@sankhyalabs/ezui 3.1.5 → 3.1.6

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.
@@ -81,7 +81,11 @@ const EzCollapsibleBox = class {
81
81
  });
82
82
  }
83
83
  saveEditionText(editDetails) {
84
- const { newValue } = editDetails.detail;
84
+ const { value, newValue } = editDetails.detail;
85
+ if (value === newValue) {
86
+ this.cancelEdition();
87
+ return;
88
+ }
85
89
  let canSave = true;
86
90
  if (this.conditionalSave) {
87
91
  canSave = this.conditionalSave(newValue);
@@ -74,17 +74,16 @@ const EzTextEdit = class {
74
74
  }
75
75
  }
76
76
  handleSaveEdition() {
77
- if (this._newValue !== this.value && !core.StringUtils.isEmpty(this._newValue)) {
78
- this.saveEdition.emit({ value: this.value, newValue: this._newValue });
79
- }
80
- else if (!this._newValue) {
77
+ if (!this._newValue) {
81
78
  ApplicationUtils.ApplicationUtils.alert("Aviso", "Não é possível salvar um campo em branco.").then(() => {
82
79
  this.setNewValue(this.value, true);
83
80
  });
81
+ return;
84
82
  }
85
- else {
86
- this.cancelEdition.emit();
87
- }
83
+ this.saveEdition.emit({ value: this.value, newValue: this._newValue });
84
+ }
85
+ handleCancelEdition() {
86
+ this.cancelEdition.emit();
88
87
  }
89
88
  setNewValue(value, setSelect = false) {
90
89
  this._newValue = value;
@@ -99,7 +98,7 @@ const EzTextEdit = class {
99
98
  }
100
99
  render() {
101
100
  core.ElementIDUtils.addIDInfoIfNotExists(this._element, 'input');
102
- return (index.h(index.Host, null, index.h("span", { class: "text-edit__hidden-value", ref: elem => this._valueBasis = elem }), index.h("ez-text-input", { "data-element-id": core.ElementIDUtils.getInternalIDInfo("textInput"), 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 }), index.h("ez-button", { class: "text-edit__icon-check", mode: "icon", iconName: "check", size: "small", onClick: () => { this.handleSaveEdition(); } }), index.h("ez-button", { class: "text-edit__icon-close", mode: "icon", iconName: "close", size: "small", onClick: () => { this.cancelEdition.emit(); } })));
101
+ return (index.h(index.Host, null, index.h("span", { class: "text-edit__hidden-value", ref: elem => this._valueBasis = elem }), index.h("ez-text-input", { "data-element-id": core.ElementIDUtils.getInternalIDInfo("textInput"), 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 }), index.h("ez-button", { class: "text-edit__icon-check", mode: "icon", iconName: "check", size: "small", onClick: () => { this.handleSaveEdition(); } }), index.h("ez-button", { class: "text-edit__icon-close", mode: "icon", iconName: "close", size: "small", onClick: () => { this.handleCancelEdition(); } })));
103
102
  }
104
103
  get _element() { return index.getElement(this); }
105
104
  };
@@ -67,7 +67,11 @@ export class EzCollapsibleBox {
67
67
  });
68
68
  }
69
69
  saveEditionText(editDetails) {
70
- const { newValue } = editDetails.detail;
70
+ const { value, newValue } = editDetails.detail;
71
+ if (value === newValue) {
72
+ this.cancelEdition();
73
+ return;
74
+ }
71
75
  let canSave = true;
72
76
  if (this.conditionalSave) {
73
77
  canSave = this.conditionalSave(newValue);
@@ -1,5 +1,5 @@
1
1
  import { Host, h } from '@stencil/core';
2
- import { ElementIDUtils, StringUtils } from '@sankhyalabs/core';
2
+ import { ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { ApplicationUtils } from "../../utils";
4
4
  export class EzTextEdit {
5
5
  constructor() {
@@ -62,17 +62,16 @@ export class EzTextEdit {
62
62
  }
63
63
  }
64
64
  handleSaveEdition() {
65
- if (this._newValue !== this.value && !StringUtils.isEmpty(this._newValue)) {
66
- this.saveEdition.emit({ value: this.value, newValue: this._newValue });
67
- }
68
- else if (!this._newValue) {
65
+ if (!this._newValue) {
69
66
  ApplicationUtils.alert("Aviso", "Não é possível salvar um campo em branco.").then(() => {
70
67
  this.setNewValue(this.value, true);
71
68
  });
69
+ return;
72
70
  }
73
- else {
74
- this.cancelEdition.emit();
75
- }
71
+ this.saveEdition.emit({ value: this.value, newValue: this._newValue });
72
+ }
73
+ handleCancelEdition() {
74
+ this.cancelEdition.emit();
76
75
  }
77
76
  setNewValue(value, setSelect = false) {
78
77
  this._newValue = value;
@@ -87,7 +86,7 @@ export class EzTextEdit {
87
86
  }
88
87
  render() {
89
88
  ElementIDUtils.addIDInfoIfNotExists(this._element, 'input');
90
- return (h(Host, null, h("span", { class: "text-edit__hidden-value", ref: elem => this._valueBasis = elem }), h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), 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 }), h("ez-button", { class: "text-edit__icon-check", mode: "icon", iconName: "check", size: "small", onClick: () => { this.handleSaveEdition(); } }), h("ez-button", { class: "text-edit__icon-close", mode: "icon", iconName: "close", size: "small", onClick: () => { this.cancelEdition.emit(); } })));
89
+ return (h(Host, null, h("span", { class: "text-edit__hidden-value", ref: elem => this._valueBasis = elem }), h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), 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 }), h("ez-button", { class: "text-edit__icon-check", mode: "icon", iconName: "check", size: "small", onClick: () => { this.handleSaveEdition(); } }), h("ez-button", { class: "text-edit__icon-close", mode: "icon", iconName: "close", size: "small", onClick: () => { this.handleCancelEdition(); } })));
91
90
  }
92
91
  static get is() { return "ez-text-edit"; }
93
92
  static get encapsulation() { return "shadow"; }
@@ -1257,7 +1257,11 @@ const EzCollapsibleBox$1 = class extends HTMLElement$1 {
1257
1257
  });
1258
1258
  }
