@sankhyalabs/ezui 1.1.109 → 1.1.112
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.
- package/dist/cjs/ApplicationUtils-c8f07135.js +39 -0
- package/dist/cjs/CSSVarsUtils-8fbdf2e0.js +19 -0
- package/dist/cjs/ez-button.cjs.entry.js +79 -0
- package/dist/cjs/ez-calendar.cjs.entry.js +223 -0
- package/dist/cjs/ez-check.cjs.entry.js +76 -0
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +47 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js +278 -0
- package/dist/cjs/ez-date-input.cjs.entry.js +102 -0
- package/dist/cjs/ez-date-time-input.cjs.entry.js +145 -0
- package/dist/cjs/ez-form.cjs.entry.js +785 -0
- package/dist/cjs/ez-icon.cjs.entry.js +41 -0
- package/dist/cjs/{ez-button_3.cjs.entry.js → ez-list.cjs.entry.js} +0 -89
- package/dist/cjs/ez-modal.cjs.entry.js +65 -0
- package/dist/cjs/ez-number-input.cjs.entry.js +86 -0
- package/dist/cjs/ez-search.cjs.entry.js +64 -0
- package/dist/cjs/ez-tabselector.cjs.entry.js +198 -0
- package/dist/cjs/ez-text-area.cjs.entry.js +114 -0
- package/dist/cjs/ez-text-input.cjs.entry.js +201 -0
- package/dist/cjs/ez-time-input.cjs.entry.js +118 -0
- package/dist/cjs/ez-upload.cjs.entry.js +356 -0
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/{ez-modal_2.cjs.entry.js → grid-config.cjs.entry.js} +0 -59
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/select-box.cjs.entry.js +22 -0
- package/dist/cjs/test-du.cjs.entry.js +76 -0
- package/dist/collection/collection-manifest.json +132 -1
- package/dist/esm/ApplicationUtils-36e38de9.js +37 -0
- package/dist/esm/CSSVarsUtils-667e0016.js +17 -0
- package/dist/esm/ez-button.entry.js +75 -0
- package/dist/esm/ez-calendar.entry.js +219 -0
- package/dist/esm/ez-check.entry.js +72 -0
- package/dist/esm/ez-collapsible-box.entry.js +43 -0
- package/dist/esm/ez-combo-box.entry.js +274 -0
- package/dist/esm/ez-date-input.entry.js +98 -0
- package/dist/esm/ez-date-time-input.entry.js +141 -0
- package/dist/esm/ez-form.entry.js +781 -0
- package/dist/esm/ez-icon.entry.js +37 -0
- package/dist/esm/{ez-button_3.entry.js → ez-list.entry.js} +2 -89
- package/dist/esm/ez-modal.entry.js +61 -0
- package/dist/esm/ez-number-input.entry.js +82 -0
- package/dist/esm/ez-search.entry.js +60 -0
- package/dist/esm/ez-tabselector.entry.js +194 -0
- package/dist/esm/ez-text-area.entry.js +110 -0
- package/dist/esm/ez-text-input.entry.js +197 -0
- package/dist/esm/ez-time-input.entry.js +114 -0
- package/dist/esm/ez-upload.entry.js +352 -0
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/{ez-modal_2.entry.js → grid-config.entry.js} +1 -59
- package/dist/esm/loader.js +1 -1
- package/dist/esm/select-box.entry.js +18 -0
- package/dist/esm/test-du.entry.js +72 -0
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-25e87823.entry.js +1 -0
- package/dist/ezui/p-31b0e21a.entry.js +1 -0
- package/dist/ezui/p-363fc3af.entry.js +1 -0
- package/dist/ezui/p-3662c09e.entry.js +1 -0
- package/dist/ezui/p-3a8bf0a8.entry.js +1 -0
- package/dist/ezui/p-3c954800.entry.js +1 -0
- package/dist/ezui/p-44d4f8d6.entry.js +1 -0
- package/dist/ezui/p-59a8448a.entry.js +1 -0
- package/dist/ezui/p-62daf508.js +1 -0
- package/dist/ezui/p-65893e25.entry.js +1 -0
- package/dist/ezui/p-73d3f767.entry.js +1 -0
- package/dist/ezui/p-73d45b12.entry.js +1 -0
- package/dist/ezui/p-804c118a.entry.js +1 -0
- package/dist/ezui/p-97f77023.entry.js +1 -0
- package/dist/ezui/p-9aecc079.entry.js +1 -0
- package/dist/ezui/p-a5f1f9c4.entry.js +1 -0
- package/dist/ezui/p-bc2834fa.entry.js +1 -0
- package/dist/ezui/p-c27495d9.entry.js +1 -0
- package/dist/ezui/p-c6f2aa6c.entry.js +1 -0
- package/dist/ezui/p-d54c157f.js +1 -0
- package/dist/ezui/p-f26f6d67.entry.js +1 -0
- package/dist/ezui/p-f3f9c7e6.entry.js +1 -0
- package/dist/ezui/p-f78c7ec9.entry.js +1 -0
- package/package.json +3 -37
- package/dist/cjs/ez-calendar_16.cjs.entry.js +0 -2855
- package/dist/esm/ez-calendar_16.entry.js +0 -2836
- package/dist/ezui/p-6b257393.entry.js +0 -1
- package/dist/ezui/p-ae7c92b7.entry.js +0 -1
- package/dist/ezui/p-eaeaea64.entry.js +0 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-88286449.js');
|
|
6
|
+
const core = require('@sankhyalabs/core');
|
|
7
|
+
|
|
8
|
+
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}";
|
|
9
|
+
|
|
10
|
+
let EzIcon = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
/**
|
|
14
|
+
* Tamanho do ícone
|
|
15
|
+
*/
|
|
16
|
+
this.size = 'medium';
|
|
17
|
+
}
|
|
18
|
+
isSprite() {
|
|
19
|
+
return this.href && this.href.indexOf('#') > -1;
|
|
20
|
+
}
|
|
21
|
+
getIconClassName() {
|
|
22
|
+
return `ez-icon-${this.iconName}`;
|
|
23
|
+
}
|
|
24
|
+
getIconContent() {
|
|
25
|
+
if (this.isSprite()) {
|
|
26
|
+
return index.h("svg", { class: this.size, role: "img" }, index.h("use", { xlinkHref: this.href }));
|
|
27
|
+
}
|
|
28
|
+
else if (!core.StringUtils.isEmpty(this.iconName)) {
|
|
29
|
+
return index.h("span", { class: `icon-content ${this.getIconClassName()} ${this.size}--font` });
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
return index.h("img", { class: this.size, src: this.href });
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
render() {
|
|
36
|
+
return (index.h(index.Host, null, this.getIconContent()));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
EzIcon.style = ezIconCss;
|
|
40
|
+
|
|
41
|
+
exports.ez_icon = EzIcon;
|
|
@@ -4,78 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-88286449.js');
|
|
6
6
|
|
|
7
|
-
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)}";
|
|
8
|
-
|
|
9
|
-
let EzButton = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
index.registerInstance(this, hostRef);
|
|
12
|
-
/**
|
|
13
|
-
* Deixa o botão disponível ou não para interação com o usuário.
|
|
14
|
-
*/
|
|
15
|
-
this.enabled = true;
|
|
16
|
-
/**
|
|
17
|
-
* Define o modo de uso do botão; opções: icon, link e regular
|
|
18
|
-
*/
|
|
19
|
-
this.mode = "regular";
|
|
20
|
-
/**
|
|
21
|
-
* É possível escolher entre [small,medium,large] (somente para os modos "icon" e "link")
|
|
22
|
-
*/
|
|
23
|
-
this.size = "medium";
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Realiza o foco no botão
|
|
27
|
-
*/
|
|
28
|
-
async setFocus() {
|
|
29
|
-
this._button.focus();
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Remove o foco no botão
|
|
33
|
-
*/
|
|
34
|
-
async setBlur() {
|
|
35
|
-
this._button.blur();
|
|
36
|
-
}
|
|
37
|
-
getIconSize() {
|
|
38
|
-
return this.size;
|
|
39
|
-
}
|
|
40
|
-
handleSlotChange(ev) {
|
|
41
|
-
const slot = ev.target;
|
|
42
|
-
const content = slot.assignedElements()[0];
|
|
43
|
-
if (this.mode == "link") {
|
|
44
|
-
content.style.display = "inline";
|
|
45
|
-
if (slot.name == "leftIcon") {
|
|
46
|
-
content.style.paddingRight = "var(--ez-button__inline__icon--padding)";
|
|
47
|
-
}
|
|
48
|
-
else if (slot.name == "rightIcon") {
|
|
49
|
-
content.style.paddingLeft = "var(--ez-button__inline__icon--padding)";
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
content.style.setProperty('--ez-icon--color', 'var(--ez-icon--color)');
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
render() {
|
|
57
|
-
if (this.mode == "icon") {
|
|
58
|
-
return (index.h("button", { class: "icon " + this.size, type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, index.h("ez-icon", { class: "icon", href: this.image, iconName: this.iconName, size: this.getIconSize(), onClick: evt => {
|
|
59
|
-
if (!this.enabled)
|
|
60
|
-
evt.stopPropagation();
|
|
61
|
-
} })));
|
|
62
|
-
}
|
|
63
|
-
else if (this.mode == "label-icon") {
|
|
64
|
-
return (index.h("div", { class: "label-icon" }, index.h("button", { class: "icon", type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, index.h("ez-icon", { class: "icon", href: this.image, iconName: this.iconName, size: "large", onClick: evt => {
|
|
65
|
-
if (!this.enabled)
|
|
66
|
-
evt.stopPropagation();
|
|
67
|
-
} })), index.h("label", { title: this.label }, this.label)));
|
|
68
|
-
}
|
|
69
|
-
else if (this.mode == "link") {
|
|
70
|
-
return (index.h("a", { class: this.size, ref: (el) => this._button = el }, index.h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, index.h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
return (index.h("button", { type: "button", disabled: !this.enabled, ref: (el) => this._button = el }, index.h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, index.h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
EzButton.style = ezButtonCss;
|
|
78
|
-
|
|
79
7
|
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}";
|
|
80
8
|
|
|
81
9
|
let EzList = class {
|
|
@@ -570,21 +498,4 @@ let EzList = class {
|
|
|
570
498
|
};
|
|
571
499
|
EzList.style = ezListCss;
|
|
572
500
|
|
|
573
|
-
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}";
|
|
574
|
-
|
|
575
|
-
let SelectBox = class {
|
|
576
|
-
constructor(hostRef) {
|
|
577
|
-
index.registerInstance(this, hostRef);
|
|
578
|
-
this.ezChange = index.createEvent(this, "ezChange", 7);
|
|
579
|
-
this.selectedOption = { value: "na", label: "N/A" };
|
|
580
|
-
}
|
|
581
|
-
render() {
|
|
582
|
-
return (index.h("ez-combo-box", { class: "grid-config-combo inverted", label: "", value: this.selectedOption, enabled: true, canShowError: false, suppressEmptyOption: true }, index.h("option", { value: "na" }, "N/A"), index.h("option", { value: "asc" }, "A-Z"), index.h("option", { value: "desc" }, "Z-A")));
|
|
583
|
-
}
|
|
584
|
-
static get assetsDirs() { return ["../assets"]; }
|
|
585
|
-
};
|
|
586
|
-
SelectBox.style = selectBoxCss;
|
|
587
|
-
|
|
588
|
-
exports.ez_button = EzButton;
|
|
589
501
|
exports.ez_list = EzList;
|
|
590
|
-
exports.select_box = SelectBox;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-88286449.js');
|
|
6
|
+
|
|
7
|
+
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%}}";
|
|
8
|
+
|
|
9
|
+
let EzModal = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.ezCloseModal = index.createEvent(this, "ezCloseModal", 7);
|
|
13
|
+
/**
|
|
14
|
+
* Controle de exibição do Modal
|
|
15
|
+
*/
|
|
16
|
+
this.opened = true;
|
|
17
|
+
/**
|
|
18
|
+
* Define se o modal será fechado ao clicar ESC
|
|
19
|
+
*/
|
|
20
|
+
this.closeEsc = false;
|
|
21
|
+
/**
|
|
22
|
+
* Define se o modal será fechado ao clicar fora do conteúdo.
|
|
23
|
+
*/
|
|
24
|
+
this.closeOutsideClick = false;
|
|
25
|
+
this.handleKeyboardEvent = (ev) => {
|
|
26
|
+
if ((ev === null || ev === void 0 ? void 0 : ev.key) === "Escape" && this.closeEsc) {
|
|
27
|
+
this.closeModal();
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
handleopenedChange() {
|
|
32
|
+
if (this.opened) {
|
|
33
|
+
document.addEventListener("keydown", this.handleKeyboardEvent);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
document.removeEventListener("keydown", this.handleKeyboardEvent);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
closeModal() {
|
|
40
|
+
this.opened = false;
|
|
41
|
+
this.ezCloseModal.emit(this.opened);
|
|
42
|
+
}
|
|
43
|
+
componentDidLoad() {
|
|
44
|
+
this.handleopenedChange();
|
|
45
|
+
}
|
|
46
|
+
onMouseDownHandler(event) {
|
|
47
|
+
if (this.closeOutsideClick && event.target === this._overlay) {
|
|
48
|
+
this.closeModal();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
render() {
|
|
52
|
+
const positionSufix = this.align === "left" ? "left" : "right";
|
|
53
|
+
return (index.h(index.Host, null, this.opened
|
|
54
|
+
?
|
|
55
|
+
index.h("div", { class: "modal", onMouseDown: evt => this.onMouseDownHandler(evt) }, index.h("div", { class: `modal__container modal__container--${positionSufix}`, ref: ref => this._overlay = ref }, index.h("div", { class: `modal__content modal__content--${positionSufix} ${this.modalSize}` }, index.h("slot", null))))
|
|
56
|
+
:
|
|
57
|
+
undefined));
|
|
58
|
+
}
|
|
59
|
+
static get watchers() { return {
|
|
60
|
+
"opened": ["handleopenedChange"]
|
|
61
|
+
}; }
|
|
62
|
+
};
|
|
63
|
+
EzModal.style = ezModalCss;
|
|
64
|
+
|
|
65
|
+
exports.ez_modal = EzModal;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-88286449.js');
|
|
6
|
+
const core = require('@sankhyalabs/core');
|
|
7
|
+
const CSSVarsUtils = require('./CSSVarsUtils-8fbdf2e0.js');
|
|
8
|
+
|
|
9
|
+
const ezNumberInputCss = ":host{display:block;width:100%}";
|
|
10
|
+
|
|
11
|
+
let EzNumberInput = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
this.ezChange = index.createEvent(this, "ezChange", 7);
|
|
15
|
+
/**
|
|
16
|
+
* Deixa o campo disponível ou não para uso.
|
|
17
|
+
*/
|
|
18
|
+
this.enabled = true;
|
|
19
|
+
}
|
|
20
|
+
setLabel() {
|
|
21
|
+
this._textInput.label = this.label;
|
|
22
|
+
}
|
|
23
|
+
setErrorMessage() {
|
|
24
|
+
this._textInput.errorMessage = this.errorMessage;
|
|
25
|
+
}
|
|
26
|
+
applyValueToInput() {
|
|
27
|
+
if (this._textInput) {
|
|
28
|
+
this._textInput.value = this.getTextValue(this.value);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Realiza o foco no componente de input
|
|
33
|
+
*/
|
|
34
|
+
async setFocus() {
|
|
35
|
+
this._textInput.setFocus();
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Remove o foco no componente de input
|
|
39
|
+
*/
|
|
40
|
+
async setBlur() {
|
|
41
|
+
this._textInput.setBlur();
|
|
42
|
+
}
|
|
43
|
+
changeValue(newValue) {
|
|
44
|
+
this.errorMessage = "";
|
|
45
|
+
if (newValue && newValue !== this.value) {
|
|
46
|
+
this.value = newValue;
|
|
47
|
+
this.ezChange.emit(this.value);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
parseNumber() {
|
|
51
|
+
const parsedNumber = this._textInput.value ? core.NumberUtils.stringToNumber(this._textInput.value) : null;
|
|
52
|
+
if (parsedNumber != null && isNaN(parsedNumber)) {
|
|
53
|
+
this.errorMessage = "O valor digitado não é um número válido";
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
try {
|
|
57
|
+
this.changeValue(parsedNumber);
|
|
58
|
+
}
|
|
59
|
+
catch (e) {
|
|
60
|
+
this.errorMessage = e.message;
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
getTextValue(value) {
|
|
66
|
+
if (value) {
|
|
67
|
+
return this.precision > 0 ? core.NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyPrecision)) : value.toString();
|
|
68
|
+
}
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
componentDidLoad() {
|
|
72
|
+
CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
73
|
+
}
|
|
74
|
+
render() {
|
|
75
|
+
return (index.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 }));
|
|
76
|
+
}
|
|
77
|
+
get _elem() { return index.getElement(this); }
|
|
78
|
+
static get watchers() { return {
|
|
79
|
+
"label": ["setLabel"],
|
|
80
|
+
"errorMessage": ["setErrorMessage"],
|
|
81
|
+
"value": ["applyValueToInput"]
|
|
82
|
+
}; }
|
|
83
|
+
};
|
|
84
|
+
EzNumberInput.style = ezNumberInputCss;
|
|
85
|
+
|
|
86
|
+
exports.ez_number_input = EzNumberInput;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-88286449.js');
|
|
6
|
+
const CSSVarsUtils = require('./CSSVarsUtils-8fbdf2e0.js');
|
|
7
|
+
|
|
8
|
+
const ezSearchCss = ":host{width:100%}";
|
|
9
|
+
|
|
10
|
+
let EzSearch = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
this.ezChange = index.createEvent(this, "ezChange", 7);
|
|
14
|
+
this.showPopup = index.createEvent(this, "showPopup", 7);
|
|
15
|
+
/**
|
|
16
|
+
* Deixa o campo disponível ou não.
|
|
17
|
+
*/
|
|
18
|
+
this.enabled = true;
|
|
19
|
+
/**
|
|
20
|
+
* Ajusta a opção de mostrar o "value" ao selecionar uma opção.
|
|
21
|
+
*/
|
|
22
|
+
this.showSelectedValue = true;
|
|
23
|
+
/**
|
|
24
|
+
* Ajusta a opção de mostrar o "value" para cada opção.
|
|
25
|
+
*/
|
|
26
|
+
this.showOptionValue = true;
|
|
27
|
+
}
|
|
28
|
+
updateValue() {
|
|
29
|
+
if (this._comboElement) {
|
|
30
|
+
this._comboElement.value = this.value;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Realiza o foco no componente de pesquisa
|
|
35
|
+
*/
|
|
36
|
+
async setFocus() {
|
|
37
|
+
this._comboElement.setFocus();
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Remove o foco no componente de pesquisa
|
|
41
|
+
*/
|
|
42
|
+
async setBlur() {
|
|
43
|
+
this._comboElement.setBlur();
|
|
44
|
+
}
|
|
45
|
+
onComboChange(evt) {
|
|
46
|
+
evt.stopPropagation();
|
|
47
|
+
this.value = evt.detail;
|
|
48
|
+
this.ezChange.emit(evt.detail);
|
|
49
|
+
}
|
|
50
|
+
componentDidLoad() {
|
|
51
|
+
CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this._elem, this._comboElement);
|
|
52
|
+
}
|
|
53
|
+
render() {
|
|
54
|
+
return (index.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 }));
|
|
55
|
+
}
|
|
56
|
+
;
|
|
57
|
+
get _elem() { return index.getElement(this); }
|
|
58
|
+
static get watchers() { return {
|
|
59
|
+
"value": ["updateValue"]
|
|
60
|
+
}; }
|
|
61
|
+
};
|
|
62
|
+
EzSearch.style = ezSearchCss;
|
|
63
|
+
|
|
64
|
+
exports.ez_search = EzSearch;
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-88286449.js');
|
|
6
|
+
|
|
7
|
+
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}";
|
|
8
|
+
|
|
9
|
+
let EzTabselector = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.ezChange = index.createEvent(this, "ezChange", 7);
|
|
13
|
+
this.setFocusedParam = (ev) => {
|
|
14
|
+
if (ev.key === "Enter") {
|
|
15
|
+
const selectedTab = this._processedTabs[this._focusedIndex];
|
|
16
|
+
this.handleTabClick(selectedTab);
|
|
17
|
+
ev.preventDefault();
|
|
18
|
+
this.setFocusedTab(selectedTab.index);
|
|
19
|
+
}
|
|
20
|
+
else if (ev.key === "ArrowLeft" || ev.key === "ArrowRight") {
|
|
21
|
+
let operator = undefined;
|
|
22
|
+
if (ev.key === "ArrowLeft") {
|
|
23
|
+
operator = false;
|
|
24
|
+
}
|
|
25
|
+
else if (ev.key === "ArrowRight") {
|
|
26
|
+
operator = true;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (this._focusedIndex === undefined) {
|
|
32
|
+
if (operator === false) {
|
|
33
|
+
this._focusedIndex = this.selectedIndex !== undefined ? this.selectedIndex - 1 : undefined;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
this._focusedIndex = this.selectedIndex !== undefined ? this.selectedIndex + 1 : undefined;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
if (operator === false) {
|
|
41
|
+
this._focusedIndex = this._focusedIndex - 1;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
this._focusedIndex = this._focusedIndex + 1;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (this._focusedIndex < 0) {
|
|
48
|
+
this._focusedIndex = 0;
|
|
49
|
+
}
|
|
50
|
+
else if (this._focusedIndex > this._processedTabs.length - 1) {
|
|
51
|
+
this._focusedIndex = this._processedTabs.length - 1;
|
|
52
|
+
}
|
|
53
|
+
this.setFocusedBtn(true, this._focusedIndex);
|
|
54
|
+
this.setFocusedTab(this._focusedIndex);
|
|
55
|
+
}
|
|
56
|
+
else if (ev.key === "Tab" || ev.key === "Escape") {
|
|
57
|
+
const currentTab = this._processedTabs[this.selectedIndex];
|
|
58
|
+
this._focusedIndex = undefined;
|
|
59
|
+
this.handleTabClick(currentTab);
|
|
60
|
+
ev.preventDefault();
|
|
61
|
+
this.setFocusedTab(this.selectedIndex);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
handleTabClick(tab) {
|
|
66
|
+
this.selectedIndex = tab.index;
|
|
67
|
+
this._focusedIndex = undefined;
|
|
68
|
+
this.selectedTab = tab.tabKey;
|
|
69
|
+
this.ezChange.emit(tab);
|
|
70
|
+
this.setFocusedBtn(false, tab.index);
|
|
71
|
+
}
|
|
72
|
+
componentWillRender() {
|
|
73
|
+
if (!this._processedTabs) {
|
|
74
|
+
this._processedTabs = [];
|
|
75
|
+
if (this.tabs) {
|
|
76
|
+
this.tabs.split(",").forEach((label) => {
|
|
77
|
+
label = label.trim();
|
|
78
|
+
this._processedTabs.push({ label, tabKey: label, index: this._processedTabs.length });
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
this._hostElem.querySelectorAll("ez-tab").forEach((elem) => {
|
|
82
|
+
const tabKey = elem.getAttribute("tabKey");
|
|
83
|
+
const label = elem.getAttribute("label");
|
|
84
|
+
const t = { label, tabKey, index: this._processedTabs.length };
|
|
85
|
+
const content = elem.firstChild;
|
|
86
|
+
if (content) {
|
|
87
|
+
content.setAttribute("slot", "tab" + t.index);
|
|
88
|
+
this._hostElem.appendChild(content);
|
|
89
|
+
}
|
|
90
|
+
this._processedTabs.push(t);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
handleSlotChange(ev) {
|
|
95
|
+
const slot = ev.target;
|
|
96
|
+
const content = slot.assignedElements()[0];
|
|
97
|
+
if (content) {
|
|
98
|
+
content.style.marginLeft = "6px";
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
scrollBackward() {
|
|
102
|
+
const container = this._scrollContainer;
|
|
103
|
+
if (container) {
|
|
104
|
+
container.scrollLeft -= container.clientWidth;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
scrollFoward() {
|
|
108
|
+
const container = this._scrollContainer;
|
|
109
|
+
if (container) {
|
|
110
|
+
let lastTab = null;
|
|
111
|
+
container.querySelectorAll(".tab").forEach((tab) => {
|
|
112
|
+
if (tab.getBoundingClientRect().right < container.clientWidth) {
|
|
113
|
+
lastTab = tab;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
container.scrollLeft = lastTab.offsetLeft + lastTab.offsetWidth;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
componentDidRender() {
|
|
120
|
+
this.updateScroll();
|
|
121
|
+
}
|
|
122
|
+
updateScroll() {
|
|
123
|
+
const container = this._scrollContainer;
|
|
124
|
+
if (container) {
|
|
125
|
+
const { scrollWidth, clientWidth, scrollLeft } = container;
|
|
126
|
+
const remainingScroll = scrollWidth - clientWidth - Math.ceil(scrollLeft);
|
|
127
|
+
this._startHidden = container.scrollLeft > 0;
|
|
128
|
+
this._endHidden = remainingScroll > 0;
|
|
129
|
+
if (this._startHidden) {
|
|
130
|
+
this._backwardButton.classList.remove("hidden");
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
this._backwardButton.classList.add("hidden");
|
|
134
|
+
}
|
|
135
|
+
if (this._endHidden) {
|
|
136
|
+
this._forwardButton.classList.remove("hidden");
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
this._forwardButton.classList.add("hidden");
|
|
140
|
+
}
|
|
141
|
+
const classNames = ["", "startHidden", "endHidden", "midle"];
|
|
142
|
+
const currentClass = classNames[Number(this._startHidden) | Number(this._endHidden) << 1];
|
|
143
|
+
classNames.forEach((name) => {
|
|
144
|
+
if (name !== currentClass && container.classList.contains(name)) {
|
|
145
|
+
container.classList.remove(name);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
if (currentClass && !container.classList.contains(currentClass)) {
|
|
149
|
+
container.classList.add(currentClass);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
domScrollHandler() {
|
|
154
|
+
window.clearTimeout(this._scrollCallBack);
|
|
155
|
+
this._scrollCallBack = window.setTimeout(() => { this.updateScroll(); }, 200);
|
|
156
|
+
}
|
|
157
|
+
setFocusedTab(index) {
|
|
158
|
+
window.clearTimeout(this._scrollCallBackTest);
|
|
159
|
+
this._scrollCallBackTest = window.setTimeout(() => {
|
|
160
|
+
const tabtoscroll = this._scrollContainer.querySelector(`#tab${index}`);
|
|
161
|
+
tabtoscroll.scrollIntoView();
|
|
162
|
+
}, 200);
|
|
163
|
+
}
|
|
164
|
+
getTextWidth(text) {
|
|
165
|
+
if (this._textMesurement === undefined) {
|
|
166
|
+
this._textMesurement = this._hostElem.shadowRoot.ownerDocument.createElement("canvas");
|
|
167
|
+
}
|
|
168
|
+
const context = this._textMesurement.getContext("2d");
|
|
169
|
+
context.font = "14px Sora, Algerian";
|
|
170
|
+
return Math.min(220, 24 + context.measureText(text).width) + "px";
|
|
171
|
+
}
|
|
172
|
+
;
|
|
173
|
+
setFocusedBtn(visible, parameter) {
|
|
174
|
+
const tabsButtons = this._scrollContainer.querySelectorAll(".tab");
|
|
175
|
+
tabsButtons.forEach((el) => {
|
|
176
|
+
el.classList.remove("is-focused");
|
|
177
|
+
if (el.id === "tab" + parameter && visible) {
|
|
178
|
+
el.classList.add("is-focused");
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
render() {
|
|
183
|
+
return (index.h(index.Host, null, index.h("button", { class: "backward-button", ref: (el) => this._backwardButton = el, onClick: () => this.scrollBackward() }), index.h("div", { class: "scroll", ref: (el) => this._scrollContainer = el, onScroll: () => this.domScrollHandler(), onKeyDown: (ev) => this.setFocusedParam(ev) }, this._processedTabs.map((tab, index$1) => {
|
|
184
|
+
const labelStyle = { "min-width": this.getTextWidth(tab.label) };
|
|
185
|
+
const tabId = "tab" + index$1;
|
|
186
|
+
const isSelected = index$1 === this.selectedIndex || (this.selectedTab && tab.tabKey === this.selectedTab);
|
|
187
|
+
if (isSelected) {
|
|
188
|
+
this.selectedTab = tab.tabKey;
|
|
189
|
+
this.selectedIndex = index$1;
|
|
190
|
+
}
|
|
191
|
+
return index.h("button", { id: tabId, class: `tab${isSelected ? " is-active" : ""}`, onClick: () => this.handleTabClick(tab), style: labelStyle }, index.h("span", { class: "tab-label", title: tab.label }, tab.label), index.h("slot", { name: tabId, onSlotchange: (ev) => { this.handleSlotChange(ev); } }));
|
|
192
|
+
})), index.h("button", { class: "forward-button", ref: (el) => this._forwardButton = el, onClick: () => this.scrollFoward() })));
|
|
193
|
+
}
|
|
194
|
+
get _hostElem() { return index.getElement(this); }
|
|
195
|
+
};
|
|
196
|
+
EzTabselector.style = ezTabselectorCss;
|
|
197
|
+
|
|
198
|
+
exports.ez_tabselector = EzTabselector;
|