gnui 1.2.14 → 1.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/js/gnui.esm.js +43 -7
  2. package/dist/js/gnui.js +43 -7
  3. package/dist/js/gnui.min.js +2 -2
  4. package/dist/styles/default.css +21694 -1
  5. package/dist/styles/gpi.css +21725 -1
  6. package/dist/styles/green24.css +22450 -1
  7. package/dist/styles/insights.css +21716 -1
  8. package/dist/styles/nac.css +21733 -1
  9. package/dist/styles/ztnac.css +22451 -1
  10. package/package.json +2 -2
  11. package/styleguide/assets/js/gnui.js +43 -7
  12. package/styleguide/assets/js/gnui.min.js +2 -2
  13. package/styleguide/assets/styles/default.css +21694 -1
  14. package/styleguide/assets/styles/gpi.css +21725 -1
  15. package/styleguide/assets/styles/green24.css +22450 -1
  16. package/styleguide/assets/styles/insights.css +21716 -1
  17. package/styleguide/assets/styles/nac.css +21733 -1
  18. package/styleguide/assets/styles/ztnac.css +22451 -1
  19. package/styleguide/category/COLOR/index.html +1 -1
  20. package/styleguide/category/COMPONENT/Alert(js)/index.html +1 -1
  21. package/styleguide/category/COMPONENT/Bignumber/index.html +1 -1
  22. package/styleguide/category/COMPONENT/Breadcrumb/index.html +1 -1
  23. package/styleguide/category/COMPONENT/Calendar(js)/index.html +1 -1
  24. package/styleguide/category/COMPONENT/Card/index.html +1 -1
  25. package/styleguide/category/COMPONENT/Chart(js)/index.html +1 -1
  26. package/styleguide/category/COMPONENT/Datagrid(js)/index.html +1 -1
  27. package/styleguide/category/COMPONENT/Datalist(js)/index.html +1 -1
  28. package/styleguide/category/COMPONENT/Growl(js)/index.html +1 -1
  29. package/styleguide/category/COMPONENT/JsonView(js)/index.html +1 -1
  30. package/styleguide/category/COMPONENT/Loader(js)/index.html +1 -1
  31. package/styleguide/category/COMPONENT/MenuButton(js)/index.html +1 -1
  32. package/styleguide/category/COMPONENT/Message(js)/index.html +1 -1
  33. package/styleguide/category/COMPONENT/Modal(js)/index.html +3 -3
  34. package/styleguide/category/COMPONENT/Pagination(js)/index.html +1 -1
  35. package/styleguide/category/COMPONENT/Panel/index.html +1 -1
  36. package/styleguide/category/COMPONENT/Progressbar(js)/index.html +1 -1
  37. package/styleguide/category/COMPONENT/Tab(js)/index.html +1 -1
  38. package/styleguide/category/COMPONENT/Tagcloud(js)/index.html +1 -1
  39. package/styleguide/category/COMPONENT/Tooltip(js)/index.html +1 -1
  40. package/styleguide/category/COMPONENT/Tree(js)/index.html +1 -1
  41. package/styleguide/category/CONTROLS/Button(js)/index.html +1 -1
  42. package/styleguide/category/CONTROLS/Checkbox/index.html +1 -1
  43. package/styleguide/category/CONTROLS/Colorpicker(js)/index.html +1 -1
  44. package/styleguide/category/CONTROLS/Datepicker(js)/index.html +7 -1
  45. package/styleguide/category/CONTROLS/Dropdown(js)/index.html +1 -1
  46. package/styleguide/category/CONTROLS/File/index.html +1 -1
  47. package/styleguide/category/CONTROLS/Form/Control/index.html +1 -1
  48. package/styleguide/category/CONTROLS/Form/Field/index.html +1 -1
  49. package/styleguide/category/CONTROLS/Form/Plain/index.html +1 -1
  50. package/styleguide/category/CONTROLS/Input/index.html +1 -1
  51. package/styleguide/category/CONTROLS/MultiText(js)/index.html +1 -1
  52. package/styleguide/category/CONTROLS/Picklist(js)/index.html +1 -1
  53. package/styleguide/category/CONTROLS/Radio/index.html +1 -1
  54. package/styleguide/category/CONTROLS/Select/index.html +1 -1
  55. package/styleguide/category/CONTROLS/SelectButton(js)/index.html +1 -1
  56. package/styleguide/category/CONTROLS/Slider/index.html +1 -1
  57. package/styleguide/category/CONTROLS/Switch(js)/index.html +1 -1
  58. package/styleguide/category/CONTROLS/SyntaxInput(js)/index.html +1 -1
  59. package/styleguide/category/CONTROLS/Textarea/index.html +1 -1
  60. package/styleguide/category/CONTROLS/Time(js)/index.html +1 -1
  61. package/styleguide/category/ELEMENTS/Box/index.html +1 -1
  62. package/styleguide/category/ELEMENTS/Icon/index.html +1 -1
  63. package/styleguide/category/ELEMENTS/Image/index.html +1 -1
  64. package/styleguide/category/ELEMENTS/List/index.html +1 -1
  65. package/styleguide/category/ELEMENTS/Table/index.html +1 -1
  66. package/styleguide/category/ELEMENTS/Tag/index.html +1 -1
  67. package/styleguide/category/ELEMENTS/Title/index.html +1 -1
  68. package/styleguide/category/LAYOUT/Container/index.html +1 -1
  69. package/styleguide/category/LAYOUT/Grid/index.html +1 -1
  70. package/styleguide/category/LAYOUT/Splitter(js)/index.html +1 -1
  71. package/styleguide/category/UTILITY/index.html +1 -1
  72. package/styleguide/category/Utils/index.html +1 -1
  73. package/styleguide/color.html +1 -1
  74. package/styleguide/index.html +1 -1
  75. package/styleguide/tag/javascript/index.html +9 -3
  76. package/styleguide/tag/v.0.1.0/index.html +9 -3
