q2-tecton-elements 1.12.1 → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/click-elsewhere.cjs.entry.js +5 -7
- package/dist/cjs/{icons-9bd0febe.js → icons-08ffe5c9.js} +386 -386
- package/dist/cjs/{index-c2e53804.js → index-7febb200.js} +112 -65
- package/dist/cjs/{index-773c3eec.js → index-dd823ee6.js} +2 -2
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/q2-avatar.cjs.entry.js +2 -2
- package/dist/cjs/q2-badge.cjs.entry.js +43 -0
- package/dist/cjs/q2-btn_2.cjs.entry.js +13 -13
- package/dist/cjs/q2-calendar.cjs.entry.js +42 -59
- package/dist/cjs/q2-card.cjs.entry.js +43 -5
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +5 -5
- package/dist/cjs/q2-carousel.cjs.entry.js +318 -106
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +3 -3
- package/dist/cjs/q2-checkbox.cjs.entry.js +8 -11
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +7 -7
- package/dist/cjs/q2-dropdown.cjs.entry.js +9 -18
- package/dist/cjs/q2-editable-field.cjs.entry.js +5 -8
- package/dist/cjs/q2-icon.cjs.entry.js +3 -3
- package/dist/cjs/q2-input.cjs.entry.js +431 -434
- package/dist/cjs/q2-loading-element.cjs.entry.js +3 -3
- package/dist/cjs/q2-loc.cjs.entry.js +2 -2
- package/dist/cjs/q2-message.cjs.entry.js +5 -5
- package/dist/cjs/q2-optgroup.cjs.entry.js +3 -3
- package/dist/cjs/q2-option-list.cjs.entry.js +5 -3
- package/dist/cjs/q2-option.cjs.entry.js +1 -1
- package/dist/cjs/q2-pagination.cjs.entry.js +6 -8
- package/dist/cjs/q2-pill.cjs.entry.js +9 -9
- package/dist/cjs/q2-radio-group.cjs.entry.js +4 -7
- package/dist/cjs/q2-radio.cjs.entry.js +2 -2
- package/dist/cjs/q2-section.cjs.entry.js +5 -7
- package/dist/cjs/q2-select.cjs.entry.js +17 -29
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +42 -4
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js +278 -0
- package/dist/cjs/q2-stepper.cjs.entry.js +10 -12
- package/dist/cjs/q2-tab-container.cjs.entry.js +8 -8
- package/dist/cjs/q2-tab-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-tag.cjs.entry.js +4 -4
- package/dist/cjs/q2-tecton-elements.cjs.js +3 -3
- package/dist/cjs/q2-textarea.cjs.entry.js +8 -8
- package/dist/cjs/{shapes-086c0365.js → shapes-305746b5.js} +9 -16
- package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -5
- package/dist/collection/collection-manifest.json +5 -3
- package/dist/collection/components/click-elsewhere/index.js +4 -6
- package/dist/collection/components/q2-badge/index.js +148 -0
- package/dist/collection/components/q2-badge/styles.css +134 -0
- package/dist/collection/components/q2-btn/index.js +14 -14
- package/dist/collection/components/q2-calendar/helpers.js +16 -20
- package/dist/collection/components/q2-calendar/index.js +21 -36
- package/dist/collection/components/q2-calendar/styles.css +1 -1
- package/dist/collection/components/q2-calendar/validation.js +4 -2
- package/dist/collection/components/q2-card/index.js +59 -2
- package/dist/collection/components/q2-card/styles.css +17 -1
- package/dist/collection/components/q2-carousel/index.js +11 -16
- package/dist/collection/components/q2-carousel/styles.css +3 -3
- package/dist/collection/components/q2-carousel-pane/index.js +2 -2
- package/dist/collection/components/q2-carousel-pane/styles.css +8 -3
- package/dist/collection/components/q2-checkbox/index.js +8 -11
- package/dist/collection/components/q2-checkbox/styles.css +1 -1
- package/dist/collection/components/q2-checkbox-group/index.js +1 -1
- package/dist/collection/components/q2-dropdown/index.js +6 -15
- package/dist/collection/components/q2-dropdown/styles.css +3 -3
- package/dist/collection/components/q2-dropdown-item/index.js +5 -5
- package/dist/collection/components/q2-editable-field/index.js +3 -6
- package/dist/collection/components/q2-icon/icons.js +385 -385
- package/dist/collection/components/q2-input/formatting/credit-card.js +15 -13
- package/dist/collection/components/q2-input/formatting/currency.js +162 -162
- package/dist/collection/components/q2-input/formatting/date.js +1 -1
- package/dist/collection/components/q2-input/formatting/generic.js +7 -8
- package/dist/collection/components/q2-input/formatting/number.js +6 -9
- package/dist/collection/components/q2-input/formatting/numeric.js +5 -5
- package/dist/collection/components/q2-input/formatting/phone.js +215 -215
- package/dist/collection/components/q2-input/formatting/postal.js +1 -1
- package/dist/collection/components/q2-input/index.js +20 -21
- package/dist/collection/components/q2-input/styles.css +19 -6
- package/dist/collection/components/q2-loading/index.js +4 -4
- package/dist/collection/components/q2-loading/skeleton/q2-loading-element/index.js +1 -1
- package/dist/collection/components/q2-loading/skeleton/shapes.js +8 -15
- package/dist/collection/components/q2-loading/styles.css +1 -1
- package/dist/collection/components/q2-message/index.js +3 -3
- package/dist/collection/components/q2-optgroup/index.js +1 -1
- package/dist/collection/components/q2-option-list/index.js +4 -2
- package/dist/collection/components/q2-pagination/index.js +4 -6
- package/dist/collection/components/q2-pill/index.js +8 -8
- package/dist/collection/components/q2-pill/styles.css +3 -1
- package/dist/collection/components/q2-radio-group/index.js +3 -6
- package/dist/collection/components/q2-section/index.js +5 -7
- package/dist/collection/components/q2-select/index.js +15 -27
- package/dist/collection/components/q2-select/styles.css +4 -4
- package/dist/collection/components/q2-stepper/index.js +8 -10
- package/dist/collection/components/q2-stepper/styles.css +3 -3
- package/dist/collection/components/q2-stepper-pane/index.js +133 -5
- package/dist/collection/components/q2-stepper-vertical/index.js +346 -0
- package/dist/collection/components/q2-stepper-vertical/styles.css +273 -0
- package/dist/collection/components/q2-tab-container/index.js +7 -7
- package/dist/collection/components/q2-tag/index.js +3 -3
- package/dist/collection/components/q2-textarea/index.js +6 -6
- package/dist/collection/components/tecton-tab-pane/index.js +3 -10
- package/dist/collection/utils/index.js +1 -1
- package/dist/esm/click-elsewhere.entry.js +5 -7
- package/dist/esm/{icons-6a143c2f.js → icons-b1e11526.js} +386 -386
- package/dist/esm/{index-fa32f694.js → index-0ff8de52.js} +2 -2
- package/dist/esm/{index-be8376c0.js → index-dbfb3ecc.js} +112 -65
- package/dist/esm/loader.js +3 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/q2-avatar.entry.js +2 -2
- package/dist/esm/q2-badge.entry.js +39 -0
- package/dist/esm/q2-btn_2.entry.js +13 -13
- package/dist/esm/q2-calendar.entry.js +42 -59
- package/dist/esm/q2-card.entry.js +43 -5
- package/dist/esm/q2-carousel-pane.entry.js +5 -5
- package/dist/esm/q2-carousel.entry.js +318 -106
- package/dist/esm/q2-checkbox-group.entry.js +3 -3
- package/dist/esm/q2-checkbox.entry.js +8 -11
- package/dist/esm/q2-dropdown-item.entry.js +7 -7
- package/dist/esm/q2-dropdown.entry.js +9 -18
- package/dist/esm/q2-editable-field.entry.js +5 -8
- package/dist/esm/q2-icon.entry.js +3 -3
- package/dist/esm/q2-input.entry.js +431 -434
- package/dist/esm/q2-loading-element.entry.js +3 -3
- package/dist/esm/q2-loc.entry.js +2 -2
- package/dist/esm/q2-message.entry.js +5 -5
- package/dist/esm/q2-optgroup.entry.js +3 -3
- package/dist/esm/q2-option-list.entry.js +5 -3
- package/dist/esm/q2-option.entry.js +1 -1
- package/dist/esm/q2-pagination.entry.js +6 -8
- package/dist/esm/q2-pill.entry.js +9 -9
- package/dist/esm/q2-radio-group.entry.js +4 -7
- package/dist/esm/q2-radio.entry.js +2 -2
- package/dist/esm/q2-section.entry.js +5 -7
- package/dist/esm/q2-select.entry.js +17 -29
- package/dist/esm/q2-stepper-pane.entry.js +42 -4
- package/dist/esm/q2-stepper-vertical.entry.js +274 -0
- package/dist/esm/q2-stepper.entry.js +10 -12
- package/dist/esm/q2-tab-container.entry.js +8 -8
- package/dist/esm/q2-tab-pane.entry.js +1 -1
- package/dist/esm/q2-tag.entry.js +4 -4
- package/dist/esm/q2-tecton-elements.js +3 -3
- package/dist/esm/q2-textarea.entry.js +8 -8
- package/dist/esm/{shapes-81c11dfe.js → shapes-cff4e1f0.js} +9 -16
- package/dist/esm/tecton-tab-pane.entry.js +2 -5
- package/dist/loader/index.d.ts +0 -1
- package/dist/q2-tecton-elements/{p-a0248299.entry.js → p-00e8f782.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-0900bec1.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-f98dc161.entry.js → p-10264ecb.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-0a7cff38.entry.js → p-1305ec5f.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-148391d6.entry.js +1 -0
- package/dist/q2-tecton-elements/p-1dfaee64.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-32ad664c.entry.js → p-221abbf6.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-c90a6016.js → p-255b2b4c.js} +1 -1
- package/dist/q2-tecton-elements/p-27736b6b.entry.js +1 -0
- package/dist/q2-tecton-elements/p-2846ab94.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-167a19fd.entry.js → p-2bc1de01.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-8ea2c4f7.entry.js → p-2c15414c.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-2caa89fd.js +1 -0
- package/dist/q2-tecton-elements/p-327cca41.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-54f0d64e.entry.js → p-3a420dbf.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-c460e5ed.entry.js → p-3a64e5ce.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-aca8302b.entry.js → p-3abcb09d.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-08668234.entry.js → p-3fe98e3e.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-c5199147.entry.js → p-430a979b.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-fa9e3825.entry.js → p-45eb7739.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-750bcd33.entry.js → p-49b2abc4.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-d9bc6494.entry.js → p-4ab30466.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-5bbf2bfe.entry.js +1 -0
- package/dist/q2-tecton-elements/p-6fec9235.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-3c6f73cb.js → p-824aebd9.js} +1 -1
- package/dist/q2-tecton-elements/{p-91dba21f.entry.js → p-a4ae89cc.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-d3058002.entry.js → p-a5562aaa.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-5effd81a.entry.js → p-ae130f70.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-b2302cd3.entry.js +1 -0
- package/dist/q2-tecton-elements/p-c20cbb2d.entry.js +1 -0
- package/dist/q2-tecton-elements/p-ca7a3380.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-9a3c37ab.entry.js → p-d33e152c.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-9024859f.entry.js → p-d5218cd6.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-54300d2f.entry.js → p-d52b435e.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-c3d68d5c.js → p-dd02cf8d.js} +1 -1
- package/dist/q2-tecton-elements/{p-30bf5f44.entry.js → p-e0e7ae8b.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-ede12fc1.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-af202624.entry.js → p-fdfbe75b.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-ffbded54.entry.js +1 -0
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/test/elements/q2-tag-test.js +6 -6
- package/dist/test/helpers.js +7 -7
- package/dist/types/components/q2-badge/index.d.ts +13 -0
- package/dist/types/components/q2-btn/index.d.ts +3 -3
- package/dist/types/components/q2-calendar/index.d.ts +1 -1
- package/dist/types/components/q2-calendar/validation.d.ts +1 -1
- package/dist/types/components/q2-card/index.d.ts +4 -0
- package/dist/types/components/q2-dropdown/index.d.ts +1 -1
- package/dist/types/components/q2-editable-field/index.d.ts +1 -1
- package/dist/types/components/q2-input/formatting/credit-card.d.ts +1 -3
- package/dist/types/components/q2-input/index.d.ts +2 -2
- package/dist/types/components/q2-option-list/index.d.ts +1 -1
- package/dist/types/components/q2-pill/index.d.ts +1 -1
- package/dist/types/components/q2-select/index.d.ts +1 -1
- package/dist/types/components/q2-stepper/index.d.ts +1 -1
- package/dist/types/components/q2-stepper-pane/index.d.ts +16 -1
- package/dist/types/components/q2-stepper-vertical/index.d.ts +52 -0
- package/dist/types/components/q2-tab-container/index.d.ts +1 -1
- package/dist/types/components/tecton-tab-pane/index.d.ts +2 -2
- package/dist/types/components.d.ts +63 -13
- package/dist/types/global.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +6 -4
- package/dist/types/util.d.ts +2 -10
- package/dist/types/workspace/workspace/{tecton-production_release_1.12.x → tecton-production_release_1.13.x}/packages/q2-tecton-elements/.stencil/test/elements/q2-tag-test.d.ts +0 -0
- package/dist/types/workspace/workspace/{tecton-production_release_1.12.x → tecton-production_release_1.13.x}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +2 -2
- package/package.json +13 -13
- package/dist/q2-tecton-elements/p-080839ed.js +0 -1
- package/dist/q2-tecton-elements/p-2afdc922.entry.js +0 -1
- package/dist/q2-tecton-elements/p-34415315.entry.js +0 -1
- package/dist/q2-tecton-elements/p-5b906cf1.entry.js +0 -1
- package/dist/q2-tecton-elements/p-7ce98c1a.entry.js +0 -1
- package/dist/q2-tecton-elements/p-b9c2c1d3.entry.js +0 -1
- package/dist/q2-tecton-elements/p-c5e6f7fa.entry.js +0 -1
- package/dist/q2-tecton-elements/p-d65aaed2.entry.js +0 -1
- package/dist/q2-tecton-elements/p-df86f160.entry.js +0 -1
- package/dist/q2-tecton-elements/p-e38080d2.entry.js +0 -1
- package/dist/q2-tecton-elements/p-e9d69ba8.entry.js +0 -1
- package/dist/q2-tecton-elements/p-fe6407a4.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Prop, Element, h, Listen, State, Event, Watch } from '@stencil/core';
|
|
1
|
+
import { Component, Prop, Element, h, Listen, State, Event, Watch, } from '@stencil/core';
|
|
2
2
|
import { createGuid, handleAriaLabel, isEventFromElement, loc, overrideFocus, setPopProperties } from 'src/utils';
|
|
3
3
|
export class Q2Select {
|
|
4
4
|
constructor() {
|
|
@@ -18,7 +18,7 @@ export class Q2Select {
|
|
|
18
18
|
this.scheduledAfterRender = [];
|
|
19
19
|
this.keyStore = {
|
|
20
20
|
queue: [],
|
|
21
|
-
lastPressedAt: new Date()
|
|
21
|
+
lastPressedAt: new Date(),
|
|
22
22
|
};
|
|
23
23
|
this.guid = createGuid();
|
|
24
24
|
this.onMutationObserved = () => {
|
|
@@ -63,9 +63,7 @@ export class Q2Select {
|
|
|
63
63
|
return list.find(v => {
|
|
64
64
|
return (!v.element.disabled &&
|
|
65
65
|
v.element.display &&
|
|
66
|
-
v.element.display
|
|
67
|
-
.replace(/\s/g, '')
|
|
68
|
-
.match(new RegExp(`^${this.keyStore.queue.join('')}`, 'i')));
|
|
66
|
+
v.element.display.replace(/\s/g, '').match(new RegExp(`^${this.keyStore.queue.join('')}`, 'i')));
|
|
69
67
|
});
|
|
70
68
|
};
|
|
71
69
|
const setFocus = ({ element, index }) => {
|
|
@@ -95,14 +93,13 @@ export class Q2Select {
|
|
|
95
93
|
return;
|
|
96
94
|
this.closeDropdown();
|
|
97
95
|
};
|
|
96
|
+
/* tslint:disable:cyclomatic-complexity */
|
|
98
97
|
this.dropdownKeydownHandler = (event) => {
|
|
99
98
|
event.stopPropagation();
|
|
100
99
|
const { activeIndex, searchable, optionElements, multiSelectHeader } = this;
|
|
101
100
|
const { key, shiftKey } = event;
|
|
102
101
|
if (this.readonly ||
|
|
103
|
-
(multiSelectHeader &&
|
|
104
|
-
multiSelectHeader.contains(event.target) &&
|
|
105
|
-
[' ', 'Enter'].includes(key)))
|
|
102
|
+
(multiSelectHeader && multiSelectHeader.contains(event.target) && [' ', 'Enter'].includes(key)))
|
|
106
103
|
return;
|
|
107
104
|
switch (key) {
|
|
108
105
|
case ' ':
|
|
@@ -284,9 +281,7 @@ export class Q2Select {
|
|
|
284
281
|
};
|
|
285
282
|
}
|
|
286
283
|
resizeIframe() {
|
|
287
|
-
return
|
|
288
|
-
window.TectonElements.resizeIframe &&
|
|
289
|
-
window.TectonElements.resizeIframe());
|
|
284
|
+
return window.TectonElements && window.TectonElements.resizeIframe && window.TectonElements.resizeIframe();
|
|
290
285
|
}
|
|
291
286
|
getDefaultActiveIndex() {
|
|
292
287
|
const firstSelected = this.optionElements.findIndex(element => element.selected);
|
|
@@ -347,9 +342,7 @@ export class Q2Select {
|
|
|
347
342
|
const selectedOption = this.optionElements.find(option => {
|
|
348
343
|
return this.value === option.value;
|
|
349
344
|
});
|
|
350
|
-
return (
|
|
351
|
-
this.value ||
|
|
352
|
-
'');
|
|
345
|
+
return (selectedOption && selectedOption.display && loc(selectedOption.display)) || this.value || '';
|
|
353
346
|
}
|
|
354
347
|
get minPopHeight() {
|
|
355
348
|
const { minRows } = this;
|
|
@@ -366,9 +359,7 @@ export class Q2Select {
|
|
|
366
359
|
// when closed they display the same as non searchable select (what is selected)
|
|
367
360
|
return this.searchText || '';
|
|
368
361
|
}
|
|
369
|
-
return this.multiple
|
|
370
|
-
? this.calculateMultiSelectSelectedDisplay()
|
|
371
|
-
: this.calculateSingleSelectSelectedDisplay();
|
|
362
|
+
return this.multiple ? this.calculateMultiSelectSelectedDisplay() : this.calculateSingleSelectSelectedDisplay();
|
|
372
363
|
}
|
|
373
364
|
get selectedOptionsCount() {
|
|
374
365
|
return this.selectedOptions.length;
|
|
@@ -406,7 +397,7 @@ export class Q2Select {
|
|
|
406
397
|
const isSelected = this.selectedOptions.includes(value);
|
|
407
398
|
if (isSelected) {
|
|
408
399
|
this.change.emit({
|
|
409
|
-
selectedOptions: this.selectedOptions.filter(selectedValue => selectedValue !== value)
|
|
400
|
+
selectedOptions: this.selectedOptions.filter(selectedValue => selectedValue !== value),
|
|
410
401
|
});
|
|
411
402
|
}
|
|
412
403
|
else {
|
|
@@ -566,14 +557,13 @@ export class Q2Select {
|
|
|
566
557
|
}
|
|
567
558
|
else {
|
|
568
559
|
const { display = '', innerText = '' } = option;
|
|
569
|
-
const matched = display.toLowerCase().includes(query) ||
|
|
570
|
-
innerText.toLowerCase().includes(query);
|
|
560
|
+
const matched = display.toLowerCase().includes(query) || innerText.toLowerCase().includes(query);
|
|
571
561
|
option.hidden = !matched;
|
|
572
562
|
if (matched)
|
|
573
563
|
matchedCount++;
|
|
574
564
|
}
|
|
575
565
|
});
|
|
576
|
-
|
|
566
|
+
const statusMessageLocString = query
|
|
577
567
|
? 'tecton.element.select.searchable.results'
|
|
578
568
|
: 'tecton.element.select.allOptions';
|
|
579
569
|
const count = query ? matchedCount : options.length;
|
|
@@ -594,12 +584,12 @@ export class Q2Select {
|
|
|
594
584
|
}
|
|
595
585
|
clickHandler(event) {
|
|
596
586
|
const selected = event.target.closest('q2-option');
|
|
597
|
-
if (!selected ||
|
|
598
|
-
(selected.hasAttribute('disabled') && selected.getAttribute('disabled') !== 'false')) {
|
|
587
|
+
if (!selected || (selected.hasAttribute('disabled') && selected.getAttribute('disabled') !== 'false')) {
|
|
599
588
|
return;
|
|
600
589
|
}
|
|
601
590
|
this.selectOption(selected.getAttribute('value'), true);
|
|
602
591
|
}
|
|
592
|
+
/* tslint:enable:cyclomatic-complexity */
|
|
603
593
|
keydownHandler(event) {
|
|
604
594
|
this.inputKeydownHandler(event);
|
|
605
595
|
}
|
|
@@ -610,7 +600,7 @@ export class Q2Select {
|
|
|
610
600
|
this.errors.length > 0 &&
|
|
611
601
|
this.errors.map(error => loc(error))) ||
|
|
612
602
|
(this.invalid && ['tecton.element.select.invalid']) ||
|
|
613
|
-
[], disabled: this.disabled, optional: this.optional, readonly: this.readonly, hideLabel: this.hideLabel, ariaExpanded: this.dropdownOpen
|
|
603
|
+
[], disabled: this.disabled, optional: this.optional, readonly: this.readonly, hideLabel: this.hideLabel, ariaExpanded: `${!!this.dropdownOpen}`, ariaOwns: "dropdown", ariaHaspopup: "listbox", role: this.searchable ? 'combobox' : null, pseudo: !this.searchable, "test-id": "toggleDropdown", "hide-messages": true, iconRight: "chevron-down", onClick: this.inputClickHandler, onInput: this.inputInputHandler, onKeyDown: this.inputKeydownHandler, onFocus: this.inputFocusHandler, onBlur: this.inputBlurHandler, onChange: this.inputChangeHandler }),
|
|
614
604
|
h("div", { class: "custom-display-content", hidden: !this.hasCustomDisplay || !!this.searchText, onClick: this.onCustomDisplayClick },
|
|
615
605
|
h("slot", { name: "q2-select-display" })),
|
|
616
606
|
this.optionsDropdown()));
|
|
@@ -626,9 +616,7 @@ export class Q2Select {
|
|
|
626
616
|
return (h("div", { class: "multi-select-header", ref: el => (this.multiSelectHeader = el) },
|
|
627
617
|
loc('tecton.element.select.multiHeader.showing'),
|
|
628
618
|
h("q2-btn", { class: `option-toggle show-all-options${this.onlyShowingSelected ? '' : ' selected'}`, badge: true, "aria-selected": !this.onlyShowingSelected || undefined, "test-id": "allOptionsButton", onClick: this.showAllOptions, label: loc('tecton.element.select.multiHeader.allAriaLabel'), "hide-label": true }, loc('tecton.element.select.multiHeader.all')),
|
|
629
|
-
h("q2-btn", { class: `option-toggle show-selected-options${this.onlyShowingSelected ? ' selected' : ''}`, "aria-selected": this.onlyShowingSelected || undefined, disabled: this.selectedOptions.length === 0, badge: true, "test-id": "selectedOptionsButton", onClick: this.showSelectedOptions, label: loc('tecton.element.select.multiHeader.selectedAriaLabel', [
|
|
630
|
-
this.selectedOptionsCount
|
|
631
|
-
]), "hide-label": true }, loc('tecton.element.select.multiHeader.selected', [this.selectedOptionsCount]))));
|
|
619
|
+
h("q2-btn", { class: `option-toggle show-selected-options${this.onlyShowingSelected ? ' selected' : ''}`, "aria-selected": this.onlyShowingSelected || undefined, disabled: this.selectedOptions.length === 0, badge: true, "test-id": "selectedOptionsButton", onClick: this.showSelectedOptions, label: loc('tecton.element.select.multiHeader.selectedAriaLabel', [this.selectedOptionsCount]), "hide-label": true }, loc('tecton.element.select.multiHeader.selected', [this.selectedOptionsCount]))));
|
|
632
620
|
}
|
|
633
621
|
static get is() { return "q2-select"; }
|
|
634
622
|
static get encapsulation() { return "shadow"; }
|
|
@@ -136,9 +136,9 @@ button {
|
|
|
136
136
|
.custom-display-content {
|
|
137
137
|
position: absolute;
|
|
138
138
|
bottom: 0;
|
|
139
|
-
left: calc(var
|
|
139
|
+
left: calc(var(--tct-scale-2, var(--app-scale-2, 10px)) + 1px);
|
|
140
140
|
height: 44px;
|
|
141
|
-
width: calc(100% - 34px - var
|
|
141
|
+
width: calc(100% - 34px - var(--tct-scale-3, var(--app-scale-3, 15px)));
|
|
142
142
|
overflow: hidden;
|
|
143
143
|
cursor: pointer;
|
|
144
144
|
transition: left var(--tct-tween-2, var(--app-tween-1, 0.2s ease));
|
|
@@ -151,11 +151,11 @@ button {
|
|
|
151
151
|
|
|
152
152
|
.is-searchable.is-focused .custom-display-content,
|
|
153
153
|
.is-searchable .custom-display-content:active {
|
|
154
|
-
left: calc(var
|
|
154
|
+
left: calc(var(--tct-scale-3, var(--app-scale-3, 15px)) + 1px);
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
.has-error .custom-display-content {
|
|
158
|
-
width: calc(100% - 68px - var
|
|
158
|
+
width: calc(100% - 68px - var(--tct-scale-3, var(--app-scale-3, 15px)));
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
.dropdown-open .q2-select-dropdown {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Prop, h, Element, State, Watch, Listen, Event, Fragment } from '@stencil/core';
|
|
1
|
+
import { Component, Prop, h, Element, State, Watch, Listen, Event, Fragment, } from '@stencil/core';
|
|
2
2
|
import { loc, addSmoothScrollPolyfill, overrideFocus, isEventFromElement } from 'src/utils';
|
|
3
3
|
addSmoothScrollPolyfill();
|
|
4
4
|
export class Q2Stepper {
|
|
@@ -17,7 +17,7 @@ export class Q2Stepper {
|
|
|
17
17
|
const scrollAmount = Math.floor(this.listElement.clientWidth / 2);
|
|
18
18
|
this.listElement.scrollBy({
|
|
19
19
|
left: direction === 'left' ? -scrollAmount : scrollAmount,
|
|
20
|
-
behavior: 'smooth'
|
|
20
|
+
behavior: 'smooth',
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
this.onStepClick = (event, selectedStep) => {
|
|
@@ -29,7 +29,7 @@ export class Q2Stepper {
|
|
|
29
29
|
selectedStep,
|
|
30
30
|
lastEnabledStep,
|
|
31
31
|
currentStep,
|
|
32
|
-
stepCount
|
|
32
|
+
stepCount,
|
|
33
33
|
});
|
|
34
34
|
};
|
|
35
35
|
this.onStepKeyDown = (event, stepNumber) => {
|
|
@@ -100,9 +100,7 @@ export class Q2Stepper {
|
|
|
100
100
|
////////// HOST EVENTS ////////
|
|
101
101
|
defaultChangeHandler(event) {
|
|
102
102
|
const { hostElement } = this;
|
|
103
|
-
if (event.target === hostElement &&
|
|
104
|
-
!hostElement.getAttribute('onchange') &&
|
|
105
|
-
!!event.detail) {
|
|
103
|
+
if (event.target === hostElement && !hostElement.getAttribute('onchange') && !!event.detail) {
|
|
106
104
|
this.currentStep = event.detail.selectedStep;
|
|
107
105
|
}
|
|
108
106
|
}
|
|
@@ -124,7 +122,7 @@ export class Q2Stepper {
|
|
|
124
122
|
selectedStep: null,
|
|
125
123
|
lastEnabledStep: stepNumber,
|
|
126
124
|
currentStep,
|
|
127
|
-
stepCount
|
|
125
|
+
stepCount,
|
|
128
126
|
});
|
|
129
127
|
}
|
|
130
128
|
this.scheduledAfterRender.push(this.resizeIframe);
|
|
@@ -132,8 +130,8 @@ export class Q2Stepper {
|
|
|
132
130
|
this.focusStep(stepNumber, this.scrollEnabled);
|
|
133
131
|
}
|
|
134
132
|
resizeIframe() {
|
|
135
|
-
var _a;
|
|
136
|
-
return (_a = window === null || window === void 0 ? void 0 : window.TectonElements) === null || _a === void 0 ? void 0 : _a.resizeIframe();
|
|
133
|
+
var _a, _b;
|
|
134
|
+
return (_b = (_a = window === null || window === void 0 ? void 0 : window.TectonElements) === null || _a === void 0 ? void 0 : _a.resizeIframe) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
137
135
|
}
|
|
138
136
|
showStepPane(stepNumber) {
|
|
139
137
|
this.allPanes.forEach((pane, index) => {
|
|
@@ -153,7 +151,7 @@ export class Q2Stepper {
|
|
|
153
151
|
const left = stepListItem.offsetLeft - this.listElement.clientWidth / 2;
|
|
154
152
|
this.listElement.scrollTo({
|
|
155
153
|
left,
|
|
156
|
-
behavior: 'smooth'
|
|
154
|
+
behavior: 'smooth',
|
|
157
155
|
});
|
|
158
156
|
}
|
|
159
157
|
}
|
|
@@ -171,9 +171,9 @@ li {
|
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
hr {
|
|
174
|
-
width: calc(
|
|
175
|
-
top: calc(
|
|
176
|
-
left: calc(
|
|
174
|
+
width: calc(var(--comp-step-width) - var(--comp-step-gap) - var(--comp-bullet-gap) - var(--comp-bullet-size));
|
|
175
|
+
top: calc(var(--comp-bullet-size) / 2 + var(--comp-bullet-gap));
|
|
176
|
+
left: calc(var(--comp-step-width) * -0.5 + var(--comp-step-gap) + var(--comp-bullet-gap));
|
|
177
177
|
border: 0;
|
|
178
178
|
border-top: 1px solid var(--comp-bullet-bg);
|
|
179
179
|
height: 0;
|
|
@@ -1,15 +1,50 @@
|
|
|
1
|
-
import { Component, Prop, h, Element } from '@stencil/core';
|
|
2
|
-
import { createGuid, loc } from 'src/utils';
|
|
1
|
+
import { Component, Prop, h, Element, Fragment, Event, Watch, Listen, State, } from '@stencil/core';
|
|
2
|
+
import { createGuid, loc, nextPaint } from 'src/utils';
|
|
3
3
|
export class Q2StepperPane {
|
|
4
|
-
|
|
4
|
+
constructor() {
|
|
5
|
+
this.isChildActive = false;
|
|
6
|
+
}
|
|
7
|
+
/// LifeCycle Hooks ///
|
|
5
8
|
connectedCallback() {
|
|
6
9
|
if (!this.hostElement.id)
|
|
7
10
|
this.hostElement.id = `step-${createGuid()}`;
|
|
8
11
|
}
|
|
12
|
+
componentWillLoad() {
|
|
13
|
+
this.checkForActiveChildren();
|
|
14
|
+
}
|
|
15
|
+
/// Watchers and Listeners ///
|
|
16
|
+
statusChanged(status) {
|
|
17
|
+
this.statusChange.emit({
|
|
18
|
+
status,
|
|
19
|
+
isActive: !!this.isActive,
|
|
20
|
+
id: this.hostElement.id,
|
|
21
|
+
host: this.hostElement,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
isActiveChanged(isActive) {
|
|
25
|
+
this.activeChange.emit({
|
|
26
|
+
status: this.status || '',
|
|
27
|
+
isActive,
|
|
28
|
+
id: this.hostElement.id,
|
|
29
|
+
host: this.hostElement,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
checkForActiveChildren() {
|
|
33
|
+
if (!this.showWithChildren)
|
|
34
|
+
return;
|
|
35
|
+
nextPaint(() => {
|
|
36
|
+
setTimeout(() => {
|
|
37
|
+
this.isChildActive = !!this.hostElement.querySelector("[slot='children'] > q2-stepper-pane[is-active]");
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/// DOM ///
|
|
9
42
|
render() {
|
|
10
43
|
const { label, description, isActive } = this;
|
|
11
|
-
return (h(
|
|
12
|
-
h("
|
|
44
|
+
return (h(Fragment, null,
|
|
45
|
+
h("div", { role: "tabpanel", "aria-label": label && loc(label), "aria-description": description && loc(description), tabindex: "0", hidden: !isActive && !(this.isChildActive && this.showWithChildren) },
|
|
46
|
+
h("slot", null)),
|
|
47
|
+
h("slot", { name: "children" })));
|
|
13
48
|
}
|
|
14
49
|
static get is() { return "q2-stepper-pane"; }
|
|
15
50
|
static get encapsulation() { return "shadow"; }
|
|
@@ -70,7 +105,100 @@ export class Q2StepperPane {
|
|
|
70
105
|
},
|
|
71
106
|
"attribute": "is-active",
|
|
72
107
|
"reflect": true
|
|
108
|
+
},
|
|
109
|
+
"showWithChildren": {
|
|
110
|
+
"type": "boolean",
|
|
111
|
+
"mutable": false,
|
|
112
|
+
"complexType": {
|
|
113
|
+
"original": "boolean",
|
|
114
|
+
"resolved": "boolean",
|
|
115
|
+
"references": {}
|
|
116
|
+
},
|
|
117
|
+
"required": false,
|
|
118
|
+
"optional": false,
|
|
119
|
+
"docs": {
|
|
120
|
+
"tags": [],
|
|
121
|
+
"text": ""
|
|
122
|
+
},
|
|
123
|
+
"attribute": "show-with-children",
|
|
124
|
+
"reflect": true
|
|
125
|
+
},
|
|
126
|
+
"status": {
|
|
127
|
+
"type": "string",
|
|
128
|
+
"mutable": false,
|
|
129
|
+
"complexType": {
|
|
130
|
+
"original": "'complete' | 'error' | 'locked'",
|
|
131
|
+
"resolved": "\"complete\" | \"error\" | \"locked\"",
|
|
132
|
+
"references": {}
|
|
133
|
+
},
|
|
134
|
+
"required": false,
|
|
135
|
+
"optional": false,
|
|
136
|
+
"docs": {
|
|
137
|
+
"tags": [],
|
|
138
|
+
"text": ""
|
|
139
|
+
},
|
|
140
|
+
"attribute": "status",
|
|
141
|
+
"reflect": true
|
|
73
142
|
}
|
|
74
143
|
}; }
|
|
144
|
+
static get states() { return {
|
|
145
|
+
"isChildActive": {}
|
|
146
|
+
}; }
|
|
147
|
+
static get events() { return [{
|
|
148
|
+
"method": "statusChange",
|
|
149
|
+
"name": "statusChange",
|
|
150
|
+
"bubbles": true,
|
|
151
|
+
"cancelable": true,
|
|
152
|
+
"composed": true,
|
|
153
|
+
"docs": {
|
|
154
|
+
"tags": [],
|
|
155
|
+
"text": ""
|
|
156
|
+
},
|
|
157
|
+
"complexType": {
|
|
158
|
+
"original": "IStepperPaneEvent",
|
|
159
|
+
"resolved": "IStepperPaneEvent",
|
|
160
|
+
"references": {
|
|
161
|
+
"IStepperPaneEvent": {
|
|
162
|
+
"location": "local"
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}, {
|
|
167
|
+
"method": "activeChange",
|
|
168
|
+
"name": "activeChange",
|
|
169
|
+
"bubbles": true,
|
|
170
|
+
"cancelable": true,
|
|
171
|
+
"composed": true,
|
|
172
|
+
"docs": {
|
|
173
|
+
"tags": [],
|
|
174
|
+
"text": ""
|
|
175
|
+
},
|
|
176
|
+
"complexType": {
|
|
177
|
+
"original": "IStepperPaneEvent",
|
|
178
|
+
"resolved": "IStepperPaneEvent",
|
|
179
|
+
"references": {
|
|
180
|
+
"IStepperPaneEvent": {
|
|
181
|
+
"location": "local"
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}]; }
|
|
75
186
|
static get elementRef() { return "hostElement"; }
|
|
187
|
+
static get watchers() { return [{
|
|
188
|
+
"propName": "status",
|
|
189
|
+
"methodName": "statusChanged"
|
|
190
|
+
}, {
|
|
191
|
+
"propName": "isActive",
|
|
192
|
+
"methodName": "isActiveChanged"
|
|
193
|
+
}, {
|
|
194
|
+
"propName": "showWithChildren",
|
|
195
|
+
"methodName": "checkForActiveChildren"
|
|
196
|
+
}]; }
|
|
197
|
+
static get listeners() { return [{
|
|
198
|
+
"name": "activeChange",
|
|
199
|
+
"method": "checkForActiveChildren",
|
|
200
|
+
"target": undefined,
|
|
201
|
+
"capture": false,
|
|
202
|
+
"passive": false
|
|
203
|
+
}]; }
|
|
76
204
|
}
|