@sankhyalabs/ezui 5.13.0-dev.2 → 5.13.0-dev.4
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/{constants-3a1d64fb.js → constants-2714478b.js} +2 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +1 -1
- package/dist/cjs/ez-grid.cjs.entry.js +24 -18
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +7 -6
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/filter-column.cjs.entry.js +16 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +10 -9
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +7 -1
- package/dist/collection/components/ez-grid/ez-grid.js +2 -8
- package/dist/collection/components/ez-grid/subcomponents/filter-column.js +16 -4
- package/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource.js +6 -0
- package/dist/collection/components/ez-icon/ez-icon.css +150 -137
- package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.js +8 -7
- package/dist/collection/utils/constants.js +1 -0
- package/dist/custom-elements/index.js +49 -29
- package/dist/esm/constants-4e0d35b7.js +5 -0
- package/dist/esm/ez-combo-box.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +1 -1
- package/dist/esm/ez-grid.entry.js +24 -18
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-multi-selection-list.entry.js +7 -6
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/filter-column.entry.js +16 -4
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-05e1f4e7.js +1 -0
- package/dist/ezui/{p-5e55a42b.entry.js → p-0c62cfda.entry.js} +1 -1
- package/dist/ezui/{p-b977d29c.entry.js → p-16b5126b.entry.js} +1 -1
- package/dist/ezui/{p-a0d8a94f.entry.js → p-214e748b.entry.js} +2 -2
- package/dist/ezui/{p-3078d25c.entry.js → p-7fd54841.entry.js} +1 -1
- package/dist/ezui/p-a42fe2ce.entry.js +1 -0
- package/dist/ezui/p-ee212571.entry.js +1 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +0 -5
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +1 -3
- package/dist/types/components/ez-grid/utils/InMemoryFilterColumnDataSource.d.ts +1 -0
- package/dist/types/components/ez-multi-selection-list/interfaces/IMultiSelectionListDataSource.d.ts +1 -0
- package/dist/types/utils/constants.d.ts +1 -0
- package/package.json +1 -1
- package/dist/esm/constants-6dab64f7.js +0 -4
- package/dist/ezui/p-061f4d73.entry.js +0 -1
- package/dist/ezui/p-1e7c4986.entry.js +0 -1
- package/dist/ezui/p-27a01a26.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,r as a,c as t,H as l,g as o}from"./p-e318d280.js";import{ObjectUtils as n,UserInterface as r,ElementIDUtils as s}from"@sankhyalabs/core";import{R as d}from"./p-
|
|
1
|
+
import{h as e,r as a,c as t,H as l,g as o}from"./p-e318d280.js";import{ObjectUtils as n,UserInterface as r,ElementIDUtils as s}from"@sankhyalabs/core";import{R as d}from"./p-05e1f4e7.js";import{C as i}from"./p-b853763b.js";function c(a,t,l,o,n){return e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-align--middle ez-padding-horizontal--small ez-padding-bottom--large"},e("ez-check",{enabled:!l,label:t,mode:n?i.SWITCH:i.REGULAR,"data-field-name":a,"data-context-name":o,key:a}))}function m(a,t,l,o,n,r,s){return e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-number-input",{enabled:!l,label:t,precision:o,prettyPrecision:n,"data-field-name":a,"data-context-name":r,key:a,canShowError:s}))}const z=({name:a,label:t,readOnly:l,contextName:o,canShowError:n})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-text-input",{label:t,"data-field-name":a,"data-context-name":o,key:a,enabled:!l,canShowError:n})),h=new Map;h.set(r.CHECKBOX,(e=>c(e.name,e.label,e.readOnly,e.contextName,!1))),h.set(r.SWITCH,(e=>c(e.name,e.label,e.readOnly,e.contextName,!0))),h.set(r.OPTIONSELECTOR,(({name:a,label:t,readOnly:l,required:o,props:n,contextName:r,canShowError:s})=>{const d=null==n?void 0:n.options;let i;if("string"==typeof d){const e=JSON.parse(d);i=Object.keys(e).map((a=>({value:a,label:e[a]})))}else i=d;return e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-combo-box",{enabled:!l,suppressEmptyOption:o,label:t,"data-field-name":a,"data-context-name":r,key:a,options:i,canShowError:s}))})),h.set(r.DATE,(({name:a,label:t,readOnly:l,canShowError:o})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-date-input",{enabled:!l,label:t,"data-field-name":a,key:a,canShowError:o})))),h.set(r.TIME,(({name:a,label:t,readOnly:l,canShowError:o})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-time-input",{enabled:!l,label:t,"data-field-name":a,key:a,canShowError:o})))),h.set(r.DATETIME,(({name:a,label:t,readOnly:l,contextName:o,canShowError:n})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-date-time-input",{enabled:!l,label:t,"data-field-name":a,"data-context-name":o,key:a,canShowError:n})))),h.set(r.FILE,(({name:a,label:t,readOnly:l,contextName:o,props:r})=>{const s=n.removeEmptyValues({subTitle:r.subTitle,requestHeaders:r.STORAGESTRATEGY?{STORAGESTRATEGY:r.STORAGESTRATEGY}:null});return e("div",{class:"ez-col ez-col--sd-12 ez-padding-horizontal--small"},e("ez-upload",Object.assign({enabled:!l,label:t,"data-field-name":a,"data-context-name":o,key:a},s)))})),h.set(r.DECIMALNUMBER,(({name:e,label:a,readOnly:t,props:l,contextName:o,canShowError:n})=>{const r=Number((null==l?void 0:l.precision)||2);return m(e,a,t,r,Number((null==l?void 0:l.prettyPrecision)||r),o,n)})),h.set(r.INTEGERNUMBER,(({name:e,label:a,readOnly:t,contextName:l,canShowError:o})=>m(e,a,t,0,0,l,o))),h.set(r.SEARCH,(({name:a,label:t,readOnly:l,required:o,contextName:n,canShowError:r,optionLoader:s})=>e("div",{class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-padding-horizontal--small"},e("ez-search",{enabled:!l,suppressEmptyOption:o,label:t,"data-field-name":a,"data-context-name":n,key:a,canShowError:r,optionLoader:s})))),h.set(r.LONGTEXT,(({name:a,label:t,readOnly:l,contextName:o,rows:n,canShowError:r})=>e("div",{class:"ez-col ez-col--sd-12 ez-padding-horizontal--small",key:a},e("ez-text-area",{enabled:!l,label:t,"data-field-name":a,"data-context-name":o,rows:n,canShowError:r}))));const b=e=>{const a=h.get(e.userInterface)||z,t=e.required?`${e.label}${d}`:e.label,l=a(Object.assign(Object.assign({},e),{label:t}));return l.t["data-form-item"]=e.name,l};class p{constructor(e){this.elem=e}addRightElement(e){this.removeRightElement(),e.classList.add("ez-padding-left--small"),e.setAttribute("data-custom-item","true"),this.elem.classList.add("ez-col--nowrap"),this.elem.appendChild(e)}removeRightElement(){Array.from(this.elem.querySelectorAll('[data-custom-item="true"]')).forEach((e=>e.remove()))}get fieldName(){return this.elem.getAttribute("data-form-item")}}class u{constructor(e,a){this.items=new Map,this.formId=a,e.forEach((e=>{const a=new p(e);this.items.set(a.fieldName,a)}))}getItem(e){return this.items.get(e)}get formName(){return this.formId}}const y=class{constructor(e){a(this,e),this.ezContentReady=t(this,"ezContentReady",7),this.formItemsReady=t(this,"formItemsReady",7),this.fields=void 0}async showUp(){this._element.scrollIntoView({behavior:"smooth",block:"start"})}groupFields(e){const a=new Map;return e.forEach((e=>{const t=e.group;if(t){let l=a.get(t);null==l&&(l=[],a.set(t,l)),l.push(e)}else a.set(e.name,e)})),a}componentDidRender(){this.ezContentReady.emit(Array.from(this._element.querySelectorAll("[data-field-name]")));const e=new u(Array.from(this._element.querySelectorAll("[data-form-item]")));this.formItemsReady.emit(e)}render(){if(s.addIDInfoIfNotExists(this._element,"ezFormView"),null!=this.fields)return e(l,null,Array.from(this.groupFields(this.fields).entries()).map((([a,t])=>Array.isArray(t)?e("ez-collapsible-box",{id:`group-${a}`,label:a,"header-size":"large",key:a},t.map((e=>b(e)))):b(t))))}get _element(){return o(this)}};y.style=".sc-ez-form-view-h{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}";export{y as ez_form_view}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as s}from"./p-e318d280.js";import{UserInterface as e}from"@sankhyalabs/core";const o=window,h=new CustomEvent("onSubmitFilter",{detail:{showToast:!0}}),l=class{constructor(s){t(this,s),this.applyFilterColumnOptions=i(this,"applyFilterColumnOptions",7),this.TOP_POSITION="65",this.TOP_POSITION_HEADER_HIDDEN="18",this.TOP_POSITION_NO_TASKBAR="32",this.TOP_POSITION_NO_TASKBAR_HEADER_HIDDEN="20",this.DEFAULT_HEIGHT=430,this.opened=!0,this.columnName=void 0,this.columnLabel=void 0,this.gridHeaderHidden=!1,this.noHeaderTaskBar=!1,this.dataSource=void 0,this.dataUnit=void 0,this.options=void 0,this.selectedItems=void 0,this.fieldDescriptor=void 0,this.useOptions=!1,this.isTextSearch=!1}async hide(){await this.ezPopoverElement.hide(),await this.clearConfigs()}async show(t){this.canShow(t)&&(await this.hide(),this.fieldDescriptor=this.dataUnit.getField(t.columnName),this.buildIsTextSearch(),this.columnName=t.columnName,this.columnLabel=t.columnLabel,await this.setOptions(t.filteredOptions),await this.ezPopoverElement.show(this.calcTopPosition(),this.calculateLeftPosition(t)))}calculateLeftPosition(t){if(!t.fromIcon)return t.leftPosition;const i=this.ezPopoverElement.getBoundingClientRect().left,s=parseInt(t.leftPosition.replace("px",""))+16-i;return`${s>0?s:0}px`}buildIsTextSearch(){var t,i;const s=null!==(i=null===(t=this.fieldDescriptor)||void 0===t?void 0:t.userInterface)&&void 0!==i?i:e.SHORTTEXT;this.isTextSearch=!(s===e.DECIMALNUMBER||s===e.INTEGERNUMBER)}calcTopPosition(){const t=this.buildReferenceTopPosition(),i=parseInt(t)+this.DEFAULT_HEIGHT,s=Math.round(this.ezPopoverElement.getBoundingClientRect().top)+i,e=window.innerHeight;return e>s?`${t}px`:e-s+"px"}buildReferenceTopPosition(){return this.noHeaderTaskBar?this.gridHeaderHidden?this.TOP_POSITION_NO_TASKBAR_HEADER_HIDDEN:this.TOP_POSITION_NO_TASKBAR:this.gridHeaderHidden?this.TOP_POSITION_HEADER_HIDDEN:this.TOP_POSITION}async clearConfigs(){var t;await(null===(t=this.ezMultiSelectionList)||void 0===t?void 0:t.clearFilteredOptions()),this.options=null,this.columnName=null}canShow(t){return!this.ezPopoverElement.opened||t.columnName!==this.columnName}submit(){this.applyFilterColumnOptions.emit({field:this.columnName,values:this.selectedItems}),o.dispatchEvent(h),this.hide()}changeSelectedItems(t){this.selectedItems=t}hasToUseOptions(){return this.fieldDescriptor.userInterface===e.OPTIONSELECTOR||this.fieldDescriptor.userInterface===e.SWITCH||this.fieldDescriptor.userInterface===e.CHECKBOX}isCheckBoxOrSwitch(){return this.fieldDescriptor.userInterface===e.SWITCH||this.fieldDescriptor.userInterface===e.CHECKBOX}async setOptions(t){const i=this.hasToUseOptions();if(i)return this.useOptions=i,void(this.options=i?this.buildOptions(t):null!=t?t:null);const s=await this.dataSource.getStaticOptions(this.columnName);if(null!=s){const i=new Set((t||[]).filter((t=>t.check)).map((t=>t.label)));return this.useOptions=!0,void(this.options=0===i.size?s:s.map((t=>Object.assign(Object.assign({},t),{check:i.has(t.label)}))))}this.useOptions=!1,this.options=null}buildOptions(t){var i,s;if(t&&t.length>0)return t;if(this.isCheckBoxOrSwitch())return[{label:"Sim",value:"true",check:!0},{label:"Não",value:"false",check:!0}];const e=JSON.parse(null===(s=null===(i=this.fieldDescriptor)||void 0===i?void 0:i.properties)||void 0===s?void 0:s.options);return Object.keys(e).map((t=>({label:e[t],value:t,check:!0})))}handleEzVisibilityChange(t){!1===t.detail&&this.clearConfigs()}render(){return s("ez-popover",{class:"filter-column__popover","overlay-type":"none",ref:t=>this.ezPopoverElement=t,autoClose:!0,onEzVisibilityChange:this.handleEzVisibilityChange.bind(this)},s("section",{class:"filter-column"},s("header",{class:"filter-column__header"},s("span",{class:"ez-text ez-text--medium filter-column__header-title"},"Filtro da coluna ",this.columnLabel),s("ez-button",{mode:"icon","icon-name":"close",class:"ez-button--tertiary",onClick:()=>this.hide()})),s("ez-multi-selection-list",{columnName:this.columnName,dataSource:this.dataSource,options:this.options,useOptions:this.useOptions,ref:t=>this.ezMultiSelectionList=t,onChangeFilteredOptions:t=>this.changeSelectedItems(t.detail),isTextSearch:this.isTextSearch}),s("footer",{class:"filter-column__footer"},s("ez-button",{label:"Aplicar",class:"ez-button--primary",onClick:this.submit.bind(this)}))))}};l.style=".filter-column{padding:var(--space--2xs, 8px);position:relative}.filter-column__header{margin-bottom:var(--space--2xs, 8px);display:flex;flex-direction:row;align-items:center;justify-content:space-between;height:var(--space--xl, 32px)}.filter-column__footer{position:relative;display:flex;flex-direction:row;justify-content:flex-end;align-items:center;width:100%;bottom:0;left:0;padding-top:var(--space--2xs, 8px);border-top:var(--border--medium) var(--color--disable-secondary)}.filter-column__popover{position:absolute}.filter-column__header-title{margin-left:8px}";export{l as filter_column}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,h as o,H as n,g as t}from"./p-e318d280.js";import{StringUtils as c,ElementIDUtils as i}from"@sankhyalabs/core";const a=class{constructor(o){e(this,o),this.size="medium",this.href=void 0,this.iconName=void 0}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})):c.isEmpty(this.iconName)?o("img",{class:this.size,src:this.href}):o("span",{class:`icon-content ${this.getIconClassName()} ${this.size}--font`})}componentDidLoad(){i.addIDInfo(this._hostElement,"icon")}render(){return o(n,null,this.getIconContent())}get _hostElement(){return t(this)}};a.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-2chevron-down:before{content:"\\ea01"}.ez-icon-2chevron-up:before{content:"\\ea02"}.ez-icon-acao:before{content:"\\ea03"}.ez-icon-account-outline:before{content:"\\ea04"}.ez-icon-account:before{content:"\\ea05"}.ez-icon-actions-sprite-v1:before{content:"\\ea06"}.ez-icon-actions-sprite-v2:before{content:"\\ea07"}.ez-icon-alert-circle-inverted:before{content:"\\ea08"}.ez-icon-alert-circle:before{content:"\\ea09"}.ez-icon-alert-mail:before{content:"\\ea0a"}.ez-icon-alert-popup:before{content:"\\ea0b"}.ez-icon-anexo:before{content:"\\ea0c"}.ez-icon-antecipacao:before{content:"\\ea0d"}.ez-icon-apps:before{content:"\\ea0e"}.ez-icon-arrow-forward:before{content:"\\ea0f"}.ez-icon-arrow-upward:before{content:"\\ea10"}.ez-icon-arrow_back:before{content:"\\ea11"}.ez-icon-arrow_downward:before{content:"\\ea12"}.ez-icon-baixa:before{content:"\\ea13"}.ez-icon-balance:before{content:"\\ea14"}.ez-icon-bell-inverted:before{content:"\\ea15"}.ez-icon-bell:before{content:"\\ea16"}.ez-icon-boleto:before{content:"\\ea17"}.ez-icon-boolean:before{content:"\\ea18"}.ez-icon-business-center:before{content:"\\ea19"}.ez-icon-calendar-clock:before{content:"\\ea1a"}.ez-icon-calendar:before{content:"\\ea1b"}.ez-icon-cash-remove:before{content:"\\ea1c"}.ez-icon-check-circle-inverted:before{content:"\\ea1d"}.ez-icon-check-circle:before{content:"\\ea1e"}.ez-icon-check:before{content:"\\ea1f"}.ez-icon-chevron-down:before{content:"\\ea20"}.ez-icon-chevron-left:before{content:"\\ea21"}.ez-icon-chevron-right:before{content:"\\ea22"}.ez-icon-chevron-up:before{content:"\\ea23"}.ez-icon-circle--medium:before{content:"\\ea24"}.ez-icon-circle:before{content:"\\ea25"}.ez-icon-cleaning:before{content:"\\ea26"}.ez-icon-clipboard:before{content:"\\ea27"}.ez-icon-close:before{content:"\\ea28"}.ez-icon-cobrar:before{content:"\\ea29"}.ez-icon-code:before{content:"\\ea2a"}.ez-icon-configuration:before{content:"\\ea2b"}.ez-icon-content-cut:before{content:"\\ea2c"}.ez-icon-copy:before{content:"\\ea2d"}.ez-icon-credit_card:before{content:"\\ea2e"}.ez-icon-crop:before{content:"\\ea2f"}.ez-icon-custom:before{content:"\\ea30"}.ez-icon-delete-file:before{content:"\\ea31"}.ez-icon-delete:before{content:"\\ea32"}.ez-icon-description:before{content:"\\ea33"}.ez-icon-dividir:before{content:"\\ea34"}.ez-icon-docx:before{content:"\\ea35"}.ez-icon-dot-notification:before{content:"\\ea36"}.ez-icon-dots-horizontal:before{content:"\\ea37"}.ez-icon-dots-vertical:before{content:"\\ea38"}.ez-icon-drag-indicator:before{content:"\\ea39"}.ez-icon-dual-chevron-down:before{content:"\\ea3a"}.ez-icon-dual-chevron-left:before{content:"\\ea3b"}.ez-icon-dual-chevron-right:before{content:"\\ea3c"}.ez-icon-dual-chevron-up:before{content:"\\ea3d"}.ez-icon-edit-file:before{content:"\\ea3e"}.ez-icon-edit-table:before{content:"\\ea3f"}.ez-icon-edit-time:before{content:"\\ea40"}.ez-icon-edit-value:before{content:"\\ea41"}.ez-icon-edit:before{content:"\\ea42"}.ez-icon-email:before{content:"\\ea43"}.ez-icon-estorno:before{content:"\\ea44"}.ez-icon-exe:before{content:"\\ea45"}.ez-icon-expand:before{content:"\\ea46"}.ez-icon-expandir_card:before{content:"\\ea47"}.ez-icon-extrato:before{content:"\\ea48"}.ez-icon-eye-off:before{content:"\\ea49"}.ez-icon-eye:before{content:"\\ea4a"}.ez-icon-favorite:before{content:"\\ea4b"}.ez-icon-figma:before{content:"\\ea4c"}.ez-icon-file-download:before{content:"\\ea4d"}.ez-icon-file-upload:before{content:"\\ea4e"}.ez-icon-filter:before{content:"\\ea4f"}.ez-icon-find-file:before{content:"\\ea50"}.ez-icon-find-page:before{content:"\\ea51"}.ez-icon-format-color-fill:before{content:"\\ea52"}.ez-icon-generic:before{content:"\\ea53"}.ez-icon-gif:before{content:"\\ea54"}.ez-icon-graph_bar:before{content:"\\ea55"}.ez-icon-handshake:before{content:"\\ea56"}.ez-icon-help-inverted:before{content:"\\ea57"}.ez-icon-help:before{content:"\\ea58"}.ez-icon-hide_menu:before{content:"\\ea59"}.ez-icon-home:before{content:"\\ea5a"}.ez-icon-icons104:before{content:"\\ea5b"}.ez-icon-language:before{content:"\\ea5c"}.ez-icon-launch:before{content:"\\ea5d"}.ez-icon-lightbulb:before{content:"\\ea5e"}.ez-icon-list:before{content:"\\ea5f"}.ez-icon-location:before{content:"\\ea60"}.ez-icon-lock-outline:before{content:"\\ea61"}.ez-icon-lock:before{content:"\\ea62"}.ez-icon-menu:before{content:"\\ea63"}.ez-icon-mid:before{content:"\\ea64"}.ez-icon-minus:before{content:"\\ea65"}.ez-icon-money-off:before{content:"\\ea66"}.ez-icon-money:before{content:"\\ea67"}.ez-icon-more:before{content:"\\ea68"}.ez-icon-mp3:before{content:"\\ea69"}.ez-icon-mp4:before{content:"\\ea6a"}.ez-icon-multiple-files:before{content:"\\ea6b"}.ez-icon-north-west:before{content:"\\ea6c"}.ez-icon-number:before{content:"\\ea6d"}.ez-icon-ordem-ascendente:before{content:"\\ea6e"}.ez-icon-ordem-descendente:before{content:"\\ea6f"}.ez-icon-parcelar:before{content:"\\ea70"}.ez-icon-pause:before{content:"\\ea71"}.ez-icon-payments:before{content:"\\ea72"}.ez-icon-pdf:before{content:"\\ea73"}.ez-icon-play:before{content:"\\ea74"}.ez-icon-plus:before{content:"\\ea75"}.ez-icon-png:before{content:"\\ea76"}.ez-icon-power:before{content:"\\ea77"}.ez-icon-pptx:before{content:"\\ea78"}.ez-icon-preview:before{content:"\\ea79"}.ez-icon-print:before{content:"\\ea7a"}.ez-icon-push-pin:before{content:"\\ea7b"}.ez-icon-rateio:before{content:"\\ea7c"}.ez-icon-receipt:before{content:"\\ea7d"}.ez-icon-recolher_card:before{content:"\\ea7e"}.ez-icon-restore:before{content:"\\ea7f"}.ez-icon-return:before{content:"\\ea80"}.ez-icon-sankhya-place:before{content:"\\ea81"}.ez-icon-save:before{content:"\\ea82"}.ez-icon-search:before{content:"\\ea83"}.ez-icon-settings-inverted:before{content:"\\ea84"}.ez-icon-settings:before{content:"\\ea85"}.ez-icon-share:before{content:"\\ea86"}.ez-icon-shield:before{content:"\\ea87"}.ez-icon-show_menu:before{content:"\\ea88"}.ez-icon-south-east:before{content:"\\ea89"}.ez-icon-sync:before{content:"\\ea8a"}.ez-icon-table:before{content:"\\ea8b"}.ez-icon-tag_code:before{content:"\\ea8c"}.ez-icon-text:before{content:"\\ea8d"}.ez-icon-timeline:before{content:"\\ea8e"}.ez-icon-timer-outline:before{content:"\\ea8f"}.ez-icon-trending-up:before{content:"\\ea90"}.ez-icon-tune:before{content:"\\ea91"}.ez-icon-txt:before{content:"\\ea92"}.ez-icon-un-pin:before{content:"\\ea93"}.ez-icon-unfold_less:before{content:"\\ea94"}.ez-icon-unfold_more:before{content:"\\ea95"}.ez-icon-user-circle:before{content:"\\ea96"}.ez-icon-warning-outline:before{content:"\\ea97"}.ez-icon-warning_triangle:before{content:"\\ea98"}.ez-icon-whatshot:before{content:"\\ea99"}.ez-icon-xlsx:before{content:"\\ea9a"}.ez-icon-zip:before{content:"\\ea9b"}.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{a as ez_icon}
|
|
@@ -2,7 +2,6 @@ import { DataUnit, Filter } from '@sankhyalabs/core';
|
|
|
2
2
|
import { Components } from '../../../components';
|
|
3
3
|
import FilterCollumn = Components.FilterColumn;
|
|
4
4
|
import { IRecordValidator } from '../../../utils/form/interfaces';
|
|
5
|
-
import { GridApi } from 'ag-grid-community';
|
|
6
5
|
/**
|
|
7
6
|
* O intuito desta abstração, é isolar o componente EzGrid de uma implementação
|
|
8
7
|
* específica, permitindo que usemos componentes de terceiros sem um acoplamento
|
|
@@ -22,10 +21,6 @@ export default interface EzGridController {
|
|
|
22
21
|
* @param options - A contextualização dessa instância de grade.
|
|
23
22
|
*/
|
|
24
23
|
initDatagrid(container: HTMLElement, options: EzGridOptions): void;
|
|
25
|
-
/**
|
|
26
|
-
* Chamado pelo EzGrid para retornar a api de manipulação da grade.
|
|
27
|
-
*/
|
|
28
|
-
getGridApi(): GridApi;
|
|
29
24
|
/**
|
|
30
25
|
* Método responsável por receber a definição das colunas.
|
|
31
26
|
* @param cols - Array contendo a definição de todas as colunas.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Sort, SortingProvider } from '@sankhyalabs/core';
|
|
2
2
|
import { Filter, FilterProvider } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
3
|
-
import { GridApi } from 'ag-grid-community';
|
|
4
3
|
import EzGridController, { EzGridColumn, EzGridColumnConfig, EzGridColumnMenuItemDef, EzGridOptions } from '../EzGridController';
|
|
5
4
|
export default class AgGridController implements EzGridController, SortingProvider, FilterProvider {
|
|
6
5
|
private readonly DEFAULT_ROW_HEIGHT;
|
|
@@ -36,8 +35,7 @@ export default class AgGridController implements EzGridController, SortingProvid
|
|
|
36
35
|
private showFilterColumn;
|
|
37
36
|
constructor(enterprise: boolean);
|
|
38
37
|
getGridConfig(): Array<EzGridColumnConfig>;
|
|
39
|
-
|
|
40
|
-
getSort(): Array<Sort>;
|
|
38
|
+
getSort(_dataUnitName: string, defaultSorting: Array<Sort>): Array<Sort>;
|
|
41
39
|
getFilter(): Array<Filter> | undefined;
|
|
42
40
|
initDatagrid(container: HTMLElement, options: EzGridOptions): void;
|
|
43
41
|
private setFilterColumnLeftPosition;
|
|
@@ -6,6 +6,7 @@ export default class InMemoryFilterColumnDataSource implements IMultiSelectionLi
|
|
|
6
6
|
private originalRecords;
|
|
7
7
|
constructor(dataUnit: DataUnit);
|
|
8
8
|
onDataUnitAction: (action: any) => void;
|
|
9
|
+
getStaticOptions(fieldName: string): Promise<Array<IMultiSelectionOption>>;
|
|
9
10
|
fetchData(filterTerm: string, fieldName: string): Promise<Array<IMultiSelectionOption>>;
|
|
10
11
|
private buildFieldOption;
|
|
11
12
|
private buildValue;
|
package/dist/types/components/ez-multi-selection-list/interfaces/IMultiSelectionListDataSource.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IMultiSelectionOption } from './IMultiSelectionOption';
|
|
2
2
|
export interface IMultiSelectionListDataSource {
|
|
3
|
+
getStaticOptions: (fieldName: string) => Promise<IMultiSelectionOption[] | undefined>;
|
|
3
4
|
fetchData: (filterTerm: string, fieldName: string) => Promise<IMultiSelectionOption[]>;
|
|
4
5
|
}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s}from"./p-e318d280.js";import{UserInterface as e}from"@sankhyalabs/core";const o=window,l=new CustomEvent("onSubmitFilter",{detail:{showToast:!0}}),h=class{constructor(s){t(this,s),this.applyFilterColumnOptions=i(this,"applyFilterColumnOptions",7),this.TOP_POSITION="65",this.TOP_POSITION_HEADER_HIDDEN="18",this.TOP_POSITION_NO_TASKBAR="32",this.TOP_POSITION_NO_TASKBAR_HEADER_HIDDEN="20",this.DEFAULT_HEIGHT=430,this.opened=!0,this.columnName=void 0,this.columnLabel=void 0,this.gridHeaderHidden=!1,this.noHeaderTaskBar=!1,this.dataSource=void 0,this.dataUnit=void 0,this.options=void 0,this.selectedItems=void 0,this.fieldDescriptor=void 0,this.useOptions=!1,this.isTextSearch=!1}async hide(){await this.ezPopoverElement.hide(),await this.clearConfigs()}async show(t){this.canShow(t)&&(await this.hide(),this.fieldDescriptor=this.dataUnit.getField(t.columnName),this.buildIsTextSearch(),this.setOptions(t.filteredOptions),this.columnName=t.columnName,this.columnLabel=t.columnLabel,await this.ezPopoverElement.show(this.calcTopPosition(),this.calculateLeftPosition(t)))}calculateLeftPosition(t){if(!t.fromIcon)return t.leftPosition;const i=this.ezPopoverElement.getBoundingClientRect().left,s=parseInt(t.leftPosition.replace("px",""))+16-i;return`${s>0?s:0}px`}buildIsTextSearch(){var t,i;const s=null!==(i=null===(t=this.fieldDescriptor)||void 0===t?void 0:t.userInterface)&&void 0!==i?i:e.SHORTTEXT;this.isTextSearch=!(s===e.DECIMALNUMBER||s===e.INTEGERNUMBER)}calcTopPosition(){const t=this.buildReferenceTopPosition(),i=parseInt(t)+this.DEFAULT_HEIGHT,s=Math.round(this.ezPopoverElement.getBoundingClientRect().top)+i,e=window.innerHeight;return e>s?`${t}px`:e-s+"px"}buildReferenceTopPosition(){return this.noHeaderTaskBar?this.gridHeaderHidden?this.TOP_POSITION_NO_TASKBAR_HEADER_HIDDEN:this.TOP_POSITION_NO_TASKBAR:this.gridHeaderHidden?this.TOP_POSITION_HEADER_HIDDEN:this.TOP_POSITION}async clearConfigs(){var t;await(null===(t=this.ezMultiSelectionList)||void 0===t?void 0:t.clearFilteredOptions()),this.options=null,this.columnName=null}canShow(t){return!this.ezPopoverElement.opened||t.columnName!==this.columnName}submit(){this.applyFilterColumnOptions.emit({field:this.columnName,values:this.selectedItems}),o.dispatchEvent(l),this.hide()}changeSelectedItems(t){this.selectedItems=t}hasToUseOptions(){return this.fieldDescriptor.userInterface===e.OPTIONSELECTOR||this.fieldDescriptor.userInterface===e.SWITCH||this.fieldDescriptor.userInterface===e.CHECKBOX}isCheckBoxOrSwitch(){return this.fieldDescriptor.userInterface===e.SWITCH||this.fieldDescriptor.userInterface===e.CHECKBOX}setOptions(t){const i=this.hasToUseOptions();this.useOptions=i,this.options=i?this.buildOptions(t):null!=t?t:null}buildOptions(t){var i,s;if(t&&t.length>0)return t;if(this.isCheckBoxOrSwitch())return[{label:"Sim",value:"true",check:!0},{label:"Não",value:"false",check:!0}];const e=JSON.parse(null===(s=null===(i=this.fieldDescriptor)||void 0===i?void 0:i.properties)||void 0===s?void 0:s.options);return Object.keys(e).map((t=>({label:e[t],value:t,check:!0})))}handleEzVisibilityChange(t){!1===t.detail&&this.clearConfigs()}render(){return s("ez-popover",{class:"filter-column__popover","overlay-type":"none",ref:t=>this.ezPopoverElement=t,autoClose:!0,onEzVisibilityChange:this.handleEzVisibilityChange.bind(this)},s("section",{class:"filter-column"},s("header",{class:"filter-column__header"},s("span",{class:"ez-text ez-text--medium filter-column__header-title"},"Filtro da coluna ",this.columnLabel),s("ez-button",{mode:"icon","icon-name":"close",class:"ez-button--tertiary",onClick:()=>this.hide()})),s("ez-multi-selection-list",{columnName:this.columnName,dataSource:this.dataSource,options:this.options,useOptions:this.useOptions,ref:t=>this.ezMultiSelectionList=t,onChangeFilteredOptions:t=>this.changeSelectedItems(t.detail),isTextSearch:this.isTextSearch}),s("footer",{class:"filter-column__footer"},s("ez-button",{label:"Aplicar",class:"ez-button--primary",onClick:this.submit.bind(this)}))))}};h.style=".filter-column{padding:var(--space--2xs, 8px);position:relative}.filter-column__header{margin-bottom:var(--space--2xs, 8px);display:flex;flex-direction:row;align-items:center;justify-content:space-between;height:var(--space--xl, 32px)}.filter-column__footer{position:relative;display:flex;flex-direction:row;justify-content:flex-end;align-items:center;width:100%;bottom:0;left:0;padding-top:var(--space--2xs, 8px);border-top:var(--border--medium) var(--color--disable-secondary)}.filter-column__popover{position:absolute}.filter-column__header-title{margin-left:8px}";export{h as filter_column}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as o,H as n,g as t}from"./p-e318d280.js";import{StringUtils as c,ElementIDUtils as i}from"@sankhyalabs/core";const a=class{constructor(o){e(this,o),this.size="medium",this.href=void 0,this.iconName=void 0}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})):c.isEmpty(this.iconName)?o("img",{class:this.size,src:this.href}):o("span",{class:`icon-content ${this.getIconClassName()} ${this.size}--font`})}componentDidLoad(){i.addIDInfo(this._hostElement,"icon")}render(){return o(n,null,this.getIconContent())}get _hostElement(){return t(this)}};a.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-2chevron-down:before{content:"\\ea01"}.ez-icon-2chevron-up:before{content:"\\ea02"}.ez-icon-acao:before{content:"\\ea03"}.ez-icon-account-outline:before{content:"\\ea04"}.ez-icon-account:before{content:"\\ea05"}.ez-icon-actions-sprite-v1:before{content:"\\ea06"}.ez-icon-alert-circle-inverted:before{content:"\\ea07"}.ez-icon-alert-circle:before{content:"\\ea08"}.ez-icon-alert-mail:before{content:"\\ea09"}.ez-icon-alert-popup:before{content:"\\ea0a"}.ez-icon-anexo:before{content:"\\ea0b"}.ez-icon-antecipação:before{content:"\\ea0c"}.ez-icon-apps:before{content:"\\ea0d"}.ez-icon-arrow_back:before{content:"\\ea0e"}.ez-icon-arrow_downward:before{content:"\\ea0f"}.ez-icon-baixa:before{content:"\\ea10"}.ez-icon-balance:before{content:"\\ea11"}.ez-icon-bell-inverted:before{content:"\\ea12"}.ez-icon-bell:before{content:"\\ea13"}.ez-icon-boleto:before{content:"\\ea14"}.ez-icon-boolean:before{content:"\\ea15"}.ez-icon-business-center:before{content:"\\ea16"}.ez-icon-calendar-clock:before{content:"\\ea17"}.ez-icon-calendar:before{content:"\\ea18"}.ez-icon-cash-remove:before{content:"\\ea19"}.ez-icon-check-circle-inverted:before{content:"\\ea1a"}.ez-icon-check-circle:before{content:"\\ea1b"}.ez-icon-check:before{content:"\\ea1c"}.ez-icon-chevron-down:before{content:"\\ea1d"}.ez-icon-chevron-left:before{content:"\\ea1e"}.ez-icon-chevron-right:before{content:"\\ea1f"}.ez-icon-chevron-up:before{content:"\\ea20"}.ez-icon-circle--medium:before{content:"\\ea21"}.ez-icon-circle:before{content:"\\ea22"}.ez-icon-cleaning:before{content:"\\ea23"}.ez-icon-clipboard:before{content:"\\ea24"}.ez-icon-close:before{content:"\\ea25"}.ez-icon-cobrar:before{content:"\\ea26"}.ez-icon-code:before{content:"\\ea27"}.ez-icon-configuration:before{content:"\\ea28"}.ez-icon-copy:before{content:"\\ea29"}.ez-icon-credit_card:before{content:"\\ea2a"}.ez-icon-crop:before{content:"\\ea2b"}.ez-icon-custom:before{content:"\\ea2c"}.ez-icon-delete:before{content:"\\ea2d"}.ez-icon-description:before{content:"\\ea2e"}.ez-icon-dividir:before{content:"\\ea2f"}.ez-icon-docx:before{content:"\\ea30"}.ez-icon-dot-notification:before{content:"\\ea31"}.ez-icon-dots-horizontal:before{content:"\\ea32"}.ez-icon-dots-vertical:before{content:"\\ea33"}.ez-icon-drag-indicator:before{content:"\\ea34"}.ez-icon-dual-chevron-down:before{content:"\\ea35"}.ez-icon-dual-chevron-up:before{content:"\\ea36"}.ez-icon-edit-file:before{content:"\\ea37"}.ez-icon-edit-table:before{content:"\\ea38"}.ez-icon-edit-time:before{content:"\\ea39"}.ez-icon-edit:before{content:"\\ea3a"}.ez-icon-email:before{content:"\\ea3b"}.ez-icon-estorno:before{content:"\\ea3c"}.ez-icon-exe:before{content:"\\ea3d"}.ez-icon-expand:before{content:"\\ea3e"}.ez-icon-expandir_card:before{content:"\\ea3f"}.ez-icon-extrato:before{content:"\\ea40"}.ez-icon-eye-off:before{content:"\\ea41"}.ez-icon-eye:before{content:"\\ea42"}.ez-icon-favorite:before{content:"\\ea43"}.ez-icon-figma:before{content:"\\ea44"}.ez-icon-file-download:before{content:"\\ea45"}.ez-icon-file-upload:before{content:"\\ea46"}.ez-icon-filter:before{content:"\\ea47"}.ez-icon-find-file:before{content:"\\ea48"}.ez-icon-find-page:before{content:"\\ea49"}.ez-icon-format-color-fill:before{content:"\\ea4a"}.ez-icon-generic:before{content:"\\ea4b"}.ez-icon-gif:before{content:"\\ea4c"}.ez-icon-graph_bar:before{content:"\\ea4d"}.ez-icon-handshake:before{content:"\\ea4e"}.ez-icon-help-inverted:before{content:"\\ea4f"}.ez-icon-help:before{content:"\\ea50"}.ez-icon-hide_menu:before{content:"\\ea51"}.ez-icon-home:before{content:"\\ea52"}.ez-icon-icons104:before{content:"\\ea53"}.ez-icon-language:before{content:"\\ea54"}.ez-icon-launch:before{content:"\\ea55"}.ez-icon-lightbulb:before{content:"\\ea56"}.ez-icon-list:before{content:"\\ea57"}.ez-icon-location:before{content:"\\ea58"}.ez-icon-lock-outline:before{content:"\\ea59"}.ez-icon-lock:before{content:"\\ea5a"}.ez-icon-menu:before{content:"\\ea5b"}.ez-icon-mid:before{content:"\\ea5c"}.ez-icon-minus:before{content:"\\ea5d"}.ez-icon-money-off:before{content:"\\ea5e"}.ez-icon-money:before{content:"\\ea5f"}.ez-icon-more:before{content:"\\ea60"}.ez-icon-mp3:before{content:"\\ea61"}.ez-icon-mp4:before{content:"\\ea62"}.ez-icon-north-west:before{content:"\\ea63"}.ez-icon-number:before{content:"\\ea64"}.ez-icon-ordem-ascendente:before{content:"\\ea65"}.ez-icon-ordem-descendente:before{content:"\\ea66"}.ez-icon-parcelar:before{content:"\\ea67"}.ez-icon-pause:before{content:"\\ea68"}.ez-icon-payments:before{content:"\\ea69"}.ez-icon-pdf:before{content:"\\ea6a"}.ez-icon-play:before{content:"\\ea6b"}.ez-icon-plus:before{content:"\\ea6c"}.ez-icon-png:before{content:"\\ea6d"}.ez-icon-power:before{content:"\\ea6e"}.ez-icon-pptx:before{content:"\\ea6f"}.ez-icon-print:before{content:"\\ea70"}.ez-icon-push-pin:before{content:"\\ea71"}.ez-icon-rateio:before{content:"\\ea72"}.ez-icon-receipt:before{content:"\\ea73"}.ez-icon-recolher_card:before{content:"\\ea74"}.ez-icon-restore:before{content:"\\ea75"}.ez-icon-return:before{content:"\\ea76"}.ez-icon-save:before{content:"\\ea77"}.ez-icon-search:before{content:"\\ea78"}.ez-icon-settings-inverted:before{content:"\\ea79"}.ez-icon-settings:before{content:"\\ea7a"}.ez-icon-share:before{content:"\\ea7b"}.ez-icon-shield:before{content:"\\ea7c"}.ez-icon-show_menu:before{content:"\\ea7d"}.ez-icon-south-east:before{content:"\\ea7e"}.ez-icon-sync:before{content:"\\ea7f"}.ez-icon-table:before{content:"\\ea80"}.ez-icon-tag_code:before{content:"\\ea81"}.ez-icon-text:before{content:"\\ea82"}.ez-icon-timeline:before{content:"\\ea83"}.ez-icon-timer-outline:before{content:"\\ea84"}.ez-icon-tune:before{content:"\\ea85"}.ez-icon-txt:before{content:"\\ea86"}.ez-icon-un-pin:before{content:"\\ea87"}.ez-icon-unfold_less:before{content:"\\ea88"}.ez-icon-unfold_more:before{content:"\\ea89"}.ez-icon-user-circle:before{content:"\\ea8a"}.ez-icon-warning-outline:before{content:"\\ea8b"}.ez-icon-warning_triangle:before{content:"\\ea8c"}.ez-icon-whatshot:before{content:"\\ea8d"}.ez-icon-xlsx:before{content:"\\ea8e"}.ez-icon-zip:before{content:"\\ea8f"}.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{a as ez_icon}
|
package/dist/ezui/p-27a01a26.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const o=" (obrigatório) *",a="FILTRO_COLUNA_";export{a as D,o as R}
|