@sankhyalabs/ezui 6.3.0-dev.6 → 6.3.0-ms.1
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/{app-globals-0a67e214.js → app-globals-cdb08d04.js} +1 -3
- package/dist/cjs/ez-button.cjs.entry.js +26 -96
- package/dist/cjs/ez-card-item_2.cjs.entry.js +1 -1
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-tree.cjs.entry.js +0 -35
- package/dist/cjs/ezui.cjs.js +2 -2
- package/dist/cjs/index-a7b0c73d.js +0 -4
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +0 -1
- package/dist/collection/components/ez-button/ez-button.css +80 -292
- package/dist/collection/components/ez-button/ez-button.js +29 -226
- package/dist/collection/components/ez-card-item/ez-card-item.css +3 -7
- package/dist/collection/components/ez-icon/ez-icon.css +1271 -1303
- package/dist/collection/components/ez-tree/ez-tree.js +0 -44
- package/dist/collection/components/ez-tree/types/Tree.js +0 -23
- package/dist/collection/global/app-init.js +1 -3
- package/dist/custom-elements/index.d.ts +0 -6
- package/dist/custom-elements/index.js +31 -156
- package/dist/esm/{app-globals-8a94d86c.js → app-globals-8c57b015.js} +1 -3
- package/dist/esm/ez-button.entry.js +27 -97
- package/dist/esm/ez-card-item_2.entry.js +1 -1
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-tree.entry.js +0 -35
- package/dist/esm/ezui.js +2 -2
- package/dist/esm/index-baa5e267.js +0 -4
- package/dist/esm/loader.js +2 -2
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-1bcfd88c.entry.js +1 -0
- package/dist/ezui/p-2d080bdc.entry.js +1 -0
- package/dist/ezui/{p-5e495d47.entry.js → p-8afb6e8a.entry.js} +1 -1
- package/dist/ezui/p-b2b1a1a7.entry.js +1 -0
- package/dist/types/components/ez-button/ez-button.d.ts +2 -48
- package/dist/types/components/ez-tree/ez-tree.d.ts +0 -8
- package/dist/types/components/ez-tree/types/Tree.d.ts +0 -3
- package/dist/types/components.d.ts +2 -97
- package/package.json +3 -4
- package/react/components.d.ts +0 -1
- package/react/components.js +0 -1
- package/react/components.js.map +1 -1
- package/dist/cjs/ez-list-item.cjs.entry.js +0 -22
- package/dist/collection/components/ez-list-item/ez-list-item.css +0 -61
- package/dist/collection/components/ez-list-item/ez-list-item.js +0 -78
- package/dist/esm/ez-list-item.entry.js +0 -18
- package/dist/ezui/p-3751da14.entry.js +0 -1
- package/dist/ezui/p-6f77a359.entry.js +0 -1
- package/dist/ezui/p-d6742c1e.entry.js +0 -1
- package/dist/ezui/p-dee18824.entry.js +0 -1
- package/dist/types/components/ez-list-item/ez-list-item.d.ts +0 -9
- /package/dist/ezui/{p-07819d50.js → p-76ad2e26.js} +0 -0
|
@@ -4,9 +4,7 @@ const index = require('./index-425b1f67.js');
|
|
|
4
4
|
|
|
5
5
|
async function initializeApp() {
|
|
6
6
|
await index.initI18n();
|
|
7
|
-
|
|
8
|
-
console.log('Global initialization ez-ui completed!');
|
|
9
|
-
}
|
|
7
|
+
console.log('Global initialization ez-ui completed!');
|
|
10
8
|
}
|
|
11
9
|
|
|
12
10
|
const globalScripts = initializeApp;
|
|
@@ -5,58 +5,23 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-a7b0c73d.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
|
|
8
|
-
const ezButtonCss = ":host{--ez-button--min-width:50px;--ez-button--width:auto;--ez-button--height:var(--space--42, 42px);--ez-button--padding-top:var(--space--0, 0px);--ez-button--padding-bottom:var(--space--0, 0px);--ez-button--padding-right:var(--space--12, 12px);--ez-button--padding-left:var(--space--12, 12px);--ez-button--icon--gap:var(--space--8, 8px);--ez-button--color:var(--color--ocean-green-600, #008561);--ez-button--label-icon--color:var(--color--ocean-green-500, #1A9171);--ez-button--label-icon--hover-color:var(--color--ocean-green-700, #00684C);--ez-button--label-icon--disabled-color:var(--color--gray-400);--ez-button--left-icon--color:var(--color--ocean-green-600, #008561);--ez-button--right-icon--color:var(--color--ocean-green-600, #008561);--ez-button--left-icon--hover-color:var(--color--ocean-green-600, #008561);--ez-button--right-icon--hover-color:var(--color--ocean-green-600, #008561);--ez-button--left-icon--disabled-color:var(--color--gray-300, #A4A5A7);--ez-button--right-icon--disabled-color:var(--color--gray-300, #A4A5A7);--ez-button--font-size:var(--font-size--default, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--font-weight--medium, 500);--ez-button--background-color:var(--color--gray-70, #ffffff);--ez-button--border-radius:var(--border--radius--24, 24px);--ez-button--border:1px solid var(--color--gray-90, #EAEAEA);--ez-button--hover--border:1px solid var(--color--gray-90, #EAEAEA);--ez-button--justify-content:center;--ez-button--hover-color:var(--color--ocean-green-600, #008561);--ez-button--hover--background-color:var(--color--gray-80, #F9F9F9);--ez-button--disabled-color:var(--color--gray-400, #77777A);--ez-button--disabled--background-color:var(--color--gray-80, #F9F9F9);--ez-button--disabled--border:1px solid var(--color--gray-200, #A4A5A7);--ez-button--disabled-icon-color:var(--color--gray-400, #D2D2D3);--ez-button--link-color:var(--color--ocean-green-600, #008561);--ez-button--link--hover-color:var(--color--primary-700, #1C1D22);--ez-button--link-disabled-color:var(--color--gray-400, #77777A);--ez-button--link--small--font-size:var(--font-size--small, 12px);--ez-button--link--medium--font-size:var(--font-size--default, 14px);--ez-button--link--large--font-size:var(--font-size--medium, 16px);display:flex;width:fit-content}:host(.ez-button--primary){--ez-button--color:var(--color--gray-70);--ez-button--background-color:var(--color--ocean-green-500);--ez-button--font-weight:var(--font-weight--regular);--ez-button--left-icon--color:var(--color--gray-70);--ez-button--right-icon--color:var(--color--gray-70);--ez-button--border:1px solid var(--color--ocean-green-500);--ez-button--hover-color:var(--color--gray-70);--ez-button--hover--background-color:var(--color--ocean-green-700);--ez-button--hover--border:1px solid var(--color--ocean-green-700);--ez-button--left-icon--hover-color:var(--color--gray-70);--ez-button--right-icon--hover-color:var(--color--gray-70);--ez-button--disabled-color:var(--color--gray-70);--ez-button--disabled--background-color:var(--color--gray-400);--ez-button--disabled--border:1px solid var(--color--gray-400);--ez-button--disabled-icon-color:var(--color--gray-200);--ez-button--left-icon--disabled-color:var(--color--gray-200);--ez-button--right-icon--disabled-color:var(--color--gray-200)}:host(.ez-button--secondary){--ez-button--color:var(--color--ocean-green-600);--ez-button--background-color:var(--color--gray-70);--ez-button--border:1px solid var(--color--gray-90);--ez-button--left-icon--color:var(--color--ocean-green-600);--ez-button--right-icon--color:var(--color--ocean-green-600);--ez-button--hover-color:var(--color--ocean-green-600);--ez-button--hover--background-color:var(--color--gray-80);--ez-button--hover--border:1px solid var(--color--gray-90);--ez-button--left-icon--hover-color:var(--color--ocean-green-600);--ez-button--right-icon--hover-color:var(--color--ocean-green-600);--ez-button--disabled-color:var(--color--gray-400);--ez-button--disabled--background-color:var(--color--gray-80);--ez-button--disabled--border:1px solid var(--color--gray-200);--ez-button--disabled-icon-color:var(--color--gray-400);--ez-button--left-icon--disabled-color:var(--color--gray-300);--ez-button--right-icon--disabled-color:var(--color--gray-300)}:host(.ez-button--tertiary){--ez-button--color:var(--color--ocean-green-600);--ez-button--background-color:transparent;--ez-button--font-weight:var(--font-weight--regular);--ez-button--border:none;--ez-button--left-icon--color:var(--color--ocean-green-600);--ez-button--right-icon--color:var(--color--ocean-green-600);--ez-button--hover-color:var(--color--ocean-green-800);--ez-button--hover--background-color:transparent;--ez-button--hover--border:none;--ez-button--left-icon--hover-color:var(--color--ocean-green-800);--ez-button--right-icon--hover-color:var(--color--ocean-green-800);--ez-button--disabled-color:var(--color--gray-400);--ez-button--disabled--background-color:transparent;--ez-button--disabled--border:transparent;--ez-button--disabled-icon-color:var(--color--gray-200);--ez-button--left-icon--disabled-color:var(--color--gray-200);--ez-button--right-icon--disabled-color:var(--color--gray-200)}:host(.ez-button--link--primary){color:var(--color--primary);fill:var(--color--primary)}button{position:relative;display:flex;align-items:center;outline:0;border:0;margin:0;padding:0;cursor:pointer;transition:background-color 0.2s linear, transform 0.15s ease;white-space:nowrap;box-sizing:border-box;overflow:hidden;transform:scale(1);min-width:var(--ez-button--min-width);width:var(--ez-button--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);gap:var(--ez-button--icon--gap);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border);justify-content:var(--ez-button--justify-content)}button.pressed{transform:scale(0.98)}button.btn-icon{transition:background-color 0.2s linear, transform 0.15s ease;transform:scale(1)}button.btn-icon.pressed{transform:scale(0.95)}button:disabled,button[aria-disabled]{transform:scale(1) !important}.ripple{position:absolute;width:20px;height:20px;border-radius:50%;background:rgba(255, 255, 255, 0.3);pointer-events:none;transform:scale(0);animation:ripple-animation 0.6s linear;z-index:0}@keyframes ripple-animation{to{transform:scale(4);opacity:0}}:host .ripple,:host(.ez-button--secondary) .ripple{background:rgba(0, 133, 97, 0.2)}:host(.ez-button--primary) .ripple{background:rgba(255, 255, 255, 0.3)}:host(.ez-button--tertiary) .ripple{background:rgba(0, 133, 97, 0.15)}button>*:not(.ripple){position:relative;z-index:1}button:disabled .ripple,button[aria-disabled] .ripple{display:none}button:hover{background-color:var(--ez-button--hover--background-color);border:var(--ez-button--hover--border);color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}button[aria-disabled]:active,button:disabled:active,button[aria-disabled]:hover,button:disabled:hover,button[aria-disabled],button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);--ez-icon--color:var(--ez-button--disabled-icon-color);--ez-button--left-icon--color:var(--ez-button--left-icon--disabled-color);--ez-button--right-icon--color:var(--ez-button--right-icon--disabled-color);cursor:no-drop;border:var(--ez-button--disabled--border)}button[aria-disabled].force-focus-visible,button[aria-disabled]:focus-visible{box-shadow:0 0 0 2px var(--color--gray-70), 0 0 0 4px var(--color--petroleum-100)}button ez-icon{--ez-icon--color:inherit}button ez-icon.leftIcon{--ez-icon--color:var(--ez-button--left-icon--color)}button ez-icon.rightIcon{--ez-icon--color:var(--ez-button--right-icon--color)}button:hover ez-icon.leftIcon{--ez-icon--color:var(--ez-button--left-icon--hover-color)}button:hover ez-icon.rightIcon{--ez-icon--color:var(--ez-button--right-icon--hover-color)}button:disabled:hover ez-icon.leftIcon,button[aria-disabled]:hover ez-icon.leftIcon{--ez-icon--color:var(--ez-button--left-icon--disabled-color)}button:disabled:hover ez-icon.rightIcon,button[aria-disabled]:hover ez-icon.rightIcon{--ez-icon--color:var(--ez-button--right-icon--disabled-color)}button.x-small{height:28px;--ez-button--font-size:var(--text--small, 12px)}button.small{height:32px;--ez-button--font-size:var(--text--small, 12px)}button.medium{height:42px}button.large{height:46px}button.btn-icon{padding:0px}.btn-icon--medium{width:42px;min-width:42px;height:42px}.btn-icon--x-small{width:28px;min-width:28px;height:28px}.btn-icon--small{width:32px;min-width:32px;height:32px}.btn-icon--large{width:46px;min-width:46px;height:46px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--label-icon--color)}.label-icon:hover{color:var(--ez-button--label-icon--hover-color);fill:var(--ez-button--label-icon--hover-color)}.label-icon .disabled{color:var(--ez-button--label-icon--disabled-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);user-select:none}button[aria-disabled]+label,button:disabled+label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);color:var(--ez-button--label-icon--disabled-color);cursor:no-drop}button.force-focus-visible,button:focus-visible{box-shadow:0 0 0 2px var(--color--gray-70), 0 0 0 4px var(--color--ocean-green-200)}div.label-icon{cursor:pointer}div.label-icon button[aria-disabled],div.label-icon button:disabled{cursor:no-drop}a{outline:0;border:0;margin:0;border-radius:0;padding:0;margin:0;padding-inline:var(--space--8);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;border-radius:var(--ez-button--border-radius);gap:var(--ez-button--icon--gap)}a ez-icon{--ez-icon--color:var(--ez-button--link--color)}a:hover{color:var(--ez-button--link--hover-color);--ez-icon--color:var(--ez-button--link--hover-color)}a:hover ez-icon{--ez-icon--color:var(--ez-button--link--hover-color)}a.disabled{color:var(--ez-button--link-disabled-color);cursor:not-allowed}a.disabled ez-icon{--ez-icon--color:var(--ez-button--link-disabled-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)}a.force-focus-visible,a:focus-visible{box-shadow:0 0 0 2px var(--color--gray-70), 0 0 0 4px var(--color--ocean-green-200)}a.disabled.force-focus-visible,a.disabled:focus-visible{box-shadow:0 0 0 2px var(--color--gray-70), 0 0 0 4px var(--color--petroleum-100)}";
|
|
8
|
+
const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--width:'auto';--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:0px;--ez-button--padding-bottom:0px;--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--title--primary, #2B3A54);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large, 500);--ez-button--background-color:var(--background--light, #ffffff);--ez-button--border-radius:var(--border--radius-large, 24px);--ez-button--border:1px solid var(--color--strokes);--ez-button--justify-content:center;--ez-button--hover-color:var(--color--primary-600, #007a5a);--ez-button--hover--background-color:var(--background--light, #ffffff);--ez-button--disabled-color:var(--text--primary);--ez-button--disabled--background-color:var(--background--medium);--ez-button--focus--border:var(--border--medium, 2px solid) var(--color--primary-300);--ez-button--focus--box-shadow:var(--color--primary-300) 0px 0px 0px 2px;--ez-button--active-color:var(--color--primary-700);--ez-button--active--background-color:var(--background--strong);--ez-button--link-color:var(--color--primary, '#008561');--ez-button--link--hover-color:var(--color--primary-700, '#1C1D22');--ez-button--link-disabled-color:var(--text--secondary, #a2abb9);--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{position:relative;display:flex;align-items:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;white-space:nowrap;min-width:var(--ez-button--min-width);width:var(--ez-button--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);justify-content:var(--ez-button--justify-content)}button:focus{outline:none;box-shadow:var(--ez-button--focus--box-shadow)}button:hover{outline:none;background-color:var(--ez-button--hover--background-color);color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}button:active{outline:none;box-shadow:none;background-color:var(--ez-button--active--background-color);color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);--ez-icon--color:var(--ez-button--disabled-color);cursor:no-drop}.x-small{height:28px;--ez-button--font-size:var(--text--small, 12px)}.small{height:32px;--ez-button--font-size:var(--text--small, 12px)}.medium{height:42px}.large{height:46px}.btn-icon{padding:0px}.btn-icon--medium{width:42px;min-width:42px;height:42px}.btn-icon--x-small{width:28px;min-width:28px;height:28px}.btn-icon--small{width:32px;min-width:32px;height:32px}.btn-icon--large{width:46px;min-width:46px;height:46px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--color)}.label-icon:hover{color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}.label-icon:active{color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-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);user-select:none}button:disabled+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);color:var(--ez-button--disabled-color);cursor:no-drop}div.label-icon{cursor:pointer}div.label-icon,button:disabled{cursor:no-drop}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)}a.disabled{color:var(--ez-button--link-disabled-color);cursor:not-allowed}";
|
|
9
9
|
|
|
10
10
|
const EzButton = class {
|
|
11
11
|
constructor(hostRef) {
|
|
12
12
|
index.registerInstance(this, hostRef);
|
|
13
|
-
this.createRipple = (event) => {
|
|
14
|
-
const button = this._button;
|
|
15
|
-
if (!button || this.isDisabled || !this.enabled)
|
|
16
|
-
return;
|
|
17
|
-
const rect = button.getBoundingClientRect();
|
|
18
|
-
let clientX, clientY;
|
|
19
|
-
if (event instanceof MouseEvent) {
|
|
20
|
-
clientX = event.clientX;
|
|
21
|
-
clientY = event.clientY;
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
clientX = event.touches[0].clientX;
|
|
25
|
-
clientY = event.touches[0].clientY;
|
|
26
|
-
}
|
|
27
|
-
const x = clientX - rect.left;
|
|
28
|
-
const y = clientY - rect.top;
|
|
29
|
-
const newRipple = { x, y, id: Date.now() };
|
|
30
|
-
this.ripples = [...this.ripples, newRipple];
|
|
31
|
-
this.isPressed = true;
|
|
32
|
-
setTimeout(() => {
|
|
33
|
-
this.isPressed = false;
|
|
34
|
-
}, 150);
|
|
35
|
-
setTimeout(() => {
|
|
36
|
-
this.ripples = this.ripples.filter(ripple => ripple.id !== newRipple.id);
|
|
37
|
-
}, 600);
|
|
38
|
-
};
|
|
39
|
-
this.ripples = [];
|
|
40
|
-
this.isPressed = false;
|
|
41
13
|
this.label = undefined;
|
|
42
14
|
this.enabled = true;
|
|
43
|
-
this.isDisabled = false;
|
|
44
15
|
this.mode = "regular";
|
|
45
16
|
this.image = undefined;
|
|
46
17
|
this.iconName = undefined;
|
|
47
|
-
this.size =
|
|
48
|
-
this.variant = undefined;
|
|
49
|
-
this.type = "button";
|
|
50
|
-
this.leftIconName = undefined;
|
|
51
|
-
this.rightIconName = undefined;
|
|
52
|
-
this.suppressAnimation = false;
|
|
18
|
+
this.size = undefined;
|
|
53
19
|
}
|
|
54
20
|
/**
|
|
55
21
|
* Aplica o foco no botão.
|
|
56
22
|
*/
|
|
57
23
|
async setFocus() {
|
|
58
24
|
this._button.focus();
|
|
59
|
-
this._button.classList.add("force-focus-visible");
|
|
60
25
|
}
|
|
61
26
|
/**
|
|
62
27
|
* Remove o foco do botão.
|
|
@@ -64,32 +29,12 @@ const EzButton = class {
|
|
|
64
29
|
async setBlur() {
|
|
65
30
|
this._button.blur();
|
|
66
31
|
}
|
|
67
|
-
onMouseDown(event) {
|
|
68
|
-
this.createRipple(event);
|
|
69
|
-
}
|
|
70
|
-
onTouchStart(event) {
|
|
71
|
-
this.createRipple(event);
|
|
72
|
-
}
|
|
73
32
|
clickListener(evt) {
|
|
74
|
-
|
|
75
|
-
this.isDisabled === true ||
|
|
76
|
-
this.isDisabled === "" ||
|
|
77
|
-
this.isDisabled === "full";
|
|
78
|
-
if (isDisabled) {
|
|
33
|
+
if (!this.enabled) {
|
|
79
34
|
evt.stopImmediatePropagation();
|
|
80
35
|
}
|
|
81
36
|
}
|
|
82
|
-
removeForcedFocusVisible() {
|
|
83
|
-
var _a;
|
|
84
|
-
(_a = this._button) === null || _a === void 0 ? void 0 : _a.classList.remove('force-focus-visible');
|
|
85
|
-
}
|
|
86
|
-
connectedCallback() {
|
|
87
|
-
var _a, _b;
|
|
88
|
-
(_a = this._button) === null || _a === void 0 ? void 0 : _a.removeEventListener('blur', this.removeForcedFocusVisible.bind(this));
|
|
89
|
-
(_b = this._button) === null || _b === void 0 ? void 0 : _b.addEventListener('blur', this.removeForcedFocusVisible.bind(this));
|
|
90
|
-
}
|
|
91
37
|
componentDidLoad() {
|
|
92
|
-
var _a;
|
|
93
38
|
if (this._element) {
|
|
94
39
|
core.ElementIDUtils.addIDInfo(this._element);
|
|
95
40
|
}
|
|
@@ -97,23 +42,17 @@ const EzButton = class {
|
|
|
97
42
|
const dataInfo = { id: 'embedded' };
|
|
98
43
|
core.ElementIDUtils.addIDInfo(this._button, 'button', dataInfo);
|
|
99
44
|
}
|
|
100
|
-
(_a = this._button) === null || _a === void 0 ? void 0 : _a.addEventListener('blur', this.removeForcedFocusVisible.bind(this));
|
|
101
|
-
}
|
|
102
|
-
disconnectCallback() {
|
|
103
|
-
var _a;
|
|
104
|
-
(_a = this._button) === null || _a === void 0 ? void 0 : _a.removeEventListener('blur', this.removeForcedFocusVisible.bind(this));
|
|
105
45
|
}
|
|
106
46
|
getButtonSize(sizeParam = "medium") {
|
|
107
47
|
const sizeList = ["x-small", "small", "medium", "large"];
|
|
108
48
|
const sizeLowerCase = this.size && this.size.toLowerCase();
|
|
109
49
|
return sizeList.includes(sizeLowerCase) ? sizeLowerCase : sizeParam;
|
|
110
50
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
return iconSize;
|
|
51
|
+
getIconSize(sizeParam = "medium") {
|
|
52
|
+
const sizeList = ["small", "medium", "large"];
|
|
53
|
+
const sizeLowerCase = this.size && this.size.toLowerCase();
|
|
54
|
+
const sizeMapped = sizeLowerCase === "x-small" ? "small" : sizeLowerCase;
|
|
55
|
+
return sizeList.includes(sizeMapped) ? sizeMapped : sizeParam;
|
|
117
56
|
}
|
|
118
57
|
handleSlotChange(ev) {
|
|
119
58
|
const slot = ev.target;
|
|
@@ -121,40 +60,31 @@ const EzButton = class {
|
|
|
121
60
|
if (!!content) {
|
|
122
61
|
if (this.mode == "link") {
|
|
123
62
|
content.style.display = "inline";
|
|
63
|
+
if (slot.name == "leftIcon") {
|
|
64
|
+
content.style.paddingRight = "var(--ez-button__inline__icon--padding)";
|
|
65
|
+
}
|
|
66
|
+
else if (slot.name == "rightIcon") {
|
|
67
|
+
content.style.paddingLeft = "var(--ez-button__inline__icon--padding)";
|
|
68
|
+
}
|
|
124
69
|
}
|
|
125
70
|
else {
|
|
126
71
|
content.style.setProperty("--ez-icon--color", "var(--ez-icon--color)");
|
|
127
72
|
}
|
|
128
73
|
}
|
|
129
74
|
}
|
|
130
|
-
renderRipples() {
|
|
131
|
-
return this.ripples.map((ripple) => (index.h("span", { key: ripple.id, class: "ripple", style: {
|
|
132
|
-
left: `${ripple.x - 10}px`,
|
|
133
|
-
top: `${ripple.y - 10}px`,
|
|
134
|
-
} })));
|
|
135
|
-
}
|
|
136
75
|
render() {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
: index.h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
150
|
-
}
|
|
151
|
-
return (index.h("button", { class: `${this.getButtonSize("")} ${this.isPressed ? 'pressed' : ''}`, type: this.type, disabled: this.isDisabled === "full" || !this.enabled, "aria-disabled": this.isDisabled && this.isDisabled === true, ref: (el) => this._button = el }, this.leftIconName
|
|
152
|
-
? index.h("ez-icon", { class: "leftIcon", iconName: this.leftIconName, size: this.getIconSize() })
|
|
153
|
-
: index.h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, this.rightIconName
|
|
154
|
-
? index.h("ez-icon", { class: "rightIcon", iconName: this.rightIconName, size: this.getIconSize() })
|
|
155
|
-
: index.h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), !this.suppressAnimation && this.renderRipples()));
|
|
156
|
-
};
|
|
157
|
-
return (index.h(index.Host, { class: `${this.variant ? `ez-button--${this.variant}` : ""}` }, renderButton()));
|
|
76
|
+
if (this.mode == "icon") {
|
|
77
|
+
return (index.h("button", { class: "btn-icon " + ((this.getButtonSize()) ? `btn-icon--${this.getButtonSize()}` : ""), 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() })));
|
|
78
|
+
}
|
|
79
|
+
else if (this.mode == "label-icon") {
|
|
80
|
+
return (index.h("div", { class: "label-icon" }, index.h("button", { class: "btn-icon " + ((this.getButtonSize()) ? `btn-icon--${this.getButtonSize()}` : ""), 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() })), index.h("label", { title: this.label }, this.label)));
|
|
81
|
+
}
|
|
82
|
+
else if (this.mode == "link") {
|
|
83
|
+
return (index.h("a", { class: `${this.getIconSize()} ${!this.enabled ? "disabled" : ""}`, 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); } })));
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
return (index.h("button", { class: this.getButtonSize(""), 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); } })));
|
|
87
|
+
}
|
|
158
88
|
}
|
|
159
89
|
get _element() { return index.getElement(this); }
|
|
160
90
|
};
|
|
@@ -6,7 +6,7 @@ const index = require('./index-a7b0c73d.js');
|
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const floatingUi_dom_esm = require('./floating-ui.dom.esm-017acce4.js');
|
|
8
8
|
|
|
9
|
-
const ezCardItemCss = ":host { \n /*@doc Define o tamanho da fonte do componente.*/\n --ez-card-item--font-size: var(--text--medium, 14px);\n\n /*@doc Define o tamanho da fonte do componente no modo compacto.*/\n --ez-card-item--font-size-compacted: var(--text--extra-small, 10px);\n\n /*@doc Define a família da fonte do componente.*/\n --ez-card-item--font-family: var(--font-pattern, Arial);\n\n /*@doc Define o peso da fonte do componente.*/\n --ez-card-item--font-weight: var(--
|
|
9
|
+
const ezCardItemCss = ":host { \n /*@doc Define o tamanho da fonte do componente.*/\n --ez-card-item--font-size: var(--text--medium, 14px);\n\n /*@doc Define o tamanho da fonte do componente no modo compacto.*/\n --ez-card-item--font-size-compacted: var(--text--extra-small, 10px);\n\n /*@doc Define a família da fonte do componente.*/\n --ez-card-item--font-family: var(--font-pattern, Arial);\n\n /*@doc Define o peso da fonte do componente.*/\n --ez-card-item--font-weight: var(--text-weight--medium, 400);\n\n /*@doc Define o peso da fonte do title do componente.*/\n --ez-card-item--font-weight-large: var(--text-weight--large, 600);\n\n /*@doc Define a cor da fonte do componente.*/\n --ez-card-item--color: var(--text--primary, #626e82);\n\n /*@doc Define a cor da fonte da key do componente.*/\n --ez-card-item__key--color: var(--text--primary, #626e82);\n\n /*@doc Define a cor da fonte do label do detalhe do componente.*/\n --ez-card-item__detail-label--color: var(--text--secondary, #A2ABB9);\n\n /*@doc Define o espaçamento inferior dos detalhes do componente.*/\n --ez-card-item__detail--padding-bottom: var(--space--extra-small, 3px);\n\n /*@doc Define o espaçamento inferior do title do componente.*/\n --ez-card-item__title--padding-bottom: var(--space--extra-small, 3px);\n\n /*@doc Define a cor do highlight / marcação nos textos do componente.*/\n --ez-card-item__highlight--color: var(--color--primary-300, #E2F4EF);\n\n /*@doc Define o peso da fonte do componente.*/\n --ez-card-item--detail-label--font-weight: var(--text-weight--large, 400);\n\n width: 100%;\n display: flex;\n cursor: pointer;\n}\n\n.card-item {\n display: flex;\n flex-direction: column;\n width: 100%;\n cursor: pointer;\n z-index: 0;\n position: relative;\n container-type: inline-size;\n container-name: box;\n white-space: pre-line;\n}\n\n.card-item__detail{\n display: inline-block;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n opacity: var(--opacity--soft);\n}\n\n\n\n.card-item__expanded {\n padding: var(--space--medium);\n}\n\n.card-item:hover {\n background: #F0F3F7;\n border-radius: 12px;\n}\n\n.card-item__title {\n display: flex;\n align-items: center;\n line-height: 18px;\n cursor: pointer;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight-large);\n color: var(--ez-card-item--color);\n padding-bottom: var(--ez-card-item__title--padding-bottom);\n gap: var(--space--small, 6px);\n}\n\n.card-item__key {\n /*public*/\n color: var(--ez-card-item__key--color);\n}\n\n.card-item__details {\n display: flex;\n flex-direction: column;\n cursor: pointer;\n justify-content: space-between;\n width: 100%;\n}\n\n.card-item__details-container__left {\n display: flex;\n flex-direction: column;\n white-space: pre-line;\n cursor: pointer;\n width: 50%;\n}\n\n.card-item__details-container__right {\n display: flex;\n flex-direction: column;\n white-space: pre-line;\n width: 50%;\n cursor: pointer;\n}\n\n.card-item__detail{\n cursor: pointer;\n}\n\n.card-item__detail-default:not(:last-child) {\n padding-bottom: var(--ez-card-item__detail--padding-bottom);\n}\n\n.card-item__detail-label {\n cursor: pointer;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--detail-label--font-weight);\n}\n\n.card-item__detail-value {\n cursor: pointer;\n line-break: anywhere;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight);\n}\n\n.card-item__highlight {\n position: relative;\n border-radius: 8px;\n z-index: -1;\n\n /*public*/\n background-color: var(--ez-card-item__highlight--color);\n outline: 2px solid var(--ez-card-item__highlight--color);\n box-shadow: -4px 0px 0px 0px var(--ez-card-item__highlight--color), \n 4px 0px 0px 0px var(--ez-card-item__highlight--color);\n}\n\n.card-item__content{\n display: flex;\n align-items: center;\n}\n\n.card-item__details-container_default{\n display: flex;\n}\n\n.card-item__details-slot{\n margin-left: auto;\n}\n\n/* Modo compacto */\n.card-item__compacted {\n padding: var(--space--2xs) var(--space--small);\n}\n\n.card-item__detail-label-compacted {\n font-size: var(--ez-card-item--font-size-compacted);\n}\n\n.card-item__detail-value-compacted {\n font-size: var(--ez-card-item--font-size-compacted);\n}\n\n.card-item__title-compacted {\n font-size: var(--ez-card-item--font-size-compacted);\n}\n\n.card-item__details-container__left-compacted{\n width: 100%;\n}\n\n.card-item__details-container__right-compacted {\n width: 100%;\n}\n\n\n@container box (max-width: 550px) {\n .card-item__details {\n flex-direction: column;\n }\n\n .card-item__details-container__left {\n width: 100%;\n }\n \n .card-item__details-container__right {\n width: 100%;\n }\n}\n\n@container box (max-width: 200px) {\n .card-item__title {\n font-size: 10px;\n }\n\n .card-item__detail-label {\n font-size: 10px;\n }\n\n .card-item__detail-value {\n font-size: 10px;\n }\n\n}";
|
|
10
10
|
|
|
11
11
|
const EzCardItem = class {
|
|
12
12
|
constructor(hostRef) {
|