bromcom-ui 2.3.57 → 2.3.58

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 (156) hide show
  1. package/dist/bromcom-ui/bromcom-ui.css +0 -0
  2. package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
  3. package/dist/bromcom-ui/index.esm.js +0 -0
  4. package/dist/bromcom-ui/{p-7b469915.entry.js → p-13d038f5.entry.js} +1 -1
  5. package/dist/bromcom-ui/p-1429a2b4.js +1 -0
  6. package/dist/bromcom-ui/{p-e02ea2a4.entry.js → p-20d03fa1.entry.js} +1 -1
  7. package/dist/bromcom-ui/p-37750343.entry.js +1 -0
  8. package/dist/bromcom-ui/{p-9bfd984c.entry.js → p-3f797656.entry.js} +1 -1
  9. package/dist/bromcom-ui/p-4a41ef80.entry.js +1 -0
  10. package/dist/bromcom-ui/p-53e9b679.entry.js +1 -0
  11. package/dist/bromcom-ui/p-8851e01e.entry.js +1 -0
  12. package/dist/bromcom-ui/p-9ffff762.entry.js +1 -0
  13. package/dist/bromcom-ui/p-af7e4741.entry.js +1 -0
  14. package/dist/bromcom-ui/{p-0d336381.entry.js → p-afb68492.entry.js} +1 -1
  15. package/dist/bromcom-ui/p-bbf99620.entry.js +1 -0
  16. package/dist/bromcom-ui/{p-b52eb625.entry.js → p-e21a8f2d.entry.js} +1 -1
  17. package/dist/bromcom-ui/p-e450ebda.entry.js +1 -0
  18. package/dist/bromcom-ui/p-f067821e.entry.js +1 -0
  19. package/dist/cjs/bcm-alert.cjs.entry.js +7 -26
  20. package/dist/cjs/{bcm-button_5.cjs.entry.js → bcm-button_11.cjs.entry.js} +1206 -2
  21. package/dist/cjs/{bcm-checkbox-lite_3.cjs.entry.js → bcm-checkbox-lite_4.cjs.entry.js} +64 -0
  22. package/dist/cjs/bcm-colorpicker.cjs.entry.js +1 -1
  23. package/dist/cjs/{bcm-datetime-picker_2.cjs.entry.js → bcm-datetime-picker.cjs.entry.js} +1 -135
  24. package/dist/cjs/bcm-list-select.cjs.entry.js +21 -6
  25. package/dist/cjs/bcm-list.cjs.entry.js +41 -4
  26. package/dist/cjs/{bcm-empty_6.cjs.entry.js → bcm-listbox_5.cjs.entry.js} +8 -75
  27. package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +1 -1
  28. package/dist/cjs/bcm-popconfirm.cjs.entry.js +1 -1
  29. package/dist/cjs/bcm-popover-box.cjs.entry.js +1 -1
  30. package/dist/cjs/bcm-popover.cjs.entry.js +1 -1
  31. package/dist/cjs/bcm-radio-group.cjs.entry.js +1 -1
  32. package/dist/cjs/bcm-select.cjs.entry.js +1 -1
  33. package/dist/cjs/bromcom-ui.cjs.js +1 -1
  34. package/dist/cjs/loader.cjs.js +1 -1
  35. package/dist/cjs/types-37c8ced6.js +16 -0
  36. package/dist/collection/collection-manifest.json +1 -0
  37. package/dist/collection/components/atoms/label/label.css +70 -0
  38. package/dist/collection/components/atoms/label/label.js +203 -0
  39. package/dist/collection/components/molecules/checkbox/group.js +19 -6
  40. package/dist/collection/components/molecules/input/input.js +19 -6
  41. package/dist/collection/components/molecules/list/list-select.css +3 -7
  42. package/dist/collection/components/molecules/list/list-select.js +41 -12
  43. package/dist/collection/components/molecules/list/list.css +18 -0
  44. package/dist/collection/components/molecules/list/list.js +63 -11
  45. package/dist/collection/components/molecules/popconfirm/popconfirm-box.css +1 -0
  46. package/dist/collection/components/molecules/popconfirm/popconfirm.css +1 -0
  47. package/dist/collection/components/molecules/popover/popover-box.css +1 -0
  48. package/dist/collection/components/molecules/popover/popover.css +1 -0
  49. package/dist/collection/components/molecules/radio/group.js +19 -6
  50. package/dist/collection/components/molecules/select/select.js +19 -6
  51. package/dist/collection/components/molecules/switch/switch.css +0 -1
  52. package/dist/collection/components/molecules/switch/switch.js +20 -7
  53. package/dist/collection/components/molecules/textarea/textarea.js +19 -6
  54. package/dist/collection/components/molecules/tooltip/tooltip-box.css +1 -0
  55. package/dist/collection/components/molecules/tooltip/tooltip.css +1 -0
  56. package/dist/collection/components/organism/colorpicker/colorpicker.js +19 -6
  57. package/dist/collection/components/organism/listbox/listbox.js +26 -16
  58. package/dist/collection/helper/color-helper.js +33 -0
  59. package/dist/collection/helper/generate.js +47 -0
  60. package/dist/collection/helper/number-helper.js +10 -0
  61. package/dist/collection/helper/string-helper.js +21 -0
  62. package/dist/collection/helper/validators.js +21 -0
  63. package/dist/collection/models/bcm-types.js +1 -0
  64. package/dist/collection/models/bcm.js +451 -0
  65. package/dist/collection/templates/caption-template.js +22 -0
  66. package/dist/collection/templates/label-template.js +16 -0
  67. package/dist/collection/templates/slot-template.js +6 -0
  68. package/dist/esm/bcm-alert.entry.js +1 -20
  69. package/dist/esm/{bcm-button_5.entry.js → bcm-button_11.entry.js} +1202 -4
  70. package/dist/esm/{bcm-checkbox-lite_3.entry.js → bcm-checkbox-lite_4.entry.js} +65 -2
  71. package/dist/esm/bcm-colorpicker.entry.js +1 -1
  72. package/dist/esm/{bcm-datetime-picker_2.entry.js → bcm-datetime-picker.entry.js} +2 -135
  73. package/dist/esm/bcm-list-select.entry.js +21 -6
  74. package/dist/esm/bcm-list.entry.js +41 -4
  75. package/dist/esm/{bcm-empty_6.entry.js → bcm-listbox_5.entry.js} +10 -76
  76. package/dist/esm/bcm-popconfirm-box.entry.js +1 -1
  77. package/dist/esm/bcm-popconfirm.entry.js +1 -1
  78. package/dist/esm/bcm-popover-box.entry.js +1 -1
  79. package/dist/esm/bcm-popover.entry.js +1 -1
  80. package/dist/esm/bcm-radio-group.entry.js +1 -1
  81. package/dist/esm/bcm-select.entry.js +1 -1
  82. package/dist/esm/bromcom-ui.js +1 -1
  83. package/dist/esm/loader.js +1 -1
  84. package/dist/esm/polyfills/css-shim.js +0 -0
  85. package/dist/esm/types-911a8837.js +21 -0
  86. package/dist/types/assets/icons/index.d.ts +0 -0
  87. package/dist/types/assets/icons/index.example.d.ts +0 -0
  88. package/dist/types/components/atoms/avatar/avatar.d.ts +0 -0
  89. package/dist/types/components/atoms/badge/badge.d.ts +0 -0
  90. package/dist/types/components/atoms/button/button.d.ts +0 -0
  91. package/dist/types/components/atoms/divider/divider.d.ts +0 -0
  92. package/dist/types/components/atoms/icon/icon.d.ts +0 -0
  93. package/dist/types/components/atoms/icon/types.d.ts +0 -0
  94. package/dist/types/components/atoms/label/label.d.ts +16 -0
  95. package/dist/types/components/atoms/tag/tag.d.ts +0 -0
  96. package/dist/types/components/atoms/text/text.d.ts +0 -0
  97. package/dist/types/components/molecules/card/card-footer.d.ts +0 -0
  98. package/dist/types/components/molecules/card/card-header.d.ts +0 -0
  99. package/dist/types/components/molecules/card/card.d.ts +0 -0
  100. package/dist/types/components/molecules/checkbox/checkbox.d.ts +0 -0
  101. package/dist/types/components/molecules/checkbox/group.d.ts +1 -0
  102. package/dist/types/components/molecules/input/input.d.ts +1 -0
  103. package/dist/types/components/molecules/list/list-select.d.ts +6 -1
  104. package/dist/types/components/molecules/list/list.d.ts +1 -0
  105. package/dist/types/components/molecules/radio/group.d.ts +1 -0
  106. package/dist/types/components/molecules/radio/radio.d.ts +0 -0
  107. package/dist/types/components/molecules/select/group.d.ts +0 -0
  108. package/dist/types/components/molecules/select/option.d.ts +0 -0
  109. package/dist/types/components/molecules/select/select.d.ts +1 -0
  110. package/dist/types/components/molecules/switch/switch.d.ts +1 -0
  111. package/dist/types/components/molecules/textarea/textarea.d.ts +1 -0
  112. package/dist/types/components/organism/colorpicker/colorpicker.d.ts +1 -0
  113. package/dist/types/components/organism/listbox/listbox.d.ts +1 -0
  114. package/dist/types/components.d.ts +64 -3
  115. package/dist/types/global/variables/colors.d.ts +0 -0
  116. package/dist/types/helper/color-helper.d.ts +9 -0
  117. package/dist/types/helper/generate.d.ts +10 -0
  118. package/dist/types/helper/number-helper.d.ts +9 -0
  119. package/dist/types/helper/string-helper.d.ts +20 -0
  120. package/dist/types/helper/validators.d.ts +8 -0
  121. package/dist/types/index.d.ts +0 -0
  122. package/dist/types/models/bcm-types.d.ts +19 -0
  123. package/dist/types/models/bcm.d.ts +447 -0
  124. package/dist/types/stencil-public-runtime.d.ts +0 -0
  125. package/dist/types/templates/caption-template.d.ts +12 -0
  126. package/dist/types/templates/label-template.d.ts +12 -0
  127. package/dist/types/templates/slot-template.d.ts +8 -0
  128. package/dist/types/utils/utils.d.ts +0 -0
  129. package/loader/cdn.js +0 -0
  130. package/loader/index.cjs.js +0 -0
  131. package/loader/index.d.ts +0 -0
  132. package/loader/index.es2017.js +0 -0
  133. package/loader/index.js +0 -0
  134. package/loader/package.json +0 -0
  135. package/package.json +1 -1
  136. package/dist/bromcom-ui/p-013b6f5d.entry.js +0 -1
  137. package/dist/bromcom-ui/p-3a6625d7.entry.js +0 -1
  138. package/dist/bromcom-ui/p-3aef4844.entry.js +0 -1
  139. package/dist/bromcom-ui/p-5ff33d84.entry.js +0 -1
  140. package/dist/bromcom-ui/p-607bc9b3.entry.js +0 -1
  141. package/dist/bromcom-ui/p-6bd805f1.entry.js +0 -1
  142. package/dist/bromcom-ui/p-6ef403b0.entry.js +0 -1
  143. package/dist/bromcom-ui/p-865ccb94.entry.js +0 -1
  144. package/dist/bromcom-ui/p-9220ba9c.entry.js +0 -1
  145. package/dist/bromcom-ui/p-b81236b1.entry.js +0 -1
  146. package/dist/bromcom-ui/p-cdfd9ba0.entry.js +0 -1
  147. package/dist/bromcom-ui/p-cf6b0656.entry.js +0 -1
  148. package/dist/bromcom-ui/p-fc3e131c.entry.js +0 -1
  149. package/dist/cjs/bcm-checkbox-group.cjs.entry.js +0 -273
  150. package/dist/cjs/bcm-checkbox.cjs.entry.js +0 -143
  151. package/dist/cjs/bcm-switch.cjs.entry.js +0 -86
  152. package/dist/cjs/bcm-tooltip-box.cjs.entry.js +0 -36
  153. package/dist/esm/bcm-checkbox-group.entry.js +0 -269
  154. package/dist/esm/bcm-checkbox.entry.js +0 -139
  155. package/dist/esm/bcm-switch.entry.js +0 -82
  156. package/dist/esm/bcm-tooltip-box.entry.js +0 -32