@@ -16959,7 +16959,7 @@ class GNUIState {
16959
16959
  // 최초 생성 후 state에 등록 - created
16960
16960
  _addComponent(component) {
16961
16961
  const uid = component._uid;
16962
- if (uid && !this._componentMap[uid]) {
16962
+ if (uid) {
16963
16963
  this._componentMap[uid] = {
16964
16964
  component: component,
16965
16965
  selector: component.$selector,
@@ -33673,7 +33673,7 @@ class Time extends GNCoreInstance {
33673
33673
  this.$init(this, options);
33674
33674
  }
33675
33675
  template(config) {
33676
- return (createElement$1("div", { className: 'gn-time' + (config.disabled ? ' is-disabled' : '') + (config.readonly ? ' is-readonly' : ''), id: this._uid },
33676
+ return (createElement$1("div", { className: 'gn-time' + (config.disabled ? ' is-disabled' : '') + (config.readonly ? ' is-readonly' : '') + (config.timeFormat === 'hh:mm' ? ' is-hm' : ''), id: this._uid },
33677
33677
  createElement$1("div", { className: "picker-controls picker-times" },
33678
33678
  createElement$1("span", { className: "gn-icon" },
33679
33679
  createElement$1("i", { className: "fa fa-clock" })),
@@ -33929,7 +33929,7 @@ class Calendar extends GNCoreInstance {
33929
33929
  this.$init(this, options);
33930
33930
  }
33931
33931
  template(config) {
33932
- return (createElement$1("div", { className: 'gn-calendar' + (config.type === 'picker' ? ' is-picker' : ''), id: this._uid },
33932
+ return (createElement$1("div", { className: 'gn-calendar' + (config.type === 'picker' ? ' is-picker' : '') + (config.timeFormat === 'hh:mm' ? ' is-hm' : ''), id: this._uid },
33933
33933
  createElement$1("div", { className: "picker-controls" },
33934
33934
  createElement$1("div", { className: "control-set gn-control is-small has-arrange" },
33935
33935
  createElement$1("button", { className: "btn-year-decrease" }),
@@ -34011,7 +34011,8 @@ class Calendar extends GNCoreInstance {
34011
34011
  }
34012
34012
  });
34013
34013
  this._time = new Time('time', find('.timePicker', this.$el), {
34014
- value: this.$options.value ? dateFormat(this.$options.value, 'hh:mm:ss') : '',
34014
+ value: this.$options.value ? dateFormat(this.$options.value, this.$options.timeFormat) : '',
34015
+ timeFormat: this.$options.timeFormat,
34015
34016
  onChange: (time) => {
34016
34017
  this._hidden.timeChange(time);
34017
34018
  }
@@ -34557,6 +34558,7 @@ class Colorpicker extends GNCoreInstance {
34557
34558
  }
34558
34559
  if (!this.$options.palette) {
34559
34560
  this.$options.palette = this.pickPanel;
34561
+ attr(this.$el, 'data-gnui', this.$options.palette._uid);
34560
34562
  }
34561
34563
  if (!isHexPattern(this.$options.value)) {
34562
34564
  this.$options.value = DEFAULT_COLOR;
@@ -34579,6 +34581,7 @@ class Colorpicker extends GNCoreInstance {
34579
34581
  this.$options.color = '';
34580
34582
  css$1(this.$options.delegates.preview, 'background', NONE_COLOR);
34581
34583
  val(this.$options.delegates.value, '');
34584
+ trigger(this.$options.delegates.value, 'change');
34582
34585
  this.$event(this, 'onChange', '');
34583
34586
  },
34584
34587
  typeColor: (e) => {
@@ -34707,6 +34710,7 @@ class Datepicker extends GNCoreInstance {
34707
34710
  id: this._uid + '_picker',
34708
34711
  value: defaultDataTime,
34709
34712
  dateType: this.$options.type,
34713
+ timeFormat: this.$options.timeFormat,
34710
34714
  min: this.$options.min || null,
34711
34715
  max: this.$options.max || null,
34712
34716
  onSelect: (date) => {
@@ -34717,6 +34721,7 @@ class Datepicker extends GNCoreInstance {
34717
34721
  });
34718
34722
  }
34719
34723
  this.$options.picker = this.pickPanel;
34724
+ attr(this.$el, 'data-gnui', this.$options.picker._uid);
34720
34725
  // 해당 컴포넌트 외 클릭 시 picker panel 숨김
34721
34726
  this.$options._destroy = on(document.body, 'click', (e) => {
34722
34727
  if (!parents(e.target, '#' + this.$options.picker._uid).length && !parents(e.target, '.gn-dateinput').length && hasClass(this.pickPanel.$el, 'is-active')) {
@@ -34764,6 +34769,7 @@ class Datepicker extends GNCoreInstance {
34764
34769
  removeDate: () => {
34765
34770
  this.$options.value = '';
34766
34771
  val(this.$options.delegates.date, '');
34772
+ trigger(this.$options.delegates.date, 'change');
34767
34773
  this.$event(this, 'onChange', '');
34768
34774
  },
34769
34775
  disable: () => {
@@ -34791,7 +34797,7 @@ class Datepicker extends GNCoreInstance {
34791
34797
  type: 'date',
34792
34798
  value: this.$selector ? this.$selector.value : '',
34793
34799
  dateFormat: 'yyyy-MM-DD',
34794
- timeFormat: 'hh:mm:ss',
34800
+ timeFormat: 'hh:mm',
34795
34801
  width: '165px',
34796
34802
  writable: true
34797
34803
  };
@@ -38192,10 +38198,10 @@ class Modal extends GNCoreInstance {
38192
38198
  const styles = {};
38193
38199
  const contStyles = {};
38194
38200
  if (config.width) {
38195
- styles.width = getUnit('width', config.width);
38201
+ styles.width = this.parseModalSize(config.width, window.innerWidth);
38196
38202
  }
38197
38203
  if (config.height) {
38198
- styles.height = getUnit('height', config.height);
38204
+ styles.height = this.parseModalSize(config.height, window.innerHeight);
38199
38205
  }
38200
38206
  if (config.padding) {
38201
38207
  contStyles.padding = getUnit('padding', config.padding);
@@ -38219,6 +38225,36 @@ class Modal extends GNCoreInstance {
38219
38225
  config.hasConfirm && (createElement$1("button", { type: "button", className: 'gn-button' + ` is-${config.sizeSets.confirm}`, id: this._uid + '_confirm', "on-click": this._hidden.confirm }, config.textSets.confirm)),
38220
38226
  config.hasCancel && (createElement$1("button", { type: "button", className: 'gn-button btnCloseModal is-cancel' + ` is-${config.sizeSets.cancel}`, id: this._uid + '_cancel', "on-click": this._hidden.close }, config.textSets.cancel)))))));
38221
38227
  }
38228
+ parseModalSize(value, windowValue) {
38229
+ if (value === 'auto') {
38230
+ return 'auto';
38231
+ }
38232
+ try {
38233
+ if (typeof value === 'number') {
38234
+ return `${value > windowValue ? windowValue - 100 : value}px`;
38235
+ }
38236
+ else {
38237
+ const number = parseFloat(value);
38238
+ const unit = value.replace(number.toString(), '');
38239
+ switch (unit) {
38240
+ case '%':
38241
+ return `${number}%`;
38242
+ case 'px':
38243
+ return `${number > windowValue ? windowValue - 100 : number}px`;
38244
+ case 'vw':
38245
+ return `${number > 100 ? 90 : number}vw`;
38246
+ case 'vh':
38247
+ return `${number > 100 ? 90 : number}vh`;
38248
+ default:
38249
+ return 'auto';
38250
+ }
38251
+ }
38252
+ }
38253
+ catch (e) {
38254
+ console.error(e.message);
38255
+ return 'auto';
38256
+ }
38257
+ }
38222
38258
  $render(config) {
38223
38259
  if (config.contents) {
38224
38260
  if (config.contents.sel !== undefined) {
package/dist/js/gnui.js CHANGED
@@ -16965,7 +16965,7 @@
16965
16965
  // 최초 생성 후 state에 등록 - created
16966
16966
  _addComponent(component) {
16967
16967
  const uid = component._uid;
16968
- if (uid && !this._componentMap[uid]) {
16968
+ if (uid) {
16969
16969
  this._componentMap[uid] = {
16970
16970
  component: component,
16971
16971
  selector: component.$selector,
@@ -33679,7 +33679,7 @@
33679
33679
  this.$init(this, options);
33680
33680
  }
33681
33681
  template(config) {
33682
- return (createElement$1("div", { className: 'gn-time' + (config.disabled ? ' is-disabled' : '') + (config.readonly ? ' is-readonly' : ''), id: this._uid },
33682
+ return (createElement$1("div", { className: 'gn-time' + (config.disabled ? ' is-disabled' : '') + (config.readonly ? ' is-readonly' : '') + (config.timeFormat === 'hh:mm' ? ' is-hm' : ''), id: this._uid },
33683
33683
  createElement$1("div", { className: "picker-controls picker-times" },
33684
33684
  createElement$1("span", { className: "gn-icon" },
33685
33685
  createElement$1("i", { className: "fa fa-clock" })),
@@ -33935,7 +33935,7 @@
33935
33935
  this.$init(this, options);
33936
33936
  }
33937
33937
  template(config) {
33938
- return (createElement$1("div", { className: 'gn-calendar' + (config.type === 'picker' ? ' is-picker' : ''), id: this._uid },
33938
+ return (createElement$1("div", { className: 'gn-calendar' + (config.type === 'picker' ? ' is-picker' : '') + (config.timeFormat === 'hh:mm' ? ' is-hm' : ''), id: this._uid },
33939
33939
  createElement$1("div", { className: "picker-controls" },
33940
33940
  createElement$1("div", { className: "control-set gn-control is-small has-arrange" },
33941
33941
  createElement$1("button", { className: "btn-year-decrease" }),
@@ -34017,7 +34017,8 @@
34017
34017
  }
34018
34018
  });
34019
34019
  this._time = new Time('time', find('.timePicker', this.$el), {
34020
- value: this.$options.value ? dateFormat(this.$options.value, 'hh:mm:ss') : '',
34020
+ value: this.$options.value ? dateFormat(this.$options.value, this.$options.timeFormat) : '',
34021
+ timeFormat: this.$options.timeFormat,
34021
34022
  onChange: (time) => {
34022
34023
  this._hidden.timeChange(time);
34023
34024
  }
@@ -34563,6 +34564,7 @@
34563
34564
  }
34564
34565
  if (!this.$options.palette) {
34565
34566
  this.$options.palette = this.pickPanel;
34567
+ attr(this.$el, 'data-gnui', this.$options.palette._uid);
34566
34568
  }
34567
34569
  if (!isHexPattern(this.$options.value)) {
34568
34570
  this.$options.value = DEFAULT_COLOR;
@@ -34585,6 +34587,7 @@
34585
34587
  this.$options.color = '';
34586
34588
  css$1(this.$options.delegates.preview, 'background', NONE_COLOR);
34587
34589
  val(this.$options.delegates.value, '');
34590
+ trigger(this.$options.delegates.value, 'change');
34588
34591
  this.$event(this, 'onChange', '');
34589
34592
  },
34590
34593
  typeColor: (e) => {
@@ -34713,6 +34716,7 @@
34713
34716
  id: this._uid + '_picker',
34714
34717
  value: defaultDataTime,
34715
34718
  dateType: this.$options.type,
34719
+ timeFormat: this.$options.timeFormat,
34716
34720
  min: this.$options.min || null,
34717
34721
  max: this.$options.max || null,
34718
34722
  onSelect: (date) => {
@@ -34723,6 +34727,7 @@
34723
34727
  });
34724
34728
  }
34725
34729
  this.$options.picker = this.pickPanel;
34730
+ attr(this.$el, 'data-gnui', this.$options.picker._uid);
34726
34731
  // 해당 컴포넌트 외 클릭 시 picker panel 숨김
34727
34732
  this.$options._destroy = on(document.body, 'click', (e) => {
34728
34733
  if (!parents(e.target, '#' + this.$options.picker._uid).length && !parents(e.target, '.gn-dateinput').length && hasClass(this.pickPanel.$el, 'is-active')) {
@@ -34770,6 +34775,7 @@
34770
34775
  removeDate: () => {
34771
34776
  this.$options.value = '';
34772
34777
  val(this.$options.delegates.date, '');
34778
+ trigger(this.$options.delegates.date, 'change');
34773
34779
  this.$event(this, 'onChange', '');
34774
34780
  },
34775
34781
  disable: () => {
@@ -34797,7 +34803,7 @@
34797
34803
  type: 'date',
34798
34804
  value: this.$selector ? this.$selector.value : '',
34799
34805
  dateFormat: 'yyyy-MM-DD',
34800
- timeFormat: 'hh:mm:ss',
34806
+ timeFormat: 'hh:mm',
34801
34807
  width: '165px',
34802
34808
  writable: true
34803
34809
  };
@@ -38198,10 +38204,10 @@
38198
38204
  const styles = {};
38199
38205
  const contStyles = {};
38200
38206
  if (config.width) {
38201
- styles.width = getUnit('width', config.width);
38207
+ styles.width = this.parseModalSize(config.width, window.innerWidth);
38202
38208
  }
38203
38209
  if (config.height) {
38204
- styles.height = getUnit('height', config.height);
38210
+ styles.height = this.parseModalSize(config.height, window.innerHeight);
38205
38211
  }
38206
38212
  if (config.padding) {
38207
38213
  contStyles.padding = getUnit('padding', config.padding);
@@ -38225,6 +38231,36 @@
38225
38231
  config.hasConfirm && (createElement$1("button", { type: "button", className: 'gn-button' + ` is-${config.sizeSets.confirm}`, id: this._uid + '_confirm', "on-click": this._hidden.confirm }, config.textSets.confirm)),
38226
38232
  config.hasCancel && (createElement$1("button", { type: "button", className: 'gn-button btnCloseModal is-cancel' + ` is-${config.sizeSets.cancel}`, id: this._uid + '_cancel', "on-click": this._hidden.close }, config.textSets.cancel)))))));
38227
38233
  }
38234
+ parseModalSize(value, windowValue) {
38235
+ if (value === 'auto') {
38236
+ return 'auto';
38237
+ }
38238
+ try {
38239
+ if (typeof value === 'number') {
38240
+ return `${value > windowValue ? windowValue - 100 : value}px`;
38241
+ }
38242
+ else {
38243
+ const number = parseFloat(value);
38244
+ const unit = value.replace(number.toString(), '');
38245
+ switch (unit) {
38246
+ case '%':
38247
+ return `${number}%`;
38248
+ case 'px':
38249
+ return `${number > windowValue ? windowValue - 100 : number}px`;
38250
+ case 'vw':
38251
+ return `${number > 100 ? 90 : number}vw`;
38252
+ case 'vh':
38253
+ return `${number > 100 ? 90 : number}vh`;
38254
+ default:
38255
+ return 'auto';
38256
+ }
38257
+ }
38258
+ }
38259
+ catch (e) {
38260
+ console.error(e.message);
38261
+ return 'auto';
38262
+ }
38263
+ }
38228
38264
  $render(config) {
38229
38265
  if (config.contents) {
38230
38266
  if (config.contents.sel !== undefined) {