1259
1259
  saveEditionText(editDetails) {
1260
- const { newValue } = editDetails.detail;
1260
+ const { value, newValue } = editDetails.detail;
1261
+ if (value === newValue) {
1262
+ this.cancelEdition();
1263
+ return;
1264
+ }
1261
1265
  let canSave = true;
1262
1266
  if (this.conditionalSave) {
1263
1267
  canSave = this.conditionalSave(newValue);
@@ -125738,17 +125742,16 @@ const EzTextEdit$1 = class extends HTMLElement$1 {
125738
125742
  }
125739
125743
  }
125740
125744
  handleSaveEdition() {
125741
- if (this._newValue !== this.value && !StringUtils$1.isEmpty(this._newValue)) {
125742
- this.saveEdition.emit({ value: this.value, newValue: this._newValue });
125743
- }
125744
- else if (!this._newValue) {
125745
+ if (!this._newValue) {
125745
125746
  ApplicationUtils.alert("Aviso", "Não é possível salvar um campo em branco.").then(() => {
125746
125747
  this.setNewValue(this.value, true);
125747
125748
  });
125749
+ return;
125748
125750
  }
125749
- else {
125750
- this.cancelEdition.emit();
125751
- }
125751
+ this.saveEdition.emit({ value: this.value, newValue: this._newValue });
125752
+ }
125753
+ handleCancelEdition() {
125754
+ this.cancelEdition.emit();
125752
125755
  }
125753
125756
  setNewValue(value, setSelect = false) {
125754
125757
  this._newValue = value;
@@ -125763,7 +125766,7 @@ const EzTextEdit$1 = class extends HTMLElement$1 {
125763
125766
  }
125764
125767
  render() {
125765
125768
  ElementIDUtils.addIDInfoIfNotExists(this._element, 'input');
125766
- return (h(Host, null, h("span", { class: "text-edit__hidden-value", ref: elem => this._valueBasis = elem }), h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), 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 }), h("ez-button", { class: "text-edit__icon-check", mode: "icon", iconName: "check", size: "small", onClick: () => { this.handleSaveEdition(); } }), h("ez-button", { class: "text-edit__icon-close", mode: "icon", iconName: "close", size: "small", onClick: () => { this.cancelEdition.emit(); } })));
125769
+ return (h(Host, null, h("span", { class: "text-edit__hidden-value", ref: elem => this._valueBasis = elem }), h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), 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 }), h("ez-button", { class: "text-edit__icon-check", mode: "icon", iconName: "check", size: "small", onClick: () => { this.handleSaveEdition(); } }), h("ez-button", { class: "text-edit__icon-close", mode: "icon", iconName: "close", size: "small", onClick: () => { this.handleCancelEdition(); } })));
125767
125770
  }
125768
125771
  get _element() { return this; }
125769
125772
  static get style() { return ezTextEditCss; }
@@ -77,7 +77,11 @@ const EzCollapsibleBox = class {
77
77
  });
78
78
  }
79
79
  saveEditionText(editDetails) {
80
- const { newValue } = editDetails.detail;
80
+ const { value, newValue } = editDetails.detail;
81
+ if (value === newValue) {
82
+ this.cancelEdition();
83
+ return;
84
+ }
81
85
  let canSave = true;
82
86
  if (this.conditionalSave) {
83
87
  canSave = this.conditionalSave(newValue);
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-c27164d3.js';
2
- import { StringUtils, ElementIDUtils } from '@sankhyalabs/core';
2
+ import { ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { A as ApplicationUtils } from './ApplicationUtils-79bf1d95.js';
4
4
  import './DialogType-54a62731.js';
5
5
  import './CheckMode-bdb2ec19.js';
@@ -70,17 +70,16 @@ const EzTextEdit = class {
70
70
  }
71
71
  }
72
72
  handleSaveEdition() {
73
- if (this._newValue !== this.value && !StringUtils.isEmpty(this._newValue)) {
74
- this.saveEdition.emit({ value: this.value, newValue: this._newValue });
75
- }
76
- else if (!this._newValue) {
73
+ if (!this._newValue) {
77
74
  ApplicationUtils.alert("Aviso", "Não é possível salvar um campo em branco.").then(() => {
78
75
  this.setNewValue(this.value, true);
79
76
  });
77
+ return;
80
78
  }
81
- else {
82
- this.cancelEdition.emit();
83
- }
79
+ this.saveEdition.emit({ value: this.value, newValue: this._newValue });
80
+ }
81
+ handleCancelEdition() {
82
+ this.cancelEdition.emit();
84
83
  }
85
84
  setNewValue(value, setSelect = false) {
86
85
  this._newValue = value;
@@ -95,7 +94,7 @@ const EzTextEdit = class {
95
94
  }
96
95
  render() {
97
96
  ElementIDUtils.addIDInfoIfNotExists(this._element, 'input');
98
- return (h(Host, null, h("span", { class: "text-edit__hidden-value", ref: elem => this._valueBasis = elem }), h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), 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 }), h("ez-button", { class: "text-edit__icon-check", mode: "icon", iconName: "check", size: "small", onClick: () => { this.handleSaveEdition(); } }), h("ez-button", { class: "text-edit__icon-close", mode: "icon", iconName: "close", size: "small", onClick: () => { this.cancelEdition.emit(); } })));
97
+ return (h(Host, null, h("span", { class: "text-edit__hidden-value", ref: elem => this._valueBasis = elem }), h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), 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 }), h("ez-button", { class: "text-edit__icon-check", mode: "icon", iconName: "check", size: "small", onClick: () => { this.handleSaveEdition(); } }), h("ez-button", { class: "text-edit__icon-close", mode: "icon", iconName: "close", size: "small", onClick: () => { this.handleCancelEdition(); } })));
99
98
  }
100
99
  get _element() { return getElement(this); }
101
100
  };
