xv-webcomponents 0.1.30 → 0.1.32

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 (123) hide show
  1. package/dist/cjs/{index-782b9733.js → index-5ee1b884.js} +43 -2
  2. package/dist/cjs/index-5ee1b884.js.map +1 -0
  3. package/dist/cjs/index.cjs.js +1 -1
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/{utils-aa46f72a.js → utils-22c0eda0.js} +1 -16
  6. package/dist/cjs/utils-22c0eda0.js.map +1 -0
  7. package/dist/cjs/{xv-accordion-v2_28.cjs.entry.js → xv-accordion-v2_26.cjs.entry.js} +191 -440
  8. package/dist/cjs/xv-accordion-v2_26.cjs.entry.js.map +1 -0
  9. package/dist/cjs/xv-breadcrumbs-v2.cjs.entry.js +1 -1
  10. package/dist/cjs/xv-webcomponents.cjs.js +2 -2
  11. package/dist/collection/collection-manifest.json +1 -3
  12. package/dist/collection/components/xv-checkbox/xv-checkbox.css +4 -1
  13. package/dist/collection/components/xv-checkbox/xv-checkbox.js +1 -1
  14. package/dist/collection/components/xv-checkbox/xv-checkbox.js.map +1 -1
  15. package/dist/collection/components/xv-dropdown/xv-dropdown-item/xv-dropdown-item.js +1 -1
  16. package/dist/collection/components/xv-dropdown/xv-dropdown.css +1 -1
  17. package/dist/collection/components/xv-dropdown/xv-dropdown.js +41 -11
  18. package/dist/collection/components/xv-dropdown/xv-dropdown.js.map +1 -1
  19. package/dist/collection/components/xv-footer/xv-footer.js +1 -1
  20. package/dist/collection/components/xv-header/xv-header.js +1 -1
  21. package/dist/collection/components/xv-link/xv-link.css +5 -0
  22. package/dist/collection/components/xv-link/xv-link.js +3 -3
  23. package/dist/collection/components/xv-link/xv-link.js.map +1 -1
  24. package/dist/collection/components/xv-modal/xv-modal.css +8 -4
  25. package/dist/collection/components/xv-modal/xv-modal.js +31 -7
  26. package/dist/collection/components/xv-modal/xv-modal.js.map +1 -1
  27. package/dist/collection/components/xv-notification/xv-notification.js +3 -3
  28. package/dist/collection/components/xv-notification/xv-notification.js.map +1 -1
  29. package/dist/collection/components/xv-overflow-menu/xv-overflow-menu-item/xv-overflow-menu-item.js +1 -1
  30. package/dist/collection/components/xv-overflow-menu/xv-overflow-menu.css +3 -0
  31. package/dist/collection/components/xv-overflow-menu/xv-overflow-menu.js +1 -1
  32. package/dist/collection/components/xv-progress-indicator/xv-progress-indicator-item/xv-progress-indicator-item.js +1 -1
  33. package/dist/collection/components/xv-progress-indicator/xv-progress-indicator.js +2 -2
  34. package/dist/collection/components/xv-progress-indicator/xv-progress-indicator.js.map +1 -1
  35. package/dist/collection/components/xv-table/_vars.js +9 -0
  36. package/dist/collection/components/xv-table/_vars.js.map +1 -0
  37. package/dist/collection/components/xv-table/xv-table-cell/xv-table-cell.css +93 -0
  38. package/dist/collection/components/xv-table/xv-table-cell/xv-table-cell.js +160 -0
  39. package/dist/collection/components/xv-table/xv-table-cell/xv-table-cell.js.map +1 -0
  40. package/dist/collection/components/xv-table/xv-table-expand/xv-table-expand.css +55 -114
  41. package/dist/collection/components/xv-table/xv-table-expand/xv-table-expand.js +28 -151
  42. package/dist/collection/components/xv-table/xv-table-expand/xv-table-expand.js.map +1 -1
  43. package/dist/collection/components/xv-table/xv-table-row/xv-table-row.css +27 -34
  44. package/dist/collection/components/xv-table/xv-table-row/xv-table-row.js +165 -106
  45. package/dist/collection/components/xv-table/xv-table-row/xv-table-row.js.map +1 -1
  46. package/dist/collection/components/xv-table/xv-table.css +101 -141
  47. package/dist/collection/components/xv-table/xv-table.js +70 -196
  48. package/dist/collection/components/xv-table/xv-table.js.map +1 -1
  49. package/dist/collection/components/xv-tabs/xv-tab/xv-tab.css +7 -0
  50. package/dist/collection/components/xv-tabs/xv-tab/xv-tab.js +44 -3
  51. package/dist/collection/components/xv-tabs/xv-tab/xv-tab.js.map +1 -1
  52. package/dist/collection/components/xv-tabs/xv-tabs.css +60 -12
  53. package/dist/collection/components/xv-tabs/xv-tabs.js +97 -48
  54. package/dist/collection/components/xv-tabs/xv-tabs.js.map +1 -1
  55. package/dist/collection/components/xv-tag/xv-tag.js +1 -1
  56. package/dist/collection/components/xv-text-input/xv-text-input.js +53 -10
  57. package/dist/collection/components/xv-text-input/xv-text-input.js.map +1 -1
  58. package/dist/collection/components/xv-tooltip/xv-tooltip.css +6 -1
  59. package/dist/collection/components/xv-tooltip/xv-tooltip.js +22 -3
  60. package/dist/collection/components/xv-tooltip/xv-tooltip.js.map +1 -1
  61. package/dist/esm/{index-83ab73b7.js → index-590eb7d2.js} +43 -3
  62. package/dist/esm/index-590eb7d2.js.map +1 -0
  63. package/dist/esm/index.js +1 -1
  64. package/dist/esm/loader.js +3 -3
  65. package/dist/esm/{utils-0d1c18d5.js → utils-a9c71376.js} +2 -16
  66. package/dist/esm/utils-a9c71376.js.map +1 -0
  67. package/dist/esm/{xv-accordion-v2_28.entry.js → xv-accordion-v2_26.entry.js} +191 -438
  68. package/dist/esm/xv-accordion-v2_26.entry.js.map +1 -0
  69. package/dist/esm/xv-breadcrumbs-v2.entry.js +1 -1
  70. package/dist/esm/xv-webcomponents.js +3 -3
  71. package/dist/types/components/xv-dropdown/xv-dropdown.d.ts +2 -0
  72. package/dist/types/components/xv-link/xv-link.d.ts +1 -1
  73. package/dist/types/components/xv-modal/xv-modal.d.ts +5 -1
  74. package/dist/types/components/xv-table/_vars.d.ts +19 -0
  75. package/dist/types/components/xv-table/xv-table-cell/xv-table-cell.d.ts +12 -0
  76. package/dist/types/components/xv-table/xv-table-expand/xv-table-expand.d.ts +4 -20
  77. package/dist/types/components/xv-table/xv-table-row/xv-table-row.d.ts +16 -46
  78. package/dist/types/components/xv-table/xv-table.d.ts +10 -32
  79. package/dist/types/components/xv-tabs/xv-tab/xv-tab.d.ts +2 -0
  80. package/dist/types/components/xv-tabs/xv-tabs.d.ts +15 -11
  81. package/dist/types/components/xv-text-input/xv-text-input.d.ts +3 -0
  82. package/dist/types/components/xv-tooltip/xv-tooltip.d.ts +1 -0
  83. package/dist/types/components.d.ts +127 -265
  84. package/dist/xv-webcomponents/index.esm.js +1 -1
  85. package/dist/xv-webcomponents/p-51113bf3.entry.js +2 -0
  86. package/dist/xv-webcomponents/p-51113bf3.entry.js.map +1 -0
  87. package/dist/xv-webcomponents/p-612356e6.js +3 -0
  88. package/dist/xv-webcomponents/p-612356e6.js.map +1 -0
  89. package/dist/xv-webcomponents/p-c09a0bfe.entry.js +2 -0
  90. package/dist/xv-webcomponents/p-f98a1845.js +2 -0
  91. package/dist/xv-webcomponents/p-f98a1845.js.map +1 -0
  92. package/dist/xv-webcomponents/xv-webcomponents.esm.js +1 -1
  93. package/dist/xv-webcomponents/xv-webcomponents.esm.js.map +1 -1
  94. package/package.json +1 -1
  95. package/dist/cjs/index-782b9733.js.map +0 -1
  96. package/dist/cjs/utils-aa46f72a.js.map +0 -1
  97. package/dist/cjs/xv-accordion-v2_28.cjs.entry.js.map +0 -1
  98. package/dist/collection/components/xv-table/defs.js +0 -28
  99. package/dist/collection/components/xv-table/defs.js.map +0 -1
  100. package/dist/collection/components/xv-table/xv-table-col/xv-table-col.css +0 -13
  101. package/dist/collection/components/xv-table/xv-table-col/xv-table-col.js +0 -111
  102. package/dist/collection/components/xv-table/xv-table-col/xv-table-col.js.map +0 -1
  103. package/dist/collection/components/xv-table/xv-table-header-row/xv-table-header-row.css +0 -80
  104. package/dist/collection/components/xv-table/xv-table-header-row/xv-table-header-row.js +0 -172
  105. package/dist/collection/components/xv-table/xv-table-header-row/xv-table-header-row.js.map +0 -1
  106. package/dist/collection/components/xv-table/xv-table-toolbar/xv-table-toolbar.css +0 -47
  107. package/dist/collection/components/xv-table/xv-table-toolbar/xv-table-toolbar.js +0 -78
  108. package/dist/collection/components/xv-table/xv-table-toolbar/xv-table-toolbar.js.map +0 -1
  109. package/dist/esm/index-83ab73b7.js.map +0 -1
  110. package/dist/esm/utils-0d1c18d5.js.map +0 -1
  111. package/dist/esm/xv-accordion-v2_28.entry.js.map +0 -1
  112. package/dist/types/components/xv-table/defs.d.ts +0 -38
  113. package/dist/types/components/xv-table/xv-table-col/xv-table-col.d.ts +0 -9
  114. package/dist/types/components/xv-table/xv-table-header-row/xv-table-header-row.d.ts +0 -28
  115. package/dist/types/components/xv-table/xv-table-toolbar/xv-table-toolbar.d.ts +0 -6
  116. package/dist/xv-webcomponents/p-39bf1511.js +0 -2
  117. package/dist/xv-webcomponents/p-39bf1511.js.map +0 -1
  118. package/dist/xv-webcomponents/p-5f18d718.entry.js +0 -2
  119. package/dist/xv-webcomponents/p-840929c5.js +0 -3
  120. package/dist/xv-webcomponents/p-840929c5.js.map +0 -1
  121. package/dist/xv-webcomponents/p-cc83f7ea.entry.js +0 -2
  122. package/dist/xv-webcomponents/p-cc83f7ea.entry.js.map +0 -1
  123. /package/dist/xv-webcomponents/{p-5f18d718.entry.js.map → p-c09a0bfe.entry.js.map} +0 -0
