@sankhyalabs/ezui 1.1.108 → 1.1.111

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 (101) hide show
  1. package/dist/cjs/ApplicationUtils-c8f07135.js +39 -0
  2. package/dist/cjs/AssetsUtils-4909c6de.js +24 -0
  3. package/dist/cjs/CSSVarsUtils-8fbdf2e0.js +19 -0
  4. package/dist/cjs/ez-button.cjs.entry.js +79 -0
  5. package/dist/cjs/ez-calendar.cjs.entry.js +223 -0
  6. package/dist/cjs/ez-check.cjs.entry.js +76 -0
  7. package/dist/cjs/ez-collapsible-box.cjs.entry.js +47 -0
  8. package/dist/cjs/ez-combo-box.cjs.entry.js +278 -0
  9. package/dist/cjs/ez-date-input.cjs.entry.js +102 -0
  10. package/dist/cjs/ez-date-time-input.cjs.entry.js +145 -0
  11. package/dist/cjs/ez-form.cjs.entry.js +785 -0
  12. package/dist/cjs/ez-grid.cjs.entry.js +9 -8
  13. package/dist/cjs/ez-icon.cjs.entry.js +41 -0
  14. package/dist/cjs/{ez-button_3.cjs.entry.js → ez-list.cjs.entry.js} +0 -89
  15. package/dist/cjs/ez-modal.cjs.entry.js +65 -0
  16. package/dist/cjs/ez-number-input.cjs.entry.js +86 -0
  17. package/dist/cjs/ez-popover.cjs.entry.js +4 -5
  18. package/dist/cjs/ez-search.cjs.entry.js +64 -0
  19. package/dist/cjs/ez-tabselector.cjs.entry.js +198 -0
  20. package/dist/cjs/ez-text-area.cjs.entry.js +114 -0
  21. package/dist/cjs/ez-text-input.cjs.entry.js +201 -0
  22. package/dist/cjs/ez-time-input.cjs.entry.js +118 -0
  23. package/dist/cjs/ez-upload.cjs.entry.js +356 -0
  24. package/dist/cjs/ezui.cjs.js +1 -1
  25. package/dist/cjs/{ez-modal_2.cjs.entry.js → grid-config.cjs.entry.js} +3 -62
  26. package/dist/cjs/loader.cjs.js +1 -1
  27. package/dist/cjs/select-box.cjs.entry.js +22 -0
  28. package/dist/cjs/test-du.cjs.entry.js +76 -0
  29. package/dist/collection/collection-manifest.json +132 -1
  30. package/dist/custom-elements/index.js +3 -1577
  31. package/dist/esm/ApplicationUtils-36e38de9.js +37 -0
  32. package/dist/esm/AssetsUtils-9b1329a3.js +22 -0
  33. package/dist/esm/CSSVarsUtils-667e0016.js +17 -0
  34. package/dist/esm/ez-button.entry.js +75 -0
  35. package/dist/esm/ez-calendar.entry.js +219 -0
  36. package/dist/esm/ez-check.entry.js +72 -0
  37. package/dist/esm/ez-collapsible-box.entry.js +43 -0
  38. package/dist/esm/ez-combo-box.entry.js +274 -0
  39. package/dist/esm/ez-date-input.entry.js +98 -0
  40. package/dist/esm/ez-date-time-input.entry.js +141 -0
  41. package/dist/esm/ez-form.entry.js +781 -0
  42. package/dist/esm/ez-grid.entry.js +2 -1
  43. package/dist/esm/ez-icon.entry.js +37 -0
  44. package/dist/esm/{ez-button_3.entry.js → ez-list.entry.js} +2 -89
  45. package/dist/esm/ez-modal.entry.js +61 -0
  46. package/dist/esm/ez-number-input.entry.js +82 -0
  47. package/dist/esm/ez-popover.entry.js +1 -2
  48. package/dist/esm/ez-search.entry.js +60 -0
  49. package/dist/esm/ez-tabselector.entry.js +194 -0
  50. package/dist/esm/ez-text-area.entry.js +110 -0
  51. package/dist/esm/ez-text-input.entry.js +197 -0
  52. package/dist/esm/ez-time-input.entry.js +114 -0
  53. package/dist/esm/ez-upload.entry.js +352 -0
  54. package/dist/esm/ezui.js +1 -1
  55. package/dist/esm/{ez-modal_2.entry.js → grid-config.entry.js} +3 -61
  56. package/dist/esm/loader.js +1 -1
  57. package/dist/esm/select-box.entry.js +18 -0
  58. package/dist/esm/test-du.entry.js +72 -0
  59. package/dist/ezui/ezui.esm.js +1 -1
  60. package/dist/ezui/p-080045a0.entry.js +1 -0
  61. package/dist/ezui/p-25e87823.entry.js +1 -0
  62. package/dist/ezui/p-31b0e21a.entry.js +1 -0
  63. package/dist/ezui/p-363fc3af.entry.js +1 -0
  64. package/dist/ezui/p-3662c09e.entry.js +1 -0
  65. package/dist/ezui/p-3a8bf0a8.entry.js +1 -0
  66. package/dist/ezui/p-3c954800.entry.js +1 -0
  67. package/dist/ezui/p-44d4f8d6.entry.js +1 -0
  68. package/dist/ezui/p-477bb703.js +1 -0
  69. package/dist/ezui/p-59a8448a.entry.js +1 -0
  70. package/dist/ezui/p-62daf508.js +1 -0
  71. package/dist/ezui/p-65893e25.entry.js +1 -0
  72. package/dist/ezui/p-73d3f767.entry.js +1 -0
  73. package/dist/ezui/p-73d45b12.entry.js +1 -0
  74. package/dist/ezui/p-804c118a.entry.js +1 -0
  75. package/dist/ezui/p-97f77023.entry.js +1 -0
  76. package/dist/ezui/p-9aecc079.entry.js +1 -0
  77. package/dist/ezui/{p-db1797d7.entry.js → p-a038e7a5.entry.js} +28 -28
  78. package/dist/ezui/p-a5f1f9c4.entry.js +1 -0
  79. package/dist/ezui/p-bc2834fa.entry.js +1 -0
  80. package/dist/ezui/p-c27495d9.entry.js +1 -0
  81. package/dist/ezui/p-c6f2aa6c.entry.js +1 -0
  82. package/dist/ezui/p-d54c157f.js +1 -0
  83. package/dist/ezui/p-f26f6d67.entry.js +1 -0
  84. package/dist/ezui/p-f3f9c7e6.entry.js +1 -0
  85. package/dist/ezui/p-f78c7ec9.entry.js +1 -0
  86. package/package.json +5 -4
  87. package/dist/cjs/AssetsUtils-697927e8.js +0 -79
  88. package/dist/cjs/FloatingManager-751368a8.js +0 -126
  89. package/dist/cjs/UnitMetadata-de809a4b.js +0 -1346
  90. package/dist/cjs/ez-calendar_16.cjs.entry.js +0 -2916
  91. package/dist/esm/AssetsUtils-f75711ac.js +0 -76
  92. package/dist/esm/FloatingManager-ee1f7fdf.js +0 -124
  93. package/dist/esm/UnitMetadata-d300ae38.js +0 -1340
  94. package/dist/esm/ez-calendar_16.entry.js +0 -2897
  95. package/dist/ezui/p-3e6fa4ca.entry.js +0 -1
  96. package/dist/ezui/p-47cf74f0.js +0 -1
  97. package/dist/ezui/p-6b257393.entry.js +0 -1
  98. package/dist/ezui/p-780fbe22.entry.js +0 -1
  99. package/dist/ezui/p-81fc41a5.js +0 -1
  100. package/dist/ezui/p-b05feb1f.js +0 -1
  101. package/dist/ezui/p-c451d6e6.entry.js +0 -1
