xv-webcomponents 0.1.17 → 0.1.18

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 (73) hide show
  1. package/dist/cjs/{index-4d938647.js → index-782b9733.js} +55 -3
  2. package/dist/cjs/index-782b9733.js.map +1 -0
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/utils-c7652b74.js.map +1 -1
  5. package/dist/cjs/xv-accordion-v2_14.cjs.entry.js +602 -0
  6. package/dist/cjs/xv-accordion-v2_14.cjs.entry.js.map +1 -0
  7. package/dist/cjs/xv-breadcrumbs-v2.cjs.entry.js +1 -1
  8. package/dist/cjs/xv-webcomponents.cjs.js +2 -2
  9. package/dist/collection/collection-manifest.json +4 -0
  10. package/dist/collection/components/xv-checkbox/xv-checkbox.css +108 -0
  11. package/dist/collection/components/xv-checkbox/xv-checkbox.js +364 -10
  12. package/dist/collection/components/xv-checkbox/xv-checkbox.js.map +1 -1
  13. package/dist/collection/components/xv-link/xv-link.js +1 -1
  14. package/dist/collection/components/xv-progress-indicator/xv-progress-indicator.js +1 -1
  15. package/dist/collection/components/xv-progress-indicator-item/xv-progress-indicator-item.js +1 -1
  16. package/dist/collection/components/xv-table/defs.js +14 -0
  17. package/dist/collection/components/xv-table/defs.js.map +1 -0
  18. package/dist/collection/components/xv-table/xv-table-col/xv-table-col.css +8 -0
  19. package/dist/collection/components/xv-table/xv-table-col/xv-table-col.js +19 -0
  20. package/dist/collection/components/xv-table/xv-table-col/xv-table-col.js.map +1 -0
  21. package/dist/collection/components/xv-table/xv-table-header-row/xv-table-header-row.css +21 -0
  22. package/dist/collection/components/xv-table/xv-table-header-row/xv-table-header-row.js +122 -0
  23. package/dist/collection/components/xv-table/xv-table-header-row/xv-table-header-row.js.map +1 -0
  24. package/dist/collection/components/xv-table/xv-table-row/xv-table-row.css +53 -0
  25. package/dist/collection/components/xv-table/xv-table-row/xv-table-row.js +299 -0
  26. package/dist/collection/components/xv-table/xv-table-row/xv-table-row.js.map +1 -0
  27. package/dist/collection/components/xv-table/xv-table.css +154 -0
  28. package/dist/collection/components/xv-table/xv-table.js +245 -0
  29. package/dist/collection/components/xv-table/xv-table.js.map +1 -0
  30. package/dist/collection/components/xv-tag/xv-tag.js +1 -1
  31. package/dist/collection/components/xv-tooltip/xv-tooltip.js +1 -1
  32. package/dist/collection/types/enum.js +9 -0
  33. package/dist/collection/types/enum.js.map +1 -0
  34. package/dist/collection/utils/utils.js +7 -0
  35. package/dist/collection/utils/utils.js.map +1 -1
  36. package/dist/esm/{index-60f5a964.js → index-83ab73b7.js} +55 -3
  37. package/dist/esm/index-83ab73b7.js.map +1 -0
  38. package/dist/esm/loader.js +3 -3
  39. package/dist/esm/utils-9bb6333b.js.map +1 -1
  40. package/dist/esm/xv-accordion-v2_14.entry.js +585 -0
  41. package/dist/esm/xv-accordion-v2_14.entry.js.map +1 -0
  42. package/dist/esm/xv-breadcrumbs-v2.entry.js +1 -1
  43. package/dist/esm/xv-webcomponents.js +3 -3
  44. package/dist/types/components/xv-checkbox/xv-checkbox.d.ts +66 -2
  45. package/dist/types/components/xv-table/defs.d.ts +16 -0
  46. package/dist/types/components/xv-table/xv-table-col/xv-table-col.d.ts +3 -0
  47. package/dist/types/components/xv-table/xv-table-header-row/xv-table-header-row.d.ts +25 -0
  48. package/dist/types/components/xv-table/xv-table-row/xv-table-row.d.ts +59 -0
  49. package/dist/types/components/xv-table/xv-table.d.ts +40 -0
  50. package/dist/types/components.d.ts +342 -0
  51. package/dist/types/types/enum.d.ts +7 -0
  52. package/dist/types/utils/utils.d.ts +7 -0
  53. package/dist/xv-webcomponents/p-5f18d718.entry.js +2 -0
  54. package/dist/xv-webcomponents/p-840929c5.js +3 -0
  55. package/dist/xv-webcomponents/p-840929c5.js.map +1 -0
  56. package/dist/xv-webcomponents/p-a0b74d3c.js.map +1 -1
  57. package/dist/xv-webcomponents/p-bfe83d1e.entry.js +2 -0
  58. package/dist/xv-webcomponents/p-bfe83d1e.entry.js.map +1 -0
  59. package/dist/xv-webcomponents/xv-webcomponents.esm.js +1 -1
  60. package/dist/xv-webcomponents/xv-webcomponents.esm.js.map +1 -1
  61. package/package.json +1 -1
  62. package/dist/cjs/index-4d938647.js.map +0 -1
  63. package/dist/cjs/xv-accordion-v2_10.cjs.entry.js +0 -265
  64. package/dist/cjs/xv-accordion-v2_10.cjs.entry.js.map +0 -1
  65. package/dist/esm/index-60f5a964.js.map +0 -1
  66. package/dist/esm/xv-accordion-v2_10.entry.js +0 -252
  67. package/dist/esm/xv-accordion-v2_10.entry.js.map +0 -1
  68. package/dist/xv-webcomponents/p-08297c60.entry.js +0 -2
  69. package/dist/xv-webcomponents/p-08297c60.entry.js.map +0 -1
  70. package/dist/xv-webcomponents/p-543fe755.js +0 -3
  71. package/dist/xv-webcomponents/p-543fe755.js.map +0 -1
  72. package/dist/xv-webcomponents/p-6fe85516.entry.js +0 -2
  73. /package/dist/xv-webcomponents/{p-6fe85516.entry.js.map → p-5f18d718.entry.js.map} +0 -0
