@sankhyalabs/ezui 2.1.0 → 2.2.1

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 (38) hide show
  1. package/dist/cjs/ez-collapsible-box.cjs.entry.js +4 -0
  2. package/dist/cjs/ez-form.cjs.entry.js +14 -4
  3. package/dist/cjs/ez-grid.cjs.entry.js +9 -1
  4. package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
  5. package/dist/cjs/ez-tabselector.cjs.entry.js +24 -4
  6. package/dist/cjs/ez-view-stack.cjs.entry.js +4 -0
  7. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +4 -0
  8. package/dist/collection/components/ez-form/ez-form.js +13 -3
  9. package/dist/collection/components/ez-form/structure/FormSheet.js +2 -2
  10. package/dist/collection/components/ez-grid/ez-grid.js +11 -2
  11. package/dist/collection/components/ez-modal-container/ez-modal-container.css +1 -1
  12. package/dist/collection/components/ez-tabselector/ez-tabselector.js +24 -4
  13. package/dist/collection/components/ez-view-stack/ez-view-stack.js +4 -0
  14. package/dist/custom-elements/index.js +53 -10
  15. package/dist/esm/ez-collapsible-box.entry.js +4 -0
  16. package/dist/esm/ez-form.entry.js +15 -5
  17. package/dist/esm/ez-grid.entry.js +11 -3
  18. package/dist/esm/ez-modal-container.entry.js +1 -1
  19. package/dist/esm/ez-tabselector.entry.js +24 -4
  20. package/dist/esm/ez-view-stack.entry.js +4 -0
  21. package/dist/ezui/ezui.esm.js +1 -1
  22. package/dist/ezui/p-04fab1e9.entry.js +1 -0
  23. package/dist/ezui/{p-dfcf55e0.entry.js → p-739d60d1.entry.js} +1 -1
  24. package/dist/ezui/{p-d0b8330e.entry.js → p-77b7b623.entry.js} +2 -2
  25. package/dist/ezui/p-8c874b58.entry.js +1 -0
  26. package/dist/ezui/p-a595dd4e.entry.js +1 -0
  27. package/dist/ezui/p-dff2b725.entry.js +1 -0
  28. package/dist/types/components/ez-collapsible-box/ez-collapsible-box.d.ts +1 -0
  29. package/dist/types/components/ez-form/ez-form.d.ts +3 -0
  30. package/dist/types/components/ez-form/structure/FormSheet.d.ts +1 -0
  31. package/dist/types/components/ez-grid/ez-grid.d.ts +3 -0
  32. package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +3 -1
  33. package/dist/types/components/ez-view-stack/ez-view-stack.d.ts +1 -0
  34. package/package.json +1 -1
  35. package/dist/ezui/p-0c7203d5.entry.js +0 -1
  36. package/dist/ezui/p-659616e4.entry.js +0 -1
  37. package/dist/ezui/p-ac296141.entry.js +0 -1
  38. package/dist/ezui/p-f27c364b.entry.js +0 -1
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-8646c40d.js');
6
+ const core = require('@sankhyalabs/core');
6
7
  const ApplicationUtils = require('./ApplicationUtils-edc62c5c.js');
7
8
  require('./DialogType-aa435c52.js');
8
9
  require('./CheckMode-ecb90b87.js');
@@ -119,6 +120,9 @@ let EzCollapsibleBox = class {
119
120
  };
120
121
  return styledLabel;
121
122
  }
