@sankhyalabs/ezui 1.2.0-beta.8 → 2.0.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/dist/cjs/{ApplicationUtils-2ac1b73e.js → ApplicationUtils-edc62c5c.js} +4 -1
- package/dist/cjs/CheckMode-ecb90b87.js +7 -0
- package/dist/cjs/{DialogType-a1e288e6.js → DialogType-aa435c52.js} +1 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +68 -17
- package/dist/cjs/ez-application.cjs.entry.js +1 -1
- package/dist/cjs/ez-button.cjs.entry.js +13 -11
- package/dist/cjs/ez-calendar.cjs.entry.js +5 -5
- package/dist/cjs/ez-card-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-check.cjs.entry.js +11 -9
- package/dist/cjs/ez-chip.cjs.entry.js +17 -7
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +85 -7
- package/dist/cjs/ez-combo-box.cjs.entry.js +51 -20
- package/dist/cjs/ez-date-input.cjs.entry.js +13 -18
- package/dist/cjs/ez-date-time-input.cjs.entry.js +12 -17
- package/dist/cjs/ez-dialog.cjs.entry.js +43 -8
- package/dist/cjs/ez-filter-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +99 -486
- package/dist/cjs/ez-grid-config.cjs.entry.js +8 -9
- package/dist/cjs/ez-grid.cjs.entry.js +1073 -1168
- package/dist/cjs/ez-icon.cjs.entry.js +3 -3
- package/dist/cjs/ez-list.cjs.entry.js +2 -4
- package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal-container.cjs.entry.js +58 -0
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +4 -4
- package/dist/cjs/ez-popover.cjs.entry.js +6 -6
- package/dist/cjs/ez-popup.cjs.entry.js +8 -4
- package/dist/cjs/ez-radio-button.cjs.entry.js +3 -3
- package/dist/cjs/ez-scroller.cjs.entry.js +2 -2
- package/dist/cjs/ez-search.cjs.entry.js +1 -1
- package/dist/cjs/ez-select-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-tabselector.cjs.entry.js +8 -7
- package/dist/cjs/ez-text-area.cjs.entry.js +7 -7
- package/dist/cjs/ez-text-edit.cjs.entry.js +103 -0
- package/dist/cjs/ez-text-input.cjs.entry.js +14 -4
- package/dist/cjs/ez-time-input.cjs.entry.js +7 -7
- package/dist/cjs/ez-toast.cjs.entry.js +2 -2
- package/dist/cjs/ez-upload.cjs.entry.js +4 -4
- package/dist/cjs/ez-view-stack.cjs.entry.js +10 -7
- package/dist/cjs/ezui.cjs.js +4 -112
- package/dist/cjs/loader.cjs.js +2 -18
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/ez-actions-button/ez-actions-button.css +49 -20
- package/dist/collection/components/ez-actions-button/ez-actions-button.js +219 -23
- package/dist/collection/components/ez-button/ez-button.css +0 -6
- package/dist/collection/components/ez-button/ez-button.js +11 -9
- package/dist/collection/components/ez-calendar/ez-calendar.css +17 -20
- package/dist/collection/components/ez-check/CheckMode.js +5 -0
- package/dist/collection/components/ez-check/ez-check.css +23 -24
- package/dist/collection/components/ez-check/ez-check.js +10 -8
- package/dist/collection/components/ez-chip/ez-chip.css +4 -2
- package/dist/collection/components/ez-chip/ez-chip.js +16 -6
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +16 -0
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +226 -7
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +1 -22
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +51 -20
- package/dist/collection/components/ez-date-input/ez-date-input.js +8 -13
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +8 -13
- package/dist/collection/components/ez-dialog/DialogType.js +1 -0
- package/dist/collection/components/ez-dialog/ez-dialog.css +19 -25
- package/dist/collection/components/ez-dialog/ez-dialog.js +41 -6
- package/dist/collection/components/ez-form/DataBinder.js +1 -0
- package/dist/collection/components/ez-form/ez-form.js +22 -13
- package/dist/collection/components/ez-form/fieldbuilder/FieldBuilder.js +3 -3
- package/dist/collection/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.js +2 -1
- package/dist/collection/components/ez-form/fieldbuilder/tpl/DateInput.tpl.js +4 -4
- package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +25 -15
- package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +3 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +51 -15
- package/dist/collection/components/ez-grid/controller/ag-grid/components/cellRenderer.js +31 -0
- package/dist/collection/components/ez-grid/ez-grid.js +40 -3
- package/dist/collection/components/ez-grid/subcomponents/ez-grid-config/ez-grid-config.css +38 -27
- package/dist/collection/components/ez-grid/subcomponents/ez-grid-config/ez-grid-config.js +1 -2
- package/dist/collection/components/ez-grid/subcomponents/ez-select-box/ez-select-box.js +5 -4
- package/dist/collection/components/ez-list/ez-list.css +12 -4
- package/dist/collection/components/ez-modal-container/ez-modal-container.css +38 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +190 -0
- package/dist/collection/components/ez-modal-container/index.js +2 -0
- package/dist/collection/components/ez-modal-container/modal-action.js +8 -0
- package/dist/collection/components/ez-modal-container/modal-button-status.js +7 -0
- package/dist/collection/components/ez-popover/ez-popover.css +1 -1
- package/dist/collection/components/ez-popup/ez-popup.css +6 -1
- package/dist/collection/components/ez-popup/ez-popup.js +26 -4
- package/dist/collection/components/ez-radio-button/ez-radio-button.css +16 -5
- package/dist/collection/components/ez-radio-button/ez-radio-button.js +1 -1
- package/dist/collection/components/ez-scroller/ez-scroller.css +3 -2
- package/dist/collection/components/ez-search/ez-search.js +6 -6
- package/dist/collection/components/ez-tabselector/ez-tabselector.css +10 -1
- package/dist/collection/components/ez-tabselector/ez-tabselector.js +7 -3
- package/dist/collection/components/ez-text-area/ez-text-area.css +6 -3
- package/dist/collection/components/ez-text-area/ez-text-area.js +5 -5
- package/dist/collection/components/ez-text-edit/ez-text-edit.css +19 -0
- package/dist/collection/components/ez-text-edit/ez-text-edit.js +188 -0
- package/dist/collection/components/ez-text-input/ez-text-input.css +18 -2
- package/dist/collection/components/ez-text-input/ez-text-input.js +28 -0
- package/dist/collection/components/ez-toast/ez-toast.css +1 -1
- package/dist/collection/components/ez-upload/ez-upload.css +1 -1
- package/dist/collection/components/ez-view-stack/ez-view-stack.js +12 -6
- package/dist/collection/utils/ApplicationUtils.js +3 -0
- package/dist/collection/utils/index.js +1 -0
- package/dist/custom-elements/index.d.ts +12 -0
- package/dist/custom-elements/index.js +1595 -4005
- package/dist/{ezui/ApplicationUtils-30a69eb0.js → esm/ApplicationUtils-205ac4bc.js} +4 -2
- package/dist/esm/CheckMode-bdb2ec19.js +7 -0
- package/dist/esm/{DialogType-72afa679.js → DialogType-4059dc4d.js} +1 -0
- package/dist/esm/ez-actions-button.entry.js +68 -17
- package/dist/esm/ez-application.entry.js +1 -1
- package/dist/esm/ez-button.entry.js +13 -11
- package/dist/esm/ez-calendar.entry.js +3 -3
- package/dist/esm/ez-card-item.entry.js +1 -1
- package/dist/esm/ez-check.entry.js +11 -9
- package/dist/esm/ez-chip.entry.js +17 -7
- package/dist/esm/ez-collapsible-box.entry.js +85 -7
- package/dist/esm/ez-combo-box.entry.js +48 -17
- package/dist/esm/ez-date-input.entry.js +10 -15
- package/dist/esm/ez-date-time-input.entry.js +10 -15
- package/dist/esm/ez-dialog.entry.js +43 -8
- package/dist/esm/ez-filter-input.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +65 -452
- package/dist/esm/ez-grid-config.entry.js +6 -7
- package/dist/esm/ez-grid.entry.js +1039 -1134
- package/dist/esm/ez-icon.entry.js +2 -2
- package/dist/esm/ez-list.entry.js +2 -4
- package/dist/esm/ez-loading-bar.entry.js +1 -1
- package/dist/esm/ez-modal-container.entry.js +54 -0
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +2 -2
- package/dist/esm/ez-popover.entry.js +3 -3
- package/dist/esm/ez-popup.entry.js +8 -4
- package/dist/esm/ez-radio-button.entry.js +3 -3
- package/dist/esm/ez-scroller.entry.js +2 -2
- package/dist/esm/ez-search.entry.js +1 -1
- package/dist/esm/ez-select-box.entry.js +1 -1
- package/dist/esm/ez-tabselector.entry.js +8 -7
- package/dist/esm/ez-text-area.entry.js +7 -7
- package/dist/esm/ez-text-edit.entry.js +99 -0
- package/dist/esm/ez-text-input.entry.js +13 -3
- package/dist/esm/ez-time-input.entry.js +2 -2
- package/dist/esm/ez-toast.entry.js +2 -2
- package/dist/esm/ez-upload.entry.js +4 -4
- package/dist/esm/ez-view-stack.entry.js +10 -7
- package/dist/esm/ezui.js +4 -112
- package/dist/esm/loader.js +2 -18
- package/dist/ezui/ezui.esm.js +1 -125
- package/dist/ezui/index.esm.js +0 -1
- package/dist/ezui/p-04a41a44.entry.js +1 -0
- package/dist/ezui/p-0b44cf1c.js +1 -0
- package/dist/ezui/p-0c7203d5.entry.js +1 -0
- package/dist/ezui/p-2213da1f.entry.js +1 -0
- package/dist/ezui/p-2c6398b3.entry.js +1 -0
- package/dist/ezui/p-2ccad880.entry.js +1 -0
- package/dist/ezui/p-333d79c4.entry.js +1 -0
- package/dist/ezui/p-3987f8d8.entry.js +1 -0
- package/dist/ezui/{p-81eb2738.entry.js → p-42c6493e.entry.js} +1 -1
- package/dist/ezui/{p-b4ad3b15.entry.js → p-482c3dd8.entry.js} +1 -1
- package/dist/ezui/p-5bdb1a41.entry.js +1 -0
- package/dist/ezui/{p-b2cf7db2.entry.js → p-63d567cc.entry.js} +1 -1
- package/dist/ezui/p-659616e4.entry.js +1 -0
- package/dist/ezui/p-6608b9a5.entry.js +1 -0
- package/dist/ezui/p-77ec47ac.entry.js +1 -0
- package/dist/ezui/p-9b9ebf95.entry.js +1 -0
- package/dist/ezui/{p-88bfdea4.entry.js → p-ae5af8f9.entry.js} +1 -1
- package/dist/ezui/p-b853763b.js +1 -0
- package/dist/ezui/p-be06251d.entry.js +1 -0
- package/dist/ezui/{p-e7d03a0d.entry.js → p-bffae598.entry.js} +1 -1
- package/dist/ezui/p-cd4677d4.entry.js +1 -0
- package/dist/ezui/p-cfcc23e6.entry.js +1 -0
- package/dist/ezui/p-dfcf55e0.entry.js +1 -0
- package/dist/ezui/p-e1148f5c.js +1 -0
- package/dist/ezui/p-e1f2b5da.entry.js +1 -0
- package/dist/ezui/p-e230bfd2.entry.js +1 -0
- package/dist/ezui/{p-867aac16.entry.js → p-e3ee814c.entry.js} +1 -1
- package/dist/ezui/p-e697ffd5.entry.js +1 -0
- package/dist/ezui/{p-4eb273f8.entry.js → p-efa32bcc.entry.js} +1 -1
- package/dist/types/components/ez-actions-button/ez-actions-button.d.ts +42 -9
- package/dist/types/components/ez-check/CheckMode.d.ts +4 -0
- package/dist/types/components/ez-chip/ez-chip.d.ts +2 -1
- package/dist/types/components/ez-collapsible-box/ez-collapsible-box.d.ts +46 -1
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +15 -5
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +0 -1
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +0 -1
- package/dist/types/components/ez-dialog/DialogType.d.ts +1 -0
- package/dist/types/components/ez-dialog/ez-dialog.d.ts +3 -0
- package/dist/types/components/ez-form/DataBinder.d.ts +2 -2
- package/dist/types/components/ez-form/ez-form.d.ts +21 -11
- package/dist/types/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.d.ts +3 -3
- package/dist/types/components/ez-form/fieldbuilder/tpl/DateInput.tpl.d.ts +4 -2
- package/dist/types/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.d.ts +2 -5
- package/dist/types/components/ez-form/structure/FormSheetMetadata.d.ts +3 -3
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +4 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/cellRenderer.d.ts +9 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +8 -3
- package/dist/types/components/ez-grid/subcomponents/ez-select-box/ez-select-box.d.ts +2 -6
- package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +47 -0
- package/dist/types/components/ez-modal-container/index.d.ts +2 -0
- package/dist/types/components/ez-modal-container/modal-action.d.ts +7 -0
- package/dist/types/components/ez-modal-container/modal-button-status.d.ts +6 -0
- package/dist/types/components/ez-popup/ez-popup.d.ts +4 -0
- package/dist/types/components/ez-search/ez-search.d.ts +3 -3
- package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +2 -0
- package/dist/types/components/ez-text-edit/ez-text-edit.d.ts +39 -0
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +5 -0
- package/dist/types/components/ez-view-stack/ez-view-stack.d.ts +5 -1
- package/dist/types/components.d.ts +274 -28
- package/dist/types/utils/ApplicationUtils.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +5 -5
- package/react/components.d.ts +2 -0
- package/react/components.js +2 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/ApplicationUtils-475b50d9.js +0 -63
- package/dist/cjs/app-globals-3a1e7e63.js +0 -5
- package/dist/cjs/css-shim-3bfdba4f.js +0 -6
- package/dist/cjs/dom-8ac1ad03.js +0 -75
- package/dist/cjs/index-2ec1da82.js +0 -2307
- package/dist/cjs/index-55178184.js +0 -6
- package/dist/cjs/index-d9c5cb88.js +0 -3068
- package/dist/cjs/shadow-css-41d9783d.js +0 -390
- package/dist/esm/ApplicationUtils-30a69eb0.js +0 -61
- package/dist/esm/ApplicationUtils-a4a76132.js +0 -60
- package/dist/esm/app-globals-0f993ce5.js +0 -3
- package/dist/esm/css-shim-20dbffa5.js +0 -4
- package/dist/esm/dom-c5ed0ba5.js +0 -73
- package/dist/esm/index-1e9d524f.js +0 -3031
- package/dist/esm/index-b96183c8.js +0 -2295
- package/dist/esm/index-f32470b5.js +0 -3
- package/dist/esm/shadow-css-8c625855.js +0 -388
- package/dist/ezui/CSSVarsUtils-00f67f32.js +0 -70
- package/dist/ezui/DialogType-72afa679.js +0 -8
- package/dist/ezui/app-globals-0f993ce5.js +0 -3
- package/dist/ezui/css-shim-20dbffa5.js +0 -4
- package/dist/ezui/dom-c5ed0ba5.js +0 -73
- package/dist/ezui/ez-actions-button.entry.js +0 -98
- package/dist/ezui/ez-application.entry.js +0 -22
- package/dist/ezui/ez-button.entry.js +0 -73
- package/dist/ezui/ez-calendar.entry.js +0 -219
- package/dist/ezui/ez-card-item.entry.js +0 -40
- package/dist/ezui/ez-check.entry.js +0 -72
- package/dist/ezui/ez-chip.entry.js +0 -97
- package/dist/ezui/ez-collapsible-box.entry.js +0 -57
- package/dist/ezui/ez-combo-box.entry.js +0 -439
- package/dist/ezui/ez-date-input.entry.js +0 -159
- package/dist/ezui/ez-date-time-input.entry.js +0 -214
- package/dist/ezui/ez-dialog.entry.js +0 -108
- package/dist/ezui/ez-filter-input.entry.js +0 -75
- package/dist/ezui/ez-form.entry.js +0 -1395
- package/dist/ezui/ez-grid-config.entry.js +0 -433
- package/dist/ezui/ez-grid.entry.js +0 -115419
- package/dist/ezui/ez-icon.entry.js +0 -37
- package/dist/ezui/ez-list.entry.js +0 -516
- package/dist/ezui/ez-loading-bar.entry.js +0 -24
- package/dist/ezui/ez-modal.entry.js +0 -67
- package/dist/ezui/ez-number-input.entry.js +0 -148
- package/dist/ezui/ez-popover.entry.js +0 -141
- package/dist/ezui/ez-popup.entry.js +0 -49
- package/dist/ezui/ez-radio-button.entry.js +0 -45
- package/dist/ezui/ez-scroller.entry.js +0 -101
- package/dist/ezui/ez-search.entry.js +0 -83
- package/dist/ezui/ez-select-box.entry.js +0 -18
- package/dist/ezui/ez-tabselector.entry.js +0 -195
- package/dist/ezui/ez-text-area.entry.js +0 -158
- package/dist/ezui/ez-text-input.entry.js +0 -235
- package/dist/ezui/ez-time-input.entry.js +0 -164
- package/dist/ezui/ez-toast.entry.js +0 -84
- package/dist/ezui/ez-upload.entry.js +0 -379
- package/dist/ezui/ez-view-stack.entry.js +0 -74
- package/dist/ezui/index-1e9d524f.js +0 -3031
- package/dist/ezui/index-b96183c8.js +0 -2295
- package/dist/ezui/index-f32470b5.js +0 -3
- package/dist/ezui/p-2f02347d.entry.js +0 -1
- package/dist/ezui/p-416bedbe.entry.js +0 -1
- package/dist/ezui/p-544f0c63.entry.js +0 -1
- package/dist/ezui/p-62110996.entry.js +0 -1
- package/dist/ezui/p-719e9ef9.entry.js +0 -1
- package/dist/ezui/p-787fbdfe.js +0 -1
- package/dist/ezui/p-9d5be6a7.entry.js +0 -1
- package/dist/ezui/p-a27dafa4.entry.js +0 -1
- package/dist/ezui/p-aba3fa6c.entry.js +0 -1
- package/dist/ezui/p-adbe4188.js +0 -1
- package/dist/ezui/p-af43be42.entry.js +0 -1
- package/dist/ezui/p-b7467ad6.entry.js +0 -1
- package/dist/ezui/p-c019e137.entry.js +0 -1
- package/dist/ezui/p-c9d2060e.entry.js +0 -1
- package/dist/ezui/p-cccd8cde.entry.js +0 -1
- package/dist/ezui/p-d0671e14.entry.js +0 -1
- package/dist/ezui/p-e0f06d73.entry.js +0 -1
- package/dist/ezui/p-e59adce6.entry.js +0 -1
- package/dist/ezui/p-ed835b36.entry.js +0 -1
- package/dist/ezui/shadow-css-8c625855.js +0 -388
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { Component, Host, h, Prop, Event, State, Method } from '@stencil/core';
|
|
2
|
+
import { StringUtils } from '@sankhyalabs/core';
|
|
3
|
+
import { ApplicationUtils } from "../../utils";
|
|
4
|
+
export class EzTextEdit {
|
|
5
|
+
/**
|
|
6
|
+
* Aplica focus no campo.
|
|
7
|
+
*/
|
|
8
|
+
async applyFocusSelect() {
|
|
9
|
+
this.calcSizeInput(this.value, true);
|
|
10
|
+
}
|
|
11
|
+
calcSizeInput(value, setSelect = false) {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
const textInput = (_b = (_a = this._inputElement) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('input');
|
|
14
|
+
if (textInput != undefined) {
|
|
15
|
+
const sizeText = this.getWidthValue(value);
|
|
16
|
+
textInput.style.width = sizeText + 'px';
|
|
17
|
+
if (setSelect) {
|
|
18
|
+
setTimeout(() => textInput.select(), 100);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
getWidthValue(value) {
|
|
23
|
+
if (this._valueBasis != undefined) {
|
|
24
|
+
const span = this._valueBasis;
|
|
25
|
+
if (value != undefined) {
|
|
26
|
+
const cursorSpace = 2;
|
|
27
|
+
span.innerHTML = value;
|
|
28
|
+
return span.clientWidth > 0 ? (span.clientWidth + cursorSpace) : cursorSpace;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
span.innerHTML = "";
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return 0;
|
|
35
|
+
}
|
|
36
|
+
setStyledInput() {
|
|
37
|
+
var _a, _b;
|
|
38
|
+
let fontSize = "";
|
|
39
|
+
let fontWeight = "";
|
|
40
|
+
let fontFamily = "";
|
|
41
|
+
if (this.styled != undefined) {
|
|
42
|
+
fontSize = this.styled.fontSize;
|
|
43
|
+
fontWeight = this.styled.fontWeight;
|
|
44
|
+
fontFamily = this.styled.fontFamily;
|
|
45
|
+
}
|
|
46
|
+
const textInput = (_b = (_a = this._inputElement) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('input');
|
|
47
|
+
if (textInput != undefined) {
|
|
48
|
+
textInput.style.fontSize = fontSize;
|
|
49
|
+
textInput.style.fontWeight = fontWeight;
|
|
50
|
+
textInput.style.fontFamily = fontFamily;
|
|
51
|
+
}
|
|
52
|
+
const span = this._valueBasis;
|
|
53
|
+
if (span != undefined) {
|
|
54
|
+
span.style.fontSize = fontSize;
|
|
55
|
+
span.style.fontWeight = fontWeight;
|
|
56
|
+
span.style.fontFamily = fontFamily;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
handleSaveEdition() {
|
|
60
|
+
if (this._newValue !== this.value && !StringUtils.isEmpty(this._newValue)) {
|
|
61
|
+
this.saveEdition.emit({ value: this.value, newValue: this._newValue });
|
|
62
|
+
}
|
|
63
|
+
else if (!this._newValue) {
|
|
64
|
+
ApplicationUtils.alert("Aviso", "Não é possível salvar um campo em branco.").then(() => {
|
|
65
|
+
this.setNewValue(this.value, true);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
this.cancelEdition.emit();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
setNewValue(value, setSelect = false) {
|
|
73
|
+
this._newValue = value;
|
|
74
|
+
this.calcSizeInput(this._newValue, setSelect);
|
|
75
|
+
}
|
|
76
|
+
componentDidLoad() {
|
|
77
|
+
this.applyFocusSelect();
|
|
78
|
+
this.setNewValue(this.value);
|
|
79
|
+
}
|
|
80
|
+
componentDidRender() {
|
|
81
|
+
this.setStyledInput();
|
|
82
|
+
}
|
|
83
|
+
render() {
|
|
84
|
+
return (h(Host, null,
|
|
85
|
+
h("span", { class: "text-edit__hidden-value", ref: elem => this._valueBasis = elem }),
|
|
86
|
+
h("ez-text-input", { onInput: () => { this.calcSizeInput(this._newValue); }, class: "text-edit__form-input", value: this._newValue, ref: (elem) => this._inputElement = elem, mode: "slim", onEzChange: (evt) => this.setNewValue(evt === null || evt === void 0 ? void 0 : evt.detail), noBorder: true }),
|
|
87
|
+
h("ez-button", { class: "text-edit__icon-check", mode: "icon", iconName: "check", size: "small", onClick: () => { this.handleSaveEdition(); } }),
|
|
88
|
+
h("ez-button", { class: "text-edit__icon-close", mode: "icon", iconName: "close", size: "small", onClick: () => { this.cancelEdition.emit(); } })));
|
|
89
|
+
}
|
|
90
|
+
static get is() { return "ez-text-edit"; }
|
|
91
|
+
static get encapsulation() { return "shadow"; }
|
|
92
|
+
static get originalStyleUrls() { return {
|
|
93
|
+
"$": ["ez-text-edit.css"]
|
|
94
|
+
}; }
|
|
95
|
+
static get styleUrls() { return {
|
|
96
|
+
"$": ["ez-text-edit.css"]
|
|
97
|
+
}; }
|
|
98
|
+
static get properties() { return {
|
|
99
|
+
"value": {
|
|
100
|
+
"type": "string",
|
|
101
|
+
"mutable": false,
|
|
102
|
+
"complexType": {
|
|
103
|
+
"original": "string",
|
|
104
|
+
"resolved": "string",
|
|
105
|
+
"references": {}
|
|
106
|
+
},
|
|
107
|
+
"required": false,
|
|
108
|
+
"optional": false,
|
|
109
|
+
"docs": {
|
|
110
|
+
"tags": [],
|
|
111
|
+
"text": "Valor manipulado pelo componente atrav\u00E9s do input"
|
|
112
|
+
},
|
|
113
|
+
"attribute": "value",
|
|
114
|
+
"reflect": false
|
|
115
|
+
},
|
|
116
|
+
"styled": {
|
|
117
|
+
"type": "unknown",
|
|
118
|
+
"mutable": false,
|
|
119
|
+
"complexType": {
|
|
120
|
+
"original": "IStyled",
|
|
121
|
+
"resolved": "IStyled",
|
|
122
|
+
"references": {
|
|
123
|
+
"IStyled": {
|
|
124
|
+
"location": "local"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"required": false,
|
|
129
|
+
"optional": false,
|
|
130
|
+
"docs": {
|
|
131
|
+
"tags": [],
|
|
132
|
+
"text": "Define atributos do estilo"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}; }
|
|
136
|
+
static get states() { return {
|
|
137
|
+
"_newValue": {}
|
|
138
|
+
}; }
|
|
139
|
+
static get events() { return [{
|
|
140
|
+
"method": "saveEdition",
|
|
141
|
+
"name": "saveEdition",
|
|
142
|
+
"bubbles": true,
|
|
143
|
+
"cancelable": true,
|
|
144
|
+
"composed": true,
|
|
145
|
+
"docs": {
|
|
146
|
+
"tags": [],
|
|
147
|
+
"text": "Evento emitido ao salvar uma edi\u00E7\u00E3o"
|
|
148
|
+
},
|
|
149
|
+
"complexType": {
|
|
150
|
+
"original": "any",
|
|
151
|
+
"resolved": "any",
|
|
152
|
+
"references": {}
|
|
153
|
+
}
|
|
154
|
+
}, {
|
|
155
|
+
"method": "cancelEdition",
|
|
156
|
+
"name": "cancelEdition",
|
|
157
|
+
"bubbles": true,
|
|
158
|
+
"cancelable": true,
|
|
159
|
+
"composed": true,
|
|
160
|
+
"docs": {
|
|
161
|
+
"tags": [],
|
|
162
|
+
"text": "Disparado ao cancelar uma edi\u00E7\u00E3o"
|
|
163
|
+
},
|
|
164
|
+
"complexType": {
|
|
165
|
+
"original": "any",
|
|
166
|
+
"resolved": "any",
|
|
167
|
+
"references": {}
|
|
168
|
+
}
|
|
169
|
+
}]; }
|
|
170
|
+
static get methods() { return {
|
|
171
|
+
"applyFocusSelect": {
|
|
172
|
+
"complexType": {
|
|
173
|
+
"signature": "() => Promise<void>",
|
|
174
|
+
"parameters": [],
|
|
175
|
+
"references": {
|
|
176
|
+
"Promise": {
|
|
177
|
+
"location": "global"
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
"return": "Promise<void>"
|
|
181
|
+
},
|
|
182
|
+
"docs": {
|
|
183
|
+
"text": "Aplica focus no campo.",
|
|
184
|
+
"tags": []
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}; }
|
|
188
|
+
}
|
|
@@ -37,6 +37,10 @@
|
|
|
37
37
|
--ez-text-input__input--disabled--color: var(--text--disable, #AFB6C0);
|
|
38
38
|
/*@doc Define a cor da borda do input quando com erro.*/
|
|
39
39
|
--ez-text-input__input--error--border-color: #CC2936;
|
|
40
|
+
/*@doc Define a cor do input quando não possuir borda*/
|
|
41
|
+
--ez-text-input__input--noborder-color: white;
|
|
42
|
+
/*@doc Define o padding do input*/
|
|
43
|
+
--ez-text-input__input--padding: var(--space--medium, 6px);
|
|
40
44
|
|
|
41
45
|
/* message box */
|
|
42
46
|
/*@doc Define o tamanho da fonte da mensagem abaixo do input.*/
|
|
@@ -72,7 +76,6 @@ input {
|
|
|
72
76
|
/*private*/
|
|
73
77
|
width: 100%;
|
|
74
78
|
box-sizing: border-box;
|
|
75
|
-
padding: var(--space--medium, 6px);
|
|
76
79
|
|
|
77
80
|
/*public*/
|
|
78
81
|
height: var(--ez-text-input--height);
|
|
@@ -84,6 +87,7 @@ input {
|
|
|
84
87
|
background-color: var(--ez-text-input__input--background-color);
|
|
85
88
|
color: var(--ez-text-input--color);
|
|
86
89
|
font-weight: var(--ez-text-input--font-weight);
|
|
90
|
+
padding: var(--ez-text-input__input--padding);
|
|
87
91
|
}
|
|
88
92
|
|
|
89
93
|
input:disabled {
|
|
@@ -103,7 +107,7 @@ input.icon--left {
|
|
|
103
107
|
padding-left: var(--ez-text-input__icon--width);
|
|
104
108
|
}
|
|
105
109
|
|
|
106
|
-
input.icon--right {
|
|
110
|
+
input.icon--right {
|
|
107
111
|
padding-right: var(--ez-text-input__icon--width);
|
|
108
112
|
}
|
|
109
113
|
|
|
@@ -212,6 +216,11 @@ input:read-only {
|
|
|
212
216
|
height: var(--ez-text-input--height--slim);
|
|
213
217
|
}
|
|
214
218
|
|
|
219
|
+
.input__slim--title{
|
|
220
|
+
font-size: 16px;
|
|
221
|
+
font-weight: bold;
|
|
222
|
+
}
|
|
223
|
+
|
|
215
224
|
.input--slim::-webkit-input-placeholder { /* Edge */
|
|
216
225
|
/*public*/
|
|
217
226
|
font-family: var(--ez-text-input--font-family);
|
|
@@ -275,4 +284,11 @@ input:read-only {
|
|
|
275
284
|
.input--slim:disabled::placeholder {
|
|
276
285
|
/*public*/
|
|
277
286
|
color: var(--ez-text-input__input--disabled--color);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
input.input__slim--noborder {
|
|
290
|
+
box-shadow: 0 0 0 0;
|
|
291
|
+
border: 0 none;
|
|
292
|
+
outline: 0;
|
|
293
|
+
background: var(--ez-text-input__input--noborder-color);
|
|
278
294
|
}
|
|
@@ -14,6 +14,10 @@ export class EzTextInput {
|
|
|
14
14
|
* Define o modo do tamanho do campo; opções: slim e regular.
|
|
15
15
|
*/
|
|
16
16
|
this.mode = "regular";
|
|
17
|
+
/**
|
|
18
|
+
* Define se o campo contará com bordas ou não
|
|
19
|
+
*/
|
|
20
|
+
this.noBorder = false;
|
|
17
21
|
}
|
|
18
22
|
observeErrorMessage() {
|
|
19
23
|
if (this._inputElem) {
|
|
@@ -87,6 +91,11 @@ export class EzTextInput {
|
|
|
87
91
|
this._contentLeftSlot.style.color = color;
|
|
88
92
|
}
|
|
89
93
|
}
|
|
94
|
+
adjustBorderInput() {
|
|
95
|
+
if (this.noBorder) {
|
|
96
|
+
this._inputElem.classList.add("input__slim--noborder");
|
|
97
|
+
}
|
|
98
|
+
}
|
|
90
99
|
//---------------------------------------------
|
|
91
100
|
// Public methods
|
|
92
101
|
//---------------------------------------------
|
|
@@ -194,6 +203,7 @@ export class EzTextInput {
|
|
|
194
203
|
this.observeErrorMessage();
|
|
195
204
|
this.observeMask();
|
|
196
205
|
this.adjustFloatingLabel();
|
|
206
|
+
this.adjustBorderInput();
|
|
197
207
|
}
|
|
198
208
|
componentWillLoad() {
|
|
199
209
|
this.observeMask();
|
|
@@ -387,6 +397,24 @@ export class EzTextInput {
|
|
|
387
397
|
"attribute": "mode",
|
|
388
398
|
"reflect": true,
|
|
389
399
|
"defaultValue": "\"regular\""
|
|
400
|
+
},
|
|
401
|
+
"noBorder": {
|
|
402
|
+
"type": "boolean",
|
|
403
|
+
"mutable": false,
|
|
404
|
+
"complexType": {
|
|
405
|
+
"original": "boolean",
|
|
406
|
+
"resolved": "boolean",
|
|
407
|
+
"references": {}
|
|
408
|
+
},
|
|
409
|
+
"required": false,
|
|
410
|
+
"optional": false,
|
|
411
|
+
"docs": {
|
|
412
|
+
"tags": [],
|
|
413
|
+
"text": "Define se o campo contar\u00E1 com bordas ou n\u00E3o"
|
|
414
|
+
},
|
|
415
|
+
"attribute": "no-border",
|
|
416
|
+
"reflect": true,
|
|
417
|
+
"defaultValue": "false"
|
|
390
418
|
}
|
|
391
419
|
}; }
|
|
392
420
|
static get events() { return [{
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { Component, h, Host, Element, Method } from '@stencil/core';
|
|
2
2
|
export class EzViewStack {
|
|
3
|
+
constructor() {
|
|
4
|
+
/**
|
|
5
|
+
* Indetificador único do componente
|
|
6
|
+
*/
|
|
7
|
+
this._dataKey = 'id_'.concat(Date.now().toString());
|
|
8
|
+
}
|
|
3
9
|
/**
|
|
4
10
|
* Exibe a aba desejada de acordo com o index passado na tela fazendo com a ativa atual seja removida ou oculta dependendo da hidePolicy.
|
|
5
11
|
*/
|
|
@@ -11,17 +17,17 @@ export class EzViewStack {
|
|
|
11
17
|
}
|
|
12
18
|
}
|
|
13
19
|
/**
|
|
14
|
-
* Retorna o index que
|
|
20
|
+
* Retorna o index que está atualmente ativo e sendo exibido.
|
|
15
21
|
*/
|
|
16
22
|
async getSelectedIndex() {
|
|
17
23
|
return this._focusedIndex;
|
|
18
24
|
}
|
|
19
25
|
policyHideRemove() {
|
|
20
|
-
let element = this._hostElem.querySelector(
|
|
26
|
+
let element = this._hostElem.querySelector(`#${this._dataKey}_el_${this._focusedIndex}`);
|
|
21
27
|
this.checkElementVisibility(element);
|
|
22
28
|
}
|
|
23
29
|
policyShowAppend(index) {
|
|
24
|
-
let selectedElement = this._hostElem.querySelector(
|
|
30
|
+
let selectedElement = this._hostElem.querySelector(`#${this._dataKey}_el_${index}`);
|
|
25
31
|
if (selectedElement) {
|
|
26
32
|
selectedElement.removeAttribute("style");
|
|
27
33
|
}
|
|
@@ -44,8 +50,8 @@ export class EzViewStack {
|
|
|
44
50
|
this._focusedIndex = 0;
|
|
45
51
|
this._totalStackItems = 0;
|
|
46
52
|
this._hostElem.classList.add("ez-view-stack__container");
|
|
47
|
-
this._hostElem.querySelectorAll("stack-item").forEach((element, index) => {
|
|
48
|
-
element.setAttribute("id",
|
|
53
|
+
this._hostElem.querySelectorAll(":scope > stack-item").forEach((element, index) => {
|
|
54
|
+
element.setAttribute("id", `${this._dataKey}_el_${index}`);
|
|
49
55
|
if (index !== 0) {
|
|
50
56
|
this.checkElementVisibility(element);
|
|
51
57
|
}
|
|
@@ -100,7 +106,7 @@ export class EzViewStack {
|
|
|
100
106
|
"return": "Promise<number>"
|
|
101
107
|
},
|
|
102
108
|
"docs": {
|
|
103
|
-
"text": "Retorna o index que est\
|
|
109
|
+
"text": "Retorna o index que est\u00E1 atualmente ativo e sendo exibido.",
|
|
104
110
|
"tags": []
|
|
105
111
|
}
|
|
106
112
|
}
|
|
@@ -19,6 +19,9 @@ export default class ApplicationUtils {
|
|
|
19
19
|
static async error(title, message, icon = null, options = ApplicationUtils.defaultMessageOptions) {
|
|
20
20
|
return ApplicationUtils.showDialog(title, message, icon, false, DialogType.CRITICAL, options);
|
|
21
21
|
}
|
|
22
|
+
static async success(title, message, icon = null, options = ApplicationUtils.defaultMessageOptions) {
|
|
23
|
+
return ApplicationUtils.showDialog(title, message, icon, false, DialogType.SUCCESS, options);
|
|
24
|
+
}
|
|
22
25
|
static async confirm(title, message, icon = null, dialogType = DialogType.WARN, options = ApplicationUtils.defaultMessageOptions) {
|
|
23
26
|
return ApplicationUtils.showDialog(title, message, icon, true, dialogType, options);
|
|
24
27
|
}
|
|
@@ -122,6 +122,12 @@ export const EzModal: {
|
|
|
122
122
|
new (): EzModal;
|
|
123
123
|
};
|
|
124
124
|
|
|
125
|
+
interface EzModalContainer extends Components.EzModalContainer, HTMLElement {}
|
|
126
|
+
export const EzModalContainer: {
|
|
127
|
+
prototype: EzModalContainer;
|
|
128
|
+
new (): EzModalContainer;
|
|
129
|
+
};
|
|
130
|
+
|
|
125
131
|
interface EzNumberInput extends Components.EzNumberInput, HTMLElement {}
|
|
126
132
|
export const EzNumberInput: {
|
|
127
133
|
prototype: EzNumberInput;
|
|
@@ -176,6 +182,12 @@ export const EzTextArea: {
|
|
|
176
182
|
new (): EzTextArea;
|
|
177
183
|
};
|
|
178
184
|
|
|
185
|
+
interface EzTextEdit extends Components.EzTextEdit, HTMLElement {}
|
|
186
|
+
export const EzTextEdit: {
|
|
187
|
+
prototype: EzTextEdit;
|
|
188
|
+
new (): EzTextEdit;
|
|
189
|
+
};
|
|
190
|
+
|
|
179
191
|
interface EzTextInput extends Components.EzTextInput, HTMLElement {}
|
|
180
192
|
export const EzTextInput: {
|
|
181
193
|
prototype: EzTextInput;
|