@sankhyalabs/ezui 1.1.4 → 1.1.8
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/README.md +72 -72
- package/dist/{ezui/DataUnit-285bec19.js → cjs/DataUnit-28b290cb.js} +382 -369
- package/dist/{ezui/index-919090de.js → cjs/RequestMetadata-2cd01e8a.js} +4 -383
- package/dist/cjs/ez-action-chip.cjs.entry.js +52 -0
- package/dist/cjs/ez-button_14.cjs.entry.js +3341 -0
- package/dist/cjs/ez-label-chip.cjs.entry.js +131 -0
- package/dist/cjs/ez-modal.cjs.entry.js +115 -0
- package/dist/cjs/ez-number-input.cjs.entry.js +248 -0
- package/dist/cjs/ez-time-input.cjs.entry.js +180 -0
- package/dist/cjs/ezui.cjs.js +19 -0
- package/dist/cjs/form-metadata.cjs.entry.js +74 -0
- package/dist/cjs/index-9403fe8f.js +1322 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/collection/collection-manifest.json +31 -0
- package/dist/collection/components/ez-action-chip/ez-action-chip.css +82 -0
- package/dist/collection/components/ez-action-chip/ez-action-chip.js +109 -0
- package/dist/collection/components/ez-button/ez-button.css +94 -0
- package/dist/collection/components/ez-button/ez-button.js +125 -0
- package/dist/collection/components/ez-calendar/ez-calendar.css +210 -0
- package/dist/collection/components/ez-calendar/ez-calendar.js +215 -0
- package/dist/collection/components/ez-check/ez-check.css +266 -0
- package/dist/collection/components/ez-check/ez-check.js +168 -0
- package/dist/collection/components/ez-collapsable-box/ez-collapsable-box.css +68 -0
- package/dist/collection/components/ez-collapsable-box/ez-collapsable-box.js +108 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box-interfaces.js +2 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +167 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +363 -0
- package/dist/collection/components/ez-date-input/ez-date-input.css +39 -0
- package/dist/collection/components/ez-date-input/ez-date-input.js +172 -0
- package/dist/collection/components/ez-form/ez-form.css +19 -0
- package/dist/collection/components/ez-form/ez-form.js +368 -0
- package/dist/collection/components/ez-form/store/Form.actions.js +132 -0
- package/dist/collection/components/ez-form/store/Form.reducer.js +194 -0
- package/dist/collection/components/ez-form/store/Form.selectors.js +44 -0
- package/dist/collection/components/ez-form/subcomponents/DataUnit.js +207 -0
- package/dist/collection/components/ez-form/subcomponents/FormMetadata.js +16 -0
- package/dist/collection/components/ez-form/subcomponents/css/place-holder.css +24 -0
- package/dist/collection/components/ez-form/subcomponents/form-metadata.js +173 -0
- package/dist/collection/components/ez-form/subcomponents/place-holder.js +14 -0
- package/dist/collection/components/ez-form/subcomponents/structure/Field.js +71 -0
- package/dist/collection/components/ez-form/subcomponents/structure/FieldSet.js +27 -0
- package/dist/collection/components/ez-form/subcomponents/structure/FormSheet.js +40 -0
- package/dist/collection/components/ez-form/subcomponents/structure/NavigationBar.js +27 -0
- package/dist/collection/components/ez-icon/ez-icon.css +37 -0
- package/dist/collection/components/ez-icon/ez-icon.js +56 -0
- package/dist/collection/components/ez-label-chip/ez-label-chip.css +117 -0
- package/dist/collection/components/ez-label-chip/ez-label-chip.js +276 -0
- package/dist/collection/components/ez-modal/ez-modal.css +87 -0
- package/dist/collection/components/ez-modal/ez-modal.js +224 -0
- package/dist/collection/components/ez-number-input/ez-number-input.css +144 -0
- package/dist/collection/components/ez-number-input/ez-number-input.js +465 -0
- package/dist/collection/components/ez-popover/ez-popover.css +39 -0
- package/dist/collection/components/ez-popover/ez-popover.js +323 -0
- package/dist/collection/components/ez-search/ez-search.css +296 -0
- package/dist/{ezui/ez-search.entry.js → collection/components/ez-search/ez-search.js} +527 -334
- package/dist/collection/components/ez-tabselector/ez-tabselector.css +126 -0
- package/dist/{ezui/ez-tabselector.entry.js → collection/components/ez-tabselector/ez-tabselector.js} +283 -209
- package/dist/collection/components/ez-text-area/ez-text-area.css +140 -0
- package/dist/collection/components/ez-text-area/ez-text-area.js +267 -0
- package/dist/collection/components/ez-text-input/ez-text-input.css +170 -0
- package/dist/collection/components/ez-text-input/ez-text-input.js +395 -0
- package/dist/collection/components/ez-time-input/ez-time-input.css +155 -0
- package/dist/collection/components/ez-time-input/ez-time-input.js +326 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/servidor.js +101 -0
- package/dist/collection/utils/FloatingManager.js +16 -0
- package/dist/collection/utils/utils.js +6 -0
- package/dist/custom-elements/index.js +5071 -0
- package/dist/esm/DataUnit-69e518fa.js +378 -0
- package/dist/esm/RequestMetadata-c265c9d5.js +527 -0
- package/dist/{ezui → esm}/ez-action-chip.entry.js +42 -42
- package/dist/esm/ez-button_14.entry.js +3324 -0
- package/dist/{ezui → esm}/ez-label-chip.entry.js +121 -121
- package/dist/{ezui → esm}/ez-modal.entry.js +105 -96
- package/dist/{ezui → esm}/ez-number-input.entry.js +238 -238
- package/dist/{ezui → esm}/ez-time-input.entry.js +170 -170
- package/dist/esm/ezui.js +17 -0
- package/dist/{ezui → esm}/form-metadata.entry.js +66 -66
- package/dist/esm/index-95bb3fd9.js +1293 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/ezui/ezui.esm.js +1 -122
- package/dist/ezui/index.esm.js +0 -1
- package/dist/ezui/p-10ef58b3.js +1 -0
- package/dist/ezui/p-185c57f4.js +1 -0
- package/dist/ezui/p-22b82efb.entry.js +1 -0
- package/dist/ezui/p-77fdb4fd.entry.js +1 -0
- package/dist/ezui/p-9dfccb16.js +1 -0
- package/dist/ezui/p-b0974f4f.entry.js +1 -0
- package/dist/ezui/p-db11c600.entry.js +1 -0
- package/dist/ezui/p-dd4331b7.entry.js +1 -0
- package/dist/ezui/p-f6fd31ab.entry.js +1 -0
- package/dist/ezui/p-fa260f22.entry.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/ez-action-chip/ez-action-chip.d.ts +16 -16
- package/dist/types/components/ez-button/ez-button.d.ts +20 -20
- package/dist/types/components/ez-calendar/ez-calendar.d.ts +42 -42
- package/dist/types/components/ez-check/ez-check.d.ts +32 -32
- package/dist/types/components/ez-collapsable-box/ez-collapsable-box.d.ts +18 -18
- package/dist/types/components/ez-combo-box/ez-combo-box-interfaces.d.ts +4 -4
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +68 -68
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +31 -31
- package/dist/types/components/ez-form/ez-form.d.ts +31 -27
- package/dist/types/components/ez-form/store/Form.actions.d.ts +111 -104
- package/dist/types/components/ez-form/store/Form.reducer.d.ts +20 -11
- package/dist/types/components/ez-form/store/Form.selectors.d.ts +14 -13
- package/dist/types/components/ez-form/subcomponents/DataUnit.d.ts +55 -48
- package/dist/types/components/ez-form/subcomponents/FormMetadata.d.ts +41 -41
- package/dist/types/components/ez-form/subcomponents/form-metadata.d.ts +15 -15
- package/dist/types/components/ez-form/subcomponents/place-holder.d.ts +3 -3
- package/dist/types/components/ez-form/subcomponents/structure/Field.d.ts +10 -10
- package/dist/types/components/ez-form/subcomponents/structure/FieldSet.d.ts +12 -12
- package/dist/types/components/ez-form/subcomponents/structure/FormSheet.d.ts +13 -13
- package/dist/types/components/ez-form/subcomponents/structure/NavigationBar.d.ts +17 -7
- package/dist/types/components/ez-icon/ez-icon.d.ts +5 -5
- package/dist/types/components/ez-label-chip/ez-label-chip.d.ts +40 -40
- package/dist/types/components/ez-modal/ez-modal.d.ts +32 -26
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +73 -73
- package/dist/types/components/ez-popover/ez-popover.d.ts +52 -52
- package/dist/types/components/ez-search/ez-search.d.ts +95 -95
- package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +31 -31
- package/dist/types/components/ez-text-area/ez-text-area.d.ts +49 -49
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +64 -64
- package/dist/types/components/ez-time-input/ez-time-input.d.ts +53 -53
- package/dist/types/components.d.ts +8 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/utils/utils.d.ts +2 -2
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +13 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +114 -114
- package/react/components.d.ts +22 -0
- package/react/components.js +25 -0
- package/react/components.js.map +1 -0
- package/react/react-component-lib/createComponent.d.ts +10 -0
- package/react/react-component-lib/createComponent.js +59 -0
- package/react/react-component-lib/createComponent.js.map +1 -0
- package/react/react-component-lib/createOverlayComponent.d.ts +20 -0
- package/react/react-component-lib/createOverlayComponent.js +89 -0
- package/react/react-component-lib/createOverlayComponent.js.map +1 -0
- package/react/react-component-lib/index.d.ts +2 -0
- package/react/react-component-lib/index.js +3 -0
- package/react/react-component-lib/index.js.map +1 -0
- package/react/react-component-lib/interfaces.d.ts +29 -0
- package/react/react-component-lib/interfaces.js +1 -0
- package/react/react-component-lib/interfaces.js.map +1 -0
- package/react/react-component-lib/utils/attachProps.d.ts +12 -0
- package/react/react-component-lib/utils/attachProps.js +96 -0
- package/react/react-component-lib/utils/attachProps.js.map +1 -0
- package/react/react-component-lib/utils/case.d.ts +2 -0
- package/react/react-component-lib/utils/case.js +7 -0
- package/react/react-component-lib/utils/case.js.map +1 -0
- package/react/react-component-lib/utils/dev.d.ts +2 -0
- package/react/react-component-lib/utils/dev.js +13 -0
- package/react/react-component-lib/utils/dev.js.map +1 -0
- package/react/react-component-lib/utils/index.d.ts +7 -0
- package/react/react-component-lib/utils/index.js +21 -0
- package/react/react-component-lib/utils/index.js.map +1 -0
- package/dist/ezui/app-globals-0f993ce5.js +0 -3
- package/dist/ezui/css-shim-003e9264.js +0 -4
- package/dist/ezui/dom-1b195079.js +0 -73
- package/dist/ezui/ez-button.entry.js +0 -47
- package/dist/ezui/ez-calendar.entry.js +0 -102
- package/dist/ezui/ez-check.entry.js +0 -62
- package/dist/ezui/ez-collapsable-box.entry.js +0 -32
- package/dist/ezui/ez-combo-box.entry.js +0 -181
- package/dist/ezui/ez-date-input.entry.js +0 -77
- package/dist/ezui/ez-form.entry.js +0 -1907
- package/dist/ezui/ez-icon.entry.js +0 -17
- package/dist/ezui/ez-popover.entry.js +0 -112
- package/dist/ezui/ez-text-area.entry.js +0 -105
- package/dist/ezui/ez-text-input.entry.js +0 -202
- package/dist/ezui/index-39044be2.js +0 -2832
- package/dist/ezui/place-holder.entry.js +0 -15
- package/dist/ezui/shadow-css-c1ad5fdc.js +0 -383
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-9403fe8f.js');
|
|
6
|
+
|
|
7
|
+
const ezLabelChipCss = ":host{--lc--height:36px;--lc--width:100%;--lc__icon--width:48px;--lc--border-radius:var(--border--radius-large, 24px);--lc--font-size:var(--text--medium, 14px);--lc--font-family:var(--font-pattern, Arial);--lc--font-weight:var(--text-weight--large, 500);--lc--space--medium:var(--space--medium, 6px);--lc__border:1px solid;--lc__border-color-strokes:var(--color--strokes, #DCE0E8);--lc__label--title--primary:var(--title--primary, #919191);--lc__label--color-primary:var(--color--primary, #008561);--lc__label-color--disable-secondary:var(--color--disable-secondary, #F2F5F8);--lc__label--background-color:#0085610F;--lc__label__default--background-color--hover:var(--color--primary-200, #f2faf8);--lc__label__default--border-color--hover:var(--color--primary-600, #007a5a);--lc__label--text--disabled:var(--text--disable, #AFB6C0);--lc__label--text--primary:var(--text--primary, #626e82);--lc__message_box--font-size:var(--text--small, 12px);--lc__message_box--info--color:var(--color--success, #22085d);--lc__message_box--error--color:var(--color--error, #FF0000);width:100%}.padding-right--small{padding-right:var(--lc--space--medium)}.padding-left--small{padding-left:var(--lc--space--medium)}.label__container{width:fit-content;display:flex;flex-wrap:wrap;position:relative;align-items:center;align-self:center;color:var(--lc__label--title--primary);fill:var(--lc__label--title--primary);border:var(--lc__border);border-radius:var(--lc--border-radius);border-color:var( --lc__border-color-strokes);padding-right:var(--space--large, 12px);padding-left:var(--space--large, 12px)}.label__container:hover{border-color:var(--lc__label__default--border-color--hover);background-color:var(--lc__label__default--background-color--hover)}.label__container--active{width:fit-content;display:flex;flex-wrap:wrap;position:relative;align-items:center;align-self:center;border:var(--lc__border);border-radius:var(--lc--border-radius);padding-right:var(--space--large, 12px);padding-left:var(--space--large, 12px);fill:var(--lc__label--color-primary);color:var(--lc__label--color-primary);border-color:var(--lc__label--background-color);background-color:var(--lc__label--background-color)}.label__container--disabled{width:fit-content;display:flex;flex-wrap:wrap;position:relative;align-items:center;align-self:center;border:var(--lc__border);border-color:var(--lc__label-color--disable-secondary);border-radius:var(--lc--border-radius);padding-right:var(--space--large, 12px);padding-left:var(--space--large, 12px);fill:var(--lc__label--text--disabled);color:var(--lc__label--text--disabled);background-color:var(--lc__label-color--disable-secondary)}label{display:flex;align-items:center;width:calc(100% - var(--lc__icon--width));width:fit-content;font-weight:var(--text-weight--large, 600);cursor:pointer;height:var(--lc--height);font-family:var(--lc--font-family);font-size:var(--lc--font-size)}.label__icon{display:flex;cursor:pointer}";
|
|
8
|
+
|
|
9
|
+
const EzLabelChip = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.removeChip = index.createEvent(this, "removeChip", 7);
|
|
13
|
+
this.valueChange = index.createEvent(this, "valueChange", 7);
|
|
14
|
+
/**
|
|
15
|
+
* Deixa o componente disponível ou não para seleção.
|
|
16
|
+
*/
|
|
17
|
+
this.enabled = true;
|
|
18
|
+
/**
|
|
19
|
+
* Indica se o componente terá a opção de ser removido.
|
|
20
|
+
*/
|
|
21
|
+
this.removable = false;
|
|
22
|
+
/**
|
|
23
|
+
* Indica se o componente está ou não ativado.
|
|
24
|
+
*/
|
|
25
|
+
this.value = false;
|
|
26
|
+
}
|
|
27
|
+
//---------------------------------------------
|
|
28
|
+
// Public methods
|
|
29
|
+
//---------------------------------------------
|
|
30
|
+
/**
|
|
31
|
+
* Faz o foco no componente de input
|
|
32
|
+
*/
|
|
33
|
+
async setFocus() {
|
|
34
|
+
this._labelElem.focus();
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Remove o foco no componente de input
|
|
38
|
+
*/
|
|
39
|
+
async setBlur() {
|
|
40
|
+
this._labelElem.blur();
|
|
41
|
+
}
|
|
42
|
+
//---------------------------------------------
|
|
43
|
+
// Event handlers
|
|
44
|
+
//---------------------------------------------
|
|
45
|
+
handleClick(ev) {
|
|
46
|
+
const target = ev.target;
|
|
47
|
+
if (target.assignedSlot === null && !target.classList.contains('label__icon')) {
|
|
48
|
+
this.valueChange.emit(this.value);
|
|
49
|
+
this.swichState();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
swichState() {
|
|
53
|
+
if (this.enabled) {
|
|
54
|
+
this.value = !this.value;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
reflectChange() {
|
|
58
|
+
if (this._divElem) {
|
|
59
|
+
this._divElem.classList.remove('label__container--active');
|
|
60
|
+
this._divElem.classList.remove('label__container');
|
|
61
|
+
if (this.value) {
|
|
62
|
+
this._divElem.classList.add('label__container--active');
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
this._divElem.classList.add('label__container');
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
handleSlotChange(ev) {
|
|
70
|
+
const slot = ev.target;
|
|
71
|
+
const content = slot.assignedElements()[0];
|
|
72
|
+
if (content) {
|
|
73
|
+
content.style.position = "absolute";
|
|
74
|
+
content.style.display = "flex";
|
|
75
|
+
content.style.alignItems = "center";
|
|
76
|
+
content.style.justifyContent = "center";
|
|
77
|
+
content.style.overflow = "hidden";
|
|
78
|
+
content.style.top = "0px";
|
|
79
|
+
content.style.width = "var(--lc__icon--width)";
|
|
80
|
+
content.style.height = "var(--lc--height)";
|
|
81
|
+
if (slot.name == "leftIcon") {
|
|
82
|
+
content.style.left = "0px";
|
|
83
|
+
this._labelElem.classList.add('padding-left--small');
|
|
84
|
+
}
|
|
85
|
+
else if (slot.name == "rightIcon") {
|
|
86
|
+
content.style.right = "0px";
|
|
87
|
+
if (this.removable) {
|
|
88
|
+
this._iconElement.classList.add('padding-right--small');
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
this._labelElem.classList.add('padding-right--small');
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
//---------------------------------------------
|
|
97
|
+
// Lifecycle web component
|
|
98
|
+
//---------------------------------------------
|
|
99
|
+
componentDidLoad() {
|
|
100
|
+
if (this._divElem) {
|
|
101
|
+
if (this.value) {
|
|
102
|
+
this._divElem.classList.add('label__container--active');
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
this.handleEnabledState();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
handleEnabledState() {
|
|
110
|
+
this._divElem.classList.remove('label__container--disabled');
|
|
111
|
+
if (!this.enabled) {
|
|
112
|
+
this._divElem.classList.remove('label__container');
|
|
113
|
+
this._divElem.classList.add('label__container--disabled');
|
|
114
|
+
if (this._labelElem) {
|
|
115
|
+
this._labelElem.style.cursor = 'default';
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
render() {
|
|
120
|
+
return (index.h("div", { onClick: (ev) => this.handleClick(ev), class: this.value ? "label__container--active" : "label__container", ref: (el) => this._divElem = el }, index.h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), index.h("label", { class: this.removable ? "padding-right--small" : " ", ref: (el) => this._labelElem = el }, this.label), this.removable ?
|
|
121
|
+
index.h("ez-icon", { class: "label__icon align--middle padding-horizontal--medium", onClick: () => { this.removeChip.emit(); }, ref: (el) => this._iconElement = el, href: "/themes/default/images/icons/actions-sprite.svg#close", size: "x-small" })
|
|
122
|
+
: null, index.h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
123
|
+
}
|
|
124
|
+
static get watchers() { return {
|
|
125
|
+
"value": ["reflectChange"],
|
|
126
|
+
"enabled": ["handleEnabledState"]
|
|
127
|
+
}; }
|
|
128
|
+
};
|
|
129
|
+
EzLabelChip.style = ezLabelChipCss;
|
|
130
|
+
|
|
131
|
+
exports.ez_label_chip = EzLabelChip;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-9403fe8f.js');
|
|
6
|
+
|
|
7
|
+
const ezModalCss = ":host{--modal-z-index:var(--most-visible, 3);--modal-vertical-padding:var(--space--extra-large, 48px);display:block}.modal{position:fixed;padding:var(--modal-vertical-padding) 0;display:flex;top:0px;z-index:var(--modal-z-index);left:0px;width:100%;height:100vh;backdrop-filter:blur(4px);background:rgb(0 4 12 / 40%)}@keyframes expand-modal--left{from{transform:translate(-100%)}}@keyframes expand-modal--right{from{transform:translate(100%)}}.modal__container{display:flex;flex-wrap:wrap;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:89.6vh;overflow-y:auto;background-color:#fff;padding:24px;border-radius:12px 0px 0px 12px;box-shadow:0px 0px 16px 0px rgba(0, 38, 111, 0.12)}.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}.small{width:30%}.medium{width:50%}.large{width:70%}";
|
|
8
|
+
|
|
9
|
+
const EzModal = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.ezChange = index.createEvent(this, "ezChange", 7);
|
|
13
|
+
/**
|
|
14
|
+
* Controle de exibição do Modal
|
|
15
|
+
*/
|
|
16
|
+
this.oppened = true;
|
|
17
|
+
/**
|
|
18
|
+
* Define se o modal será fechado ao digitar 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
|
+
console.log(ev === null || ev === void 0 ? void 0 : ev.key);
|
|
27
|
+
if ((ev === null || ev === void 0 ? void 0 : ev.key) === 'Escape' && this.closeesc) {
|
|
28
|
+
this.oppened = false;
|
|
29
|
+
debugger;
|
|
30
|
+
this.ezChange.emit(this.oppened);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
handleClickOverlay(ev) {
|
|
35
|
+
ev === null || ev === void 0 ? void 0 : ev.stopPropagation();
|
|
36
|
+
if (ev instanceof PointerEvent && this.closeoutsideclick) {
|
|
37
|
+
this.oppened = false;
|
|
38
|
+
debugger;
|
|
39
|
+
this.ezChange.emit(this.oppened);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
handleOppenedChange() {
|
|
43
|
+
if (this.oppened) {
|
|
44
|
+
document.addEventListener('keydown', this.handleKeyboardEvent);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
document.removeEventListener('keydown', this.handleKeyboardEvent);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
///////
|
|
51
|
+
// trapTabKey(e) {
|
|
52
|
+
// // Check for TAB key press
|
|
53
|
+
// if (e.keyCode === 9) {
|
|
54
|
+
// // SHIFT + TAB
|
|
55
|
+
// if (e.shiftKey) {
|
|
56
|
+
// if (document.activeElement === this._firstTabStop) {
|
|
57
|
+
// e.preventDefault();
|
|
58
|
+
// this._lastTabStop.focus();
|
|
59
|
+
// }
|
|
60
|
+
// // TAB
|
|
61
|
+
// } else {
|
|
62
|
+
// if (document.activeElement === this._lastTabStop) {
|
|
63
|
+
// e.preventDefault();
|
|
64
|
+
// this._firstTabStop.focus();
|
|
65
|
+
// }
|
|
66
|
+
// }
|
|
67
|
+
// }
|
|
68
|
+
// if (e.keyCode === 27) {
|
|
69
|
+
// this.closeModal();
|
|
70
|
+
// }
|
|
71
|
+
// }
|
|
72
|
+
// closeModal() {
|
|
73
|
+
// this.oppened = false;
|
|
74
|
+
// this._focusedElementBeforeModal.focus();
|
|
75
|
+
// }
|
|
76
|
+
// componentDidLoad() {
|
|
77
|
+
// this._overlay.addEventListener('keydown', (ev) => { this.trapTabKey(ev) });
|
|
78
|
+
// // Save current focus
|
|
79
|
+
// this._focusedElementBeforeModal = document.activeElement;
|
|
80
|
+
// // Find all focusable children
|
|
81
|
+
// var focusableElementsString = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [contenteditable]';
|
|
82
|
+
// var focusableElements = this._modalContainer.querySelectorAll(focusableElementsString);
|
|
83
|
+
// // Convert NodeList to Array
|
|
84
|
+
// focusableElements = Array.prototype.slice.call(focusableElements);
|
|
85
|
+
// this._firstTabStop = focusableElements[0];
|
|
86
|
+
// this._lastTabStop = focusableElements[focusableElements.length - 1];
|
|
87
|
+
// // Focus first child
|
|
88
|
+
// this._firstTabStop.focus();
|
|
89
|
+
// }
|
|
90
|
+
// componentDidUpdate() {
|
|
91
|
+
// var focusableElementsString = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [contenteditable]';
|
|
92
|
+
// var focusableElements = this._modalContainer.querySelectorAll(focusableElementsString);
|
|
93
|
+
// }
|
|
94
|
+
/////
|
|
95
|
+
componentDidLoad() {
|
|
96
|
+
this.handleOppenedChange();
|
|
97
|
+
}
|
|
98
|
+
//Ainda teremos ajustes visuais
|
|
99
|
+
render() {
|
|
100
|
+
return (index.h(index.Host, null, this.oppened ?
|
|
101
|
+
index.h("div", { class: 'modal' /* ref={el => this._overlay = el} */, onClick: (ev) => this.handleClickOverlay(ev) }, this.align === 'left'
|
|
102
|
+
?
|
|
103
|
+
index.h("div", { onClick: (ev) => this.handleClickOverlay(ev), class: "modal__container modal__container--left" }, index.h("div", { onClick: (ev) => ev.stopPropagation(), class: "modal__content modal__content--left " + this.modalsize }, index.h("slot", null)))
|
|
104
|
+
: undefined, this.align === 'right' ?
|
|
105
|
+
index.h("div", { onClick: (ev) => this.handleClickOverlay(ev), class: "modal__container modal__container--right" }, index.h("div", { onClick: (ev) => ev.stopPropagation(), class: "modal__content modal__content--right " + this.modalsize }, index.h("slot", null)))
|
|
106
|
+
: undefined)
|
|
107
|
+
: undefined));
|
|
108
|
+
}
|
|
109
|
+
static get watchers() { return {
|
|
110
|
+
"oppened": ["handleOppenedChange"]
|
|
111
|
+
}; }
|
|
112
|
+
};
|
|
113
|
+
EzModal.style = ezModalCss;
|
|
114
|
+
|
|
115
|
+
exports.ez_modal = EzModal;
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-9403fe8f.js');
|
|
6
|
+
const RequestMetadata = require('./RequestMetadata-2cd01e8a.js');
|
|
7
|
+
|
|
8
|
+
const ezNumberInputCss = ":host{--ni--height:42px;--ni--width:100%;--ni__icon--width:48px;--ni--border-radius:var(--border--radius-medium, 12px);--ni--font-size:var(--text--medium, 14px);--ni--font-family:var(--font-pattern, Arial);--ni__input--background-color:var(--background--medium, #e0e0e0);--ni__input--border:var(--border--medium, 2px solid);--ni__input--border-color:var(--ni__input--background-color);--ni__input--focus--border-color:var(--color--primary, #008561);--ni__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ni__input--disabled--color:var(--text--disable, #AFB6C0);--ni__input--error--border-color:#CC2936;--ni__placeholder--disabled--color:var(--text--disable, #AFB6C0);--ni__placeholder--color:var(--title--primary, #919191);--ni__placeholder--font-weight:var(--text-weight--large, 500);--ni__message_box--font-size:var(--text--small, 12px);--ni__message_box--info--color:var(--color--success, #22085d);--ni__message_box--error--color:var(--color--error, #FF0000);display:flex;flex-wrap:wrap;position:relative;width:var(--ni--width)}.invisible{visibility:hidden}input{width:100%;box-sizing:border-box;padding:var(--space--medium);height:var(--ni--height);border-radius:var(--ni--border-radius);font-family:var(--ni--font-family);font-size:var(--ni--font-size);border:var(--ni__input--border);border-color:var(--ni__input--border-color);background-color:var(--ni__input--background-color);font-weight:var(--text-weight--large)}input:disabled{background-color:var(--ni__input--disabled--background-color);color:var(--ni__input--disabled--color)}input:focus{outline:none;border-color:var(--ni__input--focus--border-color)}input.icon--left{padding-left:var(--ni__icon--width)}input.icon--right{padding-right:var(--ni__icon--width)}input::placeholder{color:var(--ni__placeholder--color);font-weight:var(--ni__placeholder--font-weight)}input:disabled::placeholder{color:var(--ni__placeholder--disabled--color)}input.hasError{color:inherit;border-color:var(--ni__input--error--border-color)}input.text--right{text-align:right}.message-box{min-height:16px;min-width:100%;margin-top:2px;line-height:12px;font-family:var(--ni--font-family);font-size:var(--ni__message_box--font-size);color:var(--ni__message_box--info--color)}.hasError{color:var(--ni__message_box--error--color)}.input__label{font-size:var(--text--medium);font-weight:var(--text-weight--large);left:var(--space--medium);position:absolute;color:var(--title--primary);top:var(--space--medium);font-family:var(--ni--font-family);-webkit-transition:font-size .3s, top .3s;transition:font-size .3s, top .3s;z-index:var(--visible)}.input__label--floated{font-family:var(--ni--font-family);font-size:var(--text--extra-small);top:var(--space--small);color:var(--text--primary)}.input__label--left{left:var(--ni__icon--width)}.input--with--label{padding-bottom:0}";
|
|
9
|
+
|
|
10
|
+
const NumberInput = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
/**
|
|
14
|
+
* Deixa o campo disponível ou não para digitação.
|
|
15
|
+
*/
|
|
16
|
+
this.enabled = true;
|
|
17
|
+
/**
|
|
18
|
+
* Deixa o campo disponível ou não para digitação.
|
|
19
|
+
*/
|
|
20
|
+
this.textleft = false;
|
|
21
|
+
/**
|
|
22
|
+
* Opção de configurar a transformação de string to number entre formatação pt-BR e en-US
|
|
23
|
+
* (formatação de ENTRADA e SAÍDA do componente: pt-BR="###.###,##" en-US="###,###.##"; Default: "pt-BR")
|
|
24
|
+
* Qualquer outro valor que não seja "en-US", adotará a formatação "pt-BR"
|
|
25
|
+
* Não é case sensitive
|
|
26
|
+
*/
|
|
27
|
+
this.formatnumber = "PT-BR";
|
|
28
|
+
//---------------------------------------------
|
|
29
|
+
// Private Methods
|
|
30
|
+
//---------------------------------------------
|
|
31
|
+
this.settingStrValueIntNumber = (strvalue) => {
|
|
32
|
+
if (this.precision === 0 && strvalue) {
|
|
33
|
+
return strvalue = strvalue.replace(/\./g, '').replace(/\,/g, '');
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
return strvalue;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
this.checkNumberValidation = (valuePtBRorNumber) => {
|
|
40
|
+
try {
|
|
41
|
+
if (valuePtBRorNumber != "" && RequestMetadata.NumberUtils.format(valuePtBRorNumber, this.precision, this.prettyprecision) === "NaN") {
|
|
42
|
+
this.errormessage = `Valor não é um número válido`;
|
|
43
|
+
this.value = undefined;
|
|
44
|
+
this.strvalue = undefined;
|
|
45
|
+
if (this._inputElem) {
|
|
46
|
+
this._inputElem.value = "";
|
|
47
|
+
}
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
this.errormessage = err.message;
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
return true;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
showError() {
|
|
59
|
+
const hasError = typeof this.errormessage === 'string' && this.errormessage !== '';
|
|
60
|
+
if (this._inputElem) {
|
|
61
|
+
if (hasError) {
|
|
62
|
+
this._inputElem.classList.add('hasError');
|
|
63
|
+
this._messageBoxElem.classList.add('hasError');
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
this._inputElem.classList.remove('hasError');
|
|
67
|
+
this._messageBoxElem.classList.remove('hasError');
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
onPrecisionChanged(newPrecision) {
|
|
72
|
+
if (isNaN(newPrecision)) {
|
|
73
|
+
this.precision = 0;
|
|
74
|
+
}
|
|
75
|
+
this.handleFocusout();
|
|
76
|
+
}
|
|
77
|
+
onPrettyPrecisionChanged(newPrettyPrecision) {
|
|
78
|
+
if (isNaN(newPrettyPrecision)) {
|
|
79
|
+
this.prettyprecision = 0;
|
|
80
|
+
}
|
|
81
|
+
this.handleFocusout();
|
|
82
|
+
}
|
|
83
|
+
onValueChanged(newValue) {
|
|
84
|
+
if (isNaN(newValue) && newValue !== undefined) {
|
|
85
|
+
this.value = undefined;
|
|
86
|
+
this.strvalue = "";
|
|
87
|
+
this.errormessage = `Valor não é um número válido`;
|
|
88
|
+
this.adjustFloatingLabel();
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
this.settingComponent();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
adjustFloatingLabel() {
|
|
95
|
+
if (this._labelElem) {
|
|
96
|
+
if (this.label && this._inputElem.value && this._inputElem.value.toString().length > 0) {
|
|
97
|
+
if (!this._labelElem.classList.contains("input__label--floated")) {
|
|
98
|
+
this._labelElem.classList.add("input__label--floated");
|
|
99
|
+
}
|
|
100
|
+
if (!this._inputElem.classList.contains("input--with--label")) {
|
|
101
|
+
this._inputElem.classList.add("input--with--label");
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
this._labelElem.classList.remove("input__label--floated");
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
//---------------------------------------------
|
|
110
|
+
// Public methods
|
|
111
|
+
//---------------------------------------------
|
|
112
|
+
/**
|
|
113
|
+
* Faz o foco no componente de input
|
|
114
|
+
*/
|
|
115
|
+
async setFocus() {
|
|
116
|
+
this._inputElem.focus();
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Remove o foco no componente de input
|
|
120
|
+
*/
|
|
121
|
+
async setBlur() {
|
|
122
|
+
this._inputElem.blur();
|
|
123
|
+
}
|
|
124
|
+
//---------------------------------------------
|
|
125
|
+
// Event handlers
|
|
126
|
+
//---------------------------------------------
|
|
127
|
+
/**
|
|
128
|
+
* Promove a atualização do componente
|
|
129
|
+
*/
|
|
130
|
+
async handleFocusout() {
|
|
131
|
+
//Setting value and strvalue by stringinput
|
|
132
|
+
if (this._inputElem) {
|
|
133
|
+
this.errormessage = "";
|
|
134
|
+
if (this._inputElem.value !== "") {
|
|
135
|
+
this._inputElem.value = this.settingStrValueIntNumber(this._inputElem.value);
|
|
136
|
+
const value = RequestMetadata.NumberUtils.keepOnlyDecimalSeparator(this._inputElem.value, this.formatnumber.toUpperCase());
|
|
137
|
+
if (!this.checkNumberValidation(value)) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
if (value) {
|
|
141
|
+
try {
|
|
142
|
+
this._inputElem.value = this.formatnumber.toUpperCase() !== "EN-US" ? RequestMetadata.NumberUtils.format(value, this.precision, this.prettyprecision) : RequestMetadata.NumberUtils.changeFormat(RequestMetadata.NumberUtils.format(value, this.precision, this.prettyprecision));
|
|
143
|
+
}
|
|
144
|
+
catch (e) {
|
|
145
|
+
this.errormessage = e.message;
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
this.strvalue = this._inputElem.value;
|
|
150
|
+
this.value = RequestMetadata.NumberUtils.stringToNumber(value);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
this.strvalue = undefined;
|
|
154
|
+
this.value = undefined;
|
|
155
|
+
}
|
|
156
|
+
this.adjustFloatingLabel();
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
handleChange() {
|
|
160
|
+
this._inputElem.value = this.settingStrValueIntNumber(this._inputElem.value);
|
|
161
|
+
}
|
|
162
|
+
handleSlotChange(ev) {
|
|
163
|
+
const slot = ev.target;
|
|
164
|
+
const content = slot.assignedElements()[0];
|
|
165
|
+
content.style.position = "absolute";
|
|
166
|
+
content.style.display = "flex";
|
|
167
|
+
content.style.alignItems = "center";
|
|
168
|
+
content.style.justifyContent = "center";
|
|
169
|
+
content.style.overflow = "hidden";
|
|
170
|
+
content.style.top = "0px";
|
|
171
|
+
content.style.width = "var(--ni__icon--width)";
|
|
172
|
+
content.style.height = "var(--ni--height)";
|
|
173
|
+
if (slot.name == "leftIcon") {
|
|
174
|
+
content.style.left = "0px";
|
|
175
|
+
content.style.borderRadius = "var(--ni--border-radius) 0 0 var(--ni--border-radius)";
|
|
176
|
+
this._inputElem.classList.add('icon--left');
|
|
177
|
+
if (this._labelElem) {
|
|
178
|
+
this._labelElem.classList.add("input__label--left");
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
else if (slot.name == "rightIcon") {
|
|
182
|
+
content.style.right = "0px";
|
|
183
|
+
content.style.borderRadius = "0 var(--ni--border-radius) var(--ni--border-radius) 0";
|
|
184
|
+
this._inputElem.classList.add('icon--right');
|
|
185
|
+
}
|
|
186
|
+
this.showError();
|
|
187
|
+
}
|
|
188
|
+
doFocus() {
|
|
189
|
+
if (this.label && this._labelElem) {
|
|
190
|
+
this._labelElem.classList.contains("input__label--floated") ? undefined : this._labelElem.classList.add("input__label--floated");
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
settingComponent() {
|
|
194
|
+
const value = '' + this.value;
|
|
195
|
+
if (this.value !== undefined) {
|
|
196
|
+
try {
|
|
197
|
+
this._inputElem.value = this.formatnumber.toUpperCase() !== "EN-US" ? RequestMetadata.NumberUtils.format(value, this.precision, this.prettyprecision) : RequestMetadata.NumberUtils.changeFormat(RequestMetadata.NumberUtils.format(value, this.precision, this.prettyprecision));
|
|
198
|
+
}
|
|
199
|
+
catch (e) {
|
|
200
|
+
this.errormessage = e.message;
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
this.strvalue = this._inputElem.value;
|
|
204
|
+
}
|
|
205
|
+
this.adjustFloatingLabel();
|
|
206
|
+
}
|
|
207
|
+
settingValue() {
|
|
208
|
+
//this.value: en-US format => Need to convert
|
|
209
|
+
const value = !isNaN(this.value) ? '' + this.value : 'NaN';
|
|
210
|
+
if (!this.checkNumberValidation(value)) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
//output default from ".format": pt-BR
|
|
214
|
+
const tempStrValue = RequestMetadata.NumberUtils.format(value, this.precision, this.prettyprecision);
|
|
215
|
+
//output => depends to formatnumber
|
|
216
|
+
this.strvalue = this.formatnumber.toUpperCase() !== 'EN-US' ? tempStrValue : RequestMetadata.NumberUtils.changeFormat(tempStrValue);
|
|
217
|
+
RequestMetadata.NumberUtils.format(this.value.toString(), this.precision, this.prettyprecision);
|
|
218
|
+
}
|
|
219
|
+
//---------------------------------------------
|
|
220
|
+
// Lifecycle web component
|
|
221
|
+
//---------------------------------------------
|
|
222
|
+
componentDidLoad() {
|
|
223
|
+
if (!this.textleft) {
|
|
224
|
+
this._inputElem.classList.add('text--right');
|
|
225
|
+
}
|
|
226
|
+
this.showError();
|
|
227
|
+
this.adjustFloatingLabel();
|
|
228
|
+
}
|
|
229
|
+
componentWillLoad() {
|
|
230
|
+
this.onPrecisionChanged(this.precision);
|
|
231
|
+
this.onPrettyPrecisionChanged(this.prettyprecision);
|
|
232
|
+
this.settingValue();
|
|
233
|
+
}
|
|
234
|
+
render() {
|
|
235
|
+
const labelInput = this.label ? index.h("label", { onClick: () => this._inputElem.focus(), class: "input__label", ref: (el) => this._labelElem = el }, this.label) : null;
|
|
236
|
+
return (index.h(index.Host, null, index.h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), labelInput, index.h("input", { onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: "text", value: this.strvalue, disabled: !this.enabled, onInput: this.handleChange.bind(this), onFocusout: this.handleFocusout.bind(this) }), index.h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), index.h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el }, this.errormessage)));
|
|
237
|
+
}
|
|
238
|
+
get el() { return index.getElement(this); }
|
|
239
|
+
static get watchers() { return {
|
|
240
|
+
"errormessage": ["showError"],
|
|
241
|
+
"precision": ["onPrecisionChanged"],
|
|
242
|
+
"prettyprecision": ["onPrettyPrecisionChanged"],
|
|
243
|
+
"value": ["onValueChanged"]
|
|
244
|
+
}; }
|
|
245
|
+
};
|
|
246
|
+
NumberInput.style = ezNumberInputCss;
|
|
247
|
+
|
|
248
|
+
exports.ez_number_input = NumberInput;
|