@sankhyalabs/ezui 5.5.0 → 5.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ez-grid.cjs.entry.js +31 -2
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/filter-column.cjs.entry.js +25 -5
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-grid/ez-grid.css +2 -5
- package/dist/collection/components/ez-grid/ez-grid.js +32 -2
- package/dist/collection/components/ez-grid/subcomponents/filter-column.js +43 -5
- package/dist/custom-elements/index.js +58 -9
- package/dist/esm/ez-grid.entry.js +31 -2
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/filter-column.entry.js +25 -5
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-4c8b029b.entry.js +1 -0
- package/dist/ezui/{p-fc15aae2.entry.js → p-7c83718e.entry.js} +1 -1
- package/dist/types/components/ez-grid/ez-grid.d.ts +4 -0
- package/dist/types/components/ez-grid/subcomponents/filter-column.d.ts +4 -0
- package/dist/types/components.d.ts +2 -0
- package/package.json +1 -1
- package/dist/ezui/p-c0acdb46.entry.js +0 -1
|
@@ -18,6 +18,7 @@ export declare class EzGrid {
|
|
|
18
18
|
private _isAllSelection;
|
|
19
19
|
private _currentPageSelected;
|
|
20
20
|
private _selectionCount;
|
|
21
|
+
private _originalRecords;
|
|
21
22
|
/**
|
|
22
23
|
* Emitido quando acontece a alteração de estado das colunas do grid: Ordenação, largura, etc.
|
|
23
24
|
*/
|
|
@@ -118,5 +119,8 @@ export declare class EzGrid {
|
|
|
118
119
|
componentDidLoad(): void;
|
|
119
120
|
componentWillRender(): void;
|
|
120
121
|
componentDidRender(): void;
|
|
122
|
+
private getDataSource;
|
|
123
|
+
private buildDefaultDataSource;
|
|
124
|
+
private buildIMultiSelectionOption;
|
|
121
125
|
render(): any;
|
|
122
126
|
}
|
|
@@ -4,12 +4,15 @@ import { IMultiSelectionListDataSource } from '../../ez-multi-selection-list/int
|
|
|
4
4
|
import { IMultiSelectionOption } from '../../ez-multi-selection-list/interfaces/IMultiSelectionOption';
|
|
5
5
|
export declare class FilterColumn {
|
|
6
6
|
private readonly TOP_POSITION;
|
|
7
|
+
private readonly TOP_POSITION_HEADER_HIDDEN;
|
|
8
|
+
private readonly DEFAULT_HEIGHT;
|
|
7
9
|
private ezPopoverElement;
|
|
8
10
|
private ezMultiSelectionList;
|
|
9
11
|
applyFilterColumnOptions: EventEmitter<IAppliedFilterColumnOptions>;
|
|
10
12
|
opened: boolean;
|
|
11
13
|
columnName: string;
|
|
12
14
|
columnLabel: string;
|
|
15
|
+
gridHeaderHidden: boolean;
|
|
13
16
|
dataSource: IMultiSelectionListDataSource;
|
|
14
17
|
dataUnit: DataUnit;
|
|
15
18
|
options: IMultiSelectionOption[];
|
|
@@ -22,6 +25,7 @@ export declare class FilterColumn {
|
|
|
22
25
|
* @Params IFilterColumnConfigs informações para configurar o filtro
|
|
23
26
|
*/
|
|
24
27
|
show(configs: IFilterColumnConfigs): Promise<void>;
|
|
28
|
+
private calcTopPosition;
|
|
25
29
|
private clearConfigs;
|
|
26
30
|
private canShow;
|
|
27
31
|
private submit;
|
|
@@ -1438,6 +1438,7 @@ export namespace Components {
|
|
|
1438
1438
|
"columnName": string;
|
|
1439
1439
|
"dataSource": IMultiSelectionListDataSource;
|
|
1440
1440
|
"dataUnit": DataUnit;
|
|
1441
|
+
"gridHeaderHidden": boolean;
|
|
1441
1442
|
"hide": () => Promise<void>;
|
|
1442
1443
|
"opened": boolean;
|
|
1443
1444
|
"options": IMultiSelectionOption[];
|
|
@@ -3227,6 +3228,7 @@ declare namespace LocalJSX {
|
|
|
3227
3228
|
"columnName"?: string;
|
|
3228
3229
|
"dataSource"?: IMultiSelectionListDataSource;
|
|
3229
3230
|
"dataUnit"?: DataUnit;
|
|
3231
|
+
"gridHeaderHidden"?: boolean;
|
|
3230
3232
|
"onApplyFilterColumnOptions"?: (event: FilterColumnCustomEvent<IAppliedFilterColumnOptions>) => void;
|
|
3231
3233
|
"opened"?: boolean;
|
|
3232
3234
|
"options"?: IMultiSelectionOption[];
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as e}from"./p-e318d280.js";import{UserInterface as s}from"@sankhyalabs/core";const o=window,l=new CustomEvent("onSubmitFilter",{detail:{showToast:!0}}),n=class{constructor(e){t(this,e),this.applyFilterColumnOptions=i(this,"applyFilterColumnOptions",7),this.TOP_POSITION="65px",this.opened=!0,this.columnName=void 0,this.columnLabel=void 0,this.dataSource=void 0,this.dataUnit=void 0,this.options=void 0,this.selectedItems=void 0,this.fieldDescriptor=void 0,this.useOptions=!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.setOptions(t.filteredOptions),this.columnName=t.columnName,this.columnLabel=t.columnLabel,await this.ezPopoverElement.show(this.TOP_POSITION,t.leftPosition))}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===s.OPTIONSELECTOR||this.fieldDescriptor.userInterface===s.SWITCH||this.fieldDescriptor.userInterface===s.CHECKBOX}isCheckBoxOrSwitch(){return this.fieldDescriptor.userInterface===s.SWITCH||this.fieldDescriptor.userInterface===s.CHECKBOX}setOptions(t){const i=this.hasToUseOptions();this.useOptions=i,this.options=i?this.buildOptions(t):null!=t?t:null}buildOptions(t){var i,e;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 s=JSON.parse(null===(e=null===(i=this.fieldDescriptor)||void 0===i?void 0:i.properties)||void 0===e?void 0:e.options);return Object.keys(s).map((t=>({label:s[t],value:t,check:!0})))}handleEzVisibilityChange(t){!1===t.detail&&this.clearConfigs()}render(){return e("ez-popover",{class:"filter-column__popover","overlay-type":"none",ref:t=>this.ezPopoverElement=t,autoClose:!0,onEzVisibilityChange:this.handleEzVisibilityChange.bind(this)},e("section",{class:"filter-column"},e("header",{class:"filter-column__header"},e("span",{class:"ez-text ez-text--medium filter-column__header-title"},"Filtro da coluna ",this.columnLabel),e("ez-button",{mode:"icon","icon-name":"close",class:"ez-button--tertiary",onClick:()=>this.hide()})),e("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)}),e("footer",{class:"filter-column__footer"},e("ez-button",{label:"Aplicar",class:"ez-button--primary",onClick:this.submit.bind(this)}))))}};n.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{n as filter_column}
|