@sankhyalabs/ezui 1.2.0-beta.21 → 1.2.0-beta.22
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/CheckMode-ecb90b87.js +7 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-check.cjs.entry.js +10 -8
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -2
- package/dist/cjs/ez-combo-box.cjs.entry.js +9 -2
- package/dist/cjs/ez-form.cjs.entry.js +116 -3
- package/dist/cjs/ez-text-edit.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/ez-check/CheckMode.js +5 -0
- package/dist/collection/components/ez-check/ez-check.css +23 -23
- package/dist/collection/components/ez-check/ez-check.js +10 -8
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +8 -1
- package/dist/collection/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.js +2 -1
- package/dist/collection/utils/index.js +1 -1
- package/dist/custom-elements/index.js +137 -123
- package/dist/esm/CheckMode-bdb2ec19.js +7 -0
- package/dist/esm/ez-actions-button.entry.js +1 -1
- package/dist/esm/ez-check.entry.js +10 -8
- package/dist/esm/ez-collapsible-box.entry.js +1 -2
- package/dist/esm/ez-combo-box.entry.js +9 -2
- package/dist/esm/ez-form.entry.js +115 -2
- package/dist/esm/ez-text-edit.entry.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-dd257f17.entry.js → p-5bdb1a41.entry.js} +1 -1
- package/dist/ezui/p-659616e4.entry.js +1 -0
- package/dist/ezui/{p-6befd7e4.entry.js → p-77ec47ac.entry.js} +1 -1
- package/dist/ezui/p-ac1c0236.entry.js +1 -0
- package/dist/ezui/p-b853763b.js +1 -0
- package/dist/ezui/p-bd0c4789.entry.js +1 -0
- package/dist/ezui/p-e6971baf.entry.js +1 -0
- package/dist/types/components/ez-check/CheckMode.d.ts +4 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/FieldBuilder-cd3e45ed.js +0 -119
- package/dist/esm/FieldBuilder-9e9545fc.js +0 -117
- package/dist/ezui/p-4ad647fc.entry.js +0 -1
- package/dist/ezui/p-54ecd19a.js +0 -1
- package/dist/ezui/p-712bd293.entry.js +0 -1
- package/dist/ezui/p-d91527dc.entry.js +0 -1
- package/dist/ezui/p-e59adce6.entry.js +0 -1
package/dist/ezui/ezui.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as o}from"./p-3c7ea91b.js";(()=>{const o=import.meta.url,s={};return""!==o&&(s.resourcesUrl=new URL(".",o).href),e(s)})().then((e=>o([["p-72c75a43",[[6,"ez-grid",{multipleSelection:[4,"multiple-selection"],config:[1040],serverUrl:[1,"server-url"],dataUnit:[16],statusResolver:[16],_paginationInfo:[32],_popUpGridConfig:[32],setColumnsDef:[64],addColumnMenuItem:[64],setColumnsState:[64],setData:[64],getSelection:[64],getColumnsState:[64],getColumns:[64],quickFilter:[64],closeGridConfig:[64],openGridConfig:[64]}]]],["p-
|
|
1
|
+
import{p as e,b as o}from"./p-3c7ea91b.js";(()=>{const o=import.meta.url,s={};return""!==o&&(s.resourcesUrl=new URL(".",o).href),e(s)})().then((e=>o([["p-72c75a43",[[6,"ez-grid",{multipleSelection:[4,"multiple-selection"],config:[1040],serverUrl:[1,"server-url"],dataUnit:[16],statusResolver:[16],_paginationInfo:[32],_popUpGridConfig:[32],setColumnsDef:[64],addColumnMenuItem:[64],setColumnsState:[64],setData:[64],getSelection:[64],getColumnsState:[64],getColumns:[64],quickFilter:[64],closeGridConfig:[64],openGridConfig:[64]}]]],["p-77ec47ac",[[1,"ez-actions-button",{enabled:[516],actions:[1040],size:[513],showLabel:[516,"show-label"],iconName:[513,"icon-name"],checkOption:[516,"check-option"],value:[513],isTransparent:[516,"is-transparent"],arrowActive:[516,"arrow-active"],_selectedAction:[32],hideActions:[64],isOpened:[64]}]]],["p-3987f8d8",[[1,"ez-dialog",{confirm:[1028],dialogType:[1025,"dialog-type"],message:[1025],opened:[1540],personalizedIconPath:[1025,"personalized-icon-path"],ezTitle:[1025,"ez-title"],handleButtonClick:[64],show:[64]}]]],["p-43bb6a59",[[1,"ez-filter-input",{label:[1],value:[1537],enabled:[4],loading:[516],errorMessage:[1537,"error-message"],restrict:[1],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-86daa81a",[[6,"ez-modal-container",{modalTitle:[1,"modal-title"],modalSubTitle:[1,"modal-sub-title"],cancelButtonLabel:[1,"cancel-button-label"],okButtonLabel:[1,"ok-button-label"],cancelButtonStatus:[1,"cancel-button-status"],okButtonStatus:[1,"ok-button-status"]}]]],["p-3c87845d",[[1,"ez-chip",{label:[513],enabled:[516],removePosition:[513,"remove-position"],mode:[513],value:[1540],setFocus:[64],setBlur:[64]}]]],["p-1cc11468",[[0,"ez-application"]]],["p-fe75f477",[[1,"ez-card-item",{item:[16]}]]],["p-ed2135a5",[[1,"ez-loading-bar",{_showLoading:[32],hide:[64],show:[64]}]]],["p-bffae598",[[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"],updatePosition:[64],show:[64],hide:[64]}]]],["p-f36dbc21",[[1,"ez-popup",{size:[1],opened:[1540],useHeader:[1540,"use-header"],heightMode:[1537,"height-mode"],ezTitle:[1,"ez-title"]}]]],["p-be06251d",[[1,"ez-radio-button",{value:[1544],options:[1040],enabled:[516],label:[513],direction:[1537]}]]],["p-e3ee814c",[[1,"ez-scroller",{direction:[1]},[[2,"click","clickListener"],[1,"mousedown","mouseDownHandler"],[1,"mouseup","mouseUpHandler"],[1,"mousemove","mouseMoveHandler"]]]]],["p-b4ad3b15",[[1,"ez-toast",{message:[1025],fadeTime:[1026,"fade-time"],useIcon:[1028,"use-icon"],canClose:[1028,"can-close"],show:[64]}]]],["p-0c7203d5",[[0,"ez-view-stack",{show:[64],getSelectedIndex:[64]}]]],["p-bca406db",[[2,"ez-grid-config",{selectedTab:[1025,"selected-tab"],columns:[1040],config:[1040]}]]],["p-659616e4",[[1,"ez-collapsible-box",{value:[1540],label:[513],headerSize:[513,"header-size"],iconPlacement:[513,"icon-placement"],stretchTitle:[516,"stretch-title"],removable:[516],editable:[516],conditionalSave:[16],_activeEditText:[32],showHide:[64],applyFocusTextEdit:[64],cancelEdition:[64]}]]],["p-56688470",[[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-63d567cc",[[1,"ez-calendar",{value:[1040],floating:[516],time:[516],showSeconds:[516,"show-seconds"],show:[64],fitVertical:[64],hide:[64]}]]],["p-2ccad880",[[1,"ez-text-input",{label:[513],value:[1537],enabled:[516],loading:[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-e230bfd2",[[1,"ez-date-input",{label:[513],value:[1040],enabled:[516],errorMessage:[1537,"error-message"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-e1f2b5da",[[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-744eb735",[[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-5a1927a2",[[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-7c227b86",[[1,"ez-modal",{modalSize:[1,"modal-size"],align:[1],opened:[1028],closeEsc:[4,"close-esc"],closeOutsideClick:[4,"close-outside-click"]}]]],["p-e697ffd5",[[1,"ez-text-area",{label:[513],value:[1537],enabled:[516],loading:[516],errorMessage:[1537,"error-message"],rows:[1538],canShowError:[516,"can-show-error"],mode:[513],setFocus:[64],setBlur:[64],isInvalid:[64]}]]],["p-b706619e",[[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-5bdb1a41",[[1,"ez-text-edit",{value:[1],styled:[16],_newValue:[32],applyFocusSelect:[64]}]]],["p-802d23d9",[[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-2cc6dd66",[[1,"ez-tabselector",{selectedIndex:[1538,"selected-index"],selectedTab:[1537,"selected-tab"],tabs:[1]}]]],["p-bd0c4789",[[1,"ez-check",{label:[513],value:[1540],enabled:[1540],mode:[513],getMode:[64],setFocus:[64]}]]],["p-ec9decf2",[[1,"ez-icon",{size:[513],href:[513],iconName:[513,"icon-name"]}]]],["p-ac1c0236",[[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-9b1700f7",[[1,"ez-select-box",{selectedOption:[1,"selected-option"]}]]],["p-333d79c4",[[1,"ez-button",{label:[513],enabled:[516],mode:[513],image:[513],iconName:[513,"icon-name"],size:[513],setFocus:[64],setBlur:[64]}]]],["p-e6971baf",[[0,"ez-form",{dataUnit:[1040],config:[16],recordsValidator:[16],submit:[64],cancel:[64],validate:[64]}]]]],e)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,H as e}from"./p-3c7ea91b.js";import{StringUtils as n}from"@sankhyalabs/core";import{A as o}from"./p-0b44cf1c.js";import"./p-e1148f5c.js";import"./p-
|
|
1
|
+
import{r as t,c as i,h as s,H as e}from"./p-3c7ea91b.js";import{StringUtils as n}from"@sankhyalabs/core";import{A as o}from"./p-0b44cf1c.js";import"./p-e1148f5c.js";import"./p-b853763b.js";let l=class{constructor(s){t(this,s),this.saveEdition=i(this,"saveEdition",7),this.cancelEdition=i(this,"cancelEdition",7)}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||n.isEmpty(this._newValue)?this._newValue?this.cancelEdition.emit():o.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 s(e,null,s("span",{class:"text-edit__hidden-value",ref:t=>this._valueBasis=t}),s("ez-text-input",{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()}}))}};l.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{l as ez_text_edit}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,c as l,h as e,g as o}from"./p-3c7ea91b.js";import{A as t}from"./p-0b44cf1c.js";import"./p-e1148f5c.js";import"./p-b853763b.js";let s=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.headerSize="small",this.iconPlacement="left",this.stretchTitle=!1,this.removable=!1,this.editable=!1}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(),t.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")}}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"+("right"===this.iconPlacement?" collapsible-box__title--icon-right":"")+(this.stretchTitle?" collapsible-box__title--stretched":"")+(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":"")}),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"]}}};s.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--stretched{width:100%;justify-content:space-between}.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{s as ez_collapsible_box}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as o,H as n,g as s}from"./p-3c7ea91b.js";import{FloatingManager as a}from"@sankhyalabs/core";import"./p-0b44cf1c.js";import{C as e}from"./p-4a5e37a7.js";import"./p-e1148f5c.js";import"./p-
|
|
1
|
+
import{r as t,c as i,h as o,H as n,g as s}from"./p-3c7ea91b.js";import{FloatingManager as a}from"@sankhyalabs/core";import"./p-0b44cf1c.js";import{C as e}from"./p-4a5e37a7.js";import"./p-e1148f5c.js";import"./p-b853763b.js";let r=class{constructor(o){t(this,o),this.ezAction=i(this,"ezAction",7),this.enabled=!0,this.showLabel=!1,this.checkOption=!1,this.isTransparent=!1,this.arrowActive=!1,this.innerClickCheck=(t,i)=>{var o;if(i&&t){if(i===t)return!0;const n=t.children;for(let t=0;t<n.length;t++)if(null===(o=n[t].shadowRoot)||void 0===o?void 0:o.contains(i))return!0}return!1}}async hideActions(){null!=this._floatingID&&a.close(this._floatingID),this._floatingID=void 0}async isOpened(){return null!=this._floatingID}showActions(){var t,i;if(!this.enabled)return;const o=null===(t=this._element)||void 0===t?void 0:t.getBoundingClientRect();let n=o?o.x-(this.arrowActive?5:0)+"px":null,s={autoClose:!0,innerClickTest:this.innerClickCheck,isFixed:!0,left:n};this._floatingID=a.float(this._actionsList,this._listContainer,s);const e=document.body.clientWidth,r=null===(i=this._actionsList)||void 0===i?void 0:i.getBoundingClientRect();(null==r?void 0:r.right)>e&&(n=e-r.width+"px",s={autoClose:!0,innerClickTest:this.innerClickCheck,left:n},a.updateFloatPosition(this._actionsList,this._listContainer,s)),window.requestAnimationFrame((()=>{this._actionsList.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}))}hasLabelOrCheckOption(){var t;return(this.showLabel||this.checkOption)&&(null===(t=this.actions)||void 0===t?void 0:t.length)>0}handlerButtonClick(){this.showActions()}actionClick(t){this._selectedAction=t,this.hideActions(),this.ezAction.emit(t)}componentWillLoad(){if(null==this.actions){this.actions=[];const t=this._element.querySelectorAll("action");t&&t.forEach((t=>{let i=t.innerText,o=t.getAttribute("value");o||(o=i),this.actions.push({label:i,value:o}),t.hidden=!0}))}}componentDidLoad(){e.applyVarsButton(this._element,this._button)}componentDidRender(){null==this._floatingID&&this._actionsList.remove(),this.hasLabelOrCheckOption()&&(this.value?this._selectedAction=this.actions.find((t=>t.value===this.value)):this._selectedAction||(this._selectedAction=this.actions[0]))}render(){var t;return o(n,null,o("ez-button",{ref:t=>this._button=t,class:this.isTransparent?"ez-actions-button__btn-transparent":"",label:this.showLabel&&(null===(t=this._selectedAction)||void 0===t?void 0:t.label),enabled:this.enabled,mode:this.showLabel?"":"icon",iconName:this.showLabel?"":this.iconName||"dots-vertical",size:this.size,onClick:()=>this.handlerButtonClick()},this.showLabel&&o("ez-icon",{class:"ez-actions-button__icon-left",slot:"rightIcon",iconName:this.iconName||"dots-vertical"})),o("section",{class:"ez-actions-button__list-container",ref:t=>this._listContainer=t},o("div",{class:"ez-actions-button__actions-list",ref:t=>this._actionsList=t},this.arrowActive&&o("div",{class:"ez-actions-button__arrow"}),this.actions.map((t=>{var i;return o("ez-button",{class:"ez-actions-button__btn-action",size:"small",label:t.label,onClick:()=>this.actionClick(t)},this.checkOption&&(null===(i=this._selectedAction)||void 0===i?void 0:i.value)===t.value&&o("ez-icon",{class:"ez-actions-button__icon-right",slot:"leftIcon",iconName:"check"}))})))))}get _element(){return s(this)}};r.style=":host{--ez-actions-button__actions-list--border-radius:var(--border--radius-medium, 12px);--ez-actions-button__actions-list--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-actions-button__actions-list--background-color:var(--background--xlight, #fff);--ez-actions-button__actions-list--padding:var(--space-small, 6px);--ez-actions-button__actions-list--top-margin:var(--space-extra-small, 3px);--ez-actions-button__btn-action--min-width:400px;--ez-actions-button__btn-action--background-color:var(--background--xlight, #fff);display:flex;flex-direction:column;height:fit-content;user-select:none}.ez-actions-button__actions-list{display:flex;flex-direction:column;position:fixed;width:fit-content;height:fit-content;z-index:var(--more-visible, 2);padding:var(--ez-actions-button__actions-list--padding);margin-top:var(--ez-actions-button__actions-list--top-margin);background-color:var(--ez-actions-button__actions-list--background-color);border-radius:var(--ez-actions-button__actions-list--border-radius);box-shadow:var(--ez-actions-button__actions-list--box-shadow)}.ez-actions-button__btn-action{--ez-button--min-width:var(--ez-actions-button__btn-action--min-width);--ez-button--background-color:var(--ez-actions-button__btn-action--background-color)}.ez-actions-button__icon-left{margin-left:var(--space-small, 6px)}.ez-actions-button__icon-right{margin-right:var(--space-small, 6px)}.ez-actions-button__btn-transparent{--ez-button--background-color:transparent;--ez-button--hover--background-color:transparent;--ez-button--active--background-color:transparent;--ez-button--focus--border:none}.ez-actions-button__arrow{position:absolute;top:-13px;left:10px;border-left:10px solid transparent;border-right:10px solid transparent;border-bottom:15px solid var(--ez-actions-button__btn-action--background-color);width:0;height:0}";export{r as ez_actions_button}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o,c as i,h as t,H as s,g as e}from"./p-3c7ea91b.js";import{FloatingManager as r}from"@sankhyalabs/core";import{A as a}from"./p-0b44cf1c.js";import{C as l}from"./p-4a5e37a7.js";import"./p-e1148f5c.js";import"./p-b853763b.js";let n=class{constructor(t){o(this,t),this.ezChange=i(this,"ezChange",7),this._changeDeboucingTimeout=null,this._limitCharsToSearch=3,this._deboucingTime=300,this._maxWidthValue=0,this._tabPressed=!1,this._textEmptyList="Nenhum resultado encontrado",this._startLoading=!1,this._showLoading=!0,this.enabled=!0,this.showSelectedValue=!1,this.showOptionValue=!1,this.suppressSearch=!1,this.suppressEmptyOption=!1,this.canShowError=!0,this.mode="regular"}observeErrorMessage(){var o;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(o=this.errorMessage)||void 0===o?void 0:o.trim())||this.setInputValue())}observeValue(o,i){var t,s,e,r;if(this._textInput&&o!=i){const a=this.getSelectedOption(o),l=this.getSelectedOption(i),n=this.getSelectedOption(this.value);(null===(t=null==n?void 0:n.value)||void 0===t?void 0:t.toString())!=(null===(s=null==a?void 0:a.value)||void 0===s?void 0:s.toString())&&(this.value=a),(null===(e=null==a?void 0:a.value)||void 0===e?void 0:e.toString())!==(null===(r=null==l?void 0:l.value)||void 0===r?void 0:r.toString())&&(this.setInputValue(),this.ezChange.emit(null===a?void 0:a)),this.hideOptions(),this._criteria=void 0,this._preSelection=void 0,this.updateVisibleOptions()}}async setFocus(){this._textInput.setFocus()}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}getText(){let o="";const i=this.getSelectedOption(this.value);if(i&&(o=this.showSelectedValue?`${i.value} - ${i.label}`:i.label),null!=o)return String(o).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')}getSelectedOption(o){return"string"==typeof o||o instanceof String?this._visibleOptions.find((i=>i.value===o)):o}updateVisibleOptions(){let o=this._source||[];if(!this.searchMode&&this._criteria){const i=this._criteria.toUpperCase();o=o.filter((o=>o.label.toLocaleUpperCase().indexOf(i)>-1))}this._visibleOptions=this.suppressEmptyOption?o:[{value:void 0,label:""}].concat(o),this._maxWidthValue=this.getMaxWidthValue()}getMaxWidthValue(){var o;if(this.showOptionValue){const i=[];return null===(o=this._visibleOptions)||void 0===o||o.forEach((o=>{const t=this.getWidthValue(o.value);i.includes(t)||i.push(t)})),i.length>1?Math.max(...i):0}return 0}getWidthValue(o){if(null!=this._itemValueBasis){const i=this._itemValueBasis;if(null!=o)return i.innerHTML=o,i.clientWidth>0?i.clientWidth+2:0;i.innerHTML=""}return 0}buildItem(o,i){const s=this.showOptionValue&&this._maxWidthValue>0?`${this._maxWidthValue}px`:"";return t("li",{class:i===this._preSelection?"item preselected":"item",id:`item_${o.value}`,onMouseDown:()=>this.selectOption(o),onMouseOver:()=>this._preSelection=void 0},this.showOptionValue?t("span",{class:"item__value",title:o.value,style:{width:s,minWidth:s,maxWidth:s}},o.value):void 0,t("span",{class:"item__label",title:o.label},o.label))}showOptions(){this.enabled&&(this._floatingID=r.float(this._listWrapper,this._listContainer,{autoClose:!0,top:this.errorMessage||!this.canShowError||"slim"===this.mode?"0px":"-19px"}),window.requestAnimationFrame((()=>{this._listWrapper.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})))}hideOptions(){void 0!==this._floatingID&&r.close(this._floatingID),this._floatingID=void 0}isOptionsVisible(){return void 0!==this._floatingID&&r.isFloating(this._floatingID)}nextOption(){this.searchMode&&!this.isOptionsVisible()||(this.showOptions(),this._preSelection=void 0===this._preSelection?0:Math.min(this._preSelection+1,this._visibleOptions.length-1),this.scrollToOption(this._visibleOptions[this._preSelection],!0))}previousOption(){this._preSelection=void 0===this._preSelection?0:Math.max(this._preSelection-1,0),this.scrollToOption(this._visibleOptions[this._preSelection],!1)}scrollToOption(o,i){window.requestAnimationFrame((()=>{const t=this._optionsList.querySelector(`li#item_${o.value}`);if(t){const o=t.parentElement,s=o.getBoundingClientRect(),e=t.getBoundingClientRect();i&&e.bottom>s.bottom?o.scrollTop=e.top:!i&&e.top<s.top&&(o.scrollTop=0)}}))}selectCurrentOption(){void 0!==this._preSelection?(this.selectOption(this._visibleOptions[this._preSelection]),this._preSelection=void 0):this.controlListWithOnlyOne()}updateSource(o){this._startLoading=!1,o instanceof Promise?(this._showLoading=!0,o.then((o=>{this._showLoading=!1,this.updateSource(o)})).catch((()=>this._showLoading=!1)),this.updateVisibleOptions()):(this._showLoading=!1,Array.isArray(o)?(this._source=o,this.updateVisibleOptions(),this._tabPressed&&(this._tabPressed=!1,this.controlEmptySearch())):this.selectOption(o))}clearSource(){this._source=[],this.updateVisibleOptions()}selectOption(o){var i,t;const s=this.getSelectedOption(this.value);(null===(i=null==s?void 0:s.value)||void 0===i?void 0:i.toString())!==(null===(t=null==o?void 0:o.value)||void 0===t?void 0:t.toString())?this.value=(null==o?void 0:o.value)?o:void 0:(this.setInputValue(),this.hideOptions()),this.searchMode&&(this._visibleOptions=[]),this.searchMode&&(this._visibleOptions=[])}loadOptions(o,i=""){this._criteria=i,this._startLoading=!0,this.updateSource(this.optionLoader?this.optionLoader({mode:o,argument:i}):this.options)}cancelPreselection(){!this._textInput.value&&this.value?this.selectOption(void 0):this.setInputValue()}setInputValue(o=!0){const i=this.getText();(this._textInput.value||"")!==i&&(this._textInput.value=i,o&&(this.errorMessage=""))}clearSearch(){this.value=null}controlListWithOnlyOne(){if(this.searchMode){const o=this._visibleOptions;1===(null==o?void 0:o.length)&&this.selectOption(o[0])}}controlEmptySearch(){var o;this.searchMode&&((null===(o=this._visibleOptions)||void 0===o?void 0:o.length)?this.controlListWithOnlyOne():(this.clearSearch(),a.info(this._textEmptyList)))}componentWillLoad(){if(void 0===this.options){this.options=[];const o=this.el.querySelectorAll("option");o&&o.forEach((o=>{let i=o.innerText,t=o.getAttribute("value");t||(t=i),this.options.push({label:i,value:t}),o.hidden=!0}))}this.searchMode?this.updateSource([]):this.loadOptions(h.PRELOAD)}componentDidRender(){void 0===this._floatingID&&this._listWrapper.remove()}componentDidLoad(){l.applyVarsTextInput(this.el,this._textInput),this.setInputValue(!1)}handlerIconClick(){this.searchMode?this.loadOptions(h.ADVANCED):this.showOptions()}onTextInputChangeHandler(o){var i;if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=window.setTimeout((()=>{this.onTextInputChangeHandler(o)}),this._deboucingTime));const t=null===(i=o.target.value)||void 0===i?void 0:i.trim(),s=Number(t||void 0);this._criteria||(this._textInput.value=o.data||t),this._criteria=t,t&&(!isNaN(s)||t.length>=this._limitCharsToSearch)?(this.searchMode?(this._showLoading=!0,this.clearSource(),this._changeDeboucingTimeout=window.setTimeout((()=>{this.loadOptions(h.PREDICTIVE,isNaN(s)?t:s.toString())}),this._deboucingTime)):this.updateVisibleOptions(),this.showOptions()):this.hideOptions()}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(window.clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=void 0)}onTextInputClickHandler(){this.searchMode||this.showOptions()}keyDownHandler(o){switch(this._tabPressed=!1,o.ctrlKey&&("f"!==o.key&&"F"!==o.key||(this.loadOptions(h.ADVANCED),o.stopPropagation(),o.stopImmediatePropagation(),o.preventDefault())),o.key){case"ArrowDown":this.nextOption();break;case"ArrowUp":this.previousOption();break;case"Enter":this.selectCurrentOption();break;case"Escape":this.cancelPreselection();break;case"Tab":this._tabPressed=!0,this.controlListWithOnlyOne()}}onTextInputFocusOutHandler(){this.cancelPreselection()}render(){var o;return t(s,null,t("ez-text-input",{class:this.suppressSearch?"suppressed-search-input":"",ref:o=>this._textInput=o,"data-slave-mode":"true",enabled:this.enabled&&!this.suppressSearch,onInput:o=>this.onTextInputChangeHandler(o),onClick:()=>this.onTextInputClickHandler(),onFocusout:()=>this.onTextInputFocusOutHandler(),onKeyDown:o=>this.keyDownHandler(o),label:this.label,canShowError:this.canShowError,errorMessage:this.errorMessage,mode:this.mode},t("button",{class:"btn",slot:this.searchMode?"leftIcon":"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.handlerIconClick()},t("ez-icon",{iconName:this.searchMode?"search":"chevron-down"})),this.searchMode&&(null===(o=this._textInput)||void 0===o?void 0:o.value)&&(this._criteria||this.value)?t("button",{class:"btn btn__close",slot:"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.clearSearch()},t("ez-icon",{iconName:"close"})):void 0),t("section",{class:"list-container",ref:o=>this._listContainer=o},t("div",{class:"list-wrapper",ref:o=>this._listWrapper=o},t("div",{class:"list-options",ref:o=>this._optionsList=o},0===this._visibleOptions.length&&t("div",{class:"message"},!this._showLoading&&t("span",{class:"message__no-result"},this._textEmptyList),this._showLoading&&t("div",{class:"message__loading"})),this.showOptionValue?t("span",{class:"item__value item__value--hidden",ref:o=>this._itemValueBasis=o}):void 0,this._visibleOptions.length>0&&this._visibleOptions.map(((o,i)=>this.buildItem(o,i)))))))}get el(){return e(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],value:["observeValue"]}}};var h;!function(o){o.ADVANCED="ADVANCED",o.PRELOAD="PRELOAD",o.PREDICTIVE="PREDICTIVE"}(h||(h={})),n.style=":host{--ez-combo-box--height:42px;--ez-combo-box--width:100%;--ez-combo-box__icon--width:48px;--ez-combo-box--border-radius:var(--border--radius-medium, 12px);--ez-combo-box--border-radius-small:var(--border--radius-small, 6px);--ez-combo-box--font-size:var(--text--medium, 14px);--ez-combo-box--font-family:var(--font-pattern, Arial);--ez-combo-box--font-weight--large:var(--text-weight--large, 500);--ez-combo-box--font-weight--medium:var(--text-weight--medium, 400);--ez-combo-box--background-color--xlight:var(--background--xlight, #fff);--ez-combo-box--background-medium:var(--background--medium, #f0f3f7);--ez-combo-box__input--background-color:var(--background--medium, #e0e0e0);--ez-combo-box__input--border:var(--border--medium, 2px solid);--ez-combo-box__input--border-color:var(--ez-combo-box__input--background-color);--ez-combo-box__input--focus--border-color:var(--color--primary, #008561);--ez-combo-box__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-combo-box__input--disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__input--error--border-color:#CC2936;--ez-combo-box__btn--color:var(--title--primary, #2B3A54);--ez-combo-box__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-hover--color:var(--color--primary, #4e4e4e);--ez-combo-box__label--color:var(--title--primary, #2B3A54);--ez-combo-box__list-title--primary:var(--title--primary, #2B3A54);--ez-combo-box__list-text--primary:var(--text--primary, #626e82);--ez-combo-box__list-height:calc(var(--ez-combo-box--font-size) + var(--ez-combo-box--space--medium));--ez-combo-box--space--medium:var(--space--medium, 12px);--ez-combo-box--space--small:var(--space--small, 6px);--ez-combo-box__list-scrollbar--background-color-primary:var(--scrollbar--primary, #2B3A54);--ez-combo-box__list-scrollbar--background-color-secondary:var(--scrollbar--secondary, #E5EAF0);--ez-combo-box__list-scrollbar--border-radius:var(--border--radius-small, 6px);--ez-combo-box__list-scrollbar--width:var(--space--medium, 12px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-combo-box--width)}ez-icon{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.suppressed-search-input{--ez-text-input__input--border-color:var(--color--strokes, #dce0e8);--ez-text-input__input--disabled--background-color:var(--background--xlight, #fff);--ez-text-input__input--disabled--color:var(--title--primary, #2B3A54)}.list-container{position:relative;width:100%}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:100%;z-index:var(--more-visible, 2);max-height:calc(4*var(--ez-combo-box__list-height) + 2*var(--ez-combo-box--space--small));background-color:var(--ez-combo-box--background-color--xlight);border-radius:var(--ez-combo-box--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);padding:var(--ez-combo-box--space--small)}.list-options{box-sizing:border-box;width:100%;height:100%;display:flex;flex-direction:column;scroll-behavior:smooth;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--ez-combo-box__list-scrollbar--background-color-primary) var(--ez-combo-box__list-scrollbar--background-color-secondary)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-combo-box__list-scrollbar--background-color-secondary);border-radius:var(--ez-combo-box__list-scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-combo-box__list-scrollbar--background-color-primary);border-radius:var(--ez-combo-box__list-scrollbar--border-radius)}.list-options::-webkit-scrollbar{background-color:var(--ez-combo-box__list-scrollbar--background-color-secondary);width:var(--ez-combo-box__list-scrollbar--width);max-width:var(--ez-combo-box__list-scrollbar--width);min-width:var(--ez-combo-box__list-scrollbar--width)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-combo-box--border-radius-small);padding:0 var(--ez-combo-box--space--small);min-height:var(--ez-combo-box__list-height);gap:var(--space--small, 6px)}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-combo-box__list-title--primary);font-weight:var(--ez-combo-box--font-weight--large);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size)}.item__value{text-align:center;color:var(--ez-combo-box__list-text--primary)}.item__value--hidden{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}.item__label{text-align:left}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;min-height:calc(var(--ez-combo-box__list-height) * 1.5)}.message__no-result{color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size)}.message__loading{border-radius:50%;width:16px;height:16px;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:3px solid var(--ez-combo-box__list-title--primary);border-top:3px solid transparent}li:hover{background-color:var(--ez-combo-box--background-medium)}.preselected{background-color:var(--background--medium)}.btn{outline:none;border:none;background:none;cursor:pointer;color:var(--ez-combo-box__btn--color)}.btn:disabled{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:disabled:hover{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:hover{color:var(--ez-combo-box__btn-hover--color)}.btn__close{visibility:hidden}ez-text-input:hover .btn__close,ez-text-input:focus .btn__close{visibility:visible}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";export{n as ez_combo_box}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a;!function(a){a.REGULAR="REGULAR",a.SWITCH="SWITCH"}(a||(a={}));export{a as C}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as r,h as o,H as c}from"./p-3c7ea91b.js";import{C as a}from"./p-b853763b.js";let i=class{constructor(o){e(this,o),this.ezChange=r(this,"ezChange",7),this.enabled=!0,this.mode=a.REGULAR}observeMode(){var e;(null===(e=this.mode)||void 0===e?void 0:e.toUpperCase())===a.SWITCH?(this._inputElem.classList.remove("regular-mode"),this._inputElem.classList.add("switch-mode")):(this._inputElem.classList.remove("switch-mode"),this._inputElem.classList.add("regular-mode"))}async getMode(){return this.mode}async setFocus(){this._inputElem.focus()}componentDidLoad(){this.observeMode()}changeValue(){this.enabled&&(this.value=!this.value,this.ezChange.emit(this.value))}getLabelClasses(){let e="label";return this.enabled||(e+=" label--disabled"),e}render(){return o(c,null,o("input",{type:"checkbox",class:"regular-mode",checked:!0===this.value,onChange:()=>{this.changeValue()},disabled:!this.enabled,ref:e=>this._inputElem=e}),this.label?o("label",{class:this.getLabelClasses(),onClick:()=>{this.changeValue()},title:this.label},this.label):void 0)}static get watchers(){return{mode:["observeMode"]}}};i.style=':host{--ez-check--box--width:18px;--ez-check--box--height:18px;--ez-check--width:calc(var(--ez-check--box--width) + 14px);--ez-check--height:calc(var(--ez-check--box--width) + 14px);--ez-check--border-radius:var(--border--radius-small);--ez-check--checked--background-color:var(--color--primary-200);--ez-check--focus--background-color:var(--color--strokes, #FFFFFF);--ez-check--hover--background-color:var(--background--medium);--ez-check--checked--disabled--background-color:var(--color--disable-secondary);--ez-check--border:var(--border--medium) var(--title--primary);--ez-check--disabled--border:var(--border--medium) var(--color--strokes);--ez-check--checked--border:var(--border--medium) var(--color--primary);--ez-check--checked--hover--background-color:var(--color--primary-200);--ez-check--checked--focus--background-color:var(--color--primary-300, #FFFFFF);--ez-check--check--image:url(\'data:image/svg+xml;utf8,<svg width="8" height="7" viewBox="0 0 8 7" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M7.70002 0.398999L7.48502 0.207997C7.31524 0.0598858 7.09376 -0.0150438 6.86894 -0.000430025C6.64411 0.0141838 6.43419 0.117153 6.28502 0.285997L2.70002 4.332L1.61802 3.384C1.44837 3.23576 1.22697 3.16067 1.00214 3.17509C0.77732 3.18952 0.567332 3.2923 0.418019 3.461L0.229019 3.674C0.0752361 3.84797 -0.00437434 4.07521 0.00721192 4.30713C0.0187982 4.53904 0.120661 4.75722 0.291019 4.915L2.27402 6.762C2.35832 6.8432 2.45842 6.90618 2.56811 6.94702C2.67779 6.98787 2.79471 7.00571 2.91159 6.99942C3.02846 6.99314 3.14279 6.96287 3.24747 6.91049C3.35214 6.85812 3.44492 6.78477 3.52002 6.695L7.79102 1.638C7.94063 1.46048 8.01486 1.23149 7.99786 0.999963C7.98085 0.768436 7.87396 0.552749 7.70002 0.398999Z"/></svg>\');--ez-check--check--background-color:var(--color--primary);--ez-check--check--disabled--background-color:var(--color--strokes);--ez-switch--slider--width:34px;--ez-switch--slider--height:14px;--ez-switch--pin--width:19px;--ez-switch--pin--height:19px;--ez-switch--focus--width:32px;--ez-switch--focus--height:32px;--ez-switch--background-color:var(--color--strokes);--ez-switch--disabled--background-color:var(--color--disable-secondary);--ez-switch--disabled--checked--background-color:var(--color--primary-300);--ez-switch--checked--background-color:var(--color--primary);--ez-switch--pin--background-color:var(--background--xlight);--ez-switch--pin--disabled--background-color:var(--color--disable-primary);--ez-switch--pin--checked--background-color:var(--background--xlight);--ez-switch--pin--checked--disabled--background-color:#E8F7F4;--ez-switch--pin--focus--background-color:var(--text--disable);--ez-switch--pin--checked--focus--background-color:var(--color--primary);--ez-switch--pin--border-color:var(--text--primary);--ez-switch--pin--disabled--border-color:var(--text--secondary);--ez-check--label--font-size:var(--text--medium, 14px);--ez-check--label--font-family:var(--font-pattern, Arial);--ez-check--label--color:var(--title--primary, #000);--ez-check--label--disabled--color:var(--text--disable, #AFB6C0);display:flex;width:100%;align-items:center;margin:0}input.regular-mode{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;box-sizing:border-box;-webkit-appearance:none;appearance:none;cursor:pointer;border-radius:50%;position:relative;width:var(--ez-check--width);height:var(--ez-check--height)}input.regular-mode:enabled:hover{background-color:var(--ez-check--hover--background-color)}input.regular-mode:enabled:focus{outline:none;background-color:var(--ez-check--focus--background-color)}input.regular-mode:disabled{cursor:auto;background:none}input.regular-mode::before{box-sizing:border-box;content:"";display:block;width:var(--ez-check--box--width);height:var(--ez-check--box--height);border-radius:var(--ez-check--border-radius);border:var(--ez-check--border)}input.regular-mode:disabled::before{border:var(--ez-check--disabled--border)}input.regular-mode:checked:enabled:hover{background-color:var(--ez-check--checked--hover--background-color)}input.regular-mode:checked:enabled:focus{background-color:var(--ez-check--checked--focus--background-color)}input.regular-mode:checked::before{border:var(--ez-check--checked--border);background-color:var(--ez-check--checked--background-color)}input.regular-mode:checked:disabled:before{border:var(--ez-check--disabled--border);background-color:var(--ez-check--checked--disabled--background-color)}input.regular-mode:checked::after{display:flex;position:absolute;content:"";background-color:var(--ez-check--check--background-color);width:8px;height:7px;-webkit-mask-image:var(--ez-check--check--image);mask-image:var(--ez-check--check--image)}input.regular-mode:checked:disabled::after{background-color:var(--ez-check--check--disabled--background-color)}input.switch-mode{flex-shrink:0;-webkit-appearance:none;appearance:none;position:relative;outline:none;cursor:pointer;border-radius:20px;border:var(--border--small, 1px solid) var(--ez-switch--pin--border-color, #626e82);transition:background-color var(--transition);width:var(--ez-switch--slider--width);height:var(--ez-switch--slider--height);background-color:var(--ez-switch--background-color)}input.switch-mode:disabled{background-color:var(--ez-switch--disabled--background-color);border:var(--border--small, 1px solid) var(--ez-switch--pin--disabled--border-color, #a2abb9)}input.switch-mode:checked:disabled{background-color:var(--ez-switch--disabled--checked--background-color)}input.switch-mode::after{content:"";display:block;position:absolute;box-shadow:var(--shadow);transition:transform var(--transition);transition:background-color var(--transition);transition:border-color var(--transition);transform:translateX(-2px) translateY(-4px);border-radius:50%;border:var(--border--small, 1px solid) var(--ez-switch--pin--border-color, #626e82);width:var(--ez-switch--pin--width);height:var(--ez-switch--pin--height);background-color:var(--ez-switch--pin--background-color)}input.switch-mode:disabled::after{background-color:var(--ez-switch--pin--disabled--background-color);border:var(--border--small, 1px solid) var(--ez-switch--pin--disabled--border-color, #a2abb9)}input.switch-mode:checked{transition:background-color var(--transition), border var(--transition);background-color:var(--ez-switch--checked--background-color);border:var(--border--small, 1px solid) var(--color--primary, #008561)}input.switch-mode::before{display:block;content:"";display:block;position:absolute;border-radius:50%;opacity:0;width:var(--ez-switch--focus--width);height:var(--ez-switch--focus--height);top:calc((var(--ez-switch--slider--height) - var(--ez-switch--focus--height)) / 2);left:calc((var(--ez-switch--pin--width) - var(--ez-switch--focus--width) - 2px) / 2);background-color:var(--ez-switch--pin--focus--background-color)}input.switch-mode:focus::before{opacity:0.24;transition:opacity var(--transition)}input.switch-mode:checked:focus::before{background-color:var(--ez-switch--pin--checked--focus--background-color);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width) + 2px))}input.switch-mode:checked::after{transition:transform var(--transition);transition:background-color var(--transition);transition:border-color var(--transition);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width))) translateY(-4px);box-shadow:var(--shadow);background-color:var(--ez-switch--pin--checked--background-color);border:var(--border--small, 1px solid) var(--color--primary, #008561)}input.switch-mode:checked:disabled::after{background-color:var(--ez-switch--pin--checked--disabled--background-color)}.label{flex-shrink:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-check--label--color);text-shadow:var(--text-shadow);font-size:var(--ez-check--label--font-size);font-family:var(--ez-check--label--font-family);cursor:default;padding-left:var(--space--small)}.label--disabled{color:var(--ez-check--label--disabled--color)}';export{i as ez_check}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e,r as t,c as i,f as n,H as s,g as r}from"./p-3c7ea91b.js";import{UserInterface as a,Action as o,WaitingChangeException as l,ApplicationContext as c,DateUtils as d,DataUnitAction as h,DataUnit as u}from"@sankhyalabs/core";import{C as f}from"./p-b853763b.js";import{A as p}from"./p-0b44cf1c.js";import"./p-e1148f5c.js";const b=({name:t,label:i,readOnly:n})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-text-input",{label:i,"data-field-name":t,key:t,enabled:!n}));function m(t,i,n,s=!1){return e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large"},e("ez-check",{enabled:!n,label:i,mode:s?f.SWITCH:f.REGULAR,"data-field-name":t,key:t}))}function v(t,i,n,s,r){return e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-number-input",{enabled:!n,label:i,precision:s,prettyPrecision:r,"data-field-name":t,key:t}))}const z=new Map;z.set(a.LONGTEXT,(({name:t,label:i,readOnly:n})=>e("div",{class:"ez-col ez-col--sd-12 ez-padding-horizontal--small",key:t},e("ez-text-area",{enabled:!n,label:i,"data-field-name":t})))),z.set(a.CHECKBOX,(e=>m(e.name,e.label,e.readOnly,!1))),z.set(a.SWITCH,(e=>m(e.name,e.label,e.readOnly,!0))),z.set(a.OPTIONSELECTOR,(({name:t,label:i,readOnly:n,required:s},r)=>{const a=null==r?void 0:r.options;let o;if("string"==typeof a){const e=JSON.parse(a);o=Object.keys(e).map((t=>({value:t,label:e[t]})))}else o=a;return e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-combo-box",{enabled:!n,suppressEmptyOption:s,label:i,"data-field-name":t,key:t,options:o}))})),z.set(a.SEARCH,(({name:t,label:i,readOnly:n,required:s})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-search",{enabled:!n,suppressEmptyOption:s,label:i,"data-field-name":t,key:t})))),z.set(a.FILE,(({name:t,label:i,readOnly:n})=>e("div",{class:"ez-col ez-col--sd-12 ez-padding-horizontal--small"},e("ez-upload",{enabled:!n,label:i,"data-field-name":t,key:t})))),z.set(a.DATE,(({name:t,label:i,readOnly:n})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-date-input",{enabled:!n,label:i,"data-field-name":t,key:t})))),z.set(a.TIME,(({name:t,label:i})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-time-input",{label:i,"data-field-name":t,key:t})))),z.set(a.DATETIME,(({name:t,label:i})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-date-time-input",{label:i,"data-field-name":t,key:t})))),z.set(a.DECIMALNUMBER,(({name:e,label:t,readOnly:i},n)=>{const s=Number((null==n?void 0:n.precision)||2);return v(e,t,i,s,Number((null==n?void 0:n.prettyPrecision)||s))})),z.set(a.INTEGERNUMBER,(({name:e,label:t,readOnly:i})=>v(e,t,i,0,0)));const y=e=>{const t=e.descriptor,i=Object.assign({},e.config);let n,s;return t&&(i.label||(i.label=t.label),i.name||(i.name=t.name),void 0===i.required&&(i.required=t.required),void 0===i.readOnly&&(i.readOnly=t.readOnly),s=t.properties,n=z.get(t.userInterface)),i.required&&(i.label=`${i.label} (obrigatório) *`),n||(n=b),n(i,s)},g=({source:t})=>"items"in t?e("ez-collapsible-box",{label:t.label,"header-size":"large"},t.items.map((e=>y(e)))):y(t),_=({store:t,source:i})=>e("div",{class:"dynamic-content ez-box__container"},e("div",{class:"ez-row ez-padding-vertical--small"},i.items.map((i=>e(g,{store:t,source:i})))));class w{constructor(){this._sheets=new Map,this._requiredFields=[],this._cleanOnCopyFields=[],this._defaultValues={}}getSheet(e){return this._sheets.get(e)}getAllSheets(){return this._sheets}addSheet(e){this._sheets.set(e.name,e),this._requiredFields=this._requiredFields.concat(e.requiredFields),this._cleanOnCopyFields=this._cleanOnCopyFields.concat(e.cleanOnCopyFields),this._defaultValues=e.defaultValues}getRequiredFields(){return this._requiredFields}getCleanOnCopyFields(){return this._cleanOnCopyFields}getDefaultValues(){return this._defaultValues}}function O(e,t){return"__main"==e[0].label?-1:(e[0].order||1e4)-(t[0].order||1e4)}function E(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var A="function"==typeof Symbol&&Symbol.observable||"@@observable",C=function(){return Math.random().toString(36).substring(7).split("").join(".")},j={INIT:"@@redux/INIT"+C(),REPLACE:"@@redux/REPLACE"+C(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+C()}};function x(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function R(e,t,i){var n;if("function"==typeof t&&"function"==typeof i||"function"==typeof i&&"function"==typeof arguments[3])throw new Error(E(0));if("function"==typeof t&&void 0===i&&(i=t,t=void 0),void 0!==i){if("function"!=typeof i)throw new Error(E(1));return i(R)(e,t)}if("function"!=typeof e)throw new Error(E(2));var s=e,r=t,a=[],o=a,l=!1;function c(){o===a&&(o=a.slice())}function d(){if(l)throw new Error(E(3));return r}function h(e){if("function"!=typeof e)throw new Error(E(4));if(l)throw new Error(E(5));var t=!0;return c(),o.push(e),function(){if(t){if(l)throw new Error(E(6));t=!1,c();var i=o.indexOf(e);o.splice(i,1),a=null}}}function u(e){if(!x(e))throw new Error(E(7));if(void 0===e.type)throw new Error(E(8));if(l)throw new Error(E(9));try{l=!0,r=s(r,e)}finally{l=!1}for(var t=a=o,i=0;i<t.length;i++)(0,t[i])();return e}function f(e){if("function"!=typeof e)throw new Error(E(10));s=e,u({type:j.REPLACE})}function p(){var e,t=h;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(E(11));function i(){e.next&&e.next(d())}return i(),{unsubscribe:t(i)}}})[A]=function(){return this},e}return u({type:j.INIT}),(n={dispatch:u,subscribe:h,getState:d,replaceReducer:f})[A]=p,n}const M={};function k(e=M,t){switch(t.type){case P.METADATA_LOADED:return Object.assign(Object.assign({},e),{formMetadata:t.payload});case P.CHANGE_TAB:return Object.assign(Object.assign({},e),{currentSheet:t.payload});default:return e}}function N(e){return e.formMetadata}var P;!function(e){e.METADATA_LOADED="FORM/METADATA_LOADED",e.CHANGE_TAB="FORM/CHANGE_TAB"}(P||(P={}));class D{constructor(e){this._invalidFields=new Map,this.onDataUnitEvent=e=>{var t;switch(e.type){case o.DATA_LOADED:case o.DATA_SAVED:case o.RECORDS_REMOVED:case o.RECORDS_ADDED:case o.RECORDS_COPIED:case o.EDITION_CANCELED:case o.SELECTION_CHANGED:case o.NEXT_SELECTED:case o.PREVIOUS_SELECTED:this.clearInvalid();case o.DATA_CHANGED:case o.CHANGE_UNDONE:case o.CHANGE_REDONE:case o.RECORD_LOADED:null===(t=this._fields)||void 0===t||t.forEach((e=>{this.updateValue(e.fieldName,e.field)}))}},this._fields=new Map,this._dataUnit=e,this._dataUnit.subscribe(this.onDataUnitEvent)}bind(e){e.forEach((e=>{this.updateBind(e.dataset.fieldName,e)}))}onDisconnectedCallback(){this._dataUnit.unsubscribe(this.onDataUnitEvent)}markInvalid(e){this._invalidFields.set(e.name,e),this._fields.has(e.name)&&this.updateErrorMessage(e.name,this._fields.get(e.name).field)}clearInvalid(){this._invalidFields.clear(),this._fields.forEach((e=>{this.updateErrorMessage(e.field.dataset.fieldName,e.field)}))}updateValue(e,t){const i=this._fields.get(e);try{i&&(i.listen=!1),t.value=this._dataUnit.getFieldValue(e),this.updateErrorMessage(e,t)}finally{i&&(i.listen=!0)}}updateErrorMessage(e,t){const i=this._invalidFields.get(e);t.errorMessage=i?i.message:""}updateBind(e,t){const i=this._fields.get(e);i&&i.destroy(),t.value=this._dataUnit.getFieldValue(e),this.updateErrorMessage(e,t),this._fields.set(e,S.create(e,t,((e,t)=>this.changeStarted(e,t)),(e=>this.cancelWaitingChange(e)),((e,t)=>this.setFieldValue(e,t)))),this.bindSearchOptionsLoader(e,t),this.applyEzUploadContext(e,t)}changeStarted(e,t){if(0===this._dataUnit.records.length&&this._dataUnit.addRecord(),!t.blocking&&null==t.promise){const i=this._fields.get(e);i&&(t.promise=new Promise(((e,t)=>{i.waitingChangePromiseResolve=e,i.waitingChangePromiseReject=t})))}this._dataUnit.startChange(e,t)}cancelWaitingChange(e){if(this._dataUnit.waitingForChange(e)){this._dataUnit.cancelWaitingChange(e);const t=this._fields.get(e);t&&t.rejectWaitingChange(new l("Change canceled",e))}}setFieldValue(e,t){if(0===this._dataUnit.records.length&&this._dataUnit.addRecord(),this._invalidFields.delete(e),this._dataUnit.setFieldValue(e,t),this._dataUnit.waitingForChange(e)){const t=this._fields.get(e);t&&t.acceptWaitingChange()}}bindSearchOptionsLoader(e,t){if("EZ-SEARCH"===t.nodeName&&null==t.optionLoader){const i=c.getContextValue("__EZUI__SEARCH__OPTION__LOADER__");i&&(t.optionLoader=t=>i(t,e,this._dataUnit))}}applyEzUploadContext(e,t){var i,n;if("EZ-UPLOAD"===t.nodeName){t.urlUpload=c.getContextValue("__EZUI__UPLOAD__ADD__URL__"),t.urlDelete=c.getContextValue("__EZUI__UPLOAD__DEL__URL__");const s=this._dataUnit.getField(e),r=null===(i=s.properties)||void 0===i?void 0:i.DESTINATION;r&&(t.requestHeaders={XTRAINF:`{"destination": "${r}"}`}),t.maxFiles=(null===(n=s.properties)||void 0===n?void 0:n.MAX_FILES)||0}}}class S{constructor(){this.listen=!0,this.startChangeEventName="ezStartChange",this.cancelWaitingChangeEventName="ezCancelWaitingChange",this.changeEventName="ezChange"}destroy(){this.field.removeEventListener(this.startChangeEventName,this.startChangeListener),this.field.removeEventListener(this.cancelWaitingChangeEventName,this.cancelWaitingChangeListener),this.field.removeEventListener(this.changeEventName,this.changeListener)}acceptWaitingChange(){this.waitingChangePromiseResolve&&(this.waitingChangePromiseResolve(),this.waitingChangePromiseReject=void 0,this.waitingChangePromiseResolve=void 0)}rejectWaitingChange(e){this.waitingChangePromiseReject&&(this.waitingChangePromiseReject(e),this.waitingChangePromiseReject=void 0,this.waitingChangePromiseResolve=void 0)}static create(e,t,i,n,s){const r=new S;return r.field=t,r.fieldName=e,r.startChangeListener=t=>{r.listen&&i(e,t.detail)},r.field.addEventListener(r.startChangeEventName,r.startChangeListener),r.cancelWaitingChangeListener=()=>{r.listen&&n(e)},r.field.addEventListener(r.cancelWaitingChangeEventName,r.cancelWaitingChangeListener),r.changeListener=t=>{r.listen&&s(e,t.detail)},r.field.addEventListener(r.changeEventName,r.changeListener),r}}let I=class{constructor(e){t(this,e),this.ezReady=i(this,"ezReady",7),this.onDataUnitAction=e=>{e.type===o.METADATA_LOADED&&this.processMetadata()}}submit(){return Promise.resolve()}cancel(){return Promise.resolve()}validate(){return new Promise(((e,t)=>{var i;const n=this.dataUnit.getModifiedRecords();for(let e=0;e<n.length;e++){const s=n[e],r=[];let a=this.validateRequired(s);if(a&&!a.isValid&&r.push(a),a=null===(i=this.recordsValidator)||void 0===i?void 0:i.validateRecord(this,s),a&&!a.isValid&&r.push(a),r.length>0){this.processValidationResult(r),t();break}}e()}))}observeConfig(){this.processMetadata()}validateRequired(e){const t=N(this._store.getState()),i=this._staticFields.filter((e=>e.dataset.required)).map((e=>e.dataset.fieldName)).concat(t.getRequiredFields()),n=[];if(i.forEach((t=>{const i=e[t];null!=i&&""!==i||n.push({name:t,message:"Essa informação é obrigatória"})})),n.length>0)return{isValid:!1,invalidFields:n,infoMessage:"Há pelo menos um campo obrigatório não preenchido."}}processValidationResult(e){e.forEach((e=>{const t=e.invalidFields;if(t&&t.forEach((e=>{this._dataBinder.markInvalid(e)})),e.infoMessage&&p.info(e.infoMessage),e.errorMessage){const{errorTitle:t,errorMessage:i}=e;p.error(t,i)}}))}getDynamicContent(){var t;const i=N(this._store.getState());if(!i)return null;const n=(s=null===(t=this._store)||void 0===t?void 0:t.getState()).currentSheet?s.formMetadata.getSheet(s.currentSheet):Array.from(s.formMetadata.getAllSheets().values())[0];var s;if(!n)return null;const r=Array.from(i.getAllSheets().values()),a=[];return r.length>1&&a.push(e("ez-tabselector",{onEzChange:e=>this._store.dispatch(function(e){return{type:P.CHANGE_TAB,payload:e.tabKey}}(e.detail)),selectedTab:n.name},r.map((t=>e("ez-tab",{tabKey:t.name,label:t.label}))))),a.push(e(_,{store:this._store,source:n})),a}processMetadata(){if(!this.isStatic()&&this.dataUnit){const e=null!=this.config?((e,t)=>{var i,n;const s=new Map,r=new Map,a=[],o=[],l={};null===(i=null==e?void 0:e.tabs)||void 0===i||i.forEach((e=>{r.has(e.label)||!1!==e.visible||r.set(e.label,e)})),null===(n=null==e?void 0:e.fields)||void 0===n||n.forEach((e=>{var i,n,c;if(!1!==e.visible){const d=function(e,t){return("string"==typeof e?Array.from(t.keys()).find((t=>t.label===e)):e)||{label:e,visible:!0}}(e.tab||"__main",s);if(r.has(d.label))return;const h=t.getField(e.name);if(h&&d.visible){s.has(d)||s.set(d,new Map);const t=s.get(d);(null==e.required?h.required:e.required)&&a.push(e.name),(null==e.cleanOnCopy?(null===(i=h.properties)||void 0===i?void 0:i.cleanOnCopy)||(null===(n=h.properties)||void 0===n?void 0:n.autoNum):e.cleanOnCopy)&&o.push(e.name),(null==e.defaultValue?null===(c=h.properties)||void 0===c?void 0:c.defaultValue:e.defaultValue)&&(l[e.name]=e.defaultValue);const r={config:e,descriptor:h},u=e.group;if(u){const e=`group::${u}`;t.has(e)?t.get(e).items.push(r):t.set(e,{label:u,items:[r]})}else t.set(e.name,r)}}}));const c=new w;return Array.from(s.entries()).sort(O).forEach((([e,t])=>{c.addSheet({label:"__main"===e.label?"Principal":e.label,name:e.label,items:Array.from(t.values()),requiredFields:a,cleanOnCopyFields:o,defaultValues:l})})),c})(this.config,this.dataUnit):(()=>{var e;const t=this.dataUnit.metadata,i=new w;if(t){const n=null===(e=t.fields)||void 0===e?void 0:e.filter((e=>!1!==e.visible));let s={};n.filter((e=>e.defaultValue)).map((e=>s[e.name]=e.defaultValue)),i.addSheet({label:t.label,name:t.name,items:n.map((e=>({descriptor:e}))),requiredFields:n.filter((e=>e.required)).map((e=>e.name)),cleanOnCopyFields:n.filter((e=>{var t,i;return(null===(t=e.properties)||void 0===t?void 0:t.cleanOnCopy)||(null===(i=e.properties)||void 0===i?void 0:i.autoNum)})).map((e=>e.name)),defaultValues:s})}return i})();this._store.dispatch({type:P.METADATA_LOADED,payload:e})}}isStatic(){var e;return(null===(e=this._staticFields)||void 0===e?void 0:e.length)>0}getValidatedValue(e){switch(e){case"${data}":return d.getToday();case"${datahora}":return d.getToday(!0);default:return e}}interceptAction(e){if(e.type===o.RECORDS_COPIED){const t=N(this._store.getState()).getCleanOnCopyFields();if(t)return new h(o.RECORDS_COPIED,e.payload.map((e=>{const i=Object.assign({},e);return t.forEach((e=>delete i[e])),i})))}if(e.type===o.SAVING_DATA)return new Promise((t=>{this.validate().then((()=>t(e))).catch((()=>{}))}));if(e.type===o.RECORDS_ADDED){const t=N(this._store.getState()).getDefaultValues();if(t)return new h(o.RECORDS_ADDED,e.payload.map((e=>{const i=Object.assign({},e);for(const e in t){const n=t[e].value;i[e]=this.dataUnit.valueFromString(e,this.getValidatedValue(null!=n?n:t[e]))}return i})))}return e}componentWillLoad(){void 0===this.dataUnit&&(this.dataUnit=new u("ez-form")),this.dataUnit.addInterceptor(this),this.dataUnit.subscribe(this.onDataUnitAction),this._dataBinder=new D(this.dataUnit),this._store=R(k),this._store.subscribe((()=>n(this))),this._staticFields=Array.from(this._element.querySelectorAll("[data-field-name]")),this.processMetadata()}componentDidRender(){this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]"))),this.ezReady.emit()}disconnectedCallback(){this.dataUnit.unsubscribe(this.onDataUnitAction),this.dataUnit.removeInterceptor(this),this._dataBinder.onDisconnectedCallback()}render(){return e(s,null,this.isStatic()?null:this.getDynamicContent())}get _element(){return r(this)}static get watchers(){return{config:["observeConfig"]}}};I.style="ez-form{display:flex;flex-direction:column;width:100%}.dynamic-content ez-collapsible-box{--ez-collapsible-box__header--padding-right:var(--space-small, 6px);--ez-collapsible-box__header--padding-left:var(--space-small, 6px)}";export{I as ez_form}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as ApplicationUtils } from './ApplicationUtils';
|
|
2
2
|
export { default as CSSVarsUtils } from './CSSVarsUtils';
|
|
3
3
|
export { DialogType } from '../components/ez-dialog/DialogType';
|
|
4
|
-
export {
|
|
4
|
+
export { CheckMode } from '../components/ez-check/CheckMode';
|
package/package.json
CHANGED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const core = require('@sankhyalabs/core');
|
|
4
|
-
const index = require('./index-8646c40d.js');
|
|
5
|
-
|
|
6
|
-
const buildTextArea = ({ name, label, readOnly }) => {
|
|
7
|
-
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small", key: name },
|
|
8
|
-
index.h("ez-text-area", { enabled: !readOnly, label: label, "data-field-name": name })));
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const buildTextInput = ({ name, label, readOnly }) => {
|
|
12
|
-
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
13
|
-
index.h("ez-text-input", { label: label, "data-field-name": name, key: name, enabled: !readOnly })));
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const buildSwitch = (fieldConfig) => {
|
|
17
|
-
return buildField$1(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, true);
|
|
18
|
-
};
|
|
19
|
-
const buildCheckBox = (fieldConfig) => {
|
|
20
|
-
return buildField$1(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, false);
|
|
21
|
-
};
|
|
22
|
-
function buildField$1(fieldName, fieldLabel, readOnly, switchMode = false) {
|
|
23
|
-
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large" },
|
|
24
|
-
index.h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? "switch" : "regular", "data-field-name": fieldName, key: fieldName })));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const buildComboBox = ({ name, label, readOnly, required }, properties) => {
|
|
28
|
-
const prop = properties === null || properties === void 0 ? void 0 : properties.options;
|
|
29
|
-
let options;
|
|
30
|
-
if (typeof prop === "string") {
|
|
31
|
-
const parsed = JSON.parse(prop);
|
|
32
|
-
options = Object.keys(parsed).map(key => { return { value: key, label: parsed[key] }; });
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
options = prop;
|
|
36
|
-
}
|
|
37
|
-
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
38
|
-
index.h("ez-combo-box", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name, options: options })));
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const buildSearch = ({ name, label, readOnly, required }) => {
|
|
42
|
-
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
43
|
-
index.h("ez-search", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name })));
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const buildFile = ({ name, label, readOnly }) => {
|
|
47
|
-
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
|
|
48
|
-
index.h("ez-upload", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const buildDate = ({ name, label, readOnly }) => {
|
|
52
|
-
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
53
|
-
index.h("ez-date-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
54
|
-
};
|
|
55
|
-
const buildTime = ({ name, label }) => {
|
|
56
|
-
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
57
|
-
index.h("ez-time-input", { label: label, "data-field-name": name, key: name })));
|
|
58
|
-
};
|
|
59
|
-
const buildTimeDate = ({ name, label }) => {
|
|
60
|
-
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
61
|
-
index.h("ez-date-time-input", { label: label, "data-field-name": name, key: name })));
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
const buildDecimal = ({ name, label, readOnly }, properties) => {
|
|
65
|
-
const precision = Number((properties === null || properties === void 0 ? void 0 : properties.precision) || 2);
|
|
66
|
-
const prettyPrecision = Number((properties === null || properties === void 0 ? void 0 : properties.prettyPrecision) || precision);
|
|
67
|
-
return buildNumeric(name, label, readOnly, precision, prettyPrecision);
|
|
68
|
-
};
|
|
69
|
-
const buildInteger = ({ name, label, readOnly }) => {
|
|
70
|
-
return buildNumeric(name, label, readOnly, 0, 0);
|
|
71
|
-
};
|
|
72
|
-
function buildNumeric(fieldName, fieldLabel, readOnly, precision, prettyPrecision) {
|
|
73
|
-
return (index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
74
|
-
index.h("ez-number-input", { enabled: !readOnly, label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, key: fieldName })));
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const uiBuilders = new Map();
|
|
78
|
-
uiBuilders.set(core.UserInterface.LONGTEXT, buildTextArea);
|
|
79
|
-
uiBuilders.set(core.UserInterface.CHECKBOX, buildCheckBox);
|
|
80
|
-
uiBuilders.set(core.UserInterface.SWITCH, buildSwitch);
|
|
81
|
-
uiBuilders.set(core.UserInterface.OPTIONSELECTOR, buildComboBox);
|
|
82
|
-
uiBuilders.set(core.UserInterface.SEARCH, buildSearch);
|
|
83
|
-
uiBuilders.set(core.UserInterface.FILE, buildFile);
|
|
84
|
-
uiBuilders.set(core.UserInterface.DATE, buildDate);
|
|
85
|
-
uiBuilders.set(core.UserInterface.TIME, buildTime);
|
|
86
|
-
uiBuilders.set(core.UserInterface.DATETIME, buildTimeDate);
|
|
87
|
-
uiBuilders.set(core.UserInterface.DECIMALNUMBER, buildDecimal);
|
|
88
|
-
uiBuilders.set(core.UserInterface.INTEGERNUMBER, buildInteger);
|
|
89
|
-
const buildField = (field) => {
|
|
90
|
-
const descriptor = field.descriptor;
|
|
91
|
-
const config = Object.assign({}, field.config);
|
|
92
|
-
let builder;
|
|
93
|
-
let props;
|
|
94
|
-
if (descriptor) {
|
|
95
|
-
if (!config.label) {
|
|
96
|
-
config.label = descriptor.label;
|
|
97
|
-
}
|
|
98
|
-
if (!config.name) {
|
|
99
|
-
config.name = descriptor.name;
|
|
100
|
-
}
|
|
101
|
-
if (config.required === undefined) {
|
|
102
|
-
config.required = descriptor.required;
|
|
103
|
-
}
|
|
104
|
-
if (config.readOnly === undefined) {
|
|
105
|
-
config.readOnly = descriptor.readOnly;
|
|
106
|
-
}
|
|
107
|
-
props = descriptor.properties;
|
|
108
|
-
builder = uiBuilders.get(descriptor.userInterface);
|
|
109
|
-
}
|
|
110
|
-
if (config.required) {
|
|
111
|
-
config.label = `${config.label} (obrigatório) *`;
|
|
112
|
-
}
|
|
113
|
-
if (!builder) {
|
|
114
|
-
builder = buildTextInput;
|
|
115
|
-
}
|
|
116
|
-
return builder(config, props);
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
exports.buildField = buildField;
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { UserInterface } from '@sankhyalabs/core';
|
|
2
|
-
import { h } from './index-7bc778b3.js';
|
|
3
|
-
|
|
4
|
-
const buildTextArea = ({ name, label, readOnly }) => {
|
|
5
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small", key: name },
|
|
6
|
-
h("ez-text-area", { enabled: !readOnly, label: label, "data-field-name": name })));
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
const buildTextInput = ({ name, label, readOnly }) => {
|
|
10
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
11
|
-
h("ez-text-input", { label: label, "data-field-name": name, key: name, enabled: !readOnly })));
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const buildSwitch = (fieldConfig) => {
|
|
15
|
-
return buildField$1(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, true);
|
|
16
|
-
};
|
|
17
|
-
const buildCheckBox = (fieldConfig) => {
|
|
18
|
-
return buildField$1(fieldConfig.name, fieldConfig.label, fieldConfig.readOnly, false);
|
|
19
|
-
};
|
|
20
|
-
function buildField$1(fieldName, fieldLabel, readOnly, switchMode = false) {
|
|
21
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large" },
|
|
22
|
-
h("ez-check", { enabled: !readOnly, label: fieldLabel, mode: switchMode ? "switch" : "regular", "data-field-name": fieldName, key: fieldName })));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const buildComboBox = ({ name, label, readOnly, required }, properties) => {
|
|
26
|
-
const prop = properties === null || properties === void 0 ? void 0 : properties.options;
|
|
27
|
-
let options;
|
|
28
|
-
if (typeof prop === "string") {
|
|
29
|
-
const parsed = JSON.parse(prop);
|
|
30
|
-
options = Object.keys(parsed).map(key => { return { value: key, label: parsed[key] }; });
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
options = prop;
|
|
34
|
-
}
|
|
35
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
36
|
-
h("ez-combo-box", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name, options: options })));
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const buildSearch = ({ name, label, readOnly, required }) => {
|
|
40
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
41
|
-
h("ez-search", { enabled: !readOnly, suppressEmptyOption: required, label: label, "data-field-name": name, key: name })));
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const buildFile = ({ name, label, readOnly }) => {
|
|
45
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-padding-horizontal--small" },
|
|
46
|
-
h("ez-upload", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const buildDate = ({ name, label, readOnly }) => {
|
|
50
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
51
|
-
h("ez-date-input", { enabled: !readOnly, label: label, "data-field-name": name, key: name })));
|
|
52
|
-
};
|
|
53
|
-
const buildTime = ({ name, label }) => {
|
|
54
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
55
|
-
h("ez-time-input", { label: label, "data-field-name": name, key: name })));
|
|
56
|
-
};
|
|
57
|
-
const buildTimeDate = ({ name, label }) => {
|
|
58
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
59
|
-
h("ez-date-time-input", { label: label, "data-field-name": name, key: name })));
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const buildDecimal = ({ name, label, readOnly }, properties) => {
|
|
63
|
-
const precision = Number((properties === null || properties === void 0 ? void 0 : properties.precision) || 2);
|
|
64
|
-
const prettyPrecision = Number((properties === null || properties === void 0 ? void 0 : properties.prettyPrecision) || precision);
|
|
65
|
-
return buildNumeric(name, label, readOnly, precision, prettyPrecision);
|
|
66
|
-
};
|
|
67
|
-
const buildInteger = ({ name, label, readOnly }) => {
|
|
68
|
-
return buildNumeric(name, label, readOnly, 0, 0);
|
|
69
|
-
};
|
|
70
|
-
function buildNumeric(fieldName, fieldLabel, readOnly, precision, prettyPrecision) {
|
|
71
|
-
return (h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small" },
|
|
72
|
-
h("ez-number-input", { enabled: !readOnly, label: fieldLabel, precision: precision, prettyPrecision: prettyPrecision, "data-field-name": fieldName, key: fieldName })));
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const uiBuilders = new Map();
|
|
76
|
-
uiBuilders.set(UserInterface.LONGTEXT, buildTextArea);
|
|
77
|
-
uiBuilders.set(UserInterface.CHECKBOX, buildCheckBox);
|
|
78
|
-
uiBuilders.set(UserInterface.SWITCH, buildSwitch);
|
|
79
|
-
uiBuilders.set(UserInterface.OPTIONSELECTOR, buildComboBox);
|
|
80
|
-
uiBuilders.set(UserInterface.SEARCH, buildSearch);
|
|
81
|
-
uiBuilders.set(UserInterface.FILE, buildFile);
|
|
82
|
-
uiBuilders.set(UserInterface.DATE, buildDate);
|
|
83
|
-
uiBuilders.set(UserInterface.TIME, buildTime);
|
|
84
|
-
uiBuilders.set(UserInterface.DATETIME, buildTimeDate);
|
|
85
|
-
uiBuilders.set(UserInterface.DECIMALNUMBER, buildDecimal);
|
|
86
|
-
uiBuilders.set(UserInterface.INTEGERNUMBER, buildInteger);
|
|
87
|
-
const buildField = (field) => {
|
|
88
|
-
const descriptor = field.descriptor;
|
|
89
|
-
const config = Object.assign({}, field.config);
|
|
90
|
-
let builder;
|
|
91
|
-
let props;
|
|
92
|
-
if (descriptor) {
|
|
93
|
-
if (!config.label) {
|
|
94
|
-
config.label = descriptor.label;
|
|
95
|
-
}
|
|
96
|
-
if (!config.name) {
|
|
97
|
-
config.name = descriptor.name;
|
|
98
|
-
}
|
|
99
|
-
if (config.required === undefined) {
|
|
100
|
-
config.required = descriptor.required;
|
|
101
|
-
}
|
|
102
|
-
if (config.readOnly === undefined) {
|
|
103
|
-
config.readOnly = descriptor.readOnly;
|
|
104
|
-
}
|
|
105
|
-
props = descriptor.properties;
|
|
106
|
-
builder = uiBuilders.get(descriptor.userInterface);
|
|
107
|
-
}
|
|
108
|
-
if (config.required) {
|
|
109
|
-
config.label = `${config.label} (obrigatório) *`;
|
|
110
|
-
}
|
|
111
|
-
if (!builder) {
|
|
112
|
-
builder = buildTextInput;
|
|
113
|
-
}
|
|
114
|
-
return builder(config, props);
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
export { buildField as b };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,c as l,h as e,g as o}from"./p-3c7ea91b.js";import{A as t}from"./p-0b44cf1c.js";import"./p-e1148f5c.js";import"./p-54ecd19a.js";import"@sankhyalabs/core";let s=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.headerSize="small",this.iconPlacement="left",this.stretchTitle=!1,this.removable=!1,this.editable=!1}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(),t.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")}}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"+("right"===this.iconPlacement?" collapsible-box__title--icon-right":"")+(this.stretchTitle?" collapsible-box__title--stretched":"")+(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":"")}),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"]}}};s.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--stretched{width:100%;justify-content:space-between}.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{s as ez_collapsible_box}
|
package/dist/ezui/p-54ecd19a.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{UserInterface as e}from"@sankhyalabs/core";import{h as l}from"./p-3c7ea91b.js";const a=({name:e,label:a,readOnly:d})=>l("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},l("ez-text-input",{label:a,"data-field-name":e,key:e,enabled:!d}));function d(e,a,d,n=!1){return l("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large"},l("ez-check",{enabled:!d,label:a,mode:n?"switch":"regular","data-field-name":e,key:e}))}function n(e,a,d,n,o){return l("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},l("ez-number-input",{enabled:!d,label:a,precision:n,prettyPrecision:o,"data-field-name":e,key:e}))}const o=new Map;o.set(e.LONGTEXT,(({name:e,label:a,readOnly:d})=>l("div",{class:"ez-col ez-col--sd-12 ez-padding-horizontal--small",key:e},l("ez-text-area",{enabled:!d,label:a,"data-field-name":e})))),o.set(e.CHECKBOX,(e=>d(e.name,e.label,e.readOnly,!1))),o.set(e.SWITCH,(e=>d(e.name,e.label,e.readOnly,!0))),o.set(e.OPTIONSELECTOR,(({name:e,label:a,readOnly:d,required:n},o)=>{const t=null==o?void 0:o.options;let i;if("string"==typeof t){const e=JSON.parse(t);i=Object.keys(e).map((l=>({value:l,label:e[l]})))}else i=t;return l("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},l("ez-combo-box",{enabled:!d,suppressEmptyOption:n,label:a,"data-field-name":e,key:e,options:i}))})),o.set(e.SEARCH,(({name:e,label:a,readOnly:d,required:n})=>l("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},l("ez-search",{enabled:!d,suppressEmptyOption:n,label:a,"data-field-name":e,key:e})))),o.set(e.FILE,(({name:e,label:a,readOnly:d})=>l("div",{class:"ez-col ez-col--sd-12 ez-padding-horizontal--small"},l("ez-upload",{enabled:!d,label:a,"data-field-name":e,key:e})))),o.set(e.DATE,(({name:e,label:a,readOnly:d})=>l("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},l("ez-date-input",{enabled:!d,label:a,"data-field-name":e,key:e})))),o.set(e.TIME,(({name:e,label:a})=>l("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},l("ez-time-input",{label:a,"data-field-name":e,key:e})))),o.set(e.DATETIME,(({name:e,label:a})=>l("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},l("ez-date-time-input",{label:a,"data-field-name":e,key:e})))),o.set(e.DECIMALNUMBER,(({name:e,label:l,readOnly:a},d)=>{const o=Number((null==d?void 0:d.precision)||2);return n(e,l,a,o,Number((null==d?void 0:d.prettyPrecision)||o))})),o.set(e.INTEGERNUMBER,(({name:e,label:l,readOnly:a})=>n(e,l,a,0,0)));const t=e=>{const l=e.descriptor,d=Object.assign({},e.config);let n,t;return l&&(d.label||(d.label=l.label),d.name||(d.name=l.name),void 0===d.required&&(d.required=l.required),void 0===d.readOnly&&(d.readOnly=l.readOnly),t=l.properties,n=o.get(l.userInterface)),d.required&&(d.label=`${d.label} (obrigatório) *`),n||(n=a),n(d,t)};export{t as b}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,c as i,h as t,H as s,g as e}from"./p-3c7ea91b.js";import{FloatingManager as r}from"@sankhyalabs/core";import{A as a}from"./p-0b44cf1c.js";import{C as l}from"./p-4a5e37a7.js";import"./p-e1148f5c.js";import"./p-54ecd19a.js";let n=class{constructor(t){o(this,t),this.ezChange=i(this,"ezChange",7),this._changeDeboucingTimeout=null,this._limitCharsToSearch=3,this._deboucingTime=300,this._maxWidthValue=0,this._tabPressed=!1,this._textEmptyList="Nenhum resultado encontrado",this._startLoading=!1,this._showLoading=!0,this.enabled=!0,this.showSelectedValue=!1,this.showOptionValue=!1,this.suppressSearch=!1,this.suppressEmptyOption=!1,this.canShowError=!0,this.mode="regular"}observeErrorMessage(){var o;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(o=this.errorMessage)||void 0===o?void 0:o.trim())||this.setInputValue())}observeValue(o,i){var t,s,e,r;if(this._textInput&&o!=i){const a=this.getSelectedOption(o),l=this.getSelectedOption(i),n=this.getSelectedOption(this.value);(null===(t=null==n?void 0:n.value)||void 0===t?void 0:t.toString())!=(null===(s=null==a?void 0:a.value)||void 0===s?void 0:s.toString())&&(this.value=a),(null===(e=null==a?void 0:a.value)||void 0===e?void 0:e.toString())!==(null===(r=null==l?void 0:l.value)||void 0===r?void 0:r.toString())&&(this.setInputValue(),this.ezChange.emit(null===a?void 0:a)),this.hideOptions(),this._criteria=void 0,this._preSelection=void 0,this.updateVisibleOptions()}}async setFocus(){this._textInput.setFocus()}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}getText(){let o="";const i=this.getSelectedOption(this.value);return i&&(o=this.showSelectedValue?`${i.value} - ${i.label}`:i.label),o}getSelectedOption(o){return"string"==typeof o||o instanceof String?this._visibleOptions.find((i=>i.value===o)):o}updateVisibleOptions(){let o=this._source||[];if(!this.searchMode&&this._criteria){const i=this._criteria.toUpperCase();o=o.filter((o=>o.label.toLocaleUpperCase().indexOf(i)>-1))}this._visibleOptions=this.suppressEmptyOption?o:[{value:void 0,label:""}].concat(o),this._maxWidthValue=this.getMaxWidthValue()}getMaxWidthValue(){var o;if(this.showOptionValue){const i=[];return null===(o=this._visibleOptions)||void 0===o||o.forEach((o=>{const t=this.getWidthValue(o.value);i.includes(t)||i.push(t)})),i.length>1?Math.max(...i):0}return 0}getWidthValue(o){if(null!=this._itemValueBasis){const i=this._itemValueBasis;if(null!=o)return i.innerHTML=o,i.clientWidth>0?i.clientWidth+2:0;i.innerHTML=""}return 0}buildItem(o,i){const s=this.showOptionValue&&this._maxWidthValue>0?`${this._maxWidthValue}px`:"";return t("li",{class:i===this._preSelection?"item preselected":"item",id:`item_${o.value}`,onMouseDown:()=>this.selectOption(o),onMouseOver:()=>this._preSelection=void 0},this.showOptionValue?t("span",{class:"item__value",title:o.value,style:{width:s,minWidth:s,maxWidth:s}},o.value):void 0,t("span",{class:"item__label",title:o.label},o.label))}showOptions(){this.enabled&&(this._floatingID=r.float(this._listWrapper,this._listContainer,{autoClose:!0,top:this.errorMessage||!this.canShowError||"slim"===this.mode?"0px":"-19px"}),window.requestAnimationFrame((()=>{this._listWrapper.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})))}hideOptions(){void 0!==this._floatingID&&r.close(this._floatingID),this._floatingID=void 0}isOptionsVisible(){return void 0!==this._floatingID&&r.isFloating(this._floatingID)}nextOption(){this.searchMode&&!this.isOptionsVisible()||(this.showOptions(),this._preSelection=void 0===this._preSelection?0:Math.min(this._preSelection+1,this._visibleOptions.length-1),this.scrollToOption(this._visibleOptions[this._preSelection],!0))}previousOption(){this._preSelection=void 0===this._preSelection?0:Math.max(this._preSelection-1,0),this.scrollToOption(this._visibleOptions[this._preSelection],!1)}scrollToOption(o,i){window.requestAnimationFrame((()=>{const t=this._optionsList.querySelector(`li#item_${o.value}`);if(t){const o=t.parentElement,s=o.getBoundingClientRect(),e=t.getBoundingClientRect();i&&e.bottom>s.bottom?o.scrollTop=e.top:!i&&e.top<s.top&&(o.scrollTop=0)}}))}selectCurrentOption(){void 0!==this._preSelection?(this.selectOption(this._visibleOptions[this._preSelection]),this._preSelection=void 0):this.controlListWithOnlyOne()}updateSource(o){this._startLoading=!1,o instanceof Promise?(this._showLoading=!0,o.then((o=>{this._showLoading=!1,this.updateSource(o)})).catch((()=>this._showLoading=!1)),this.updateVisibleOptions()):(this._showLoading=!1,Array.isArray(o)?(this._source=o,this.updateVisibleOptions(),this._tabPressed&&(this._tabPressed=!1,this.controlEmptySearch())):this.selectOption(o))}clearSource(){this._source=[],this.updateVisibleOptions()}selectOption(o){var i,t;const s=this.getSelectedOption(this.value);(null===(i=null==s?void 0:s.value)||void 0===i?void 0:i.toString())!==(null===(t=null==o?void 0:o.value)||void 0===t?void 0:t.toString())?this.value=(null==o?void 0:o.value)?o:void 0:(this.setInputValue(),this.hideOptions()),this.searchMode&&(this._visibleOptions=[]),this.searchMode&&(this._visibleOptions=[])}loadOptions(o,i=""){this._criteria=i,this._startLoading=!0,this.updateSource(this.optionLoader?this.optionLoader({mode:o,argument:i}):this.options)}cancelPreselection(){!this._textInput.value&&this.value?this.selectOption(void 0):this.setInputValue()}setInputValue(o=!0){const i=this.getText();(this._textInput.value||"")!==i&&(this._textInput.value=i,o&&(this.errorMessage=""))}clearSearch(){this.value=null}controlListWithOnlyOne(){if(this.searchMode){const o=this._visibleOptions;1===(null==o?void 0:o.length)&&this.selectOption(o[0])}}controlEmptySearch(){var o;this.searchMode&&((null===(o=this._visibleOptions)||void 0===o?void 0:o.length)?this.controlListWithOnlyOne():(this.clearSearch(),a.info(this._textEmptyList)))}componentWillLoad(){if(void 0===this.options){this.options=[];const o=this.el.querySelectorAll("option");o&&o.forEach((o=>{let i=o.innerText,t=o.getAttribute("value");t||(t=i),this.options.push({label:i,value:t}),o.hidden=!0}))}this.searchMode?this.updateSource([]):this.loadOptions(h.PRELOAD)}componentDidRender(){void 0===this._floatingID&&this._listWrapper.remove()}componentDidLoad(){l.applyVarsTextInput(this.el,this._textInput),this.setInputValue(!1)}handlerIconClick(){this.searchMode?this.loadOptions(h.ADVANCED):this.showOptions()}onTextInputChangeHandler(o){var i;if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=window.setTimeout((()=>{this.onTextInputChangeHandler(o)}),this._deboucingTime));const t=null===(i=o.target.value)||void 0===i?void 0:i.trim(),s=Number(t||void 0);this._criteria||(this._textInput.value=o.data||t),this._criteria=t,t&&(!isNaN(s)||t.length>=this._limitCharsToSearch)?(this.searchMode?(this._showLoading=!0,this.clearSource(),this._changeDeboucingTimeout=window.setTimeout((()=>{this.loadOptions(h.PREDICTIVE,isNaN(s)?t:s.toString())}),this._deboucingTime)):this.updateVisibleOptions(),this.showOptions()):this.hideOptions()}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(window.clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=void 0)}onTextInputClickHandler(){this.searchMode||this.showOptions()}keyDownHandler(o){switch(this._tabPressed=!1,o.ctrlKey&&("f"!==o.key&&"F"!==o.key||(this.loadOptions(h.ADVANCED),o.stopPropagation(),o.stopImmediatePropagation(),o.preventDefault())),o.key){case"ArrowDown":this.nextOption();break;case"ArrowUp":this.previousOption();break;case"Enter":this.selectCurrentOption();break;case"Escape":this.cancelPreselection();break;case"Tab":this._tabPressed=!0,this.controlListWithOnlyOne()}}onTextInputFocusOutHandler(){this.cancelPreselection()}render(){var o;return t(s,null,t("ez-text-input",{class:this.suppressSearch?"suppressed-search-input":"",ref:o=>this._textInput=o,"data-slave-mode":"true",enabled:this.enabled&&!this.suppressSearch,onInput:o=>this.onTextInputChangeHandler(o),onClick:()=>this.onTextInputClickHandler(),onFocusout:()=>this.onTextInputFocusOutHandler(),onKeyDown:o=>this.keyDownHandler(o),label:this.label,canShowError:this.canShowError,errorMessage:this.errorMessage,mode:this.mode},t("button",{class:"btn",slot:this.searchMode?"leftIcon":"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.handlerIconClick()},t("ez-icon",{iconName:this.searchMode?"search":"chevron-down"})),this.searchMode&&(null===(o=this._textInput)||void 0===o?void 0:o.value)&&(this._criteria||this.value)?t("button",{class:"btn btn__close",slot:"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.clearSearch()},t("ez-icon",{iconName:"close"})):void 0),t("section",{class:"list-container",ref:o=>this._listContainer=o},t("div",{class:"list-wrapper",ref:o=>this._listWrapper=o},t("div",{class:"list-options",ref:o=>this._optionsList=o},0===this._visibleOptions.length&&t("div",{class:"message"},!this._showLoading&&t("span",{class:"message__no-result"},this._textEmptyList),this._showLoading&&t("div",{class:"message__loading"})),this.showOptionValue?t("span",{class:"item__value item__value--hidden",ref:o=>this._itemValueBasis=o}):void 0,this._visibleOptions.length>0&&this._visibleOptions.map(((o,i)=>this.buildItem(o,i)))))))}get el(){return e(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],value:["observeValue"]}}};var h;!function(o){o.ADVANCED="ADVANCED",o.PRELOAD="PRELOAD",o.PREDICTIVE="PREDICTIVE"}(h||(h={})),n.style=":host{--ez-combo-box--height:42px;--ez-combo-box--width:100%;--ez-combo-box__icon--width:48px;--ez-combo-box--border-radius:var(--border--radius-medium, 12px);--ez-combo-box--border-radius-small:var(--border--radius-small, 6px);--ez-combo-box--font-size:var(--text--medium, 14px);--ez-combo-box--font-family:var(--font-pattern, Arial);--ez-combo-box--font-weight--large:var(--text-weight--large, 500);--ez-combo-box--font-weight--medium:var(--text-weight--medium, 400);--ez-combo-box--background-color--xlight:var(--background--xlight, #fff);--ez-combo-box--background-medium:var(--background--medium, #f0f3f7);--ez-combo-box__input--background-color:var(--background--medium, #e0e0e0);--ez-combo-box__input--border:var(--border--medium, 2px solid);--ez-combo-box__input--border-color:var(--ez-combo-box__input--background-color);--ez-combo-box__input--focus--border-color:var(--color--primary, #008561);--ez-combo-box__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-combo-box__input--disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__input--error--border-color:#CC2936;--ez-combo-box__btn--color:var(--title--primary, #2B3A54);--ez-combo-box__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-hover--color:var(--color--primary, #4e4e4e);--ez-combo-box__label--color:var(--title--primary, #2B3A54);--ez-combo-box__list-title--primary:var(--title--primary, #2B3A54);--ez-combo-box__list-text--primary:var(--text--primary, #626e82);--ez-combo-box__list-height:calc(var(--ez-combo-box--font-size) + var(--ez-combo-box--space--medium));--ez-combo-box--space--medium:var(--space--medium, 12px);--ez-combo-box--space--small:var(--space--small, 6px);--ez-combo-box__list-scrollbar--background-color-primary:var(--scrollbar--primary, #2B3A54);--ez-combo-box__list-scrollbar--background-color-secondary:var(--scrollbar--secondary, #E5EAF0);--ez-combo-box__list-scrollbar--border-radius:var(--border--radius-small, 6px);--ez-combo-box__list-scrollbar--width:var(--space--medium, 12px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-combo-box--width)}ez-icon{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.suppressed-search-input{--ez-text-input__input--border-color:var(--color--strokes, #dce0e8);--ez-text-input__input--disabled--background-color:var(--background--xlight, #fff);--ez-text-input__input--disabled--color:var(--title--primary, #2B3A54)}.list-container{position:relative;width:100%}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:100%;z-index:var(--more-visible, 2);max-height:calc(4*var(--ez-combo-box__list-height) + 2*var(--ez-combo-box--space--small));background-color:var(--ez-combo-box--background-color--xlight);border-radius:var(--ez-combo-box--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);padding:var(--ez-combo-box--space--small)}.list-options{box-sizing:border-box;width:100%;height:100%;display:flex;flex-direction:column;scroll-behavior:smooth;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--ez-combo-box__list-scrollbar--background-color-primary) var(--ez-combo-box__list-scrollbar--background-color-secondary)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-combo-box__list-scrollbar--background-color-secondary);border-radius:var(--ez-combo-box__list-scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-combo-box__list-scrollbar--background-color-primary);border-radius:var(--ez-combo-box__list-scrollbar--border-radius)}.list-options::-webkit-scrollbar{background-color:var(--ez-combo-box__list-scrollbar--background-color-secondary);width:var(--ez-combo-box__list-scrollbar--width);max-width:var(--ez-combo-box__list-scrollbar--width);min-width:var(--ez-combo-box__list-scrollbar--width)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-combo-box--border-radius-small);padding:0 var(--ez-combo-box--space--small);min-height:var(--ez-combo-box__list-height);gap:var(--space--small, 6px)}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-combo-box__list-title--primary);font-weight:var(--ez-combo-box--font-weight--large);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size)}.item__value{text-align:center;color:var(--ez-combo-box__list-text--primary)}.item__value--hidden{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}.item__label{text-align:left}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;min-height:calc(var(--ez-combo-box__list-height) * 1.5)}.message__no-result{color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size)}.message__loading{border-radius:50%;width:16px;height:16px;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:3px solid var(--ez-combo-box__list-title--primary);border-top:3px solid transparent}li:hover{background-color:var(--ez-combo-box--background-medium)}.preselected{background-color:var(--background--medium)}.btn{outline:none;border:none;background:none;cursor:pointer;color:var(--ez-combo-box__btn--color)}.btn:disabled{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:disabled:hover{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:hover{color:var(--ez-combo-box__btn-hover--color)}.btn__close{visibility:hidden}ez-text-input:hover .btn__close,ez-text-input:focus .btn__close{visibility:visible}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";export{n as ez_combo_box}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as t,r as e,c as i,f as s,H as n,g as r}from"./p-3c7ea91b.js";import{Action as o,WaitingChangeException as a,ApplicationContext as c,DateUtils as h,DataUnitAction as l,DataUnit as u}from"@sankhyalabs/core";import{b as d}from"./p-54ecd19a.js";import{A as f}from"./p-0b44cf1c.js";import"./p-e1148f5c.js";const p=({source:e})=>"items"in e?t("ez-collapsible-box",{label:e.label,"header-size":"large"},e.items.map((t=>d(t)))):d(e),v=({store:e,source:i})=>t("div",{class:"dynamic-content ez-box__container"},t("div",{class:"ez-row ez-padding-vertical--small"},i.items.map((i=>t(p,{store:e,source:i})))));class b{constructor(){this._sheets=new Map,this._requiredFields=[],this._cleanOnCopyFields=[],this._defaultValues={}}getSheet(t){return this._sheets.get(t)}getAllSheets(){return this._sheets}addSheet(t){this._sheets.set(t.name,t),this._requiredFields=this._requiredFields.concat(t.requiredFields),this._cleanOnCopyFields=this._cleanOnCopyFields.concat(t.cleanOnCopyFields),this._defaultValues=t.defaultValues}getRequiredFields(){return this._requiredFields}getCleanOnCopyFields(){return this._cleanOnCopyFields}getDefaultValues(){return this._defaultValues}}function m(t,e){return"__main"==t[0].label?-1:(t[0].order||1e4)-(e[0].order||1e4)}function _(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var w="function"==typeof Symbol&&Symbol.observable||"@@observable",y=function(){return Math.random().toString(36).substring(7).split("").join(".")},g={INIT:"@@redux/INIT"+y(),REPLACE:"@@redux/REPLACE"+y(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+y()}};function E(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function A(t,e,i){var s;if("function"==typeof e&&"function"==typeof i||"function"==typeof i&&"function"==typeof arguments[3])throw new Error(_(0));if("function"==typeof e&&void 0===i&&(i=e,e=void 0),void 0!==i){if("function"!=typeof i)throw new Error(_(1));return i(A)(t,e)}if("function"!=typeof t)throw new Error(_(2));var n=t,r=e,o=[],a=o,c=!1;function h(){a===o&&(a=o.slice())}function l(){if(c)throw new Error(_(3));return r}function u(t){if("function"!=typeof t)throw new Error(_(4));if(c)throw new Error(_(5));var e=!0;return h(),a.push(t),function(){if(e){if(c)throw new Error(_(6));e=!1,h();var i=a.indexOf(t);a.splice(i,1),o=null}}}function d(t){if(!E(t))throw new Error(_(7));if(void 0===t.type)throw new Error(_(8));if(c)throw new Error(_(9));try{c=!0,r=n(r,t)}finally{c=!1}for(var e=o=a,i=0;i<e.length;i++)(0,e[i])();return t}function f(t){if("function"!=typeof t)throw new Error(_(10));n=t,d({type:g.REPLACE})}function p(){var t,e=u;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(_(11));function i(){t.next&&t.next(l())}return i(),{unsubscribe:e(i)}}})[w]=function(){return this},t}return d({type:g.INIT}),(s={dispatch:d,subscribe:u,getState:l,replaceReducer:f})[w]=p,s}const O={};function C(t=O,e){switch(e.type){case R.METADATA_LOADED:return Object.assign(Object.assign({},t),{formMetadata:e.payload});case R.CHANGE_TAB:return Object.assign(Object.assign({},t),{currentSheet:e.payload});default:return t}}function z(t){return t.formMetadata}var R;!function(t){t.METADATA_LOADED="FORM/METADATA_LOADED",t.CHANGE_TAB="FORM/CHANGE_TAB"}(R||(R={}));class j{constructor(t){this._invalidFields=new Map,this.onDataUnitEvent=t=>{var e;switch(t.type){case o.DATA_LOADED:case o.DATA_SAVED:case o.RECORDS_REMOVED:case o.RECORDS_ADDED:case o.RECORDS_COPIED:case o.EDITION_CANCELED:case o.SELECTION_CHANGED:case o.NEXT_SELECTED:case o.PREVIOUS_SELECTED:this.clearInvalid();case o.DATA_CHANGED:case o.CHANGE_UNDONE:case o.CHANGE_REDONE:case o.RECORD_LOADED:null===(e=this._fields)||void 0===e||e.forEach((t=>{this.updateValue(t.fieldName,t.field)}))}},this._fields=new Map,this._dataUnit=t,this._dataUnit.subscribe(this.onDataUnitEvent)}bind(t){t.forEach((t=>{this.updateBind(t.dataset.fieldName,t)}))}onDisconnectedCallback(){this._dataUnit.unsubscribe(this.onDataUnitEvent)}markInvalid(t){this._invalidFields.set(t.name,t),this._fields.has(t.name)&&this.updateErrorMessage(t.name,this._fields.get(t.name).field)}clearInvalid(){this._invalidFields.clear(),this._fields.forEach((t=>{this.updateErrorMessage(t.field.dataset.fieldName,t.field)}))}updateValue(t,e){const i=this._fields.get(t);try{i&&(i.listen=!1),e.value=this._dataUnit.getFieldValue(t),this.updateErrorMessage(t,e)}finally{i&&(i.listen=!0)}}updateErrorMessage(t,e){const i=this._invalidFields.get(t);e.errorMessage=i?i.message:""}updateBind(t,e){const i=this._fields.get(t);i&&i.destroy(),e.value=this._dataUnit.getFieldValue(t),this.updateErrorMessage(t,e),this._fields.set(t,x.create(t,e,((t,e)=>this.changeStarted(t,e)),(t=>this.cancelWaitingChange(t)),((t,e)=>this.setFieldValue(t,e)))),this.bindSearchOptionsLoader(t,e),this.applyEzUploadContext(t,e)}changeStarted(t,e){if(0===this._dataUnit.records.length&&this._dataUnit.addRecord(),!e.blocking&&null==e.promise){const i=this._fields.get(t);i&&(e.promise=new Promise(((t,e)=>{i.waitingChangePromiseResolve=t,i.waitingChangePromiseReject=e})))}this._dataUnit.startChange(t,e)}cancelWaitingChange(t){if(this._dataUnit.waitingForChange(t)){this._dataUnit.cancelWaitingChange(t);const e=this._fields.get(t);e&&e.rejectWaitingChange(new a("Change canceled",t))}}setFieldValue(t,e){if(0===this._dataUnit.records.length&&this._dataUnit.addRecord(),this._invalidFields.delete(t),this._dataUnit.setFieldValue(t,e),this._dataUnit.waitingForChange(t)){const e=this._fields.get(t);e&&e.acceptWaitingChange()}}bindSearchOptionsLoader(t,e){if("EZ-SEARCH"===e.nodeName&&null==e.optionLoader){const i=c.getContextValue("__EZUI__SEARCH__OPTION__LOADER__");i&&(e.optionLoader=e=>i(e,t,this._dataUnit))}}applyEzUploadContext(t,e){var i,s;if("EZ-UPLOAD"===e.nodeName){e.urlUpload=c.getContextValue("__EZUI__UPLOAD__ADD__URL__"),e.urlDelete=c.getContextValue("__EZUI__UPLOAD__DEL__URL__");const n=this._dataUnit.getField(t),r=null===(i=n.properties)||void 0===i?void 0:i.DESTINATION;r&&(e.requestHeaders={XTRAINF:`{"destination": "${r}"}`}),e.maxFiles=(null===(s=n.properties)||void 0===s?void 0:s.MAX_FILES)||0}}}class x{constructor(){this.listen=!0,this.startChangeEventName="ezStartChange",this.cancelWaitingChangeEventName="ezCancelWaitingChange",this.changeEventName="ezChange"}destroy(){this.field.removeEventListener(this.startChangeEventName,this.startChangeListener),this.field.removeEventListener(this.cancelWaitingChangeEventName,this.cancelWaitingChangeListener),this.field.removeEventListener(this.changeEventName,this.changeListener)}acceptWaitingChange(){this.waitingChangePromiseResolve&&(this.waitingChangePromiseResolve(),this.waitingChangePromiseReject=void 0,this.waitingChangePromiseResolve=void 0)}rejectWaitingChange(t){this.waitingChangePromiseReject&&(this.waitingChangePromiseReject(t),this.waitingChangePromiseReject=void 0,this.waitingChangePromiseResolve=void 0)}static create(t,e,i,s,n){const r=new x;return r.field=e,r.fieldName=t,r.startChangeListener=e=>{r.listen&&i(t,e.detail)},r.field.addEventListener(r.startChangeEventName,r.startChangeListener),r.cancelWaitingChangeListener=()=>{r.listen&&s(t)},r.field.addEventListener(r.cancelWaitingChangeEventName,r.cancelWaitingChangeListener),r.changeListener=e=>{r.listen&&n(t,e.detail)},r.field.addEventListener(r.changeEventName,r.changeListener),r}}let M=class{constructor(t){e(this,t),this.ezReady=i(this,"ezReady",7),this.onDataUnitAction=t=>{t.type===o.METADATA_LOADED&&this.processMetadata()}}submit(){return Promise.resolve()}cancel(){return Promise.resolve()}validate(){return new Promise(((t,e)=>{var i;const s=this.dataUnit.getModifiedRecords();for(let t=0;t<s.length;t++){const n=s[t],r=[];let o=this.validateRequired(n);if(o&&!o.isValid&&r.push(o),o=null===(i=this.recordsValidator)||void 0===i?void 0:i.validateRecord(this,n),o&&!o.isValid&&r.push(o),r.length>0){this.processValidationResult(r),e();break}}t()}))}observeConfig(){this.processMetadata()}validateRequired(t){const e=z(this._store.getState()),i=this._staticFields.filter((t=>t.dataset.required)).map((t=>t.dataset.fieldName)).concat(e.getRequiredFields()),s=[];if(i.forEach((e=>{const i=t[e];null!=i&&""!==i||s.push({name:e,message:"Essa informação é obrigatória"})})),s.length>0)return{isValid:!1,invalidFields:s,infoMessage:"Há pelo menos um campo obrigatório não preenchido."}}processValidationResult(t){t.forEach((t=>{const e=t.invalidFields;if(e&&e.forEach((t=>{this._dataBinder.markInvalid(t)})),t.infoMessage&&f.info(t.infoMessage),t.errorMessage){const{errorTitle:e,errorMessage:i}=t;f.error(e,i)}}))}getDynamicContent(){var e;const i=z(this._store.getState());if(!i)return null;const s=(n=null===(e=this._store)||void 0===e?void 0:e.getState()).currentSheet?n.formMetadata.getSheet(n.currentSheet):Array.from(n.formMetadata.getAllSheets().values())[0];var n;if(!s)return null;const r=Array.from(i.getAllSheets().values()),o=[];return r.length>1&&o.push(t("ez-tabselector",{onEzChange:t=>this._store.dispatch(function(t){return{type:R.CHANGE_TAB,payload:t.tabKey}}(t.detail)),selectedTab:s.name},r.map((e=>t("ez-tab",{tabKey:e.name,label:e.label}))))),o.push(t(v,{store:this._store,source:s})),o}processMetadata(){if(!this.isStatic()&&this.dataUnit){const t=null!=this.config?((t,e)=>{var i,s;const n=new Map,r=new Map,o=[],a=[],c={};null===(i=null==t?void 0:t.tabs)||void 0===i||i.forEach((t=>{r.has(t.label)||!1!==t.visible||r.set(t.label,t)})),null===(s=null==t?void 0:t.fields)||void 0===s||s.forEach((t=>{var i,s,h;if(!1!==t.visible){const l=function(t,e){return("string"==typeof t?Array.from(e.keys()).find((e=>e.label===t)):t)||{label:t,visible:!0}}(t.tab||"__main",n);if(r.has(l.label))return;const u=e.getField(t.name);if(u&&l.visible){n.has(l)||n.set(l,new Map);const e=n.get(l);(null==t.required?u.required:t.required)&&o.push(t.name),(null==t.cleanOnCopy?(null===(i=u.properties)||void 0===i?void 0:i.cleanOnCopy)||(null===(s=u.properties)||void 0===s?void 0:s.autoNum):t.cleanOnCopy)&&a.push(t.name),(null==t.defaultValue?null===(h=u.properties)||void 0===h?void 0:h.defaultValue:t.defaultValue)&&(c[t.name]=t.defaultValue);const r={config:t,descriptor:u},d=t.group;if(d){const t=`group::${d}`;e.has(t)?e.get(t).items.push(r):e.set(t,{label:d,items:[r]})}else e.set(t.name,r)}}}));const h=new b;return Array.from(n.entries()).sort(m).forEach((([t,e])=>{h.addSheet({label:"__main"===t.label?"Principal":t.label,name:t.label,items:Array.from(e.values()),requiredFields:o,cleanOnCopyFields:a,defaultValues:c})})),h})(this.config,this.dataUnit):(()=>{var t;const e=this.dataUnit.metadata,i=new b;if(e){const s=null===(t=e.fields)||void 0===t?void 0:t.filter((t=>!1!==t.visible));let n={};s.filter((t=>t.defaultValue)).map((t=>n[t.name]=t.defaultValue)),i.addSheet({label:e.label,name:e.name,items:s.map((t=>({descriptor:t}))),requiredFields:s.filter((t=>t.required)).map((t=>t.name)),cleanOnCopyFields:s.filter((t=>{var e,i;return(null===(e=t.properties)||void 0===e?void 0:e.cleanOnCopy)||(null===(i=t.properties)||void 0===i?void 0:i.autoNum)})).map((t=>t.name)),defaultValues:n})}return i})();this._store.dispatch({type:R.METADATA_LOADED,payload:t})}}isStatic(){var t;return(null===(t=this._staticFields)||void 0===t?void 0:t.length)>0}getValidatedValue(t){switch(t){case"${data}":return h.getToday();case"${datahora}":return h.getToday(!0);default:return t}}interceptAction(t){if(t.type===o.RECORDS_COPIED){const e=z(this._store.getState()).getCleanOnCopyFields();if(e)return new l(o.RECORDS_COPIED,t.payload.map((t=>{const i=Object.assign({},t);return e.forEach((t=>delete i[t])),i})))}if(t.type===o.SAVING_DATA)return new Promise((e=>{this.validate().then((()=>e(t))).catch((()=>{}))}));if(t.type===o.RECORDS_ADDED){const e=z(this._store.getState()).getDefaultValues();if(e)return new l(o.RECORDS_ADDED,t.payload.map((t=>{const i=Object.assign({},t);for(const t in e){const s=e[t].value;i[t]=this.dataUnit.valueFromString(t,this.getValidatedValue(null!=s?s:e[t]))}return i})))}return t}componentWillLoad(){void 0===this.dataUnit&&(this.dataUnit=new u("ez-form")),this.dataUnit.addInterceptor(this),this.dataUnit.subscribe(this.onDataUnitAction),this._dataBinder=new j(this.dataUnit),this._store=A(C),this._store.subscribe((()=>s(this))),this._staticFields=Array.from(this._element.querySelectorAll("[data-field-name]")),this.processMetadata()}componentDidRender(){this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]"))),this.ezReady.emit()}disconnectedCallback(){this.dataUnit.unsubscribe(this.onDataUnitAction),this.dataUnit.removeInterceptor(this),this._dataBinder.onDisconnectedCallback()}render(){return t(n,null,this.isStatic()?null:this.getDynamicContent())}get _element(){return r(this)}static get watchers(){return{config:["observeConfig"]}}};M.style="ez-form{display:flex;flex-direction:column;width:100%}.dynamic-content ez-collapsible-box{--ez-collapsible-box__header--padding-right:var(--space-small, 6px);--ez-collapsible-box__header--padding-left:var(--space-small, 6px)}";export{M as ez_form}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as r,h as o,H as c}from"./p-3c7ea91b.js";let a=class{constructor(o){e(this,o),this.ezChange=r(this,"ezChange",7),this.enabled=!0,this.mode="regular"}observeMode(){"switch"===this.mode?(this._inputElem.classList.remove("regularMode"),this._inputElem.classList.add("switchMode")):(this._inputElem.classList.remove("switchMode"),this._inputElem.classList.add("regularMode"))}async getMode(){return this.mode}async setFocus(){this._inputElem.focus()}componentDidLoad(){this.observeMode()}changeValue(){this.enabled&&(this.value=!this.value,this.ezChange.emit(this.value))}getLabelClasses(){let e="label";return this.enabled||(e+=" label--disabled"),e}render(){return o(c,null,o("input",{type:"checkbox",class:"regularMode",checked:!0===this.value,onChange:()=>{this.changeValue()},disabled:!this.enabled,ref:e=>this._inputElem=e}),this.label?o("label",{class:this.getLabelClasses(),onClick:()=>{this.changeValue()},title:this.label},this.label):void 0)}static get watchers(){return{mode:["observeMode"]}}};a.style=':host{--ez-check--box--width:18px;--ez-check--box--height:18px;--ez-check--width:calc(var(--ez-check--box--width) + 14px);--ez-check--height:calc(var(--ez-check--box--width) + 14px);--ez-check--border-radius:var(--border--radius-small);--ez-check--checked--background-color:var(--color--primary-200);--ez-check--focus--background-color:var(--color--strokes, #FFFFFF);--ez-check--hover--background-color:var(--background--medium);--ez-check--checked--disabled--background-color:var(--color--disable-secondary);--ez-check--border:var(--border--medium) var(--title--primary);--ez-check--disabled--border:var(--border--medium) var(--color--strokes);--ez-check--checked--border:var(--border--medium) var(--color--primary);--ez-check--checked--hover--background-color:var(--color--primary-200);--ez-check--checked--focus--background-color:var(--color--primary-300, #FFFFFF);--ez-check--check--image:url(\'data:image/svg+xml;utf8,<svg width="8" height="7" viewBox="0 0 8 7" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M7.70002 0.398999L7.48502 0.207997C7.31524 0.0598858 7.09376 -0.0150438 6.86894 -0.000430025C6.64411 0.0141838 6.43419 0.117153 6.28502 0.285997L2.70002 4.332L1.61802 3.384C1.44837 3.23576 1.22697 3.16067 1.00214 3.17509C0.77732 3.18952 0.567332 3.2923 0.418019 3.461L0.229019 3.674C0.0752361 3.84797 -0.00437434 4.07521 0.00721192 4.30713C0.0187982 4.53904 0.120661 4.75722 0.291019 4.915L2.27402 6.762C2.35832 6.8432 2.45842 6.90618 2.56811 6.94702C2.67779 6.98787 2.79471 7.00571 2.91159 6.99942C3.02846 6.99314 3.14279 6.96287 3.24747 6.91049C3.35214 6.85812 3.44492 6.78477 3.52002 6.695L7.79102 1.638C7.94063 1.46048 8.01486 1.23149 7.99786 0.999963C7.98085 0.768436 7.87396 0.552749 7.70002 0.398999Z"/></svg>\');--ez-check--check--background-color:var(--color--primary);--ez-check--check--disabled--background-color:var(--color--strokes);--ez-switch--slider--width:34px;--ez-switch--slider--height:14px;--ez-switch--pin--width:19px;--ez-switch--pin--height:19px;--ez-switch--focus--width:32px;--ez-switch--focus--height:32px;--ez-switch--background-color:var(--color--strokes);--ez-switch--disabled--background-color:var(--color--disable-secondary);--ez-switch--disabled--checked--background-color:var(--color--primary-300);--ez-switch--checked--background-color:var(--color--primary);--ez-switch--pin--background-color:var(--background--xlight);--ez-switch--pin--disabled--background-color:var(--color--disable-primary);--ez-switch--pin--checked--background-color:var(--background--xlight);--ez-switch--pin--checked--disabled--background-color:#E8F7F4;--ez-switch--pin--focus--background-color:var(--text--disable);--ez-switch--pin--checked--focus--background-color:var(--color--primary);--ez-switch--pin--border-color:var(--text--primary);--ez-switch--pin--disabled--border-color:var(--text--secondary);--ez-check--label--font-size:var(--text--medium, 14px);--ez-check--label--font-family:var(--font-pattern, Arial);--ez-check--label--color:var(--title--primary, #000);--ez-check--label--disabled--color:var(--text--disable, #AFB6C0);display:flex;width:100%;align-items:center;margin:0}input.regularMode{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;box-sizing:border-box;-webkit-appearance:none;appearance:none;cursor:pointer;border-radius:50%;position:relative;width:var(--ez-check--width);height:var(--ez-check--height)}input.regularMode:enabled:hover{background-color:var(--ez-check--hover--background-color)}input.regularMode:enabled:focus{outline:none;background-color:var(--ez-check--focus--background-color)}input.regularMode:disabled{cursor:auto;background:none}input.regularMode::before{box-sizing:border-box;content:"";display:block;width:var(--ez-check--box--width);height:var(--ez-check--box--height);border-radius:var(--ez-check--border-radius);border:var(--ez-check--border)}input.regularMode:disabled::before{border:var(--ez-check--disabled--border)}input.regularMode:checked:enabled:hover{background-color:var(--ez-check--checked--hover--background-color)}input.regularMode:checked:enabled:focus{background-color:var(--ez-check--checked--focus--background-color)}input.regularMode:checked::before{border:var(--ez-check--checked--border);background-color:var(--ez-check--checked--background-color)}input.regularMode:checked:disabled:before{border:var(--ez-check--disabled--border);background-color:var(--ez-check--checked--disabled--background-color)}input.regularMode:checked::after{display:flex;position:absolute;content:"";background-color:var(--ez-check--check--background-color);width:8px;height:7px;-webkit-mask-image:var(--ez-check--check--image);mask-image:var(--ez-check--check--image)}input.regularMode:checked:disabled::after{background-color:var(--ez-check--check--disabled--background-color)}input.switchMode{flex-shrink:0;-webkit-appearance:none;appearance:none;position:relative;outline:none;cursor:pointer;border-radius:20px;border:var(--border--small, 1px solid) var(--ez-switch--pin--border-color, #626e82);transition:background-color var(--transition);width:var(--ez-switch--slider--width);height:var(--ez-switch--slider--height);background-color:var(--ez-switch--background-color)}input.switchMode:disabled{background-color:var(--ez-switch--disabled--background-color);border:var(--border--small, 1px solid) var(--ez-switch--pin--disabled--border-color, #a2abb9)}input.switchMode:checked:disabled{background-color:var(--ez-switch--disabled--checked--background-color)}input.switchMode::after{content:"";display:block;position:absolute;box-shadow:var(--shadow);transition:transform var(--transition);transition:background-color var(--transition);transition:border-color var(--transition);transform:translateX(-2px) translateY(-4px);border-radius:50%;border:var(--border--small, 1px solid) var(--ez-switch--pin--border-color, #626e82);width:var(--ez-switch--pin--width);height:var(--ez-switch--pin--height);background-color:var(--ez-switch--pin--background-color)}input.switchMode:disabled::after{background-color:var(--ez-switch--pin--disabled--background-color);border:var(--border--small, 1px solid) var(--ez-switch--pin--disabled--border-color, #a2abb9)}input.switchMode:checked{transition:background-color var(--transition), border var(--transition);background-color:var(--ez-switch--checked--background-color);border:var(--border--small, 1px solid) var(--color--primary, #008561)}input.switchMode::before{display:block;content:"";display:block;position:absolute;border-radius:50%;opacity:0;width:var(--ez-switch--focus--width);height:var(--ez-switch--focus--height);top:calc((var(--ez-switch--slider--height) - var(--ez-switch--focus--height)) / 2);left:calc((var(--ez-switch--pin--width) - var(--ez-switch--focus--width) - 2px) / 2);background-color:var(--ez-switch--pin--focus--background-color)}input.switchMode:focus::before{opacity:0.24;transition:opacity var(--transition)}input.switchMode:checked:focus::before{background-color:var(--ez-switch--pin--checked--focus--background-color);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width) + 2px))}input.switchMode:checked::after{transition:transform var(--transition);transition:background-color var(--transition);transition:border-color var(--transition);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width))) translateY(-4px);box-shadow:var(--shadow);background-color:var(--ez-switch--pin--checked--background-color);border:var(--border--small, 1px solid) var(--color--primary, #008561)}input.switchMode:checked:disabled::after{background-color:var(--ez-switch--pin--checked--disabled--background-color)}.label{flex-shrink:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-check--label--color);text-shadow:var(--text-shadow);font-size:var(--ez-check--label--font-size);font-family:var(--ez-check--label--font-family);cursor:default;padding-left:var(--space--small)}.label--disabled{color:var(--ez-check--label--disabled--color)}';export{a as ez_check}
|