Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update corporation #75

Merged
merged 2 commits into from
Apr 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exemptLabels:
- Type: Feature
- Type: Enhancement
- Type: Bug
- NHN
- NHN Cloud

# Label to use when marking as stale
staleLabel: inactive
Expand All @@ -23,4 +23,4 @@ markComment: >
This issue has been automatically marked as inactive because there hasn’t been much going on it lately.
It is going to be closed after 7 days. Thanks!
# Comment to post when closing a stale Issue or Pull Request.
closeComment: >
closeComment: >
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) 2019 NHN Corp.
Copyright (c) 2019 NHN Cloud Corp.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![npm](https://img.shields.io/npm/v/tui-time-picker.svg)](https://www.npmjs.com/package/tui-time-picker)
[![GitHub license](https://img.shields.io/github/license/nhn/tui.time-picker.svg)](https://github.com/nhn/tui.time-picker/blob/production/LICENSE)
[![PRs welcome](https://img.shields.io/badge/PRs-welcome-ff69b4.svg)](https://github.com/nhn/tui.project-name/labels/help%20wanted)
[![code with hearth by NHN](https://img.shields.io/badge/%3C%2F%3E%20with%20%E2%99%A5%20by-NHN-ff1414.svg)](https://github.com/nhn)
[![code with hearth by NHN Cloud](https://img.shields.io/badge/%3C%2F%3E%20with%20%E2%99%A5%20by-NHN_Cloud-ff1414.svg)](https://github.com/nhn)


<p><a href="https://nhn.github.io/tui.time-picker/latest/"><img src="https://user-images.githubusercontent.com/8615506/64507615-27ae8200-d316-11e9-85a0-8f384d74cc02.gif" /></a></p>
Expand Down Expand Up @@ -246,7 +246,7 @@ For more information on PR's step, please see links of Contributing section.
## 🍞 TOAST UI Family

* [TOAST UI Editor](https://github.com/nhn/tui.editor)
* [TOAST UI Calendar](https://github.com/nhn/tui.calendar)
* [TOAST UI Calendar](https://github.com/nhn/tui.calendar)
* [TOAST UI Chart](https://github.com/nhn/tui.chart)
* [TOAST UI Image-Editor](https://github.com/nhn/tui.image-editor)
* [TOAST UI Grid](https://github.com/nhn/tui.grid)
Expand All @@ -255,4 +255,4 @@ For more information on PR's step, please see links of Contributing section.

## 📜 License

This software is licensed under the [MIT](https://github.com/nhn/tui.time-picker/blob/production/LICENSE) © [NHN](https://github.com/nhn).
This software is licensed under the [MIT](https://github.com/nhn/tui.time-picker/blob/production/LICENSE) © [NHN Cloud](https://github.com/nhn).
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tui-time-picker",
"authors": [
"NHN. FE Development Lab <dl_javascript@nhn.com>"
"NHN Cloud. FE Development Lab <dl_javascript@nhn.com>"
],
"main": [
"dist/tui-time-picker.js",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
},
"keywords": [
"nhn",
"nhn cloud",
"tui",
"component",
"time-picker",
"tui-time-picker"
],
"author": "NHN FE Development Lab <dl_javascript@nhn.com>",
"author": "NHN Cloud. FE Development Lab <dl_javascript@nhn.com>",
"license": "MIT",
"devDependencies": {
"@toast-ui/release-notes": "^2.0.1",
Expand Down
5 changes: 0 additions & 5 deletions src/js/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* @fileoverview The entry file of TimePicker components
* @author NHN. FE Development Lab <dl_javascript@nhn.com>
*/

'use strict';

require('../css/timepicker.css');
Expand Down
5 changes: 0 additions & 5 deletions src/js/localeTexts.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* @fileoverview Default locale texts
* @author NHN. FE Development Lab <dl_javascript@nhn.com>
*/

'use strict';

module.exports = {
Expand Down
81 changes: 29 additions & 52 deletions src/js/timepicker/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* @fileoverview TimePicker component
* @author NHN. FE Development Lab <dl_javascript@nhn.com>
*/

'use strict';

var inArray = require('tui-code-snippet/array/inArray');
Expand Down Expand Up @@ -87,14 +82,14 @@ var mergeDefaultOptions = function(options) {
* @param {Boolean} [options.usageStatistics=true|false] send hostname to google analytics [default value is true]
* @example
* // ES6
* import TimePicker from 'tui-time-picker';
*
* import TimePicker from 'tui-time-picker';
*
* // CommonJS
* const TimePicker = require('tui-time-picker');
*
* const TimePicker = require('tui-time-picker');
*
* // Browser
* const TimePicker = tui.TimePicker;
*
*
* const timepicker = new TimePicker('#timepicker-container', {
* initialHour: 15,
* initialMinute: 13,
Expand Down Expand Up @@ -135,9 +130,7 @@ var TimePicker = defineClass(
* @type {HTMLElement}
* @private
*/
this.container = isHTMLNode(container)
? container
: document.querySelector(container);
this.container = isHTMLNode(container) ? container : document.querySelector(container);

/**
* @type {HTMLElement}
Expand Down Expand Up @@ -263,12 +256,7 @@ var TimePicker = defineClass(

if (this.showMeridiem) {
if (this.inputType === INPUT_TYPE_SELECTBOX) {
on(
this.meridiemElement.querySelector('select'),
'change',
this.onChangeMeridiem,
this
);
on(this.meridiemElement.querySelector('select'), 'change', this.onChangeMeridiem, this);
} else if (this.inputType === INPUT_TYPE_SPINBOX) {
on(this.meridiemElement, 'click', this.onChangeMeridiem, this);
}
Expand All @@ -287,12 +275,7 @@ var TimePicker = defineClass(

if (this.showMeridiem) {
if (this.inputType === INPUT_TYPE_SELECTBOX) {
off(
this.meridiemElement.querySelector('select'),
'change',
this.onChangeMeridiem,
this
);
off(this.meridiemElement.querySelector('select'), 'change', this.onChangeMeridiem, this);
} else if (this.inputType === INPUT_TYPE_SPINBOX) {
off(this.meridiemElement, 'click', this.onChangeMeridiem, this);
}
Expand Down Expand Up @@ -570,10 +553,7 @@ var TimePicker = defineClass(
hour = util.getMeridiemHour(hour);
}

return (
inArray(hour, this.getHourItems()) > -1 &&
inArray(minute, this.getMinuteItems()) > -1
);
return inArray(hour, this.getHourItems()) > -1 && inArray(minute, this.getMinuteItems()) > -1;
},

/**
Expand Down Expand Up @@ -678,7 +658,7 @@ var TimePicker = defineClass(
},

/**
* Set selectable range
* Set selectable range
* @param {Object} begin - Contain begin hour and minute of range
* @param {number} begin.hour - begin hour of range
* @param {number} begin.minute - begin minute of range
Expand Down Expand Up @@ -749,15 +729,21 @@ var TimePicker = defineClass(
});

if (beginHour === endHour) {
this.disabledMinutes[beginHour] = util.getDisabledMinuteArr(disabledMinRanges, this.minuteStep).slice();
this.disabledMinutes[beginHour] = util
.getDisabledMinuteArr(disabledMinRanges, this.minuteStep)
.slice();

return;
}

this.disabledMinutes[endHour] = util.getDisabledMinuteArr([disabledMinRanges[1]], this.minuteStep).slice();
this.disabledMinutes[endHour] = util
.getDisabledMinuteArr([disabledMinRanges[1]], this.minuteStep)
.slice();
}

this.disabledMinutes[beginHour] = util.getDisabledMinuteArr([disabledMinRanges[0]], this.minuteStep).slice();
this.disabledMinutes[beginHour] = util
.getDisabledMinuteArr([disabledMinRanges[0]], this.minuteStep)
.slice();
},

/**
Expand Down Expand Up @@ -803,7 +789,7 @@ var TimePicker = defineClass(
},

/**
* Whether the given range a valid range
* Whether the given range a valid range
* @param {Object} begin - Contain begin hour and minute of range
* @param {number} begin.hour - begin hour of range
* @param {number} begin.minute - begin minute of range
Expand Down Expand Up @@ -833,21 +819,23 @@ var TimePicker = defineClass(
},

/**
* Whether the given time a valid time
* Whether the given time a valid time
* @param {number} hour - hour for validation
* @param {number} minute - minute for validation
* @returns {boolean} result of time validation
* @private
*/
isValidTime: function(hour, minute) {
return hour >= START_NUMBER_OF_TIME &&
hour <= END_NUMBER_OF_HOUR &&
minute >= START_NUMBER_OF_TIME &&
minute <= END_NUMBER_OF_MINUTE;
return (
hour >= START_NUMBER_OF_TIME &&
hour <= END_NUMBER_OF_HOUR &&
minute >= START_NUMBER_OF_TIME &&
minute <= END_NUMBER_OF_MINUTE
);
},

/**
* Compare given time with set time
* Compare given time with set time
* @param {number} hour - given hour
* @param {number} minute - given minute
* @returns {boolean} result of compare
Expand Down Expand Up @@ -914,18 +902,7 @@ var TimePicker = defineClass(
this.removeEvents();
removeElement(this.element);

this.container
= this.showMeridiem
= this.hourInput
= this.minuteInput
= this.hour
= this.minute
= this.inputType
= this.element
= this.meridiemElement
= this.amEl
= this.pmEl
= null;
this.container = this.showMeridiem = this.hourInput = this.minuteInput = this.hour = this.minute = this.inputType = this.element = this.meridiemElement = this.amEl = this.pmEl = null;
}
}
);
Expand Down
9 changes: 1 addition & 8 deletions src/js/timepicker/selectbox.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* @fileoverview Selectbox (in TimePicker)
* @author NHN. FE Development Lab <dl_javascript@nhn.com>
*/

'use strict';

var inArray = require('tui-code-snippet/array/inArray');
Expand Down Expand Up @@ -41,9 +36,7 @@ var Selectbox = defineClass(
* @type {HTMLElement}
* @private
*/
this._container = isHTMLNode(container)
? container
: document.querySelector(container);
this._container = isHTMLNode(container) ? container : document.querySelector(container);

/**
* Selectbox items
Expand Down
9 changes: 1 addition & 8 deletions src/js/timepicker/spinbox.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* @fileoverview Spinbox (in TimePicker)
* @author NHN. FE Development Lab <dl_javascript@nhn.com>
*/

'use strict';

var inArray = require('tui-code-snippet/array/inArray');
Expand Down Expand Up @@ -44,9 +39,7 @@ var Spinbox = defineClass(
* @type {HTMLElement}
* @private
*/
this._container = isHTMLNode(container)
? container
: document.querySelector(container);
this._container = isHTMLNode(container) ? container : document.querySelector(container);

/**
* Spinbox element
Expand Down
15 changes: 4 additions & 11 deletions src/js/util.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* @fileoverview Utils for Timepicker component
* @author NHN. FE dev Lab. <dl_javascript@nhn.com>
*/

'use strict';

var inArray = require('tui-code-snippet/array/inArray');
Expand All @@ -29,18 +24,15 @@ var utils = {

/**
* Convert a value to meet the format
* @param {number|string} value
* @param {number|string} value
* @param {string} format - ex) hh, h, mm, m
* @returns {string}
*/
formatTime: function(value, format) {
var PADDING_ZERO_TYPES = ['hh', 'mm'];
value = String(value);

return inArray(format, PADDING_ZERO_TYPES) >= 0
&& value.length === 1
? '0' + value
: value;
return inArray(format, PADDING_ZERO_TYPES) >= 0 && value.length === 1 ? '0' + value : value;
},

/**
Expand Down Expand Up @@ -112,7 +104,8 @@ var utils = {
* Get a target element
* @param {Event} ev Event object
* @returns {HTMLElement} An event target element
*/
*/

getTarget: function(ev) {
return ev.target || ev.srcElement;
},
Expand Down
4 changes: 0 additions & 4 deletions test/timepicker/selectbox.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/**
* @fileoverview Selectbox spec
* @author NHN. FE Development Lab <dl_javascript@nhn.com>
*/
'use strict';

var Selectbox = require('../../src/js/timepicker/selectbox');
Expand Down
4 changes: 0 additions & 4 deletions test/timepicker/spinbox.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/**
* @fileoverview Spinbox spec
* @author NHN. FE Development Lab <dl_javascript@nhn.com>
*/
'use strict';

var Spinbox = require('../../src/js/timepicker/spinbox');
Expand Down
Loading