@@ -1,5 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-6b8bfbeb.js';
2
- import { U as UserInterface, b as DataType, S as SortMode, A as Action } from './UnitMetadata-d300ae38.js';
2
+ import { DataType, Action } from '@sankhyalabs/core';
3
+ import { UserInterface, SortMode } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
3
4
 
4
5
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
5
6
 
@@ -0,0 +1,37 @@
1
+ import { r as registerInstance, h, H as Host } from './index-6b8bfbeb.js';
2
+ import { StringUtils } from '@sankhyalabs/core';
3
+
4
+ const ezIconCss = ":host{display:flex;overflow:hidden;position:relative;--ez-icon--color:var(--icon--color, #ffffff)}svg{display:flex;justify-content:center;align-items:center;fill:var(--ez-icon--color)}.x-small{width:12px;height:12px}.small{width:16px;height:16px}.medium{width:20px;height:20px}.large{width:24px;height:24px}.x-large{width:30px;height:30px}[class^=\"ez-icon-\"],[class*=\" ez-icon-\"]{color:var(--ez-icon--color)}[class^=\"ez-icon-\"],[class*=\" ez-icon-\"]{font-family:'ez-icons' !important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ez-icon-account-outline:before{content:\"\\ea01\"}.ez-icon-account:before{content:\"\\ea02\"}.ez-icon-alert-circle-inverted:before{content:\"\\ea03\"}.ez-icon-alert-circle:before{content:\"\\ea04\"}.ez-icon-alert-mail:before{content:\"\\ea05\"}.ez-icon-alert-outline:before{content:\"\\ea06\"}.ez-icon-alert-popup:before{content:\"\\ea07\"}.ez-icon-apps:before{content:\"\\ea08\"}.ez-icon-arrow_back:before{content:\"\\ea09\"}.ez-icon-bell-inverted:before{content:\"\\ea0a\"}.ez-icon-bell:before{content:\"\\ea0b\"}.ez-icon-business-center:before{content:\"\\ea0c\"}.ez-icon-calendar-text:before{content:\"\\ea0d\"}.ez-icon-calendar:before{content:\"\\ea0e\"}.ez-icon-check-circle-inverted:before{content:\"\\ea0f\"}.ez-icon-check-circle:before{content:\"\\ea10\"}.ez-icon-check:before{content:\"\\ea11\"}.ez-icon-chevron-down:before{content:\"\\ea12\"}.ez-icon-chevron-left:before{content:\"\\ea13\"}.ez-icon-chevron-right:before{content:\"\\ea14\"}.ez-icon-chevron-up:before{content:\"\\ea15\"}.ez-icon-circle--medium:before{content:\"\\ea16\"}.ez-icon-circle:before{content:\"\\ea17\"}.ez-icon-clipboard:before{content:\"\\ea18\"}.ez-icon-close-circle-inverted:before{content:\"\\ea19\"}.ez-icon-close-circle:before{content:\"\\ea1a\"}.ez-icon-close:before{content:\"\\ea1b\"}.ez-icon-comment-inverted:before{content:\"\\ea1c\"}.ez-icon-comment:before{content:\"\\ea1d\"}.ez-icon-configuration:before{content:\"\\ea1e\"}.ez-icon-copy:before{content:\"\\ea1f\"}.ez-icon-crop:before{content:\"\\ea20\"}.ez-icon-delete:before{content:\"\\ea21\"}.ez-icon-description:before{content:\"\\ea22\"}.ez-icon-dot-notification:before{content:\"\\ea23\"}.ez-icon-dots-horizontal:before{content:\"\\ea24\"}.ez-icon-dots-vertical:before{content:\"\\ea25\"}.ez-icon-drag-indicator:before{content:\"\\ea26\"}.ez-icon-edit-file:before{content:\"\\ea27\"}.ez-icon-edit-table:before{content:\"\\ea28\"}.ez-icon-edit-time:before{content:\"\\ea29\"}.ez-icon-edit:before{content:\"\\ea2a\"}.ez-icon-email-inverted:before{content:\"\\ea2b\"}.ez-icon-email:before{content:\"\\ea2c\"}.ez-icon-error-octagon:before{content:\"\\ea2d\"}.ez-icon-expand:before{content:\"\\ea2e\"}.ez-icon-eye-off:before{content:\"\\ea2f\"}.ez-icon-eye:before{content:\"\\ea30\"}.ez-icon-favorite:before{content:\"\\ea31\"}.ez-icon-file-download:before{content:\"\\ea32\"}.ez-icon-file-upload:before{content:\"\\ea33\"}.ez-icon-filter:before{content:\"\\ea34\"}.ez-icon-find-file:before{content:\"\\ea35\"}.ez-icon-find-page:before{content:\"\\ea36\"}.ez-icon-format-color-fill:before{content:\"\\ea37\"}.ez-icon-help-circle-outline:before{content:\"\\ea38\"}.ez-icon-help-inverted:before{content:\"\\ea39\"}.ez-icon-help:before{content:\"\\ea3a\"}.ez-icon-home:before{content:\"\\ea3b\"}.ez-icon-language:before{content:\"\\ea3c\"}.ez-icon-launch:before{content:\"\\ea3d\"}.ez-icon-lightbulb:before{content:\"\\ea3e\"}.ez-icon-list:before{content:\"\\ea3f\"}.ez-icon-loading:before{content:\"\\ea40\"}.ez-icon-lock-outline:before{content:\"\\ea41\"}.ez-icon-lock:before{content:\"\\ea42\"}.ez-icon-menu:before{content:\"\\ea43\"}.ez-icon-minus-circle-inverted:before{content:\"\\ea44\"}.ez-icon-minus:before{content:\"\\ea45\"}.ez-icon-money-off:before{content:\"\\ea46\"}.ez-icon-money:before{content:\"\\ea47\"}.ez-icon-north-west:before{content:\"\\ea48\"}.ez-icon-pause:before{content:\"\\ea49\"}.ez-icon-payments:before{content:\"\\ea4a\"}.ez-icon-play:before{content:\"\\ea4b\"}.ez-icon-plus-circle-inverted:before{content:\"\\ea4c\"}.ez-icon-plus-circle:before{content:\"\\ea4d\"}.ez-icon-plus:before{content:\"\\ea4e\"}.ez-icon-power:before{content:\"\\ea4f\"}.ez-icon-push-pin:before{content:\"\\ea50\"}.ez-icon-restore:before{content:\"\\ea51\"}.ez-icon-return:before{content:\"\\ea52\"}.ez-icon-rotate:before{content:\"\\ea53\"}.ez-icon-save:before{content:\"\\ea54\"}.ez-icon-search:before{content:\"\\ea55\"}.ez-icon-settings-inverted:before{content:\"\\ea56\"}.ez-icon-settings:before{content:\"\\ea57\"}.ez-icon-share:before{content:\"\\ea58\"}.ez-icon-shield:before{content:\"\\ea59\"}.ez-icon-south-east:before{content:\"\\ea5a\"}.ez-icon-success-circle:before{content:\"\\ea5b\"}.ez-icon-sync:before{content:\"\\ea5c\"}.ez-icon-table:before{content:\"\\ea5d\"}.ez-icon-timer-outline:before{content:\"\\ea5e\"}.ez-icon-user-circle:before{content:\"\\ea5f\"}.ez-icon-warning-minus:before{content:\"\\ea60\"}.ez-icon-warning-triangle:before{content:\"\\ea61\"}.x-small--font{font-size:12px}.small--font{font-size:16px}.medium--font{font-size:20px}.large--font{font-size:24px}.x-large--font{font-size:30px}";
5
+
6
+ let EzIcon = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ /**
10
+ * Tamanho do ícone
11
+ */
12
+ this.size = 'medium';
13
+ }
14
+ isSprite() {
15
+ return this.href && this.href.indexOf('#') > -1;
16
+ }
17
+ getIconClassName() {
18
+ return `ez-icon-${this.iconName}`;
19
+ }
20
+ getIconContent() {
21
+ if (this.isSprite()) {
22
+ return h("svg", { class: this.size, role: "img" }, h("use", { xlinkHref: this.href }));
23
+ }
24
+ else if (!StringUtils.isEmpty(this.iconName)) {
25
+ return h("span", { class: `icon-content ${this.getIconClassName()} ${this.size}--font` });
26
+ }
27
+ else {
28
+ return h("img", { class: this.size, src: this.href });
29
+ }
30
+ }
31
+ render() {
32
+ return (h(Host, null, this.getIconContent()));
33
+ }
34
+ };
35
+ EzIcon.style = ezIconCss;
36
+
37
+ export { EzIcon as ez_icon };
@@ -1,76 +1,4 @@
1
- import { r as registerInstance, h, c as createEvent, H as Host } from './index-6b8bfbeb.js';
2
-
3
- const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:var(--space--medium, 12px);--ez-button--padding-bottom:var(--space--medium, 12px);--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--text--primary, #FFF);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--medium, #c0c0c0);--ez-button--border-radius:var(--border--radius-large, 12px);--ez-button--border:none;--ez-button--hover--background-color:var(--background--strong, var(--ez-button--background-color));--ez-button--disabled-color:var(--text--disable);--ez-button--disabled--background-color:var(--color--disable-secondary);--ez-button--focus--border:var(--ez-button--border);--ez-button--focus--box-shadow:none;--ez-button--link-color:var(--color--primary, '#008561');--ez-button--link--hover-color:var(--color--primary-700, '#1C1D22');--ez-button--link--small--font-size:var(--text--small, 12px);--ez-button--link--medium--font-size:var(--text--medium, 14px);--ez-button--link--large--font-size:var(--text--large, 16px)}ez-icon{--ez-icon--color:inherit}button{display:flex;align-items:center;justify-content:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;min-width:var(--ez-button--min-width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border)}button:hover{background-color:var(--ez-button--hover--background-color)}button:focus{outline:none;border:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);border:none;cursor:no-drop}button.icon{padding:0px}button.small{width:32px;min-width:32px;height:32px}button.medium{width:42px;min-width:42px;height:42px}button.large{width:52px;min-width:52px;height:52px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--color)}.label-icon label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight)}a{font-family:var(--ez-button--font-family);font-weight:var(--ez-button--font-weight);color:var(--ez-button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}a:hover{color:var(--ez-button--link--hover-color)}a.small{font-size:var(--ez-button--link--small--font-size);line-height:var(--ez-button--link--small--font-size)}a.medium{font-size:var(--ez-button--link--medium--font-size);line-height:var(--ez-button--link--medium--font-size)}a.large{font-size:var(--ez-button--link--large--font-size);line-height:var(--ez-button--link--large--font-size)}";
4
-
5
- let EzButton = class {
6
- constructor(hostRef) {
7
- registerInstance(this, hostRef);
8
- /**
9
- * Deixa o botão disponível ou não para interação com o usuário.
10
- */
11
- this.enabled = true;
12
- /**
13
- * Define o modo de uso do botão; opções: icon, link e regular
14
- */
15
- this.mode = "regular";
16
- /**
17
- * É possível escolher entre [small,medium,large] (somente para os modos "icon" e "link")
18
- */
19
- this.size = "medium";
20
- }
21
- /**
22
- * Realiza o foco no botão
23
- */
24
- async setFocus() {
25
- this._button.focus();
26
- }
27
- /**
28
- * Remove o foco no botão
29
- */
30
- async setBlur() {
31
- this._button.blur();
32
- }
33
- getIconSize() {
34
- return this.size;
35
- }
36
- handleSlotChange(ev) {
37
- const slot = ev.target;
38
- const content = slot.assignedElements()[0];
39
- if (this.mode == "link") {
40
- content.style.display = "inline";
41
- if (slot.name == "leftIcon") {
42
- content.style.paddingRight = "var(--ez-button__inline__icon--padding)";
43
- }
44
- else if (slot.name == "rightIcon") {
45
- content.style.paddingLeft = "var(--ez-button__inline__icon--padding)";
46
- }
47
- }
48
- else {
49
- content.style.setProperty('--ez-icon--color', 'var(--ez-icon--color)');
50
- }
51
- }
52
- render() {
53
- if (this.mode == "icon") {
54
- return (h("button", { class: "icon " + this.size, type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("ez-icon", { class: "icon", href: this.image, iconName: this.iconName, size: this.getIconSize(), onClick: evt => {
55
- if (!this.enabled)
56
- evt.stopPropagation();
57
- } })));
58
- }
59
- else if (this.mode == "label-icon") {
60
- return (h("div", { class: "label-icon" }, h("button", { class: "icon", type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("ez-icon", { class: "icon", href: this.image, iconName: this.iconName, size: "large", onClick: evt => {
61
- if (!this.enabled)
62
- evt.stopPropagation();
63
- } })), h("label", { title: this.label }, this.label)));
64
- }
65
- else if (this.mode == "link") {
66
- return (h("a", { class: this.size, ref: (el) => this._button = el }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
67
- }
68
- else {
69
- return (h("button", { type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
70
- }
71
- }
72
- };
73
- EzButton.style = ezButtonCss;
1
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-6b8bfbeb.js';
74
2
 
75
3
  const ezListCss = ":host{--ez-list__host--z-index:var(--visible, 1);--ez-list__host--border-radius:var(--border--radius-medium, 12px);--ez-list__host--padding:var(--space--medium, 12px);--ez-list__icon__padding:var(--space--small, 6px);--ez-list__icon--color:#AFB6C0;--ez-list__item__margin:0 var(--space--small, 6px);--ez-list__item--color:var(--title--primary, #2b3a54);--ez-list__item--border-bottom:var(--border--small, 1px solid);--ez-list__item--border-color:var(--title--primary, #2b3a54);--ez-list__item--font-family:var(--font-pattern, \"Sora\");--ez-list__item--font-size:var(--text--medium, 14px);--ez-list__selectable--padding-right:var(--space--small, 6px);--ez-list__selectable--padding-left:var(--space--small, 6px);--ez-list__selected-item__border-radius:var(--border--radius-small, 6px);--ez-list__selected-item__background:var(--color--primary-300, #E2F4EF);--ez-list__group--font-family:var(--font-pattern, \"Sora\");--ez-list__group--font-size:var(--text--medium, 14px);--ez-list__group--font-weight:var(--text-weight--large, 600);--ez-list__group--padding-bottom:var(--space-small, 6px);--ez-list__group__overlay--font-family:var(--font-pattern, \"Sora\");--ez-list__group__overlay--font-size:var(--text--medium, 14px);--ez-list__group-container__scrollbar--border-radius:var(--border--radius-large, 24px);--ez-list__group-container__scrollbar--width:var(--space--medium, 12px);--ez-list__group-container__scrollbar--background-color:var(--text--primary, #626e82);--ez-list__over--border--color:var(--color--primary, #008561);--ez-list__draggable__list--padding-bottom:var(--space--small, 6px);--ez-list__last-droppable-space--height:var(--space--small, 6px);--ez-list__draggable__scrollbar--border-radius:var(--border--radius-large, 24px);--ez-list__draggable__scrollbar--width:var(--space--medium, 12px);--ez-list__draggable__scrollbar--background-color:var(--text--primary, #626e82);--ez-list__draggable__icon--image:url('data:image/svg+xml;utf8,<svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m 6.75,2.25 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z m -3,3 h 1.5 v 1.5 h -1.5 z m 3,0 h 1.5 v 1.5 h -1.5 z\"/></svg>');max-height:100%;width:100%;background-color:#fff;display:flex;z-index:var(--ez-list__host--z-index)}p{margin:0}.draggable{display:flex;align-items:center;border-top:1px dashed #fff;justify-content:space-between;background-color:#fff;font-family:var(--ez-list__item--font-family);font-size:var(--ez-list__item--font-size);flex:1}.dragging{background:#FFFFFF;border:1px solid #008561;box-sizing:border-box;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);border-radius:6px}.selectable{cursor:pointer;padding-right:var(--ez-list__selectable--padding-right);padding-left:var(--ez-list__selectable--padding-left)}.selectable-container{margin:0px !important}.item-content{display:flex;justify-content:center;align-items:center}.draggable-list{color:var(--text-color);padding:0;margin:0;width:100%;max-height:100%}.draggable-list li{background-color:#fff;display:flex;margin:var(--ez-list__item__margin);font-family:var(--ez-list__item--font-family);font-size:var(--ez-list__item--font-size);color:var(--ez-list__item--color);height:32px}.over{border-top:1px dashed var(--ez-list__over--border--color)}.last-droppable-space{height:var(--ez-list__last-droppable-space--height)}.draggable-selected{background-color:var(--background--strong) !important}.draggable-selected div:hover{background-color:var(--background--strong) !important}.draggable-list::-webkit-scrollbar-track{background-color:#f0f2f5}.draggable-list::-webkit-scrollbar-thumb{background-color:var(--ez-list__draggable__scrollbar--background-color);border-radius:var(--ez-list__draggable__scrollbar--border-radius)}.draggable-list::-webkit-scrollbar{background-color:#f0f2f5;width:var(--ez-list__draggable__scrollbar--width);max-width:var(--ez-list__draggable__scrollbar--width);min-width:var(--ez-list__draggable__scrollbar--width)}.draggable-icon{align-items:flex-start;display:flex;outline:none;border:none;background-color:unset}.draggable-icon::after{content:'';display:flex;background-color:var(--ez-list__icon--color);width:18px;height:18px;-webkit-mask-image:var(--ez-list__draggable__icon--image);mask-image:var(--ez-list__draggable__icon--image)}*{box-sizing:border-box}.checkbox{width:fit-content}.text--ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.group-container{display:flex;flex-direction:column;max-height:100%;overflow-y:auto;outline:none;width:100%}.group-name{font-family:var(--ez-list__group--font-family);font-size:var(--ez-list__group--font-size);font-weight:var(--ez-list__group--font-weight);padding-bottom:var(--ez-list__group--padding-bottom);-webkit-user-select:none;-moz-user-select:-moz-none;-ms-user-select:none;user-select:none}.group{display:flex;flex-direction:column}.group-container::-webkit-scrollbar-track{background-color:#f0f2f5}.group-container::-webkit-scrollbar-thumb{background-color:var(--ez-list__group-container__scrollbar--background-color);border-radius:var(--ez-list__group-container__scrollbar--border-radius)}.group-container::-webkit-scrollbar{background-color:#f0f2f5;width:var(--ez-list__group-container__scrollbar--width);max-width:var(--ez-list__group-container__scrollbar--width);min-width:var(--ez-list__group-container__scrollbar--width)}.section-container{display:flex;position:relative;height:100%}.items-container{width:100%;max-height:100%;overflow-y:auto;outline:none}.group-items-container{width:100%;max-height:100%;height:100%;outline:none}.items-container::-webkit-scrollbar-track{background-color:#f0f2f5}.items-container::-webkit-scrollbar-thumb{background-color:var(--ez-list__draggable__scrollbar--background-color);border-radius:var(--ez-list__draggable__scrollbar--border-radius)}.items-container::-webkit-scrollbar{background-color:#f0f2f5;width:var(--ez-list__draggable__scrollbar--width);max-width:var(--ez-list__draggable__scrollbar--width);min-width:var(--ez-list__draggable__scrollbar--width)}.group-overlay{font-family:var(--ez-list__group__overlay--font-family);font-size:var(--ez-list__group__overlay--font-size);background:rgba(226, 244, 239, 0.8);border:1px solid #008561;border-radius:8px;position:absolute;display:none;place-items:center;top:0;bottom:0;left:0;right:0;z-index:2;margin:0;cursor:pointer}.presetedHeight{min-height:100px}.overlay-text{position:absolute;top:50%;left:50%;font-size:50px;color:white;transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%)}.selected-item{background:var(--ez-list__selected-item__background);border-radius:var(--ez-list__selected-item__border-radius)}.slot-item{align-items:flex-end}.overGroup{background:rgba(226, 244, 239, 0.8);border:1px solid #008561;box-sizing:border-box;border-radius:8px;padding-top:6px}";
76
4
 
@@ -566,19 +494,4 @@ let EzList = class {
566
494
  };
567
495
  EzList.style = ezListCss;
568
496
 
569
- const selectBoxCss = "ez-combo-box{width:100px}.grid-config-combo{--ez-text-input--height:28px;--ez-text-input__input--background-color:#fff;--ez-text-input__input--border-color:#dce0e8}";
570
-
571
- let SelectBox = class {
572
- constructor(hostRef) {
573
- registerInstance(this, hostRef);
574
- this.ezChange = createEvent(this, "ezChange", 7);
575
- this.selectedOption = { value: "na", label: "N/A" };
576
- }
577
- render() {
578
- return (h("ez-combo-box", { class: "grid-config-combo inverted", label: "", value: this.selectedOption, enabled: true, canShowError: false, suppressEmptyOption: true }, h("option", { value: "na" }, "N/A"), h("option", { value: "asc" }, "A-Z"), h("option", { value: "desc" }, "Z-A")));
579
- }
580
- static get assetsDirs() { return ["../assets"]; }
581
- };
582
- SelectBox.style = selectBoxCss;
583
-
584
- export { EzButton as ez_button, EzList as ez_list, SelectBox as select_box };
497
+ export { EzList as ez_list };
@@ -0,0 +1,61 @@
1
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-6b8bfbeb.js';
2
+
3
+ const ezModalCss = ":host{--ez-modal-z-index:var(--most-visible, 3);--ez-modal-vertical-padding:var(--space--large, 24px);display:block}.modal{position:fixed;padding:var(--ez-modal-vertical-padding) 0;display:flex;top:0px;z-index:var(--ez-modal-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}@keyframes expand-modal--left{from{transform:translate(-100%)}}@keyframes expand-modal--right{from{transform:translate(100%)}}.modal__container{display:flex;flex-wrap:wrap;height:100%;box-sizing:border-box;width:100%;align-items:flex-start}.modal__container--right{animation:expand-modal--right .2s ease-in-out 1;justify-content:flex-end}.modal__container--left{animation:expand-modal--left .2s ease-in-out 1;justify-content:flex-start}.modal__content{display:flex;flex-wrap:wrap;max-height:calc(100% - 48px);height:100%;overflow-y:auto;background-color:rgb(255, 255, 255);padding:24px;border-radius:12px 0px 0px 12px;box-shadow:rgb(0 38 111 / 12%) 0px 0px 16px 0px}.modal__content--right{border-radius:12px 0px 0px 12px}.modal__content--left{border-radius:0px 12px 12px 0px}.modal__box__container{display:flex;flex-wrap:wrap;background-color:#fff;width:100%;border-radius:12px}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
4
+
5
+ let EzModal = class {
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ this.ezCloseModal = createEvent(this, "ezCloseModal", 7);
9
+ /**
10
+ * Controle de exibição do Modal
11
+ */
12
+ this.opened = true;
13
+ /**
14
+ * Define se o modal será fechado ao clicar ESC
15
+ */
16
+ this.closeEsc = false;
17
+ /**
18
+ * Define se o modal será fechado ao clicar fora do conteúdo.
19
+ */
20
+ this.closeOutsideClick = false;
21
+ this.handleKeyboardEvent = (ev) => {
22
+ if ((ev === null || ev === void 0 ? void 0 : ev.key) === "Escape" && this.closeEsc) {
23
+ this.closeModal();
24
+ }
25
+ };
26
+ }
27
+ handleopenedChange() {
28
+ if (this.opened) {
29
+ document.addEventListener("keydown", this.handleKeyboardEvent);
30
+ }
31
+ else {
32
+ document.removeEventListener("keydown", this.handleKeyboardEvent);
33
+ }
34
+ }
35
+ closeModal() {
36
+ this.opened = false;
37
+ this.ezCloseModal.emit(this.opened);
38
+ }
39
+ componentDidLoad() {
40
+ this.handleopenedChange();
41
+ }
42
+ onMouseDownHandler(event) {
43
+ if (this.closeOutsideClick && event.target === this._overlay) {
44
+ this.closeModal();
45
+ }
46
+ }
47
+ render() {
48
+ const positionSufix = this.align === "left" ? "left" : "right";
49
+ return (h(Host, null, this.opened
50
+ ?
51
+ h("div", { class: "modal", onMouseDown: evt => this.onMouseDownHandler(evt) }, h("div", { class: `modal__container modal__container--${positionSufix}`, ref: ref => this._overlay = ref }, h("div", { class: `modal__content modal__content--${positionSufix} ${this.modalSize}` }, h("slot", null))))
52
+ :
53
+ undefined));
54
+ }
55
+ static get watchers() { return {
56
+ "opened": ["handleopenedChange"]
57
+ }; }
58
+ };
59
+ EzModal.style = ezModalCss;
60
+
61
+ export { EzModal as ez_modal };
@@ -0,0 +1,82 @@
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-6b8bfbeb.js';
2
+ import { NumberUtils } from '@sankhyalabs/core';
3
+ import { C as CSSVarsUtils } from './CSSVarsUtils-667e0016.js';
4
+
5
+ const ezNumberInputCss = ":host{display:block;width:100%}";
6
+
7
+ let EzNumberInput = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.ezChange = createEvent(this, "ezChange", 7);
11
+ /**
12
+ * Deixa o campo disponível ou não para uso.
13
+ */
14
+ this.enabled = true;
15
+ }
16
+ setLabel() {
17
+ this._textInput.label = this.label;
18
+ }
19
+ setErrorMessage() {
20
+ this._textInput.errorMessage = this.errorMessage;
21
+ }
22
+ applyValueToInput() {
23
+ if (this._textInput) {
24
+ this._textInput.value = this.getTextValue(this.value);
25
+ }
26
+ }
27
+ /**
28
+ * Realiza o foco no componente de input
29
+ */
30
+ async setFocus() {
31
+ this._textInput.setFocus();
32
+ }
33
+ /**
34
+ * Remove o foco no componente de input
35
+ */
36
+ async setBlur() {
37
+ this._textInput.setBlur();
38
+ }
39
+ changeValue(newValue) {
40
+ this.errorMessage = "";
41
+ if (newValue && newValue !== this.value) {
42
+ this.value = newValue;
43
+ this.ezChange.emit(this.value);
44
+ }
45
+ }
46
+ parseNumber() {
47
+ const parsedNumber = this._textInput.value ? NumberUtils.stringToNumber(this._textInput.value) : null;
48
+ if (parsedNumber != null && isNaN(parsedNumber)) {
49
+ this.errorMessage = "O valor digitado não é um número válido";
50
+ }
51
+ else {
52
+ try {
53
+ this.changeValue(parsedNumber);
54
+ }
55
+ catch (e) {
56
+ this.errorMessage = e.message;
57
+ return;
58
+ }
59
+ }
60
+ }
61
+ getTextValue(value) {
62
+ if (value) {
63
+ return this.precision > 0 ? NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyPrecision)) : value.toString();
64
+ }
65
+ return null;
66
+ }
67
+ componentDidLoad() {
68
+ CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
69
+ }
70
+ render() {
71
+ return (h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseNumber(), label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled, errorMessage: this.errorMessage }));
72
+ }
73
+ get _elem() { return getElement(this); }
74
+ static get watchers() { return {
75
+ "label": ["setLabel"],
76
+ "errorMessage": ["setErrorMessage"],
77
+ "value": ["applyValueToInput"]
78
+ }; }
79
+ };
80
+ EzNumberInput.style = ezNumberInputCss;
81
+
82
+ export { EzNumberInput as ez_number_input };
@@ -1,6 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-6b8bfbeb.js';
2
- import './UnitMetadata-d300ae38.js';
3
- import { F as FloatingManager } from './FloatingManager-ee1f7fdf.js';
2
+ import { FloatingManager } from '@sankhyalabs/core';
4
3
 