123
+ componentDidLoad() {
124
+ core.ElementIDUtils.addIDInfo(this._hostElement);
125
+ }
122
126
  render() {
123
127
  return (index.h("div", { class: "collapsible-box" }, index.h("div", { class: "collapsible-box__header" }, index.h("button", Object.assign({}, (!this._activeEditText ? { onClick: () => { this.showHide(); } } : null), { class: "collapsible-box__title" +
124
128
  (this.iconPlacement === "right" ? " collapsible-box__title--icon-right" : "") +
@@ -131,8 +131,8 @@ const FormItem = ({ source }) => {
131
131
  }
132
132
  };
133
133
 
134
- const FormSheet = ({ store, source }) => {
135
- return (index.h("div", { class: "dynamic-content ez-box__container" },
134
+ const FormSheet = ({ store, source, dataElementId }) => {
135
+ return (index.h("div", { class: "dynamic-content ez-box__container", "data-element-id": dataElementId },
136
136
  index.h("div", { class: "ez-row ez-padding-vertical--small" }, source.items.map(item => index.h(FormItem, { store: store, source: item })))));
137
137
  };
138
138
 
@@ -945,9 +945,11 @@ let EzForm = class {
945
945
  const tabs = allSheets.map((sheet, index) => {
946
946
  return { tabKey: sheet.name, label: sheet.label, index };
947
947
  });
948
- result.push(index.h("ez-tabselector", { tabs: tabs, onEzChange: (evt) => this._store.dispatch(changeTab(evt.detail)), selectedTab: currentSheet.name }));
948
+ const idTabSelector = `${this._dataElementIdEzForm}_internal_tabSelector`;
949
+ result.push(index.h("ez-tabselector", { tabs: this.buildIdTabSelector(tabs), onEzChange: (evt) => this._store.dispatch(changeTab(evt.detail)), selectedTab: currentSheet.name, "data-element-id": idTabSelector }));
949
950
  }
950
- result.push(index.h(FormSheet, { store: this._store, source: currentSheet }));
951
+ const idFormSheet = `${this._dataElementIdEzForm}_${core.StringUtils.toCamelCase(currentSheet.label)}`;
952
+ result.push(index.h(FormSheet, { store: this._store, source: currentSheet, dataElementId: idFormSheet }));
951
953
  return result;
952
954
  }
953
955
  processMetadata() {
@@ -1010,6 +1012,8 @@ let EzForm = class {
1010
1012
  this._store.subscribe(() => index.forceUpdate(this));
1011
1013
  this._staticFields = Array.from(this._element.querySelectorAll("[data-field-name]"));
1012
1014
  this.processMetadata();
1015
+ const dataInfo = { dataUnit: this.dataUnit };
1016
+ this._dataElementIdEzForm = core.ElementIDUtils.addIDInfo(this._element, null, dataInfo);
1013
1017
  }
1014
1018
  componentDidRender() {
1015
1019
  this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")));
@@ -1020,6 +1024,12 @@ let EzForm = class {
1020
1024
  this.dataUnit.removeInterceptor(this);
1021
1025
  this._dataBinder.onDisconnectedCallback();
1022
1026
  }
1027
+ buildIdTabSelector(tabs) {
1028
+ if (tabs) {
1029
+ tabs.forEach(tab => tab["data-element-id"] = `${this._dataElementIdEzForm}_${core.StringUtils.toCamelCase(tab.label)}`);
1030
+ }
1031
+ return tabs;
1032
+ }
1023
1033
  render() {
1024
1034
  return (index.h(index.Host, null, this.isStatic() ? null : this.getDynamicContent()));
1025
1035
  }
@@ -115345,6 +115345,13 @@ let EzGrid = class {
115345
115345
  if (this.config) {
115346
115346
  this.observeConfig(this.config);
115347
115347
  }
115348
+ this.buildDataElementId();
115349
+ }
115350
+ buildDataElementId() {
115351
+ const dataInfo = { dataUnit: this.dataUnit };
115352
+ const dataElementIdEzGrid = core.ElementIDUtils.addIDInfo(this._element, null, dataInfo);
115353
+ const dtInfo = { id: `${dataElementIdEzGrid}_ezGrid_pagination` };
115354
+ core.ElementIDUtils.addIDInfo(this._refPaginationControl, null, dtInfo);
115348
115355
  }
115349
115356
  previousPage() {
115350
115357
  if (this.dataUnit) {
@@ -115371,9 +115378,10 @@ let EzGrid = class {
115371
115378
  this._gridController.setColumnsState(config.columns);
115372
115379
  }
115373
115380
  render() {
115374
- return (index.h(index.Host, null, index.h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, index.h("div", { class: "grid-header__container" }, index.h("slot", { name: "leftButtons" })), index.h("div", { class: "grid-header__container" }, this.getPaginationControl())), index.h("div", { class: "grid__container ez-grid", ref: elem => this._container = elem }), index.h("div", { class: "grid__footer" })));
115381
+ return (index.h(index.Host, null, index.h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, index.h("div", { class: "grid-header__container" }, index.h("slot", { name: "leftButtons" })), index.h("div", { class: "grid-header__container", ref: ref => this._refPaginationControl = ref }, this.getPaginationControl())), index.h("div", { class: "grid__container ez-grid", ref: elem => this._container = elem }), index.h("div", { class: "grid__footer" })));
115375
115382
  }
115376
115383
  static get assetsDirs() { return ["../assets"]; }
115384
+ get _element() { return index.getElement(this); }
115377
115385
  static get watchers() { return {
115378
115386
  "config": ["observeConfig"]
115379
115387
  }; }
@@ -21,7 +21,7 @@ var ModalButtonStatus;
21
21
  })(ModalButtonStatus || (ModalButtonStatus = {}));
22
22
  const ModalButtonStatus$1 = ModalButtonStatus;
23
23
 
24
- const ezModalContainerCss = ".sc-ez-modal-container-h{display:grid;grid-template-rows:0 auto 1fr auto 0;width:100%;height:100%}.ez-modal-container__header.sc-ez-modal-container{display:flex;flex-wrap:nowrap;flex-direction:row;justify-content:space-between}.ez-modal-container__content.sc-ez-modal-container{overflow-y:auto;scrollbar-gutter:stable}.ez-modal-container__title.sc-ez-modal-container{display:grid}.ez-modal-container__close-button.sc-ez-modal-container{cursor:pointer;background-color:transparent;border:none}.ez-modal-container__close-icon.sc-ez-modal-container{--icon--color:var(--title--primary, #2B3A54)}.ez-modal-container__focus-ctrl.sc-ez-modal-container{height:0px;background-color:transparent;border:none}";
24
+ const ezModalContainerCss = ".sc-ez-modal-container-h{display:grid;grid-template-rows:0 auto 1fr auto;width:100%;height:100%}.ez-modal-container__header.sc-ez-modal-container{display:flex;flex-wrap:nowrap;flex-direction:row;justify-content:space-between}.ez-modal-container__content.sc-ez-modal-container{overflow-y:auto;scrollbar-gutter:stable}.ez-modal-container__title.sc-ez-modal-container{display:grid}.ez-modal-container__close-button.sc-ez-modal-container{cursor:pointer;background-color:transparent;border:none}.ez-modal-container__close-icon.sc-ez-modal-container{--icon--color:var(--title--primary, #2B3A54)}.ez-modal-container__focus-ctrl.sc-ez-modal-container{height:0px;background-color:transparent;border:none}";
25
25
 
26
26
  let EzModalContainer = class {
27
27
  constructor(hostRef) {
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-8646c40d.js');
6
+ const core = require('@sankhyalabs/core');
6
7
 
7
8
  const ezTabselectorCss = "@keyframes activate{0%{clip-path:inset(calc(100% - 3px) 50% 0px 50%)}100%{clip-path:inset(calc(100% - 3px) 0px 0px 0px)}}:host{display:flex;position:relative;width:100%;overflow:hidden;--tabselector--backward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z\"/></svg>');--tabselector--forward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>')}.scroll{display:flex;width:100%;scroll-behavior:smooth;overflow-x:auto;scrollbar-width:none}.scroll.startHidden{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px)}.scroll.middle{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px, #000 calc(100% - 48px), transparent calc(100% - 20px))}.scroll.endHidden{-webkit-mask-image:linear-gradient(90deg, #000 calc(100% - 48px), transparent calc(100% - 20px))}.tab{display:flex;border:none;min-width:100px;background-color:unset;cursor:pointer;padding:6px 12px;align-items:center;justify-content:center;color:var(--text--primary, #626e82);font-family:var(--font-pattern, \"Roboto\");font-size:var(--title--small, 14px)}.tab:focus,.forward-button,.backward-button{outline:none}.is-active{position:relative;color:var(--color--primary, #008561)}.is-active::after{content:\"\";position:absolute;width:100%;height:100%;background-color:var(--color--primary, #008561);clip-path:inset(calc(100% - 3px) 0px 0px 0px);animation:activate 0.25s ease-in-out}.is-focused{border:1px dashed var(--color--primary, #000000c5)}.tab-label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-shadow:var(--text-shadow);margin-bottom:var(--space--extra-small, 3px)}.forward-button,.backward-button{position:absolute;z-index:1;display:flex;box-sizing:border-box;padding:0px;top:0px;right:0px;width:16px;height:100%;border:none;background-color:unset;cursor:pointer;justify-content:center;align-items:center}.backward-button{left:0px}.forward-button::after,.backward-button::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:10px;height:16px}.forward-button::after{-webkit-mask-image:var(--tabselector--forward-icon);mask-image:var(--tabselector--forward-icon)}.backward-button::after{-webkit-mask-image:var(--tabselector--backward-icon);mask-image:var(--tabselector--backward-icon)}.forward-button:hover::after,.backward-button:hover::after{background-color:var(--color--primary, #4e4e4e)}.hidden{display:none}.scroll::-webkit-scrollbar{display:none}.left-icon{padding-right:var(--space--small)}.right-icon{padding-left:var(--space--small)}";
8
9
 
@@ -75,6 +76,7 @@ let EzTabselector = class {
75
76
  this.setFocusedBtn(false, tab.index);
76
77
  }
77
78
  componentWillRender() {
79
+ core.ElementIDUtils.addIDInfo(this._hostElem);
78
80
  if (!this._processedTabs) {
79
81
  this._processedTabs = [];
80
82
  if (this.tabs) {
@@ -82,6 +84,7 @@ let EzTabselector = class {
82
84
  this.tabs.split(",").forEach((label) => {
83
85
  label = label.trim();
84
86
  this._processedTabs.push({ label, tabKey: label, index: this._processedTabs.length });
87
+ this.buildElementIdTab(this._processedTabs);
85
88
  });
86
89
  }
87
90
  }
@@ -97,9 +100,20 @@ let EzTabselector = class {
97
100
  this._hostElem.appendChild(content);
98
101
  }
99
102
  this._processedTabs.push(tab);
103
+ this.buildElementIdTab(this._processedTabs);
100
104
  });
101
105
  }
102
106
  }
107
+ componentDidRender() {
108
+ this.updateScroll();
109
+ }
110
+ componentDidLoad() {
111
+ this._hostElem.shadowRoot.querySelectorAll('button[name="tab-button"]').forEach((elem) => {
112
+ const elemIdTabSelector = this._hostElem.getAttribute("data-element-id");
113
+ const dataInfo = { id: `${elemIdTabSelector}_${core.StringUtils.toCamelCase(elem.id)}` };
114
+ core.ElementIDUtils.addIDInfo(elem, null, dataInfo);
115
+ });
116
+ }
103
117
  handleSlotChange(ev) {
104
118
  const slot = ev.target;
105
119
  const content = slot.assignedElements()[0];
@@ -125,9 +139,6 @@ let EzTabselector = class {
125
139
  container.scrollLeft = lastTab.offsetLeft + lastTab.offsetWidth;
126
140
  }
127
141
  }
128
- componentDidRender() {
129
- this.updateScroll();
130
- }
131
142
  updateScroll() {
132
143
  const container = this._scrollContainer;
133
144
  if (container) {
@@ -188,6 +199,15 @@ let EzTabselector = class {
188
199
  }
189
200
  });
190
201
  }
202
+ buildElementIdTab(tabs) {
203
+ tabs.forEach(tab => {
204
+ if (!tab.hasOwnProperty("data-element-id")) {
205
+ const elemIdTabSelector = this._hostElem.getAttribute("data-element-id");
206
+ const dataElementID = `${elemIdTabSelector}_${core.StringUtils.toCamelCase(tab.tabKey)}`;
207
+ tab["data-element-id"] = dataElementID;
208
+ }
209
+ });
210
+ }
191
211
  render() {
192
212
  return (index.h(index.Host, null, index.h("button", { class: "backward-button", ref: (el) => this._backwardButton = el, onClick: () => this.scrollBackward() }), index.h("div", { class: "scroll", ref: (el) => this._scrollContainer = el, onScroll: () => this.domScrollHandler(), onKeyDown: (ev) => this.setFocusedParam(ev) }, this._processedTabs.map((tab, index$1) => {
193
213
  const labelStyle = { "min-width": this.getTextWidth(tab.label) };
@@ -197,7 +217,7 @@ let EzTabselector = class {
197
217
  this.selectedTab = tab.tabKey;
198
218
  this.selectedIndex = index$1;
199
219
  }
200
- return index.h("button", { id: tabId, class: `tab${isSelected ? " is-active" : ""}`, onClick: () => this.handleTabClick(tab), style: labelStyle }, tab.leftIcon && index.h("ez-icon", { iconName: tab.leftIcon, class: "left-icon" }), index.h("span", { class: "tab-label", title: tab.label }, tab.label), tab.rightIcon && index.h("ez-icon", { iconName: tab.rightIcon, class: "right-icon" }), index.h("slot", { name: tabId, onSlotchange: (ev) => { this.handleSlotChange(ev); } }));
220
+ return index.h("button", { id: tabId, name: "tab-button", class: `tab${isSelected ? " is-active" : ""}`, onClick: () => this.handleTabClick(tab), style: labelStyle }, tab.leftIcon && index.h("ez-icon", { iconName: tab.leftIcon, class: "left-icon" }), index.h("span", { class: "tab-label", title: tab.label }, tab.label), tab.rightIcon && index.h("ez-icon", { iconName: tab.rightIcon, class: "right-icon" }), index.h("slot", { name: tabId, onSlotchange: (ev) => { this.handleSlotChange(ev); } }));
201
221
  })), index.h("button", { class: "forward-button", ref: (el) => this._forwardButton = el, onClick: () => this.scrollFoward() })));
202
222
  }
203
223
  get _hostElem() { return index.getElement(this); }
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-8646c40d.js');
6
+ const core = require('@sankhyalabs/core');
6
7
 
7
8
  const ezViewStackCss = ":host{width:100%;height:100%}.ez-view-stack__container{width:100%;height:100%}";
8
9
 
@@ -67,6 +68,9 @@ let EzViewStack = class {
67
68
  });
68
69
  }
69
70
  }
71
+ componentDidLoad() {
72
+ core.ElementIDUtils.addIDInfo(this._hostElem);
73
+ }
70
74
  disconectCallback() {
71
75
  this._hostElem = null;
72
76
  this._elemList = null;
@@ -1,4 +1,5 @@
1
1
  import { Component, h, Prop, Event, Watch, Method, Element, State } from "@stencil/core";
2
+ import { ElementIDUtils } from "@sankhyalabs/core";
2
3
  import { ApplicationUtils } from "../../utils";
3
4
  export class EzCollapsibleBox {
4
5
  constructor() {
@@ -105,6 +106,9 @@ export class EzCollapsibleBox {
105
106
  };
106
107
  return styledLabel;
107
108
  }
109
+ componentDidLoad() {
110
+ ElementIDUtils.addIDInfo(this._hostElement);
111
+ }
108
112
  render() {
109
113
  return (h("div", { class: "collapsible-box" },
110
114
  h("div", { class: "collapsible-box__header" },
@@ -1,5 +1,5 @@
1
1
  import { Component, h, Host, Prop, Element, forceUpdate, Method, Watch, Event } from "@stencil/core";
2
- import { DataUnit, Action, DataUnitAction } from "@sankhyalabs/core";
2
+ import { DataUnit, Action, DataUnitAction, ElementIDUtils, StringUtils } from "@sankhyalabs/core";
3
3
  import { FormSheet } from "./structure/FormSheet";
4
4
  import { buildFromConfig, buildFromDataUnit } from "./structure/FormSheetMetadata";
5
5
  import { createStore } from "redux";
@@ -103,9 +103,11 @@ export class EzForm {
103
103
  const tabs = allSheets.map((sheet, index) => {
104
104
  return { tabKey: sheet.name, label: sheet.label, index };
105
105
  });
106
- result.push(h("ez-tabselector", { tabs: tabs, onEzChange: (evt) => this._store.dispatch(changeTab(evt.detail)), selectedTab: currentSheet.name }));
106
+ const idTabSelector = `${this._dataElementIdEzForm}_internal_tabSelector`;
107
+ result.push(h("ez-tabselector", { tabs: this.buildIdTabSelector(tabs), onEzChange: (evt) => this._store.dispatch(changeTab(evt.detail)), selectedTab: currentSheet.name, "data-element-id": idTabSelector }));
107
108
  }
108
- result.push(h(FormSheet, { store: this._store, source: currentSheet }));
109
+ const idFormSheet = `${this._dataElementIdEzForm}_${StringUtils.toCamelCase(currentSheet.label)}`;
110
+ result.push(h(FormSheet, { store: this._store, source: currentSheet, dataElementId: idFormSheet }));
109
111
  return result;
110
112
  }
111
113
  processMetadata() {
@@ -168,6 +170,8 @@ export class EzForm {
168
170
  this._store.subscribe(() => forceUpdate(this));
169
171
  this._staticFields = Array.from(this._element.querySelectorAll("[data-field-name]"));
170
172
  this.processMetadata();
173
+ const dataInfo = { dataUnit: this.dataUnit };
174
+ this._dataElementIdEzForm = ElementIDUtils.addIDInfo(this._element, null, dataInfo);
171
175
  }
172
176
  componentDidRender() {
173
177
  this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")));
@@ -178,6 +182,12 @@ export class EzForm {
178
182
  this.dataUnit.removeInterceptor(this);
179
183
  this._dataBinder.onDisconnectedCallback();
180
184
  }
185
+ buildIdTabSelector(tabs) {
186
+ if (tabs) {
187
+ tabs.forEach(tab => tab["data-element-id"] = `${this._dataElementIdEzForm}_${StringUtils.toCamelCase(tab.label)}`);
188
+ }
189
+ return tabs;
190
+ }
181
191
  render() {
182
192
  return (h(Host, null, this.isStatic() ? null : this.getDynamicContent()));
183
193
  }
@@ -1,6 +1,6 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { FormItem } from "./FormItem";
3
- export const FormSheet = ({ store, source }) => {
4
- return (h("div", { class: "dynamic-content ez-box__container" },
3
+ export const FormSheet = ({ store, source, dataElementId }) => {
4
+ return (h("div", { class: "dynamic-content ez-box__container", "data-element-id": dataElementId },
5
5
  h("div", { class: "ez-row ez-padding-vertical--small" }, source.items.map(item => h(FormItem, { store: store, source: item })))));
6
6
  };
@@ -1,4 +1,5 @@
1
- import { Component, h, Host, Prop, Method, Event, State, Watch } from "@stencil/core";
1
+ import { ElementIDUtils } from "@sankhyalabs/core";
2
+ import { Component, h, Host, Prop, Method, Event, State, Watch, Element } from "@stencil/core";
2
3
  import AgGridController from "./controller/ag-grid/AgGridController";
3
4
  export class EzGrid {
4
5
  constructor() {
@@ -139,6 +140,13 @@ export class EzGrid {
139
140
  if (this.config) {
140
141
  this.observeConfig(this.config);
141
142
  }
143
+ this.buildDataElementId();
144
+ }
145
+ buildDataElementId() {
146
+ const dataInfo = { dataUnit: this.dataUnit };
147
+ const dataElementIdEzGrid = ElementIDUtils.addIDInfo(this._element, null, dataInfo);
148
+ const dtInfo = { id: `${dataElementIdEzGrid}_ezGrid_pagination` };
149
+ ElementIDUtils.addIDInfo(this._refPaginationControl, null, dtInfo);
142
150
  }
143
151
  previousPage() {
144
152
  if (this.dataUnit) {
@@ -171,7 +179,7 @@ export class EzGrid {
171
179
  h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" },
172
180
  h("div", { class: "grid-header__container" },
173
181
  h("slot", { name: "leftButtons" })),
174
- h("div", { class: "grid-header__container" }, this.getPaginationControl())),
182
+ h("div", { class: "grid-header__container", ref: ref => this._refPaginationControl = ref }, this.getPaginationControl())),
175
183
  h("div", { class: "grid__container ez-grid", ref: elem => this._container = elem }),
176
184
  h("div", { class: "grid__footer" })));
177
185
  }
@@ -546,6 +554,7 @@ export class EzGrid {
546
554
  }
547
555
  }
548
556
  }; }
557
+ static get elementRef() { return "_element"; }
549
558
  static get watchers() { return [{
550
559
  "propName": "config",
551
560
  "methodName": "observeConfig"
@@ -1,6 +1,6 @@
1
1
  :host {
2
2
  display: grid;
3
- grid-template-rows: 0 auto 1fr auto 0;
3
+ grid-template-rows: 0 auto 1fr auto;
4
4
  width: 100%;
5
5
  height: 100%;
6
6
  }
@@ -1,4 +1,5 @@
1
1
  import { Component, Event, Element, h, Prop, Host, State, Watch } from "@stencil/core";
2
+ import { ElementIDUtils, StringUtils } from "@sankhyalabs/core";
2
3
  export class EzTabselector {
3
4
  constructor() {
4
5
  this.setFocusedParam = (ev) => {
@@ -66,6 +67,7 @@ export class EzTabselector {
66
67
  this.setFocusedBtn(false, tab.index);
67
68
  }
68
69
  componentWillRender() {
70
+ ElementIDUtils.addIDInfo(this._hostElem);
69
71
  if (!this._processedTabs) {
70
72
  this._processedTabs = [];
71
73
  if (this.tabs) {
@@ -73,6 +75,7 @@ export class EzTabselector {
73
75
  this.tabs.split(",").forEach((label) => {
74
76
  label = label.trim();
75
77
  this._processedTabs.push({ label, tabKey: label, index: this._processedTabs.length });
78
+ this.buildElementIdTab(this._processedTabs);
76
79
  });
77
80
  }
78
81
  }
@@ -88,9 +91,20 @@ export class EzTabselector {
88
91
  this._hostElem.appendChild(content);
89
92
  }
90
93
  this._processedTabs.push(tab);
94
+ this.buildElementIdTab(this._processedTabs);
91
95
  });
92
96
  }
93
97
  }
98
+ componentDidRender() {
99
+ this.updateScroll();
100
+ }
101
+ componentDidLoad() {
102
+ this._hostElem.shadowRoot.querySelectorAll('button[name="tab-button"]').forEach((elem) => {
103
+ const elemIdTabSelector = this._hostElem.getAttribute("data-element-id");
104
+ const dataInfo = { id: `${elemIdTabSelector}_${StringUtils.toCamelCase(elem.id)}` };
105
+ ElementIDUtils.addIDInfo(elem, null, dataInfo);
106
+ });
107
+ }
94
108
  handleSlotChange(ev) {
95
109
  const slot = ev.target;
96
110
  const content = slot.assignedElements()[0];
@@ -116,9 +130,6 @@ export class EzTabselector {
116
130
  container.scrollLeft = lastTab.offsetLeft + lastTab.offsetWidth;
117
131
  }
118
132
  }
119
- componentDidRender() {
120
- this.updateScroll();
121
- }
122
133
  updateScroll() {
123
134
  const container = this._scrollContainer;
124
135
  if (container) {
@@ -180,6 +191,15 @@ export class EzTabselector {
180
191
  ;
181
192
  });
182
193
  }
194
+ buildElementIdTab(tabs) {
195
+ tabs.forEach(tab => {
196
+ if (!tab.hasOwnProperty("data-element-id")) {
197
+ const elemIdTabSelector = this._hostElem.getAttribute("data-element-id");
198
+ const dataElementID = `${elemIdTabSelector}_${StringUtils.toCamelCase(tab.tabKey)}`;
199
+ tab["data-element-id"] = dataElementID;
200
+ }
201
+ });
202
+ }
183
203
  render() {
184
204
  return (h(Host, null,
185
205
  h("button", { class: "backward-button", ref: (el) => this._backwardButton = el, onClick: () => this.scrollBackward() }),
@@ -191,7 +211,7 @@ export class EzTabselector {
191
211
  this.selectedTab = tab.tabKey;
192
212
  this.selectedIndex = index;
193
213
  }
194
- return h("button", { id: tabId, class: `tab${isSelected ? " is-active" : ""}`, onClick: () => this.handleTabClick(tab), style: labelStyle },
214
+ return h("button", { id: tabId, name: "tab-button", class: `tab${isSelected ? " is-active" : ""}`, onClick: () => this.handleTabClick(tab), style: labelStyle },
195
215
  tab.leftIcon && h("ez-icon", { iconName: tab.leftIcon, class: "left-icon" }),
196
216
  h("span", { class: "tab-label", title: tab.label }, tab.label),
197
217
  tab.rightIcon && h("ez-icon", { iconName: tab.rightIcon, class: "right-icon" }),
@@ -1,4 +1,5 @@
1
1
  import { Component, h, Host, Element, Method } from '@stencil/core';
2
+ import { ElementIDUtils } from '@sankhyalabs/core';
2
3
  export class EzViewStack {
3
4
  constructor() {
4
5
  /**
@@ -60,6 +61,9 @@ export class EzViewStack {
60
61
  });
61
62
  }
62
63
  }
64
+ componentDidLoad() {
65
+ ElementIDUtils.addIDInfo(this._hostElem);
66
+ }
63
67
  disconectCallback() {
64
68
  this._hostElem = null;
65
69
  this._elemList = null;
@@ -959,6 +959,9 @@ let EzCollapsibleBox$1 = class extends HTMLElement$1 {
959
959
  };
960
960
  return styledLabel;
961
961
  }
962
+ componentDidLoad() {
963
+ ElementIDUtils.addIDInfo(this._hostElement);
964
+ }
962
965
  render() {
963
966
  return (h("div", { class: "collapsible-box" }, h("div", { class: "collapsible-box__header" }, h("button", Object.assign({}, (!this._activeEditText ? { onClick: () => { this.showHide(); } } : null), { class: "collapsible-box__title" +
964
967
  (this.iconPlacement === "right" ? " collapsible-box__title--icon-right" : "") +
@@ -2165,8 +2168,8 @@ const FormItem = ({ source }) => {
2165
2168
  }
2166
2169
  };
2167
2170
 
2168
- const FormSheet = ({ store, source }) => {
2169
- return (h("div", { class: "dynamic-content ez-box__container" },
2171
+ const FormSheet = ({ store, source, dataElementId }) => {
2172
+ return (h("div", { class: "dynamic-content ez-box__container", "data-element-id": dataElementId },
2170
2173
  h("div", { class: "ez-row ez-padding-vertical--small" }, source.items.map(item => h(FormItem, { store: store, source: item })))));
2171
2174
  };
2172
2175
 
@@ -2980,9 +2983,11 @@ let EzForm$1 = class extends HTMLElement$1 {
2980
2983
  const tabs = allSheets.map((sheet, index) => {
2981
2984
  return { tabKey: sheet.name, label: sheet.label, index };
2982
2985
  });
2983
- result.push(h("ez-tabselector", { tabs: tabs, onEzChange: (evt) => this._store.dispatch(changeTab(evt.detail)), selectedTab: currentSheet.name }));
2986
+ const idTabSelector = `${this._dataElementIdEzForm}_internal_tabSelector`;
2987
+ result.push(h("ez-tabselector", { tabs: this.buildIdTabSelector(tabs), onEzChange: (evt) => this._store.dispatch(changeTab(evt.detail)), selectedTab: currentSheet.name, "data-element-id": idTabSelector }));
2984
2988
  }
2985
- result.push(h(FormSheet, { store: this._store, source: currentSheet }));
2989
+ const idFormSheet = `${this._dataElementIdEzForm}_${StringUtils$1.toCamelCase(currentSheet.label)}`;
2990
+ result.push(h(FormSheet, { store: this._store, source: currentSheet, dataElementId: idFormSheet }));
2986
2991
  return result;
2987
2992
  }
2988
2993
  processMetadata() {
@@ -3045,6 +3050,8 @@ let EzForm$1 = class extends HTMLElement$1 {
3045
3050
  this._store.subscribe(() => forceUpdate(this));
3046
3051
  this._staticFields = Array.from(this._element.querySelectorAll("[data-field-name]"));
3047
3052
  this.processMetadata();
3053
+ const dataInfo = { dataUnit: this.dataUnit };
3054
+ this._dataElementIdEzForm = ElementIDUtils.addIDInfo(this._element, null, dataInfo);
3048
3055
  }
3049
3056
  componentDidRender() {
3050
3057
  this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")));
@@ -3055,6 +3062,12 @@ let EzForm$1 = class extends HTMLElement$1 {
3055
3062
  this.dataUnit.removeInterceptor(this);
3056
3063
  this._dataBinder.onDisconnectedCallback();
3057
3064
  }
3065
+ buildIdTabSelector(tabs) {
3066
+ if (tabs) {
3067
+ tabs.forEach(tab => tab["data-element-id"] = `${this._dataElementIdEzForm}_${StringUtils$1.toCamelCase(tab.label)}`);
3068
+ }
3069
+ return tabs;
3070
+ }
3058
3071
  render() {
3059
3072
  return (h(Host, null, this.isStatic() ? null : this.getDynamicContent()));
3060
3073
  }
@@ -118406,6 +118419,13 @@ let EzGrid$1 = class extends HTMLElement$1 {
118406
118419
  if (this.config) {
118407
118420
  this.observeConfig(this.config);
118408
118421
  }
118422
+ this.buildDataElementId();
118423
+ }
118424
+ buildDataElementId() {
118425
+ const dataInfo = { dataUnit: this.dataUnit };
118426
+ const dataElementIdEzGrid = ElementIDUtils.addIDInfo(this._element, null, dataInfo);
118427
+ const dtInfo = { id: `${dataElementIdEzGrid}_ezGrid_pagination` };
118428
+ ElementIDUtils.addIDInfo(this._refPaginationControl, null, dtInfo);
118409
118429
  }
118410
118430
  previousPage() {
118411
118431
  if (this.dataUnit) {
@@ -118432,9 +118452,10 @@ let EzGrid$1 = class extends HTMLElement$1 {
118432
118452
  this._gridController.setColumnsState(config.columns);
118433
118453
  }
118434
118454
  render() {
118435
- return (h(Host, null, h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, h("div", { class: "grid-header__container" }, h("slot", { name: "leftButtons" })), h("div", { class: "grid-header__container" }, this.getPaginationControl())), h("div", { class: "grid__container ez-grid", ref: elem => this._container = elem }), h("div", { class: "grid__footer" })));
118455
+ return (h(Host, null, h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, h("div", { class: "grid-header__container" }, h("slot", { name: "leftButtons" })), h("div", { class: "grid-header__container", ref: ref => this._refPaginationControl = ref }, this.getPaginationControl())), h("div", { class: "grid__container ez-grid", ref: elem => this._container = elem }), h("div", { class: "grid__footer" })));
118436
118456
  }
118437
118457
  static get assetsDirs() { return ["../assets"]; }
118458
+ get _element() { return this; }
118438
118459
  static get watchers() { return {
118439
118460
  "config": ["observeConfig"]
118440
118461
  }; }
@@ -119095,7 +119116,7 @@ var ModalButtonStatus;
119095
119116
  })(ModalButtonStatus || (ModalButtonStatus = {}));
119096
119117
  const ModalButtonStatus$1 = ModalButtonStatus;
119097
119118
 
119098
- const ezModalContainerCss = ".sc-ez-modal-container-h{display:grid;grid-template-rows:0 auto 1fr auto 0;width:100%;height:100%}.ez-modal-container__header.sc-ez-modal-container{display:flex;flex-wrap:nowrap;flex-direction:row;justify-content:space-between}.ez-modal-container__content.sc-ez-modal-container{overflow-y:auto;scrollbar-gutter:stable}.ez-modal-container__title.sc-ez-modal-container{display:grid}.ez-modal-container__close-button.sc-ez-modal-container{cursor:pointer;background-color:transparent;border:none}.ez-modal-container__close-icon.sc-ez-modal-container{--icon--color:var(--title--primary, #2B3A54)}.ez-modal-container__focus-ctrl.sc-ez-modal-container{height:0px;background-color:transparent;border:none}";
119119
+ const ezModalContainerCss = ".sc-ez-modal-container-h{display:grid;grid-template-rows:0 auto 1fr auto;width:100%;height:100%}.ez-modal-container__header.sc-ez-modal-container{display:flex;flex-wrap:nowrap;flex-direction:row;justify-content:space-between}.ez-modal-container__content.sc-ez-modal-container{overflow-y:auto;scrollbar-gutter:stable}.ez-modal-container__title.sc-ez-modal-container{display:grid}.ez-modal-container__close-button.sc-ez-modal-container{cursor:pointer;background-color:transparent;border:none}.ez-modal-container__close-icon.sc-ez-modal-container{--icon--color:var(--title--primary, #2B3A54)}.ez-modal-container__focus-ctrl.sc-ez-modal-container{height:0px;background-color:transparent;border:none}";
119099
119120
 
119100
119121
  let EzModalContainer$1 = class extends HTMLElement$1 {
119101
119122
  constructor() {
@@ -119859,6 +119880,7 @@ let EzTabselector$1 = class extends HTMLElement$1 {
119859
119880
  this.setFocusedBtn(false, tab.index);
119860
119881
  }
119861
119882
  componentWillRender() {
119883
+ ElementIDUtils.addIDInfo(this._hostElem);
119862
119884
  if (!this._processedTabs) {
119863
119885
  this._processedTabs = [];
119864
119886
  if (this.tabs) {
@@ -119866,6 +119888,7 @@ let EzTabselector$1 = class extends HTMLElement$1 {
119866
119888
  this.tabs.split(",").forEach((label) => {
119867
119889
  label = label.trim();
119868
119890
  this._processedTabs.push({ label, tabKey: label, index: this._processedTabs.length });
119891
+ this.buildElementIdTab(this._processedTabs);
119869
119892
  });
119870
119893
  }
119871
119894
  }
@@ -119881,9 +119904,20 @@ let EzTabselector$1 = class extends HTMLElement$1 {
119881
119904
  this._hostElem.appendChild(content);
119882
119905
  }
119883
119906
  this._processedTabs.push(tab);
119907
+ this.buildElementIdTab(this._processedTabs);
119884
119908
  });
119885
119909
  }
119886
119910
  }
119911
+ componentDidRender() {
119912
+ this.updateScroll();
119913
+ }
119914
+ componentDidLoad() {
119915
+ this._hostElem.shadowRoot.querySelectorAll('button[name="tab-button"]').forEach((elem) => {
119916
+ const elemIdTabSelector = this._hostElem.getAttribute("data-element-id");
119917
+ const dataInfo = { id: `${elemIdTabSelector}_${StringUtils$1.toCamelCase(elem.id)}` };
119918
+ ElementIDUtils.addIDInfo(elem, null, dataInfo);
119919
+ });
119920
+ }
119887
119921
  handleSlotChange(ev) {
119888
119922
  const slot = ev.target;
119889
119923
  const content = slot.assignedElements()[0];
@@ -119909,9 +119943,6 @@ let EzTabselector$1 = class extends HTMLElement$1 {
119909
119943
  container.scrollLeft = lastTab.offsetLeft + lastTab.offsetWidth;
119910
119944
  }
119911
119945
  }
119912
- componentDidRender() {
119913
- this.updateScroll();
119914
- }
119915
119946
  updateScroll() {
119916
119947
  const container = this._scrollContainer;
119917
119948
  if (container) {
@@ -119972,6 +120003,15 @@ let EzTabselector$1 = class extends HTMLElement$1 {
119972
120003
  }
119973
120004
  });
119974
120005
  }
120006
+ buildElementIdTab(tabs) {
120007
+ tabs.forEach(tab => {
120008
+ if (!tab.hasOwnProperty("data-element-id")) {
120009
+ const elemIdTabSelector = this._hostElem.getAttribute("data-element-id");
120010
+ const dataElementID = `${elemIdTabSelector}_${StringUtils$1.toCamelCase(tab.tabKey)}`;
120011
+ tab["data-element-id"] = dataElementID;
120012
+ }
120013
+ });
120014
+ }
119975
120015
  render() {
119976
120016
  return (h(Host, null, h("button", { class: "backward-button", ref: (el) => this._backwardButton = el, onClick: () => this.scrollBackward() }), h("div", { class: "scroll", ref: (el) => this._scrollContainer = el, onScroll: () => this.domScrollHandler(), onKeyDown: (ev) => this.setFocusedParam(ev) }, this._processedTabs.map((tab, index) => {
119977
120017
  const labelStyle = { "min-width": this.getTextWidth(tab.label) };
@@ -119981,7 +120021,7 @@ let EzTabselector$1 = class extends HTMLElement$1 {
119981
120021
  this.selectedTab = tab.tabKey;
119982
120022
  this.selectedIndex = index;
119983
120023
  }
119984
- return h("button", { id: tabId, class: `tab${isSelected ? " is-active" : ""}`, onClick: () => this.handleTabClick(tab), style: labelStyle }, tab.leftIcon && h("ez-icon", { iconName: tab.leftIcon, class: "left-icon" }), h("span", { class: "tab-label", title: tab.label }, tab.label), tab.rightIcon && h("ez-icon", { iconName: tab.rightIcon, class: "right-icon" }), h("slot", { name: tabId, onSlotchange: (ev) => { this.handleSlotChange(ev); } }));
120024
+ return h("button", { id: tabId, name: "tab-button", class: `tab${isSelected ? " is-active" : ""}`, onClick: () => this.handleTabClick(tab), style: labelStyle }, tab.leftIcon && h("ez-icon", { iconName: tab.leftIcon, class: "left-icon" }), h("span", { class: "tab-label", title: tab.label }, tab.label), tab.rightIcon && h("ez-icon", { iconName: tab.rightIcon, class: "right-icon" }), h("slot", { name: tabId, onSlotchange: (ev) => { this.handleSlotChange(ev); } }));
119985
120025
  })), h("button", { class: "forward-button", ref: (el) => this._forwardButton = el, onClick: () => this.scrollFoward() })));
119986
120026
  }
119987
120027
  get _hostElem() { return this; }
@@ -121197,6 +121237,9 @@ let EzViewStack$1 = class extends HTMLElement$1 {
121197
121237
  });
121198
121238
  }
121199
121239
  }
121240
+ componentDidLoad() {
121241
+ ElementIDUtils.addIDInfo(this._hostElem);
121242
+ }
121200
121243
  disconectCallback() {
121201
121244
  this._hostElem = null;
121202
121245
  this._elemList = null;
@@ -1,4 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement } from './index-7bc778b3.js';
2
+ import { ElementIDUtils } from '@sankhyalabs/core';
2
3
  import { A as ApplicationUtils } from './ApplicationUtils-205ac4bc.js';
3
4
  import './DialogType-4059dc4d.js';
4
5
  import './CheckMode-bdb2ec19.js';
@@ -115,6 +116,9 @@ let EzCollapsibleBox = class {
115
116
  };
116
117
  return styledLabel;
117
118
  }
119
+ componentDidLoad() {
120
+ ElementIDUtils.addIDInfo(this._hostElement);
121
+ }
118
122
  render() {
119
123
  return (h("div", { class: "collapsible-box" }, h("div", { class: "collapsible-box__header" }, h("button", Object.assign({}, (!this._activeEditText ? { onClick: () => { this.showHide(); } } : null), { class: "collapsible-box__title" +
120
124
  (this.iconPlacement === "right" ? " collapsible-box__title--icon-right" : "") +