@@ -0,0 +1,245 @@
1
+ import { Host, h } from "@stencil/core";
2
+ import { TABLE_COLOR_SCHEMA, TABLE_SIZE } from "./defs";
3
+ export class XvTable {
4
+ constructor() {
5
+ /**
6
+ * Set current color schema type of enum TABLE_COLOR_SCHEMA
7
+ * Possible options 'zebra'
8
+ */
9
+ this.colorSchema = TABLE_COLOR_SCHEMA.DEF;
10
+ /**
11
+ * If table is expandable fields
12
+ */
13
+ this.expandable = false;
14
+ /**
15
+ * Table size
16
+ * enum TABLE_SIZE
17
+ */
18
+ this.size = TABLE_SIZE.MEDIUM;
19
+ /**
20
+ * Add checkbox selection to the table
21
+ */
22
+ this.selectable = false;
23
+ this.selectedRows = new Map();
24
+ this.handleCheckedChange = (e) => {
25
+ const { name, value, checked } = e.detail;
26
+ if (checked) {
27
+ this.selectedRows.set(name, { name, value });
28
+ }
29
+ else {
30
+ this.selectedRows.delete(name);
31
+ }
32
+ this.changeSelection.emit(Array.from(this.selectedRows.values()));
33
+ };
34
+ }
35
+ setRowPropsHandler() {
36
+ const rows = Array
37
+ .from(this.el.childNodes)
38
+ .filter((node) => node.nodeType === Node.ELEMENT_NODE &&
39
+ ((node === null || node === void 0 ? void 0 : node.tagName) === `${this.el.tagName}-ROW` || (node === null || node === void 0 ? void 0 : node.tagName) === `${this.el.tagName}-HEADER-ROW`));
40
+ let visualIndex = 0;
41
+ rows.forEach((node, i) => {
42
+ var _a;
43
+ const row = node;
44
+ const isHeaderRow = (node === null || node === void 0 ? void 0 : node.tagName) === `${this.el.tagName}-HEADER-ROW`;
45
+ if (this.selectable) {
46
+ let name = row.getAttribute('selection-name');
47
+ if (!name) {
48
+ name = isHeaderRow ? 'header' : `xv-table-row-${i}`;
49
+ row.setAttribute('selection-name', name);
50
+ }
51
+ if (row.hasAttribute('checked')) {
52
+ this.selectedRows.set(name, {
53
+ name,
54
+ value: (_a = row.getAttribute('value')) !== null && _a !== void 0 ? _a : undefined,
55
+ });
56
+ }
57
+ }
58
+ if (isHeaderRow)
59
+ return;
60
+ switch (this.colorSchema) {
61
+ case TABLE_COLOR_SCHEMA.ZEBRA:
62
+ const stripe = visualIndex % 2 === 0 ? 'even' : 'odd';
63
+ if (row.hasAttribute('expandable') && rows[i + 1]) {
64
+ row.setAttribute(stripe, '');
65
+ }
66
+ else {
67
+ visualIndex++;
68
+ row.setAttribute(stripe, '');
69
+ }
70
+ break;
71
+ default:
72
+ row.removeAttribute('odd');
73
+ row.removeAttribute('even');
74
+ }
75
+ });
76
+ }
77
+ render() {
78
+ return (h(Host, { key: '5d187689ae04f8cf161616defc092b2690831f98', size: this.size, selectable: this.selectable }, (this.el.title || this.description) && (h("div", { key: 'ee66085f185a99c2404d8e398ec356b2e2e5c347', class: "caption" }, this.el.title && h("h5", { key: '652bd665af5fac06bbaecd4aed542246c2a5d002', class: "caption_title" }, this.el.title), this.description && h("p", { key: '650461f500003c3ce70bbaaf24d4764a5c1904f1', class: "caption_description" }, this.description))), h("slot", { key: '7331a48d73167801ccc2d5f8682b62d3656712c3' })));
79
+ }
80
+ componentWillLoad() {
81
+ this.setRowPropsHandler();
82
+ this.el.addEventListener('checkedChange', this.handleCheckedChange);
83
+ }
84
+ disconnectedCallback() {
85
+ this.el.removeEventListener('checkedChange', this.handleCheckedChange);
86
+ }
87
+ static get is() { return "xv-table-v2"; }
88
+ static get encapsulation() { return "shadow"; }
89
+ static get originalStyleUrls() {
90
+ return {
91
+ "$": ["xv-table.scss"]
92
+ };
93
+ }
94
+ static get styleUrls() {
95
+ return {
96
+ "$": ["xv-table.css"]
97
+ };
98
+ }
99
+ static get properties() {
100
+ return {
101
+ "description": {
102
+ "type": "string",
103
+ "mutable": false,
104
+ "complexType": {
105
+ "original": "string",
106
+ "resolved": "string",
107
+ "references": {}
108
+ },
109
+ "required": false,
110
+ "optional": false,
111
+ "docs": {
112
+ "tags": [],
113
+ "text": "Table caption description"
114
+ },
115
+ "getter": false,
116
+ "setter": false,
117
+ "attribute": "description",
118
+ "reflect": false
119
+ },
120
+ "colorSchema": {
121
+ "type": "string",
122
+ "mutable": false,
123
+ "complexType": {
124
+ "original": "TABLE_COLOR_SCHEMA",
125
+ "resolved": "TABLE_COLOR_SCHEMA.DEF | TABLE_COLOR_SCHEMA.ZEBRA",
126
+ "references": {
127
+ "TABLE_COLOR_SCHEMA": {
128
+ "location": "import",
129
+ "path": "./defs",
130
+ "id": "src/components/xv-table/defs.ts::TABLE_COLOR_SCHEMA"
131
+ }
132
+ }
133
+ },
134
+ "required": false,
135
+ "optional": false,
136
+ "docs": {
137
+ "tags": [],
138
+ "text": "Set current color schema type of enum TABLE_COLOR_SCHEMA\nPossible options 'zebra'"
139
+ },
140
+ "getter": false,
141
+ "setter": false,
142
+ "attribute": "color-schema",
143
+ "reflect": false,
144
+ "defaultValue": "TABLE_COLOR_SCHEMA.DEF"
145
+ },
146
+ "expandable": {
147
+ "type": "boolean",
148
+ "mutable": false,
149
+ "complexType": {
150
+ "original": "boolean",
151
+ "resolved": "boolean",
152
+ "references": {}
153
+ },
154
+ "required": false,
155
+ "optional": false,
156
+ "docs": {
157
+ "tags": [],
158
+ "text": "If table is expandable fields"
159
+ },
160
+ "getter": false,
161
+ "setter": false,
162
+ "attribute": "expandable",
163
+ "reflect": false,
164
+ "defaultValue": "false"
165
+ },
166
+ "size": {
167
+ "type": "string",
168
+ "mutable": false,
169
+ "complexType": {
170
+ "original": "TABLE_SIZE",
171
+ "resolved": "TABLE_SIZE.EXTRA_LARGE | TABLE_SIZE.EXTRA_SMALL | TABLE_SIZE.LARGE | TABLE_SIZE.MEDIUM | TABLE_SIZE.SMALL",
172
+ "references": {
173
+ "TABLE_SIZE": {
174
+ "location": "import",
175
+ "path": "./defs",
176
+ "id": "src/components/xv-table/defs.ts::TABLE_SIZE"
177
+ }
178
+ }
179
+ },
180
+ "required": false,
181
+ "optional": false,
182
+ "docs": {
183
+ "tags": [],
184
+ "text": "Table size\nenum TABLE_SIZE"
185
+ },
186
+ "getter": false,
187
+ "setter": false,
188
+ "attribute": "size",
189
+ "reflect": false,
190
+ "defaultValue": "TABLE_SIZE.MEDIUM"
191
+ },
192
+ "selectable": {
193
+ "type": "boolean",
194
+ "mutable": false,
195
+ "complexType": {
196
+ "original": "boolean",
197
+ "resolved": "boolean",
198
+ "references": {}
199
+ },
200
+ "required": false,
201
+ "optional": false,
202
+ "docs": {
203
+ "tags": [],
204
+ "text": "Add checkbox selection to the table"
205
+ },
206
+ "getter": false,
207
+ "setter": false,
208
+ "attribute": "selectable",
209
+ "reflect": false,
210
+ "defaultValue": "false"
211
+ }
212
+ };
213
+ }
214
+ static get states() {
215
+ return {
216
+ "selectedRows": {}
217
+ };
218
+ }
219
+ static get events() {
220
+ return [{
221
+ "method": "changeSelection",
222
+ "name": "changeSelection",
223
+ "bubbles": true,
224
+ "cancelable": true,
225
+ "composed": true,
226
+ "docs": {
227
+ "tags": [],
228
+ "text": ""
229
+ },
230
+ "complexType": {
231
+ "original": "{ name: string, value?: any }[]",
232
+ "resolved": "{ name: string; value?: any; }[]",
233
+ "references": {}
234
+ }
235
+ }];
236
+ }
237
+ static get elementRef() { return "el"; }
238
+ static get watchers() {
239
+ return [{
240
+ "propName": "colorSchema",
241
+ "methodName": "setRowPropsHandler"
242
+ }];
243
+ }
244
+ }
245
+ //# sourceMappingURL=xv-table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xv-table.js","sourceRoot":"","sources":["../../../src/components/xv-table/xv-table.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAgB,KAAK,EAAE,MAAM,eAAe,CAAC;AACrG,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAuB,MAAM,QAAQ,CAAC;AAO7E,MAAM,OAAO,OAAO;IALpB;QAWE;;;WAGG;QACkC,gBAAW,GAAuB,kBAAkB,CAAC,GAAG,CAAC;QAC9F;;WAEG;QACK,eAAU,GAAY,KAAK,CAAC;QACpC;;;WAGG;QACK,SAAI,GAAe,UAAU,CAAC,MAAM,CAAC;QAC7C;;WAEG;QACK,eAAU,GAAY,KAAK,CAAC;QAE3B,iBAAY,GAAG,IAAI,GAAG,EAA4C,CAAC;QAqDpE,wBAAmB,GAAG,CAAC,CAAsB,EAAE,EAAE;YACvD,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC;YAE1C,IAAI,OAAO,EAAE,CAAC;gBACZ,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;YAC/C,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACjC,CAAC;YAED,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CA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ACJ,CAAC;IAED,iBAAiB;QACf,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1B,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,eAAe,EAAE,IAAI,CAAC,mBAA0B,CAAC,CAAC;IAC7E,CAAC;IAED,oBAAoB;QAClB,IAAI,CAAC,EAAE,CAAC,mBAAmB,CAAC,eAAe,EAAE,IAAI,CAAC,mBAA0B,CAAC,CAAC;IAChF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Element, Prop, Watch, Event, EventEmitter, State } from '@stencil/core';\nimport { TABLE_COLOR_SCHEMA, TABLE_SIZE, TableSelectionEvent } from './defs';\n\n@Component({\n tag: 'xv-table-v2',\n styleUrl: 'xv-table.scss',\n shadow: true,\n})\nexport class XvTable {\n @Element() el: HTMLElement;\n /**\n * Table caption description\n */\n @Prop() description: string;\n /**\n * Set current color schema type of enum TABLE_COLOR_SCHEMA\n * Possible options 'zebra'\n */\n @Prop({ attribute: 'color-schema' }) colorSchema: TABLE_COLOR_SCHEMA = TABLE_COLOR_SCHEMA.DEF;\n /**\n * If table is expandable fields\n */\n @Prop() expandable: boolean = false;\n /**\n * Table size\n * enum TABLE_SIZE\n */\n @Prop() size: TABLE_SIZE = TABLE_SIZE.MEDIUM;\n /**\n * Add checkbox selection to the table\n */\n @Prop() selectable: boolean = false;\n\n @State() selectedRows = new Map<string, { name: string, value?: string }>();\n\n @Event() changeSelection: EventEmitter<{ name: string, value?: any }[]>;\n\n @Watch('colorSchema')\n setRowPropsHandler() {\n const rows = Array\n .from(this.el.childNodes)\n .filter((node) =>\n node.nodeType === Node.ELEMENT_NODE &&\n ((node as any)?.tagName === `${this.el.tagName}-ROW` || (node as any)?.tagName === `${this.el.tagName}-HEADER-ROW`)\n );\n let visualIndex = 0;\n\n rows.forEach((node, i) => {\n const row = (node as HTMLElement);\n const isHeaderRow = (node as any)?.tagName === `${this.el.tagName}-HEADER-ROW`;\n\n if (this.selectable) {\n let name = row.getAttribute('selection-name');\n\n if (!name) {\n name = isHeaderRow ? 'header' : `xv-table-row-${i}`;\n row.setAttribute('selection-name', name);\n }\n\n if (row.hasAttribute('checked')) {\n this.selectedRows.set(name, {\n name,\n value: row.getAttribute('value') ?? undefined,\n })\n }\n }\n\n if (isHeaderRow) return;\n\n switch (this.colorSchema) {\n case TABLE_COLOR_SCHEMA.ZEBRA:\n const stripe = visualIndex % 2 === 0 ? 'even' : 'odd';\n if (row.hasAttribute('expandable') && rows[i + 1]) {\n row.setAttribute(stripe, '');\n } else {\n visualIndex++;\n row.setAttribute(stripe, '');\n }\n break;\n default:\n row.removeAttribute('odd');\n row.removeAttribute('even');\n }\n });\n }\n\n private handleCheckedChange = (e: TableSelectionEvent) => {\n const { name, value, checked } = e.detail;\n\n if (checked) {\n this.selectedRows.set(name, { name, value });\n } else {\n this.selectedRows.delete(name);\n }\n\n this.changeSelection.emit(Array.from(this.selectedRows.values()));\n }\n\n render() {\n return (\n <Host size={this.size} selectable={this.selectable}>\n {(this.el.title || this.description) && (\n <div class=\"caption\">\n {this.el.title && <h5 class=\"caption_title\">{this.el.title}</h5>}\n {this.description && <p class=\"caption_description\">{this.description}</p>}\n </div>\n )}\n <slot></slot>\n </Host>\n );\n }\n\n componentWillLoad() {\n this.setRowPropsHandler();\n this.el.addEventListener('checkedChange', this.handleCheckedChange as any);\n }\n\n disconnectedCallback() {\n this.el.removeEventListener('checkedChange', this.handleCheckedChange as any);\n }\n}\n"]}
@@ -13,7 +13,7 @@ export class XvTag {
13
13
  this.closeClick.emit(e);
14
14
  }
