q2-tecton-elements 1.9.5 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/dist/cjs/{icons-077ed9b7.js → icons-fa5f4367.js} +22 -22
  2. package/dist/cjs/index-14348270.js +557 -0
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/q2-avatar.cjs.entry.js +1 -1
  5. package/dist/cjs/q2-btn_2.cjs.entry.js +7 -6
  6. package/dist/cjs/q2-calendar.cjs.entry.js +2 -2
  7. package/dist/cjs/q2-carousel-pane.cjs.entry.js +1 -1
  8. package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
  9. package/dist/cjs/q2-checkbox-group.cjs.entry.js +2 -2
  10. package/dist/cjs/q2-checkbox.cjs.entry.js +1 -1
  11. package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
  12. package/dist/cjs/q2-dropdown.cjs.entry.js +2 -2
  13. package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
  14. package/dist/cjs/q2-icon.cjs.entry.js +23 -10
  15. package/dist/cjs/q2-input.cjs.entry.js +18 -5
  16. package/dist/cjs/q2-loc.cjs.entry.js +1 -1
  17. package/dist/cjs/q2-optgroup.cjs.entry.js +1 -1
  18. package/dist/cjs/q2-option.cjs.entry.js +43 -5
  19. package/dist/cjs/q2-radio-group.cjs.entry.js +1 -1
  20. package/dist/cjs/q2-radio.cjs.entry.js +1 -1
  21. package/dist/cjs/q2-section.cjs.entry.js +1 -1
  22. package/dist/cjs/q2-select.cjs.entry.js +104 -62
  23. package/dist/cjs/q2-stepper-pane.cjs.entry.js +27 -0
  24. package/dist/cjs/q2-stepper.cjs.entry.js +187 -0
  25. package/dist/cjs/q2-tab-container.cjs.entry.js +12 -464
  26. package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
  27. package/dist/cjs/q2-textarea.cjs.entry.js +1 -1
  28. package/dist/collection/collection-manifest.json +2 -0
  29. package/dist/collection/components/q2-btn/index.js +6 -5
  30. package/dist/collection/components/q2-calendar/styles.css +18 -0
  31. package/dist/collection/components/q2-checkbox-group/styles.css +12 -2
  32. package/dist/collection/components/q2-dropdown/styles.css +18 -0
  33. package/dist/collection/components/q2-icon/icons.js +22 -22
  34. package/dist/collection/components/q2-icon/index.js +41 -9
  35. package/dist/collection/components/q2-icon/styles.css +57 -50
  36. package/dist/collection/components/q2-input/formatting/phone.js +8 -0
  37. package/dist/collection/components/q2-input/index.js +8 -3
  38. package/dist/collection/components/q2-input/styles.css +20 -125
  39. package/dist/collection/components/q2-option/index.js +104 -8
  40. package/dist/collection/components/q2-option/styles.css +31 -37
  41. package/dist/collection/components/q2-select/index.js +106 -62
  42. package/dist/collection/components/q2-select/styles.css +18 -0
  43. package/dist/collection/components/q2-stepper/index.js +283 -0
  44. package/dist/collection/components/q2-stepper/styles.css +253 -0
  45. package/dist/collection/components/q2-stepper-pane/index.js +76 -0
  46. package/dist/collection/components/q2-stepper-pane/styles.css +70 -0
  47. package/dist/collection/components/q2-tab-container/index.js +2 -9
  48. package/dist/collection/utils/index.js +23 -2
  49. package/dist/esm/{icons-5506a72c.js → icons-17612675.js} +22 -22
  50. package/dist/esm/index-da24669a.js +548 -0
  51. package/dist/esm/loader.js +1 -1
  52. package/dist/esm/q2-avatar.entry.js +1 -1
  53. package/dist/esm/q2-btn_2.entry.js +7 -6
  54. package/dist/esm/q2-calendar.entry.js +2 -2
  55. package/dist/esm/q2-carousel-pane.entry.js +1 -1
  56. package/dist/esm/q2-carousel.entry.js +1 -1
  57. package/dist/esm/q2-checkbox-group.entry.js +2 -2
  58. package/dist/esm/q2-checkbox.entry.js +1 -1
  59. package/dist/esm/q2-dropdown-item.entry.js +1 -1
  60. package/dist/esm/q2-dropdown.entry.js +2 -2
  61. package/dist/esm/q2-editable-field.entry.js +1 -1
  62. package/dist/esm/q2-icon.entry.js +23 -10
  63. package/dist/esm/q2-input.entry.js +18 -5
  64. package/dist/esm/q2-loc.entry.js +1 -1
  65. package/dist/esm/q2-optgroup.entry.js +1 -1
  66. package/dist/esm/q2-option.entry.js +44 -6
  67. package/dist/esm/q2-radio-group.entry.js +1 -1
  68. package/dist/esm/q2-radio.entry.js +1 -1
  69. package/dist/esm/q2-section.entry.js +1 -1
  70. package/dist/esm/q2-select.entry.js +104 -62
  71. package/dist/esm/q2-stepper-pane.entry.js +23 -0
  72. package/dist/esm/q2-stepper.entry.js +183 -0
  73. package/dist/esm/q2-tab-container.entry.js +2 -454
  74. package/dist/esm/q2-tecton-elements.js +1 -1
  75. package/dist/esm/q2-textarea.entry.js +1 -1
  76. package/dist/q2-tecton-elements/{p-f1ec7948.entry.js → p-2a28baa9.entry.js} +1 -1
  77. package/dist/q2-tecton-elements/p-2c2a5d58.entry.js +1 -0
  78. package/dist/q2-tecton-elements/{p-93799868.entry.js → p-2f2bbed9.entry.js} +3 -3
  79. package/dist/q2-tecton-elements/p-37d281b7.entry.js +1 -0
  80. package/dist/q2-tecton-elements/{p-dfe693e9.entry.js → p-3f2590c0.entry.js} +1 -1
  81. package/dist/q2-tecton-elements/p-4d283b84.entry.js +1 -0
  82. package/dist/q2-tecton-elements/p-5289f040.entry.js +1 -0
  83. package/dist/q2-tecton-elements/{p-f6d2fa2f.entry.js → p-576509e6.entry.js} +1 -1
  84. package/dist/q2-tecton-elements/{p-c6d4933e.entry.js → p-64eef8d1.entry.js} +1 -1
  85. package/dist/q2-tecton-elements/{p-89ae4f7b.entry.js → p-65894494.entry.js} +1 -1
  86. package/dist/q2-tecton-elements/p-6ed006a7.entry.js +1 -0
  87. package/dist/q2-tecton-elements/p-6f570344.js +1 -0
  88. package/dist/q2-tecton-elements/{p-0c23d50a.entry.js → p-7520656d.entry.js} +1 -1
  89. package/dist/q2-tecton-elements/p-792d1170.entry.js +1 -0
  90. package/dist/q2-tecton-elements/{p-ccb8126f.entry.js → p-82b24667.entry.js} +1 -1
  91. package/dist/q2-tecton-elements/{p-ec245511.entry.js → p-86116f5c.entry.js} +1 -1
  92. package/dist/q2-tecton-elements/{p-ed433950.entry.js → p-891ca6f8.entry.js} +1 -1
  93. package/dist/q2-tecton-elements/p-8b4f6d3f.entry.js +1 -0
  94. package/dist/q2-tecton-elements/{p-0e9e5b53.entry.js → p-9b420e22.entry.js} +1 -1
  95. package/dist/q2-tecton-elements/p-aaa55918.js +1 -0
  96. package/dist/q2-tecton-elements/{p-915ce8d8.entry.js → p-c14e0622.entry.js} +1 -1
  97. package/dist/q2-tecton-elements/p-c92e3bc2.entry.js +1 -0
  98. package/dist/q2-tecton-elements/{p-7a952b02.entry.js → p-d0d605dc.entry.js} +1 -1
  99. package/dist/q2-tecton-elements/p-e3a27b97.entry.js +1 -0
  100. package/dist/q2-tecton-elements/{p-72f9686c.entry.js → p-ebee91e2.entry.js} +1 -1
  101. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  102. package/dist/types/components/q2-icon/index.d.ts +1 -0
  103. package/dist/types/components/q2-input/formatting/phone.d.ts +8 -0
  104. package/dist/types/components/q2-option/index.d.ts +9 -2
  105. package/dist/types/components/q2-select/index.d.ts +4 -1
  106. package/dist/types/components/q2-stepper/index.d.ts +33 -0
  107. package/dist/types/components/q2-stepper-pane/index.d.ts +9 -0
  108. package/dist/types/components.d.ts +46 -0
  109. package/dist/types/global.d.ts +1 -0
  110. package/dist/types/utils/index.d.ts +5 -2
  111. package/dist/types/workspace/workspace/{_tecton-production_release_1.9.x → Tecton_tecton-production_master}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +0 -0
  112. package/package.json +2 -2
  113. package/dist/cjs/index-2dcb1a72.js +0 -99
  114. package/dist/esm/index-f3de8cee.js +0 -91
  115. package/dist/q2-tecton-elements/p-031a8f06.js +0 -1
  116. package/dist/q2-tecton-elements/p-044827e2.entry.js +0 -1
  117. package/dist/q2-tecton-elements/p-0feefe56.js +0 -1
  118. package/dist/q2-tecton-elements/p-1022a1c6.entry.js +0 -1
  119. package/dist/q2-tecton-elements/p-12f6dc10.entry.js +0 -1
  120. package/dist/q2-tecton-elements/p-5da60194.entry.js +0 -1
  121. package/dist/q2-tecton-elements/p-b0cb8867.entry.js +0 -1
  122. package/dist/q2-tecton-elements/p-d93abdce.entry.js +0 -1
  123. package/dist/q2-tecton-elements/p-e5e8eac3.entry.js +0 -1
