@sankhyalabs/sankhyablocks 1.1.28 → 1.2.0
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/LICENSE +21 -21
- package/README.md +75 -75
- package/package.json +94 -52
- package/react/.keepfolder +1 -0
- package/dist/cjs/ApplicationUtils-05b74ee9.js +0 -39
- package/dist/cjs/AssetsUtils-7e3c38f9.js +0 -24
- package/dist/cjs/CSSVarsUtils-75ca9c64.js +0 -19
- package/dist/cjs/_commonjsHelpers-537d719a.js +0 -20
- package/dist/cjs/ez-action-chip.cjs.entry.js +0 -27
- package/dist/cjs/ez-application.cjs.entry.js +0 -26
- package/dist/cjs/ez-button_4.cjs.entry.js +0 -660
- package/dist/cjs/ez-calendar.cjs.entry.js +0 -223
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +0 -47
- package/dist/cjs/ez-combo-box.cjs.entry.js +0 -278
- package/dist/cjs/ez-date-input.cjs.entry.js +0 -102
- package/dist/cjs/ez-date-time-input.cjs.entry.js +0 -145
- package/dist/cjs/ez-dialog.cjs.entry.js +0 -89
- package/dist/cjs/ez-form.cjs.entry.js +0 -785
- package/dist/cjs/ez-grid.cjs.entry.js +0 -110485
- package/dist/cjs/ez-icon.cjs.entry.js +0 -41
- package/dist/cjs/ez-label-chip.cjs.entry.js +0 -104
- package/dist/cjs/ez-modal_2.cjs.entry.js +0 -316
- package/dist/cjs/ez-number-input.cjs.entry.js +0 -86
- package/dist/cjs/ez-popover.cjs.entry.js +0 -120
- package/dist/cjs/ez-popup.cjs.entry.js +0 -48
- package/dist/cjs/ez-search.cjs.entry.js +0 -64
- package/dist/cjs/ez-tabselector.cjs.entry.js +0 -198
- package/dist/cjs/ez-text-area.cjs.entry.js +0 -114
- package/dist/cjs/ez-text-input.cjs.entry.js +0 -201
- package/dist/cjs/ez-time-input.cjs.entry.js +0 -118
- package/dist/cjs/ez-toast.cjs.entry.js +0 -44
- package/dist/cjs/ez-upload.cjs.entry.js +0 -356
- package/dist/cjs/index-682c98b2.js +0 -1771
- package/dist/cjs/index.cjs.js +0 -2
- package/dist/cjs/loader.cjs.js +0 -21
- package/dist/cjs/sankhyablocks.cjs.js +0 -19
- package/dist/cjs/snk-application.cjs.entry.js +0 -7050
- package/dist/cjs/test-du.cjs.entry.js +0 -76
- package/dist/collection/collection-manifest.json +0 -47
- package/dist/collection/components/snk-application/snk-application.css +0 -5
- package/dist/collection/components/snk-application/snk-application.js +0 -492
- package/dist/collection/index.js +0 -1
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +0 -158
- package/dist/collection/lib/http/data-fetcher/fetchers/application-config-fetcher.js +0 -23
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +0 -188
- package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +0 -25
- package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +0 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +0 -59
- package/dist/collection/lib/http/data-fetcher/fetchers/resource-fetcher.js +0 -30
- package/dist/collection/lib/http/data-fetcher/state/LoadStateManager.js +0 -66
- package/dist/collection/lib/utils/pesquisa.js +0 -16
- package/dist/collection/lib/utils/urlutils.js +0 -23
- package/dist/collection/lib/workspace/workspace.js +0 -7
- package/dist/components/ApplicationUtils.js +0 -37
- package/dist/components/AssetsUtils.js +0 -22
- package/dist/components/CSSVarsUtils.js +0 -17
- package/dist/components/_commonjsHelpers.js +0 -17
- package/dist/components/ez-action-chip.js +0 -44
- package/dist/components/ez-application.js +0 -39
- package/dist/components/ez-button.js +0 -6
- package/dist/components/ez-button2.js +0 -105
- package/dist/components/ez-calendar.js +0 -6
- package/dist/components/ez-calendar2.js +0 -242
- package/dist/components/ez-check.js +0 -6
- package/dist/components/ez-check2.js +0 -94
- package/dist/components/ez-collapsible-box.js +0 -67
- package/dist/components/ez-combo-box.js +0 -6
- package/dist/components/ez-combo-box2.js +0 -311
- package/dist/components/ez-date-input.js +0 -135
- package/dist/components/ez-date-time-input.js +0 -179
- package/dist/components/ez-dialog.js +0 -124
- package/dist/components/ez-form.js +0 -6
- package/dist/components/ez-form2.js +0 -807
- package/dist/components/ez-grid.js +0 -110576
- package/dist/components/ez-icon.js +0 -6
- package/dist/components/ez-icon2.js +0 -56
- package/dist/components/ez-label-chip.js +0 -125
- package/dist/components/ez-list.js +0 -6
- package/dist/components/ez-list2.js +0 -523
- package/dist/components/ez-modal.js +0 -6
- package/dist/components/ez-modal2.js +0 -82
- package/dist/components/ez-number-input.js +0 -115
- package/dist/components/ez-popover.js +0 -145
- package/dist/components/ez-popup.js +0 -67
- package/dist/components/ez-search.js +0 -100
- package/dist/components/ez-tabselector.js +0 -6
- package/dist/components/ez-tabselector2.js +0 -213
- package/dist/components/ez-text-area.js +0 -137
- package/dist/components/ez-text-input.js +0 -6
- package/dist/components/ez-text-input2.js +0 -223
- package/dist/components/ez-time-input.js +0 -153
- package/dist/components/ez-toast.js +0 -64
- package/dist/components/ez-upload.js +0 -382
- package/dist/components/grid-config.js +0 -6
- package/dist/components/grid-config2.js +0 -318
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -1
- package/dist/components/select-box.js +0 -6
- package/dist/components/select-box2.js +0 -47
- package/dist/components/snk-application.d.ts +0 -11
- package/dist/components/snk-application.js +0 -7079
- package/dist/components/test-du.js +0 -101
- package/dist/esm/ApplicationUtils-e0b6d857.js +0 -37
- package/dist/esm/AssetsUtils-6e6624dc.js +0 -22
- package/dist/esm/CSSVarsUtils-0787c3f3.js +0 -17
- package/dist/esm/_commonjsHelpers-9943807e.js +0 -17
- package/dist/esm/ez-action-chip.entry.js +0 -23
- package/dist/esm/ez-application.entry.js +0 -22
- package/dist/esm/ez-button_4.entry.js +0 -653
- package/dist/esm/ez-calendar.entry.js +0 -219
- package/dist/esm/ez-collapsible-box.entry.js +0 -43
- package/dist/esm/ez-combo-box.entry.js +0 -274
- package/dist/esm/ez-date-input.entry.js +0 -98
- package/dist/esm/ez-date-time-input.entry.js +0 -141
- package/dist/esm/ez-dialog.entry.js +0 -85
- package/dist/esm/ez-form.entry.js +0 -781
- package/dist/esm/ez-grid.entry.js +0 -110481
- package/dist/esm/ez-icon.entry.js +0 -37
- package/dist/esm/ez-label-chip.entry.js +0 -100
- package/dist/esm/ez-modal_2.entry.js +0 -311
- package/dist/esm/ez-number-input.entry.js +0 -82
- package/dist/esm/ez-popover.entry.js +0 -116
- package/dist/esm/ez-popup.entry.js +0 -44
- package/dist/esm/ez-search.entry.js +0 -60
- package/dist/esm/ez-tabselector.entry.js +0 -194
- package/dist/esm/ez-text-area.entry.js +0 -110
- package/dist/esm/ez-text-input.entry.js +0 -197
- package/dist/esm/ez-time-input.entry.js +0 -114
- package/dist/esm/ez-toast.entry.js +0 -40
- package/dist/esm/ez-upload.entry.js +0 -352
- package/dist/esm/index-35088a3f.js +0 -1740
- package/dist/esm/index.js +0 -1
- package/dist/esm/loader.js +0 -17
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/sankhyablocks.js +0 -17
- package/dist/esm/snk-application.entry.js +0 -7046
- package/dist/esm/test-du.entry.js +0 -72
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-action-chip/ez-action-chip.css +0 -67
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-application/ez-application.css +0 -3
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-button/ez-button.css +0 -180
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-calendar/ez-calendar.css +0 -319
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-check/ez-check.css +0 -327
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +0 -162
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-combo-box/ez-combo-box.css +0 -217
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-date-input/ez-date-input.css +0 -49
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-date-time-input/ez-date-time-input.css +0 -44
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-dialog/ez-dialog.css +0 -527
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-form/ez-form.css +0 -5
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/ez-grid.css +0 -31
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.css +0 -129
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/subcomponents/select-box/select-box.css +0 -10
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-icon/ez-icon.css +0 -176
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-label-chip/ez-label-chip.css +0 -139
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-list/ez-list.css +0 -335
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-modal/ez-modal.css +0 -358
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-number-input/ez-number-input.css +0 -4
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-popover/ez-popover.css +0 -44
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-popup/ez-popup.css +0 -405
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-search/ez-search.css +0 -3
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-tabselector/ez-tabselector.css +0 -138
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-text-area/ez-text-area.css +0 -165
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-text-input/ez-text-input.css +0 -196
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-time-input/ez-time-input.css +0 -10
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-toast/ez-toast.css +0 -127
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-upload/ez-upload.css +0 -568
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/test-du/test-du.css +0 -3
- package/dist/sankhyablocks/index.esm.js +0 -0
- package/dist/sankhyablocks/p-0183d259.entry.js +0 -1
- package/dist/sankhyablocks/p-01f23a70.entry.js +0 -1
- package/dist/sankhyablocks/p-07c32f68.entry.js +0 -1
- package/dist/sankhyablocks/p-0f90499d.entry.js +0 -1
- package/dist/sankhyablocks/p-105724a3.entry.js +0 -1
- package/dist/sankhyablocks/p-112455b1.js +0 -1
- package/dist/sankhyablocks/p-2ac02d48.entry.js +0 -1
- package/dist/sankhyablocks/p-35364a97.entry.js +0 -1
- package/dist/sankhyablocks/p-3f6aa9a7.entry.js +0 -1
- package/dist/sankhyablocks/p-4811bc0a.entry.js +0 -369
- package/dist/sankhyablocks/p-5f9af495.entry.js +0 -1
- package/dist/sankhyablocks/p-60967cf0.js +0 -1
- package/dist/sankhyablocks/p-70ad6c16.entry.js +0 -1
- package/dist/sankhyablocks/p-710bfffe.entry.js +0 -1
- package/dist/sankhyablocks/p-73397a0f.entry.js +0 -57
- package/dist/sankhyablocks/p-811b4b9d.js +0 -1
- package/dist/sankhyablocks/p-813fe4f7.js +0 -1
- package/dist/sankhyablocks/p-85a9446b.js +0 -2
- package/dist/sankhyablocks/p-89a1100f.entry.js +0 -1
- package/dist/sankhyablocks/p-8b543003.entry.js +0 -1
- package/dist/sankhyablocks/p-9750632b.entry.js +0 -1
- package/dist/sankhyablocks/p-a96272f7.entry.js +0 -1
- package/dist/sankhyablocks/p-ac8842e5.entry.js +0 -1
- package/dist/sankhyablocks/p-ba64cc41.entry.js +0 -1
- package/dist/sankhyablocks/p-c1ede043.entry.js +0 -1
- package/dist/sankhyablocks/p-d90ebb85.entry.js +0 -1
- package/dist/sankhyablocks/p-e5355a29.entry.js +0 -1
- package/dist/sankhyablocks/p-ef04b633.entry.js +0 -1
- package/dist/sankhyablocks/p-f6db07fb.entry.js +0 -1
- package/dist/sankhyablocks/p-f80cabc7.entry.js +0 -1
- package/dist/sankhyablocks/p-fcd9bd92.entry.js +0 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +0 -1
- package/dist/types/components/snk-application/snk-application.d.ts +0 -44
- package/dist/types/components.d.ts +0 -66
- package/dist/types/index.d.ts +0 -1
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +0 -15
- package/dist/types/lib/http/data-fetcher/fetchers/application-config-fetcher.d.ts +0 -6
- package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +0 -12
- package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +0 -5
- package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +0 -2
- package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +0 -13
- package/dist/types/lib/http/data-fetcher/fetchers/resource-fetcher.d.ts +0 -6
- package/dist/types/lib/http/data-fetcher/state/LoadStateManager.d.ts +0 -23
- package/dist/types/lib/utils/pesquisa.d.ts +0 -2
- package/dist/types/lib/utils/urlutils.d.ts +0 -4
- package/dist/types/lib/workspace/workspace.d.ts +0 -4
- package/dist/types/stencil-public-runtime.d.ts +0 -1565
- package/loader/cdn.js +0 -3
- package/loader/index.cjs.js +0 -3
- package/loader/index.d.ts +0 -12
- package/loader/index.es2017.js +0 -3
- package/loader/index.js +0 -4
- package/loader/package.json +0 -10
- package/react/components.d.ts +0 -32
- package/react/components.js +0 -35
- package/react/components.js.map +0 -1
- package/react/react-component-lib/createComponent.d.ts +0 -10
- package/react/react-component-lib/createComponent.js +0 -75
- package/react/react-component-lib/createComponent.js.map +0 -1
- package/react/react-component-lib/createOverlayComponent.d.ts +0 -21
- package/react/react-component-lib/createOverlayComponent.js +0 -109
- package/react/react-component-lib/createOverlayComponent.js.map +0 -1
- package/react/react-component-lib/index.d.ts +0 -2
- package/react/react-component-lib/index.js +0 -3
- package/react/react-component-lib/index.js.map +0 -1
- package/react/react-component-lib/interfaces.d.ts +0 -29
- package/react/react-component-lib/interfaces.js +0 -1
- package/react/react-component-lib/interfaces.js.map +0 -1
- package/react/react-component-lib/utils/attachProps.d.ts +0 -12
- package/react/react-component-lib/utils/attachProps.js +0 -98
- package/react/react-component-lib/utils/attachProps.js.map +0 -1
- package/react/react-component-lib/utils/case.d.ts +0 -2
- package/react/react-component-lib/utils/case.js +0 -7
- package/react/react-component-lib/utils/case.js.map +0 -1
- package/react/react-component-lib/utils/dev.d.ts +0 -2
- package/react/react-component-lib/utils/dev.js +0 -13
- package/react/react-component-lib/utils/dev.js.map +0 -1
- package/react/react-component-lib/utils/index.d.ts +0 -10
- package/react/react-component-lib/utils/index.js +0 -34
- package/react/react-component-lib/utils/index.js.map +0 -1
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
|
|
3
|
-
const ezTextAreaCss = ":host{--text-area--width:100%;--text-area--border-radius:var(--border--radius-medium, 12px);--text-area--font-size:var(--text--medium, 14px);--text-area--font-family:var(--font-pattern, Arial);--text-area--font-weight:var(--text-weight--large, 500);--text-area--color:var(--title--primary, #000);--text-area__input--background-color:var(--background--medium, #e0e0e0);--text-area__input--border:var(--border--medium, 2px solid);--text-area__input--border-color:var(--text-area__input--background-color);--text-area__input--focus--border-color:var(--color--primary, #008561);--text-area__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--text-area__input--disabled--color:var(--text--disable, #AFB6C0);--text-area__input--error--border-color:#CC2936;--text-area__message_box--font-size:var(--text--small, 12px);--text-area__message_box--info--color:var(--color--success, #22085d);--text-area__message_box--error--color:var(--color--error, #FF0000);--text-area__label--floating--top:6px;--text-area__label--padding-top:12px;--text-area__label--padding-left:14px;--text-area__label--padding-right:12px;display:flex;flex-wrap:wrap;position:relative;width:var(--text-area--width)}textarea{box-sizing:border-box;border:none;resize:none;margin-top:calc(var(--space--medium, 12px) + 4px);width:100%;font-weight:var(--text-weight--large, 600);font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);color:var(--text-area--color);padding:0;background:none}textarea:focus{outline:none}textarea:disabled{background-color:transparent;color:var(--text-area__input--disabled--color)}.textarea{width:100%;box-sizing:border-box;padding-left:var(--space--medium);padding-right:var(--space--extra-small);border-radius:var(--text-area--border-radius);border:var(--text-area__input--border);border-color:var(--text-area__input--border-color);background-color:var(--text-area__input--background-color)}.textarea--focus{border-color:var(--text-area__input--focus--border-color)}.textarea.hasError{color:var(--text-area--color);border-color:var(--text-area__input--error--border-color)}.message-box{min-height:16px;min-width:100%;margin-top:3px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--text-area--font-family);font-size:var(--text-area__message_box--font-size);color:var(--text-area__message_box--info--color)}.hasError{color:var(--text-area__message_box--error--color)}.textarea__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--text-area__label--padding-right));left:var(--text-area--space--medium);font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color);top:var(--text-area__label--padding-top);left:var(--text-area__label--padding-left);padding-right:var(--text-area__label--padding-right)}.textarea__label--floated{font-family:var(--text-area--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--text-area__label--floating--top)}.textarea__label--disabled{color:var(--text-area__input--disabled--color)}";
|
|
4
|
-
|
|
5
|
-
const EzTextArea$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
-
constructor() {
|
|
7
|
-
super();
|
|
8
|
-
this.__registerHost();
|
|
9
|
-
this.__attachShadow();
|
|
10
|
-
this.ezChange = createEvent(this, "ezChange", 7);
|
|
11
|
-
/**
|
|
12
|
-
* Deixa o campo disponível ou não para digitação.
|
|
13
|
-
*/
|
|
14
|
-
this.enabled = true;
|
|
15
|
-
/**
|
|
16
|
-
* Ajusta o número de linhas e consequentemente o height do textarea. Valor default: 4
|
|
17
|
-
*/
|
|
18
|
-
this.rows = 4;
|
|
19
|
-
}
|
|
20
|
-
showError() {
|
|
21
|
-
const hasError = typeof this.errorMessage === 'string' && this.errorMessage !== '';
|
|
22
|
-
if (hasError) {
|
|
23
|
-
this._container.classList.add('hasError');
|
|
24
|
-
this._messageBoxElem.classList.add('hasError');
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
this._container.classList.remove('hasError');
|
|
28
|
-
this._messageBoxElem.classList.remove('hasError');
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
updateInputValue() {
|
|
32
|
-
this._inputElem.value = this.value === undefined ? "" : this.value;
|
|
33
|
-
this.handleChange();
|
|
34
|
-
this.adjustFloatingLabel();
|
|
35
|
-
this.ezChange.emit(this.value);
|
|
36
|
-
}
|
|
37
|
-
adjustFloatingLabel() {
|
|
38
|
-
if (this.label) {
|
|
39
|
-
const hasValue = this.value && this.value.toString().length > 0;
|
|
40
|
-
const containsFloatedClass = this._labelElem.classList.contains("textarea__label--floated");
|
|
41
|
-
if (hasValue || this.isFocused()) {
|
|
42
|
-
if (!containsFloatedClass) {
|
|
43
|
-
this._labelElem.classList.add("textarea__label--floated");
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
if (containsFloatedClass) {
|
|
48
|
-
this._labelElem.classList.remove("textarea__label--floated");
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
isFocused() {
|
|
54
|
-
return this._hostElement.shadowRoot.activeElement !== null;
|
|
55
|
-
}
|
|
56
|
-
//---------------------------------------------
|
|
57
|
-
// Public methods
|
|
58
|
-
//---------------------------------------------
|
|
59
|
-
/**
|
|
60
|
-
* Faz o foco no componente de input
|
|
61
|
-
*/
|
|
62
|
-
async setFocus() {
|
|
63
|
-
this._inputElem.focus();
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Remove o foco no componente de input
|
|
67
|
-
*/
|
|
68
|
-
async setBlur() {
|
|
69
|
-
this._inputElem.blur();
|
|
70
|
-
}
|
|
71
|
-
//---------------------------------------------
|
|
72
|
-
// Event handlers
|
|
73
|
-
//---------------------------------------------
|
|
74
|
-
handleFocusout() {
|
|
75
|
-
this.adjustFloatingLabel();
|
|
76
|
-
if (this._container && this._container.classList.contains("textarea--focus")) {
|
|
77
|
-
this._container.classList.remove("textarea--focus");
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
handleChange() {
|
|
81
|
-
this.errorMessage = "";
|
|
82
|
-
this.value = this._inputElem.value;
|
|
83
|
-
}
|
|
84
|
-
handleFocus() {
|
|
85
|
-
if (this.label && this._labelElem && !this._labelElem.classList.contains("textarea__label--floated")) {
|
|
86
|
-
this._labelElem.classList.add("textarea__label--floated");
|
|
87
|
-
}
|
|
88
|
-
if (this._container && !this._container.classList.contains("textarea--focus")) {
|
|
89
|
-
this._container.classList.add("textarea--focus");
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
//---------------------------------------------
|
|
93
|
-
// Lifecycle web component
|
|
94
|
-
//---------------------------------------------
|
|
95
|
-
componentDidLoad() {
|
|
96
|
-
this.showError();
|
|
97
|
-
this.adjustFloatingLabel();
|
|
98
|
-
}
|
|
99
|
-
render() {
|
|
100
|
-
return (h(Host, null, h("div", { class: "textarea", ref: (el) => this._container = el }, this.label ?
|
|
101
|
-
h("label", { ref: (el) => this._labelElem = el, class: this.enabled ? "textarea__label" : "textarea__label textarea__label--disabled", onClick: () => this._inputElem.focus(), title: this.label }, this.label)
|
|
102
|
-
: null, h("textarea", { onFocus: () => this.handleFocus(), ref: (el) => this._inputElem = el, value: this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, onKeyDown: event => event.stopPropagation(), rows: this.rows })), h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage }, this.errorMessage)));
|
|
103
|
-
}
|
|
104
|
-
get _hostElement() { return this; }
|
|
105
|
-
static get watchers() { return {
|
|
106
|
-
"errorMessage": ["showError"],
|
|
107
|
-
"value": ["updateInputValue"]
|
|
108
|
-
}; }
|
|
109
|
-
static get style() { return ezTextAreaCss; }
|
|
110
|
-
}, [1, "ez-text-area", {
|
|
111
|
-
"label": [513],
|
|
112
|
-
"value": [1537],
|
|
113
|
-
"enabled": [516],
|
|
114
|
-
"loading": [516],
|
|
115
|
-
"errorMessage": [1537, "error-message"],
|
|
116
|
-
"rows": [1538],
|
|
117
|
-
"setFocus": [64],
|
|
118
|
-
"setBlur": [64]
|
|
119
|
-
}]);
|
|
120
|
-
function defineCustomElement$1() {
|
|
121
|
-
if (typeof customElements === "undefined") {
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
const components = ["ez-text-area"];
|
|
125
|
-
components.forEach(tagName => { switch (tagName) {
|
|
126
|
-
case "ez-text-area":
|
|
127
|
-
if (!customElements.get(tagName)) {
|
|
128
|
-
customElements.define(tagName, EzTextArea$1);
|
|
129
|
-
}
|
|
130
|
-
break;
|
|
131
|
-
} });
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
const EzTextArea = EzTextArea$1;
|
|
135
|
-
const defineCustomElement = defineCustomElement$1;
|
|
136
|
-
|
|
137
|
-
export { EzTextArea, defineCustomElement };
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { MaskFormatter } from '@sankhyalabs/core';
|
|
3
|
-
|
|
4
|
-
const ezTextInputCss = ":host{--ez-text-input--height:42px;--ez-text-input--width:100%;--ez-text-input__icon--width:48px;--ez-text-input--border-radius:var(--border--radius-medium, 12px);--ez-text-input--font-size:var(--text--medium, 14px);--ez-text-input--font-family:var(--font-pattern, Arial);--ez-text-input--font-weight:var(--text-weight--medium, 400);--ez-text-input--color:var(--title--primary, #000);--ez-text-input__input--background-color:var(--background--medium, #e0e0e0);--ez-text-input__input--border:var(--border--medium, 2px solid);--ez-text-input__input--border-color:var(--ez-text-input__input--background-color);--ez-text-input__input--focus--border-color:var(--color--primary, #008561);--ez-text-input__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-text-input__input--disabled--color:var(--text--disable, #AFB6C0);--ez-text-input__input--error--border-color:#CC2936;--ez-text-input__message_box--font-size:var(--text--small, 12px);--ez-text-input__message_box--info--color:var(--color--success, #22085d);--ez-text-input__message_box--error--color:var(--color--error, #FF0000);--ez-text-input__label--floating--top:6px;--ez-text-input__label--padding-top:12px;--ez-text-input__label--padding-left:14px;--ez-text-input__label--padding-right:12px;display:flex;flex-wrap:wrap;position:relative;width:var(--ez-text-input--width)}input{width:100%;box-sizing:border-box;padding:var(--space--medium, 6px);font-weight:var(--text-weight--large, 600);height:var(--ez-text-input--height);border-radius:var(--ez-text-input--border-radius);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);border:var(--ez-text-input__input--border);border-color:var(--ez-text-input__input--border-color);background-color:var(--ez-text-input__input--background-color);color:var(--ez-text-input--color)}input:disabled{background-color:var(--ez-text-input__input--disabled--background-color);color:var(--ez-text-input__input--disabled--color)}input:focus{outline:none;border-color:var(--ez-text-input__input--focus--border-color)}input.icon--left{padding-left:var(--ez-text-input__icon--width)}input.icon--right{padding-right:var(--ez-text-input__icon--width)}input.hasError{color:var(--ez-text-input--color);border-color:var(--ez-text-input__input--error--border-color)}input.text--right{text-align:right}.message-box{min-height:16px;min-width:100%;margin-top:3px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input__message_box--font-size);color:var(--ez-text-input__message_box--info--color)}.hasError{color:var(--ez-text-input__message_box--error--color)}.input__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--ez-text-input__label--padding-right));left:var(--ez-text-input--space--medium);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color);top:var(--ez-text-input__label--padding-top);left:var(--ez-text-input__label--padding-left);padding-right:var(--ez-text-input__label--padding-right)}.input__label--floated{font-family:var(--ez-text-input--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--ez-text-input__label--floating--top)}.input__label--disabled{color:var(--ez-text-input__input--disabled--color)}.input__label--left{text-align:left;left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--right{right:var(--ez-text-input__icon--width);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--left.input__label--right{left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width) * 2)}.input--with--label{padding-bottom:0}";
|
|
5
|
-
|
|
6
|
-
const EzTextInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
|
-
constructor() {
|
|
8
|
-
super();
|
|
9
|
-
this.__registerHost();
|
|
10
|
-
this.__attachShadow();
|
|
11
|
-
this.ezChange = createEvent(this, "ezChange", 7);
|
|
12
|
-
/**
|
|
13
|
-
* Deixa o campo disponível ou não para digitação.
|
|
14
|
-
*/
|
|
15
|
-
this.enabled = true;
|
|
16
|
-
/**
|
|
17
|
-
* Permite exibir a mensagem de erro.
|
|
18
|
-
*/
|
|
19
|
-
this.canShowError = true;
|
|
20
|
-
}
|
|
21
|
-
showError() {
|
|
22
|
-
const hasError = typeof this.errorMessage === "string" && this.errorMessage !== "";
|
|
23
|
-
if (hasError) {
|
|
24
|
-
this._inputElem.classList.add("hasError");
|
|
25
|
-
this._messageBoxElem.classList.add("hasError");
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
this._inputElem.classList.remove("hasError");
|
|
29
|
-
this._messageBoxElem.classList.remove("hasError");
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
prepareMask() {
|
|
33
|
-
if (this.mask) {
|
|
34
|
-
if (this._maskFormatter == undefined) {
|
|
35
|
-
this._maskFormatter = new MaskFormatter(this.mask);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
this._maskFormatter.mask = this.mask;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
updateInputValue() {
|
|
43
|
-
if (this._inputElem) {
|
|
44
|
-
this._inputElem.value = this.value;
|
|
45
|
-
}
|
|
46
|
-
this.handleChange();
|
|
47
|
-
this.errorMessage = "";
|
|
48
|
-
this.ezChange.emit(this.value);
|
|
49
|
-
this.adjustFloatingLabel();
|
|
50
|
-
}
|
|
51
|
-
adjustFloatingLabel() {
|
|
52
|
-
if (this.label && this._labelElem) {
|
|
53
|
-
if (this._inputElem && !this._inputElem.classList.contains("input--with--label")) {
|
|
54
|
-
this._inputElem.classList.add("input--with--label");
|
|
55
|
-
}
|
|
56
|
-
const hasValue = this.value && this.value.toString().length > 0;
|
|
57
|
-
const containsFloatedClass = this._labelElem.classList.contains("input__label--floated");
|
|
58
|
-
if (hasValue || this.isFocused()) {
|
|
59
|
-
if (!containsFloatedClass) {
|
|
60
|
-
this._labelElem.classList.add("input__label--floated");
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
if (containsFloatedClass) {
|
|
65
|
-
this._labelElem.classList.remove("input__label--floated");
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
isFocused() {
|
|
71
|
-
return this._hostElement.shadowRoot.activeElement !== null;
|
|
72
|
-
}
|
|
73
|
-
//---------------------------------------------
|
|
74
|
-
// Public methods
|
|
75
|
-
//---------------------------------------------
|
|
76
|
-
/**
|
|
77
|
-
* Faz o foco no componente de input
|
|
78
|
-
*/
|
|
79
|
-
async setFocus() {
|
|
80
|
-
this._inputElem.focus();
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Remove o foco no componente de input
|
|
84
|
-
*/
|
|
85
|
-
async setBlur() {
|
|
86
|
-
this._inputElem.blur();
|
|
87
|
-
}
|
|
88
|
-
//---------------------------------------------
|
|
89
|
-
// Event handlers
|
|
90
|
-
//---------------------------------------------
|
|
91
|
-
handleFocusout() {
|
|
92
|
-
const value = this._inputElem.value;
|
|
93
|
-
if (value && this._maskFormatter) {
|
|
94
|
-
try {
|
|
95
|
-
this._inputElem.value = this._maskFormatter.format(value);
|
|
96
|
-
}
|
|
97
|
-
catch (e) {
|
|
98
|
-
this.errorMessage = e.message;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
this.value = this._inputElem.value;
|
|
102
|
-
this.adjustFloatingLabel();
|
|
103
|
-
}
|
|
104
|
-
isValidValue(value) {
|
|
105
|
-
if (this.restrict) {
|
|
106
|
-
return Array.from(value).reduce((valid, c) => valid && this.restrict.indexOf(c) > -1, true);
|
|
107
|
-
}
|
|
108
|
-
return true;
|
|
109
|
-
}
|
|
110
|
-
handleChange() {
|
|
111
|
-
if (!this._inputElem) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
const value = this._inputElem.value;
|
|
115
|
-
if (this.isValidValue(value)) {
|
|
116
|
-
this._lastValidValue = value;
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
this._inputElem.value = this._lastValidValue === undefined ? "" : this._lastValidValue;
|
|
120
|
-
}
|
|
121
|
-
this.value = this._inputElem.value;
|
|
122
|
-
}
|
|
123
|
-
handleSlotChange(ev) {
|
|
124
|
-
const slot = ev.target;
|
|
125
|
-
const content = slot.assignedElements()[0];
|
|
126
|
-
if (content) {
|
|
127
|
-
content.style.position = "absolute";
|
|
128
|
-
content.style.display = "flex";
|
|
129
|
-
content.style.alignItems = "center";
|
|
130
|
-
content.style.justifyContent = "center";
|
|
131
|
-
content.style.overflow = "hidden";
|
|
132
|
-
content.style.top = "0px";
|
|
133
|
-
content.style.width = "var(--ez-text-input__icon--width)";
|
|
134
|
-
content.style.height = "var(--ez-text-input--height)";
|
|
135
|
-
if (slot.name == "leftIcon") {
|
|
136
|
-
content.style.left = "0px";
|
|
137
|
-
content.style.borderRadius = "var(--ez-text-input--border-radius) 0 0 var(--ez-text-input--border-radius)";
|
|
138
|
-
this._inputElem.classList.add("icon--left");
|
|
139
|
-
if (this._labelElem) {
|
|
140
|
-
this._labelElem.classList.add("input__label--left");
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
else if (slot.name == "rightIcon") {
|
|
144
|
-
content.style.right = "0px";
|
|
145
|
-
content.style.borderRadius = "0 var(--ez-text-input--border-radius) var(--ez-text-input--border-radius) 0";
|
|
146
|
-
this._inputElem.classList.add("icon--right");
|
|
147
|
-
if (this._labelElem) {
|
|
148
|
-
this._labelElem.classList.add("input__label--right");
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
this.showError();
|
|
153
|
-
}
|
|
154
|
-
doFocus() {
|
|
155
|
-
if (this.label && this._labelElem && !this._labelElem.classList.contains("input__label--floated")) {
|
|
156
|
-
this._labelElem.classList.add("input__label--floated");
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
//---------------------------------------------
|
|
160
|
-
// Lifecycle web component
|
|
161
|
-
//---------------------------------------------
|
|
162
|
-
componentDidLoad() {
|
|
163
|
-
this.showError();
|
|
164
|
-
this.prepareMask();
|
|
165
|
-
this.adjustFloatingLabel();
|
|
166
|
-
}
|
|
167
|
-
componentWillLoad() {
|
|
168
|
-
this.prepareMask();
|
|
169
|
-
if (this.value) {
|
|
170
|
-
if (this._maskFormatter) {
|
|
171
|
-
try {
|
|
172
|
-
this.value = this._maskFormatter.format(this.value);
|
|
173
|
-
}
|
|
174
|
-
catch (e) {
|
|
175
|
-
this.errorMessage = e.message;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
if (!this.isValidValue(this.value)) {
|
|
179
|
-
this._lastValidValue = "";
|
|
180
|
-
this.value = "";
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
render() {
|
|
185
|
-
return (h(Host, null, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label ?
|
|
186
|
-
h("label", { ref: (el) => this._labelElem = el, class: this.enabled ? "input__label" : "input__label input__label--disabled", onClick: () => this._inputElem.focus(), title: this.label }, this.label)
|
|
187
|
-
: null, h("input", { onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: "text", value: this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }), h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.canShowError &&
|
|
188
|
-
h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage }, this.errorMessage)));
|
|
189
|
-
}
|
|
190
|
-
get _hostElement() { return this; }
|
|
191
|
-
static get watchers() { return {
|
|
192
|
-
"errorMessage": ["showError"],
|
|
193
|
-
"mask": ["prepareMask"],
|
|
194
|
-
"value": ["updateInputValue"]
|
|
195
|
-
}; }
|
|
196
|
-
static get style() { return ezTextInputCss; }
|
|
197
|
-
}, [1, "ez-text-input", {
|
|
198
|
-
"label": [513],
|
|
199
|
-
"value": [1537],
|
|
200
|
-
"enabled": [516],
|
|
201
|
-
"loading": [516],
|
|
202
|
-
"errorMessage": [1537, "error-message"],
|
|
203
|
-
"mask": [1],
|
|
204
|
-
"canShowError": [516, "can-show-error"],
|
|
205
|
-
"restrict": [1],
|
|
206
|
-
"setFocus": [64],
|
|
207
|
-
"setBlur": [64]
|
|
208
|
-
}]);
|
|
209
|
-
function defineCustomElement() {
|
|
210
|
-
if (typeof customElements === "undefined") {
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
const components = ["ez-text-input"];
|
|
214
|
-
components.forEach(tagName => { switch (tagName) {
|
|
215
|
-
case "ez-text-input":
|
|
216
|
-
if (!customElements.get(tagName)) {
|
|
217
|
-
customElements.define(tagName, EzTextInput);
|
|
218
|
-
}
|
|
219
|
-
break;
|
|
220
|
-
} });
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
export { EzTextInput as E, defineCustomElement as d };
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { MaskFormatter, TimeFormatter, NumberUtils } from '@sankhyalabs/core';
|
|
3
|
-
import { C as CSSVarsUtils } from './CSSVarsUtils.js';
|
|
4
|
-
import { g as getSpritePath } from './AssetsUtils.js';
|
|
5
|
-
import { d as defineCustomElement$3 } from './ez-icon2.js';
|
|
6
|
-
import { d as defineCustomElement$2 } from './ez-text-input2.js';
|
|
7
|
-
|
|
8
|
-
const ezTimeInputCss = ":host{display:flex;flex-wrap:wrap;position:relative;width:100%}";
|
|
9
|
-
|
|
10
|
-
const EzTimeInput$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
11
|
-
constructor() {
|
|
12
|
-
super();
|
|
13
|
-
this.__registerHost();
|
|
14
|
-
this.__attachShadow();
|
|
15
|
-
/**
|
|
16
|
-
* Deixa o campo disponível ou não para digitação.
|
|
17
|
-
*/
|
|
18
|
-
this.enabled = true;
|
|
19
|
-
/**
|
|
20
|
-
* Define se o componente irá ou não considerar os segundos
|
|
21
|
-
*/
|
|
22
|
-
this.showSeconds = false;
|
|
23
|
-
}
|
|
24
|
-
prepareMask() {
|
|
25
|
-
if (this.showSeconds) {
|
|
26
|
-
if (this._maskFormatter == undefined) {
|
|
27
|
-
this._maskFormatter = new MaskFormatter("##:##:##");
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
this._maskFormatter.mask = "##:##:##";
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
if (this._maskFormatter == undefined) {
|
|
35
|
-
this._maskFormatter = new MaskFormatter("##:##");
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
this._maskFormatter.mask = "##:##";
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
onValueChanged() {
|
|
43
|
-
if (this.value === NaN) {
|
|
44
|
-
this.value = undefined;
|
|
45
|
-
this.handleFocusout();
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
//---------------------------------------------
|
|
49
|
-
// Public methods
|
|
50
|
-
//---------------------------------------------
|
|
51
|
-
/**
|
|
52
|
-
* Faz o foco no componente de input
|
|
53
|
-
*/
|
|
54
|
-
async setFocus() {
|
|
55
|
-
this._inputElem.focus();
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Remove o foco no componente de input
|
|
59
|
-
*/
|
|
60
|
-
async setBlur() {
|
|
61
|
-
this._inputElem.blur();
|
|
62
|
-
}
|
|
63
|
-
//---------------------------------------------
|
|
64
|
-
// Event handlers
|
|
65
|
-
//---------------------------------------------
|
|
66
|
-
handleFocusout() {
|
|
67
|
-
this.errorMessage = "";
|
|
68
|
-
this.prepareValue(this.viewValue);
|
|
69
|
-
if (!TimeFormatter.validateTime(this.viewValue, this.showSeconds)) {
|
|
70
|
-
this.clearField();
|
|
71
|
-
this.errorMessage = "Favor inserir um horário válido.";
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
prepareValue(value) {
|
|
75
|
-
try {
|
|
76
|
-
this.viewValue = TimeFormatter.prepareValue(value, this.showSeconds);
|
|
77
|
-
}
|
|
78
|
-
catch (e) {
|
|
79
|
-
this.clearField();
|
|
80
|
-
this.errorMessage = e.message;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
clearField() {
|
|
84
|
-
this.viewValue = this.value = undefined;
|
|
85
|
-
}
|
|
86
|
-
handleChange() {
|
|
87
|
-
this.viewValue = this._inputElem.value;
|
|
88
|
-
this.value = NumberUtils.stringToNumber(this.viewValue.replace(/\D/g, ""));
|
|
89
|
-
}
|
|
90
|
-
//---------------------------------------------
|
|
91
|
-
// Lifecycle web component
|
|
92
|
-
//---------------------------------------------
|
|
93
|
-
componentDidLoad() {
|
|
94
|
-
this.onValueChanged();
|
|
95
|
-
CSSVarsUtils.applyVarsTextInput(this._elem, this._inputElem);
|
|
96
|
-
}
|
|
97
|
-
componentWillLoad() {
|
|
98
|
-
this.prepareMask();
|
|
99
|
-
if (this.value) {
|
|
100
|
-
this.prepareValue(this.value.toString());
|
|
101
|
-
}
|
|
102
|
-
else if (this.viewValue) {
|
|
103
|
-
this.prepareValue(this.viewValue);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
render() {
|
|
107
|
-
return (h(Host, null, h("ez-text-input", { ref: (el) => this._inputElem = el, value: this.viewValue, enabled: this.enabled, label: this.label, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, errorMessage: this.errorMessage }, h("ez-icon", { slot: "leftIcon", href: getSpritePath("timer-outline") }))));
|
|
108
|
-
}
|
|
109
|
-
static get assetsDirs() { return ["../assets"]; }
|
|
110
|
-
get _elem() { return this; }
|
|
111
|
-
static get watchers() { return {
|
|
112
|
-
"showSeconds": ["prepareMask"],
|
|
113
|
-
"value": ["onValueChanged"]
|
|
114
|
-
}; }
|
|
115
|
-
static get style() { return ezTimeInputCss; }
|
|
116
|
-
}, [1, "ez-time-input", {
|
|
117
|
-
"label": [513],
|
|
118
|
-
"viewValue": [1537, "view-value"],
|
|
119
|
-
"value": [1026],
|
|
120
|
-
"enabled": [516],
|
|
121
|
-
"errorMessage": [1537, "error-message"],
|
|
122
|
-
"showSeconds": [516, "show-seconds"],
|
|
123
|
-
"setFocus": [64],
|
|
124
|
-
"setBlur": [64]
|
|
125
|
-
}]);
|
|
126
|
-
function defineCustomElement$1() {
|
|
127
|
-
if (typeof customElements === "undefined") {
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
const components = ["ez-time-input", "ez-icon", "ez-text-input"];
|
|
131
|
-
components.forEach(tagName => { switch (tagName) {
|
|
132
|
-
case "ez-time-input":
|
|
133
|
-
if (!customElements.get(tagName)) {
|
|
134
|
-
customElements.define(tagName, EzTimeInput$1);
|
|
135
|
-
}
|
|
136
|
-
break;
|
|
137
|
-
case "ez-icon":
|
|
138
|
-
if (!customElements.get(tagName)) {
|
|
139
|
-
defineCustomElement$3();
|
|
140
|
-
}
|
|
141
|
-
break;
|
|
142
|
-
case "ez-text-input":
|
|
143
|
-
if (!customElements.get(tagName)) {
|
|
144
|
-
defineCustomElement$2();
|
|
145
|
-
}
|
|
146
|
-
break;
|
|
147
|
-
} });
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
const EzTimeInput = EzTimeInput$1;
|
|
151
|
-
const defineCustomElement = defineCustomElement$1;
|
|
152
|
-
|
|
153
|
-
export { EzTimeInput, defineCustomElement };
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
-
|
|
3
|
-
const ezToastCss = ":host{--ez-toast__btn__close__image:url('data:image/svg+xml;utf8,<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg%22%3E<path d=\"M 7.0060773,5.995511 11.461972,1.5397722 c 0.132856,-0.1328413 0.207547,-0.3130253 0.207547,-0.5009046 0,-0.18786999 -0.07469,-0.3680541 -0.207547,-0.5009048 -0.132857,-0.13284126 -0.31302,-0.20748126 -0.500927,-0.20748126 -0.187812,0 -0.36807,0.07464 -0.500926,0.20748126 L 6.0042244,4.9937015 1.5482921,0.5379628 C 1.4154357,0.40512154 1.2352533,0.33048154 1.0473657,0.33048154 c -0.18787813,0 -0.36807,0.07464 -0.50092647,0.20748126 -0.13285646,0.1328507 -0.20749026,0.31303481 -0.20749026,0.5009048 0,0.1878793 0.0746338,0.3680633 0.20749026,0.5009046 L 5.0023715,5.995511 0.54643923,10.452213 c -0.0676086,0.06534 -0.12151598,0.14352 -0.15859681,0.229916 -0.0370714,0.08639 -0.0565645,0.1794 -0.0573369,0.27335 -7.724e-4,0.09404 0.0171873,0.187331 0.0528423,0.274293 0.0356455,0.08705 0.0882688,0.166087 0.15479148,0.23256 0.0665321,0.06648 0.14562277,0.11897 0.2326735,0.154567 0.0870507,0.0356 0.18031463,0.05344 0.2743433,0.05259 0.094029,-8.5e-4 0.1869528,-0.02049 0.2733331,-0.0576 0.08639,-0.0372 0.1645078,-0.09121 0.2298029,-0.158817 L 6.0042244,6.9973204 10.460119,11.453078 c 0.132856,0.132851 0.313114,0.207444 0.500926,0.207444 0.187907,0 0.36807,-0.07459 0.500927,-0.207444 0.132856,-0.13285 0.207547,-0.313006 0.207547,-0.500904 0,-0.187898 -0.07469,-0.368054 -0.207547,-0.500905 z\"/></svg>');--ez-toast__container-z-index:var(--more-visible, 2);--ez-toast__container--background-color:var(--color--secondary, #383c45);--ez-toast__icon--padding-left:var(--space--small, 6px)}.toast__container{position:fixed;display:flex;bottom:100px;z-index:var(--ez-toast__container-z-index);left:100px;width:280px;box-sizing:border-box;background-color:var(--ez-toast__container--background-color);border-radius:6px;align-items:center;padding:12px;visibility:hidden}.message__container{font-family:\"Sora\", \"Algerian\";text-shadow:0 0 0 #353535, 0 0 1px transparent;color:#FFFFFF;font-size:14px;width:90%;overflow:hidden;word-break:break-all;height:auto;-webkit-box-orient:vertical;-webkit-line-clamp:4;display:-webkit-box;text-overflow:ellipsis}.message__conteiner--icon{padding-left:var(--ez-toast__icon--padding-left);width:80%}.btn-close{margin-top:3px;display:flex;justify-content:flex-end;align-self:flex-start;padding:0;outline:none;width:10%;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:'';display:flex;background-color:#FFFFFF;width:12px;height:12px;-webkit-mask-image:var(--ez-toast__btn__close__image);mask-image:var(--ez-toast__btn__close__image)}.toast__container--oppened{animation:fadein 0.5s, fadeout 0.5s 3s;visibility:visible}@-webkit-keyframes fadein{from{left:-100px;opacity:0}to{left:100px;opacity:1}}@keyframes fadein{from{left:-100px;opacity:0}to{left:100px;opacity:1}}@-webkit-keyframes fadeout{from{left:100px;opacity:1}to{bottom:0;opacity:0}}@keyframes fadeout{from{left:100px;opacity:1}to{bottom:0;opacity:0}}";
|
|
4
|
-
|
|
5
|
-
const EzToast$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
-
constructor() {
|
|
7
|
-
super();
|
|
8
|
-
this.__registerHost();
|
|
9
|
-
this.__attachShadow();
|
|
10
|
-
/**
|
|
11
|
-
* Controla o tempo de exibição do componente em milissegundos.
|
|
12
|
-
*/
|
|
13
|
-
this.fadeTime = 5000;
|
|
14
|
-
/**
|
|
15
|
-
* Adiciona ícone de check no componente.
|
|
16
|
-
*/
|
|
17
|
-
this.useIcon = false;
|
|
18
|
-
/**
|
|
19
|
-
* Controla o uso do icone de fechar o toast.
|
|
20
|
-
*/
|
|
21
|
-
this.canClose = true;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Exibe o componente na tela.
|
|
25
|
-
*/
|
|
26
|
-
async show() {
|
|
27
|
-
this.container.classList.add("toast__container--oppened");
|
|
28
|
-
this.container.style.animation = `fadein 0.5s, fadeout 0.5s ${this.fadeTime / 1000}s`;
|
|
29
|
-
setTimeout(() => {
|
|
30
|
-
this.container.classList.remove("toast__container--oppened");
|
|
31
|
-
this.container.style.animation = `none`;
|
|
32
|
-
}, this.fadeTime + 400);
|
|
33
|
-
}
|
|
34
|
-
render() {
|
|
35
|
-
return (h("div", { ref: (el) => this.container = el, class: "toast__container" }, this.useIcon &&
|
|
36
|
-
h("slot", { name: "icon" }), h("div", { class: this.useIcon ? "message__container message__conteiner--icon" : "message__container", title: this.message, innerHTML: this.message }), this.canClose &&
|
|
37
|
-
h("button", { class: "btn-close", onClick: () => { this.container.classList.remove("toast__container--oppened"); this.container.style.animation = `none`; } })));
|
|
38
|
-
}
|
|
39
|
-
static get style() { return ezToastCss; }
|
|
40
|
-
}, [1, "ez-toast", {
|
|
41
|
-
"message": [1025],
|
|
42
|
-
"fadeTime": [1026, "fade-time"],
|
|
43
|
-
"useIcon": [1028, "use-icon"],
|
|
44
|
-
"canClose": [1028, "can-close"],
|
|
45
|
-
"show": [64]
|
|
46
|
-
}]);
|
|
47
|
-
function defineCustomElement$1() {
|
|
48
|
-
if (typeof customElements === "undefined") {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const components = ["ez-toast"];
|
|
52
|
-
components.forEach(tagName => { switch (tagName) {
|
|
53
|
-
case "ez-toast":
|
|
54
|
-
if (!customElements.get(tagName)) {
|
|
55
|
-
customElements.define(tagName, EzToast$1);
|
|
56
|
-
}
|
|
57
|
-
break;
|
|
58
|
-
} });
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const EzToast = EzToast$1;
|
|
62
|
-
const defineCustomElement = defineCustomElement$1;
|
|
63
|
-
|
|
64
|
-
export { EzToast, defineCustomElement };
|