@@ -1 +1 @@
1
- import{p as e,b as o}from"./p-00ea9b50.js";export{s as setNonce}from"./p-00ea9b50.js";(()=>{const o=import.meta.url,s={};return""!==o&&(s.resourcesUrl=new URL(".",o).href),e(s)})().then((e=>o([["p-8f1a5e21",[[1,"ez-actions-button",{enabled:[516],actions:[1040],size:[513],showLabel:[516,"show-label"],displayIcon:[513,"display-icon"],checkOption:[516,"check-option"],value:[513],isTransparent:[516,"is-transparent"],arrowActive:[516,"arrow-active"],_selectedAction:[32],hideActions:[64],isOpened:[64]}]]],["p-51ecf138",[[1,"ez-breadcrumb",{items:[1040],fillMode:[1025,"fill-mode"],maxItems:[1026,"max-items"],positionEllipsis:[1026,"position-ellipsis"],visibleItems:[32],hiddenItems:[32],showDropdown:[32],collapseConfigPosition:[32]}]]],["p-bb0607a6",[[1,"ez-dialog",{confirm:[1028],dialogType:[1025,"dialog-type"],message:[1025],opened:[1540],personalizedIconPath:[1025,"personalized-icon-path"],ezTitle:[1025,"ez-title"],show:[64]}]]],["p-bf442859",[[6,"ez-grid",{multipleSelection:[4,"multiple-selection"],config:[1040],serverUrl:[1,"server-url"],dataUnit:[16],statusResolver:[16],_paginationInfo:[32],_paginationChangedByKeyboard:[32],setColumnsDef:[64],addColumnMenuItem:[64],setColumnsState:[64],setData:[64],getSelection:[64],getColumnsState:[64],getColumns:[64],quickFilter:[64]},[[0,"ezSelectionChange","onSelectionChange"]]]]],["p-7932f93d",[[6,"ez-modal-container",{modalTitle:[1,"modal-title"],modalSubTitle:[1,"modal-sub-title"],showTitleBar:[4,"show-title-bar"],cancelButtonLabel:[1,"cancel-button-label"],okButtonLabel:[1,"ok-button-label"],cancelButtonStatus:[1,"cancel-button-status"],okButtonStatus:[1,"ok-button-status"]}]]],["p-064e558f",[[1,"ez-alert",{alertType:[513,"alert-type"]}]]],["p-85c1e00f",[[1,"ez-chip",{label:[513],enabled:[516],removePosition:[513,"remove-position"],mode:[513],value:[1540],setFocus:[64],setBlur:[64]}]]],["p-149442dd",[[1,"ez-file-item",{canRemove:[4,"can-remove"],fileName:[1,"file-name"],iconName:[1,"icon-name"],fileSize:[2,"file-size"],progress:[2]}]]],["p-a0e47238",[[0,"ez-application"]]],["p-216e1153",[[1,"ez-card-item",{item:[16]}]]],["p-74b3615b",[[1,"ez-list",{dataSource:[1040],useGroups:[1540,"use-groups"],ezDraggable:[1028,"ez-draggable"],ezSelectable:[1028,"ez-selectable"],itemSlotBuilder:[1040],_listItems:[32],_listGroupItems:[32],clearHistory:[64],scrollToTop:[64],setSelection:[64],getSelection:[64],getList:[64]}]]],["p-044a3427",[[1,"ez-loading-bar",{_showLoading:[32],hide:[64],show:[64]}]]],["p-1cfae451",[[1,"ez-modal",{modalSize:[1,"modal-size"],align:[1],opened:[1028],closeEsc:[4,"close-esc"],closeOutsideClick:[4,"close-outside-click"]}]]],["p-bb011a51",[[1,"ez-popover",{autoClose:[516,"auto-close"],top:[1537],left:[1537],bottom:[1537],right:[1537],boxWidth:[513,"box-width"],opened:[1540],innerElement:[1537,"inner-element"],overlayType:[513,"overlay-type"],updatePosition:[64],show:[64],hide:[64]}]]],["p-78b28632",[[1,"ez-popup",{size:[1],opened:[1540],useHeader:[516,"use-header"],heightMode:[513,"height-mode"],ezTitle:[1,"ez-title"]}]]],["p-936ae3ac",[[1,"ez-radio-button",{value:[1544],options:[1040],enabled:[516],label:[513],direction:[1537]}]]],["p-68acdc61",[[1,"ez-toast",{message:[1025],fadeTime:[1026,"fade-time"],useIcon:[1028,"use-icon"],canClose:[1028,"can-close"],show:[64]}]]],["p-93c8bdc6",[[0,"ez-view-stack",{show:[64],getSelectedIndex:[64]}]]],["p-90c3d4fd",[[2,"ez-form-view",{fields:[16]}]]],["p-38520b9c",[[1,"ez-tabselector",{selectedIndex:[1538,"selected-index"],selectedTab:[1537,"selected-tab"],tabs:[1],_processedTabs:[32]}]]],["p-1806b3c6",[[1,"ez-text-input",{label:[513],value:[1537],enabled:[516],errorMessage:[1537,"error-message"],mask:[1],canShowError:[516,"can-show-error"],restrict:[1],mode:[513],noBorder:[516,"no-border"],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-bfca509e",[[1,"ez-guide-navigator",{open:[1540],items:[16],tooltipResolver:[16],filterText:[32],disableItem:[64],enableItem:[64]}]]],["p-e6cf82e8",[[1,"ez-dropdown",{items:[1040],value:[1040],itemBuilder:[16]}]]],["p-dd13d0e6",[[1,"ez-collapsible-box",{value:[1540],label:[513],headerSize:[513,"header-size"],iconPlacement:[513,"icon-placement"],headerAlign:[513,"header-align"],removable:[516],editable:[516],conditionalSave:[16],_activeEditText:[32],showHide:[64],applyFocusTextEdit:[64],cancelEdition:[64]}]]],["p-e8271a0e",[[1,"ez-search",{value:[1537],label:[1537],enabled:[1540],errorMessage:[1537,"error-message"],optionLoader:[16],showSelectedValue:[4,"show-selected-value"],showOptionValue:[4,"show-option-value"],suppressEmptyOption:[4,"suppress-empty-option"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-77d70bae",[[1,"ez-date-input",{label:[513],value:[1040],enabled:[516],errorMessage:[1537,"error-message"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-cd1e0679",[[1,"ez-date-time-input",{label:[513],value:[1040],enabled:[516],errorMessage:[1537,"error-message"],showSeconds:[516,"show-seconds"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-124859c3",[[1,"ez-time-input",{label:[513],value:[1026],enabled:[516],errorMessage:[1537,"error-message"],showSeconds:[516,"show-seconds"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-aaba630e",[[1,"ez-number-input",{label:[1],value:[1538],enabled:[4],errorMessage:[1537,"error-message"],precision:[2],prettyPrecision:[2,"pretty-precision"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-330aef41",[[1,"ez-check",{label:[513],value:[1540],enabled:[1540],indeterminate:[516],mode:[513],getMode:[64],setFocus:[64]}]]],["p-66dba09c",[[1,"ez-text-area",{label:[513],value:[1537],enabled:[516],errorMessage:[1537,"error-message"],rows:[1538],canShowError:[516,"can-show-error"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-74379544",[[1,"ez-upload",{label:[1],enabled:[4],maxFileSize:[2,"max-file-size"],maxFiles:[2,"max-files"],requestHeaders:[8,"request-headers"],urlUpload:[1,"url-upload"],urlDelete:[1,"url-delete"],value:[1040],addFiles:[64],setFocus:[64],setBlur:[64]}]]],["p-30afcb93",[[1,"ez-combo-box",{value:[1537],label:[513],enabled:[516],options:[1040],errorMessage:[1537,"error-message"],searchMode:[4,"search-mode"],showSelectedValue:[4,"show-selected-value"],showOptionValue:[4,"show-option-value"],suppressSearch:[4,"suppress-search"],optionLoader:[16],suppressEmptyOption:[4,"suppress-empty-option"],canShowError:[516,"can-show-error"],mode:[513],_preSelection:[32],_visibleOptions:[32],_startLoading:[32],_showLoading:[32],_criteria:[32],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-7ff5d0cc",[[1,"ez-calendar",{value:[1040],floating:[516],time:[516],showSeconds:[516,"show-seconds"],show:[64],fitVertical:[64],hide:[64]}]]],["p-ce1408dd",[[1,"ez-icon",{size:[513],href:[513],iconName:[513,"icon-name"]}]]],["p-0e4ab096",[[1,"ez-filter-input",{label:[1],value:[1537],enabled:[4],errorMessage:[1537,"error-message"],restrict:[1],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}],[1,"ez-scroller",{direction:[1],locked:[4],activeShadow:[4,"active-shadow"],isActive:[32]},[[2,"click","clickListener"],[1,"mousedown","mouseDownHandler"],[1,"mouseup","mouseUpHandler"],[1,"mousemove","mouseMoveHandler"]]],[1,"ez-sidebar-button"],[1,"ez-tree",{items:[1040],value:[1040],selectedId:[1537,"selected-id"],iconResolver:[16],tooltipResolver:[16],_tree:[32],_waintingForLoad:[32],selectItem:[64],openItem:[64],disableItem:[64],enableItem:[64],addChild:[64],applyFilter:[64]},[[2,"keydown","onKeyDownListener"]]]]],["p-80f79b1c",[[1,"ez-button",{label:[513],enabled:[516],mode:[513],image:[513],iconName:[513,"icon-name"],size:[513],setFocus:[64],setBlur:[64]}]]],["p-52e5cc09",[[1,"ez-text-edit",{value:[1],styled:[16],_newValue:[32],applyFocusSelect:[64]}]]],["p-1a1c2eda",[[2,"ez-form",{dataUnit:[1040],config:[16],recordsValidator:[16],multiLevel:[4,"multi-level"],levelResolver:[16],contentBuilder:[16],validate:[64]}]]]],e)));
1
+ import{p as e,b as o}from"./p-00ea9b50.js";export{s as setNonce}from"./p-00ea9b50.js";(()=>{const o=import.meta.url,s={};return""!==o&&(s.resourcesUrl=new URL(".",o).href),e(s)})().then((e=>o([["p-8f1a5e21",[[1,"ez-actions-button",{enabled:[516],actions:[1040],size:[513],showLabel:[516,"show-label"],displayIcon:[513,"display-icon"],checkOption:[516,"check-option"],value:[513],isTransparent:[516,"is-transparent"],arrowActive:[516,"arrow-active"],_selectedAction:[32],hideActions:[64],isOpened:[64]}]]],["p-51ecf138",[[1,"ez-breadcrumb",{items:[1040],fillMode:[1025,"fill-mode"],maxItems:[1026,"max-items"],positionEllipsis:[1026,"position-ellipsis"],visibleItems:[32],hiddenItems:[32],showDropdown:[32],collapseConfigPosition:[32]}]]],["p-bb0607a6",[[1,"ez-dialog",{confirm:[1028],dialogType:[1025,"dialog-type"],message:[1025],opened:[1540],personalizedIconPath:[1025,"personalized-icon-path"],ezTitle:[1025,"ez-title"],show:[64]}]]],["p-bf442859",[[6,"ez-grid",{multipleSelection:[4,"multiple-selection"],config:[1040],serverUrl:[1,"server-url"],dataUnit:[16],statusResolver:[16],_paginationInfo:[32],_paginationChangedByKeyboard:[32],setColumnsDef:[64],addColumnMenuItem:[64],setColumnsState:[64],setData:[64],getSelection:[64],getColumnsState:[64],getColumns:[64],quickFilter:[64]},[[0,"ezSelectionChange","onSelectionChange"]]]]],["p-7932f93d",[[6,"ez-modal-container",{modalTitle:[1,"modal-title"],modalSubTitle:[1,"modal-sub-title"],showTitleBar:[4,"show-title-bar"],cancelButtonLabel:[1,"cancel-button-label"],okButtonLabel:[1,"ok-button-label"],cancelButtonStatus:[1,"cancel-button-status"],okButtonStatus:[1,"ok-button-status"]}]]],["p-064e558f",[[1,"ez-alert",{alertType:[513,"alert-type"]}]]],["p-85c1e00f",[[1,"ez-chip",{label:[513],enabled:[516],removePosition:[513,"remove-position"],mode:[513],value:[1540],setFocus:[64],setBlur:[64]}]]],["p-149442dd",[[1,"ez-file-item",{canRemove:[4,"can-remove"],fileName:[1,"file-name"],iconName:[1,"icon-name"],fileSize:[2,"file-size"],progress:[2]}]]],["p-a0e47238",[[0,"ez-application"]]],["p-216e1153",[[1,"ez-card-item",{item:[16]}]]],["p-74b3615b",[[1,"ez-list",{dataSource:[1040],useGroups:[1540,"use-groups"],ezDraggable:[1028,"ez-draggable"],ezSelectable:[1028,"ez-selectable"],itemSlotBuilder:[1040],_listItems:[32],_listGroupItems:[32],clearHistory:[64],scrollToTop:[64],setSelection:[64],getSelection:[64],getList:[64]}]]],["p-044a3427",[[1,"ez-loading-bar",{_showLoading:[32],hide:[64],show:[64]}]]],["p-1cfae451",[[1,"ez-modal",{modalSize:[1,"modal-size"],align:[1],opened:[1028],closeEsc:[4,"close-esc"],closeOutsideClick:[4,"close-outside-click"]}]]],["p-bb011a51",[[1,"ez-popover",{autoClose:[516,"auto-close"],top:[1537],left:[1537],bottom:[1537],right:[1537],boxWidth:[513,"box-width"],opened:[1540],innerElement:[1537,"inner-element"],overlayType:[513,"overlay-type"],updatePosition:[64],show:[64],hide:[64]}]]],["p-78b28632",[[1,"ez-popup",{size:[1],opened:[1540],useHeader:[516,"use-header"],heightMode:[513,"height-mode"],ezTitle:[1,"ez-title"]}]]],["p-936ae3ac",[[1,"ez-radio-button",{value:[1544],options:[1040],enabled:[516],label:[513],direction:[1537]}]]],["p-68acdc61",[[1,"ez-toast",{message:[1025],fadeTime:[1026,"fade-time"],useIcon:[1028,"use-icon"],canClose:[1028,"can-close"],show:[64]}]]],["p-93c8bdc6",[[0,"ez-view-stack",{show:[64],getSelectedIndex:[64]}]]],["p-90c3d4fd",[[2,"ez-form-view",{fields:[16]}]]],["p-38520b9c",[[1,"ez-tabselector",{selectedIndex:[1538,"selected-index"],selectedTab:[1537,"selected-tab"],tabs:[1],_processedTabs:[32]}]]],["p-1806b3c6",[[1,"ez-text-input",{label:[513],value:[1537],enabled:[516],errorMessage:[1537,"error-message"],mask:[1],canShowError:[516,"can-show-error"],restrict:[1],mode:[513],noBorder:[516,"no-border"],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-bfca509e",[[1,"ez-guide-navigator",{open:[1540],items:[16],tooltipResolver:[16],filterText:[32],disableItem:[64],enableItem:[64]}]]],["p-e6cf82e8",[[1,"ez-dropdown",{items:[1040],value:[1040],itemBuilder:[16]}]]],["p-d015295f",[[1,"ez-collapsible-box",{value:[1540],label:[513],headerSize:[513,"header-size"],iconPlacement:[513,"icon-placement"],headerAlign:[513,"header-align"],removable:[516],editable:[516],conditionalSave:[16],_activeEditText:[32],showHide:[64],applyFocusTextEdit:[64],cancelEdition:[64]}]]],["p-e8271a0e",[[1,"ez-search",{value:[1537],label:[1537],enabled:[1540],errorMessage:[1537,"error-message"],optionLoader:[16],showSelectedValue:[4,"show-selected-value"],showOptionValue:[4,"show-option-value"],suppressEmptyOption:[4,"suppress-empty-option"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-77d70bae",[[1,"ez-date-input",{label:[513],value:[1040],enabled:[516],errorMessage:[1537,"error-message"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-cd1e0679",[[1,"ez-date-time-input",{label:[513],value:[1040],enabled:[516],errorMessage:[1537,"error-message"],showSeconds:[516,"show-seconds"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-124859c3",[[1,"ez-time-input",{label:[513],value:[1026],enabled:[516],errorMessage:[1537,"error-message"],showSeconds:[516,"show-seconds"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-aaba630e",[[1,"ez-number-input",{label:[1],value:[1538],enabled:[4],errorMessage:[1537,"error-message"],precision:[2],prettyPrecision:[2,"pretty-precision"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-330aef41",[[1,"ez-check",{label:[513],value:[1540],enabled:[1540],indeterminate:[516],mode:[513],getMode:[64],setFocus:[64]}]]],["p-66dba09c",[[1,"ez-text-area",{label:[513],value:[1537],enabled:[516],errorMessage:[1537,"error-message"],rows:[1538],canShowError:[516,"can-show-error"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-74379544",[[1,"ez-upload",{label:[1],enabled:[4],maxFileSize:[2,"max-file-size"],maxFiles:[2,"max-files"],requestHeaders:[8,"request-headers"],urlUpload:[1,"url-upload"],urlDelete:[1,"url-delete"],value:[1040],addFiles:[64],setFocus:[64],setBlur:[64]}]]],["p-30afcb93",[[1,"ez-combo-box",{value:[1537],label:[513],enabled:[516],options:[1040],errorMessage:[1537,"error-message"],searchMode:[4,"search-mode"],showSelectedValue:[4,"show-selected-value"],showOptionValue:[4,"show-option-value"],suppressSearch:[4,"suppress-search"],optionLoader:[16],suppressEmptyOption:[4,"suppress-empty-option"],canShowError:[516,"can-show-error"],mode:[513],_preSelection:[32],_visibleOptions:[32],_startLoading:[32],_showLoading:[32],_criteria:[32],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-7ff5d0cc",[[1,"ez-calendar",{value:[1040],floating:[516],time:[516],showSeconds:[516,"show-seconds"],show:[64],fitVertical:[64],hide:[64]}]]],["p-ce1408dd",[[1,"ez-icon",{size:[513],href:[513],iconName:[513,"icon-name"]}]]],["p-0e4ab096",[[1,"ez-filter-input",{label:[1],value:[1537],enabled:[4],errorMessage:[1537,"error-message"],restrict:[1],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}],[1,"ez-scroller",{direction:[1],locked:[4],activeShadow:[4,"active-shadow"],isActive:[32]},[[2,"click","clickListener"],[1,"mousedown","mouseDownHandler"],[1,"mouseup","mouseUpHandler"],[1,"mousemove","mouseMoveHandler"]]],[1,"ez-sidebar-button"],[1,"ez-tree",{items:[1040],value:[1040],selectedId:[1537,"selected-id"],iconResolver:[16],tooltipResolver:[16],_tree:[32],_waintingForLoad:[32],selectItem:[64],openItem:[64],disableItem:[64],enableItem:[64],addChild:[64],applyFilter:[64]},[[2,"keydown","onKeyDownListener"]]]]],["p-80f79b1c",[[1,"ez-button",{label:[513],enabled:[516],mode:[513],image:[513],iconName:[513,"icon-name"],size:[513],setFocus:[64],setBlur:[64]}]]],["p-07d71b7a",[[1,"ez-text-edit",{value:[1],styled:[16],_newValue:[32],applyFocusSelect:[64]}]]],["p-1a1c2eda",[[2,"ez-form",{dataUnit:[1040],config:[16],recordsValidator:[16],multiLevel:[4,"multi-level"],levelResolver:[16],contentBuilder:[16],validate:[64]}]]]],e)));
@@ -0,0 +1 @@
1
+ import{r as t,c as i,h as s,H as e,g as n}from"./p-00ea9b50.js";import{ElementIDUtils as o}from"@sankhyalabs/core";import{A as l}from"./p-efb43dd8.js";import"./p-ab574d59.js";import"./p-b853763b.js";const h=class{constructor(s){t(this,s),this.saveEdition=i(this,"saveEdition",7),this.cancelEdition=i(this,"cancelEdition",7),this._newValue=void 0,this.value=void 0,this.styled=void 0}async applyFocusSelect(){this.calcSizeInput(this.value,!0)}calcSizeInput(t,i=!1){var s,e;const n=null===(e=null===(s=this._inputElement)||void 0===s?void 0:s.shadowRoot)||void 0===e?void 0:e.querySelector("input");if(null!=n){const s=this.getWidthValue(t);n.style.width=s+"px",i&&setTimeout((()=>n.select()),100)}}getWidthValue(t){if(null!=this._valueBasis){const i=this._valueBasis;if(null!=t){const s=2;return i.innerHTML=t,i.clientWidth>0?i.clientWidth+s:s}i.innerHTML=""}return 0}setStyledInput(){var t,i;let s="",e="",n="";null!=this.styled&&(s=this.styled.fontSize,e=this.styled.fontWeight,n=this.styled.fontFamily);const o=null===(i=null===(t=this._inputElement)||void 0===t?void 0:t.shadowRoot)||void 0===i?void 0:i.querySelector("input");null!=o&&(o.style.fontSize=s,o.style.fontWeight=e,o.style.fontFamily=n);const l=this._valueBasis;null!=l&&(l.style.fontSize=s,l.style.fontWeight=e,l.style.fontFamily=n)}handleSaveEdition(){this._newValue?this.saveEdition.emit({value:this.value,newValue:this._newValue}):l.alert("Aviso","Não é possível salvar um campo em branco.").then((()=>{this.setNewValue(this.value,!0)}))}handleCancelEdition(){this.cancelEdition.emit()}setNewValue(t,i=!1){this._newValue=t,this.calcSizeInput(this._newValue,i)}componentDidLoad(){this.applyFocusSelect(),this.setNewValue(this.value)}componentDidRender(){this.setStyledInput()}render(){return o.addIDInfoIfNotExists(this._element,"input"),s(e,null,s("span",{class:"text-edit__hidden-value",ref:t=>this._valueBasis=t}),s("ez-text-input",{"data-element-id":o.getInternalIDInfo("textInput"),onInput:()=>{this.calcSizeInput(this._newValue)},class:"text-edit__form-input",value:this._newValue,ref:t=>this._inputElement=t,mode:"slim",onEzChange:t=>this.setNewValue(null==t?void 0:t.detail),noBorder:!0}),s("ez-button",{class:"text-edit__icon-check",mode:"icon",iconName:"check",size:"small",onClick:()=>{this.handleSaveEdition()}}),s("ez-button",{class:"text-edit__icon-close",mode:"icon",iconName:"close",size:"small",onClick:()=>{this.handleCancelEdition()}}))}get _element(){return n(this)}};h.style=":host{display:flex;align-items:center;gap:5px}.text-edit__form-input{width:auto;--ez-text-input__input--padding:0px}.text-edit__hidden-value{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}";export{h as ez_text_edit}
@@ -0,0 +1 @@
1
+ import{r as i,c as l,h as e,g as o}from"./p-00ea9b50.js";import{ElementIDUtils as t}from"@sankhyalabs/core";import{A as s}from"./p-efb43dd8.js";import"./p-ab574d59.js";import"./p-b853763b.js";const a=class{constructor(e){i(this,e),this.ezChange=l(this,"ezChange",7),this.ezRemove=l(this,"ezRemove",7),this.ezSaveEditLabel=l(this,"ezSaveEditLabel",7),this.ezEditLabelMode=l(this,"ezEditLabelMode",7),this._activeEditText=!1,this.value=!1,this.label=void 0,this.headerSize="small",this.iconPlacement="left",this.headerAlign="left",this.removable=!1,this.editable=!1,this.conditionalSave=void 0}async showHide(){this.value=!this.value}async applyFocusTextEdit(){var i;null===(i=this._refTextEdit)||void 0===i||i.applyFocusSelect()}async cancelEdition(){this._activeEditText=!1,this.ezEditLabelMode.emit(this._activeEditText)}observeCollapsedValue(){this.ezChange.emit(this.value)}getHeaderSize(){const i=this.headerSize&&this.headerSize.toLowerCase(),l=["xsmall","xlarge"].includes(i)?i.replace("x","x-"):i;return["x-small","small","medium","large","x-large"].includes(l)?l:"small"}removeElement(){this._hostElement&&this._hostElement.remove(),this.ezRemove.emit(this)}editLabel(i){i.preventDefault(),i.stopPropagation(),this._activeEditText=!0,this.ezEditLabelMode.emit(this._activeEditText)}confirmRemove(i){i.preventDefault(),i.stopPropagation(),s.confirm("Aviso",`Deseja realmente remover o grupo <b>${this.label}</b>?`).then((i=>{i&&this.removeElement()}))}saveEditionText(i){const{value:l,newValue:e}=i.detail;if(l===e)return void this.cancelEdition();let o=!0;this.conditionalSave&&(o=this.conditionalSave(e)),this.label!==e&&o&&(this.label=e,this._activeEditText=!1,this.ezSaveEditLabel.emit(i.detail),this.ezEditLabelMode.emit(this._activeEditText))}getStyledLabel(){if(null!=this._refLabel)return{fontSize:window.getComputedStyle(this._refLabel).getPropertyValue("font-size"),fontWeight:window.getComputedStyle(this._refLabel).getPropertyValue("font-weight"),fontFamily:window.getComputedStyle(this._refLabel).getPropertyValue("font-family")}}componentDidLoad(){t.addIDInfo(this._hostElement)}render(){return e("div",{class:"collapsible-box"},e("div",{class:"collapsible-box__header"},e("button",Object.assign({},this._activeEditText?null:{onClick:()=>{this.showHide()}},{class:"collapsible-box__title collapsible-box__title--"+(this.headerAlign||"left")+("right"===this.iconPlacement?" collapsible-box__title--icon-right":"")+(this.value?" collapsible-box__title--no-margin":"")}),e("ez-icon",{slot:"icon","icon-name":"chevron-right",size:this.getHeaderSize(),class:"collapsible-box__icon collapsible-box__icon--"+this.getHeaderSize()+(this.value?" collapsible-box__icon--collapsed":""),id:"toggleCollapsible"}),this._activeEditText?e("ez-text-edit",{class:"collapsible-box__text-edit",ref:i=>this._refTextEdit=i,value:this.label,styled:this.getStyledLabel(),onSaveEdition:i=>this.saveEditionText(i),onCancelEdition:()=>this.cancelEdition()}):e("label",{class:"collapsible-box__label font--"+this.getHeaderSize(),title:this.label,ref:i=>this._refLabel=i},e("span",null,this.label),this.editable&&e("ez-icon",{slot:"icon","icon-name":"edit",onClick:i=>this.editLabel(i),title:"Editar"}),this.removable&&e("ez-icon",{slot:"icon","icon-name":"delete",onClick:i=>this.confirmRemove(i),title:"Remover"})))),e("div",{class:"collapsible-box__content"+(this.value?"":" collapsible-box__content--show")},e("slot",null)))}get _hostElement(){return o(this)}static get watchers(){return{value:["observeCollapsedValue"]}}};a.style=":host{--ez-collapsible-box--font-size:var(--title--medium, 14px);--ez-collapsible-box--font-family:var(--font-pattern, Arial);--ez-collapsible-box--font-weight:var(--text-weight--large, 600);--ez-collapsible-box--color:var(--title--primary);--ez-collapsible-box--focus--color:var(--color--primary-600);--ez-collapsible-box__icon--color:var(--ez-collapsible-box--color);--ez-collapsible-box__header--padding-top:0px;--ez-collapsible-box__header--padding-bottom:0px;--ez-collapsible-box__header--padding-right:0px;--ez-collapsible-box__header--padding-left:0px;display:flex;flex-wrap:wrap;width:100%}ez-icon{--ez-icon--color:inherit}.collapsible-box{display:flex;flex-direction:column;width:100%}.collapsible-box__header{display:flex;box-sizing:border-box;padding-top:var(--ez-collapsible-box__header--padding-top);padding-bottom:var(--ez-collapsible-box__header--padding-bottom);padding-right:var(--ez-collapsible-box__header--padding-right);padding-left:var(--ez-collapsible-box__header--padding-left)}.collapsible-box__title{position:relative;width:auto;display:flex;box-sizing:border-box;align-items:center;outline:none;border:none;background-color:unset;cursor:pointer;padding:0px;text-align:left;color:var(--ez-collapsible-box--color);--ez-icon--color:var(--ez-collapsible-box__icon--color);margin-bottom:var(--space--medium, 12px)}.collapsible-box__title:focus{color:var(--ez-collapsible-box--focus--color);--ez-icon--color:var(--ez-collapsible-box--focus--color)}.collapsible-box__label{display:flex;white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;box-sizing:border-box;margin-left:6px;gap:6px;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight)}.collapsible-box__label ez-icon{visibility:hidden;transition:0.25s linear}.collapsible-box__label:hover ez-icon{visibility:visible}.collapsible-box__text-edit{margin-left:6px}.collapsible-box__icon{transform:rotate(90deg) translate(0px, 14%);transition:transform var(--transition)}.collapsible-box__icon--collapsed{transform:rotate(0deg) translate(-14%, 0px)}.collapsible-box__title--icon-right{flex-direction:row-reverse}.collapsible-box__title--icon-right .collapsible-box__icon{transform:rotate(90deg) translate(0px, -14%)}.collapsible-box__title--icon-right .collapsible-box__icon--collapsed{transform:rotate(0deg) translate(14%, 0px)}.collapsible-box__title--icon-right .collapsible-box__label{margin-left:0px;margin-right:6px}.collapsible-box__title--left{margin-right:auto}.collapsible-box__title--right{margin-left:auto}.collapsible-box__title--center{margin-left:auto;margin-right:auto}.collapsible-box__title--stretch{justify-content:space-between;width:100%}.collapsible-box__title--no-margin{margin-bottom:0}.collapsible-box__content{display:flex;flex-wrap:wrap;width:100%;height:0px;max-height:0px;opacity:0;overflow:hidden;transition:all var(--transition, 0.5s)}.collapsible-box__content--show{height:100%;max-height:none;opacity:1;overflow:visible;transition:all var(--transition, 0.5s)}.font--x-small{font-size:10px}.font--small{font-size:12px}.font--medium{font-size:14px}.font--large{font-size:16px}.font--x-large{font-size:20px}";export{a as ez_collapsible_box}
@@ -28,6 +28,7 @@ export declare class EzTextEdit {
28
28
  private getWidthValue;
29
29
  private setStyledInput;
30
30
  private handleSaveEdition;
31
+ private handleCancelEdition;
31
32
  private setNewValue;
32
33
  componentDidLoad(): void;
33
34
  componentDidRender(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sankhyalabs/ezui",
3
- "version": "3.1.5",
3
+ "version": "3.1.6",
4
4
  "description": "Biblioteca de componentes Sankhya.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/custom-elements/index.js",
@@ -1 +0,0 @@
1
- import{r as t,c as i,h as s,H as e,g as n}from"./p-00ea9b50.js";import{StringUtils as o,ElementIDUtils as l}from"@sankhyalabs/core";import{A as h}from"./p-efb43dd8.js";import"./p-ab574d59.js";import"./p-b853763b.js";const a=class{constructor(s){t(this,s),this.saveEdition=i(this,"saveEdition",7),this.cancelEdition=i(this,"cancelEdition",7),this._newValue=void 0,this.value=void 0,this.styled=void 0}async applyFocusSelect(){this.calcSizeInput(this.value,!0)}calcSizeInput(t,i=!1){var s,e;const n=null===(e=null===(s=this._inputElement)||void 0===s?void 0:s.shadowRoot)||void 0===e?void 0:e.querySelector("input");if(null!=n){const s=this.getWidthValue(t);n.style.width=s+"px",i&&setTimeout((()=>n.select()),100)}}getWidthValue(t){if(null!=this._valueBasis){const i=this._valueBasis;if(null!=t){const s=2;return i.innerHTML=t,i.clientWidth>0?i.clientWidth+s:s}i.innerHTML=""}return 0}setStyledInput(){var t,i;let s="",e="",n="";null!=this.styled&&(s=this.styled.fontSize,e=this.styled.fontWeight,n=this.styled.fontFamily);const o=null===(i=null===(t=this._inputElement)||void 0===t?void 0:t.shadowRoot)||void 0===i?void 0:i.querySelector("input");null!=o&&(o.style.fontSize=s,o.style.fontWeight=e,o.style.fontFamily=n);const l=this._valueBasis;null!=l&&(l.style.fontSize=s,l.style.fontWeight=e,l.style.fontFamily=n)}handleSaveEdition(){this._newValue===this.value||o.isEmpty(this._newValue)?this._newValue?this.cancelEdition.emit():h.alert("Aviso","Não é possível salvar um campo em branco.").then((()=>{this.setNewValue(this.value,!0)})):this.saveEdition.emit({value:this.value,newValue:this._newValue})}setNewValue(t,i=!1){this._newValue=t,this.calcSizeInput(this._newValue,i)}componentDidLoad(){this.applyFocusSelect(),this.setNewValue(this.value)}componentDidRender(){this.setStyledInput()}render(){return l.addIDInfoIfNotExists(this._element,"input"),s(e,null,s("span",{class:"text-edit__hidden-value",ref:t=>this._valueBasis=t}),s("ez-text-input",{"data-element-id":l.getInternalIDInfo("textInput"),onInput:()=>{this.calcSizeInput(this._newValue)},class:"text-edit__form-input",value:this._newValue,ref:t=>this._inputElement=t,mode:"slim",onEzChange:t=>this.setNewValue(null==t?void 0:t.detail),noBorder:!0}),s("ez-button",{class:"text-edit__icon-check",mode:"icon",iconName:"check",size:"small",onClick:()=>{this.handleSaveEdition()}}),s("ez-button",{class:"text-edit__icon-close",mode:"icon",iconName:"close",size:"small",onClick:()=>{this.cancelEdition.emit()}}))}get _element(){return n(this)}};a.style=":host{display:flex;align-items:center;gap:5px}.text-edit__form-input{width:auto;--ez-text-input__input--padding:0px}.text-edit__hidden-value{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}";export{a as ez_text_edit}
@@ -1 +0,0 @@
1
- import{r as i,c as l,h as e,g as o}from"./p-00ea9b50.js";import{ElementIDUtils as t}from"@sankhyalabs/core";import{A as s}from"./p-efb43dd8.js";import"./p-ab574d59.js";import"./p-b853763b.js";const a=class{constructor(e){i(this,e),this.ezChange=l(this,"ezChange",7),this.ezRemove=l(this,"ezRemove",7),this.ezSaveEditLabel=l(this,"ezSaveEditLabel",7),this.ezEditLabelMode=l(this,"ezEditLabelMode",7),this._activeEditText=!1,this.value=!1,this.label=void 0,this.headerSize="small",this.iconPlacement="left",this.headerAlign="left",this.removable=!1,this.editable=!1,this.conditionalSave=void 0}async showHide(){this.value=!this.value}async applyFocusTextEdit(){var i;null===(i=this._refTextEdit)||void 0===i||i.applyFocusSelect()}async cancelEdition(){this._activeEditText=!1,this.ezEditLabelMode.emit(this._activeEditText)}observeCollapsedValue(){this.ezChange.emit(this.value)}getHeaderSize(){const i=this.headerSize&&this.headerSize.toLowerCase(),l=["xsmall","xlarge"].includes(i)?i.replace("x","x-"):i;return["x-small","small","medium","large","x-large"].includes(l)?l:"small"}removeElement(){this._hostElement&&this._hostElement.remove(),this.ezRemove.emit(this)}editLabel(i){i.preventDefault(),i.stopPropagation(),this._activeEditText=!0,this.ezEditLabelMode.emit(this._activeEditText)}confirmRemove(i){i.preventDefault(),i.stopPropagation(),s.confirm("Aviso",`Deseja realmente remover o grupo <b>${this.label}</b>?`).then((i=>{i&&this.removeElement()}))}saveEditionText(i){const{newValue:l}=i.detail;let e=!0;this.conditionalSave&&(e=this.conditionalSave(l)),this.label!==l&&e&&(this.label=l,this._activeEditText=!1,this.ezSaveEditLabel.emit(i.detail),this.ezEditLabelMode.emit(this._activeEditText))}getStyledLabel(){if(null!=this._refLabel)return{fontSize:window.getComputedStyle(this._refLabel).getPropertyValue("font-size"),fontWeight:window.getComputedStyle(this._refLabel).getPropertyValue("font-weight"),fontFamily:window.getComputedStyle(this._refLabel).getPropertyValue("font-family")}}componentDidLoad(){t.addIDInfo(this._hostElement)}render(){return e("div",{class:"collapsible-box"},e("div",{class:"collapsible-box__header"},e("button",Object.assign({},this._activeEditText?null:{onClick:()=>{this.showHide()}},{class:"collapsible-box__title collapsible-box__title--"+(this.headerAlign||"left")+("right"===this.iconPlacement?" collapsible-box__title--icon-right":"")+(this.value?" collapsible-box__title--no-margin":"")}),e("ez-icon",{slot:"icon","icon-name":"chevron-right",size:this.getHeaderSize(),class:"collapsible-box__icon collapsible-box__icon--"+this.getHeaderSize()+(this.value?" collapsible-box__icon--collapsed":""),id:"toggleCollapsible"}),this._activeEditText?e("ez-text-edit",{class:"collapsible-box__text-edit",ref:i=>this._refTextEdit=i,value:this.label,styled:this.getStyledLabel(),onSaveEdition:i=>this.saveEditionText(i),onCancelEdition:()=>this.cancelEdition()}):e("label",{class:"collapsible-box__label font--"+this.getHeaderSize(),title:this.label,ref:i=>this._refLabel=i},e("span",null,this.label),this.editable&&e("ez-icon",{slot:"icon","icon-name":"edit",onClick:i=>this.editLabel(i),title:"Editar"}),this.removable&&e("ez-icon",{slot:"icon","icon-name":"delete",onClick:i=>this.confirmRemove(i),title:"Remover"})))),e("div",{class:"collapsible-box__content"+(this.value?"":" collapsible-box__content--show")},e("slot",null)))}get _hostElement(){return o(this)}static get watchers(){return{value:["observeCollapsedValue"]}}};a.style=":host{--ez-collapsible-box--font-size:var(--title--medium, 14px);--ez-collapsible-box--font-family:var(--font-pattern, Arial);--ez-collapsible-box--font-weight:var(--text-weight--large, 600);--ez-collapsible-box--color:var(--title--primary);--ez-collapsible-box--focus--color:var(--color--primary-600);--ez-collapsible-box__icon--color:var(--ez-collapsible-box--color);--ez-collapsible-box__header--padding-top:0px;--ez-collapsible-box__header--padding-bottom:0px;--ez-collapsible-box__header--padding-right:0px;--ez-collapsible-box__header--padding-left:0px;display:flex;flex-wrap:wrap;width:100%}ez-icon{--ez-icon--color:inherit}.collapsible-box{display:flex;flex-direction:column;width:100%}.collapsible-box__header{display:flex;box-sizing:border-box;padding-top:var(--ez-collapsible-box__header--padding-top);padding-bottom:var(--ez-collapsible-box__header--padding-bottom);padding-right:var(--ez-collapsible-box__header--padding-right);padding-left:var(--ez-collapsible-box__header--padding-left)}.collapsible-box__title{position:relative;width:auto;display:flex;box-sizing:border-box;align-items:center;outline:none;border:none;background-color:unset;cursor:pointer;padding:0px;text-align:left;color:var(--ez-collapsible-box--color);--ez-icon--color:var(--ez-collapsible-box__icon--color);margin-bottom:var(--space--medium, 12px)}.collapsible-box__title:focus{color:var(--ez-collapsible-box--focus--color);--ez-icon--color:var(--ez-collapsible-box--focus--color)}.collapsible-box__label{display:flex;white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;box-sizing:border-box;margin-left:6px;gap:6px;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight)}.collapsible-box__label ez-icon{visibility:hidden;transition:0.25s linear}.collapsible-box__label:hover ez-icon{visibility:visible}.collapsible-box__text-edit{margin-left:6px}.collapsible-box__icon{transform:rotate(90deg) translate(0px, 14%);transition:transform var(--transition)}.collapsible-box__icon--collapsed{transform:rotate(0deg) translate(-14%, 0px)}.collapsible-box__title--icon-right{flex-direction:row-reverse}.collapsible-box__title--icon-right .collapsible-box__icon{transform:rotate(90deg) translate(0px, -14%)}.collapsible-box__title--icon-right .collapsible-box__icon--collapsed{transform:rotate(0deg) translate(14%, 0px)}.collapsible-box__title--icon-right .collapsible-box__label{margin-left:0px;margin-right:6px}.collapsible-box__title--left{margin-right:auto}.collapsible-box__title--right{margin-left:auto}.collapsible-box__title--center{margin-left:auto;margin-right:auto}.collapsible-box__title--stretch{justify-content:space-between;width:100%}.collapsible-box__title--no-margin{margin-bottom:0}.collapsible-box__content{display:flex;flex-wrap:wrap;width:100%;height:0px;max-height:0px;opacity:0;overflow:hidden;transition:all var(--transition, 0.5s)}.collapsible-box__content--show{height:100%;max-height:none;opacity:1;overflow:visible;transition:all var(--transition, 0.5s)}.font--x-small{font-size:10px}.font--small{font-size:12px}.font--medium{font-size:14px}.font--large{font-size:16px}.font--x-large{font-size:20px}";export{a as ez_collapsible_box}