@@ -1,3 +1,10 @@
1
1
  :host {
2
2
  display: block;
3
+ }
4
+
5
+ :host([loading]) {
6
+ display: flex;
7
+ align-items: center;
8
+ justify-content: center;
9
+ min-height: 200px;
3
10
  }
@@ -1,10 +1,12 @@
1
1
  import { Host, h } from "@stencil/core";
2
+ import { SIZE_VAR } from "../../../types/enum";
2
3
  export class XvTab {
3
4
  constructor() {
4
5
  this.disabled = false;
6
+ this.loading = false;
5
7
  }
6
8
  render() {
7
- return h(Host, { key: 'b3991bf63fb73f2c39670477652dfa5b40630126', disabled: this.disabled }, h("slot", { key: 'a5dd5a983a13e97be7d925de669461226dc296c0' }));
9
+ return (h(Host, { key: '82d797fe902cd4dab29cf094485aad742835e6b4', disabled: this.disabled, name: this.name }, this.loading ? h("xv-loader-v2", { size: SIZE_VAR.LG }) : h("slot", null)));
8
10
  }
9
11
  static get is() { return "xv-tab-v2"; }
10
12
  static get encapsulation() { return "shadow"; }
@@ -37,7 +39,7 @@ export class XvTab {
37
39
  "getter": false,
38
40
  "setter": false,
39
41
  "attribute": "label",
40
- "reflect": false
42
+ "reflect": true
41
43
  },
42
44
  "disabled": {
43
45
  "type": "boolean",
@@ -56,8 +58,47 @@ export class XvTab {
56
58
  "getter": false,
57
59
  "setter": false,
58
60
  "attribute": "disabled",
59
- "reflect": false,
61
+ "reflect": true,
60
62
  "defaultValue": "false"
63
+ },
64
+ "loading": {
65
+ "type": "boolean",
66
+ "mutable": false,
67
+ "complexType": {
68
+ "original": "boolean",
69
+ "resolved": "boolean",
70
+ "references": {}
71
+ },
72
+ "required": false,
73
+ "optional": false,
74
+ "docs": {
75
+ "tags": [],
76
+ "text": ""
77
+ },
78
+ "getter": false,
79
+ "setter": false,
80
+ "attribute": "loading",
81
+ "reflect": true,
82
+ "defaultValue": "false"
83
+ },
84
+ "name": {
85
+ "type": "any",
86
+ "mutable": false,
87
+ "complexType": {
88
+ "original": "number | string",
89
+ "resolved": "number | string",
90
+ "references": {}
91
+ },
92
+ "required": false,
93
+ "optional": true,
94
+ "docs": {
95
+ "tags": [],
96
+ "text": ""
97
+ },
98
+ "getter": false,
99
+ "setter": false,
100
+ "attribute": "name",
101
+ "reflect": false
61
102
  }
62
103
  };
63
104
  }