15
15
  render() {
16
- return (h(Host, { key: '429e196f85e0b46f65822519d0e363671fd60a77', style: { color: this.color, background: this.bg }, class: `xv-tag ${this.disabled ? 'disabled' : ''} ${this.size}` }, h("div", { key: 'b2b919d599e662e07fad0cc0d2e933926911aea9', class: "xv-tag_content" }, h("slot", { key: '717f8e980099bb813a12342015661e9914cc1330' })), this.closeable && (h("button", { key: '31ea0d38544c9b422fcab3dd92718de0e4005be8', onClick: this.closeHandler.bind(this), class: "xv-tag_close" }))));
16
+ return (h(Host, { key: '3164ae035733d790ba1fb02040dd8ba5430c960a', style: { color: this.color, background: this.bg }, class: `xv-tag ${this.disabled ? 'disabled' : ''} ${this.size}` }, h("div", { key: '1c540ff9be6a45d89d8a2175bf2603640e43b478', class: "xv-tag_content" }, h("slot", { key: '2d893f03cc168828c932c4995ba2bbb6a649897b' })), this.closeable && (h("button", { key: '459f1f667f3b207fa6f5b24af82e2b5f6470db0d', onClick: this.closeHandler.bind(this), class: "xv-tag_close" }))));
17
17
  }
