@sankhyalabs/ezui 4.2.0 → 4.3.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.
Files changed (30) hide show
  1. package/dist/cjs/ez-badge.cjs.entry.js +120 -0
  2. package/dist/cjs/ez-grid.cjs.entry.js +7 -7
  3. package/dist/cjs/ezui.cjs.js +1 -1
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/collection/collection-manifest.json +1 -0
  6. package/dist/collection/components/ez-badge/enum/sizes.js +9 -0
  7. package/dist/collection/components/ez-badge/ez-badge.css +165 -0
  8. package/dist/collection/components/ez-badge/ez-badge.js +211 -0
  9. package/dist/collection/components/ez-badge/interfaces/IPosition.js +1 -0
  10. package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +2 -2
  11. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +4 -4
  12. package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +1 -1
  13. package/dist/collection/components/ez-grid/ez-grid.js +2 -2
  14. package/dist/custom-elements/index.d.ts +6 -0
  15. package/dist/custom-elements/index.js +124 -8
  16. package/dist/esm/ez-badge.entry.js +116 -0
  17. package/dist/esm/ez-grid.entry.js +7 -7
  18. package/dist/esm/ezui.js +1 -1
  19. package/dist/esm/loader.js +1 -1
  20. package/dist/ezui/ezui.esm.js +1 -1
  21. package/dist/ezui/p-077a6943.entry.js +1 -0
  22. package/dist/ezui/{p-8105c967.entry.js → p-96df1a0e.entry.js} +1 -1
  23. package/dist/types/components/ez-badge/enum/sizes.d.ts +8 -0
  24. package/dist/types/components/ez-badge/ez-badge.d.ts +35 -0
  25. package/dist/types/components/ez-badge/interfaces/IPosition.d.ts +4 -0
  26. package/dist/types/components.d.ts +54 -0
  27. package/package.json +1 -1
  28. package/react/components.d.ts +1 -0
  29. package/react/components.js +1 -0
  30. package/react/components.js.map +1 -1