5
4
  const ezPopoverCss = ":host{--ez-popover__box--border-radius:var(--border--radius-medium, 12px);--ez-popover__box--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-popover__box--background-color:var(--background--xlight, #fff);--ez-popover__box--z-index:var(--more-visible, 1);position:relative;display:flex;user-select:none;width:100%}.box{z-index:var(--ez-popover__box--z-index);display:flex;flex-direction:column;height:fit-content;background-color:var(--ez-popover__box--background-color);border-radius:var(--ez-popover__box--border-radius);box-shadow:var(--ez-popover__box--box-shadow)}.box--fit-content{width:fit-content}.box--full-width{width:100%}";
6
5
 
@@ -0,0 +1,60 @@
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-6b8bfbeb.js';
2
+ import { C as CSSVarsUtils } from './CSSVarsUtils-667e0016.js';
3
+
4
+ const ezSearchCss = ":host{width:100%}";
5
+
6
+ let EzSearch = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.ezChange = createEvent(this, "ezChange", 7);
10
+ this.showPopup = createEvent(this, "showPopup", 7);
11
+ /**
12
+ * Deixa o campo disponível ou não.
13
+ */
14
+ this.enabled = true;
15
+ /**
16
+ * Ajusta a opção de mostrar o "value" ao selecionar uma opção.
17
+ */
18
+ this.showSelectedValue = true;
19
+ /**
20
+ * Ajusta a opção de mostrar o "value" para cada opção.
21
+ */
22
+ this.showOptionValue = true;
23
+ }
24
+ updateValue() {
25
+ if (this._comboElement) {
26
+ this._comboElement.value = this.value;
27
+ }
28
+ }
29
+ /**
30
+ * Realiza o foco no componente de pesquisa
31
+ */
32
+ async setFocus() {
33
+ this._comboElement.setFocus();
34
+ }
35
+ /**
36
+ * Remove o foco no componente de pesquisa
37
+ */
38
+ async setBlur() {
39
+ this._comboElement.setBlur();
40
+ }
41
+ onComboChange(evt) {
42
+ evt.stopPropagation();
43
+ this.value = evt.detail;
44
+ this.ezChange.emit(evt.detail);
45
+ }
46
+ componentDidLoad() {
47
+ CSSVarsUtils.applyVarsTextInput(this._elem, this._comboElement);
48
+ }
49
+ render() {
50
+ return (h("ez-combo-box", { ref: elem => this._comboElement = elem, value: this.value, label: this.label, enabled: this.enabled, errorMessage: this.errorMessage, optionLoader: this.optionLoader, searchMode: true, onEzChange: evt => this.onComboChange(evt), showSelectedValue: this.showSelectedValue, showOptionValue: this.showOptionValue }));
51
+ }
52
+ ;
53
+ get _elem() { return getElement(this); }
54
+ static get watchers() { return {
55
+ "value": ["updateValue"]
56
+ }; }
57
+ };
58
+ EzSearch.style = ezSearchCss;
59
+
60
+ export { EzSearch as ez_search };
@@ -0,0 +1,194 @@
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-6b8bfbeb.js';
2
+
3
+ const ezTabselectorCss = "@keyframes activate{0%{clip-path:inset(calc(100% - 3px) 50% 0px 50%)}100%{clip-path:inset(calc(100% - 3px) 0px 0px 0px)}}:host{display:flex;position:relative;width:100%;overflow:hidden;--tabselector--backward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z\"/></svg>');--tabselector--forward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>')}.scroll{display:flex;width:100%;scroll-behavior:smooth;overflow-x:auto;scrollbar-width:none}.scroll.startHidden{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px)}.scroll.midle{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px, #000 calc(100% - 48px), transparent calc(100% - 20px))}.scroll.endHidden{-webkit-mask-image:linear-gradient(90deg, #000 calc(100% - 48px), transparent calc(100% - 20px))}.tab{display:flex;border:none;min-width:100px;background-color:unset;cursor:pointer;padding:6px 12px;align-items:center;justify-content:center;color:var(--text--primary, #626e82);font-family:var(--font-pattern, \"Sora, Algerian\");font-size:var(--title--small, 14px)}.tab:focus,.forward-button,.backward-button{outline:none}.is-active{position:relative;color:var(--color--primary, #008561)}.is-active::after{content:\"\";position:absolute;width:100%;height:100%;background-color:var(--color--primary, #008561);clip-path:inset(calc(100% - 3px) 0px 0px 0px);animation:activate 0.25s ease-in-out}.is-focused{border:1px dashed var(--color--primary, #000000c5)}.tab-label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-shadow:var(--text-shadow);margin-bottom:var(--space--extra-small, 3px)}.forward-button,.backward-button{position:absolute;z-index:1;display:flex;box-sizing:border-box;padding:0px;top:0px;right:0px;width:16px;height:100%;border:none;background-color:unset;cursor:pointer;justify-content:center;align-items:center}.backward-button{left:0px}.forward-button::after,.backward-button::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:10px;height:16px}.forward-button::after{-webkit-mask-image:var(--tabselector--forward-icon);mask-image:var(--tabselector--forward-icon)}.backward-button::after{-webkit-mask-image:var(--tabselector--backward-icon);mask-image:var(--tabselector--backward-icon)}.forward-button:hover::after,.backward-button:hover::after{background-color:var(--color--primary, #4e4e4e)}.hidden{display:none}.scroll::-webkit-scrollbar{display:none}";
4
+
5
+ let EzTabselector = class {
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ this.ezChange = createEvent(this, "ezChange", 7);
9
+ this.setFocusedParam = (ev) => {
10
+ if (ev.key === "Enter") {
11
+ const selectedTab = this._processedTabs[this._focusedIndex];
12
+ this.handleTabClick(selectedTab);
13
+ ev.preventDefault();
14
+ this.setFocusedTab(selectedTab.index);
15
+ }
16
+ else if (ev.key === "ArrowLeft" || ev.key === "ArrowRight") {
17
+ let operator = undefined;
18
+ if (ev.key === "ArrowLeft") {
19
+ operator = false;
20
+ }
21
+ else if (ev.key === "ArrowRight") {
22
+ operator = true;
23
+ }
24
+ else {
25
+ return;
26
+ }
27
+ if (this._focusedIndex === undefined) {
28
+ if (operator === false) {
29
+ this._focusedIndex = this.selectedIndex !== undefined ? this.selectedIndex - 1 : undefined;
30
+ }
31
+ else {
32
+ this._focusedIndex = this.selectedIndex !== undefined ? this.selectedIndex + 1 : undefined;
33
+ }
34
+ }
35
+ else {
36
+ if (operator === false) {
37
+ this._focusedIndex = this._focusedIndex - 1;
38
+ }
39
+ else {
40
+ this._focusedIndex = this._focusedIndex + 1;
41
+ }
42
+ }
43
+ if (this._focusedIndex < 0) {
44
+ this._focusedIndex = 0;
45
+ }
46
+ else if (this._focusedIndex > this._processedTabs.length - 1) {
47
+ this._focusedIndex = this._processedTabs.length - 1;
48
+ }
49
+ this.setFocusedBtn(true, this._focusedIndex);
50
+ this.setFocusedTab(this._focusedIndex);
51
+ }
52
+ else if (ev.key === "Tab" || ev.key === "Escape") {
53
+ const currentTab = this._processedTabs[this.selectedIndex];
54
+ this._focusedIndex = undefined;
55
+ this.handleTabClick(currentTab);
56
+ ev.preventDefault();
57
+ this.setFocusedTab(this.selectedIndex);
58
+ }
59
+ };
60
+ }
61
+ handleTabClick(tab) {
62
+ this.selectedIndex = tab.index;
63
+ this._focusedIndex = undefined;
64
+ this.selectedTab = tab.tabKey;
65
+ this.ezChange.emit(tab);
66
+ this.setFocusedBtn(false, tab.index);
67
+ }
68
+ componentWillRender() {
69
+ if (!this._processedTabs) {
70
+ this._processedTabs = [];
71
+ if (this.tabs) {
72
+ this.tabs.split(",").forEach((label) => {
73
+ label = label.trim();
74
+ this._processedTabs.push({ label, tabKey: label, index: this._processedTabs.length });
75
+ });
76
+ }
77
+ this._hostElem.querySelectorAll("ez-tab").forEach((elem) => {
78
+ const tabKey = elem.getAttribute("tabKey");
79
+ const label = elem.getAttribute("label");
80
+ const t = { label, tabKey, index: this._processedTabs.length };
81
+ const content = elem.firstChild;
82
+ if (content) {
83
+ content.setAttribute("slot", "tab" + t.index);
84
+ this._hostElem.appendChild(content);
85
+ }
86
+ this._processedTabs.push(t);
87
+ });
88
+ }
89
+ }
90
+ handleSlotChange(ev) {
91
+ const slot = ev.target;
92
+ const content = slot.assignedElements()[0];
93
+ if (content) {
94
+ content.style.marginLeft = "6px";
95
+ }
96
+ }
97
+ scrollBackward() {
98
+ const container = this._scrollContainer;
99
+ if (container) {
100
+ container.scrollLeft -= container.clientWidth;
101
+ }
102
+ }
103
+ scrollFoward() {
104
+ const container = this._scrollContainer;
105
+ if (container) {
106
+ let lastTab = null;
107
+ container.querySelectorAll(".tab").forEach((tab) => {
108
+ if (tab.getBoundingClientRect().right < container.clientWidth) {
109
+ lastTab = tab;
110
+ }
111
+ });
112
+ container.scrollLeft = lastTab.offsetLeft + lastTab.offsetWidth;
113
+ }
114
+ }
115
+ componentDidRender() {
116
+ this.updateScroll();
117
+ }
118
+ updateScroll() {
119
+ const container = this._scrollContainer;
120
+ if (container) {
121
+ const { scrollWidth, clientWidth, scrollLeft } = container;
122
+ const remainingScroll = scrollWidth - clientWidth - Math.ceil(scrollLeft);
123
+ this._startHidden = container.scrollLeft > 0;
124
+ this._endHidden = remainingScroll > 0;
125
+ if (this._startHidden) {
126
+ this._backwardButton.classList.remove("hidden");
127
+ }
128
+ else {
129
+ this._backwardButton.classList.add("hidden");
130
+ }
131
+ if (this._endHidden) {
132
+ this._forwardButton.classList.remove("hidden");
133
+ }
134
+ else {
135
+ this._forwardButton.classList.add("hidden");
136
+ }
137
+ const classNames = ["", "startHidden", "endHidden", "midle"];
138
+ const currentClass = classNames[Number(this._startHidden) | Number(this._endHidden) << 1];
139
+ classNames.forEach((name) => {
140
+ if (name !== currentClass && container.classList.contains(name)) {
141
+ container.classList.remove(name);
142
+ }
143
+ });
144
+ if (currentClass && !container.classList.contains(currentClass)) {
145
+ container.classList.add(currentClass);
146
+ }
147
+ }
148
+ }
149
+ domScrollHandler() {
150
+ window.clearTimeout(this._scrollCallBack);
151
+ this._scrollCallBack = window.setTimeout(() => { this.updateScroll(); }, 200);
152
+ }
153
+ setFocusedTab(index) {
154
+ window.clearTimeout(this._scrollCallBackTest);
155
+ this._scrollCallBackTest = window.setTimeout(() => {
156
+ const tabtoscroll = this._scrollContainer.querySelector(`#tab${index}`);
157
+ tabtoscroll.scrollIntoView();
158
+ }, 200);
159
+ }
160
+ getTextWidth(text) {
161
+ if (this._textMesurement === undefined) {
162
+ this._textMesurement = this._hostElem.shadowRoot.ownerDocument.createElement("canvas");
163
+ }
164
+ const context = this._textMesurement.getContext("2d");
165
+ context.font = "14px Sora, Algerian";
166
+ return Math.min(220, 24 + context.measureText(text).width) + "px";
167
+ }
168
+ ;
169
+ setFocusedBtn(visible, parameter) {
170
+ const tabsButtons = this._scrollContainer.querySelectorAll(".tab");
171
+ tabsButtons.forEach((el) => {
172
+ el.classList.remove("is-focused");
173
+ if (el.id === "tab" + parameter && visible) {
174
+ el.classList.add("is-focused");
175
+ }
176
+ });
177
+ }
178
+ render() {
179
+ return (h(Host, null, h("button", { class: "backward-button", ref: (el) => this._backwardButton = el, onClick: () => this.scrollBackward() }), h("div", { class: "scroll", ref: (el) => this._scrollContainer = el, onScroll: () => this.domScrollHandler(), onKeyDown: (ev) => this.setFocusedParam(ev) }, this._processedTabs.map((tab, index) => {
180
+ const labelStyle = { "min-width": this.getTextWidth(tab.label) };
181
+ const tabId = "tab" + index;
182
+ const isSelected = index === this.selectedIndex || (this.selectedTab && tab.tabKey === this.selectedTab);
183
+ if (isSelected) {
184
+ this.selectedTab = tab.tabKey;
185
+ this.selectedIndex = index;
186
+ }
187
+ return h("button", { id: tabId, class: `tab${isSelected ? " is-active" : ""}`, onClick: () => this.handleTabClick(tab), style: labelStyle }, h("span", { class: "tab-label", title: tab.label }, tab.label), h("slot", { name: tabId, onSlotchange: (ev) => { this.handleSlotChange(ev); } }));
188
+ })), h("button", { class: "forward-button", ref: (el) => this._forwardButton = el, onClick: () => this.scrollFoward() })));
189
+ }
190
+ get _hostElem() { return getElement(this); }
191
+ };
192
+ EzTabselector.style = ezTabselectorCss;
193
+
194
+ export { EzTabselector as ez_tabselector };