18
18
  static get is() { return "xv-tag-v2"; }
19
19
  static get encapsulation() { return "shadow"; }
@@ -9,7 +9,7 @@ export class XvTooltip {
9
9
  this.position = 'top';
10
10
  }
11
11
  render() {
12
- return (h(Host, { key: '3896748ac459f1b401b4cd59b5ff163640811dce', tooltip: this.message, class: `xv-tooltip_${this.position}` }, h("slot", { key: '458ac3f69fe0b595af5bfbf16b7b99614a84bb8c' }, h("svg", { key: '32561cbbb87adcd9ef493a81c3edfd7e9c1f71ed', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", width: 16, height: 16 }, h("path", { key: 'cb38fdc43b099b8fa080bf8a48fb736ff2c2cf80', fill: "currentColor", d: "M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-8 0 0-88c0-13.3-10.7-24-24-24l-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l24 0 0 64-24 0zm40-144a32 32 0 1 0 0-64 32 32 0 1 0 0 64z" })))));
12
+ return (h(Host, { key: '476077c0607c160c2374a48f00c5ddabd199da03', tooltip: this.message, class: `xv-tooltip_${this.position}` }, h("slot", { key: '9ebaf660c304374fd7eb1802a5e145a7856c7b70' }, h("svg", { key: '196a46d3bf15df204853bc092361538dafcbf9f8', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", width: 16, height: 16 }, h("path", { key: '042422978eb1dca37c64df75b076fc25f4f0dd87', fill: "currentColor", d: "M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-8 0 0-88c0-13.3-10.7-24-24-24l-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l24 0 0 64-24 0zm40-144a32 32 0 1 0 0-64 32 32 0 1 0 0 64z" })))));
13
13
  }
14
14
  static get is() { return "xv-tooltip-v2"; }
15
15
  static get encapsulation() { return "shadow"; }
@@ -0,0 +1,9 @@
1
+ export var SIZE_VAR;
2
+ (function (SIZE_VAR) {
3
+ SIZE_VAR["XS"] = "XS";
4
+ SIZE_VAR["SM"] = "sm";
5
+ SIZE_VAR["MD"] = "md";
6
+ SIZE_VAR["LG"] = "lg";
7
+ SIZE_VAR["XL"] = "xl";
8
+ })(SIZE_VAR || (SIZE_VAR = {}));
9
+ //# sourceMappingURL=enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enum.js","sourceRoot":"","sources":["../../src/types/enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,qBAAS,CAAA;IACT,qBAAS,CAAA;IACT,qBAAS,CAAA;IACT,qBAAS,CAAA;IACT,qBAAS,CAAA;AACX,CAAC,EANW,QAAQ,KAAR,QAAQ,QAMnB","sourcesContent":["export enum SIZE_VAR {\n XS = 'XS',\n SM = 'sm',\n MD = 'md',\n LG = 'lg',\n XL = 'xl',\n}\n"]}
@@ -4,4 +4,11 @@ export function format(first, middle, last) {
4
4
  export function uidGenerator() {
5
5
  return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, c => (+c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +c / 4).toString(16));
6
6
  }
7
+ /**
8
+ * Walks through the given DOM collection and runs the given callback.
9
+ * @param a A DOM collection.
10
+ * @param predicate The callback function.
11
+ * @param [thisObject] The context object for the given callback function.
12
+ */
13
+ export const forEach = (a, predicate, thisObject) => Array.prototype.forEach.call(a, predicate, thisObject);
7
14
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,MAAM,CAAC,KAAc,EAAE,MAAe,EAAE,IAAa;IACnE,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACjF,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,OAAO,sCAAsC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAClE,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAChF,CAAC;AACJ,CAAC","sourcesContent":["export function format(first?: string, middle?: string, last?: string): string {\n return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');\n}\n\nexport function uidGenerator() {\n return \"10000000-1000-4000-8000-100000000000\".replace(/[018]/g, c =>\n (+c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +c / 4).toString(16)\n );\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,MAAM,CAAC,KAAc,EAAE,MAAe,EAAE,IAAa;IACnE,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACjF,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,OAAO,sCAAsC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAClE,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAChF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CACrB,CAA+C,EAC/C,SAAoD,EACpD,UAAgB,EAChB,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC","sourcesContent":["export function format(first?: string, middle?: string, last?: string): string {\n return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');\n}\n\nexport function uidGenerator() {\n return \"10000000-1000-4000-8000-100000000000\".replace(/[018]/g, c =>\n (+c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +c / 4).toString(16)\n );\n}\n\n/**\n * Walks through the given DOM collection and runs the given callback.\n * @param a A DOM collection.\n * @param predicate The callback function.\n * @param [thisObject] The context object for the given callback function.\n */\nexport const forEach = (\n a: NodeListOf<Node> | HTMLCollectionOf<Element>,\n predicate: (search: Element, index?: number) => void,\n thisObject?: any\n) => Array.prototype.forEach.call(a, predicate, thisObject);\n"]}
@@ -1,5 +1,5 @@
1
1
  const NAMESPACE = 'xv-webcomponents';
2
- const BUILD = /* xv-webcomponents */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, constructableCSS: true, cssAnnotations: true, devTools: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: true, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: false, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
2
+ const BUILD = /* xv-webcomponents */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, constructableCSS: true, cssAnnotations: true, devTools: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: true, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: true, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
3
3
 
4
4
  /*
5
5
  Stencil Client Platform v4.27.1 | MIT Licensed | https://stenciljs.com
@@ -84,6 +84,12 @@ var styles = /* @__PURE__ */ new Map();
84
84
  var HYDRATED_STYLE_ID = "sty-id";
85
85
  var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
86
86
  var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
87
+ var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
88
+ "formAssociatedCallback",
89
+ "formResetCallback",
90
+ "formDisabledCallback",
91
+ "formStateRestoreCallback"
92
+ ];
87
93
  var win = typeof window !== "undefined" ? window : {};
88
94
  var plt = {
89
95
  $flags$: 0,
@@ -459,7 +465,11 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
459
465
  }
460
466
  }
461
467
  }
462
- } else if (memberName === "key") ; else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
468
+ } else if (memberName === "key") ; else if (memberName === "ref") {
469
+ if (newValue) {
470
+ newValue(elm);
471
+ }
472
+ } else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
463
473
  if (memberName[2] === "-") {
464
474
  memberName = memberName.slice(3);
465
475
  } else if (isMemberInElement(win, ln)) {
@@ -631,6 +641,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
631
641
  const vnode = vnodes[index];
632
642
  if (vnode) {
633
643
  const elm = vnode.$elm$;
644
+ nullifyVNodeRefs(vnode);
634
645
  if (elm) {
635
646
  elm.remove();
636
647
  }
@@ -766,6 +777,12 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
766
777
  elm.data = text;
767
778
  }
768
779
  };
780
+ var nullifyVNodeRefs = (vNode) => {
781
+ {
782
+ vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
783
+ vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
784
+ }
785
+ };
769
786
  var insertBefore = (parent, newNode, reference) => {
770
787
  {
771
788
  return parent == null ? void 0 : parent.insertBefore(newNode, reference);
@@ -777,6 +794,12 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
777
794
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
778
795
  const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
779
796
  hostTagName = hostElm.tagName;
797
+ if (cmpMeta.$attrsToReflect$) {
798
+ rootVnode.$attrs$ = rootVnode.$attrs$ || {};
799
+ cmpMeta.$attrsToReflect$.map(
800
+ ([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
801
+ );
802
+ }
780
803
  if (isInitialLoad && rootVnode.$attrs$) {
781
804
  for (const key of Object.keys(rootVnode.$attrs$)) {
782
805
  if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
@@ -1002,6 +1025,25 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1002
1025
  var proxyComponent = (Cstr, cmpMeta, flags) => {
1003
1026
  var _a, _b;
1004
1027
  const prototype = Cstr.prototype;
1028
+ if (cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
1029
+ FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
1030
+ Object.defineProperty(prototype, cbName, {
1031
+ value(...args) {
1032
+ const hostRef = getHostRef(this);
1033
+ const instance = hostRef.$lazyInstance$ ;
1034
+ if (!instance) {
1035
+ hostRef.$onReadyPromise$.then((asyncInstance) => {
1036
+ const cb = asyncInstance[cbName];
1037
+ typeof cb === "function" && cb.call(asyncInstance, ...args);
1038
+ });
1039
+ } else {
1040
+ const cb = instance[cbName] ;
1041
+ typeof cb === "function" && cb.call(instance, ...args);
1042
+ }
1043
+ }
1044
+ });
1045
+ });
1046
+ }
1005
1047
  if (cmpMeta.$members$ || (cmpMeta.$watchers$ || Cstr.watchers)) {
1006
1048
  if (Cstr.watchers && !cmpMeta.$watchers$) {
1007
1049
  cmpMeta.$watchers$ = Cstr.watchers;
@@ -1122,8 +1164,12 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1122
1164
  /* @__PURE__ */ new Set([
1123
1165
  ...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
1124
1166
  ...members.filter(([_, m]) => m[0] & 15 /* HasAttribute */).map(([propName, m]) => {
1167
+ var _a2;
1125
1168
  const attrName = m[1] || propName;
1126
1169
  attrNameToPropName.set(attrName, propName);
1170
+ if (m[0] & 512 /* ReflectAttr */) {
1171
+ (_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
1172
+ }
1127
1173
  return attrName;
1128
1174
  })
1129
1175
  ])
@@ -1313,6 +1359,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1313
1359
  {
1314
1360
  cmpMeta.$listeners$ = compactMeta[3];
1315
1361
  }
1362
+ {
1363
+ cmpMeta.$attrsToReflect$ = [];
1364
+ }
1316
1365
  {
1317
1366
  cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};
1318
1367
  }
@@ -1374,6 +1423,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1374
1423
  return getHostRef(this).$onReadyPromise$;
1375
1424
  }
1376
1425
  };
1426
+ if (cmpMeta.$flags$ & 64 /* formAssociated */) {
1427
+ HostElement.formAssociated = true;
1428
+ }
1377
1429
  cmpMeta.$lazyBundleId$ = lazyBundle[0];
1378
1430
  if (!exclude.includes(tagName) && !customElements2.get(tagName)) {
1379
1431
  cmpTags.push(tagName);
@@ -1451,4 +1503,4 @@ var setNonce = (nonce) => plt.$nonce$ = nonce;
1451
1503
 
1452
1504
  export { Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
1453
1505
 
1454
- //# sourceMappingURL=index-60f5a964.js.map
1506
+ //# sourceMappingURL=index-83ab73b7.js.map