@@ -121,6 +121,7 @@
121
121
  display: none;
122
122
  border: 6px solid;
123
123
  z-index: 10700;
124
+ pointer-events: none;
124
125
  }
125
126
  .popover-box.open .box, .popover-box.open::after {
126
127
  display: block;
@@ -121,6 +121,7 @@
121
121
  display: none;
122
122
  border: 6px solid;
123
123
  z-index: 10700;
124
+ pointer-events: none;
124
125
  }
125
126
  .popover.open .box, .popover.open::after {
126
127
  display: block;
@@ -99,12 +99,8 @@ export class BcmRadioGroup {
99
99
  const captionClasses = cs('size-1', 'input-caption', 'caption-' + captionType);
100
100
  if (this.radioOptions) {
101
101
  return (h(Host, { class: hostClasses },
102
- label && h("label", { class: "label size-1" },
103
- " ",
104
- label,
105
- " ",
106
- required && ('*'),
107
- " "),
102
+ label && h("div", null,
103
+ h("bcm-label", { tooltip: this.tooltip, type: captionType, value: label, required: required })),
108
104
  h("div", { class: classes },
109
105
  this.radioOptions && this.radioOptions.map(radio => (h("bcm-radio", { value: radio.value, disabled: radio.disabled, checked: radio.checked },
110
106
  " ",
@@ -419,6 +415,23 @@ export class BcmRadioGroup {
419
415
  "attribute": "caption-type",
420
416
  "reflect": false,
421
417
  "defaultValue": "'default'"
418
+ },
419
+ "tooltip": {
420
+ "type": "string",
421
+ "mutable": false,
422
+ "complexType": {
423
+ "original": "string",
424
+ "resolved": "string",
425
+ "references": {}
426
+ },
427
+ "required": false,
428
+ "optional": false,
429
+ "docs": {
430
+ "tags": [],
431
+ "text": ""
432
+ },
433
+ "attribute": "tooltip",
434
+ "reflect": false
422
435
  }
423
436
  }; }
424
437
  static get states() { return {
@@ -1084,12 +1084,8 @@ export class BcmSelect {
1084
1084
  };
1085
1085
  return (h(Host, { class: hostClasses, onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur() },
1086
1086
  h("div", { class: container },
1087
- label && h("label", { class: "label size-1", onClick: () => this.handleOpen(false) },
1088
- " ",
1089
- label,
1090
- " ",
1091
- required && ('*'),
1092
- " "),
1087
+ label && h("div", null,
1088
+ h("bcm-label", { onClick: () => this.handleOpen(false), tooltip: this.tooltip, type: captionType, value: label, required: required })),
1093
1089
  h("div", { id: "selected-container", class: selected, onClick: (e) => this.handleOpen(e), tabIndex: -1 },
1094
1090
  h("span", { class: selectedText, title: this.selectText && (this.selectText) },
1095
1091
  (this.selectText && (this.selectText)),
@@ -1772,6 +1768,23 @@ export class BcmSelect {
1772
1768
  "attribute": "placement",
1773
1769
  "reflect": true,
1774
1770
  "defaultValue": "'bottom-start'"
1771
+ },
1772
+ "tooltip": {
1773
+ "type": "string",
1774
+ "mutable": false,
1775
+ "complexType": {
1776
+ "original": "string",
1777
+ "resolved": "string",
1778
+ "references": {}
1779
+ },
1780
+ "required": false,
1781
+ "optional": false,
1782
+ "docs": {
1783
+ "tags": [],
1784
+ "text": ""
1785
+ },
1786
+ "attribute": "tooltip",
1787
+ "reflect": false
1775
1788
  }
1776
1789
  }; }
1777
1790
  static get states() { return {
@@ -57,7 +57,6 @@
57
57
  */
58
58
  :host {
59
59
  display: inline-block;
60
- width: 100%;
61
60
  margin: 0 0 8px 0;
62
61
  }
63
62
 
@@ -64,14 +64,10 @@ export class BcmSwitch {
64
64
  return (condition && size === 'medium');
65
65
  };
66
66
  const isMedium = size === 'medium';
67
- const hostClasses = cs('switch', this.hidden ? 'hidden' : null);
67
+ const hostClasses = cs('bcm-switch', this.hidden ? 'hidden' : null);
68
68
  return (h(Host, { class: hostClasses },
69
- label && h("label", { class: "label size-1" },
70
- " ",
71
- label,
72
- " ",
73
- required && ('*'),
74
- " "),
69
+ label && h("div", null,
70
+ h("bcm-label", { tooltip: this.tooltip, type: captionType, value: label, required: required })),
75
71
  h("label", { class: wrapperClass },
76
72
  isPermitted(inactiveText) && h("span", { class: "inactive-text size-1" }, inactiveText),
77
73
  h("div", { class: classes },
@@ -397,6 +393,23 @@ export class BcmSwitch {
397
393
  "attribute": "caption-type",
398
394
  "reflect": false,
399
395
  "defaultValue": "'default'"
396
+ },
397
+ "tooltip": {
398
+ "type": "string",
399
+ "mutable": false,
400
+ "complexType": {
401
+ "original": "string",
402
+ "resolved": "string",
403
+ "references": {}
404
+ },
405
+ "required": false,
406
+ "optional": false,
407
+ "docs": {
408
+ "tags": [],
409
+ "text": ""
410
+ },
411
+ "attribute": "tooltip",
412
+ "reflect": false
400
413
  }
401
414
  }; }
402
415
  static get states() { return {
@@ -113,12 +113,8 @@ export class BcmTextarea {
113
113
  const hostClasses = cs(this.hidden ? 'hidden' : null);
114
114
  return (h(Host, { class: hostClasses },
115
115
  h("div", { class: wrapperClasses },
116
- label && h("label", { class: "label size-1", htmlFor: this.textareaId },
117
- " ",
118
- label,
119
- " ",
120
- required && ('*'),
121
- " "),
116
+ label && h("div", null,
117
+ h("bcm-label", { tooltip: this.tooltip, type: captionType, value: label, required: required, htmlFor: this.textareaId })),
122
118
  h("div", { class: contanerClasses },
123
119
  h("textarea", { ref: el => (this.textarea = el), onInput: this.handleInput, onFocus: this.handleFocus, onChange: this.handleChange, onBlur: this.handleBlur, class: textareaClasses, id: this.textareaId, value: value, rows: rows, disabled: disabled, maxlength: maxLength, placeholder: placeholder }),
124
120
  clearable && (h("button", { class: "clear-button", onClick: this.handleClear },
@@ -442,6 +438,23 @@ export class BcmTextarea {
442
438
  "attribute": "required",
443
439
  "reflect": false,
444
440
  "defaultValue": "false"
441
+ },
442
+ "tooltip": {
443
+ "type": "string",
444
+ "mutable": false,
445
+ "complexType": {
446
+ "original": "string",
447
+ "resolved": "string",
448
+ "references": {}
449
+ },
450
+ "required": false,
451
+ "optional": false,
452
+ "docs": {
453
+ "tags": [],
454
+ "text": ""
455
+ },
456
+ "attribute": "tooltip",
457
+ "reflect": false
445
458
  }
446
459
  }; }
447
460
  static get states() { return {
@@ -110,6 +110,7 @@
110
110
  display: none;
111
111
  border: 6px solid;
112
112
  z-index: 10700;
113
+ pointer-events: none;
113
114
  }
114
115
  .tooltip-box.open .box, .tooltip-box.open::after {
115
116
  display: block;
@@ -110,6 +110,7 @@
110
110
  display: none;
111
111
  border: 6px solid;
112
112
  z-index: 10700;
113
+ pointer-events: none;
113
114
  }
114
115
  .tooltip.open .box, .tooltip.open::after {
115
116
  display: block;
@@ -391,12 +391,8 @@ export class BcmColorPicker {
391
391
  const captionClasses = cs('size-1', 'input-caption', 'caption-' + captionType);
392
392
  return (h(Host, null,
393
393
  h("div", { class: classes, onClick: () => this.handleClick() },
394
- label && h("label", { class: "label size-1" },
395
- " ",
396
- label,
397
- " ",
398
- required && ('*'),
399
- " "),
394
+ label && h("div", null,
395
+ h("bcm-label", { tooltip: this.tooltip, type: captionType, value: label, required: required })),
400
396
  h("div", { class: "input" },
401
397
  h("div", { class: "active-color" },
402
398
  h("div", { class: "color-thumb", style: { backgroundColor: this.value } })),
@@ -663,6 +659,23 @@ export class BcmColorPicker {
663
659
  "attribute": "required",
664
660
  "reflect": false,
665
661
  "defaultValue": "false"
662
+ },
663
+ "tooltip": {
664
+ "type": "string",
665
+ "mutable": false,
666
+ "complexType": {
667
+ "original": "string",
668
+ "resolved": "string",
669
+ "references": {}
670
+ },
671
+ "required": false,
672
+ "optional": false,
673
+ "docs": {
674
+ "tags": [],
675
+ "text": ""
676
+ },
677
+ "attribute": "tooltip",
678
+ "reflect": false
666
679
  }
667
680
  }; }
668
681
  static get states() { return {
@@ -289,6 +289,7 @@ export class BcmListbox {
289
289
  ? this.size = _config['size']
290
290
  : this.size = 'medium';
291
291
  }
292
+ this.searchSub = this.objectMapping['items'];
292
293
  if (_config['mapping']) {
293
294
  if (_config['mapping']['id']) {
294
295
  this.objectMapping['id'] = String(_config['mapping']['id']);
@@ -324,15 +325,14 @@ export class BcmListbox {
324
325
  if (_config['mapping']['selected']) {
325
326
  this.objectMapping['selected'] = _config['mapping']['selected'];
326
327
  }
327
- if (this.treeview) {
328
- if (_config['mapping']['items']) {
329
- this.objectMapping['items'] = _config['mapping']['items'];
330
- this.searchSub = this.objectMapping['items'];
331
- }
332
- }
333
- else {
328
+ if (_config['mapping']['items']) {
329
+ this.objectMapping['items'] = _config['mapping']['items'];
334
330
  this.searchSub = this.objectMapping['items'];
335
331
  }
332
+ // if ( this.treeview ) {
333
+ // }else{
334
+ // this.searchSub = this.objectMapping['items']
335
+ // }
336
336
  }
337
337
  sessionStorage.setItem(this._internal_id + "-config", JSON.stringify(_config));
338
338
  // forceUpdate(this.el)
@@ -876,16 +876,9 @@ export class BcmListbox {
876
876
  customStyles = Object.assign(Object.assign({}, customStyles), { 'height': this.height });
877
877
  }
878
878
  const captionClasses = cs('size-1', 'input-caption', 'caption-' + captionType);
879
- const labelClasses = cs('size-1', 'label', {
880
- 'error': captionType == 'error' ? true : false
881
- });
882
879
  return (h(Host, { class: hostClasses, style: customStyles, "bcm-internal-id": this._internal_id },
883
- !innerComponent && label && h("label", { class: labelClasses },
884
- " ",
885
- label,
886
- " ",
887
- required && ('*'),
888
- " "),
880
+ !innerComponent && label && h("div", null,
881
+ h("bcm-label", { tooltip: this.tooltip, type: captionType, value: label, required: required })),
889
882
  treeview === true && (h("bcm-treeview", { _internal_id: this._internal_id })),
890
883
  treeview == false && (h("div", { class: bcmListbox, style: customStyles },
891
884
  search && (h("div", { class: "search", id: "search", style: { 'display': String(showSearch) == 'false' ? 'none' : 'block' } },
@@ -1542,6 +1535,23 @@ export class BcmListbox {
1542
1535
  "attribute": "_internal_id",
1543
1536
  "reflect": true,
1544
1537
  "defaultValue": "(Math.random() * 4).toString(16).replace('.', '')"
1538
+ },
1539
+ "tooltip": {
1540
+ "type": "string",
1541
+ "mutable": false,
1542
+ "complexType": {
1543
+ "original": "string",
1544
+ "resolved": "string",
1545
+ "references": {}
1546
+ },
1547
+ "required": false,
1548
+ "optional": false,
1549
+ "docs": {
1550
+ "tags": [],
1551
+ "text": ""
1552
+ },
1553
+ "attribute": "tooltip",
1554
+ "reflect": false
1545
1555
  }
1546
1556
  }; }
1547
1557
  static get states() { return {
@@ -0,0 +1,33 @@
1
+ import { ColorPalette } from "../global/variables/colors";
2
+ import { extractColor } from "../utils/utils";
3
+ export class ColorHelper {
4
+ }
5
+ ColorHelper.isHex = (str) => /^[A-F0-9]+$/i.test(str);
6
+ ColorHelper.isRgb = (str) => /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/.test(str);
7
+ ColorHelper.isRgba = (str) => /^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/.test(str);
8
+ ColorHelper.isHsl = (str) => /^hsl\((\d{1,3}),\s*(\d{1,3}%),\s*(\d{1,3}%)\)$/.test(str);
9
+ ColorHelper.isHsla = (str) => /^hsla\((\d{1,3}),\s*(\d{1,3}%),\s*(\d{1,3}%),\s*(\d{1,3})\)$/.test(str);
10
+ ColorHelper.convertColorToHex = (color) => {
11
+ if (color) {
12
+ if (ColorHelper.isHex(color)) {
13
+ return color;
14
+ }
15
+ if (ColorHelper.isRgb(color)) {
16
+ const rgb = color.match(/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/);
17
+ return `#${(0x1000000 + (parseInt(rgb[1]) * 0x10000) + (parseInt(rgb[2]) * 0x100) + parseInt(rgb[3])).toString(16).substring(1)}`;
18
+ }
19
+ if (extractColor(ColorPalette, color)) {
20
+ return extractColor(ColorPalette, color);
21
+ }
22
+ }
23
+ };
24
+ ColorHelper.reverseColor = (color) => {
25
+ const hexColor = ColorHelper.convertColorToHex(color);
26
+ if (hexColor) {
27
+ const r = parseInt(hexColor.substring(1, 3), 16);
28
+ const g = parseInt(hexColor.substring(3, 5), 16);
29
+ const b = parseInt(hexColor.substring(5, 7), 16);
30
+ const yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000;
31
+ return (yiq >= 200) ? '#000000' : '#FFFFFF';
32
+ }
33
+ };
@@ -0,0 +1,47 @@
1
+ import { StatusProps } from "../components/molecules/alert/types";
2
+ export class Generate {
3
+ }
4
+ Generate.UID = () => Math.random().toString(36).substr(2, 9);
5
+ Generate.getIconAttrWithStatusType = (status, loading = false) => {
6
+ if (loading)
7
+ return { icon: 'loading', color: 'blue-6' };
8
+ switch (status) {
9
+ case StatusProps.info:
10
+ return { color: 'blue-6', icon: 'info-circle' };
11
+ case StatusProps.error:
12
+ return { color: 'red-6', icon: 'close-circle' };
13
+ case StatusProps.warning:
14
+ return { color: 'warmyellow-6', icon: 'exclamation-circle' };
15
+ case StatusProps.success:
16
+ return { color: 'green-6', icon: 'check-circle' };
17
+ }
18
+ };
19
+ Generate.createComponent = (element, props) => {
20
+ let box = document.createElement(element);
21
+ Object.keys(props).forEach(key => {
22
+ box[key] = props[key];
23
+ });
24
+ document.body.appendChild(box);
25
+ return box;
26
+ };
27
+ Generate.debounceInput = (func, wait, immediate) => {
28
+ let timeout;
29
+ return function () {
30
+ let context = this, args = arguments;
31
+ let later = function () {
32
+ timeout = null;
33
+ if (!immediate)
34
+ func.apply(context, args);
35
+ };
36
+ let callNow = immediate && !timeout;
37
+ clearTimeout(timeout);
38
+ timeout = setTimeout(later, wait);
39
+ if (callNow)
40
+ func.apply(context, args);
41
+ };
42
+ };
43
+ Generate.flatArray = (arr) => {
44
+ return arr.reduce((acc, val) => {
45
+ return acc.concat(Array.isArray(val) ? Generate.flatArray(val) : val);
46
+ }, []);
47
+ };
@@ -0,0 +1,10 @@
1
+ import snq from "snq";
2
+ export class NumberHelper {
3
+ }
4
+ NumberHelper.isNumber = (str) => snq(() => /^[0-9]+$/i.test(str));
5
+ NumberHelper.convertToNumber = (str) => snq(() => Number(str));
6
+ NumberHelper.replaceNumber = (str) => snq(() => str.replace(/[^0-9]/g, ''));
7
+ NumberHelper.replaceFloat = (str) => snq(() => str.replace(/[^0-9.]/g, ''));
8
+ NumberHelper.toFixed = (num, fixed) => snq(() => num.toFixed(fixed));
9
+ NumberHelper.parseFloatFixed = (str, fixed) => snq(() => parseFloat(NumberHelper.replaceFloat(str)).toFixed(fixed));
10
+ NumberHelper.getDecimalLength = (str) => snq(() => str.split('.')[1] ? str.split('.')[1].length : 0);
@@ -0,0 +1,21 @@
1
+ import Bcm from "../models/bcm";
2
+ export class StringHelper {
3
+ }
4
+ StringHelper.lowercase = (str) => str.toLowerCase();
5
+ StringHelper.uppercase = (str) => str.toUpperCase();
6
+ StringHelper.capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
7
+ StringHelper.camelCase = (str) => str.replace(/\s(.)/g, function ($1) { return $1.toUpperCase(); }).replace(/\s/g, '');
8
+ StringHelper.kebabCase = (str) => str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
9
+ StringHelper.snakeCase = (str) => str.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();
10
+ StringHelper.titleCase = (str) => str.replace(/\w\S*/g, function (txt) { return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); });
11
+ StringHelper.trim = (str) => str.trim();
12
+ StringHelper.trimLeft = (str) => str.trimLeft();
13
+ StringHelper.trimRight = (str) => str.trimRight();
14
+ StringHelper.trimAll = (str) => str.trim().replace(/\s+/g, ' ');
15
+ StringHelper.replace = (str, search, replace) => str.replace(search, replace);
16
+ StringHelper.remove = (str, search) => str.replace(search, '');
17
+ StringHelper.isNullOrEmpty = (str) => str === null || str === undefined || str === '';
18
+ StringHelper.localizationMessage = (str, args) => str.replace(/{(\d+)}/g, (match, number) => typeof args[number] != 'undefined' ? args[number] : match);
19
+ StringHelper.getMessage = (type, args) => StringHelper.localizationMessage(Bcm.FormErrorMessages[type], args);
20
+ StringHelper.split = (str, separator) => str.split(separator);
21
+ StringHelper.textContains = (str, search) => str.indexOf(search) !== -1;
@@ -0,0 +1,21 @@
1
+ export class Validators {
2
+ }
3
+ Validators.isEmailValid = (str) => /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(str);
4
+ Validators.isUrlValid = (str) => /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/i.test(str);
5
+ Validators.isNumberValid = (str) => /^\d+$/.test(str);
6
+ Validators.isNumberFloatValid = (str) => /^\d+(\.\d+)?$/.test(str);
7
+ Validators.isPhoneValid = (str) => /^(?=.*[0-9])[- +()0-9]+$/.test(str);
8
+ Validators.isValidate = (str, type) => {
9
+ switch (type) {
10
+ case 'email':
11
+ return Validators.isEmailValid(str);
12
+ case 'url':
13
+ return Validators.isUrlValid(str);
14
+ case 'number':
15
+ return Validators.isNumberValid(str) || Validators.isNumberFloatValid(str);
16
+ case 'phone':
17
+ return Validators.isPhoneValid(str);
18
+ default:
19
+ return true;
20
+ }
21
+ };
@@ -0,0 +1 @@
1
+ export {};