@@ -0,0 +1,253 @@
1
+ * {
2
+ box-sizing: border-box;
3
+ }
4
+
5
+ *:active {
6
+ outline: none;
7
+ }
8
+
9
+ *:focus {
10
+ outline: none;
11
+ box-shadow: var(--const-global-focus);
12
+ }
13
+
14
+ :host {
15
+ box-shadow: none !important;
16
+ }
17
+
18
+ ::-moz-focus-inner {
19
+ border: none;
20
+ }
21
+
22
+ input,
23
+ textarea,
24
+ button {
25
+ font-family: inherit;
26
+ font-size: inherit;
27
+ }
28
+
29
+ :host(.sr),
30
+ :host(.sr) button {
31
+ border: 0;
32
+ clip: rect(0 0 0 0);
33
+ height: 1px;
34
+ margin: -1px;
35
+ overflow: hidden;
36
+ padding: 0;
37
+ position: absolute;
38
+ width: 1px;
39
+ white-space: nowrap;
40
+ }
41
+
42
+ .sr,
43
+ .sr button {
44
+ border: 0;
45
+ clip: rect(0 0 0 0);
46
+ height: 1px;
47
+ margin: -1px;
48
+ overflow: hidden;
49
+ padding: 0;
50
+ position: absolute;
51
+ width: 1px;
52
+ white-space: nowrap;
53
+ }
54
+
55
+ .hidden {
56
+ display: none;
57
+ }
58
+
59
+ :host([hidden]) {
60
+ display: none;
61
+ }
62
+
63
+ .invisible {
64
+ visibility: hidden;
65
+ }
66
+
67
+ :host {
68
+ display: block;
69
+ position: relative;
70
+ }
71
+
72
+ ul {
73
+ --comp-bullet-bg: var(--tct-stepper-bullet-active-bg, var(--t-stepper-bullet-active-bg, var(--t-primary, #0079c1)));
74
+ --comp-bullet-font-color: var(--tct-stepper-bullet-active-font-color, var(--t-stepper-bullet-active-font-color, var(--t-primary-font-color, #ffffff)));
75
+ --comp-bullet-size: var(--tct-stepper-bullet-size, var(--t-stepper-bullet-size, 18px));
76
+ --comp-bullet-gap: var(--tct-stepper-bullet-padding, var(--t-stepper-bullet-padding, var(--app-scale-2x, 10px)));
77
+ --comp-bullet-border-offset: var(--tct-stepper-bullet-border-offset, var(--t-stepper-bullet-border-offset, 4px));
78
+ --comp-bullet-border: var(--tct-stepper-bullet-border, var(--t-stepper-bullet-border, 2px solid var(--t-primary-l3)));
79
+ --comp-bullet-font-size: var(--tct-stepper-bullet-font-size, var(--t-stepper-bullet-font-size, var(--app-font-size-small, 12px)));
80
+ --comp-step-width: var(--tct-stepper-step-width, var(--t-stepper-step-width, var(--t-stepper-step-width, 80px)));
81
+ --comp-step-gap: var(--tct-stepper-step-gap, var(--t-stepper-step-gap, 5px));
82
+ --comp-tween: var(--tct-stepper-tween, var(--t-stepper-tween, var(--app-tween-1, 0.2s ease)));
83
+ overflow-x: auto;
84
+ display: flex;
85
+ justify-content: center;
86
+ list-style: none;
87
+ padding: 0;
88
+ padding: var(--tct-stepper-list-padding, var(--t-stepper-list-padding, 2px));
89
+ margin: 0;
90
+ gap: var(--comp-step-gap);
91
+ --comp-scrollbar-size: var(--tct-scrollbar-size, var(--app-scale-1x, 5px));
92
+ --comp-scrollbar-border-radius: var(--tct-scrollbar-border-radius, var(--app-border-radius-1, 3px));
93
+ --comp-scrollbar-color: var(--tct-scrollbar-color, var(--t-a11y-gray-color, #747474));
94
+ scrollbar-width: thin;
95
+ scrollbar-color: var(--comp-scrollbar-color) transparent;
96
+ }
97
+ ul::-webkit-scrollbar {
98
+ width: var(--comp-scrollbar-size);
99
+ height: var(--comp-scrollbar-size);
100
+ margin: 5px;
101
+ }
102
+ ul::-webkit-scrollbar-thumb {
103
+ background: var(--comp-scrollbar-color);
104
+ border-radius: var(--comp-scrollbar-border-radius);
105
+ }
106
+ ul::-webkit-scrollbar-track {
107
+ background: transparent;
108
+ border-radius: var(--comp-scrollbar-border-radius);
109
+ }
110
+ .has-scroll ul {
111
+ justify-content: unset;
112
+ }
113
+
114
+ li {
115
+ min-height: var(--tct-stepper-min-height, var(--t-stepper-min-height, 50px));
116
+ flex: 0 0 auto;
117
+ position: relative;
118
+ width: var(--comp-step-width);
119
+ text-align: center;
120
+ max-width: 150px;
121
+ min-width: 80px;
122
+ }
123
+
124
+ .step-btn {
125
+ position: relative;
126
+ background: transparent;
127
+ border: 0;
128
+ cursor: pointer;
129
+ display: flex;
130
+ flex-direction: column;
131
+ align-items: center;
132
+ height: calc(100% - 4px);
133
+ width: 100%;
134
+ transition: var(--comp-tween);
135
+ padding: 0;
136
+ transition-property: box-shadow;
137
+ outline: none;
138
+ }
139
+ .step-btn[aria-disabled] {
140
+ cursor: default;
141
+ }
142
+ .step-btn[aria-disabled], .step-btn[aria-disabled] + hr {
143
+ --comp-bullet-font-color: var(--tct-stepper-bullet-inactive-font-color, var(--t-stepper-bullet-inactive-font-color, var(--t-text, #4d4d4d)));
144
+ --comp-bullet-bg: var(--tct-stepper-bullet-inactive-bg, var(--t-stepper-bullet-inactive-bg, var(--t-gray12, #d9d9d9)));
145
+ }
146
+
147
+ .step-bubble {
148
+ margin: var(--comp-bullet-gap) auto;
149
+ background: var(--comp-bullet-bg);
150
+ color: var(--comp-bullet-font-color);
151
+ width: var(--comp-bullet-size);
152
+ height: var(--comp-bullet-size);
153
+ min-height: var(--comp-bullet-size);
154
+ font-size: var(--comp-bullet-font-size);
155
+ transition: var(--comp-tween);
156
+ transition-property: background, color;
157
+ border-radius: 50%;
158
+ position: relative;
159
+ }
160
+ [aria-selected] .step-bubble {
161
+ font-weight: var(--tct-stepper-bullet-active-font-weight, var(--t-stepper-bullet-active-font-weight, 600));
162
+ }
163
+ [aria-selected] .step-bubble:before {
164
+ content: "";
165
+ position: absolute;
166
+ inset: calc(var(--comp-bullet-border-offset) * -1);
167
+ width: calc(var(--comp-bullet-size) + var(--comp-bullet-border-offset));
168
+ height: calc(var(--comp-bullet-size) + var(--comp-bullet-border-offset));
169
+ border-radius: 50%;
170
+ border: var(--comp-bullet-border);
171
+ }
172
+
173
+ hr {
174
+ width: calc( var(--comp-step-width) - var(--comp-step-gap) - var(--comp-bullet-gap) - var(--comp-bullet-size) );
175
+ top: calc(calc(var(--comp-bullet-size) / 2) + var(--comp-bullet-gap));
176
+ left: calc(calc(var(--comp-step-width) * -0.5) + var(--comp-step-gap) + var(--comp-bullet-gap));
177
+ border: 0;
178
+ border-top: 1px solid var(--comp-bullet-bg);
179
+ height: 0;
180
+ position: absolute;
181
+ margin: 0;
182
+ transition: border var(--comp-tween);
183
+ }
184
+
185
+ .step-container {
186
+ position: relative;
187
+ }
188
+
189
+ .step-label {
190
+ color: var(--tct-stepper-title-color, var(--t-stepper-title-color, var(--t-text, #4d4d4d)));
191
+ font-size: var(--tct-stepper-title-font-size, var(--t-stepper-title-font-size, var(--app-font-size-small, 12px)));
192
+ height: 1.5em;
193
+ display: -webkit-box;
194
+ -webkit-line-clamp: 2;
195
+ -webkit-box-orient: vertical;
196
+ overflow: hidden;
197
+ text-overflow: ellipsis;
198
+ }
199
+ [aria-selected] .step-label {
200
+ font-weight: var(--tct-stepper-active-font-weight, var(--t-stepper-active-font-weight, 600));
201
+ }
202
+ [aria-describedby] .step-label {
203
+ -webkit-line-clamp: 1;
204
+ }
205
+
206
+ .step-description {
207
+ color: var(--tct-stepper-description-color, var(--t-stepper-description-color, var(--t-textA, rgba(77, 77, 77, 0.77))));
208
+ font-size: var(--tct-stepper-description-font-size, var(--t-stepper-description-font-size, var(--app-font-size-small, 12px)));
209
+ display: -webkit-box;
210
+ -webkit-line-clamp: 4;
211
+ -webkit-box-orient: vertical;
212
+ overflow: hidden;
213
+ text-overflow: ellipsis;
214
+ padding-bottom: 0.2em;
215
+ }
216
+
217
+ .gradient-left,
218
+ .gradient-right {
219
+ z-index: 1;
220
+ position: absolute;
221
+ top: 0;
222
+ height: 100%;
223
+ width: 18px;
224
+ }
225
+
226
+ .gradient-left {
227
+ background-image: linear-gradient(to right, var(--t-base), var(--t-base-a0));
228
+ left: 0;
229
+ }
230
+
231
+ .gradient-right {
232
+ background-image: linear-gradient(to right, var(--t-base-a0), var(--t-base));
233
+ right: 0;
234
+ }
235
+
236
+ .btn-left,
237
+ .btn-right {
238
+ --tct-icon-size: 18px;
239
+ --tct-btn-icon-hover-bg: transparent;
240
+ --tct-btn-icon-width: 22px;
241
+ --tct-icon-stroke-primary: var(--tct-stepper-scroll-arrow-color, var(--t-stepper-scroll-arrow-color, var(--t-text, #4d4d4d)));
242
+ position: absolute;
243
+ top: calc(50% - 22px);
244
+ z-index: 2;
245
+ }
246
+
247
+ .btn-left {
248
+ left: 0;
249
+ }
250
+
251
+ .btn-right {
252
+ right: 0;
253
+ }
@@ -0,0 +1,76 @@
1
+ import { Component, Prop, h, Element } from '@stencil/core';
2
+ import { createGuid, loc } from 'src/utils';
3
+ export class Q2StepperPane {
4
+ ////////// LIFECYCLE HOOKS ////////
5
+ connectedCallback() {
6
+ if (!this.hostElement.id)
7
+ this.hostElement.id = `step-${createGuid()}`;
8
+ }
9
+ render() {
10
+ const { label, description, isActive } = this;
11
+ return (h("div", { role: "tabpanel", "aria-label": label && loc(label), "aria-description": description && loc(description), tabindex: "0", hidden: !isActive },
12
+ h("slot", null)));
13
+ }
14
+ static get is() { return "q2-stepper-pane"; }
15
+ static get encapsulation() { return "shadow"; }
16
+ static get originalStyleUrls() { return {
17
+ "$": ["styles.scss"]
18
+ }; }
19
+ static get styleUrls() { return {
20
+ "$": ["styles.css"]
21
+ }; }
22
+ static get properties() { return {
23
+ "label": {
24
+ "type": "string",
25
+ "mutable": false,
26
+ "complexType": {
27
+ "original": "string",
28
+ "resolved": "string",
29
+ "references": {}
30
+ },
31
+ "required": false,
32
+ "optional": false,
33
+ "docs": {
34
+ "tags": [],
35
+ "text": ""
36
+ },
37
+ "attribute": "label",
38
+ "reflect": true
39
+ },
40
+ "description": {
41
+ "type": "string",
42
+ "mutable": false,
43
+ "complexType": {
44
+ "original": "string",
45
+ "resolved": "string",
46
+ "references": {}
47
+ },
48
+ "required": false,
49
+ "optional": false,
50
+ "docs": {
51
+ "tags": [],
52
+ "text": ""
53
+ },
54
+ "attribute": "description",
55
+ "reflect": true
56
+ },
57
+ "isActive": {
58
+ "type": "boolean",
59
+ "mutable": false,
60
+ "complexType": {
61
+ "original": "boolean",
62
+ "resolved": "boolean",
63
+ "references": {}
64
+ },
65
+ "required": false,
66
+ "optional": false,
67
+ "docs": {
68
+ "tags": [],
69
+ "text": ""
70
+ },
71
+ "attribute": "is-active",
72
+ "reflect": true
73
+ }
74
+ }; }
75
+ static get elementRef() { return "hostElement"; }
76
+ }
@@ -0,0 +1,70 @@
1
+ * {
2
+ box-sizing: border-box;
3
+ }
4
+
5
+ *:active {
6
+ outline: none;
7
+ }
8
+
9
+ *:focus {
10
+ outline: none;
11
+ box-shadow: var(--const-global-focus);
12
+ }
13
+
14
+ :host {
15
+ box-shadow: none !important;
16
+ }
17
+
18
+ ::-moz-focus-inner {
19
+ border: none;
20
+ }
21
+
22
+ input,
23
+ textarea,
24
+ button {
25
+ font-family: inherit;
26
+ font-size: inherit;
27
+ }
28
+
29
+ :host(.sr),
30
+ :host(.sr) button {
31
+ border: 0;
32
+ clip: rect(0 0 0 0);
33
+ height: 1px;
34
+ margin: -1px;
35
+ overflow: hidden;
36
+ padding: 0;
37
+ position: absolute;
38
+ width: 1px;
39
+ white-space: nowrap;
40
+ }
41
+
42
+ .sr,
43
+ .sr button {
44
+ border: 0;
45
+ clip: rect(0 0 0 0);
46
+ height: 1px;
47
+ margin: -1px;
48
+ overflow: hidden;
49
+ padding: 0;
50
+ position: absolute;
51
+ width: 1px;
52
+ white-space: nowrap;
53
+ }
54
+
55
+ .hidden {
56
+ display: none;
57
+ }
58
+
59
+ :host([hidden]) {
60
+ display: none;
61
+ }
62
+
63
+ .invisible {
64
+ visibility: hidden;
65
+ }
66
+
67
+ :host {
68
+ display: block;
69
+ position: relative;
70
+ }
@@ -1,15 +1,8 @@
1
1
  import { Component, Prop, Element, Event, State, Listen, Watch, h } from '@stencil/core';
2
- import { createGuid, loc } from 'src/utils';
3
- import smoothscroll from 'smoothscroll-polyfill';
4
- // enable scroll animation polyfill only on safari
2
+ import { createGuid, loc, addSmoothScrollPolyfill } from 'src/utils';
3
+ addSmoothScrollPolyfill();
5
4
  const userAgent = navigator.userAgent.toLowerCase();
6
- const isSafari = userAgent.includes('safari') && !userAgent.includes('chrome');
7
5
  const isFirefox = userAgent.includes('firefox');
8
- if (isSafari) {
9
- // smooth scroll is not supported on safari
10
- smoothscroll.polyfill();
11
- window['__forceSmoothScrollPolyfill__'] = true;
12
- }
13
6
  export class Q2TabContainer {
14
7
  constructor() {
15
8
  this.noPrint = false;
@@ -1,8 +1,26 @@
1
1
  import { h } from '@stencil/core';
2
+ import smoothscroll from 'smoothscroll-polyfill';
3
+ export function addSmoothScrollPolyfill() {
4
+ const userAgent = navigator.userAgent.toLowerCase();
5
+ const isSafari = userAgent.includes('safari') && !userAgent.includes('chrome');
6
+ if (!isSafari)
7
+ return false;
8
+ smoothscroll.polyfill();
9
+ return (window['__forceSmoothScrollPolyfill__'] = true);
10
+ }
2
11
  let guid = 1000;
3
12
  export function createGuid() {
4
13
  return guid++;
5
14
  }
15
+ export function nextPaint(fn, execute) {
16
+ if (execute)
17
+ fn();
18
+ else
19
+ requestAnimationFrame(() => nextPaint(fn, true));
20
+ }
21
+ export function capitalize(value) {
22
+ return `${value.charAt(0).toUpperCase()}${value.slice(1)}`;
23
+ }
6
24
  export function pick(props) {
7
25
  return obj => {
8
26
  return props.reduce((memo, prop) => {
@@ -11,10 +29,13 @@ export function pick(props) {
11
29
  };
12
30
  }
13
31
  export function loc(key, subs) {
14
- var _a, _b;
32
+ var _a, _b, _c;
15
33
  if (!key)
16
34
  return '';
17
- return (_b = (_a = window === null || window === void 0 ? void 0 : window.TectonElements) === null || _a === void 0 ? void 0 : _a.loc(key, subs)) !== null && _b !== void 0 ? _b : key;
35
+ if (((_a = window.Tecton) === null || _a === void 0 ? void 0 : _a.noString) === true) {
36
+ return key;
37
+ }
38
+ return (_c = (_b = window === null || window === void 0 ? void 0 : window.TectonElements) === null || _b === void 0 ? void 0 : _b.loc(key, subs)) !== null && _c !== void 0 ? _c : key;
18
39
  }
19
40
  export function labelDOM(target) {
20
41
  const { label, hideLabel } = target;