@@ -1 +1 @@
1
- {"version":3,"file":"xv-tab.js","sourceRoot":"","sources":["../../../../src/components/xv-tabs/xv-tab/xv-tab.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAOzD,MAAM,OAAO,KAAK;IALlB;QAOU,aAAQ,GAAY,KAAK,CAAC;KAKnC;IAHC,MAAM;QACJ,OAAO,EAAC,IAAI,qDAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ;YAAE,8DAAQ,CAAO,CAAC;IACxD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop } from '@stencil/core';\n\n@Component({\n tag: 'xv-tab-v2',\n styleUrl: 'xv-tab.scss',\n shadow: true,\n})\nexport class XvTab {\n @Prop() label: string;\n @Prop() disabled: boolean = false;\n\n render() {\n return <Host disabled={this.disabled}><slot /></Host>;\n }\n}\n"]}
1
+ {"version":3,"file":"xv-tab.js","sourceRoot":"","sources":["../../../../src/components/xv-tabs/xv-tab/xv-tab.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAO/C,MAAM,OAAO,KAAK;IALlB;QAO2B,aAAQ,GAAY,KAAK,CAAC;QAC1B,YAAO,GAAY,KAAK,CAAC;KAUnD;IAPC,MAAM;QACJ,OAAO,CACP,EAAC,IAAI,qDAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,IAC3C,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,oBAAc,IAAI,EAAE,QAAQ,CAAC,EAAE,GAAI,CAAC,CAAC,CAAC,eAAQ,CACzD,CACN,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop } from '@stencil/core';\nimport { SIZE_VAR } from '../../../types/enum';\n\n@Component({\n tag: 'xv-tab-v2',\n styleUrl: 'xv-tab.scss',\n shadow: true,\n})\nexport class XvTab {\n @Prop({ reflect: true }) label: string;\n @Prop({ reflect: true }) disabled: boolean = false;\n @Prop({ reflect: true }) loading: boolean = false;\n @Prop() name?: number | string;\n\n render() {\n return (\n <Host disabled={this.disabled} name={this.name}>\n {this.loading ? <xv-loader-v2 size={SIZE_VAR.LG} /> : <slot />}\n </Host>\n );\n }\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  :host(.xv-tabs) .tab-headers {
6
6
  display: flex;
7
7
  }
8
- :host(.xv-tabs) .tab-headers button {
8
+ :host(.xv-tabs) .tab-headers_tab {
9
9
  background: none;
10
10
  padding: 11px var(--gap-md, 16px);
11
11
  cursor: pointer;
@@ -23,7 +23,7 @@
23
23
  height: 40px;
24
24
  white-space: nowrap;
25
25
  }
26
- :host(.xv-tabs) .tab-headers button:after {
26
+ :host(.xv-tabs) .tab-headers_tab:after {
27
27
  content: "";
28
28
  position: absolute;
29
29
  transition: background-color 0.3s ease, width 0.3s ease;
@@ -34,46 +34,94 @@
34
34
  height: 2px;
35
35
  background-color: var(--interactive-01, #273435);
36
36
  }
37
- :host(.xv-tabs) .tab-headers button:focus {
37
+ :host(.xv-tabs) .tab-headers_tab:focus {
38
38
  outline: none;
39
39
  border: 2px solid var(--border-border-subtle-01, #D1D1D1);
40
40
  }
41
- :host(.xv-tabs) .tab-headers button:hover {
41
+ :host(.xv-tabs) .tab-headers_tab:hover {
42
42
  border-bottom-color: var(--border-strong-01, #8B8B8B);
43
43
  }
44
- :host(.xv-tabs) .tab-headers button.active {
44
+ :host(.xv-tabs) .tab-headers_tab.active {
45
45
  color: var(--text-primary, #333);
46
46
  font-weight: 700;
47
47
  }
48
- :host(.xv-tabs) .tab-headers button.active:after {
48
+ :host(.xv-tabs) .tab-headers_tab.active:after {
49
49
  width: 100%;
50
50
  }
51
- :host(.xv-tabs) .tab-headers button.active:focus {
51
+ :host(.xv-tabs) .tab-headers_tab.active:focus {
52
52
  border-color: var(--interactive-01, #273435);
53
53
  }
54
- :host(.xv-tabs) .tab-headers button:disabled {
54
+ :host(.xv-tabs) .tab-headers_tab:disabled {
55
55
  color: var(--text-on-color-disabled, #8B8B8B);
56
56
  border-bottom-color: var(--border-disabled, #D1D1D1);
57
57
  cursor: not-allowed;
58
58
  }
59
- :host(.xv-tabs) .tab-headers button:disabled:after {
59
+ :host(.xv-tabs) .tab-headers_tab:disabled:after {
60
60
  background-color: var(--border-disabled, #D1D1D1);
61
61
  }
62
+ :host(.xv-tabs) .tab-headers_btn {
63
+ outline: none;
64
+ width: 40px;
65
+ height: 40px;
66
+ background: none;
67
+ border: none;
68
+ cursor: pointer;
69
+ position: relative;
70
+ transition: 0.25s ease-in-out opacity;
71
+ }
72
+ :host(.xv-tabs) .tab-headers_btn:before {
73
+ content: "";
74
+ position: absolute;
75
+ top: 50%;
76
+ left: 50%;
77
+ width: 0;
78
+ height: 0;
79
+ border: solid currentColor;
80
+ border-width: 0 2px 2px 0;
81
+ display: inline-block;
82
+ padding: 5px;
83
+ transform: translate(-50%, -50%) rotate(45deg);
84
+ }
85
+ :host(.xv-tabs) .tab-headers_btn:active {
86
+ opacity: 0.3;
87
+ }
88
+ :host(.xv-tabs) .tab-headers_btn.prev:before {
89
+ transform: translate(-50%, -50%) rotate(135deg);
90
+ }
91
+ :host(.xv-tabs) .tab-headers_btn.next:before {
92
+ transform: translate(-50%, -50%) rotate(-45deg);
93
+ }
62
94
  :host(.xv-tabs) .tab-content-wrapper {
63
95
  position: relative;
64
96
  overflow: hidden;
65
- transition: height 0.3s ease;
66
- padding: var(--gap-md, 16px);
97
+ padding: var(--gap-md, 16px) 0;
67
98
  }
68
99
  :host(.xv-tabs) ::slotted(xv-tab-v2) {
69
100
  position: absolute;
70
101
  opacity: 0;
71
- transition: opacity 0.3s ease;
102
+ max-height: 0;
103
+ transition: max-height 0.5s ease;
72
104
  width: 100%;
73
105
  pointer-events: none;
74
106
  }
75
107
  :host(.xv-tabs) ::slotted(xv-tab-v2.active) {
76
108
  position: relative;
77
109
  opacity: 1;
110
+ overflow-y: auto;
78
111
  pointer-events: auto;
112
+ max-height: 1000px;
113
+ }
114
+ :host(.xv-tabs) .xv-tabs_empty {
115
+ display: block;
116
+ text-align: center;
117
+ margin: 20px auto;
118
+ font-size: var(--fz-xl);
119
+ color: var(--text-primary);
120
+ }
121
+
122
+ :host([loading]) {
123
+ display: flex;
124
+ align-items: center;
125
+ justify-content: center;
126
+ min-height: 300px;
79
127
  }
@@ -1,5 +1,6 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  import { TAB_TAGS, TABS_VATIANT } from "./_vars";
3
+ import { SIZE_VAR } from "../../types/enum";
3
4
  export class XvTabs {
4
5
  constructor() {
5
6
  /**
@@ -10,54 +11,51 @@ export class XvTabs {
10
11
  * Variant of tabs from TABS_VATIANT enum
11
12
  */
12
13
  this.variant = TABS_VATIANT.DEFAULT;
13
- /**
14
- * for animate the tab content
15
- */
16
- this.height = 0;
17
14
  /**
18
15
  * local variable for tab labels collection
19
16
  */
20
17
  this.tabElements = [];
21
- }
22
- /**
23
- * Watch active tab changes to animate content height
24
- */
25
- onActiveTabChanged() {
26
- this.setHeight();
27
- }
28
- collectTabs() {
29
- if (!this.tabElements.length) {
30
- this.tabElements = Array.from(this.el.querySelectorAll(TAB_TAGS.TAB));
31
- }
18
+ this.collectTabs = () => {
19
+ if (!this.tabElements.length) {
20
+ this.tabElements = Array.from(this.el.querySelectorAll(TAB_TAGS.TAB));
21
+ this.tabElements.forEach((tab) => {
22
+ if (tab.hasAttribute('name') && !this.active) {
23
+ this.active = tab.getAttribute('name');
24
+ }
25
+ });
26
+ }
27
+ };
32
28
  }
33
29
  updateTabClasses() {
34
30
  this.tabElements.forEach((tab, i) => {
35
- tab.classList.toggle('active', i === this.active);
36
- });
37
- }
38
- setHeight() {
39
- requestAnimationFrame(() => {
40
- var _a;
41
- const tab = this.tabElements[this.active];
42
- if (tab) {
43
- const content = (_a = tab.shadowRoot) === null || _a === void 0 ? void 0 : _a.host;
44
- this.height = (content === null || content === void 0 ? void 0 : content.scrollHeight) || 0;
45
- }
31
+ tab.classList.toggle('active', (tab.getAttribute('name') || `${i}`) === `${this.active}`);
46
32
  });
47
33
  }
48
- handleTabClick(index) {
49
- if (index === this.active)
34
+ handleTabClick(active) {
35
+ if (active === this.active)
50
36
  return;
51
- this.active = index;
52
- this.setHeight();
53
- this.tabSelect.emit(this.active);
37
+ this.active = active;
38
+ this.activeChange.emit(Number(this.active) || this.active);
39
+ }
40
+ setTab(count = 1) {
41
+ const currentIdx = this.tabElements.findIndex((tab, i) => (tab.getAttribute('name') || `${i}`) === `${this.active}`);
42
+ const tab = this.tabElements[currentIdx + count];
43
+ if (tab && !(tab === null || tab === void 0 ? void 0 : tab.hasAttribute('disabled'))) {
44
+ this.active = tab.getAttribute('name') || `${currentIdx + count}`;
45
+ }
54
46
  }
55
47
  render() {
56
- return (h(Host, { key: '490001d8e74c759e11a2fc99c545d0a3429465f6', class: "xv-tabs", variant: this.variant }, h("div", { key: 'bd5210a9e26775c56b14fb4d0a330ed472033403', class: "tab-headers", role: "tablist" }, this.tabElements.map((tab, index) => (h("button", { role: "tab", disabled: !!tab.getAttribute('disabled') || !!(tab === null || tab === void 0 ? void 0 : tab.disabled), class: { active: index === this.active }, onClick: () => this.handleTabClick(index) }, tab.getAttribute('label') || `Tab ${index + 1}`)))), h("div", { key: '0e15189ae37d5ac1431545df44a4c6500694a2fc', class: "tab-content-wrapper", style: { height: `${this.height}px` }, role: "tabpanel", tabindex: -1 }, h("slot", { key: '18dc32e8d6f6576b355786d6c959582df87a59b5' }))));
48
+ var _a, _b, _c;
49
+ if (this.loading) {
50
+ return (h(Host, { class: "xv-tabs", variant: this.variant }, h("xv-loader-v2", { size: SIZE_VAR.XL })));
51
+ }
52
+ return (h(Host, { class: "xv-tabs", variant: this.variant }, h("div", { class: "tab-headers", role: "tablist" }, h("button", { hidden: !this.showArrows || !((_a = this.tabElements) === null || _a === void 0 ? void 0 : _a.length), "aria-label": "Previous", class: "tab-headers_btn prev", onClick: () => this.setTab(-1) }), ((_b = this.tabElements) === null || _b === void 0 ? void 0 : _b.length) ? this.tabElements.map((tab, index) => (h("button", { role: "tab", disabled: !!tab.getAttribute('disabled') || !!(tab === null || tab === void 0 ? void 0 : tab.disabled), class: {
53
+ 'tab-headers_tab': true,
54
+ active: (tab.getAttribute('name') || `${index}`) === `${this.active}`,
55
+ }, onClick: () => this.handleTabClick(tab.getAttribute('name') || `${index}`) }, tab.getAttribute('label') || `Tab ${index + 1}`))) : this.emptyMessage && h("p", { class: "xv-tabs_empty" }, this.emptyMessage), h("button", { "aria-label": "Next", hidden: !this.showArrows || !((_c = this.tabElements) === null || _c === void 0 ? void 0 : _c.length), class: "tab-headers_btn next", onClick: () => this.setTab(1) })), h("div", { class: "tab-content-wrapper", role: "tabpanel", tabindex: -1 }, h("slot", { onSlotchange: this.collectTabs }))));
57
56
  }
58
57
  componentWillLoad() {
59
- this.collectTabs();
60
- this.setHeight();
58
+ // this.collectTabs();
61
59
  }
62
60
  componentDidRender() {
63
61
  this.updateTabClasses();
@@ -77,11 +75,11 @@ export class XvTabs {
77
75
  static get properties() {
78
76
  return {
79
77
  "active": {
80
- "type": "number",
78
+ "type": "any",
81
79
  "mutable": true,
82
80
  "complexType": {
83
- "original": "number",
84
- "resolved": "number",
81
+ "original": "number | string",
82
+ "resolved": "number | string",
85
83
  "references": {}
86
84
  },
87
85
  "required": false,
@@ -96,6 +94,25 @@ export class XvTabs {
96
94
  "reflect": true,
97
95
  "defaultValue": "0"
98
96
  },
97
+ "loading": {
98
+ "type": "boolean",
99
+ "mutable": false,
100
+ "complexType": {
101
+ "original": "boolean",
102
+ "resolved": "boolean",
103
+ "references": {}
104
+ },
105
+ "required": false,
106
+ "optional": true,
107
+ "docs": {
108
+ "tags": [],
109
+ "text": "Show loader"
110
+ },
111
+ "getter": false,
112
+ "setter": false,
113
+ "attribute": "loading",
114
+ "reflect": true
115
+ },
99
116
  "variant": {
100
117
  "type": "string",
101
118
  "mutable": false,
@@ -121,18 +138,56 @@ export class XvTabs {
121
138
  "attribute": "variant",
122
139
  "reflect": false,
123
140
  "defaultValue": "TABS_VATIANT.DEFAULT"
141
+ },
142
+ "emptyMessage": {
143
+ "type": "string",
144
+ "mutable": false,
145
+ "complexType": {
146
+ "original": "string",
147
+ "resolved": "string",
148
+ "references": {}
149
+ },
150
+ "required": false,
151
+ "optional": true,
152
+ "docs": {
153
+ "tags": [],
154
+ "text": "Message when have no tabs"
155
+ },
156
+ "getter": false,
157
+ "setter": false,
158
+ "attribute": "empty-message",
159
+ "reflect": false
160
+ },
161
+ "showArrows": {
162
+ "type": "boolean",
163
+ "mutable": false,
164
+ "complexType": {
165
+ "original": "boolean",
166
+ "resolved": "boolean",
167
+ "references": {}
168
+ },
169
+ "required": false,
170
+ "optional": true,
171
+ "docs": {
172
+ "tags": [],
173
+ "text": "Message when have no tabs"
174
+ },
175
+ "getter": false,
176
+ "setter": false,
177
+ "attribute": "show-arrows",
178
+ "reflect": true
124
179
  }
125
180
  };
126
181
  }
127
182
  static get states() {
128
183
  return {
129
- "height": {}
184
+ "tabElements": {}
130
185
  };
131
186
  }
132
187
  static get events() {
133
188
  return [{
134
- "method": "tabSelect",
135
- "name": "tabSelect",
189
+ "method": "activeChange",
190
+ "name": "activeChange",
136
191
  "bubbles": true,
137
192
  "cancelable": true,
138
193
  "composed": true,
@@ -141,18 +196,12 @@ export class XvTabs {
141
196
  "text": "Emit event to outside"
142
197
  },
143
198
  "complexType": {
144
- "original": "number",
145
- "resolved": "number",
199
+ "original": "number | string",
200
+ "resolved": "number | string",
146
201
  "references": {}
147
202
  }
148
203
  }];
149
204
  }
150
205
  static get elementRef() { return "el"; }
151
- static get watchers() {
152
- return [{
153
- "propName": "active",
154
- "methodName": "onActiveTabChanged"
155
- }];
156
- }
157
206
  }
158
207
  //# sourceMappingURL=xv-tabs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"xv-tabs.js","sourceRoot":"","sources":["../../../src/components/xv-tabs/xv-tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AACrG,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAOjD,MAAM,OAAO,MAAM;IALnB;QAOE;;WAEG;QACqC,WAAM,GAAW,CAAC,CAAC;QAC3D;;W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core';\nimport { TAB_TAGS, TABS_VATIANT } from './_vars';\n\n@Component({\n tag: 'xv-tabs-v2',\n styleUrl: 'xv-tabs.scss',\n shadow: true,\n})\nexport class XvTabs {\n @Element() el: HTMLElement;\n /**\n * Index of active tab\n */\n @Prop({ reflect: true, mutable: true }) active: number = 0;\n /**\n * Variant of tabs from TABS_VATIANT enum\n */\n @Prop() variant: TABS_VATIANT = TABS_VATIANT.DEFAULT;\n /**\n * for animate the tab content\n */\n @State() height: number = 0;\n /**\n * Emit event to outside\n */\n @Event() tabSelect: EventEmitter<number>;\n /**\n * local variable for tab labels collection\n */\n private tabElements: HTMLElement[] = [];\n /**\n * Watch active tab changes to animate content height\n */\n @Watch('active')\n onActiveTabChanged() {\n this.setHeight();\n }\n\n private collectTabs() {\n if (!this.tabElements.length) {\n this.tabElements = Array.from(this.el.querySelectorAll(TAB_TAGS.TAB));\n }\n }\n\n private updateTabClasses() {\n this.tabElements.forEach((tab, i) => {\n tab.classList.toggle('active', i === this.active);\n });\n }\n\n private setHeight() {\n requestAnimationFrame(() => {\n const tab = this.tabElements[this.active];\n if (tab) {\n const content = tab.shadowRoot?.host;\n this.height = content?.scrollHeight || 0;\n }\n });\n }\n\n private handleTabClick(index: number) {\n if (index === this.active) return;\n\n this.active = index;\n this.setHeight();\n this.tabSelect.emit(this.active);\n }\n\n render() {\n return (\n <Host class=\"xv-tabs\" variant={this.variant}>\n <div class=\"tab-headers\" role=\"tablist\">\n {this.tabElements.map((tab, index) => (\n <button\n role=\"tab\"\n disabled={!!tab.getAttribute('disabled') || !!(tab as any)?.disabled}\n class={{ active: index === this.active }}\n onClick={() => this.handleTabClick(index)}\n >\n {tab.getAttribute('label') || `Tab ${index + 1}`}\n </button>\n ))}\n </div>\n\n <div\n class=\"tab-content-wrapper\"\n style={{ height: `${this.height}px` }}\n role=\"tabpanel\"\n tabindex={-1}\n >\n <slot />\n </div>\n </Host>\n );\n }\n\n componentWillLoad() {\n this.collectTabs();\n this.setHeight();\n }\n\n componentDidRender() {\n this.updateTabClasses();\n }\n}\n"]}
1
+ {"version":3,"file":"xv-tabs.js","sourceRoot":"","sources":["../../../src/components/xv-tabs/xv-tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAgB,KAAK,EAAE,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAO5C,MAAM,OAAO,MAAM;IALnB;QAOE;;WAEG;QACqC,WAAM,GAAoB,CAAC,CAAC;QASpE;;WAEG;QACK,YAAO,GAAiB,YAAY,CAAC,OAAO,CAAC;QASrD;;WAEG;QACM,gBAAW,GAAkB,EAAE,CAAC;QAEjC,gBAAW,GAAG,GAAG,EAAE;YACzB,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;gBAC7B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;gBACtE,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;oBAC/B,IAAI,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;wBAC7C,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;oBACzC,CAAC;gBACH,CAAC,CAAC,CAAA;YACJ,CAAC;QACH,CAAC,CAAA;KAwFF;IAtFS,gBAAgB;QACtB,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;YAClC,GAAG,CAAC,SAAS,CAAC,MAAM,CAClB,QAAQ,EACR,CAAC,GAAG,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CAAC,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,MAAM,CAAA,EACrD,KAAK,EAAC,sBAAsB,EAC5B,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAC7B,CACE;YAEN,WACE,KAAK,EAAC,qBAAqB,EAC3B,IAAI,EAAC,UAAU,EACf,QAAQ,EAAE,CAAC,CAAC;gBAEZ,YAAM,YAAY,EAAE,IAAI,CAAC,WAAW,GAAI,CACpC,CACD,CACR,CAAC;IACJ,CAAC;IAED,iBAAiB;QACf,sBAAsB;IACxB,CAAC;IAED,kBAAkB;QAChB,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Element, Prop, Event, EventEmitter, State } from '@stencil/core';\nimport { TAB_TAGS, TABS_VATIANT } from './_vars';\nimport { SIZE_VAR } from '../../types/enum';\n\n@Component({\n tag: 'xv-tabs-v2',\n styleUrl: 'xv-tabs.scss',\n shadow: true,\n})\nexport class XvTabs {\n @Element() el: HTMLElement;\n /**\n * Index of active tab\n */\n @Prop({ reflect: true, mutable: true }) active: number | string = 0;\n /**\n * Emit event to outside\n */\n @Event() activeChange: EventEmitter<number | string>;\n /**\n * Show loader\n */\n @Prop({ reflect: true }) loading?: boolean;\n /**\n * Variant of tabs from TABS_VATIANT enum\n */\n @Prop() variant: TABS_VATIANT = TABS_VATIANT.DEFAULT;\n /**\n * Message when have no tabs\n */\n @Prop() emptyMessage?: string;\n /**\n * Message when have no tabs\n */\n @Prop({ reflect: true }) showArrows?: boolean;\n /**\n * local variable for tab labels collection\n */\n @State() tabElements: HTMLElement[] = [];\n\n private collectTabs = () => {\n if (!this.tabElements.length) {\n this.tabElements = Array.from(this.el.querySelectorAll(TAB_TAGS.TAB));\n this.tabElements.forEach((tab) => {\n if (tab.hasAttribute('name') && !this.active) {\n this.active = tab.getAttribute('name');\n }\n })\n }\n }\n\n private updateTabClasses() {\n this.tabElements.forEach((tab, i) => {\n tab.classList.toggle(\n 'active',\n (tab.getAttribute('name') || `${i}`) === `${this.active}`\n );\n });\n }\n\n private handleTabClick(active: string | number) {\n if (active === this.active) return;\n\n this.active = active;\n this.activeChange.emit(Number(this.active) || this.active);\n }\n\n private setTab(count: number = 1) {\n const currentIdx = this.tabElements.findIndex(\n (tab, i) =>\n (tab.getAttribute('name') || `${i}`) === `${this.active}`\n );\n const tab = this.tabElements[currentIdx + count];\n\n if (tab && !tab?.hasAttribute('disabled')) {\n this.active = tab.getAttribute('name') || `${currentIdx + count}`;\n }\n }\n\n render() {\n if (this.loading) {\n return (\n <Host class=\"xv-tabs\" variant={this.variant}>\n <xv-loader-v2 size={SIZE_VAR.XL} />\n </Host>\n )\n }\n\n return (\n <Host class=\"xv-tabs\" variant={this.variant}>\n <div class=\"tab-headers\" role=\"tablist\">\n <button\n hidden={!this.showArrows || !this.tabElements?.length}\n aria-label=\"Previous\"\n class=\"tab-headers_btn prev\"\n onClick={() => this.setTab(-1)}\n />\n {this.tabElements?.length ? this.tabElements.map((tab, index) => (\n <button\n role=\"tab\"\n disabled={!!tab.getAttribute('disabled') || !!(tab as any)?.disabled}\n class={{\n 'tab-headers_tab': true,\n active: (tab.getAttribute('name') || `${index}`) === `${this.active}`,\n }}\n onClick={() => this.handleTabClick(tab.getAttribute('name') || `${index}`)}\n >\n {tab.getAttribute('label') || `Tab ${index + 1}`}\n </button>\n )) : this.emptyMessage && <p class=\"xv-tabs_empty\">{this.emptyMessage}</p>}\n\n <button\n aria-label=\"Next\"\n hidden={!this.showArrows || !this.tabElements?.length}\n class=\"tab-headers_btn next\"\n onClick={() => this.setTab(1)}\n />\n </div>\n\n <div\n class=\"tab-content-wrapper\"\n role=\"tabpanel\"\n tabindex={-1}\n >\n <slot onSlotchange={this.collectTabs} />\n </div>\n </Host>\n );\n }\n\n componentWillLoad() {\n // this.collectTabs();\n }\n\n componentDidRender() {\n this.updateTabClasses();\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: 'cca59dceeb566fa038234f7962be22424dc9a35e', style: { color: this.color, background: this.bg }, class: `xv-tag ${this.disabled ? 'disabled' : ''} ${this.size}` }, h("div", { key: '5d7bedbbbb7ce916b1aa5efda7cebe957b985762', class: "xv-tag_content" }, h("slot", { key: '300db1eecac2be8508b328cd869599af162c04a8' })), this.closeable && (h("button", { key: '4d7eacbb1d380ecf664780e4466129327563bace', onClick: this.closeHandler.bind(this), class: "xv-tag_close" }))));
16
+ return (h(Host, { key: 'e7015e92932ed5f4d6d3acb68ab63628e4a4bcb6', style: { color: this.color, background: this.bg }, class: `xv-tag ${this.disabled ? 'disabled' : ''} ${this.size}` }, h("div", { key: '87a56eb93d86027dfcfa6c2e0edc22defe7628b4', class: "xv-tag_content" }, h("slot", { key: 'b71fb28fdbf29da81d8cc701f7a9b4bf0fc23c4d' })), this.closeable && (h("button", { key: 'f99c2fc938973a3809a355a8621cf161e185c46c', 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"; }
@@ -14,12 +14,17 @@ export class XvTextInput {
14
14
  this.value = '';
15
15
  this.disabled = false;
16
16
  this.readonly = false;
17
+ this.loading = false;
17
18
  this.handleInput = (e) => {
18
19
  const target = e.target;
19
20
  this.value = target.value;
21
+ this.valueChange.emit(this.value);
20
22
  this.internals.setFormValue(target.value);
21
23
  };
22
24
  this.getControlIcon = (status) => {
25
+ if (this.loading) {
26
+ return h("xv-loader-v2", { class: "control_icon", size: SIZE_VAR.XS });
27
+ }
23
28
  switch (status) {
24
29
  case TextInputStatus.ERROR: {
25
30
  return (h("svg", { class: "control_icon error", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, h("path", { fill: "currentColor", d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z" })));
@@ -31,7 +36,7 @@ export class XvTextInput {
31
36
  };
32
37
  }
33
38
  render() {
34
- return (h(Host, { key: '4a16cd6ea36fd074e118bc262bf2aa50a32bbc90', name: this.name, class: "xv-text-input", role: "textbox", tabindex: this.disabled ? -1 : false }, this.label && h("label", { key: 'a18f098c242b7923951ad745d8fdca68289b6a1e', class: "label" }, this.label), h("div", { key: '3fc93834180279e5dfcc4b203e6e821e13acb539', class: "control" }, h("input", { key: '5d4b743dcb4c7afff9475f69b0127b478bc6a2a1', type: "text", class: { withIcon: this.status !== TextInputStatus.DEF }, readonly: this.readonly, value: this.value, disabled: this.disabled, onInput: this.handleInput, placeholder: this.placeholder }), this.getControlIcon(this.status)), this.helper && h("p", { key: 'e24b2c111e6fdba83006493d1fc7dcdf08256880', class: "helper" }, this.helper)));
39
+ return (h(Host, { key: '7e773cbebf4bd3bc6c2e71f454f733de77ec2b56', name: this.name, class: "xv-text-input", role: "textbox", tabindex: this.disabled ? -1 : false }, this.label && h("label", { key: 'a28eca6e736e747c5730d2b517cbcf33178a53af', class: "label" }, this.label), h("div", { key: 'c432a6ca83a94d1f160745b1f0f2e1a532441ccd', class: "control" }, h("input", { key: '5545a39193c180329fe382f8f9fd4aac5d79adcd', type: "text", class: { withIcon: this.status !== TextInputStatus.DEF }, readonly: this.readonly, value: this.value, disabled: this.disabled, onInput: this.handleInput, placeholder: this.placeholder }), this.getControlIcon(this.status)), this.helper && h("p", { key: 'ab7aee3589f336f3899afef307845466c4eee41e', class: "helper" }, this.helper)));
35
40
  }
36
41
  componentWillLoad() {
37
42
  this.internals.setFormValue(this.value);
@@ -68,7 +73,7 @@ export class XvTextInput {
68
73
  "getter": false,
69
74
  "setter": false,
70
75
  "attribute": "label",
71
- "reflect": false
76
+ "reflect": true
72
77
  },
73
78
  "placeholder": {
74
79
  "type": "string",
@@ -87,7 +92,7 @@ export class XvTextInput {
87
92
  "getter": false,
88
93
  "setter": false,
89
94
  "attribute": "placeholder",
90
- "reflect": false
95
+ "reflect": true
91
96
  },
92
97
  "helper": {
93
98
  "type": "string",
@@ -106,7 +111,7 @@ export class XvTextInput {
106
111
  "getter": false,
107
112
  "setter": false,
108
113
  "attribute": "helper",
109
- "reflect": false,
114
+ "reflect": true,
110
115
  "defaultValue": "''"
111
116
  },
112
117
  "name": {
@@ -126,7 +131,7 @@ export class XvTextInput {
126
131
  "getter": false,
127
132
  "setter": false,
128
133
  "attribute": "name",
129
- "reflect": false
134
+ "reflect": true
130
135
  },
131
136
  "size": {
132
137
  "type": "string",
@@ -151,7 +156,7 @@ export class XvTextInput {
151
156
  "getter": false,
152
157
  "setter": false,
153
158
  "attribute": "size",
154
- "reflect": false,
159
+ "reflect": true,
155
160
  "defaultValue": "SIZE_VAR.MD"
156
161
  },
157
162
  "status": {
@@ -177,7 +182,7 @@ export class XvTextInput {
177
182
  "getter": false,
178
183
  "setter": false,
179
184
  "attribute": "status",
180
- "reflect": false,
185
+ "reflect": true,
181
186
  "defaultValue": "TextInputStatus.DEF"
182
187
  },
183
188
  "value": {
@@ -197,7 +202,7 @@ export class XvTextInput {
197
202
  "getter": false,
198
203
  "setter": false,
199
204
  "attribute": "value",
200
- "reflect": false,
205
+ "reflect": true,
201
206
  "defaultValue": "''"
202
207
  },
203
208
  "disabled": {
@@ -217,7 +222,7 @@ export class XvTextInput {
217
222
  "getter": false,
218
223
  "setter": false,
219
224
  "attribute": "disabled",
220
- "reflect": false,
225
+ "reflect": true,
221
226
  "defaultValue": "false"
222
227
  },
223
228
  "readonly": {
@@ -237,11 +242,49 @@ export class XvTextInput {
237
242
  "getter": false,
238
243
  "setter": false,
239
244
  "attribute": "readonly",
240
- "reflect": false,
245
+ "reflect": true,
246
+ "defaultValue": "false"
247
+ },
248
+ "loading": {
249
+ "type": "boolean",
250
+ "mutable": false,
251
+ "complexType": {
252
+ "original": "boolean",
253
+ "resolved": "boolean",
254
+ "references": {}
255
+ },
256
+ "required": false,
257
+ "optional": false,
258
+ "docs": {
259
+ "tags": [],
260
+ "text": ""
261
+ },
262
+ "getter": false,
263
+ "setter": false,
264
+ "attribute": "loading",
265
+ "reflect": true,
241
266
  "defaultValue": "false"
242
267
  }
243
268
  };
244
269
  }
270
+ static get events() {
271
+ return [{
272
+ "method": "valueChange",
273
+ "name": "valueChange",
274
+ "bubbles": true,
275
+ "cancelable": true,
276
+ "composed": true,
277
+ "docs": {
278
+ "tags": [],
279
+ "text": ""
280
+ },
281
+ "complexType": {
282
+ "original": "string",
283
+ "resolved": "string",
284
+ "references": {}
285
+ }
286
+ }];
287
+ }
245
288
  static get elementRef() { return "el"; }
246
289
  static get attachInternalsMemberName() { return "internals"; }
247
290
  }