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
|
@@ -195,7 +195,7 @@ const postalCodeFormats = {
|
|
|
195
195
|
WF: '986##',
|
|
196
196
|
ZM: '#####',
|
|
197
197
|
US: '#####',
|
|
198
|
-
'US+4': '#####-####'
|
|
198
|
+
'US+4': '#####-####',
|
|
199
199
|
};
|
|
200
200
|
export default function formatPostalCode(value, modifier = 'US') {
|
|
201
201
|
const mask = postalCodeFormats[modifier];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, Prop, Element, State, Event, h, Watch, Listen } from '@stencil/core';
|
|
2
|
-
import { createGuid, labelDOM, loc, messagesDOM, setMessageHeight, handleAriaLabel, overrideFocus, isEventFromElement } from 'src/utils';
|
|
2
|
+
import { createGuid, labelDOM, loc, messagesDOM, setMessageHeight, handleAriaLabel, overrideFocus, isEventFromElement, } from 'src/utils';
|
|
3
3
|
import formatCurrency from './formatting/currency';
|
|
4
4
|
import formatPhoneNumber from './formatting/phone';
|
|
5
5
|
import formatSSN from './formatting/ssn';
|
|
@@ -59,7 +59,7 @@ export class Q2Input {
|
|
|
59
59
|
const eventDetail = {
|
|
60
60
|
value: '',
|
|
61
61
|
formattedValue: '',
|
|
62
|
-
minFormattedLength: this.formattedValueObject.minFormattedLength
|
|
62
|
+
minFormattedLength: this.formattedValueObject.minFormattedLength,
|
|
63
63
|
};
|
|
64
64
|
this.input.emit(eventDetail);
|
|
65
65
|
this.change.emit(eventDetail);
|
|
@@ -98,17 +98,17 @@ export class Q2Input {
|
|
|
98
98
|
percentage: formatPercentage,
|
|
99
99
|
postal: formatPostalCode,
|
|
100
100
|
date: formatDate,
|
|
101
|
-
'credit-card': formatCreditCard.format
|
|
101
|
+
'credit-card': formatCreditCard.format,
|
|
102
102
|
};
|
|
103
103
|
if (formattingFunctions[this.type]) {
|
|
104
104
|
return formattingFunctions[this.type](value, this.formatModifier, valueChangedFromProperty);
|
|
105
105
|
}
|
|
106
106
|
return {
|
|
107
|
-
value
|
|
107
|
+
value,
|
|
108
108
|
formattedValue: value,
|
|
109
109
|
fullyFormattedValue: value,
|
|
110
110
|
formattingCharacterCount: 0,
|
|
111
|
-
unformattedValue: value
|
|
111
|
+
unformattedValue: value,
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
114
|
get canClear() {
|
|
@@ -145,7 +145,7 @@ export class Q2Input {
|
|
|
145
145
|
'percentage',
|
|
146
146
|
'postal',
|
|
147
147
|
'date',
|
|
148
|
-
'credit-card'
|
|
148
|
+
'credit-card',
|
|
149
149
|
];
|
|
150
150
|
return maskedTypes.includes(this.type);
|
|
151
151
|
}
|
|
@@ -180,7 +180,7 @@ export class Q2Input {
|
|
|
180
180
|
percentage: 'tel',
|
|
181
181
|
postal: 'tel',
|
|
182
182
|
date: 'tel',
|
|
183
|
-
'credit-card': 'tel'
|
|
183
|
+
'credit-card': 'tel',
|
|
184
184
|
};
|
|
185
185
|
if (['password', 'text'].includes(this.type) && this.textHidden) {
|
|
186
186
|
return 'password';
|
|
@@ -260,15 +260,14 @@ export class Q2Input {
|
|
|
260
260
|
handleDataInput(newFormattedValue) {
|
|
261
261
|
if (this.maxlength === undefined ||
|
|
262
262
|
newFormattedValue.unformattedValue.length <= this.maxlength ||
|
|
263
|
-
newFormattedValue.unformattedValue.length <=
|
|
264
|
-
this.formattedValueObject.unformattedValue.length) {
|
|
263
|
+
newFormattedValue.unformattedValue.length <= this.formattedValueObject.unformattedValue.length) {
|
|
265
264
|
this.formattedValueObject = newFormattedValue;
|
|
266
265
|
}
|
|
267
266
|
else if (this.maxlength) {
|
|
268
267
|
newFormattedValue = this.getFormattedValue(newFormattedValue.unformattedValue.substring(0, this.maxlength), false);
|
|
269
268
|
this.formattedValueObject = newFormattedValue;
|
|
270
269
|
}
|
|
271
|
-
//ORDER IMPORTANT: calculate cursor position -> set value -> set cursor position
|
|
270
|
+
// ORDER IMPORTANT: calculate cursor position -> set value -> set cursor position
|
|
272
271
|
const cursorPosition = this.calculateCursorPositionOnInput();
|
|
273
272
|
this.inputField.value = this.formattedValueObject.formattedValue;
|
|
274
273
|
this.input.emit(Object.assign({ value: this.formattedValueObject.value, formattedValue: this.formattedValueObject.fullyFormattedValue, minFormattedLength: this.formattedValueObject.minFormattedLength }, (this.formattedValueObject.type && { type: this.formattedValueObject.type })));
|
|
@@ -281,6 +280,7 @@ export class Q2Input {
|
|
|
281
280
|
this.inputDOM(),
|
|
282
281
|
messagesDOM(this)));
|
|
283
282
|
}
|
|
283
|
+
/* tslint:disable:cyclomatic-complexity */
|
|
284
284
|
inputDOM() {
|
|
285
285
|
return (h("div", { class: "input-container" },
|
|
286
286
|
h("div", { class: "input-icons-container-left" },
|
|
@@ -297,6 +297,7 @@ export class Q2Input {
|
|
|
297
297
|
this.iconRight && !this.formattedValueObject.suffix && (h("q2-icon", { type: this.iconRight, class: "icon-right" })),
|
|
298
298
|
this.hasError && this.type !== 'currency' && (h("q2-icon", { type: "error", class: "icon-error" })))));
|
|
299
299
|
}
|
|
300
|
+
/* tslint:enable:cyclomatic-complexity */
|
|
300
301
|
pseudoInputDOM() {
|
|
301
302
|
const showPlaceholder = !this.value && !!this.placeholder;
|
|
302
303
|
let ariaLabelSuffix = '';
|
|
@@ -307,19 +308,19 @@ export class Q2Input {
|
|
|
307
308
|
ariaLabelSuffix = loc('tecton.element.input.readonly');
|
|
308
309
|
}
|
|
309
310
|
return (h("div", { class: "pseudo-input" },
|
|
310
|
-
h("button", { class: "input-field", type: "button", id: this.inputId, "aria-describedby": this.inputDescribedBy, "aria-required": `${!this.optional}`, "aria-invalid": `${this.hasError}`, "aria-controls": (this.ariaControls && `${this.ariaControls}`) || undefined, "aria-owns": (this.ariaOwns && `${this.ariaOwns}`) || undefined, "aria-haspopup": (this.ariaHaspopup && `${this.ariaHaspopup}`) || undefined, "aria-expanded": (!!this.ariaExpanded && `${!!this.ariaExpanded}`) || undefined, "aria-activedescendant": this.ariaActivedescendant && `${this.ariaActivedescendant}`, "aria-label": `${this.value}, ${(this.label && loc(this.label)) ||
|
|
311
|
-
''}${ariaLabelSuffix}`, role: (this.role && `${this.role}`) || undefined, disabled: !!this.disabled, "test-id": "q2InputInnerClearButton" },
|
|
311
|
+
h("button", { class: "input-field", type: "button", id: this.inputId, "aria-describedby": this.inputDescribedBy, "aria-required": `${!this.optional}`, "aria-invalid": `${this.hasError}`, "aria-controls": (this.ariaControls && `${this.ariaControls}`) || undefined, "aria-owns": (this.ariaOwns && `${this.ariaOwns}`) || undefined, "aria-haspopup": (this.ariaHaspopup && `${this.ariaHaspopup}`) || undefined, "aria-expanded": (!!this.ariaExpanded && `${!!this.ariaExpanded}`) || undefined, "aria-activedescendant": this.ariaActivedescendant && `${this.ariaActivedescendant}`, "aria-label": `${this.value}, ${(this.label && loc(this.label)) || ''}${ariaLabelSuffix}`, role: (this.role && `${this.role}`) || undefined, disabled: !!this.disabled, "test-id": "q2InputInnerClearButton" },
|
|
312
312
|
h("span", { class: showPlaceholder ? 'placeholder-text' : '' }, showPlaceholder ? this.placeholder : this.value))));
|
|
313
313
|
}
|
|
314
314
|
calculateCursorPositionOnInput() {
|
|
315
315
|
const input = this.inputField;
|
|
316
316
|
const formattedLength = this.formattedValueObject.formattedValue.length;
|
|
317
317
|
const currentValueLength = input.value.length;
|
|
318
|
+
const defaultPosition = this.type === 'currency' ? formattedLength : 0;
|
|
318
319
|
return {
|
|
319
|
-
startingPosition: (input && input.selectionStart) ||
|
|
320
|
+
startingPosition: (input && input.selectionStart) || defaultPosition,
|
|
320
321
|
valueLength: formattedLength,
|
|
321
322
|
previousValueLength: input && currentValueLength,
|
|
322
|
-
hasSelection: false
|
|
323
|
+
hasSelection: false,
|
|
323
324
|
};
|
|
324
325
|
}
|
|
325
326
|
calculateCursorPositionOnFocus() {
|
|
@@ -330,16 +331,14 @@ export class Q2Input {
|
|
|
330
331
|
startingPosition,
|
|
331
332
|
valueLength,
|
|
332
333
|
previousValueLength: valueLength,
|
|
333
|
-
hasSelection: getSelection().toString().length > 0
|
|
334
|
+
hasSelection: getSelection().toString().length > 0,
|
|
334
335
|
};
|
|
335
336
|
}
|
|
336
337
|
setCursorPosition(cursorData) {
|
|
337
338
|
if (this.canSetSelection && !cursorData.hasSelection) {
|
|
338
339
|
const input = this.inputField;
|
|
339
340
|
const { valueLength, previousValueLength, startingPosition } = cursorData;
|
|
340
|
-
if (startingPosition === valueLength &&
|
|
341
|
-
valueLength >= previousValueLength &&
|
|
342
|
-
this.type === 'currency') {
|
|
341
|
+
if (startingPosition === valueLength && valueLength >= previousValueLength && this.type === 'currency') {
|
|
343
342
|
input.setSelectionRange(valueLength, valueLength);
|
|
344
343
|
}
|
|
345
344
|
else {
|
|
@@ -822,11 +821,11 @@ export class Q2Input {
|
|
|
822
821
|
"reflect": false
|
|
823
822
|
},
|
|
824
823
|
"ariaExpanded": {
|
|
825
|
-
"type": "
|
|
824
|
+
"type": "string",
|
|
826
825
|
"mutable": false,
|
|
827
826
|
"complexType": {
|
|
828
|
-
"original": "
|
|
829
|
-
"resolved": "
|
|
827
|
+
"original": "string",
|
|
828
|
+
"resolved": "string",
|
|
830
829
|
"references": {}
|
|
831
830
|
},
|
|
832
831
|
"required": false,
|
|
@@ -254,8 +254,13 @@ q2-icon {
|
|
|
254
254
|
display: inline-flex;
|
|
255
255
|
align-items: center;
|
|
256
256
|
justify-content: center;
|
|
257
|
-
min-height: calc(
|
|
258
|
-
|
|
257
|
+
min-height: calc(
|
|
258
|
+
var(--comp-input-min-height) - var(--tct-input-focus-border-top-width, var(--t-input-focus-border-top-width, 1px)) -
|
|
259
|
+
var(--tct-input-focus-border-bottom-width, var(--t-input-focus-border-bottom-width, 1px))
|
|
260
|
+
);
|
|
261
|
+
height: calc(
|
|
262
|
+
var(--tct-input-height, var(--t-input-height, 44px)) - var(--tct-input-focus-border-top-width, var(--t-input-focus-border-top-width, 1px)) - var(--tct-input-focus-border-bottom-width, var(--t-input-focus-border-bottom-width, 1px))
|
|
263
|
+
);
|
|
259
264
|
font-size: var(--tct-input-prefix-font-size, var(--t-input-prefix-font-size, inherit));
|
|
260
265
|
color: var(--tct-input-prefix-font-color, var(--t-input-prefix-font-color, inherit));
|
|
261
266
|
background-color: var(--tct-input-prefix-bg, var(--t-input-prefix-bg, var(--tct-input-bg, var(--t-input-bg, var(--tct-gray-14, var(--t-gray-14, #f2f2f2))))));
|
|
@@ -263,15 +268,23 @@ q2-icon {
|
|
|
263
268
|
}
|
|
264
269
|
|
|
265
270
|
.input-prefix {
|
|
266
|
-
border-top-left-radius: calc(
|
|
267
|
-
|
|
271
|
+
border-top-left-radius: calc(
|
|
272
|
+
var(--comp-input-border-top-left-radius) - var(--tct-input-border-top-width, var(--t-input-border-top-width, 1px)) - var(--tct-input-border-left-width, var(--t-input-border-left-width, 1px))
|
|
273
|
+
);
|
|
274
|
+
border-bottom-left-radius: calc(
|
|
275
|
+
var(--comp-input-border-bottom-left-radius) - var(--tct-input-border-bottom-width, var(--t-input-border-bottom-width, 1px)) - var(--tct-input-border-left-width, var(--t-input-border-left-width, 1px))
|
|
276
|
+
);
|
|
268
277
|
pointer-events: none;
|
|
269
278
|
/* used to allow iOS voiceover to display keyboard in input TCT-1194 */
|
|
270
279
|
}
|
|
271
280
|
|
|
272
281
|
.input-suffix {
|
|
273
|
-
border-top-right-radius: calc(
|
|
274
|
-
|
|
282
|
+
border-top-right-radius: calc(
|
|
283
|
+
var(--comp-input-border-top-right-radius) - var(--tct-input-border-top-width, var(--t-input-border-top-width, 1px)) - var(--tct-input-border-right-width, var(--t-input-border-right-width, 1px))
|
|
284
|
+
);
|
|
285
|
+
border-bottom-right-radius: calc(
|
|
286
|
+
var(--comp-input-border-bottom-right-radius) - var(--tct-input-border-bottom-width, var(--t-input-border-bottom-width, 1px)) - var(--tct-input-border-right-width, var(--t-input-border-right-width, 1px))
|
|
287
|
+
);
|
|
275
288
|
}
|
|
276
289
|
|
|
277
290
|
.icon-error {
|
|
@@ -21,9 +21,9 @@ export class Q2Loading {
|
|
|
21
21
|
const loaderMap = {
|
|
22
22
|
default: this.spinner,
|
|
23
23
|
spinner: this.spinner,
|
|
24
|
-
skeleton: this.skeletonLoader
|
|
24
|
+
skeleton: this.skeletonLoader,
|
|
25
25
|
};
|
|
26
|
-
return loaderMap[this.type] || loaderMap
|
|
26
|
+
return loaderMap[this.type] || loaderMap.default;
|
|
27
27
|
}
|
|
28
28
|
get modifiersSet() {
|
|
29
29
|
if (this.type !== 'skeleton' || !this.modifiers) {
|
|
@@ -44,9 +44,9 @@ export class Q2Loading {
|
|
|
44
44
|
get spinnerShape() {
|
|
45
45
|
const spinnerMap = {
|
|
46
46
|
default: this.halfCircleSpinner,
|
|
47
|
-
'half-circle': this.halfCircleSpinner
|
|
47
|
+
'half-circle': this.halfCircleSpinner,
|
|
48
48
|
};
|
|
49
|
-
return spinnerMap[this.type] || spinnerMap
|
|
49
|
+
return spinnerMap[this.type] || spinnerMap.default;
|
|
50
50
|
}
|
|
51
51
|
get localizedLabel() {
|
|
52
52
|
return loc(this.label || 'tecton.element.loading.ariaLabel');
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { h } from '@stencil/core';
|
|
2
2
|
export const atoms = {
|
|
3
3
|
circle: ({ width, additionalClasses }) => (h("div", { class: `skeleton-shape circle ${additionalClasses || ''}`, style: { width, height: width } })),
|
|
4
|
-
rectangle: ({ width, height, borderRadius, additionalClasses }) => (h("div", { class: `skeleton-shape rectangle ${additionalClasses || ''}`, style: { width, height, borderRadius } }))
|
|
4
|
+
rectangle: ({ width, height, borderRadius, additionalClasses }) => (h("div", { class: `skeleton-shape rectangle ${additionalClasses || ''}`, style: { width, height, borderRadius } })),
|
|
5
5
|
};
|
|
6
6
|
export const molecules = {
|
|
7
7
|
field: () => (h("div", { class: "skeleton-shape field" },
|
|
8
8
|
h("div", { class: "skeleton-field-label" }, atoms.rectangle({ height: '1rem', width: '50%' })),
|
|
9
9
|
atoms.rectangle({
|
|
10
10
|
height: 'var(--tct-input-height, 42px)',
|
|
11
|
-
borderRadius: '3px'
|
|
11
|
+
borderRadius: '3px',
|
|
12
12
|
}))),
|
|
13
13
|
text: (counts, modifiers) => {
|
|
14
14
|
var _a;
|
|
15
15
|
const rows = (_a = counts === null || counts === void 0 ? void 0 : counts[0]) !== null && _a !== void 0 ? _a : 1;
|
|
16
16
|
const hasHeader = modifiers === null || modifiers === void 0 ? void 0 : modifiers.has('header');
|
|
17
|
-
const alignment = ((modifiers === null || modifiers === void 0 ? void 0 : modifiers.has('center')) && 'center') ||
|
|
18
|
-
((modifiers === null || modifiers === void 0 ? void 0 : modifiers.has('right')) && 'right') ||
|
|
19
|
-
'left';
|
|
17
|
+
const alignment = ((modifiers === null || modifiers === void 0 ? void 0 : modifiers.has('center')) && 'center') || ((modifiers === null || modifiers === void 0 ? void 0 : modifiers.has('right')) && 'right') || 'left';
|
|
20
18
|
const smallHeaderClass = (modifiers === null || modifiers === void 0 ? void 0 : modifiers.has('smallheader')) ? ' smaller' : '';
|
|
21
19
|
const additionalClasses = hasHeader ? `header ${alignment}${smallHeaderClass}` : '';
|
|
22
20
|
return (h("div", { class: "skeleton-shape text" },
|
|
@@ -25,7 +23,7 @@ export const molecules = {
|
|
|
25
23
|
Array(rows)
|
|
26
24
|
.fill(undefined)
|
|
27
25
|
.map(() => atoms.rectangle({ height: '1rem' }))));
|
|
28
|
-
}
|
|
26
|
+
},
|
|
29
27
|
};
|
|
30
28
|
export const shapes = {
|
|
31
29
|
circle: () => {
|
|
@@ -57,7 +55,7 @@ export const shapes = {
|
|
|
57
55
|
.map(() => atoms.rectangle({ height: '1.5rem' }))),
|
|
58
56
|
bordered && (h("div", { class: "skeleton-table-row-border" }, atoms.rectangle({
|
|
59
57
|
height: '1px',
|
|
60
|
-
additionalClasses: 'no-margin'
|
|
58
|
+
additionalClasses: 'no-margin',
|
|
61
59
|
})))))))));
|
|
62
60
|
},
|
|
63
61
|
field: molecules.field,
|
|
@@ -66,17 +64,12 @@ export const shapes = {
|
|
|
66
64
|
const columns = (_a = ((counts === null || counts === void 0 ? void 0 : counts[1]) && (counts === null || counts === void 0 ? void 0 : counts[0]))) !== null && _a !== void 0 ? _a : 1;
|
|
67
65
|
const rows = (_c = (_b = counts === null || counts === void 0 ? void 0 : counts[1]) !== null && _b !== void 0 ? _b : counts === null || counts === void 0 ? void 0 : counts[0]) !== null && _c !== void 0 ? _c : 1;
|
|
68
66
|
const totalItems = columns * rows;
|
|
69
|
-
return (h("div", { class: `skeleton-shape form flex columns-${columns}` }, !!totalItems &&
|
|
70
|
-
Array(totalItems)
|
|
71
|
-
.fill(undefined)
|
|
72
|
-
.map(molecules.field)));
|
|
67
|
+
return (h("div", { class: `skeleton-shape form flex columns-${columns}` }, !!totalItems && Array(totalItems).fill(undefined).map(molecules.field)));
|
|
73
68
|
},
|
|
74
69
|
text: molecules.text,
|
|
75
70
|
'detailed-item': (counts, modifiers) => {
|
|
76
71
|
const isSquare = modifiers === null || modifiers === void 0 ? void 0 : modifiers.has('square');
|
|
77
|
-
const alignment = ((modifiers === null || modifiers === void 0 ? void 0 : modifiers.has('center')) && 'center') ||
|
|
78
|
-
((modifiers === null || modifiers === void 0 ? void 0 : modifiers.has('right')) && 'right') ||
|
|
79
|
-
'left';
|
|
72
|
+
const alignment = ((modifiers === null || modifiers === void 0 ? void 0 : modifiers.has('center')) && 'center') || ((modifiers === null || modifiers === void 0 ? void 0 : modifiers.has('right')) && 'right') || 'left';
|
|
80
73
|
return (h("div", { class: `skeleton-shape detailed-item flex ${alignment}` },
|
|
81
74
|
h("div", { class: `detailed-item-image flex-${alignment}` }, isSquare
|
|
82
75
|
? atoms.rectangle({ width: '1.5em', height: '1.5em', borderRadius: '3px' })
|
|
@@ -91,6 +84,6 @@ export const shapes = {
|
|
|
91
84
|
Array(cells)
|
|
92
85
|
.fill(undefined)
|
|
93
86
|
.map(() => atoms.rectangle({ height: '1rem' }))));
|
|
94
|
-
}
|
|
87
|
+
},
|
|
95
88
|
};
|
|
96
89
|
export default shapes;
|
|
@@ -137,8 +137,8 @@ function generateIcon(type) {
|
|
|
137
137
|
warning: 'warning',
|
|
138
138
|
danger: 'error',
|
|
139
139
|
error: 'error',
|
|
140
|
-
info: 'info'
|
|
140
|
+
info: 'info',
|
|
141
141
|
};
|
|
142
|
-
const icon = iconMap[type] || iconMap
|
|
143
|
-
return h("q2-icon", { type: icon, class: "message-icon" });
|
|
142
|
+
const icon = iconMap[type] || iconMap.info;
|
|
143
|
+
return (h("q2-icon", { type: icon, class: "message-icon" }));
|
|
144
144
|
}
|
|
@@ -14,7 +14,7 @@ export class Q2Optgroup {
|
|
|
14
14
|
const observer = new MutationObserver(this.setHidden);
|
|
15
15
|
observer.observe(this.hostElement, { childList: true, attributes: true, subtree: true });
|
|
16
16
|
this.mutationObserver = observer;
|
|
17
|
-
//set initially
|
|
17
|
+
// set initially
|
|
18
18
|
this.setHidden();
|
|
19
19
|
this.disabledWatcher(this.disabled);
|
|
20
20
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Prop, h, Event, State, Element, Host, Method, Watch, Listen } from '@stencil/core';
|
|
1
|
+
import { Component, Prop, h, Event, State, Element, Host, Method, Watch, Listen, } from '@stencil/core';
|
|
2
2
|
import { isEventFromElement, overrideFocus } from 'src/utils';
|
|
3
3
|
export class Q2OptionList {
|
|
4
4
|
constructor() {
|
|
@@ -7,6 +7,7 @@ export class Q2OptionList {
|
|
|
7
7
|
this.selectedOptions = [];
|
|
8
8
|
this.scheduledAfterRender = [];
|
|
9
9
|
/// Event Handlers ///
|
|
10
|
+
/* tslint:disable:cyclomatic-complexity */
|
|
10
11
|
this.keydownHandler = (event, ignoreSelectionEvents) => {
|
|
11
12
|
event.stopPropagation();
|
|
12
13
|
const { activeIndex, customSearch, allOptions } = this;
|
|
@@ -97,6 +98,7 @@ export class Q2OptionList {
|
|
|
97
98
|
break;
|
|
98
99
|
}
|
|
99
100
|
};
|
|
101
|
+
/* tslint:enable:cyclomatic-complexity */
|
|
100
102
|
this.focusoutHandler = (event) => {
|
|
101
103
|
const { relatedTarget } = event;
|
|
102
104
|
const isInDropdown = this.allOptions.includes(relatedTarget);
|
|
@@ -230,7 +232,7 @@ export class Q2OptionList {
|
|
|
230
232
|
const option = this.allOptions.find(({ value }) => value === selectedValue);
|
|
231
233
|
const valueObject = {
|
|
232
234
|
value: selectedValue,
|
|
233
|
-
display: option.display || option.innerText.trim()
|
|
235
|
+
display: option.display || option.innerText.trim(),
|
|
234
236
|
};
|
|
235
237
|
const { multiple, noSelect } = this;
|
|
236
238
|
let values;
|
|
@@ -86,19 +86,19 @@ export class Q2Pagination {
|
|
|
86
86
|
}
|
|
87
87
|
////////// OBSERVERS //////////
|
|
88
88
|
render() {
|
|
89
|
-
const { pagesOnly, isFullViewHidden, recordTypeWithDefault: recordType, totalPages, totalWithDefault: total, pageWithDefault: page, currentRange } = this;
|
|
89
|
+
const { pagesOnly, isFullViewHidden, recordTypeWithDefault: recordType, totalPages, totalWithDefault: total, pageWithDefault: page, currentRange, } = this;
|
|
90
90
|
const onFirstPage = page === 1;
|
|
91
91
|
const onLastPage = page === totalPages;
|
|
92
92
|
return (h("nav", { class: "container", ref: el => (this.containerElement = el), "aria-label": loc('tecton.element.pagination.title') },
|
|
93
93
|
h("div", { class: "description", "test-id": "description" }, pagesOnly
|
|
94
94
|
? loc('tecton.element.pagination.pages', {
|
|
95
95
|
current: page,
|
|
96
|
-
total: totalPages
|
|
96
|
+
total: totalPages,
|
|
97
97
|
})
|
|
98
98
|
: loc('tecton.element.pagination.description', {
|
|
99
99
|
range: currentRange,
|
|
100
100
|
recordType: recordType.toLowerCase(),
|
|
101
|
-
total: total.toLocaleString()
|
|
101
|
+
total: total.toLocaleString(),
|
|
102
102
|
})),
|
|
103
103
|
h("div", { class: "btn-group" },
|
|
104
104
|
h("q2-btn", { label: "tecton.element.pagination.goToFirstPage", disabled: onFirstPage, hidden: isFullViewHidden, onClick: () => this.handlePageChange(1), "test-id": "firstPageBtn", "hide-label": true },
|
|
@@ -108,9 +108,7 @@ export class Q2Pagination {
|
|
|
108
108
|
h("div", { class: "controls", hidden: isFullViewHidden, "test-id": "controls" },
|
|
109
109
|
h("span", { "aria-hidden": "true" }, loc('tecton.element.pagination.page')),
|
|
110
110
|
h("div", { class: "input-wrapper", onClick: () => this.inputField.dispatchEvent(new FocusEvent('focus')) },
|
|
111
|
-
h("q2-input", { type: "number", value: `${page}`, min: 1, max: this.totalPages, hideLabel: true, optional: true, label: `${loc('tecton.element.pagination.page')} (${loc('tecton.element.pagination.ofPages', [
|
|
112
|
-
totalPages.toLocaleString()
|
|
113
|
-
])})`, onChange: event => this.handlePageChange(event.detail.value), "test-id": "pageInput", current: "page", ref: el => (this.inputField = el) })),
|
|
111
|
+
h("q2-input", { type: "number", value: `${page}`, min: 1, max: this.totalPages, hideLabel: true, optional: true, label: `${loc('tecton.element.pagination.page')} (${loc('tecton.element.pagination.ofPages', [totalPages.toLocaleString()])})`, onChange: event => this.handlePageChange(event.detail.value), "test-id": "pageInput", current: "page", ref: el => (this.inputField = el) })),
|
|
114
112
|
h("span", { "aria-hidden": "true" }, loc('tecton.element.pagination.ofPages', [totalPages.toLocaleString()]))),
|
|
115
113
|
h("div", { class: "btn-group" },
|
|
116
114
|
h("q2-btn", { label: loc('tecton.element.pagination.goToPage', [page + 1]), disabled: onLastPage, onClick: () => this.handlePageChange(page + 1), "test-id": "nextPageBtn", "hide-label": true },
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Component, State, Prop, h, Listen, Element, Fragment, Event } from '@stencil/core';
|
|
1
|
+
import { Component, State, Prop, h, Listen, Element, Fragment, Event, } from '@stencil/core';
|
|
2
2
|
import { isEventFromElement, loc, overrideFocus } from 'src/utils';
|
|
3
3
|
export class Q2Pill {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.selectedOptions = [];
|
|
6
6
|
this.scheduledAfterRender = [];
|
|
7
|
-
/// Helpers
|
|
7
|
+
/// Helpers ///
|
|
8
8
|
this.determineHasOptions = () => {
|
|
9
9
|
const hasOptions = !!this.hostElement.querySelectorAll('q2-option').length;
|
|
10
10
|
this.hasOptions = hasOptions;
|
|
@@ -30,9 +30,9 @@ export class Q2Pill {
|
|
|
30
30
|
const values = isActive ? [{ value, display: label }] : [];
|
|
31
31
|
this.selectedOptions = values;
|
|
32
32
|
this.change.emit({
|
|
33
|
-
value
|
|
33
|
+
value,
|
|
34
34
|
values,
|
|
35
|
-
active: isActive
|
|
35
|
+
active: isActive,
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
};
|
|
@@ -50,7 +50,7 @@ export class Q2Pill {
|
|
|
50
50
|
this.selectedOptions = values;
|
|
51
51
|
this.active = isActive;
|
|
52
52
|
}
|
|
53
|
-
this.change.emit({ value
|
|
53
|
+
this.change.emit({ value, values, active: isActive });
|
|
54
54
|
};
|
|
55
55
|
this.handleFocusout = (event) => {
|
|
56
56
|
const relatedTarget = event.relatedTarget;
|
|
@@ -115,7 +115,7 @@ export class Q2Pill {
|
|
|
115
115
|
}
|
|
116
116
|
render() {
|
|
117
117
|
const { hasOptions, active, open } = this;
|
|
118
|
-
|
|
118
|
+
const wrapperClassNames = ['btn-wrapper'];
|
|
119
119
|
if (hasOptions || active)
|
|
120
120
|
wrapperClassNames.push('has-icon');
|
|
121
121
|
if (hasOptions)
|
|
@@ -125,10 +125,10 @@ export class Q2Pill {
|
|
|
125
125
|
h("div", { class: "btn-height-wrapper", onClick: this.handleWrapperClick, tabIndex: -1 },
|
|
126
126
|
h("button", { class: "btn-primary", type: "button", "test-id": "btn-control", ref: el => (this.primaryBtn = el), onClick: this.handleClick, onKeyDown: this.handleKeydown, disabled: this.disabled, onFocusout: this.handleFocusout, "aria-selected": !hasOptions && active ? 'true' : 'false', "aria-roledescription": !hasOptions && 'filter', "aria-controls": hasOptions && 'option-list', "aria-haspopup": hasOptions && 'true', "aria-expanded": hasOptions && open ? 'true' : 'false' },
|
|
127
127
|
this.buttonContent,
|
|
128
|
-
!hasOptions && active &&
|
|
128
|
+
!hasOptions && active && h("span", { class: "sr" },
|
|
129
129
|
"(",
|
|
130
130
|
loc('tecton.element.pill.active'),
|
|
131
|
-
")")))
|
|
131
|
+
")"))),
|
|
132
132
|
this.generateIcon()),
|
|
133
133
|
this.hasOptions && (h("q2-option-list", { id: "option-list", ref: el => (this.optionList = el), open: this.open, onChange: this.handleChange, multiple: this.multiple, onFocusout: this.handleFocusout, selectedOptions: this.selectedOptions },
|
|
134
134
|
h("slot", null)))));
|
|
@@ -167,7 +167,9 @@ q2-option-list {
|
|
|
167
167
|
background: var(--comp-hover-btn-background);
|
|
168
168
|
}
|
|
169
169
|
:host(:not(:empty)) .btn-primary, .has-icon .btn-primary {
|
|
170
|
-
padding-right: calc(
|
|
170
|
+
padding-right: calc(
|
|
171
|
+
var(--tct-pill-icon-gap, var(--t-pill-icon-gap, var(--app-size-1x, 5px))) + var(--comp-close-size)
|
|
172
|
+
);
|
|
171
173
|
}
|
|
172
174
|
.has-options .btn-primary {
|
|
173
175
|
text-overflow: ellipsis;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Prop, Element, h, Listen, Event, Watch, Fragment } from '@stencil/core';
|
|
1
|
+
import { Component, Prop, Element, h, Listen, Event, Watch, Fragment, } from '@stencil/core';
|
|
2
2
|
import { createGuid, isEventFromElement, loc, overrideFocus } from 'src/utils';
|
|
3
3
|
export class Q2RadioGroup {
|
|
4
4
|
constructor() {
|
|
@@ -68,8 +68,7 @@ export class Q2RadioGroup {
|
|
|
68
68
|
delegateFocus(event) {
|
|
69
69
|
if (!isEventFromElement(event, this.hostElement))
|
|
70
70
|
return;
|
|
71
|
-
const radio = this.hostElement.querySelector('q2-radio[checked]') ||
|
|
72
|
-
this.hostElement.querySelector('q2-radio');
|
|
71
|
+
const radio = this.hostElement.querySelector('q2-radio[checked]') || this.hostElement.querySelector('q2-radio');
|
|
73
72
|
radio === null || radio === void 0 ? void 0 : radio.dispatchEvent(new FocusEvent('focus'));
|
|
74
73
|
}
|
|
75
74
|
keydownHandler(event) {
|
|
@@ -123,9 +122,7 @@ export class Q2RadioGroup {
|
|
|
123
122
|
inputDom() {
|
|
124
123
|
if (this.tilelayout) {
|
|
125
124
|
const { tileAlignment } = this;
|
|
126
|
-
const alignment = ['left', 'center', 'right'].includes(tileAlignment)
|
|
127
|
-
? tileAlignment
|
|
128
|
-
: 'center';
|
|
125
|
+
const alignment = ['left', 'center', 'right'].includes(tileAlignment) ? tileAlignment : 'center';
|
|
129
126
|
return (h("div", { class: `flexed ${alignment}` },
|
|
130
127
|
h("slot", null)));
|
|
131
128
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Prop, Element, Listen, State, Watch, h, Event } from '@stencil/core';
|
|
1
|
+
import { Component, Prop, Element, Listen, State, Watch, h, Event, } from '@stencil/core';
|
|
2
2
|
import { createGuid, isEventFromElement, loc, overrideFocus } from 'src/utils';
|
|
3
3
|
export class Q2Section {
|
|
4
4
|
constructor() {
|
|
@@ -11,7 +11,7 @@ export class Q2Section {
|
|
|
11
11
|
this.onHeaderClick = () => {
|
|
12
12
|
this.collapsible &&
|
|
13
13
|
this.change.emit({
|
|
14
|
-
expanded: !this.expanded
|
|
14
|
+
expanded: !this.expanded,
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
17
|
this.onAnimationStart = () => {
|
|
@@ -79,9 +79,7 @@ export class Q2Section {
|
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
resizeIframe() {
|
|
82
|
-
return
|
|
83
|
-
window.TectonElements.resizeIframe &&
|
|
84
|
-
window.TectonElements.resizeIframe());
|
|
82
|
+
return window.TectonElements && window.TectonElements.resizeIframe && window.TectonElements.resizeIframe();
|
|
85
83
|
}
|
|
86
84
|
componentWillLoad() {
|
|
87
85
|
this.onHeaderSlotChange();
|
|
@@ -155,10 +153,10 @@ export class Q2Section {
|
|
|
155
153
|
return (h("section", { class: this.wrapperClasses },
|
|
156
154
|
h("div", { class: "q2-section-header" },
|
|
157
155
|
h("div", { class: "q2-section-header-content", id: this.titleId, onClick: this.onHeaderClick },
|
|
158
|
-
!this.hasYieldedHeader && !!this.label ?
|
|
156
|
+
!this.hasYieldedHeader && !!this.label ? h("h2", { class: "title" }, loc(this.label)) : '',
|
|
159
157
|
h("div", { class: "q2-section-header-slot-wrapper" },
|
|
160
158
|
h("slot", { name: "q2-section-header" }))),
|
|
161
|
-
this.collapsible && !this.noCollapseIcon ? (h("q2-btn", { class: `q2-section-content-toggle ${this.expanded ? 'expanded' : 'collapsed'}`, label: this.label, ariaExpanded: !!this.expanded
|
|
159
|
+
this.collapsible && !this.noCollapseIcon ? (h("q2-btn", { class: `q2-section-content-toggle ${this.expanded ? 'expanded' : 'collapsed'}`, label: this.label, ariaExpanded: `${!!this.expanded}`, ariaControls: this.contentId, "test-id": "toggleButton", "hide-label": true, onClick: this.onHeaderClick },
|
|
162
160
|
h("q2-icon", { type: "chevron-up", class: "toggle-icon" }))) : ('')),
|
|
163
161
|
h("div", { class: "q2-section-content-wrapper", id: this.contentId, "aria-labelledby": this.titleId, role: "region", onAnimationStart: this.onAnimationStart, onAnimationEnd: this.onAnimationEnd },
|
|
164
162
|
h("div", { class: "q2-section-content", tabindex: "-1" },
|