@@ -0,0 +1,211 @@
1
+ import { ElementIDUtils } from "@sankhyalabs/core";
2
+ import { h, Host } from "@stencil/core";
3
+ import { Sizes } from "./enum/sizes";
4
+ export class EzBadge {
5
+ constructor() {
6
+ this._sizes = {
7
+ [Sizes.EXTRA_LARGE]: {
8
+ sufix: "xl",
9
+ },
10
+ [Sizes.LARGE]: {
11
+ sufix: "lg",
12
+ },
13
+ [Sizes.MEDIUM]: {
14
+ sufix: "md",
15
+ },
16
+ [Sizes.SMALL_MEDIUM]: {
17
+ sufix: "sm",
18
+ },
19
+ [Sizes.SMALL]: {
20
+ sufix: "xs",
21
+ },
22
+ [Sizes.EXTRA_SMALL]: {
23
+ sufix: "2xs",
24
+ },
25
+ };
26
+ this.hasSlot = false;
27
+ this.size = "small";
28
+ this.label = undefined;
29
+ this.iconLeft = undefined;
30
+ this.iconRight = undefined;
31
+ this.position = { horizontal: "right", vertical: "top" };
32
+ }
33
+ getIconSize() {
34
+ switch (this.size) {
35
+ case "large":
36
+ return "large";
37
+ case "medium":
38
+ case "small-medium":
39
+ return "small";
40
+ case "small":
41
+ return "x-small";
42
+ default:
43
+ return null;
44
+ }
45
+ }
46
+ componentDidLoad() {
47
+ if (this._element) {
48
+ ElementIDUtils.addIDInfo(this._element);
49
+ }
50
+ if (this._badge) {
51
+ const dataInfo = { id: 'embedded' };
52
+ ElementIDUtils.addIDInfo(this._badge, 'ezBadge', dataInfo);
53
+ }
54
+ }
55
+ handleSlotChange() {
56
+ this.hasSlot = true;
57
+ }
58
+ validateIconLeft() {
59
+ return (this.iconLeft) && this.iconLeft.trim() !== "";
60
+ }
61
+ validateIconRight() {
62
+ return (this.iconRight) && this.iconRight.trim() !== "";
63
+ }
64
+ validateLabel() {
65
+ return (this.label) && this.label.trim() !== "";
66
+ }
67
+ createContainerClassName() {
68
+ let sizeSufix = this._sizes[this.size].sufix;
69
+ let containerClassNames = ["badge__content"];
70
+ if (this.hasSlot) {
71
+ containerClassNames.push("badge__content--fill-" + sizeSufix);
72
+ if (this.position.vertical == "bottom" && this.position.horizontal == "right") {
73
+ containerClassNames.push("badge__content--fill-bottom-right");
74
+ }
75
+ if (this.position.vertical == "bottom" && this.position.horizontal == "left") {
76
+ containerClassNames.push("badge__content--fill-bottom-left");
77
+ }
78
+ if (this.position.vertical == "top" && this.position.horizontal == "right") {
79
+ containerClassNames.push("badge__content--fill-top-right");
80
+ }
81
+ if (this.position.vertical == "top" && this.position.horizontal == "left") {
82
+ containerClassNames.push("badge__content--fill-top-left");
83
+ }
84
+ }
85
+ if (this.label) {
86
+ containerClassNames.push("badge__content--text-" + sizeSufix);
87
+ }
88
+ else if (this.iconLeft || this.iconRight) {
89
+ containerClassNames.push("badge__content--icon-" + sizeSufix);
90
+ }
91
+ else {
92
+ containerClassNames.push("badge__content--fill-" + sizeSufix);
93
+ }
94
+ return containerClassNames.join(" ");
95
+ }
96
+ render() {
97
+ return (h(Host, null, h("div", { class: "badge" }, h("div", null, h("slot", { name: "child-badge", onSlotchange: () => { this.handleSlotChange(); } })), h("div", { class: this.createContainerClassName(), ref: (el) => this._badge = el }, this.validateIconLeft() && h("ez-icon", { class: "icon", iconName: this.iconLeft, size: this.getIconSize() }), this.validateLabel() && h("label", { title: this.label }, this.label), this.validateIconRight() && h("ez-icon", { class: "icon", iconName: this.iconRight, size: this.getIconSize() })))));
98
+ }
99
+ static get is() { return "ez-badge"; }
100
+ static get encapsulation() { return "shadow"; }
101
+ static get originalStyleUrls() {
102
+ return {
103
+ "$": ["ez-badge.css"]
104
+ };
105
+ }
106
+ static get styleUrls() {
107
+ return {
108
+ "$": ["ez-badge.css"]
109
+ };
110
+ }
111
+ static get properties() {
112
+ return {
113
+ "size": {
114
+ "type": "string",
115
+ "mutable": false,
116
+ "complexType": {
117
+ "original": "\"extra-large\" | \"large\" | \"medium\" | \"small-medium\" | \"small\" | \"extra-small\"",
118
+ "resolved": "\"extra-large\" | \"extra-small\" | \"large\" | \"medium\" | \"small\" | \"small-medium\"",
119
+ "references": {}
120
+ },
121
+ "required": false,
122
+ "optional": false,
123
+ "docs": {
124
+ "tags": [],
125
+ "text": "Define o tamanho de acordo com o tipo utilizado pelo componente."
126
+ },
127
+ "attribute": "size",
128
+ "reflect": true,
129
+ "defaultValue": "\"small\""
130
+ },
131
+ "label": {
132
+ "type": "string",
133
+ "mutable": false,
134
+ "complexType": {
135
+ "original": "string",
136
+ "resolved": "string",
137
+ "references": {}
138
+ },
139
+ "required": false,
140
+ "optional": false,
141
+ "docs": {
142
+ "tags": [],
143
+ "text": "Define o conte\u00FAdo textual ou num\u00E9rico do componente."
144
+ },
145
+ "attribute": "label",
146
+ "reflect": true
147
+ },
148
+ "iconLeft": {
149
+ "type": "string",
150
+ "mutable": false,
151
+ "complexType": {
152
+ "original": "string",
153
+ "resolved": "string",
154
+ "references": {}
155
+ },
156
+ "required": false,
157
+ "optional": false,
158
+ "docs": {
159
+ "tags": [],
160
+ "text": "Define o \u00EDcone a ser usado no lado esquerdo do badge: [ez-icons](https://sankhyalabs-storybook.herokuapp.com/themes/default/icons/fonts/index.html)"
161
+ },
162
+ "attribute": "icon-left",
163
+ "reflect": true
164
+ },
165
+ "iconRight": {
166
+ "type": "string",
167
+ "mutable": false,
168
+ "complexType": {
169
+ "original": "string",
170
+ "resolved": "string",
171
+ "references": {}
172
+ },
173
+ "required": false,
174
+ "optional": false,
175
+ "docs": {
176
+ "tags": [],
177
+ "text": "Define o \u00EDcone a ser usado no lado direito do badge: [ez-icons](https://sankhyalabs-storybook.herokuapp.com/themes/default/icons/fonts/index.html)"
178
+ },
179
+ "attribute": "icon-right",
180
+ "reflect": true
181
+ },
182
+ "position": {
183
+ "type": "unknown",
184
+ "mutable": true,
185
+ "complexType": {
186
+ "original": "IPosition",
187
+ "resolved": "IPosition",
188
+ "references": {
189
+ "IPosition": {
190
+ "location": "import",
191
+ "path": "./interfaces/IPosition"
192
+ }
193
+ }
194
+ },
195
+ "required": false,
196
+ "optional": false,
197
+ "docs": {
198
+ "tags": [],
199
+ "text": "Define a posi\u00E7\u00E3o do \u00EDcone em rela\u00E7\u00E3o ao elemento filho."
200
+ },
201
+ "defaultValue": "{ horizontal: \"right\", vertical: \"top\" }"
202
+ }
203
+ };
204
+ }
205
+ static get states() {
206
+ return {
207
+ "hasSlot": {}
208
+ };
209
+ }
210
+ static get elementRef() { return "_element"; }
211
+ }
@@ -20,7 +20,7 @@ export default class DataUnitBridge {
20
20
  break;
21
21
  case Action.SELECTION_REMOVED:
22
22
  const { unselection } = action.payload;
23
- const filteredRecords = this._dataUnit.getAllSelection()
23
+ const filteredRecords = this._dataUnit.getSelection()
24
24
  .filter((selectedRecord) => {
25
25
  return !unselection.some((unselectedRecord) => {
26
26
  return unselectedRecord.__record__id__ === selectedRecord.__record__id__;
@@ -35,7 +35,7 @@ export default class DataUnitBridge {
35
35
  break;
36
36
  case Action.NEXT_SELECTED:
37
37
  case Action.PREVIOUS_SELECTED:
38
- this._gridController.selectRows(this._dataUnit.getAllSelection());
38
+ this._gridController.selectRows(this._dataUnit.getSelection());
39
39
  break;
40
40
  case Action.DATA_CHANGED:
41
41
  const changes = Object.assign({}, action.payload);
@@ -88,7 +88,7 @@ export default class AgGridController {
88
88
  else {
89
89
  this._grid = new Grid(container, this._gridOptions);
90
90
  }
91
- const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getAllSelection();
91
+ const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSelection();
92
92
  if (selection) {
93
93
  this.selectRows(selection);
94
94
  }
@@ -172,7 +172,7 @@ export default class AgGridController {
172
172
  if (records && records.length === 0) {
173
173
  return false;
174
174
  }
175
- const allSelection = this._dataUnit.getAllSelection();
175
+ const allSelection = this._dataUnit.getSelection();
176
176
  if (allSelection == undefined || allSelection.length === 0) {
177
177
  return false;
178
178
  }
@@ -202,14 +202,14 @@ export default class AgGridController {
202
202
  if (this._dataUnit == undefined) {
203
203
  return;
204
204
  }
205
- let allSelection = this._dataUnit.getAllSelection();
205
+ let allSelection = this._dataUnit.getSelection();
206
206
  if (allSelection === null || allSelection === void 0 ? void 0 : allSelection.some((sel) => sel.__record__id__ === ALL_RECORD)) {
207
207
  await this._dataUnit.clearSelection();
208
208
  }
209
209
  let updateSelection = [];
210
210
  const records = this._dataUnit.records;
211
211
  const selectedRecords = this._dataUnit.getSelectedRecords();
212
- allSelection = this._dataUnit.getAllSelection();
212
+ allSelection = this._dataUnit.getSelection();
213
213
  if (selectAll && selectedRecords.length < records.length) {
214
214
  updateSelection = records;
215
215
  allSelection.forEach((selectedRecord) => {
@@ -40,7 +40,7 @@ export default class DataSource {
40
40
  }
41
41
  updateSelection() {
42
42
  var _a;
43
- const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getAllSelection();
43
+ const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSelection();
44
44
  if ((selection === null || selection === void 0 ? void 0 : selection.length) > 0) {
45
45
  this._controller.selectRows(selection);
46
46
  }
@@ -100,7 +100,7 @@ export class EzGrid {
100
100
  }
101
101
  isAllRecordSetted() {
102
102
  var _a;
103
- const allSelection = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getAllSelection();
103
+ const allSelection = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelection();
104
104
  return allSelection === null || allSelection === void 0 ? void 0 : allSelection.some((selectedRecord) => {
105
105
  return selectedRecord.__record__id__ === ALL_RECORD;
106
106
  });
@@ -128,7 +128,7 @@ export class EzGrid {
128
128
  }
129
129
  controlSelectionCounter() {
130
130
  var _a, _b;
131
- const allSelection = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getAllSelection();
131
+ const allSelection = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelection();
132
132
  const counter = (_b = allSelection === null || allSelection === void 0 ? void 0 : allSelection.length) !== null && _b !== void 0 ? _b : 0;
133
133
  if (this.isAllRecordSetted()) {
134
134
  this.setAutoSelectAll();
@@ -20,6 +20,12 @@ export const EzApplication: {
20
20
  new (): EzApplication;
21
21
  };
22
22
 
23
+ interface EzBadge extends Components.EzBadge, HTMLElement {}
24
+ export const EzBadge: {
25
+ prototype: EzBadge;
26
+ new (): EzBadge;
27
+ };
28
+
23
29
  interface EzBreadcrumb extends Components.EzBreadcrumb, HTMLElement {}
24
30
  export const EzBreadcrumb: {
25
31
  prototype: EzBreadcrumb;
@@ -926,6 +926,120 @@ const EzApplication$1 = class extends HTMLElement$1 {
926
926
  static get style() { return ezApplicationCss; }
927
927
  };
928
928
 
929
+ var Sizes;
930
+ (function (Sizes) {
931
+ Sizes["EXTRA_LARGE"] = "extra-large";
932
+ Sizes["LARGE"] = "large";
933
+ Sizes["MEDIUM"] = "medium";
934
+ Sizes["SMALL_MEDIUM"] = "small-medium";
935
+ Sizes["SMALL"] = "small";
936
+ Sizes["EXTRA_SMALL"] = "extra-small";
937
+ })(Sizes || (Sizes = {}));
938
+
939
+ const ezBadgeCss = ":host{--ez-badge--size-2xs:var(--space--2xs, 8px);--ez-badge--size-xs:var(--space--xs, 12px);--ez-badge--size-sm:var(--space--sm, 16px);--ez-badge--size-md:var(--space--md, 20px);--ez-badge--size-lg:var(--space--lg, 24px);--ez-badge--size-xl:var(--space--xl, 32px);--ez-badge--padding-2xs:0;--ez-badge--padding-xs:var(--space--nano, 2px);--ez-badge--padding-sm:calc(var(--space--nano, 2px) + 1px);--ez-badge--padding-md:var(--space--3xs, 4px);--ez-badge--padding-lg:calc(var(--space--3xs, 4px) + 2px);--ez-badge--padding-xl:var(--space--2xs);--ez-badge--border-radius:calc(var(--border--radius-medium, 12px) + 8px);--ez-badge--font-family:var(--font-pattern, Roboto);--ez-badge--font-weight-medium:var(--text-weight--medium, 400);--ez-badge--background-color:var(--color--primary, #008561);--ez-badge--border-none:0;--ez-badge--color:var(--text--inverted, #ffffff);--ez-badge--gap:calc(var(--ez-badge--padding-xs) + 1px);--ez-badge--font-size-md:var(--text--medium);--ez-badge--font-size-sm:var(--text--medium);--ez-badge--font-size-xs:var(--text--small)}ez-icon{--ez-icon--color:inherit}.badge{display:flex;justify-content:center;align-items:center;position:relative}.badge__content{font-family:var(--ez-badge--font-family, Roboto);font-weight:var(--ez-badge--font-weight-medium, 400);background-color:var(--ez-badge--background-color, #008561);border:var(--ez-badge--border-none, 0);color:var(--ez-badge--color, #ffffff);border-radius:var(--ez-badge--border-radius, 20px);gap:var(--ez-badge--gap, 3px);display:flex;justify-content:center;align-items:center}.badge__content--fill-xs{height:var(--ez-badge--size-xs, 12px);min-width:var(--ez-badge--size-xs, 12px)}.badge__content--fill-2xs{height:var(--ez-badge--size-2xs, 8px);min-width:var(--ez-badge--size-2xs, 8px)}.badge__content--text-md{height:calc(var(--ez-badge--size-md, 20px) - 2px);min-width:var(--ez-badge--size-sm, 20px);padding-top:var(--ez-badge--padding-sm);padding-bottom:var(--ez-badge--padding-sm);padding-right:var(--ez-badge--padding-xl);padding-left:var(--ez-badge--padding-xl);font-size:var(--ez-badge--font-size-md)}.badge__content--text-sm{height:calc(var(--ez-badge--size-sm, 16px) - 2px);min-width:var(--ez-badge--size-sm, 16px);padding-top:var(--ez-badge--padding-sm);padding-bottom:var(--ez-badge--padding-sm);padding-right:var(--ez-badge--padding-xl);padding-left:var(--ez-badge--padding-xl);font-size:var(--ez-badge--font-size-sm)}.badge__content--text-xs{height:var(--ez-badge--size-sm, 16px);min-width:var(--ez-badge--size-sm, 16px);padding-top:var(--ez-badge--padding-2xs);padding-bottom:var(--ez-badge--padding-2xs);padding-right:var(--ez-badge--padding-lg);padding-left:var(--ez-badge--padding-lg);font-size:var(--ez-badge--font-size-xs)}.badge__content--icon-lg{height:var(--ez-badge--size-lg, 24px);min-width:var(--ez-badge--size-lg, 24px);padding:var(--ez-badge--padding-md)}.badge__content--icon-md{height:var(--ez-badge--size-sm, 16px);min-width:var(--ez-badge--size-sm, 16px);padding:var(--ez-badge--padding-md)}.badge__content--icon-sm{height:var(--ez-badge--size-sm, 16px);min-width:var(--ez-badge--size-sm, 16px);padding:var(--ez-badge--padding-xs)}.badge__content--icon-xs{height:var(--ez-badge--size-xs, 12px);min-width:var(--ez-badge--size-xs, 12px);padding:var(--ez-badge--padding-xs)}.badge__content--fill{position:absolute;top:0;inset-inline-end:0;z-index:var(--most-visible, 2)}.badge__content--fill-top-right{transform:translate(50%, -50%);position:absolute;top:0;right:0}.badge__content--fill-top-left{transform:translate(-50%, -50%);position:absolute;top:0;left:0}.badge__content--fill-bottom-left{transform:translate(-50%, 50%);position:absolute;bottom:0;left:0}.badge__content--fill-bottom-right{transform:translate(50%, 50%);position:absolute;bottom:0;right:0}";
940
+
941
+ const EzBadge$1 = class extends HTMLElement$1 {
942
+ constructor() {
943
+ super();
944
+ this.__registerHost();
945
+ this.__attachShadow();
946
+ this._sizes = {
947
+ [Sizes.EXTRA_LARGE]: {
948
+ sufix: "xl",
949
+ },
950
+ [Sizes.LARGE]: {
951
+ sufix: "lg",
952
+ },
953
+ [Sizes.MEDIUM]: {
954
+ sufix: "md",
955
+ },
956
+ [Sizes.SMALL_MEDIUM]: {
957
+ sufix: "sm",
958
+ },
959
+ [Sizes.SMALL]: {
960
+ sufix: "xs",
961
+ },
962
+ [Sizes.EXTRA_SMALL]: {
963
+ sufix: "2xs",
964
+ },
965
+ };
966
+ this.hasSlot = false;
967
+ this.size = "small";
968
+ this.label = undefined;
969
+ this.iconLeft = undefined;
970
+ this.iconRight = undefined;
971
+ this.position = { horizontal: "right", vertical: "top" };
972
+ }
973
+ getIconSize() {
974
+ switch (this.size) {
975
+ case "large":
976
+ return "large";
977
+ case "medium":
978
+ case "small-medium":
979
+ return "small";
980
+ case "small":
981
+ return "x-small";
982
+ default:
983
+ return null;
984
+ }
985
+ }
986
+ componentDidLoad() {
987
+ if (this._element) {
988
+ ElementIDUtils.addIDInfo(this._element);
989
+ }
990
+ if (this._badge) {
991
+ const dataInfo = { id: 'embedded' };
992
+ ElementIDUtils.addIDInfo(this._badge, 'ezBadge', dataInfo);
993
+ }
994
+ }
995
+ handleSlotChange() {
996
+ this.hasSlot = true;
997
+ }
998
+ validateIconLeft() {
999
+ return (this.iconLeft) && this.iconLeft.trim() !== "";
1000
+ }
1001
+ validateIconRight() {
1002
+ return (this.iconRight) && this.iconRight.trim() !== "";
1003
+ }
1004
+ validateLabel() {
1005
+ return (this.label) && this.label.trim() !== "";
1006
+ }
1007
+ createContainerClassName() {
1008
+ let sizeSufix = this._sizes[this.size].sufix;
1009
+ let containerClassNames = ["badge__content"];
1010
+ if (this.hasSlot) {
1011
+ containerClassNames.push("badge__content--fill-" + sizeSufix);
1012
+ if (this.position.vertical == "bottom" && this.position.horizontal == "right") {
1013
+ containerClassNames.push("badge__content--fill-bottom-right");
1014
+ }
1015
+ if (this.position.vertical == "bottom" && this.position.horizontal == "left") {
1016
+ containerClassNames.push("badge__content--fill-bottom-left");
1017
+ }
1018
+ if (this.position.vertical == "top" && this.position.horizontal == "right") {
1019
+ containerClassNames.push("badge__content--fill-top-right");
1020
+ }
1021
+ if (this.position.vertical == "top" && this.position.horizontal == "left") {
1022
+ containerClassNames.push("badge__content--fill-top-left");
1023
+ }
1024
+ }
1025
+ if (this.label) {
1026
+ containerClassNames.push("badge__content--text-" + sizeSufix);
1027
+ }
1028
+ else if (this.iconLeft || this.iconRight) {
1029
+ containerClassNames.push("badge__content--icon-" + sizeSufix);
1030
+ }
1031
+ else {
1032
+ containerClassNames.push("badge__content--fill-" + sizeSufix);
1033
+ }
1034
+ return containerClassNames.join(" ");
1035
+ }
1036
+ render() {
1037
+ return (h(Host, null, h("div", { class: "badge" }, h("div", null, h("slot", { name: "child-badge", onSlotchange: () => { this.handleSlotChange(); } })), h("div", { class: this.createContainerClassName(), ref: (el) => this._badge = el }, this.validateIconLeft() && h("ez-icon", { class: "icon", iconName: this.iconLeft, size: this.getIconSize() }), this.validateLabel() && h("label", { title: this.label }, this.label), this.validateIconRight() && h("ez-icon", { class: "icon", iconName: this.iconRight, size: this.getIconSize() })))));
1038
+ }
1039
+ get _element() { return this; }
1040
+ static get style() { return ezBadgeCss; }
1041
+ };
1042
+
929
1043
  const BreadcrumbItem = (props) => {
930
1044
  const { items, selectedItem, itemsHidden, showDropdown, handleShowDropdown, collapseConfigPosition, ellipsesPositionedEnd } = props;
931
1045
  const formatDropdownItems = () => {
@@ -123165,7 +123279,7 @@ class DataSource {
123165
123279
  }
123166
123280
  updateSelection() {
123167
123281
  var _a;
123168
- const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getAllSelection();
123282
+ const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSelection();
123169
123283
  if ((selection === null || selection === void 0 ? void 0 : selection.length) > 0) {
123170
123284
  this._controller.selectRows(selection);
123171
123285
  }
@@ -123373,7 +123487,7 @@ class AgGridController {
123373
123487
  else {
123374
123488
  this._grid = new Grid(container, this._gridOptions);
123375
123489
  }
123376
- const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getAllSelection();
123490
+ const selection = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getSelection();
123377
123491
  if (selection) {
123378
123492
  this.selectRows(selection);
123379
123493
  }
@@ -123457,7 +123571,7 @@ class AgGridController {
123457
123571
  if (records && records.length === 0) {
123458
123572
  return false;
123459
123573
  }
123460
- const allSelection = this._dataUnit.getAllSelection();
123574
+ const allSelection = this._dataUnit.getSelection();
123461
123575
  if (allSelection == undefined || allSelection.length === 0) {
123462
123576
  return false;
123463
123577
  }
@@ -123487,14 +123601,14 @@ class AgGridController {
123487
123601
  if (this._dataUnit == undefined) {
123488
123602
  return;
123489
123603
  }
123490
- let allSelection = this._dataUnit.getAllSelection();
123604
+ let allSelection = this._dataUnit.getSelection();
123491
123605
  if (allSelection === null || allSelection === void 0 ? void 0 : allSelection.some((sel) => sel.__record__id__ === ALL_RECORD)) {
123492
123606
  await this._dataUnit.clearSelection();
123493
123607
  }
123494
123608
  let updateSelection = [];
123495
123609
  const records = this._dataUnit.records;
123496
123610
  const selectedRecords = this._dataUnit.getSelectedRecords();
123497
- allSelection = this._dataUnit.getAllSelection();
123611
+ allSelection = this._dataUnit.getSelection();
123498
123612
  if (selectAll && selectedRecords.length < records.length) {
123499
123613
  updateSelection = records;
123500
123614
  allSelection.forEach((selectedRecord) => {
@@ -124032,7 +124146,7 @@ const EzGrid$1 = class extends HTMLElement$1 {
124032
124146
  }
124033
124147
  isAllRecordSetted() {
124034
124148
  var _a;
124035
- const allSelection = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getAllSelection();
124149
+ const allSelection = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelection();
124036
124150
  return allSelection === null || allSelection === void 0 ? void 0 : allSelection.some((selectedRecord) => {
124037
124151
  return selectedRecord.__record__id__ === ALL_RECORD;
124038
124152
  });
@@ -124060,7 +124174,7 @@ const EzGrid$1 = class extends HTMLElement$1 {
124060
124174
  }
124061
124175
  controlSelectionCounter() {
124062
124176
  var _a, _b;
124063
- const allSelection = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getAllSelection();
124177
+ const allSelection = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelection();
124064
124178
  const counter = (_b = allSelection === null || allSelection === void 0 ? void 0 : allSelection.length) !== null && _b !== void 0 ? _b : 0;
124065
124179
  if (this.isAllRecordSetted()) {
124066
124180
  this.setAutoSelectAll();
@@ -127732,6 +127846,7 @@ const EzViewStack$1 = class extends HTMLElement$1 {
127732
127846
  const EzActionsButton = /*@__PURE__*/proxyCustomElement(EzActionsButton$1, [1,"ez-actions-button",{"enabled":[516],"actions":[1040],"size":[513],"showLabel":[516,"show-label"],"displayIcon":[513,"display-icon"],"checkOption":[516,"check-option"],"value":[513],"isTransparent":[516,"is-transparent"],"arrowActive":[516,"arrow-active"],"_selectedAction":[32]}]);
127733
127847
  const EzAlert = /*@__PURE__*/proxyCustomElement(EzAlert$1, [1,"ez-alert",{"alertType":[513,"alert-type"]}]);
127734
127848
  const EzApplication = /*@__PURE__*/proxyCustomElement(EzApplication$1, [0,"ez-application"]);
127849
+ const EzBadge = /*@__PURE__*/proxyCustomElement(EzBadge$1, [1,"ez-badge",{"size":[513],"label":[513],"iconLeft":[513,"icon-left"],"iconRight":[513,"icon-right"],"position":[1040],"hasSlot":[32]}]);
127735
127850
  const EzBreadcrumb = /*@__PURE__*/proxyCustomElement(EzBreadcrumb$1, [1,"ez-breadcrumb",{"items":[1040],"fillMode":[1025,"fill-mode"],"maxItems":[1026,"max-items"],"positionEllipsis":[1026,"position-ellipsis"],"visibleItems":[32],"hiddenItems":[32],"showDropdown":[32],"collapseConfigPosition":[32]}]);
127736
127851
  const EzButton = /*@__PURE__*/proxyCustomElement(EzButton$1, [1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513]},[[2,"click","clickListener"]]]);
127737
127852
  const EzCalendar = /*@__PURE__*/proxyCustomElement(EzCalendar$1, [1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"]}]);
@@ -127777,6 +127892,7 @@ const defineCustomElements = (opts) => {
127777
127892
  EzActionsButton,
127778
127893
  EzAlert,
127779
127894
  EzApplication,
127895
+ EzBadge,
127780
127896
  EzBreadcrumb,
127781
127897
  EzButton,
127782
127898
  EzCalendar,
@@ -127824,4 +127940,4 @@ const defineCustomElements = (opts) => {
127824
127940
  }
127825
127941
  };
127826
127942
 
127827
- export { EzActionsButton, EzAlert, EzApplication, EzBreadcrumb, EzButton, EzCalendar, EzCardItem, EzCheck, EzChip, EzCollapsibleBox, EzComboBox, EzDateInput, EzDateTimeInput, EzDialog, EzDropdown, EzFileItem, EzFilterInput, EzForm, EzFormView, EzGrid, EzGuideNavigator, EzIcon, EzList, EzLoadingBar, EzModal, EzModalContainer, EzNumberInput, EzPopover, EzPopup, EzRadioButton, EzScroller, EzSearch, EzSidebarButton, EzTabselector, EzTextArea, EzTextEdit, EzTextInput, EzTimeInput, EzToast, EzTree, EzUpload, EzViewStack, defineCustomElements };
127943
+ export { EzActionsButton, EzAlert, EzApplication, EzBadge, EzBreadcrumb, EzButton, EzCalendar, EzCardItem, EzCheck, EzChip, EzCollapsibleBox, EzComboBox, EzDateInput, EzDateTimeInput, EzDialog, EzDropdown, EzFileItem, EzFilterInput, EzForm, EzFormView, EzGrid, EzGuideNavigator, EzIcon, EzList, EzLoadingBar, EzModal, EzModalContainer, EzNumberInput, EzPopover, EzPopup, EzRadioButton, EzScroller, EzSearch, EzSidebarButton, EzTabselector, EzTextArea, EzTextEdit, EzTextInput, EzTimeInput, EzToast, EzTree, EzUpload, EzViewStack, defineCustomElements };
@@ -0,0 +1,116 @@
1
+ import { r as registerInstance, h, H as Host, g as getElement } from './index-de655f48.js';
2
+ import { ElementIDUtils } from '@sankhyalabs/core';
3
+
4
+ var Sizes;
5
+ (function (Sizes) {
6
+ Sizes["EXTRA_LARGE"] = "extra-large";
7
+ Sizes["LARGE"] = "large";
8
+ Sizes["MEDIUM"] = "medium";
9
+ Sizes["SMALL_MEDIUM"] = "small-medium";
10
+ Sizes["SMALL"] = "small";
11
+ Sizes["EXTRA_SMALL"] = "extra-small";
12
+ })(Sizes || (Sizes = {}));
13
+
14
+ const ezBadgeCss = ":host{--ez-badge--size-2xs:var(--space--2xs, 8px);--ez-badge--size-xs:var(--space--xs, 12px);--ez-badge--size-sm:var(--space--sm, 16px);--ez-badge--size-md:var(--space--md, 20px);--ez-badge--size-lg:var(--space--lg, 24px);--ez-badge--size-xl:var(--space--xl, 32px);--ez-badge--padding-2xs:0;--ez-badge--padding-xs:var(--space--nano, 2px);--ez-badge--padding-sm:calc(var(--space--nano, 2px) + 1px);--ez-badge--padding-md:var(--space--3xs, 4px);--ez-badge--padding-lg:calc(var(--space--3xs, 4px) + 2px);--ez-badge--padding-xl:var(--space--2xs);--ez-badge--border-radius:calc(var(--border--radius-medium, 12px) + 8px);--ez-badge--font-family:var(--font-pattern, Roboto);--ez-badge--font-weight-medium:var(--text-weight--medium, 400);--ez-badge--background-color:var(--color--primary, #008561);--ez-badge--border-none:0;--ez-badge--color:var(--text--inverted, #ffffff);--ez-badge--gap:calc(var(--ez-badge--padding-xs) + 1px);--ez-badge--font-size-md:var(--text--medium);--ez-badge--font-size-sm:var(--text--medium);--ez-badge--font-size-xs:var(--text--small)}ez-icon{--ez-icon--color:inherit}.badge{display:flex;justify-content:center;align-items:center;position:relative}.badge__content{font-family:var(--ez-badge--font-family, Roboto);font-weight:var(--ez-badge--font-weight-medium, 400);background-color:var(--ez-badge--background-color, #008561);border:var(--ez-badge--border-none, 0);color:var(--ez-badge--color, #ffffff);border-radius:var(--ez-badge--border-radius, 20px);gap:var(--ez-badge--gap, 3px);display:flex;justify-content:center;align-items:center}.badge__content--fill-xs{height:var(--ez-badge--size-xs, 12px);min-width:var(--ez-badge--size-xs, 12px)}.badge__content--fill-2xs{height:var(--ez-badge--size-2xs, 8px);min-width:var(--ez-badge--size-2xs, 8px)}.badge__content--text-md{height:calc(var(--ez-badge--size-md, 20px) - 2px);min-width:var(--ez-badge--size-sm, 20px);padding-top:var(--ez-badge--padding-sm);padding-bottom:var(--ez-badge--padding-sm);padding-right:var(--ez-badge--padding-xl);padding-left:var(--ez-badge--padding-xl);font-size:var(--ez-badge--font-size-md)}.badge__content--text-sm{height:calc(var(--ez-badge--size-sm, 16px) - 2px);min-width:var(--ez-badge--size-sm, 16px);padding-top:var(--ez-badge--padding-sm);padding-bottom:var(--ez-badge--padding-sm);padding-right:var(--ez-badge--padding-xl);padding-left:var(--ez-badge--padding-xl);font-size:var(--ez-badge--font-size-sm)}.badge__content--text-xs{height:var(--ez-badge--size-sm, 16px);min-width:var(--ez-badge--size-sm, 16px);padding-top:var(--ez-badge--padding-2xs);padding-bottom:var(--ez-badge--padding-2xs);padding-right:var(--ez-badge--padding-lg);padding-left:var(--ez-badge--padding-lg);font-size:var(--ez-badge--font-size-xs)}.badge__content--icon-lg{height:var(--ez-badge--size-lg, 24px);min-width:var(--ez-badge--size-lg, 24px);padding:var(--ez-badge--padding-md)}.badge__content--icon-md{height:var(--ez-badge--size-sm, 16px);min-width:var(--ez-badge--size-sm, 16px);padding:var(--ez-badge--padding-md)}.badge__content--icon-sm{height:var(--ez-badge--size-sm, 16px);min-width:var(--ez-badge--size-sm, 16px);padding:var(--ez-badge--padding-xs)}.badge__content--icon-xs{height:var(--ez-badge--size-xs, 12px);min-width:var(--ez-badge--size-xs, 12px);padding:var(--ez-badge--padding-xs)}.badge__content--fill{position:absolute;top:0;inset-inline-end:0;z-index:var(--most-visible, 2)}.badge__content--fill-top-right{transform:translate(50%, -50%);position:absolute;top:0;right:0}.badge__content--fill-top-left{transform:translate(-50%, -50%);position:absolute;top:0;left:0}.badge__content--fill-bottom-left{transform:translate(-50%, 50%);position:absolute;bottom:0;left:0}.badge__content--fill-bottom-right{transform:translate(50%, 50%);position:absolute;bottom:0;right:0}";
15
+
16
+ const EzBadge = class {
17
+ constructor(hostRef) {
18
+ registerInstance(this, hostRef);
19
+ this._sizes = {
20
+ [Sizes.EXTRA_LARGE]: {
21
+ sufix: "xl",
22
+ },
23
+ [Sizes.LARGE]: {
24
+ sufix: "lg",
25
+ },
26
+ [Sizes.MEDIUM]: {
27
+ sufix: "md",
28
+ },
29
+ [Sizes.SMALL_MEDIUM]: {
30
+ sufix: "sm",
31
+ },
32
+ [Sizes.SMALL]: {
33
+ sufix: "xs",
34
+ },
35
+ [Sizes.EXTRA_SMALL]: {
36
+ sufix: "2xs",
37
+ },
38
+ };
39
+ this.hasSlot = false;
40
+ this.size = "small";
41
+ this.label = undefined;
42
+ this.iconLeft = undefined;
43
+ this.iconRight = undefined;
44
+ this.position = { horizontal: "right", vertical: "top" };
45
+ }
46
+ getIconSize() {
47
+ switch (this.size) {
48
+ case "large":
49
+ return "large";
50
+ case "medium":
51
+ case "small-medium":
52
+ return "small";
53
+ case "small":
54
+ return "x-small";
55
+ default:
56
+ return null;
57
+ }
58
+ }
59
+ componentDidLoad() {
60
+ if (this._element) {
61
+ ElementIDUtils.addIDInfo(this._element);
62
+ }
63
+ if (this._badge) {
64
+ const dataInfo = { id: 'embedded' };
65
+ ElementIDUtils.addIDInfo(this._badge, 'ezBadge', dataInfo);
66
+ }
67
+ }
68
+ handleSlotChange() {
69
+ this.hasSlot = true;
70
+ }
71
+ validateIconLeft() {
72
+ return (this.iconLeft) && this.iconLeft.trim() !== "";
73
+ }
74
+ validateIconRight() {
75
+ return (this.iconRight) && this.iconRight.trim() !== "";
76
+ }
77
+ validateLabel() {
78
+ return (this.label) && this.label.trim() !== "";
79
+ }
80
+ createContainerClassName() {
81
+ let sizeSufix = this._sizes[this.size].sufix;
82
+ let containerClassNames = ["badge__content"];
83
+ if (this.hasSlot) {
84
+ containerClassNames.push("badge__content--fill-" + sizeSufix);
85
+ if (this.position.vertical == "bottom" && this.position.horizontal == "right") {
86
+ containerClassNames.push("badge__content--fill-bottom-right");
87
+ }
88
+ if (this.position.vertical == "bottom" && this.position.horizontal == "left") {
89
+ containerClassNames.push("badge__content--fill-bottom-left");
90
+ }
91
+ if (this.position.vertical == "top" && this.position.horizontal == "right") {
92
+ containerClassNames.push("badge__content--fill-top-right");
93
+ }
94
+ if (this.position.vertical == "top" && this.position.horizontal == "left") {
95
+ containerClassNames.push("badge__content--fill-top-left");
96
+ }
97
+ }
98
+ if (this.label) {
99
+ containerClassNames.push("badge__content--text-" + sizeSufix);
100
+ }
101
+ else if (this.iconLeft || this.iconRight) {
102
+ containerClassNames.push("badge__content--icon-" + sizeSufix);
103
+ }
104
+ else {
105
+ containerClassNames.push("badge__content--fill-" + sizeSufix);
106
+ }
107
+ return containerClassNames.join(" ");
108
+ }
109
+ render() {
110
+ return (h(Host, null, h("div", { class: "badge" }, h("div", null, h("slot", { name: "child-badge", onSlotchange: () => { this.handleSlotChange(); } })), h("div", { class: this.createContainerClassName(), ref: (el) => this._badge = el }, this.validateIconLeft() && h("ez-icon", { class: "icon", iconName: this.iconLeft, size: this.getIconSize() }), this.validateLabel() && h("label", { title: this.label }, this.label), this.validateIconRight() && h("ez-icon", { class: "icon", iconName: this.iconRight, size: this.getIconSize() })))));
111
+ }
112
+ get _element() { return getElement(this); }
113
+ };
114
+ EzBadge.style = ezBadgeCss;
115
+
116
+ export { EzBadge as ez_badge };