@sankhyalabs/ezui 1.1.97 → 1.1.98
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/{StringUtils-0ba09df4.js → AssetsUtils-69356e76.js} +22 -0
- package/dist/cjs/{UnitMetadata-2e11c5d3.js → UnitMetadata-63c56042.js} +1 -0
- package/dist/cjs/{ez-calendar_14.cjs.entry.js → ez-calendar_16.cjs.entry.js} +171 -7
- package/dist/cjs/ez-grid.cjs.entry.js +7 -4
- package/dist/cjs/ez-modal_2.cjs.entry.js +3 -4
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-form/fieldbuilder/FieldBuilder.js +2 -1
- package/dist/collection/components/ez-form/fieldbuilder/tpl/DateInput.tpl.js +4 -0
- package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +2 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +4 -2
- package/dist/custom-elements/index.js +12 -3
- package/dist/esm/{StringUtils-cbf10229.js → AssetsUtils-0e207bec.js} +22 -1
- package/dist/esm/{UnitMetadata-8b1bbaa2.js → UnitMetadata-109880b0.js} +1 -0
- package/dist/esm/{ez-calendar_14.entry.js → ez-calendar_16.entry.js} +165 -3
- package/dist/esm/ez-grid.entry.js +7 -4
- package/dist/esm/ez-modal_2.entry.js +2 -3
- package/dist/esm/ez-popover.entry.js +1 -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-1386e4d5.entry.js +1 -0
- package/dist/ezui/{p-532b5b24.entry.js → p-18de871c.entry.js} +2 -2
- package/dist/ezui/{p-07b60fe9.js → p-9fab5606.js} +1 -1
- package/dist/ezui/p-a30309ce.entry.js +1 -0
- package/dist/ezui/{p-45a25c30.entry.js → p-afb820c1.entry.js} +1 -1
- package/dist/ezui/p-ec7c1b86.js +1 -0
- package/dist/types/components/ez-form/fieldbuilder/tpl/DateInput.tpl.d.ts +4 -0
- package/package.json +2 -2
- package/dist/cjs/AssetsUtils-4909c6de.js +0 -24
- package/dist/cjs/CSSVarsUtils-8fbdf2e0.js +0 -19
- package/dist/cjs/ez-icon.cjs.entry.js +0 -42
- package/dist/cjs/ez-time-input.cjs.entry.js +0 -118
- package/dist/esm/AssetsUtils-9b1329a3.js +0 -22
- package/dist/esm/CSSVarsUtils-667e0016.js +0 -17
- package/dist/esm/ez-icon.entry.js +0 -38
- package/dist/esm/ez-time-input.entry.js +0 -114
- package/dist/ezui/p-2336c9ce.entry.js +0 -1
- package/dist/ezui/p-2f84ba72.js +0 -1
- package/dist/ezui/p-477bb703.js +0 -1
- package/dist/ezui/p-614fbb4e.entry.js +0 -1
- package/dist/ezui/p-7165ac4f.entry.js +0 -1
- package/dist/ezui/p-d3f87e18.entry.js +0 -1
- package/dist/ezui/p-d54c157f.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=/^([+-])?(\d+).?(\d*)[eE]([-+]?\d+)$/;class e{}e.stringToNumber=e=>{if(""===e||null==e)return NaN;if(e){var s="-"===(e=e.toString()).charAt(0);if(""===(e=t.test(e)?e.replace(/^-/g,""):e.replace(/[^\d.,]/g,"")))return Number(NaN);var r=e.indexOf(","),i=e.indexOf(".");i>r?e=e.replace(",",""):i<r&&(e=e.replace(/\./g,"@").replace(",",".").replace(/@/g,"")),s&&(e="-"+e)}return Number(e)},e.format=(t,s,r=NaN)=>{if(""===t||void 0===t||"NaN"===t)return NaN.toString();let i=e.stringToNumber(t);if(NaN===i)return NaN.toString();if(s<0||Math.abs(Math.round(1*s)/1)!==s)return e.changeFormat(i.toString());let n,c=0;c=NaN===r||Math.abs(Math.round(1*r)/1)!==r?s:r,n=(Math.round(i*Math.pow(10,s))/Math.pow(10,s)).toLocaleString("pt-br",{minimumFractionDigits:s});const a=s-c;if(a>0)for(let t=0;t<a;t++)"0"==n.substring(n.length-1)&&s>0&&(n=n.substring(0,n.length-1));return"."!=n.substring(n.length-1)&&","!=n.substring(n.length-1)||(n=n.substring(0,n.length-1)),n},e.keepOnlyDecimalSeparator=(t,e="pt-BR")=>(e=e.toUpperCase(),t.replace("EN-US"===e?/\,/g:/\./g,"")),e.changeFormat=t=>t.replace(/\./g,"_").replace(/\,/g,".").replace(/\_/g,",");class s{constructor(t){this._mask="",this._maskChars=new Array,this.placeholder=" ",this.mask=t}set mask(t){this._mask=t,this.updateInternalMask()}get mask(){return this._mask}format(t){let e="";const s=[0];let r=0;const i=this._maskChars.length;for(;r<i;)e=this._maskChars[r].append(e,t,s),r++;return e}updateInternalMask(){if(this._maskChars.length=0,null!=this.mask){let t=0;const e=this.mask.length;for(;t<e;){let r=this.mask.charAt(t);switch(r){case s.DIGIT_KEY:this._maskChars.push(new s.DigitMaskCharacter(this,r));break;case s.LITERAL_KEY:++t<e&&(r=this.mask.charAt(t),this._maskChars.push(new s.LiteralCharacter(this,r)));break;case s.UPPERCASE_KEY:this._maskChars.push(new s.UpperCaseCharacter(this,r));break;case s.LOWERCASE_KEY:this._maskChars.push(new s.LowerCaseCharacter(this,r));break;case s.ALPHA_NUMERIC_KEY:this._maskChars.push(new s.AlphaNumericCharacter(this,r));break;case s.CHARACTER_KEY:this._maskChars.push(new s.CharCharacter(this,r));break;case s.ANYTHING_KEY:this._maskChars.push(new s.MaskCharacter(this,r));break;default:this._maskChars.push(new s.LiteralCharacter(this,r))}t++}}}}s.DIGIT_KEY="#",s.LITERAL_KEY="'",s.UPPERCASE_KEY="U",s.LOWERCASE_KEY="L",s.ALPHA_NUMERIC_KEY="A",s.CHARACTER_KEY="?",s.ANYTHING_KEY="*",s.MaskCharacter=class{constructor(t,e){this.maskFormatter=t,this.type=e}isLiteral(){return!1}isValidCharacter(t){return this.isLiteral()?this.getChar(t)==t:(t=this.getChar(t),!0)}getChar(t){return t}append(t,e,s){const r=s[0]<e.length?e.charAt(s[0]):"";if(this.isLiteral()){const e=this.getChar(r);t+=e,e===r&&(s[0]=s[0]+1)}else if(s[0]>=e.length)t+=this.maskFormatter.placeholder,s[0]=s[0]+1;else{if(!this.isValidCharacter(r))throw new Error(`Valor inválido: "${r}". Na posição ${s[0]+1} espera-se ${this.getFormatMessage()}.`);t+=this.getChar(r),s[0]=s[0]+1}return t}getFormatMessage(){let t;switch(this.type){case s.UPPERCASE_KEY:case s.LOWERCASE_KEY:case s.CHARACTER_KEY:t="uma letra";break;case s.DIGIT_KEY:t="um número";break;case s.ALPHA_NUMERIC_KEY:t="uma letra ou um número";break;default:t=""}return t}},s.LiteralCharacter=class extends s.MaskCharacter{constructor(t,e){super(t,e),this._fixedChar=e}isLiteral(){return!0}getChar(t){return this._fixedChar}},s.DigitMaskCharacter=class extends s.MaskCharacter{isValidCharacter(t){return this.isDigit(t)&&super.isValidCharacter(t)}isDigit(t){return t>="0"&&t<="9"}},s.UpperCaseCharacter=class extends s.MaskCharacter{isValidCharacter(t){return/[a-z]/i.test(t)&&super.isValidCharacter(t)}getChar(t){return t.toUpperCase()}},s.LowerCaseCharacter=class extends s.MaskCharacter{isValidCharacter(t){return/[a-z]/i.test(t)&&super.isValidCharacter(t)}getChar(t){return t.toLocaleLowerCase()}},s.AlphaNumericCharacter=class extends s.MaskCharacter{isValidCharacter(t){return/[a-z0-9]/i.test(t)&&super.isValidCharacter(t)}},s.CharCharacter=class extends s.MaskCharacter{isValidCharacter(t){return/[a-z]/i.test(t)&&super.isValidCharacter(t)}};class r{static prepareValue(t,e){if(t&&t.length>0&&"NaN"!=t){let s=t.replace(/:/g,"");if(e){if(this._maskFormatter.mask="##:##:##",s.length<6)for(;s.length<6;)s="0".concat(s)}else if(this._maskFormatter.mask="##:##",s.length<4)for(;s.length<4;)s="0".concat(s);if(this._maskFormatter)try{return this._maskFormatter.format(s)}catch(t){throw new Error(t.message)}}return""}static validateTime(t,e){let s=!0;if(t){let r=t.replace(/:/g,"");e?(["1","2","0"].includes(r[0])||(s=!1),["0","1","2","3","4","5"].includes(r[2])||(s=!1),["0","1","2","3","4","5"].includes(r[4])||(s=!1),"2"!=r[0]||["0","1","2","3"].includes(r[1])||(s=!1)):(["1","2","0"].includes(r[0])||(s=!1),["0","1","2","3","4","5"].includes(r[2])||(s=!1),"2"!=r[0]||["0","1","2","3"].includes(r[1])||(s=!1))}else s=!1;return s}}var i,n;r._maskFormatter=new s("##:##"),function(t){t[t.GET=0]="GET",t[t.PUT=1]="PUT",t[t.POST=2]="POST",t[t.DELETE=3]="DELETE"}(i||(i={})),function(t){t.NUMBER="NUMBER",t.DATE="DATE",t.TEXT="TEXT",t.BOOLEAN="BOOLEAN",t.OBJECT="OBJECT"}(n||(n={}));const c=(t,e)=>{if(null==e)return e;switch(t){case n.NUMBER:return""===e||isNaN(e)?null:Number(e);case n.OBJECT:return"string"==typeof e?JSON.parse(e):e;case n.BOOLEAN:return Boolean(e);case n.DATE:return new Date(e.toString());default:return e}};class a{constructor(t,e){this._type=t,this._payload=e}get type(){return this._type}get payload(){return this._payload}}var h;!function(t){t.LOADING_METADATA="loadingMetadata",t.METADATA_LOADED="metadataLoaded",t.LOADING_DATA="loadingData",t.DATA_LOADED="dataLoaded",t.SAVING_DATA="savingData",t.DATA_SAVED="dataSaved",t.RECORDS_REMOVED="recordsRemoved",t.RECORDS_ADDED="recordsAdded",t.RECORDS_COPIED="recordsCopied",t.DATA_CHANGED="dataChanged",t.EDITION_CANCELED="editionCanceled",t.CHANGE_UNDONE="changeUndone",t.CHANGE_REDONE="changeRedone",t.SELECTION_CHANGED="selectionChanged",t.NEXT_SELECTED="nextSelected",t.PREVIOUS_SELECTED="previousSelected",t.STATE_CHANGED="stateChanged"}(h||(h={}));class o{constructor(t){this._past=[],this._future=[],this._present={},this._nonHist={},this._histClean=!1,this._reducers=t}process(t){const e=this._present;let s=!1;this._histClean=!1,this._reducers.forEach((e=>{const r=e.sliceName,i=this.isHistoric(r),n=this.getSlice(r,i),c=e.reduce(this,n,t);c!==n&&(this.updateSlice(r,c,i),s||(s=i))})),s&&!this._histClean&&(this._past.push(e),this._future=[],document.dispatchEvent(new CustomEvent("undoableAction",{detail:this})))}select(t,e){const s=this.isHistoric(t);return e(this.getSlice(t,s))}isHistoric(t){return t.startsWith("hist::")}updateSlice(t,e,s){s?(this._present=Object.assign(Object.assign({},this._present),{[t]:e}),void 0===e&&delete this._present[t]):(this._nonHist=Object.assign(Object.assign({},this._nonHist),{[t]:e}),void 0===e&&delete this._nonHist[t])}getSlice(t,e){return e?this._present[t]:this._nonHist[t]}canUndo(){return this._past.length>0}canRedo(){return this._future.length>0}undo(){this.canUndo()&&(this._future.push(this._present),this._present=this._past.pop())}redo(){this.canRedo()&&(this._past.push(this._present),this._present=this._future.pop())}clearUndo(){this._histClean=!0,this._past=[],this._future=[]}persist(){}}const u=new class{constructor(){this.sliceName=""}reduce(t,e,s){switch(s.type){case h.DATA_SAVED:case h.EDITION_CANCELED:t.clearUndo();break;case h.CHANGE_UNDONE:t.undo();break;case h.CHANGE_REDONE:t.redo()}}},d=new class{constructor(){this.sliceName="unitMetadata"}reduce(t,e,s){return s.type===h.METADATA_LOADED?s.payload:e}},l=t=>t.select(d.sliceName,(t=>t)),f=new class{constructor(){this.sliceName="hist::removedRecords"}reduce(t,e,s){switch(s.type){case h.RECORDS_REMOVED:return(e||[]).concat(s.payload);case h.EDITION_CANCELED:case h.DATA_SAVED:return}return e}},E=t=>t.select(f.sliceName,(t=>t)),g=new class{constructor(){this.sliceName="records"}reduce(t,e,s){switch(s.type){case h.DATA_LOADED:return s.payload;case h.DATA_SAVED:const e=new Map,r=w(t);if(r){const s=E(t)||[];r.forEach((t=>{s.includes(t.__record__id__)||e.set(t.__record__id__,t)}))}return s.payload.records.forEach((t=>{const s=t.__old__id__||t.__record__id__,r=Object.assign({},t);delete r.__old__id__,e.set(s,r)})),Array.from(e.values())}return e}},w=t=>t.select(g.sliceName,(t=>t)),v=new class{constructor(){this.sliceName="hist::addedRecords"}reduce(t,e,s){switch(s.type){case h.RECORDS_ADDED:case h.RECORDS_COPIED:return(e||[]).concat(s.payload);case h.DATA_SAVED:case h.EDITION_CANCELED:return}return e}},N=t=>t.select(v.sliceName,(t=>t)),p=(t,e)=>{let s=(N(t)||[]).length;return e.map((t=>Object.assign(Object.assign({},t),{__record__id__:"NEW_"+s++})))},b=new class{constructor(){this.sliceName="hist::changes"}reduce(t,e,s){switch(s.type){case h.DATA_CHANGED:const r=s.payload.records||R(t);if(r){const t=new Map(e);return r.forEach((e=>{const r=Object.assign(Object.assign({},t.get(e)),s.payload);delete r.records,t.set(e,r)})),t}return e;case h.DATA_SAVED:case h.EDITION_CANCELED:return}return e}},m=t=>t.select(b.sliceName,(t=>t)),T=new class{constructor(){this.sliceName="currentRecords"}reduce(t,e,s){let r=w(t);const i=N(t);if(!r&&!i)return;i&&(r=(r||[]).concat(i));const n=E(t);n&&(r=r.filter((t=>!n.includes(t.__record__id__))));const c=m(t);return new Map(r.map((t=>{const e=t.__record__id__;return[e,Object.assign(Object.assign({},t),null==c?void 0:c.get(e))]})))}},S=t=>t.select(T.sliceName,(t=>t)),M=new class{constructor(){this.sliceName="hist::selection"}reduce(t,e,s){switch(s.type){case h.RECORDS_ADDED:case h.RECORDS_COPIED:return s.payload.map((t=>t.__record__id__));case h.DATA_SAVED:return function(t,e){const s=R(t);if(s){const t=[];return s.forEach((s=>{const r=e.find((t=>t.__old__id__===s));t.push(r?r.__record__id__:s)})),t}return s}(t,s.payload.records);case h.RECORDS_REMOVED:const r=s.payload;return e&&r?e.filter((t=>!r.includes(t))):e;case h.NEXT_SELECTED:case h.PREVIOUS_SELECTED:const i=S(t);if(i&&i.size>0){let t;if(t=e&&0!==e.length?A(e[0],i)+(s.type===h.PREVIOUS_SELECTED?-1:1):s.type===h.PREVIOUS_SELECTED?0:Math.min(1,i.size),t<i.size&&t>=0)return[Array.from(i.values())[t].__record__id__]}return;case h.SELECTION_CHANGED:const{type:n,selection:c}=s.payload;if(c&&"index"===n){const e=S(t);if(e){const t=Array.from(e.values()),s=[];return c.forEach((r=>{r>0&&r<e.size&&s.push(t[r].__record__id__)})),s}}return c}return e}},R=t=>{let e=t.select(M.sliceName,(t=>t));const s=Array.from((S(t)||new Map).keys());return e&&(e=e.filter((t=>s.includes(t)))),(!e||0===e.length)&&s&&s.length>0?[s[0]]:e};function A(t,e){return Array.from(e.keys()).indexOf(t)}var C,O,D,y,I=function(t,e,s,r){return new(s||(s=Promise))((function(i,n){function c(t){try{h(r.next(t))}catch(t){n(t)}}function a(t){try{h(r.throw(t))}catch(t){n(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(c,a)}h((r=r.apply(t,e||[])).next())}))};class k{constructor(t){this._name=t,this._stateManager=new o([u,d,g,f,v,M,b,T]),this._observers=[],this._filterProviders=[],this._sortingProvider=void 0,this._interceptors=[]}get name(){return this._name}validateAndTypeValue(t,e){const s=this.getField(t);return s?c(s.dataType,e):e}getFilters(){let t;return this._filterProviders.forEach((e=>{const s=e.getFilter(this.name);s&&(t=(t||[]).concat(s))})),t}getSort(){return this._sortingProvider?this._sortingProvider.getSort(this._name):void 0}loadMetadata(){return I(this,void 0,void 0,(function*(){return this.dispatchAction(h.LOADING_METADATA),new Promise(((t,e)=>{this.metadataLoader&&this.metadataLoader(this).then((e=>{this.metadata=e,t(this.metadata)})).catch((t=>e(t)))}))}))}loadData(){return I(this,void 0,void 0,(function*(){return this.dispatchAction(h.LOADING_DATA),new Promise(((t,e)=>{if(this.dataLoader){const s=this.getSort(),r=this.getFilters();this.dataLoader(this,s,r).then((e=>{this.records=e,t(this.records)})).catch((t=>e(t)))}}))}))}saveData(){return I(this,void 0,void 0,(function*(){const t=((t,e)=>{const s=[],r=m(e),i=w(e);null==i||i.forEach((e=>{if(r){const i=r.get(e.__record__id__);i&&s.push(new U(t,e,i,C.UPDATE))}}));const n=N(e);n&&n.forEach((e=>{s.push(new U(t,e,null==r?void 0:r.get(e.__record__id__),C.INSERT))}));const c=E(e),a={};return null==i||i.forEach((t=>a[t.__record__id__]=t)),c&&c.forEach((e=>{s.push(new U(t,a[e],void 0,C.DELETE))})),s})(this._name,this._stateManager);return t.length>0?(this.dispatchAction(h.SAVING_DATA),new Promise(((e,s)=>{this.saveLoader&&this.saveLoader(this,t).then((e=>this.dispatchAction(h.DATA_SAVED,{changes:t,records:e}))).catch((t=>s(t)))}))):Promise.resolve()}))}valueFromString(t,e){const s=this.getField(t);return s?c(s.dataType,e):e}addInterceptor(t){this._interceptors.push(t)}addFilterProvider(t){this._filterProviders.push(t)}set sortingProvider(t){this._sortingProvider=t}set metadata(t){this.dispatchAction(h.METADATA_LOADED,t)}get metadata(){return l(this._stateManager)}set records(t){this.dispatchAction(h.DATA_LOADED,t)}get records(){const t=S(this._stateManager);return t?Array.from(t.values()):[]}getField(t){return((t,e)=>{const s=l(this._stateManager);return s?s.fields.find((t=>t.name===e)):void 0})(0,t)}addRecord(){this.dispatchAction(h.RECORDS_ADDED,p(this._stateManager,[{}]))}copySelected(){const t=this.getSelectedRecords();t&&this.dispatchAction(h.RECORDS_COPIED,p(this._stateManager,t))}removeSelectedRecords(){const t=R(this._stateManager);t&&this.dispatchAction(h.RECORDS_REMOVED,t)}getFieldValue(t){return((t,e)=>{const s=R(t);if(s&&s.length>0){const r=S(t);if(r){const t=r.get(s[0]);return t?t[e]:void 0}}})(this._stateManager,t)}setFieldValue(t,e,s){const r=this.validateAndTypeValue(t,e);this.getFieldValue(t)!==r&&this.dispatchAction(h.DATA_CHANGED,{[t]:r,records:s})}getSelection(){return R(this._stateManager)}setSelection(t){this.dispatchAction(h.SELECTION_CHANGED,{type:"id",selection:t})}setSelectionByIndex(t){this.dispatchAction(h.SELECTION_CHANGED,{type:"index",selection:t})}getSelectedRecords(){const t=this.getSelection();if(t){const e=this.records;return null==e?void 0:e.filter((e=>t.includes(e.__record__id__)))}}nextRecord(){this.dispatchAction(h.NEXT_SELECTED)}previousRecord(){this.dispatchAction(h.PREVIOUS_SELECTED)}cancelEdition(){this.dispatchAction(h.EDITION_CANCELED)}isDirty(){return void 0!==N(t=this._stateManager)||void 0!==E(t)||void 0!==m(t);var t}hasNext(){return(t=>{const e=S(t);if(e){const s=t.select(M.sliceName,(t=>t));return s&&0!==s.length?e.size>A(s[0],e)+1:e.size>0}return!1})(this._stateManager)}hasPrevious(){return(t=>{const e=S(t);if(e){const s=t.select(M.sliceName,(t=>t));return!(!s||0===s.length)&&A(s[0],e)>0}return!1})(this._stateManager)}canUndo(){return this._stateManager.canUndo()}canRedo(){return this._stateManager.canRedo()}undo(){this.dispatchAction(h.CHANGE_UNDONE)}redo(){this.dispatchAction(h.CHANGE_REDONE)}toString(){return this.name}dispatchAction(t,e){var s;let r=new a(t,e);null===(s=this._interceptors)||void 0===s||s.forEach((t=>{r&&(r=t.interceptAction(r))})),r&&(this._stateManager.process(r),this._observers.forEach((t=>t(r))))}subscribe(t){this._observers.push(t)}unsubscribe(t){this._observers=this._observers.filter((e=>e!==t))}}!function(t){t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"}(C||(C={}));class U{constructor(t,e,s,r){this.dataUnit=t,this.record=e,this.updatingFields=s,this._operation=r}get operation(){return this._operation.toString()}isInsert(){return this._operation===C.INSERT}isDelete(){return this._operation===C.DELETE}isUpdate(){return this._operation===C.UPDATE}}!function(t){t.ASC="ASC",t.DESC="DESC"}(O||(O={})),function(t){t.SEARCHING="SEARCHING",t.REQUIREMENT="REQUIREMENT",t.VISIBILITY="REQUIREMENT"}(D||(D={})),function(t){t.FILE="FILE",t.IMAGE="IMAGE",t.DATE="DATE",t.DATETIME="DATETIME",t.ELAPSEDTIME="ELAPSEDTIME",t.CHECKBOX="CHECKBOX",t.SWITCH="SWITCH",t.OPTIONSELECTOR="OPTIONSELECTOR",t.DECIMALNUMBER="DECIMALNUMBER",t.INTEGERNUMBER="INTEGERNUMBER",t.SEARCH="SEARCH",t.SHORTTEXT="SHORTTEXT",t.PASSWORD="PASSWORD",t.MASKEDTEXT="MASKEDTEXT",t.LONGTEXT="LONGTEXT",t.HTML="HTML"}(y||(y={}));export{h as A,a as D,s as M,e as N,O as S,r as T,y as U,k as a,n as b}
|
|
1
|
+
const t=/^([+-])?(\d+).?(\d*)[eE]([-+]?\d+)$/;class e{}e.stringToNumber=e=>{if(""===e||null==e)return NaN;if(e){var s="-"===(e=e.toString()).charAt(0);if(""===(e=t.test(e)?e.replace(/^-/g,""):e.replace(/[^\d.,]/g,"")))return Number(NaN);var r=e.indexOf(","),i=e.indexOf(".");i>r?e=e.replace(",",""):i<r&&(e=e.replace(/\./g,"@").replace(",",".").replace(/@/g,"")),s&&(e="-"+e)}return Number(e)},e.format=(t,s,r=NaN)=>{if(""===t||void 0===t||"NaN"===t)return NaN.toString();let i=e.stringToNumber(t);if(NaN===i)return NaN.toString();if(s<0||Math.abs(Math.round(1*s)/1)!==s)return e.changeFormat(i.toString());let n,c=0;c=NaN===r||Math.abs(Math.round(1*r)/1)!==r?s:r,n=(Math.round(i*Math.pow(10,s))/Math.pow(10,s)).toLocaleString("pt-br",{minimumFractionDigits:s});const a=s-c;if(a>0)for(let t=0;t<a;t++)"0"==n.substring(n.length-1)&&s>0&&(n=n.substring(0,n.length-1));return"."!=n.substring(n.length-1)&&","!=n.substring(n.length-1)||(n=n.substring(0,n.length-1)),n},e.keepOnlyDecimalSeparator=(t,e="pt-BR")=>(e=e.toUpperCase(),t.replace("EN-US"===e?/\,/g:/\./g,"")),e.changeFormat=t=>t.replace(/\./g,"_").replace(/\,/g,".").replace(/\_/g,",");class s{constructor(t){this._mask="",this._maskChars=new Array,this.placeholder=" ",this.mask=t}set mask(t){this._mask=t,this.updateInternalMask()}get mask(){return this._mask}format(t){let e="";const s=[0];let r=0;const i=this._maskChars.length;for(;r<i;)e=this._maskChars[r].append(e,t,s),r++;return e}updateInternalMask(){if(this._maskChars.length=0,null!=this.mask){let t=0;const e=this.mask.length;for(;t<e;){let r=this.mask.charAt(t);switch(r){case s.DIGIT_KEY:this._maskChars.push(new s.DigitMaskCharacter(this,r));break;case s.LITERAL_KEY:++t<e&&(r=this.mask.charAt(t),this._maskChars.push(new s.LiteralCharacter(this,r)));break;case s.UPPERCASE_KEY:this._maskChars.push(new s.UpperCaseCharacter(this,r));break;case s.LOWERCASE_KEY:this._maskChars.push(new s.LowerCaseCharacter(this,r));break;case s.ALPHA_NUMERIC_KEY:this._maskChars.push(new s.AlphaNumericCharacter(this,r));break;case s.CHARACTER_KEY:this._maskChars.push(new s.CharCharacter(this,r));break;case s.ANYTHING_KEY:this._maskChars.push(new s.MaskCharacter(this,r));break;default:this._maskChars.push(new s.LiteralCharacter(this,r))}t++}}}}s.DIGIT_KEY="#",s.LITERAL_KEY="'",s.UPPERCASE_KEY="U",s.LOWERCASE_KEY="L",s.ALPHA_NUMERIC_KEY="A",s.CHARACTER_KEY="?",s.ANYTHING_KEY="*",s.MaskCharacter=class{constructor(t,e){this.maskFormatter=t,this.type=e}isLiteral(){return!1}isValidCharacter(t){return this.isLiteral()?this.getChar(t)==t:(t=this.getChar(t),!0)}getChar(t){return t}append(t,e,s){const r=s[0]<e.length?e.charAt(s[0]):"";if(this.isLiteral()){const e=this.getChar(r);t+=e,e===r&&(s[0]=s[0]+1)}else if(s[0]>=e.length)t+=this.maskFormatter.placeholder,s[0]=s[0]+1;else{if(!this.isValidCharacter(r))throw new Error(`Valor inválido: "${r}". Na posição ${s[0]+1} espera-se ${this.getFormatMessage()}.`);t+=this.getChar(r),s[0]=s[0]+1}return t}getFormatMessage(){let t;switch(this.type){case s.UPPERCASE_KEY:case s.LOWERCASE_KEY:case s.CHARACTER_KEY:t="uma letra";break;case s.DIGIT_KEY:t="um número";break;case s.ALPHA_NUMERIC_KEY:t="uma letra ou um número";break;default:t=""}return t}},s.LiteralCharacter=class extends s.MaskCharacter{constructor(t,e){super(t,e),this._fixedChar=e}isLiteral(){return!0}getChar(t){return this._fixedChar}},s.DigitMaskCharacter=class extends s.MaskCharacter{isValidCharacter(t){return this.isDigit(t)&&super.isValidCharacter(t)}isDigit(t){return t>="0"&&t<="9"}},s.UpperCaseCharacter=class extends s.MaskCharacter{isValidCharacter(t){return/[a-z]/i.test(t)&&super.isValidCharacter(t)}getChar(t){return t.toUpperCase()}},s.LowerCaseCharacter=class extends s.MaskCharacter{isValidCharacter(t){return/[a-z]/i.test(t)&&super.isValidCharacter(t)}getChar(t){return t.toLocaleLowerCase()}},s.AlphaNumericCharacter=class extends s.MaskCharacter{isValidCharacter(t){return/[a-z0-9]/i.test(t)&&super.isValidCharacter(t)}},s.CharCharacter=class extends s.MaskCharacter{isValidCharacter(t){return/[a-z]/i.test(t)&&super.isValidCharacter(t)}};class r{static prepareValue(t,e){if(t&&t.length>0&&"NaN"!=t){let s=t.replace(/:/g,"");if(e){if(this._maskFormatter.mask="##:##:##",s.length<6)for(;s.length<6;)s="0".concat(s)}else if(this._maskFormatter.mask="##:##",s.length<4)for(;s.length<4;)s="0".concat(s);if(this._maskFormatter)try{return this._maskFormatter.format(s)}catch(t){throw new Error(t.message)}}return""}static validateTime(t,e){let s=!0;if(t){let r=t.replace(/:/g,"");e?(["1","2","0"].includes(r[0])||(s=!1),["0","1","2","3","4","5"].includes(r[2])||(s=!1),["0","1","2","3","4","5"].includes(r[4])||(s=!1),"2"!=r[0]||["0","1","2","3"].includes(r[1])||(s=!1)):(["1","2","0"].includes(r[0])||(s=!1),["0","1","2","3","4","5"].includes(r[2])||(s=!1),"2"!=r[0]||["0","1","2","3"].includes(r[1])||(s=!1))}else s=!1;return s}}var i,n;r._maskFormatter=new s("##:##"),function(t){t[t.GET=0]="GET",t[t.PUT=1]="PUT",t[t.POST=2]="POST",t[t.DELETE=3]="DELETE"}(i||(i={})),function(t){t.NUMBER="NUMBER",t.DATE="DATE",t.TEXT="TEXT",t.BOOLEAN="BOOLEAN",t.OBJECT="OBJECT"}(n||(n={}));const c=(t,e)=>{if(null==e)return e;switch(t){case n.NUMBER:return""===e||isNaN(e)?null:Number(e);case n.OBJECT:return"string"==typeof e?JSON.parse(e):e;case n.BOOLEAN:return Boolean(e);case n.DATE:return new Date(e.toString());default:return e}};class a{constructor(t,e){this._type=t,this._payload=e}get type(){return this._type}get payload(){return this._payload}}var h;!function(t){t.LOADING_METADATA="loadingMetadata",t.METADATA_LOADED="metadataLoaded",t.LOADING_DATA="loadingData",t.DATA_LOADED="dataLoaded",t.SAVING_DATA="savingData",t.DATA_SAVED="dataSaved",t.RECORDS_REMOVED="recordsRemoved",t.RECORDS_ADDED="recordsAdded",t.RECORDS_COPIED="recordsCopied",t.DATA_CHANGED="dataChanged",t.EDITION_CANCELED="editionCanceled",t.CHANGE_UNDONE="changeUndone",t.CHANGE_REDONE="changeRedone",t.SELECTION_CHANGED="selectionChanged",t.NEXT_SELECTED="nextSelected",t.PREVIOUS_SELECTED="previousSelected",t.STATE_CHANGED="stateChanged"}(h||(h={}));class o{constructor(t){this._past=[],this._future=[],this._present={},this._nonHist={},this._histClean=!1,this._reducers=t}process(t){const e=this._present;let s=!1;this._histClean=!1,this._reducers.forEach((e=>{const r=e.sliceName,i=this.isHistoric(r),n=this.getSlice(r,i),c=e.reduce(this,n,t);c!==n&&(this.updateSlice(r,c,i),s||(s=i))})),s&&!this._histClean&&(this._past.push(e),this._future=[],document.dispatchEvent(new CustomEvent("undoableAction",{detail:this})))}select(t,e){const s=this.isHistoric(t);return e(this.getSlice(t,s))}isHistoric(t){return t.startsWith("hist::")}updateSlice(t,e,s){s?(this._present=Object.assign(Object.assign({},this._present),{[t]:e}),void 0===e&&delete this._present[t]):(this._nonHist=Object.assign(Object.assign({},this._nonHist),{[t]:e}),void 0===e&&delete this._nonHist[t])}getSlice(t,e){return e?this._present[t]:this._nonHist[t]}canUndo(){return this._past.length>0}canRedo(){return this._future.length>0}undo(){this.canUndo()&&(this._future.push(this._present),this._present=this._past.pop())}redo(){this.canRedo()&&(this._past.push(this._present),this._present=this._future.pop())}clearUndo(){this._histClean=!0,this._past=[],this._future=[]}persist(){}}const u=new class{constructor(){this.sliceName=""}reduce(t,e,s){switch(s.type){case h.DATA_SAVED:case h.EDITION_CANCELED:t.clearUndo();break;case h.CHANGE_UNDONE:t.undo();break;case h.CHANGE_REDONE:t.redo()}}},d=new class{constructor(){this.sliceName="unitMetadata"}reduce(t,e,s){return s.type===h.METADATA_LOADED?s.payload:e}},l=t=>t.select(d.sliceName,(t=>t)),f=new class{constructor(){this.sliceName="hist::removedRecords"}reduce(t,e,s){switch(s.type){case h.RECORDS_REMOVED:return(e||[]).concat(s.payload);case h.EDITION_CANCELED:case h.DATA_SAVED:return}return e}},E=t=>t.select(f.sliceName,(t=>t)),g=new class{constructor(){this.sliceName="records"}reduce(t,e,s){switch(s.type){case h.DATA_LOADED:return s.payload;case h.DATA_SAVED:const e=new Map,r=w(t);if(r){const s=E(t)||[];r.forEach((t=>{s.includes(t.__record__id__)||e.set(t.__record__id__,t)}))}return s.payload.records.forEach((t=>{const s=t.__old__id__||t.__record__id__,r=Object.assign({},t);delete r.__old__id__,e.set(s,r)})),Array.from(e.values())}return e}},w=t=>t.select(g.sliceName,(t=>t)),v=new class{constructor(){this.sliceName="hist::addedRecords"}reduce(t,e,s){switch(s.type){case h.RECORDS_ADDED:case h.RECORDS_COPIED:return(e||[]).concat(s.payload);case h.DATA_SAVED:case h.EDITION_CANCELED:return}return e}},N=t=>t.select(v.sliceName,(t=>t)),p=(t,e)=>{let s=(N(t)||[]).length;return e.map((t=>Object.assign(Object.assign({},t),{__record__id__:"NEW_"+s++})))},b=new class{constructor(){this.sliceName="hist::changes"}reduce(t,e,s){switch(s.type){case h.DATA_CHANGED:const r=s.payload.records||R(t);if(r){const t=new Map(e);return r.forEach((e=>{const r=Object.assign(Object.assign({},t.get(e)),s.payload);delete r.records,t.set(e,r)})),t}return e;case h.DATA_SAVED:case h.EDITION_CANCELED:return}return e}},T=t=>t.select(b.sliceName,(t=>t)),m=new class{constructor(){this.sliceName="currentRecords"}reduce(t,e,s){let r=w(t);const i=N(t);if(!r&&!i)return;i&&(r=(r||[]).concat(i));const n=E(t);n&&(r=r.filter((t=>!n.includes(t.__record__id__))));const c=T(t);return new Map(r.map((t=>{const e=t.__record__id__;return[e,Object.assign(Object.assign({},t),null==c?void 0:c.get(e))]})))}},M=t=>t.select(m.sliceName,(t=>t)),S=new class{constructor(){this.sliceName="hist::selection"}reduce(t,e,s){switch(s.type){case h.RECORDS_ADDED:case h.RECORDS_COPIED:return s.payload.map((t=>t.__record__id__));case h.DATA_SAVED:return function(t,e){const s=R(t);if(s){const t=[];return s.forEach((s=>{const r=e.find((t=>t.__old__id__===s));t.push(r?r.__record__id__:s)})),t}return s}(t,s.payload.records);case h.RECORDS_REMOVED:const r=s.payload;return e&&r?e.filter((t=>!r.includes(t))):e;case h.NEXT_SELECTED:case h.PREVIOUS_SELECTED:const i=M(t);if(i&&i.size>0){let t;if(t=e&&0!==e.length?A(e[0],i)+(s.type===h.PREVIOUS_SELECTED?-1:1):s.type===h.PREVIOUS_SELECTED?0:Math.min(1,i.size),t<i.size&&t>=0)return[Array.from(i.values())[t].__record__id__]}return;case h.SELECTION_CHANGED:const{type:n,selection:c}=s.payload;if(c&&"index"===n){const e=M(t);if(e){const t=Array.from(e.values()),s=[];return c.forEach((r=>{r>0&&r<e.size&&s.push(t[r].__record__id__)})),s}}return c}return e}},R=t=>{let e=t.select(S.sliceName,(t=>t));const s=Array.from((M(t)||new Map).keys());return e&&(e=e.filter((t=>s.includes(t)))),(!e||0===e.length)&&s&&s.length>0?[s[0]]:e};function A(t,e){return Array.from(e.keys()).indexOf(t)}var C,O,D,y,I=function(t,e,s,r){return new(s||(s=Promise))((function(i,n){function c(t){try{h(r.next(t))}catch(t){n(t)}}function a(t){try{h(r.throw(t))}catch(t){n(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(c,a)}h((r=r.apply(t,e||[])).next())}))};class k{constructor(t){this._name=t,this._stateManager=new o([u,d,g,f,v,S,b,m]),this._observers=[],this._filterProviders=[],this._sortingProvider=void 0,this._interceptors=[]}get name(){return this._name}validateAndTypeValue(t,e){const s=this.getField(t);return s?c(s.dataType,e):e}getFilters(){let t;return this._filterProviders.forEach((e=>{const s=e.getFilter(this.name);s&&(t=(t||[]).concat(s))})),t}getSort(){return this._sortingProvider?this._sortingProvider.getSort(this._name):void 0}loadMetadata(){return I(this,void 0,void 0,(function*(){return this.dispatchAction(h.LOADING_METADATA),new Promise(((t,e)=>{this.metadataLoader&&this.metadataLoader(this).then((e=>{this.metadata=e,t(this.metadata)})).catch((t=>e(t)))}))}))}loadData(){return I(this,void 0,void 0,(function*(){return this.dispatchAction(h.LOADING_DATA),new Promise(((t,e)=>{if(this.dataLoader){const s=this.getSort(),r=this.getFilters();this.dataLoader(this,s,r).then((e=>{this.records=e,t(this.records)})).catch((t=>e(t)))}}))}))}saveData(){return I(this,void 0,void 0,(function*(){const t=((t,e)=>{const s=[],r=T(e),i=w(e);null==i||i.forEach((e=>{if(r){const i=r.get(e.__record__id__);i&&s.push(new U(t,e,i,C.UPDATE))}}));const n=N(e);n&&n.forEach((e=>{s.push(new U(t,e,null==r?void 0:r.get(e.__record__id__),C.INSERT))}));const c=E(e),a={};return null==i||i.forEach((t=>a[t.__record__id__]=t)),c&&c.forEach((e=>{s.push(new U(t,a[e],void 0,C.DELETE))})),s})(this._name,this._stateManager);return t.length>0?(this.dispatchAction(h.SAVING_DATA),new Promise(((e,s)=>{this.saveLoader&&this.saveLoader(this,t).then((e=>this.dispatchAction(h.DATA_SAVED,{changes:t,records:e}))).catch((t=>s(t)))}))):Promise.resolve()}))}valueFromString(t,e){const s=this.getField(t);return s?c(s.dataType,e):e}addInterceptor(t){this._interceptors.push(t)}addFilterProvider(t){this._filterProviders.push(t)}set sortingProvider(t){this._sortingProvider=t}set metadata(t){this.dispatchAction(h.METADATA_LOADED,t)}get metadata(){return l(this._stateManager)}set records(t){this.dispatchAction(h.DATA_LOADED,t)}get records(){const t=M(this._stateManager);return t?Array.from(t.values()):[]}getField(t){return((t,e)=>{const s=l(this._stateManager);return s?s.fields.find((t=>t.name===e)):void 0})(0,t)}addRecord(){this.dispatchAction(h.RECORDS_ADDED,p(this._stateManager,[{}]))}copySelected(){const t=this.getSelectedRecords();t&&this.dispatchAction(h.RECORDS_COPIED,p(this._stateManager,t))}removeSelectedRecords(){const t=R(this._stateManager);t&&this.dispatchAction(h.RECORDS_REMOVED,t)}getFieldValue(t){return((t,e)=>{const s=R(t);if(s&&s.length>0){const r=M(t);if(r){const t=r.get(s[0]);return t?t[e]:void 0}}})(this._stateManager,t)}setFieldValue(t,e,s){const r=this.validateAndTypeValue(t,e);this.getFieldValue(t)!==r&&this.dispatchAction(h.DATA_CHANGED,{[t]:r,records:s})}getSelection(){return R(this._stateManager)}setSelection(t){this.dispatchAction(h.SELECTION_CHANGED,{type:"id",selection:t})}setSelectionByIndex(t){this.dispatchAction(h.SELECTION_CHANGED,{type:"index",selection:t})}getSelectedRecords(){const t=this.getSelection();if(t){const e=this.records;return null==e?void 0:e.filter((e=>t.includes(e.__record__id__)))}}nextRecord(){this.dispatchAction(h.NEXT_SELECTED)}previousRecord(){this.dispatchAction(h.PREVIOUS_SELECTED)}cancelEdition(){this.dispatchAction(h.EDITION_CANCELED)}isDirty(){return void 0!==N(t=this._stateManager)||void 0!==E(t)||void 0!==T(t);var t}hasNext(){return(t=>{const e=M(t);if(e){const s=t.select(S.sliceName,(t=>t));return s&&0!==s.length?e.size>A(s[0],e)+1:e.size>0}return!1})(this._stateManager)}hasPrevious(){return(t=>{const e=M(t);if(e){const s=t.select(S.sliceName,(t=>t));return!(!s||0===s.length)&&A(s[0],e)>0}return!1})(this._stateManager)}canUndo(){return this._stateManager.canUndo()}canRedo(){return this._stateManager.canRedo()}undo(){this.dispatchAction(h.CHANGE_UNDONE)}redo(){this.dispatchAction(h.CHANGE_REDONE)}toString(){return this.name}dispatchAction(t,e){var s;let r=new a(t,e);null===(s=this._interceptors)||void 0===s||s.forEach((t=>{r&&(r=t.interceptAction(r))})),r&&(this._stateManager.process(r),this._observers.forEach((t=>t(r))))}subscribe(t){this._observers.push(t)}unsubscribe(t){this._observers=this._observers.filter((e=>e!==t))}}!function(t){t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"}(C||(C={}));class U{constructor(t,e,s,r){this.dataUnit=t,this.record=e,this.updatingFields=s,this._operation=r}get operation(){return this._operation.toString()}isInsert(){return this._operation===C.INSERT}isDelete(){return this._operation===C.DELETE}isUpdate(){return this._operation===C.UPDATE}}!function(t){t.ASC="ASC",t.DESC="DESC"}(O||(O={})),function(t){t.SEARCHING="SEARCHING",t.REQUIREMENT="REQUIREMENT",t.VISIBILITY="REQUIREMENT"}(D||(D={})),function(t){t.FILE="FILE",t.IMAGE="IMAGE",t.DATE="DATE",t.DATETIME="DATETIME",t.TIME="TIME",t.ELAPSEDTIME="ELAPSEDTIME",t.CHECKBOX="CHECKBOX",t.SWITCH="SWITCH",t.OPTIONSELECTOR="OPTIONSELECTOR",t.DECIMALNUMBER="DECIMALNUMBER",t.INTEGERNUMBER="INTEGERNUMBER",t.SEARCH="SEARCH",t.SHORTTEXT="SHORTTEXT",t.PASSWORD="PASSWORD",t.MASKEDTEXT="MASKEDTEXT",t.LONGTEXT="LONGTEXT",t.HTML="HTML"}(y||(y={}));export{h as A,a as D,s as M,e as N,O as S,r as T,y as U,k as a,n as b}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,c as t,h as e,H as o}from"./p-89a57641.js";import{S as d,g as l}from"./p-ec7c1b86.js";import"./p-9fab5606.js";let a=class{constructor(e){i(this,e),this.ezCloseModal=t(this,"ezCloseModal",7),this.opened=!0,this.closeEsc=!1,this.closeOutsideClick=!1,this.handleKeyboardEvent=i=>{"Escape"===(null==i?void 0:i.key)&&this.closeEsc&&this.closeModal()}}handleopenedChange(){this.opened?document.addEventListener("keydown",this.handleKeyboardEvent):document.removeEventListener("keydown",this.handleKeyboardEvent)}closeModal(){this.opened=!1,this.ezCloseModal.emit(this.opened)}componentDidLoad(){this.handleopenedChange()}onMouseDownHandler(i){this.closeOutsideClick&&i.target===this._overlay&&this.closeModal()}render(){const i="left"===this.align?"left":"right";return e(o,null,this.opened?e("div",{class:"modal",onMouseDown:i=>this.onMouseDownHandler(i)},e("div",{class:`modal__container modal__container--${i}`,ref:i=>this._overlay=i},e("div",{class:`modal__content modal__content--${i} ${this.modalSize}`},e("slot",null)))):void 0)}static get watchers(){return{opened:["handleopenedChange"]}}};a.style=":host{--ez-modal-z-index:var(--most-visible, 3);--ez-modal-vertical-padding:var(--space--large, 24px);display:block}.modal{position:fixed;padding:var(--ez-modal-vertical-padding) 0;display:flex;top:0px;z-index:var(--ez-modal-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}@keyframes expand-modal--left{from{transform:translate(-100%)}}@keyframes expand-modal--right{from{transform:translate(100%)}}.modal__container{display:flex;flex-wrap:wrap;height:100%;box-sizing:border-box;width:100%;align-items:flex-start}.modal__container--right{animation:expand-modal--right .2s ease-in-out 1;justify-content:flex-end}.modal__container--left{animation:expand-modal--left .2s ease-in-out 1;justify-content:flex-start}.modal__content{display:flex;flex-wrap:wrap;max-height:calc(100% - 48px);height:100%;overflow-y:auto;background-color:rgb(255, 255, 255);padding:24px;border-radius:12px 0px 0px 12px;box-shadow:rgb(0 38 111 / 12%) 0px 0px 16px 0px}.modal__content--right{border-radius:12px 0px 0px 12px}.modal__content--left{border-radius:0px 12px 12px 0px}.modal__box__container{display:flex;flex-wrap:wrap;background-color:#fff;width:100%;border-radius:12px}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";let s=class{constructor(e){i(this,e),this.configFinish=t(this,"configFinish",7),this.configCancel=t(this,"configCancel",7),this._columnListHistory=[],this._orderListItems=[],this._columListItems=[],this.selectedTab="Colunas",this._selectedIndex=-1}createOrderList(){var i;let t=[];(null===(i=this._columnListHistory)||void 0===i?void 0:i.length)>0?this._columnListHistory.find((i=>"Visíveis"===i.group)).items.forEach((i=>{t.push({label:i.label})})):this.columns.forEach((i=>{i.hidden||t.push({name:i.name,label:i.label})})),this._orderListItems=t}createColumnList(){let i={group:"Visíveis",items:[]},t={group:"Ocultas",items:[],sort:"ASC"};this.columns.forEach((e=>{let o={label:e.label};e.hidden?t.items.push(o):i.items.push(o)})),this._columnListHistory.length<=0&&(this._columListItems=[i,t])}buildColumnListSlot(i,t){return e("div",null,e("ez-check",{mode:"switch",id:"switch"+i+t,value:"Visíveis"===t.group,onEzChange:t=>{this.switchColumnGroup(t,i)}}))}buildOrderListSlot(i){let t=this.columns.find((t=>t.label===i.label));return e("div",null,e("select-box",{selectedOption:null==t?void 0:t.sort,key:"select-box"+i,onEzChange:t=>{t.stopPropagation(),this.updateOrder(t.detail,i)}}))}updateOrder(i,t){let e=[...this.columns],o=e.find((i=>i.label===t.label));o&&(o.sort=i.value),this.columns=e}switchColumnGroup(i,t){i.stopPropagation();let e=[...this._columListItems];if(!0===i.detail){let i=e.find((i=>"Ocultas"===i.group)),o=i.items.findIndex((i=>i.label===t.label));o>=0&&i.items.splice(o,1),e.find((i=>"Visíveis"===i.group)).items.push(t),this._columListItems=e,this.createOrderList()}else if(!1===i.detail){let i=e.find((i=>"Visíveis"===i.group)),o=i.items.findIndex((i=>i.label===t.label));o>=0&&i.items.splice(o,1),e.find((i=>"Ocultas"===i.group)).items.push(t),this._columListItems=e,this.createOrderList()}}finish(){let i=[];this._columListItems.forEach((t=>{t.items.forEach((e=>{const o=this.columns.find((i=>i.label===e.label));let d=Object.assign({},o);d.hidden="Ocultas"===t.group,i.push(d)}))})),this._columnListHistory=[],this.columns=i,this.configFinish.emit(this.columns)}async locateColumn(i,t){var e;const o="Enter"===i.key;t||(t=null===(e=i.currentTarget)||void 0===e?void 0:e.value);let d=-1;if("Ordenação das linhas"===this.selectedTab)if(t){const i=[];let e,l;if(await this._orderList.getList().then((o=>{e=o,e.forEach(((e,o)=>{this.compareWords(e,t)&&i.push(o)}))})),i.length>0){if(o)for(let t=0;t<i.length;t++)if(i[t]>this._selectedIndex){d=i[t];break}-1===d&&(d=i[0])}this._selectedIndex=d,l=e[d],l?this._orderList.setSelection({label:l.label},!0):this._orderList.setSelection(void 0)}else this._orderList.setSelection(void 0);else if(t){const i=[];if(this.columns.forEach(((e,o)=>{this.compareWords(e,t)&&i.push(o)})),i.length>0){if(o)for(let t=0;t<i.length;t++)if(i[t]>this._selectedIndex){d=i[t];break}-1===d&&(d=i[0])}this._selectedIndex=d;let e=this.columns[d];e?this._columnList.setSelection({label:e.label},!0):this._columnList.setSelection(void 0)}else this._columnList.setSelection(void 0)}compareWords(i,t){return d.replaceAccentuatedChars(i.label).indexOf(d.replaceAccentuatedChars(t))>-1}closeConfig(){this._columnListHistory=[],this.configCancel.emit()}handleTabChange(i){var t;(null===(t=null==i?void 0:i.target)||void 0===t?void 0:t.selectedTab)&&("Ordenação das linhas"===i.target.selectedTab&&(this._columnListHistory=this._columnList.dataSource,this.createOrderList()),this.selectedTab=i.target.selectedTab)}handleColumnListChange(i){var t;if(i.detail){let e=null===(t=i.detail.find((i=>"Visíveis"===i.group)))||void 0===t?void 0:t.items;e&&(this._orderListItems=e)}}componentWillRender(){var i;(null===(i=this.columns)||void 0===i?void 0:i.length)>0&&(this.createColumnList(),this.createOrderList())}componentDidRender(){var i;(null===(i=this.columns)||void 0===i?void 0:i.length)>0&&this.locateColumn(new KeyboardEvent("arrow-right",{key:"ArrowRight"}),this._searchElement.value)}render(){return e(o,null,e("div",{class:"grid-config__header"},e("div",{class:"title-container"},e("div",{class:""},e("label",{class:"title"},"Configuração da Grade"),e("label",{class:"subtitle"},"Defina visibilidade e ordem das colunas.")),e("div",{class:"button-close"},e("ez-button",{mode:"icon",image:l("close"),size:"medium",onClick:()=>this.closeConfig()}))),e("div",{class:"tabselector-container"},e("ez-tabselector",{selectedTab:this.selectedTab,selectedIndex:0,onEzChange:i=>{this.handleTabChange(i)},tabs:"Colunas, Ordenação das linhas"})),e("div",null,e("ez-text-input",{ref:i=>this._searchElement=i,label:"Localizar coluna",onKeyUp:i=>this.locateColumn(i)},e("ez-icon",{slot:"leftIcon",size:"medium",href:l("search")})))),e("div",{class:"grid-config__main"},e("ez-list",{ref:i=>this._columnList=i,class:"Colunas"===this.selectedTab?"":"hidden",dataSource:this._columListItems,onEzChange:i=>this.handleColumnListChange(i),ezDraggable:!0,ezSelectable:!0,itemSlotBuilder:(i,t)=>this.buildColumnListSlot(i,t),useGroups:!0}),e("div",{class:"Ordenação das linhas"===this.selectedTab?"group-name":"hidden"},"Sequência da ordenação"),e("ez-list",{ref:i=>this._orderList=i,class:"Ordenação das linhas"===this.selectedTab?"heigth-calc":"hidden",dataSource:this._orderListItems,ezSelectable:!0,ezDraggable:!0,itemSlotBuilder:i=>this.buildOrderListSlot(i)})),e("div",{class:"grid-config__footer"},e("ez-button",{class:"padding-right--medium",label:"Cancelar",onClick:()=>this.closeConfig()}),e("ez-button",{label:"Concluir",class:"button--primary",onClick:()=>this.finish()})))}static get assetsDirs(){return["../assets"]}};s.style='.sc-grid-config-h{--ez-grid-config__footer--padding-top:var(--space--medium, 12px);--ez-grid-config__main--padding-right:var(--space--medium, 12px);--ez-grid-config__tabselector-container--padding:var(--space--medium, 12px);--ez-grid-config__button-close--padding-left:var(--space--medium, 12px);--ez-grid-config__subtitle--font-family:var(--font-pattern, "Sora");--ez-grid-config__title--font-family:var(--font-pattern, "Sora");--ez-grid-config__title--font-weight:var(--text-weight--large, 700);--ez-grid-config__subtitle--font-size:var(--text--medium, 14px);--ez-grid-config__scrollbar--width:var(--space--medium, 12px);--ez-grid-config__main__scrollbar--background-color:var(--text--primary, #626e82);--ez-grid-config__main__scrollbar--border-radius:var(--border--radius-medium, 12px);--ez-grid__group--font-family:var(--font-pattern, "Sora");--ez-grid__group--font-size:var(--text--medium, 14px);--ez-grid__group--font-weight:var(--text-weight--large, 600);--ez-grid__group--padding-bottom:var(--space-small, 6px);display:grid;grid-template-rows:auto 1fr auto;max-height:100%;width:100%}.padding-right--medium.sc-grid-config{padding-right:var(--space--medium)}ez-list.sc-grid-config{height:100%}.heigth-calc.sc-grid-config{max-height:calc(100% - 24px)}.grid-config__footer.sc-grid-config{padding-top:var(--ez-grid-config__footer--padding-top);display:flex;justify-content:flex-end;width:100%}.hidden.sc-grid-config{display:none}.grid-config__main.sc-grid-config{padding-right:var(--ez-grid-config__main--padding-right);overflow-y:auto}.tabselector-container.sc-grid-config{padding:var(--ez-grid-config__tabselector-container--padding) 0}.button-close.sc-grid-config{padding-left:var(--ez-grid-config__button-close--padding-left)}.title-container.sc-grid-config{display:flex;justify-content:space-between;align-items:center;width:359px}.subtitle.sc-grid-config{font-family:var(--ez-grid-config__subtitle--font-family);font-size:var(--ez-grid-config__subtitle--font-size);color:var(--text--primary)}.title.sc-grid-config{display:flex;margin:0;font-family:var(--ez-grid-config__title--font-family);font-size:var(--title--large);font-weight:var(--ez-grid-config__title--font-weight);line-height:normal;letter-spacing:0em;text-align:left;color:var(--title--primary)}.grid-config__main.sc-grid-config::-webkit-scrollbar-track{background-color:#f0f2f5}.grid-config__main.sc-grid-config::-webkit-scrollbar-thumb{background-color:var(--ez-grid-config__main__scrollbar--background-color);border-radius:var(--ez-grid-config__main__scrollbar--border-radius)}.grid-config__main.sc-grid-config::-webkit-scrollbar{background-color:#f0f2f5;width:var(--ez-grid-config__scrollbar--width);max-width:var(--ez-grid-config__scrollbar--width);min-width:var(--ez-grid-config__scrollbar--width)}.group-name.sc-grid-config{font-family:var(--ez-grid__group--font-family);font-size:var(--ez-grid__group--font-size);font-weight:var(--ez-grid__group--font-weight);padding-bottom:var(--ez-grid__group--padding-bottom)}';export{a as ez_modal,s as grid_config}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as o,H as s,g as e}from"./p-89a57641.js";import"./p-
|
|
1
|
+
import{r as t,c as i,h as o,H as s,g as e}from"./p-89a57641.js";import"./p-9fab5606.js";import{F as r}from"./p-ddd0ef12.js";let h=class{constructor(o){t(this,o),this.ezVisibilityChange=i(this,"ezVisibilityChange",7),this._firstRender=!0,this.autoClose=!0,this.top="0px",this.left="0px",this.bottom="0px",this.right="0px",this.boxWidth="fit-content"}dispatchVisibilityChange(t,i){t!=i&&this.ezVisibilityChange.emit(t)}async updatePosition(t=this.top,i=this.left,o=this.bottom,s=this.right){r.updateFloatPosition(this._box,this._container,{autoClose:this.autoClose,top:t,left:i,bottom:o,right:s,innerClickTest:(t,i)=>!!t.contains(i)||!(!t.shadowRoot||!t.shadowRoot.contains(i))||((t=this._host).lastElementChild.shadowRoot?t.lastElementChild.shadowRoot.contains(i):t.contains(i))})}async show(t=this.top,i=this.left,o=this.bottom,s=this.right){this._floatingID=r.float(this._box,this._container,{autoClose:this.autoClose,top:t,left:i,bottom:o,right:s,innerClickTest:(t,i)=>!!t.contains(i)||!(!t.shadowRoot||!t.shadowRoot.contains(i))||((t=this._host).lastElementChild.shadowRoot?t.lastElementChild.shadowRoot.contains(i):t.contains(i))}),this.opened=!0}async hide(){void 0!==this._floatingID&&(r.close(this._floatingID),this._floatingID=void 0,this.opened=!1)}componentDidRender(){this._firstRender&&(this._box.remove(),this._firstRender=!1)}render(){return o(s,null,o("section",{ref:t=>this._container=t},o("div",{class:"box "+("fit-content"===this.boxWidth?"box--fit-content":"box--full-width"),ref:t=>this._box=t},o("slot",null))))}get _host(){return e(this)}static get watchers(){return{opened:["dispatchVisibilityChange"]}}};h.style=":host{--ez-popover__box--border-radius:var(--border--radius-medium, 12px);--ez-popover__box--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-popover__box--background-color:var(--background--xlight, #fff);--ez-popover__box--z-index:var(--more-visible, 1);position:relative;display:flex;user-select:none;width:100%}.box{z-index:var(--ez-popover__box--z-index);display:flex;flex-direction:column;height:fit-content;background-color:var(--ez-popover__box--background-color);border-radius:var(--ez-popover__box--border-radius);box-shadow:var(--ez-popover__box--box-shadow)}.box--fit-content{width:fit-content}.box--full-width{width:100%}";export{h as ez_popover}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s,s as t}from"./p-89a57641.js";class a{static isEmpty(s){return null==s||null===s||0===(s=(s=s.toString()).trim()).length}static replaceAccentuatedChars(s){return(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=s.toUpperCase()).replace(/[À]/,"A")).replace(/[Á]/,"A")).replace(/[Â]/,"A")).replace(/[Ã]/,"A")).replace(/[Ä]/,"A")).replace(/[È]/,"E")).replace(/[É]/,"E")).replace(/[Ê]/,"E")).replace(/[Ë]/,"E")).replace(/[Ì]/,"I")).replace(/[Í]/,"I")).replace(/[Î]/,"I")).replace(/[Ï]/,"I")).replace(/[Ò]/,"O")).replace(/[Ó]/,"O")).replace(/[Ô]/,"O")).replace(/[Ö]/,"O")).replace(/[Ù]/,"U")).replace(/[Ú]/,"U")).replace(/[Û]/,"U")).replace(/[Ü]/,"U")).replace(/[Ç]/,"C")).replace(/[^a-z0-9]/gi,"")}}const e=a=>`${function(){if(!r){const s=document.querySelector("script[data-ezui-assets-url]");if(s){let a=s.dataset.ezuiAssetsUrl;a&&(a.startsWith("/")&&(a=window.location.origin+a),t(a))}r=!0}return s("../assets/actions-sprite.svg")}()}#${a}`;let r=!1;export{a as S,e as g}
|
|
@@ -3,6 +3,10 @@ export declare const buildDate: ({ name, label, readOnly }: {
|
|
|
3
3
|
label: any;
|
|
4
4
|
readOnly: any;
|
|
5
5
|
}) => HTMLElement;
|
|
6
|
+
export declare const buildTime: ({ name, label }: {
|
|
7
|
+
name: any;
|
|
8
|
+
label: any;
|
|
9
|
+
}) => HTMLElement;
|
|
6
10
|
export declare const buildTimeDate: ({ name, label }: {
|
|
7
11
|
name: any;
|
|
8
12
|
label: any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sankhyalabs/ezui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.98",
|
|
4
4
|
"description": "Biblioteca de componentes Sankhya.",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/custom-elements/index.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"author": "",
|
|
47
47
|
"license": "ISC",
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@sankhyalabs/core": "^1.0.
|
|
49
|
+
"@sankhyalabs/core": "^1.0.38",
|
|
50
50
|
"@sankhyalabs/ez-design": "^1.0.47",
|
|
51
51
|
"@storybook/addon-notes": "^5.3.21",
|
|
52
52
|
"@storybook/html": "^6.4.17",
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const index = require('./index-88286449.js');
|
|
4
|
-
|
|
5
|
-
const getSpritePath = (sprite) => `${getContextAssetsPath("../assets/actions-sprite.svg")}#${sprite}`;
|
|
6
|
-
let ctxLoaded = false;
|
|
7
|
-
function getContextAssetsPath(resource) {
|
|
8
|
-
if (!ctxLoaded) {
|
|
9
|
-
const scriptElem = document.querySelector("script[data-ezui-assets-url]");
|
|
10
|
-
if (scriptElem) {
|
|
11
|
-
let assetsPath = scriptElem.dataset.ezuiAssetsUrl;
|
|
12
|
-
if (assetsPath) {
|
|
13
|
-
if (assetsPath.startsWith('/')) {
|
|
14
|
-
assetsPath = window.location.origin + assetsPath;
|
|
15
|
-
}
|
|
16
|
-
index.setAssetPath(assetsPath);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
ctxLoaded = true;
|
|
20
|
-
}
|
|
21
|
-
return index.getAssetPath(resource);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
exports.getSpritePath = getSpritePath;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
class CSSVarsUtils {
|
|
4
|
-
static applyVarsTextInput(host, child) {
|
|
5
|
-
if (child) {
|
|
6
|
-
CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--background-color');
|
|
7
|
-
CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--border-color');
|
|
8
|
-
CSSVarsUtils.applyIfExists(host, child, '--ez-text-input--height');
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
static applyIfExists(host, element, varName) {
|
|
12
|
-
const prop = getComputedStyle(host).getPropertyValue(varName);
|
|
13
|
-
if (prop) {
|
|
14
|
-
element.style.setProperty(varName, prop);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
exports.CSSVarsUtils = CSSVarsUtils;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-88286449.js');
|
|
6
|
-
const StringUtils = require('./StringUtils-0ba09df4.js');
|
|
7
|
-
require('./UnitMetadata-2e11c5d3.js');
|
|
8
|
-
|
|
9
|
-
const ezIconCss = ":host{display:flex;overflow:hidden;position:relative;--ez-icon--color:var(--icon--color, #ffffff)}svg{display:flex;justify-content:center;align-items:center;fill:var(--ez-icon--color)}.x-small{width:12px;height:12px}.small{width:16px;height:16px}.medium{width:20px;height:20px}.large{width:24px;height:24px}.x-large{width:30px;height:30px}[class^=\"ez-icon-\"],[class*=\" ez-icon-\"]{color:var(--ez-icon--color)}[class^=\"ez-icon-\"],[class*=\" ez-icon-\"]{font-family:'ez-icons' !important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ez-icon-account-outline:before{content:\"\\ea01\"}.ez-icon-account:before{content:\"\\ea02\"}.ez-icon-alert-circle-inverted:before{content:\"\\ea03\"}.ez-icon-alert-circle:before{content:\"\\ea04\"}.ez-icon-alert-mail:before{content:\"\\ea05\"}.ez-icon-alert-outline:before{content:\"\\ea06\"}.ez-icon-alert-popup:before{content:\"\\ea07\"}.ez-icon-apps:before{content:\"\\ea08\"}.ez-icon-arrow_back:before{content:\"\\ea09\"}.ez-icon-bell-inverted:before{content:\"\\ea0a\"}.ez-icon-bell:before{content:\"\\ea0b\"}.ez-icon-business-center:before{content:\"\\ea0c\"}.ez-icon-calendar-text:before{content:\"\\ea0d\"}.ez-icon-calendar:before{content:\"\\ea0e\"}.ez-icon-check-circle-inverted:before{content:\"\\ea0f\"}.ez-icon-check-circle:before{content:\"\\ea10\"}.ez-icon-check:before{content:\"\\ea11\"}.ez-icon-chevron-down:before{content:\"\\ea12\"}.ez-icon-chevron-left:before{content:\"\\ea13\"}.ez-icon-chevron-right:before{content:\"\\ea14\"}.ez-icon-chevron-up:before{content:\"\\ea15\"}.ez-icon-circle--medium:before{content:\"\\ea16\"}.ez-icon-circle:before{content:\"\\ea17\"}.ez-icon-clipboard:before{content:\"\\ea18\"}.ez-icon-close-circle-inverted:before{content:\"\\ea19\"}.ez-icon-close-circle:before{content:\"\\ea1a\"}.ez-icon-close:before{content:\"\\ea1b\"}.ez-icon-comment-inverted:before{content:\"\\ea1c\"}.ez-icon-comment:before{content:\"\\ea1d\"}.ez-icon-configuration:before{content:\"\\ea1e\"}.ez-icon-copy:before{content:\"\\ea1f\"}.ez-icon-crop:before{content:\"\\ea20\"}.ez-icon-delete:before{content:\"\\ea21\"}.ez-icon-description:before{content:\"\\ea22\"}.ez-icon-dot-notification:before{content:\"\\ea23\"}.ez-icon-dots-horizontal:before{content:\"\\ea24\"}.ez-icon-dots-vertical:before{content:\"\\ea25\"}.ez-icon-drag-indicator:before{content:\"\\ea26\"}.ez-icon-edit-file:before{content:\"\\ea27\"}.ez-icon-edit-table:before{content:\"\\ea28\"}.ez-icon-edit-time:before{content:\"\\ea29\"}.ez-icon-edit:before{content:\"\\ea2a\"}.ez-icon-email-inverted:before{content:\"\\ea2b\"}.ez-icon-email:before{content:\"\\ea2c\"}.ez-icon-error-octagon:before{content:\"\\ea2d\"}.ez-icon-expand:before{content:\"\\ea2e\"}.ez-icon-eye-off:before{content:\"\\ea2f\"}.ez-icon-eye:before{content:\"\\ea30\"}.ez-icon-favorite:before{content:\"\\ea31\"}.ez-icon-file-download:before{content:\"\\ea32\"}.ez-icon-file-upload:before{content:\"\\ea33\"}.ez-icon-filter:before{content:\"\\ea34\"}.ez-icon-find-file:before{content:\"\\ea35\"}.ez-icon-find-page:before{content:\"\\ea36\"}.ez-icon-format-color-fill:before{content:\"\\ea37\"}.ez-icon-help-circle-outline:before{content:\"\\ea38\"}.ez-icon-help-inverted:before{content:\"\\ea39\"}.ez-icon-help:before{content:\"\\ea3a\"}.ez-icon-home:before{content:\"\\ea3b\"}.ez-icon-language:before{content:\"\\ea3c\"}.ez-icon-launch:before{content:\"\\ea3d\"}.ez-icon-lightbulb:before{content:\"\\ea3e\"}.ez-icon-list:before{content:\"\\ea3f\"}.ez-icon-loading:before{content:\"\\ea40\"}.ez-icon-lock-outline:before{content:\"\\ea41\"}.ez-icon-lock:before{content:\"\\ea42\"}.ez-icon-menu:before{content:\"\\ea43\"}.ez-icon-minus-circle-inverted:before{content:\"\\ea44\"}.ez-icon-minus:before{content:\"\\ea45\"}.ez-icon-money-off:before{content:\"\\ea46\"}.ez-icon-money:before{content:\"\\ea47\"}.ez-icon-north-west:before{content:\"\\ea48\"}.ez-icon-pause:before{content:\"\\ea49\"}.ez-icon-payments:before{content:\"\\ea4a\"}.ez-icon-play:before{content:\"\\ea4b\"}.ez-icon-plus-circle-inverted:before{content:\"\\ea4c\"}.ez-icon-plus-circle:before{content:\"\\ea4d\"}.ez-icon-plus:before{content:\"\\ea4e\"}.ez-icon-power:before{content:\"\\ea4f\"}.ez-icon-push-pin:before{content:\"\\ea50\"}.ez-icon-restore:before{content:\"\\ea51\"}.ez-icon-return:before{content:\"\\ea52\"}.ez-icon-rotate:before{content:\"\\ea53\"}.ez-icon-save:before{content:\"\\ea54\"}.ez-icon-search:before{content:\"\\ea55\"}.ez-icon-settings-inverted:before{content:\"\\ea56\"}.ez-icon-settings:before{content:\"\\ea57\"}.ez-icon-share:before{content:\"\\ea58\"}.ez-icon-shield:before{content:\"\\ea59\"}.ez-icon-south-east:before{content:\"\\ea5a\"}.ez-icon-success-circle:before{content:\"\\ea5b\"}.ez-icon-sync:before{content:\"\\ea5c\"}.ez-icon-table:before{content:\"\\ea5d\"}.ez-icon-timer-outline:before{content:\"\\ea5e\"}.ez-icon-user-circle:before{content:\"\\ea5f\"}.ez-icon-warning-minus:before{content:\"\\ea60\"}.ez-icon-warning-triangle:before{content:\"\\ea61\"}.x-small--font{font-size:12px}.small--font{font-size:16px}.medium--font{font-size:20px}.large--font{font-size:24px}.x-large--font{font-size:30px}";
|
|
10
|
-
|
|
11
|
-
let EzIcon = class {
|
|
12
|
-
constructor(hostRef) {
|
|
13
|
-
index.registerInstance(this, hostRef);
|
|
14
|
-
/**
|
|
15
|
-
* Tamanho do ícone
|
|
16
|
-
*/
|
|
17
|
-
this.size = 'medium';
|
|
18
|
-
}
|
|
19
|
-
isSprite() {
|
|
20
|
-
return this.href && this.href.indexOf('#') > -1;
|
|
21
|
-
}
|
|
22
|
-
getIconClassName() {
|
|
23
|
-
return `ez-icon-${this.iconName}`;
|
|
24
|
-
}
|
|
25
|
-
getIconContent() {
|
|
26
|
-
if (this.isSprite()) {
|
|
27
|
-
return index.h("svg", { class: this.size, role: "img" }, index.h("use", { xlinkHref: this.href }));
|
|
28
|
-
}
|
|
29
|
-
else if (!StringUtils.StringUtils.isEmpty(this.iconName)) {
|
|
30
|
-
return index.h("span", { class: `icon-content ${this.getIconClassName()} ${this.size}--font` });
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
return index.h("img", { class: this.size, src: this.href });
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
render() {
|
|
37
|
-
return (index.h(index.Host, null, this.getIconContent()));
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
EzIcon.style = ezIconCss;
|
|
41
|
-
|
|
42
|
-
exports.ez_icon = EzIcon;
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-88286449.js');
|
|
6
|
-
const UnitMetadata = require('./UnitMetadata-2e11c5d3.js');
|
|
7
|
-
const CSSVarsUtils = require('./CSSVarsUtils-8fbdf2e0.js');
|
|
8
|
-
const AssetsUtils = require('./AssetsUtils-4909c6de.js');
|
|
9
|
-
|
|
10
|
-
const ezTimeInputCss = ":host{display:flex;flex-wrap:wrap;position:relative;width:100%}";
|
|
11
|
-
|
|
12
|
-
let EzTimeInput = class {
|
|
13
|
-
constructor(hostRef) {
|
|
14
|
-
index.registerInstance(this, hostRef);
|
|
15
|
-
/**
|
|
16
|
-
* Deixa o campo disponível ou não para digitação.
|
|
17
|
-
*/
|
|
18
|
-
this.enabled = true;
|
|
19
|
-
/**
|
|
20
|
-
* Define se o componente irá ou não considerar os segundos
|
|
21
|
-
*/
|
|
22
|
-
this.showSeconds = false;
|
|
23
|
-
}
|
|
24
|
-
prepareMask() {
|
|
25
|
-
if (this.showSeconds) {
|
|
26
|
-
if (this._maskFormatter == undefined) {
|
|
27
|
-
this._maskFormatter = new UnitMetadata.MaskFormatter("##:##:##");
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
this._maskFormatter.mask = "##:##:##";
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
if (this._maskFormatter == undefined) {
|
|
35
|
-
this._maskFormatter = new UnitMetadata.MaskFormatter("##:##");
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
this._maskFormatter.mask = "##:##";
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
onValueChanged() {
|
|
43
|
-
if (this.value === NaN) {
|
|
44
|
-
this.value = undefined;
|
|
45
|
-
this.handleFocusout();
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
//---------------------------------------------
|
|
49
|
-
// Public methods
|
|
50
|
-
//---------------------------------------------
|
|
51
|
-
/**
|
|
52
|
-
* Faz o foco no componente de input
|
|
53
|
-
*/
|
|
54
|
-
async setFocus() {
|
|
55
|
-
this._inputElem.focus();
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Remove o foco no componente de input
|
|
59
|
-
*/
|
|
60
|
-
async setBlur() {
|
|
61
|
-
this._inputElem.blur();
|
|
62
|
-
}
|
|
63
|
-
//---------------------------------------------
|
|
64
|
-
// Event handlers
|
|
65
|
-
//---------------------------------------------
|
|
66
|
-
handleFocusout() {
|
|
67
|
-
this.errorMessage = "";
|
|
68
|
-
this.prepareValue(this.viewValue);
|
|
69
|
-
if (!UnitMetadata.TimeFormatter.validateTime(this.viewValue, this.showSeconds)) {
|
|
70
|
-
this.clearField();
|
|
71
|
-
this.errorMessage = "Favor inserir um horário válido.";
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
prepareValue(value) {
|
|
75
|
-
try {
|
|
76
|
-
this.viewValue = UnitMetadata.TimeFormatter.prepareValue(value, this.showSeconds);
|
|
77
|
-
}
|
|
78
|
-
catch (e) {
|
|
79
|
-
this.clearField();
|
|
80
|
-
this.errorMessage = e.message;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
clearField() {
|
|
84
|
-
this.viewValue = this.value = undefined;
|
|
85
|
-
}
|
|
86
|
-
handleChange() {
|
|
87
|
-
this.viewValue = this._inputElem.value;
|
|
88
|
-
this.value = UnitMetadata.NumberUtils.stringToNumber(this.viewValue.replace(/\D/g, ""));
|
|
89
|
-
}
|
|
90
|
-
//---------------------------------------------
|
|
91
|
-
// Lifecycle web component
|
|
92
|
-
//---------------------------------------------
|
|
93
|
-
componentDidLoad() {
|
|
94
|
-
this.onValueChanged();
|
|
95
|
-
CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this._elem, this._inputElem);
|
|
96
|
-
}
|
|
97
|
-
componentWillLoad() {
|
|
98
|
-
this.prepareMask();
|
|
99
|
-
if (this.value) {
|
|
100
|
-
this.prepareValue(this.value.toString());
|
|
101
|
-
}
|
|
102
|
-
else if (this.viewValue) {
|
|
103
|
-
this.prepareValue(this.viewValue);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
render() {
|
|
107
|
-
return (index.h(index.Host, null, index.h("ez-text-input", { ref: (el) => this._inputElem = el, value: this.viewValue, enabled: this.enabled, label: this.label, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, errorMessage: this.errorMessage }, index.h("ez-icon", { slot: "leftIcon", href: AssetsUtils.getSpritePath("timer-outline") }))));
|
|
108
|
-
}
|
|
109
|
-
static get assetsDirs() { return ["../assets"]; }
|
|
110
|
-
get _elem() { return index.getElement(this); }
|
|
111
|
-
static get watchers() { return {
|
|
112
|
-
"showSeconds": ["prepareMask"],
|
|
113
|
-
"value": ["onValueChanged"]
|
|
114
|
-
}; }
|
|
115
|
-
};
|
|
116
|
-
EzTimeInput.style = ezTimeInputCss;
|
|
117
|
-
|
|
118
|
-
exports.ez_time_input = EzTimeInput;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { a as getAssetPath, s as setAssetPath } from './index-6b8bfbeb.js';
|
|
2
|
-
|
|
3
|
-
const getSpritePath = (sprite) => `${getContextAssetsPath("../assets/actions-sprite.svg")}#${sprite}`;
|
|
4
|
-
let ctxLoaded = false;
|
|
5
|
-
function getContextAssetsPath(resource) {
|
|
6
|
-
if (!ctxLoaded) {
|
|
7
|
-
const scriptElem = document.querySelector("script[data-ezui-assets-url]");
|
|
8
|
-
if (scriptElem) {
|
|
9
|
-
let assetsPath = scriptElem.dataset.ezuiAssetsUrl;
|
|
10
|
-
if (assetsPath) {
|
|
11
|
-
if (assetsPath.startsWith('/')) {
|
|
12
|
-
assetsPath = window.location.origin + assetsPath;
|
|
13
|
-
}
|
|
14
|
-
setAssetPath(assetsPath);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
ctxLoaded = true;
|
|
18
|
-
}
|
|
19
|
-
return getAssetPath(resource);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export { getSpritePath as g };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
class CSSVarsUtils {
|
|
2
|
-
static applyVarsTextInput(host, child) {
|
|
3
|
-
if (child) {
|
|
4
|
-
CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--background-color');
|
|
5
|
-
CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--border-color');
|
|
6
|
-
CSSVarsUtils.applyIfExists(host, child, '--ez-text-input--height');
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
static applyIfExists(host, element, varName) {
|
|
10
|
-
const prop = getComputedStyle(host).getPropertyValue(varName);
|
|
11
|
-
if (prop) {
|
|
12
|
-
element.style.setProperty(varName, prop);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export { CSSVarsUtils as C };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host } from './index-6b8bfbeb.js';
|
|
2
|
-
import { S as StringUtils } from './StringUtils-cbf10229.js';
|
|
3
|
-
import './UnitMetadata-8b1bbaa2.js';
|
|
4
|
-
|
|
5
|
-
const ezIconCss = ":host{display:flex;overflow:hidden;position:relative;--ez-icon--color:var(--icon--color, #ffffff)}svg{display:flex;justify-content:center;align-items:center;fill:var(--ez-icon--color)}.x-small{width:12px;height:12px}.small{width:16px;height:16px}.medium{width:20px;height:20px}.large{width:24px;height:24px}.x-large{width:30px;height:30px}[class^=\"ez-icon-\"],[class*=\" ez-icon-\"]{color:var(--ez-icon--color)}[class^=\"ez-icon-\"],[class*=\" ez-icon-\"]{font-family:'ez-icons' !important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ez-icon-account-outline:before{content:\"\\ea01\"}.ez-icon-account:before{content:\"\\ea02\"}.ez-icon-alert-circle-inverted:before{content:\"\\ea03\"}.ez-icon-alert-circle:before{content:\"\\ea04\"}.ez-icon-alert-mail:before{content:\"\\ea05\"}.ez-icon-alert-outline:before{content:\"\\ea06\"}.ez-icon-alert-popup:before{content:\"\\ea07\"}.ez-icon-apps:before{content:\"\\ea08\"}.ez-icon-arrow_back:before{content:\"\\ea09\"}.ez-icon-bell-inverted:before{content:\"\\ea0a\"}.ez-icon-bell:before{content:\"\\ea0b\"}.ez-icon-business-center:before{content:\"\\ea0c\"}.ez-icon-calendar-text:before{content:\"\\ea0d\"}.ez-icon-calendar:before{content:\"\\ea0e\"}.ez-icon-check-circle-inverted:before{content:\"\\ea0f\"}.ez-icon-check-circle:before{content:\"\\ea10\"}.ez-icon-check:before{content:\"\\ea11\"}.ez-icon-chevron-down:before{content:\"\\ea12\"}.ez-icon-chevron-left:before{content:\"\\ea13\"}.ez-icon-chevron-right:before{content:\"\\ea14\"}.ez-icon-chevron-up:before{content:\"\\ea15\"}.ez-icon-circle--medium:before{content:\"\\ea16\"}.ez-icon-circle:before{content:\"\\ea17\"}.ez-icon-clipboard:before{content:\"\\ea18\"}.ez-icon-close-circle-inverted:before{content:\"\\ea19\"}.ez-icon-close-circle:before{content:\"\\ea1a\"}.ez-icon-close:before{content:\"\\ea1b\"}.ez-icon-comment-inverted:before{content:\"\\ea1c\"}.ez-icon-comment:before{content:\"\\ea1d\"}.ez-icon-configuration:before{content:\"\\ea1e\"}.ez-icon-copy:before{content:\"\\ea1f\"}.ez-icon-crop:before{content:\"\\ea20\"}.ez-icon-delete:before{content:\"\\ea21\"}.ez-icon-description:before{content:\"\\ea22\"}.ez-icon-dot-notification:before{content:\"\\ea23\"}.ez-icon-dots-horizontal:before{content:\"\\ea24\"}.ez-icon-dots-vertical:before{content:\"\\ea25\"}.ez-icon-drag-indicator:before{content:\"\\ea26\"}.ez-icon-edit-file:before{content:\"\\ea27\"}.ez-icon-edit-table:before{content:\"\\ea28\"}.ez-icon-edit-time:before{content:\"\\ea29\"}.ez-icon-edit:before{content:\"\\ea2a\"}.ez-icon-email-inverted:before{content:\"\\ea2b\"}.ez-icon-email:before{content:\"\\ea2c\"}.ez-icon-error-octagon:before{content:\"\\ea2d\"}.ez-icon-expand:before{content:\"\\ea2e\"}.ez-icon-eye-off:before{content:\"\\ea2f\"}.ez-icon-eye:before{content:\"\\ea30\"}.ez-icon-favorite:before{content:\"\\ea31\"}.ez-icon-file-download:before{content:\"\\ea32\"}.ez-icon-file-upload:before{content:\"\\ea33\"}.ez-icon-filter:before{content:\"\\ea34\"}.ez-icon-find-file:before{content:\"\\ea35\"}.ez-icon-find-page:before{content:\"\\ea36\"}.ez-icon-format-color-fill:before{content:\"\\ea37\"}.ez-icon-help-circle-outline:before{content:\"\\ea38\"}.ez-icon-help-inverted:before{content:\"\\ea39\"}.ez-icon-help:before{content:\"\\ea3a\"}.ez-icon-home:before{content:\"\\ea3b\"}.ez-icon-language:before{content:\"\\ea3c\"}.ez-icon-launch:before{content:\"\\ea3d\"}.ez-icon-lightbulb:before{content:\"\\ea3e\"}.ez-icon-list:before{content:\"\\ea3f\"}.ez-icon-loading:before{content:\"\\ea40\"}.ez-icon-lock-outline:before{content:\"\\ea41\"}.ez-icon-lock:before{content:\"\\ea42\"}.ez-icon-menu:before{content:\"\\ea43\"}.ez-icon-minus-circle-inverted:before{content:\"\\ea44\"}.ez-icon-minus:before{content:\"\\ea45\"}.ez-icon-money-off:before{content:\"\\ea46\"}.ez-icon-money:before{content:\"\\ea47\"}.ez-icon-north-west:before{content:\"\\ea48\"}.ez-icon-pause:before{content:\"\\ea49\"}.ez-icon-payments:before{content:\"\\ea4a\"}.ez-icon-play:before{content:\"\\ea4b\"}.ez-icon-plus-circle-inverted:before{content:\"\\ea4c\"}.ez-icon-plus-circle:before{content:\"\\ea4d\"}.ez-icon-plus:before{content:\"\\ea4e\"}.ez-icon-power:before{content:\"\\ea4f\"}.ez-icon-push-pin:before{content:\"\\ea50\"}.ez-icon-restore:before{content:\"\\ea51\"}.ez-icon-return:before{content:\"\\ea52\"}.ez-icon-rotate:before{content:\"\\ea53\"}.ez-icon-save:before{content:\"\\ea54\"}.ez-icon-search:before{content:\"\\ea55\"}.ez-icon-settings-inverted:before{content:\"\\ea56\"}.ez-icon-settings:before{content:\"\\ea57\"}.ez-icon-share:before{content:\"\\ea58\"}.ez-icon-shield:before{content:\"\\ea59\"}.ez-icon-south-east:before{content:\"\\ea5a\"}.ez-icon-success-circle:before{content:\"\\ea5b\"}.ez-icon-sync:before{content:\"\\ea5c\"}.ez-icon-table:before{content:\"\\ea5d\"}.ez-icon-timer-outline:before{content:\"\\ea5e\"}.ez-icon-user-circle:before{content:\"\\ea5f\"}.ez-icon-warning-minus:before{content:\"\\ea60\"}.ez-icon-warning-triangle:before{content:\"\\ea61\"}.x-small--font{font-size:12px}.small--font{font-size:16px}.medium--font{font-size:20px}.large--font{font-size:24px}.x-large--font{font-size:30px}";
|
|
6
|
-
|
|
7
|
-
let EzIcon = class {
|
|
8
|
-
constructor(hostRef) {
|
|
9
|
-
registerInstance(this, hostRef);
|
|
10
|
-
/**
|
|
11
|
-
* Tamanho do ícone
|
|
12
|
-
*/
|
|
13
|
-
this.size = 'medium';
|
|
14
|
-
}
|
|
15
|
-
isSprite() {
|
|
16
|
-
return this.href && this.href.indexOf('#') > -1;
|
|
17
|
-
}
|
|
18
|
-
getIconClassName() {
|
|
19
|
-
return `ez-icon-${this.iconName}`;
|
|
20
|
-
}
|
|
21
|
-
getIconContent() {
|
|
22
|
-
if (this.isSprite()) {
|
|
23
|
-
return h("svg", { class: this.size, role: "img" }, h("use", { xlinkHref: this.href }));
|
|
24
|
-
}
|
|
25
|
-
else if (!StringUtils.isEmpty(this.iconName)) {
|
|
26
|
-
return h("span", { class: `icon-content ${this.getIconClassName()} ${this.size}--font` });
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
return h("img", { class: this.size, src: this.href });
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
render() {
|
|
33
|
-
return (h(Host, null, this.getIconContent()));
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
EzIcon.style = ezIconCss;
|
|
37
|
-
|
|
38
|
-
export { EzIcon as ez_icon };
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, g as getElement } from './index-6b8bfbeb.js';
|
|
2
|
-
import { M as MaskFormatter, T as TimeFormatter, N as NumberUtils } from './UnitMetadata-8b1bbaa2.js';
|
|
3
|
-
import { C as CSSVarsUtils } from './CSSVarsUtils-667e0016.js';
|
|
4
|
-
import { g as getSpritePath } from './AssetsUtils-9b1329a3.js';
|
|
5
|
-
|
|
6
|
-
const ezTimeInputCss = ":host{display:flex;flex-wrap:wrap;position:relative;width:100%}";
|
|
7
|
-
|
|
8
|
-
let EzTimeInput = class {
|
|
9
|
-
constructor(hostRef) {
|
|
10
|
-
registerInstance(this, hostRef);
|
|
11
|
-
/**
|
|
12
|
-
* Deixa o campo disponível ou não para digitação.
|
|
13
|
-
*/
|
|
14
|
-
this.enabled = true;
|
|
15
|
-
/**
|
|
16
|
-
* Define se o componente irá ou não considerar os segundos
|
|
17
|
-
*/
|
|
18
|
-
this.showSeconds = false;
|
|
19
|
-
}
|
|
20
|
-
prepareMask() {
|
|
21
|
-
if (this.showSeconds) {
|
|
22
|
-
if (this._maskFormatter == undefined) {
|
|
23
|
-
this._maskFormatter = new MaskFormatter("##:##:##");
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
this._maskFormatter.mask = "##:##:##";
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
if (this._maskFormatter == undefined) {
|
|
31
|
-
this._maskFormatter = new MaskFormatter("##:##");
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
this._maskFormatter.mask = "##:##";
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
onValueChanged() {
|
|
39
|
-
if (this.value === NaN) {
|
|
40
|
-
this.value = undefined;
|
|
41
|
-
this.handleFocusout();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
//---------------------------------------------
|
|
45
|
-
// Public methods
|
|
46
|
-
//---------------------------------------------
|
|
47
|
-
/**
|
|
48
|
-
* Faz o foco no componente de input
|
|
49
|
-
*/
|
|
50
|
-
async setFocus() {
|
|
51
|
-
this._inputElem.focus();
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Remove o foco no componente de input
|
|
55
|
-
*/
|
|
56
|
-
async setBlur() {
|
|
57
|
-
this._inputElem.blur();
|
|
58
|
-
}
|
|
59
|
-
//---------------------------------------------
|
|
60
|
-
// Event handlers
|
|
61
|
-
//---------------------------------------------
|
|
62
|
-
handleFocusout() {
|
|
63
|
-
this.errorMessage = "";
|
|
64
|
-
this.prepareValue(this.viewValue);
|
|
65
|
-
if (!TimeFormatter.validateTime(this.viewValue, this.showSeconds)) {
|
|
66
|
-
this.clearField();
|
|
67
|
-
this.errorMessage = "Favor inserir um horário válido.";
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
prepareValue(value) {
|
|
71
|
-
try {
|
|
72
|
-
this.viewValue = TimeFormatter.prepareValue(value, this.showSeconds);
|
|
73
|
-
}
|
|
74
|
-
catch (e) {
|
|
75
|
-
this.clearField();
|
|
76
|
-
this.errorMessage = e.message;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
clearField() {
|
|
80
|
-
this.viewValue = this.value = undefined;
|
|
81
|
-
}
|
|
82
|
-
handleChange() {
|
|
83
|
-
this.viewValue = this._inputElem.value;
|
|
84
|
-
this.value = NumberUtils.stringToNumber(this.viewValue.replace(/\D/g, ""));
|
|
85
|
-
}
|
|
86
|
-
//---------------------------------------------
|
|
87
|
-
// Lifecycle web component
|
|
88
|
-
//---------------------------------------------
|
|
89
|
-
componentDidLoad() {
|
|
90
|
-
this.onValueChanged();
|
|
91
|
-
CSSVarsUtils.applyVarsTextInput(this._elem, this._inputElem);
|
|
92
|
-
}
|
|
93
|
-
componentWillLoad() {
|
|
94
|
-
this.prepareMask();
|
|
95
|
-
if (this.value) {
|
|
96
|
-
this.prepareValue(this.value.toString());
|
|
97
|
-
}
|
|
98
|
-
else if (this.viewValue) {
|
|
99
|
-
this.prepareValue(this.viewValue);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
render() {
|
|
103
|
-
return (h(Host, null, h("ez-text-input", { ref: (el) => this._inputElem = el, value: this.viewValue, enabled: this.enabled, label: this.label, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, errorMessage: this.errorMessage }, h("ez-icon", { slot: "leftIcon", href: getSpritePath("timer-outline") }))));
|
|
104
|
-
}
|
|
105
|
-
static get assetsDirs() { return ["../assets"]; }
|
|
106
|
-
get _elem() { return getElement(this); }
|
|
107
|
-
static get watchers() { return {
|
|
108
|
-
"showSeconds": ["prepareMask"],
|
|
109
|
-
"value": ["onValueChanged"]
|
|
110
|
-
}; }
|
|
111
|
-
};
|
|
112
|
-
EzTimeInput.style = ezTimeInputCss;
|
|
113
|
-
|
|
114
|
-
export { EzTimeInput as ez_time_input };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as o,H as n}from"./p-89a57641.js";import{S as t}from"./p-2f84ba72.js";import"./p-07b60fe9.js";let c=class{constructor(o){e(this,o),this.size="medium"}isSprite(){return this.href&&this.href.indexOf("#")>-1}getIconClassName(){return`ez-icon-${this.iconName}`}getIconContent(){return this.isSprite()?o("svg",{class:this.size,role:"img"},o("use",{xlinkHref:this.href})):t.isEmpty(this.iconName)?o("img",{class:this.size,src:this.href}):o("span",{class:`icon-content ${this.getIconClassName()} ${this.size}--font`})}render(){return o(n,null,this.getIconContent())}};c.style=':host{display:flex;overflow:hidden;position:relative;--ez-icon--color:var(--icon--color, #ffffff)}svg{display:flex;justify-content:center;align-items:center;fill:var(--ez-icon--color)}.x-small{width:12px;height:12px}.small{width:16px;height:16px}.medium{width:20px;height:20px}.large{width:24px;height:24px}.x-large{width:30px;height:30px}[class^="ez-icon-"],[class*=" ez-icon-"]{color:var(--ez-icon--color)}[class^="ez-icon-"],[class*=" ez-icon-"]{font-family:\'ez-icons\' !important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ez-icon-account-outline:before{content:"\\ea01"}.ez-icon-account:before{content:"\\ea02"}.ez-icon-alert-circle-inverted:before{content:"\\ea03"}.ez-icon-alert-circle:before{content:"\\ea04"}.ez-icon-alert-mail:before{content:"\\ea05"}.ez-icon-alert-outline:before{content:"\\ea06"}.ez-icon-alert-popup:before{content:"\\ea07"}.ez-icon-apps:before{content:"\\ea08"}.ez-icon-arrow_back:before{content:"\\ea09"}.ez-icon-bell-inverted:before{content:"\\ea0a"}.ez-icon-bell:before{content:"\\ea0b"}.ez-icon-business-center:before{content:"\\ea0c"}.ez-icon-calendar-text:before{content:"\\ea0d"}.ez-icon-calendar:before{content:"\\ea0e"}.ez-icon-check-circle-inverted:before{content:"\\ea0f"}.ez-icon-check-circle:before{content:"\\ea10"}.ez-icon-check:before{content:"\\ea11"}.ez-icon-chevron-down:before{content:"\\ea12"}.ez-icon-chevron-left:before{content:"\\ea13"}.ez-icon-chevron-right:before{content:"\\ea14"}.ez-icon-chevron-up:before{content:"\\ea15"}.ez-icon-circle--medium:before{content:"\\ea16"}.ez-icon-circle:before{content:"\\ea17"}.ez-icon-clipboard:before{content:"\\ea18"}.ez-icon-close-circle-inverted:before{content:"\\ea19"}.ez-icon-close-circle:before{content:"\\ea1a"}.ez-icon-close:before{content:"\\ea1b"}.ez-icon-comment-inverted:before{content:"\\ea1c"}.ez-icon-comment:before{content:"\\ea1d"}.ez-icon-configuration:before{content:"\\ea1e"}.ez-icon-copy:before{content:"\\ea1f"}.ez-icon-crop:before{content:"\\ea20"}.ez-icon-delete:before{content:"\\ea21"}.ez-icon-description:before{content:"\\ea22"}.ez-icon-dot-notification:before{content:"\\ea23"}.ez-icon-dots-horizontal:before{content:"\\ea24"}.ez-icon-dots-vertical:before{content:"\\ea25"}.ez-icon-drag-indicator:before{content:"\\ea26"}.ez-icon-edit-file:before{content:"\\ea27"}.ez-icon-edit-table:before{content:"\\ea28"}.ez-icon-edit-time:before{content:"\\ea29"}.ez-icon-edit:before{content:"\\ea2a"}.ez-icon-email-inverted:before{content:"\\ea2b"}.ez-icon-email:before{content:"\\ea2c"}.ez-icon-error-octagon:before{content:"\\ea2d"}.ez-icon-expand:before{content:"\\ea2e"}.ez-icon-eye-off:before{content:"\\ea2f"}.ez-icon-eye:before{content:"\\ea30"}.ez-icon-favorite:before{content:"\\ea31"}.ez-icon-file-download:before{content:"\\ea32"}.ez-icon-file-upload:before{content:"\\ea33"}.ez-icon-filter:before{content:"\\ea34"}.ez-icon-find-file:before{content:"\\ea35"}.ez-icon-find-page:before{content:"\\ea36"}.ez-icon-format-color-fill:before{content:"\\ea37"}.ez-icon-help-circle-outline:before{content:"\\ea38"}.ez-icon-help-inverted:before{content:"\\ea39"}.ez-icon-help:before{content:"\\ea3a"}.ez-icon-home:before{content:"\\ea3b"}.ez-icon-language:before{content:"\\ea3c"}.ez-icon-launch:before{content:"\\ea3d"}.ez-icon-lightbulb:before{content:"\\ea3e"}.ez-icon-list:before{content:"\\ea3f"}.ez-icon-loading:before{content:"\\ea40"}.ez-icon-lock-outline:before{content:"\\ea41"}.ez-icon-lock:before{content:"\\ea42"}.ez-icon-menu:before{content:"\\ea43"}.ez-icon-minus-circle-inverted:before{content:"\\ea44"}.ez-icon-minus:before{content:"\\ea45"}.ez-icon-money-off:before{content:"\\ea46"}.ez-icon-money:before{content:"\\ea47"}.ez-icon-north-west:before{content:"\\ea48"}.ez-icon-pause:before{content:"\\ea49"}.ez-icon-payments:before{content:"\\ea4a"}.ez-icon-play:before{content:"\\ea4b"}.ez-icon-plus-circle-inverted:before{content:"\\ea4c"}.ez-icon-plus-circle:before{content:"\\ea4d"}.ez-icon-plus:before{content:"\\ea4e"}.ez-icon-power:before{content:"\\ea4f"}.ez-icon-push-pin:before{content:"\\ea50"}.ez-icon-restore:before{content:"\\ea51"}.ez-icon-return:before{content:"\\ea52"}.ez-icon-rotate:before{content:"\\ea53"}.ez-icon-save:before{content:"\\ea54"}.ez-icon-search:before{content:"\\ea55"}.ez-icon-settings-inverted:before{content:"\\ea56"}.ez-icon-settings:before{content:"\\ea57"}.ez-icon-share:before{content:"\\ea58"}.ez-icon-shield:before{content:"\\ea59"}.ez-icon-south-east:before{content:"\\ea5a"}.ez-icon-success-circle:before{content:"\\ea5b"}.ez-icon-sync:before{content:"\\ea5c"}.ez-icon-table:before{content:"\\ea5d"}.ez-icon-timer-outline:before{content:"\\ea5e"}.ez-icon-user-circle:before{content:"\\ea5f"}.ez-icon-warning-minus:before{content:"\\ea60"}.ez-icon-warning-triangle:before{content:"\\ea61"}.x-small--font{font-size:12px}.small--font{font-size:16px}.medium--font{font-size:20px}.large--font{font-size:24px}.x-large--font{font-size:30px}';export{c as ez_icon}
|
package/dist/ezui/p-2f84ba72.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
class t{static isEmpty(t){return null==t||null===t||0===(t=(t=t.toString()).trim()).length}static replaceAccentuatedChars(t){return(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.toUpperCase()).replace(/[À]/,"A")).replace(/[Á]/,"A")).replace(/[Â]/,"A")).replace(/[Ã]/,"A")).replace(/[Ä]/,"A")).replace(/[È]/,"E")).replace(/[É]/,"E")).replace(/[Ê]/,"E")).replace(/[Ë]/,"E")).replace(/[Ì]/,"I")).replace(/[Í]/,"I")).replace(/[Î]/,"I")).replace(/[Ï]/,"I")).replace(/[Ò]/,"O")).replace(/[Ó]/,"O")).replace(/[Ô]/,"O")).replace(/[Ö]/,"O")).replace(/[Ù]/,"U")).replace(/[Ú]/,"U")).replace(/[Û]/,"U")).replace(/[Ü]/,"U")).replace(/[Ç]/,"C")).replace(/[^a-z0-9]/gi,"")}}export{t as S}
|
package/dist/ezui/p-477bb703.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as s,s as t}from"./p-89a57641.js";const a=a=>`${function(){if(!e){const s=document.querySelector("script[data-ezui-assets-url]");if(s){let a=s.dataset.ezuiAssetsUrl;a&&(a.startsWith("/")&&(a=window.location.origin+a),t(a))}e=!0}return s("../assets/actions-sprite.svg")}()}#${a}`;let e=!1;export{a as g}
|