@sankhyalabs/ezui 4.14.0 → 4.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ez-combo-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-date-input.cjs.entry.js +2 -1
- package/dist/cjs/ez-date-time-input.cjs.entry.js +2 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +20 -20
- package/dist/cjs/ez-grid.cjs.entry.js +2 -0
- package/dist/cjs/ez-list.cjs.entry.js +2 -2
- package/dist/cjs/ez-number-input.cjs.entry.js +2 -1
- package/dist/cjs/ez-search.cjs.entry.js +2 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +2 -1
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +1 -1
- package/dist/collection/components/ez-date-input/ez-date-input.js +20 -1
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +20 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.js +2 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.js +6 -6
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +6 -6
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +2 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextArea.tpl.js +2 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js +2 -2
- package/dist/collection/components/ez-grid/ez-grid.js +16 -0
- package/dist/collection/components/ez-list/ez-list.css +3 -0
- package/dist/collection/components/ez-list/ez-list.js +1 -1
- package/dist/collection/components/ez-number-input/ez-number-input.js +20 -1
- package/dist/collection/components/ez-search/ez-search.js +20 -1
- package/dist/collection/components/ez-time-input/ez-time-input.js +20 -1
- package/dist/custom-elements/index.js +40 -33
- package/dist/esm/ez-combo-box.entry.js +1 -1
- package/dist/esm/ez-date-input.entry.js +2 -1
- package/dist/esm/ez-date-time-input.entry.js +2 -1
- package/dist/esm/ez-form-view.entry.js +20 -20
- package/dist/esm/ez-grid.entry.js +2 -0
- package/dist/esm/ez-list.entry.js +2 -2
- package/dist/esm/ez-number-input.entry.js +2 -1
- package/dist/esm/ez-search.entry.js +2 -1
- package/dist/esm/ez-time-input.entry.js +2 -1
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-3173d988.entry.js +1 -0
- package/dist/ezui/p-71d4f489.entry.js +1 -0
- package/dist/ezui/p-7cce14cd.entry.js +1 -0
- package/dist/ezui/p-855c4290.entry.js +1 -0
- package/dist/ezui/p-967758ac.entry.js +1 -0
- package/dist/ezui/p-9ba304e9.entry.js +1 -0
- package/dist/ezui/p-c0f7917c.entry.js +1 -0
- package/dist/ezui/p-d96793f1.entry.js +1 -0
- package/dist/ezui/{p-3a41181c.entry.js → p-f3e18804.entry.js} +1 -1
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +4 -0
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +4 -0
- package/dist/types/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.d.ts +1 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.d.ts +3 -3
- package/dist/types/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.d.ts +2 -2
- package/dist/types/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.d.ts +1 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/TextArea.tpl.d.ts +1 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.d.ts +1 -1
- package/dist/types/components/ez-form-view/interfaces/IFormViewField.d.ts +4 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +4 -0
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +4 -0
- package/dist/types/components/ez-search/ez-search.d.ts +4 -0
- package/dist/types/components/ez-time-input/ez-time-input.d.ts +4 -0
- package/dist/types/components.d.ts +44 -0
- package/package.json +1 -1
- package/dist/ezui/p-11431283.entry.js +0 -1
- package/dist/ezui/p-12d37f14.entry.js +0 -1
- package/dist/ezui/p-15e29287.entry.js +0 -1
- package/dist/ezui/p-5d8d9a2e.entry.js +0 -1
- package/dist/ezui/p-751aa882.entry.js +0 -1
- package/dist/ezui/p-9a58e143.entry.js +0 -1
- package/dist/ezui/p-a9f0f910.entry.js +0 -1
- package/dist/ezui/p-ff4141d8.entry.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,c as t,h as e,g as i}from"./p-bfc7b8ca.js";import{C as h}from"./p-4a5e37a7.js";import{ElementIDUtils as r}from"@sankhyalabs/core";const o=class{constructor(e){s(this,e),this.ezChange=t(this,"ezChange",7),this.value=void 0,this.label=void 0,this.enabled=!0,this.errorMessage=void 0,this.optionLoader=void 0,this.showSelectedValue=!0,this.showOptionValue=!0,this.suppressEmptyOption=!1,this.mode="regular",this.canShowError=!0}observeErrorMessage(){this._comboElement&&(this._comboElement.errorMessage=this.errorMessage)}observeValue(){this._comboElement&&(this._comboElement.value=this.value)}async setFocus(){this._comboElement.setFocus()}async setBlur(){this._comboElement.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}onComboChange(s){s.stopPropagation(),this.value=s.detail,this.ezChange.emit(s.detail),this.errorMessage!==this._comboElement.errorMessage&&(this.errorMessage=this._comboElement.errorMessage)}componentDidLoad(){h.applyVarsTextInput(this._elem,this._comboElement)}render(){return r.addIDInfoIfNotExists(this._elem,"input"),e("ez-combo-box",{"data-element-id":r.getInternalIDInfo("combo"),ref:s=>this._comboElement=s,value:this.value,label:this.label,enabled:this.enabled,errorMessage:this.errorMessage,optionLoader:this.optionLoader,searchMode:!0,onEzChange:s=>this.onComboChange(s),showSelectedValue:this.showSelectedValue,showOptionValue:this.showOptionValue,suppressEmptyOption:this.suppressEmptyOption,mode:this.mode,canShowError:this.canShowError})}get _elem(){return i(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],value:["observeValue"]}}};o.style=":host{width:100%}";export{o as ez_search}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as s,h as i,g as e}from"./p-bfc7b8ca.js";import{NumberUtils as h,ElementIDUtils as r}from"@sankhyalabs/core";import{C as a}from"./p-4a5e37a7.js";const o=class{constructor(i){t(this,i),this.ezChange=s(this,"ezChange",7),this.ezStartChange=s(this,"ezStartChange",7),this.ezCancelWaitingChange=s(this,"ezCancelWaitingChange",7),this._focused=!1,this.label=void 0,this.value=void 0,this.enabled=!0,this.canShowError=!0,this.errorMessage=void 0,this.precision=void 0,this.prettyPrecision=void 0,this.mode="regular"}async setFocus(){this._textInput.setFocus()}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}observeLabel(){this._textInput&&(this._textInput.label=this.label)}observeErrorMessage(){var t;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(t=this.errorMessage)||void 0===t?void 0:t.trim())||this.setInputValue())}observeValue(t,s){if(this._textInput&&t!=s){const i=this.validateValue(t);if(i!=this.validateValue(s)){const t=this.getTextValue(i)||"";(this._textInput.value||"")!==t&&(void 0===this.getParsedNumber(t)&&this._focused||(this._textInput.value=t,this._focused=!1,this.errorMessage="")),this.ezChange.emit(null===i?void 0:i)}}}validateValue(t){return isNaN(t)||void 0===t?null:t}getTextValue(t){if(null!=t)return this.precision>0?h.format(t.toString(),Number(this.precision),Number(this.prettyPrecision)):t.toString()}changeValue(t){this.errorMessage="",this.value!=t?this.value=void 0===t?null:t:(this.setInputValue(),this.ezCancelWaitingChange.emit())}setError(t){this.value=null,this.errorMessage=t,this.ezCancelWaitingChange.emit()}handleBlur(){const t=this.getParsedNumber();if(void 0!==t&&isNaN(t))this.setError("O valor digitado não é um número válido");else try{this.changeValue(t)}catch(t){return void this.setError(t.message)}}handleInput(){this.getParsedNumber()!==this.value&&(this._focused=!0,this.ezStartChange.emit({waitmessage:"",blocking:!1}))}getParsedNumber(t){var s;return void 0===t&&(t=null===(s=this._textInput)||void 0===s?void 0:s.value),(null==t?void 0:t.trim())?h.stringToNumber(t):void 0}setInputValue(){const t=this.getTextValue(this.value)||"";(this._textInput.value||"")!==t&&(this._textInput.value=t)}componentDidLoad(){a.applyVarsTextInput(this._elem,this._textInput),this.setInputValue()}render(){return r.addIDInfoIfNotExists(this._elem,"input"),i("ez-text-input",{"data-element-id":r.getInternalIDInfo("textInput"),ref:t=>this._textInput=t,"data-slave-mode":"true",label:this.label,onBlur:()=>this.handleBlur(),onInput:()=>this.handleInput(),restrict:this.precision>0?"0123456789-,.":"0123456789-",enabled:this.enabled,errorMessage:this.errorMessage,mode:this.mode,canShowError:this.canShowError})}get _elem(){return e(this)}static get watchers(){return{label:["observeLabel"],errorMessage:["observeErrorMessage"],value:["observeValue"]}}};o.style=":host{display:block;width:100%}";export{o as ez_number_input}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as s,h as i,H as e,g as h}from"./p-bfc7b8ca.js";import{TimeFormatter as r,MaskFormatter as a,NumberUtils as o,ElementIDUtils as n}from"@sankhyalabs/core";import{C as l}from"./p-4a5e37a7.js";const u=class{constructor(i){t(this,i),this.ezChange=s(this,"ezChange",7),this.ezStartChange=s(this,"ezStartChange",7),this.ezCancelWaitingChange=s(this,"ezCancelWaitingChange",7),this.label=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.showSeconds=!1,this.mode="regular",this.canShowError=!0}observeErrorMessage(){var t;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(t=this.errorMessage)||void 0===t?void 0:t.trim())||(this.prepareValue(this._viewValue),(this._textInput.value||"")!==this._viewValue&&(this._textInput.value=this._viewValue)))}observeShowSeconds(){this.prepareMask(this.showSeconds?"##:##:##":"##:##")}observeValue(t,s){if(this._textInput&&t!=s){let i=this.validateValue(t);i!=this.validateValue(s)&&(this._viewValue=null==i?"":i.toString(),this.prepareValue(this._viewValue),this._viewValue&&!r.validateTime(this._viewValue,this.showSeconds)?(this.setError("Favor inserir um horário válido."),i=void 0):this.setError(""),this.ezChange.emit(null===i?void 0:i))}}prepareMask(t){null==this._maskFormatter?this._maskFormatter=new a(t):this._maskFormatter.mask=t}validateValue(t){return isNaN(t)||void 0===t?null:t}setError(t){this.errorMessage=t,this._textInput&&(null==t?void 0:t.trim())&&this.ezCancelWaitingChange.emit()}getViewValue(){return this._viewValue}prepareValue(t){try{this._viewValue=r.prepareValue(t,this.showSeconds),this._textInput&&this._textInput.value!==this._viewValue&&(this._textInput.value=this._viewValue)}catch(t){this.setError(t.message)}}async setFocus(){this._textInput.setFocus()}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}handleBlur(){this._textInput&&(this._viewValue=this._textInput.value,this.prepareValue(this._viewValue),this.value=o.stringToNumber(this._viewValue.replace(/\D/g,"")))}handleInput(){o.stringToNumber(this._textInput.value.replace(/\D/g,""))!==this.value&&this.ezStartChange.emit({waitmessage:"",blocking:!1})}componentDidLoad(){l.applyVarsTextInput(this._elem,this._textInput)}componentWillLoad(){this.observeShowSeconds(),this.value?this.prepareValue(this.value.toString()):this._viewValue&&this.prepareValue(this._viewValue)}render(){return n.addIDInfoIfNotExists(this._elem,"input"),i(e,null,i("ez-text-input",{"data-element-id":n.getInternalIDInfo("textInput"),ref:t=>this._textInput=t,"data-slave-mode":"true",value:this._viewValue,enabled:this.enabled,label:this.label,restrict:"0123456789:",onBlur:()=>this.handleBlur(),onInput:()=>this.handleInput(),errorMessage:this.errorMessage,mode:this.mode,canShowError:this.canShowError},i("ez-icon",{slot:"leftIcon",iconName:"timer-outline"})))}static get assetsDirs(){return["../assets"]}get _elem(){return h(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],showSeconds:["observeShowSeconds"],value:["observeValue"]}}};u.style=":host{display:flex;flex-wrap:wrap;position:relative;width:100%}";export{u as ez_time_input}
|