q2-tecton-elements 1.23.0 → 1.25.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.
- package/dist/cjs/action-sheet-4b366e9a.js +84 -0
- package/dist/cjs/{index-0648c2ec.js → index-dc92e71f.js} +32 -5
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/q2-action-sheet.cjs.entry.js +218 -0
- package/dist/cjs/q2-badge_2.cjs.entry.js +46 -17
- package/dist/cjs/q2-btn_2.cjs.entry.js +1 -1
- package/dist/cjs/q2-calendar.cjs.entry.js +2 -4
- package/dist/cjs/q2-card.cjs.entry.js +1 -1
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-area.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-bar.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-donut.cjs.entry.js +1 -1
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/q2-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
- package/dist/cjs/q2-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
- package/dist/cjs/q2-icon.cjs.entry.js +1 -1
- package/dist/cjs/q2-loc.cjs.entry.js +1 -1
- package/dist/cjs/q2-message.cjs.entry.js +1 -1
- package/dist/cjs/q2-month-picker.cjs.entry.js +1 -1
- package/dist/cjs/q2-optgroup_2.cjs.entry.js +93 -0
- package/dist/cjs/q2-option-list_2.cjs.entry.js +226 -86
- package/dist/cjs/q2-pagination.cjs.entry.js +1 -1
- package/dist/cjs/q2-pill.cjs.entry.js +57 -18
- package/dist/cjs/q2-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/q2-radio.cjs.entry.js +1 -1
- package/dist/cjs/q2-section.cjs.entry.js +1 -1
- package/dist/cjs/q2-select.cjs.entry.js +148 -409
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js +1 -1
- package/dist/cjs/q2-stepper.cjs.entry.js +1 -1
- package/dist/cjs/q2-tab-container.cjs.entry.js +1 -1
- package/dist/cjs/q2-tag.cjs.entry.js +21 -7
- package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
- package/dist/cjs/q2-textarea.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/q2-action-sheet/index.js +345 -0
- package/dist/collection/components/q2-action-sheet/styles.css +215 -0
- package/dist/collection/components/q2-calendar/index.js +2 -4
- package/dist/collection/components/q2-checkbox/index.js +2 -2
- package/dist/collection/components/q2-dropdown/index.js +1 -1
- package/dist/collection/components/q2-input/index.js +46 -17
- package/dist/collection/components/q2-loading/index.js +1 -1
- package/dist/collection/components/q2-optgroup/styles.css +2 -2
- package/dist/collection/components/q2-option/index.js +3 -58
- package/dist/collection/components/q2-option/styles.css +7 -0
- package/dist/collection/components/q2-option-list/index.js +290 -102
- package/dist/collection/components/q2-pill/index.js +79 -18
- package/dist/collection/components/q2-pill/styles.css +1 -2
- package/dist/collection/components/q2-popover/index.js +17 -3
- package/dist/collection/components/q2-popover/styles.css +10 -67
- package/dist/collection/components/q2-radio/index.js +2 -2
- package/dist/collection/components/q2-select/index.js +179 -427
- package/dist/collection/components/q2-select/styles.css +5 -11
- package/dist/collection/components/q2-tag/index.js +33 -19
- package/dist/collection/utils/action-sheet.js +79 -0
- package/dist/collection/utils/index.js +29 -5
- package/dist/components/action-sheet.js +81 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index10.js +1 -1
- package/dist/components/index11.js +42 -353
- package/dist/components/index12.js +44 -99
- package/dist/components/index13.js +495 -583
- package/dist/components/index14.js +137 -0
- package/dist/components/index15.js +629 -0
- package/dist/components/index5.js +1 -1
- package/dist/components/index6.js +1 -1
- package/dist/components/index7.js +1 -1
- package/dist/components/index8.js +46 -17
- package/dist/components/index9.js +2 -2
- package/dist/components/q2-action-sheet.d.ts +11 -0
- package/dist/components/q2-action-sheet.js +282 -0
- package/dist/components/q2-calendar.js +2 -4
- package/dist/components/q2-card.js +1 -1
- package/dist/components/q2-carousel-pane.js +1 -1
- package/dist/components/q2-carousel.js +1 -1
- package/dist/components/q2-chart-area.js +1 -1
- package/dist/components/q2-chart-bar.js +1 -1
- package/dist/components/q2-chart-donut.js +1 -1
- package/dist/components/q2-checkbox-group.js +1 -1
- package/dist/components/q2-checkbox.js +1 -1
- package/dist/components/q2-dropdown.js +2 -2
- package/dist/components/q2-editable-field.js +1 -1
- package/dist/components/q2-loc.js +1 -1
- package/dist/components/q2-month-picker.js +1 -1
- package/dist/components/q2-optgroup.js +1 -70
- package/dist/components/q2-option-list.js +1 -1
- package/dist/components/q2-option.js +1 -76
- package/dist/components/q2-pagination.js +1 -1
- package/dist/components/q2-pill.js +62 -21
- package/dist/components/q2-popover.js +1 -1
- package/dist/components/q2-radio-group.js +1 -1
- package/dist/components/q2-radio.js +3 -3
- package/dist/components/q2-section.js +1 -1
- package/dist/components/q2-select.js +179 -427
- package/dist/components/q2-stepper-pane.js +1 -1
- package/dist/components/q2-stepper-vertical.js +1 -1
- package/dist/components/q2-stepper.js +1 -1
- package/dist/components/q2-tab-container.js +1 -1
- package/dist/components/q2-tag.js +25 -11
- package/dist/components/q2-textarea.js +1 -1
- package/dist/docs.d.ts +148 -0
- package/dist/docs.json +8755 -0
- package/dist/esm/action-sheet-a9597b32.js +81 -0
- package/dist/esm/{index-501fd22e.js → index-d4a87058.js} +30 -6
- package/dist/esm/loader.js +1 -1
- package/dist/esm/q2-action-sheet.entry.js +214 -0
- package/dist/esm/q2-badge_2.entry.js +46 -17
- package/dist/esm/q2-btn_2.entry.js +1 -1
- package/dist/esm/q2-calendar.entry.js +2 -4
- package/dist/esm/q2-card.entry.js +1 -1
- package/dist/esm/q2-carousel-pane.entry.js +1 -1
- package/dist/esm/q2-carousel.entry.js +1 -1
- package/dist/esm/q2-chart-area.entry.js +1 -1
- package/dist/esm/q2-chart-bar.entry.js +1 -1
- package/dist/esm/q2-chart-donut.entry.js +1 -1
- package/dist/esm/q2-checkbox-group.entry.js +1 -1
- package/dist/esm/q2-checkbox.entry.js +1 -1
- package/dist/esm/q2-dropdown-item.entry.js +1 -1
- package/dist/esm/q2-dropdown.entry.js +1 -1
- package/dist/esm/q2-editable-field.entry.js +1 -1
- package/dist/esm/q2-icon.entry.js +1 -1
- package/dist/esm/q2-loc.entry.js +1 -1
- package/dist/esm/q2-message.entry.js +1 -1
- package/dist/esm/q2-month-picker.entry.js +1 -1
- package/dist/esm/q2-optgroup_2.entry.js +88 -0
- package/dist/esm/q2-option-list_2.entry.js +226 -86
- package/dist/esm/q2-pagination.entry.js +1 -1
- package/dist/esm/q2-pill.entry.js +57 -18
- package/dist/esm/q2-radio-group.entry.js +1 -1
- package/dist/esm/q2-radio.entry.js +1 -1
- package/dist/esm/q2-section.entry.js +1 -1
- package/dist/esm/q2-select.entry.js +148 -409
- package/dist/esm/q2-stepper-pane.entry.js +1 -1
- package/dist/esm/q2-stepper-vertical.entry.js +1 -1
- package/dist/esm/q2-stepper.entry.js +1 -1
- package/dist/esm/q2-tab-container.entry.js +1 -1
- package/dist/esm/q2-tag.entry.js +22 -8
- package/dist/esm/q2-tecton-elements.js +1 -1
- package/dist/esm/q2-textarea.entry.js +1 -1
- package/dist/q2-tecton-elements/p-059065e4.js +1 -0
- package/dist/q2-tecton-elements/{p-9b101e22.entry.js → p-1a744921.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-3fd5d010.entry.js → p-1b95e43f.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-3603fcdc.entry.js → p-1ea4b8bd.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-53be87c8.entry.js → p-1f3eb04c.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-25839309.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-38a33baa.entry.js → p-274ec152.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-6be86940.entry.js → p-2ba9e1a2.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-ebd7efa5.entry.js → p-2c309c54.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-3e9a30c4.entry.js → p-2cc70f49.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-604b22a8.entry.js → p-2ceb41c4.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-2e938b20.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-5b1aba1a.entry.js → p-306a4bc7.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-32f44993.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-d7b27803.entry.js → p-3a9aac19.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-3c73ce3f.entry.js +1 -0
- package/dist/q2-tecton-elements/p-4a95f78e.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-6b7e1ebd.entry.js → p-4b48a49d.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-4b92e44e.entry.js +1 -0
- package/dist/q2-tecton-elements/p-5ecb9c27.entry.js +1 -0
- package/dist/q2-tecton-elements/p-6779270e.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-70b01387.entry.js → p-72fc58e7.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-7ac02ae5.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-78fac0fa.entry.js → p-7c168977.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-d27b2caa.entry.js → p-7c9bf80a.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-83d678c7.entry.js +1 -0
- package/dist/q2-tecton-elements/p-a1926e65.js +1 -0
- package/dist/q2-tecton-elements/{p-24f4571d.entry.js → p-a3a5b57b.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-a6296870.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-45d61789.entry.js → p-a64e7eb1.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-8dea9a0c.entry.js → p-ad83984e.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-bf41e71b.entry.js → p-bf0ed24a.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-a2add94e.entry.js → p-bff85959.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-7aa80653.entry.js → p-c4a9ab25.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-ea5383ba.entry.js +1 -0
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/test/helpers.js +3 -2
- package/dist/types/components/q2-action-sheet/index.d.ts +52 -0
- package/dist/types/components/q2-checkbox/index.d.ts +4 -1
- package/dist/types/components/q2-input/index.d.ts +5 -0
- package/dist/types/components/q2-option/index.d.ts +1 -4
- package/dist/types/components/q2-option-list/index.d.ts +16 -8
- package/dist/types/components/q2-pill/index.d.ts +10 -1
- package/dist/types/components/q2-popover/index.d.ts +2 -0
- package/dist/types/components/q2-select/index.d.ts +45 -47
- package/dist/types/components/q2-tag/index.d.ts +3 -3
- package/dist/types/components.d.ts +44 -17
- package/dist/types/global.d.ts +9 -2
- package/dist/types/utils/action-sheet.d.ts +12 -0
- package/dist/types/utils/index.d.ts +4 -1
- package/dist/types/workspace/workspace/Tecton_tecton-production_master/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +1 -1
- package/package.json +4 -2
- package/dist/cjs/q2-optgroup.cjs.entry.js +0 -56
- package/dist/cjs/q2-option.cjs.entry.js +0 -46
- package/dist/esm/q2-optgroup.entry.js +0 -52
- package/dist/esm/q2-option.entry.js +0 -42
- package/dist/q2-tecton-elements/p-18629cbf.entry.js +0 -1
- package/dist/q2-tecton-elements/p-2c20fc43.entry.js +0 -1
- package/dist/q2-tecton-elements/p-3813f51d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-68ef0786.entry.js +0 -1
- package/dist/q2-tecton-elements/p-a510290a.js +0 -1
- package/dist/q2-tecton-elements/p-acc77332.entry.js +0 -1
- package/dist/q2-tecton-elements/p-ba73ee1f.entry.js +0 -1
- package/dist/q2-tecton-elements/p-ba76ecfd.entry.js +0 -1
- package/dist/q2-tecton-elements/p-bbdae095.entry.js +0 -1
- package/dist/q2-tecton-elements/p-d68b5eb3.entry.js +0 -1
- package/dist/q2-tecton-elements/p-d88e4383.entry.js +0 -1
- package/dist/q2-tecton-elements/p-f1d06917.entry.js +0 -1
- package/dist/q2-tecton-elements/p-f6e868c1.entry.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h, Fragment } 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, isMobile, } from 'src/utils';
|
|
3
3
|
import formatCurrency from './formatting/currency';
|
|
4
4
|
import formatPhoneNumber from './formatting/phone';
|
|
5
5
|
import formatSSN from './formatting/ssn';
|
|
@@ -12,15 +12,20 @@ import formatCreditCard from './formatting/credit-card';
|
|
|
12
12
|
export class Q2Input {
|
|
13
13
|
constructor() {
|
|
14
14
|
this.scheduledAfterRender = [];
|
|
15
|
+
this.isMobile = isMobile();
|
|
15
16
|
this.guid = createGuid();
|
|
16
17
|
///// ACTIONS ////////
|
|
17
18
|
this.onToggleVisibility = () => {
|
|
18
19
|
this.textHidden = !this.textHidden;
|
|
19
20
|
};
|
|
21
|
+
this.onInputClick = () => {
|
|
22
|
+
if (this.shouldCursorStayAtEnd)
|
|
23
|
+
this.placeCursorAtEnd();
|
|
24
|
+
};
|
|
20
25
|
this.onInputFocus = () => {
|
|
21
|
-
this.scheduledAfterRender.push(() =>
|
|
22
|
-
this.
|
|
23
|
-
|
|
26
|
+
this.scheduledAfterRender.push(() => this.shouldCursorStayAtEnd
|
|
27
|
+
? this.placeCursorAtEnd()
|
|
28
|
+
: this.setCursorPosition(this.calculateCursorPositionOnFocus()));
|
|
24
29
|
this.hasFocus = true;
|
|
25
30
|
setMessageHeight(this);
|
|
26
31
|
this.valueOnFocus = this.value;
|
|
@@ -47,7 +52,11 @@ export class Q2Input {
|
|
|
47
52
|
}
|
|
48
53
|
};
|
|
49
54
|
this.onInputKeydown = (event) => {
|
|
50
|
-
|
|
55
|
+
const keysThatMoveCursor = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Home', 'End'];
|
|
56
|
+
const { key } = event;
|
|
57
|
+
if (this.shouldCursorStayAtEnd && keysThatMoveCursor.includes(key))
|
|
58
|
+
event.preventDefault();
|
|
59
|
+
if (key === 'Enter' && this.valueOnFocus !== this.formattedValueObject.value) {
|
|
51
60
|
this.valueOnFocus = this.formattedValueObject.value;
|
|
52
61
|
this.change.emit(Object.assign({ value: this.formattedValueObject.value, formattedValue: this.formattedValueObject.fullyFormattedValue, minFormattedLength: this.formattedValueObject.minFormattedLength }, (this.formattedValueObject.type && { type: this.formattedValueObject.type })));
|
|
53
62
|
}
|
|
@@ -149,6 +158,9 @@ export class Q2Input {
|
|
|
149
158
|
get canClear() {
|
|
150
159
|
return this.clearable && !!this.value;
|
|
151
160
|
}
|
|
161
|
+
get shouldCursorStayAtEnd() {
|
|
162
|
+
return this.isMobile && this.type === 'currency';
|
|
163
|
+
}
|
|
152
164
|
get hasError() {
|
|
153
165
|
return Array.isArray(this.errors) && this.errors.length > 0;
|
|
154
166
|
}
|
|
@@ -221,16 +233,16 @@ export class Q2Input {
|
|
|
221
233
|
search: 'search',
|
|
222
234
|
url: 'url',
|
|
223
235
|
email: 'email',
|
|
224
|
-
currency: '
|
|
236
|
+
currency: 'text',
|
|
225
237
|
phone: 'tel',
|
|
226
|
-
ssn: '
|
|
238
|
+
ssn: 'text',
|
|
227
239
|
alphanumeric: 'text',
|
|
228
240
|
alpha: 'text',
|
|
229
|
-
numeric: '
|
|
230
|
-
percentage: '
|
|
231
|
-
postal: '
|
|
232
|
-
date: '
|
|
233
|
-
'credit-card': '
|
|
241
|
+
numeric: 'text',
|
|
242
|
+
percentage: 'text',
|
|
243
|
+
postal: 'text',
|
|
244
|
+
date: 'text',
|
|
245
|
+
'credit-card': 'text',
|
|
234
246
|
};
|
|
235
247
|
if (['password', 'text', 'ssn'].includes(this.type) && this.textHidden) {
|
|
236
248
|
return 'password';
|
|
@@ -240,7 +252,7 @@ export class Q2Input {
|
|
|
240
252
|
}
|
|
241
253
|
}
|
|
242
254
|
get computedAutocomplete() {
|
|
243
|
-
// force off for
|
|
255
|
+
// force off for currency type
|
|
244
256
|
if (this.type === 'currency')
|
|
245
257
|
return 'transaction-amount';
|
|
246
258
|
return this.autocomplete || 'off';
|
|
@@ -283,6 +295,18 @@ export class Q2Input {
|
|
|
283
295
|
this.inputField.value = this.formattedValueObject.formattedValue;
|
|
284
296
|
}
|
|
285
297
|
}
|
|
298
|
+
get inputMode() {
|
|
299
|
+
const inputModeMap = {
|
|
300
|
+
currency: 'numeric',
|
|
301
|
+
ssn: 'numeric',
|
|
302
|
+
numeric: 'decimal',
|
|
303
|
+
percentage: 'decimal',
|
|
304
|
+
postal: 'numeric',
|
|
305
|
+
date: 'numeric',
|
|
306
|
+
'credit-card': 'numeric',
|
|
307
|
+
};
|
|
308
|
+
return (this.type && inputModeMap[this.type]) || undefined;
|
|
309
|
+
}
|
|
286
310
|
//////// OBSERVERS //////////
|
|
287
311
|
ariaLabelObserver() {
|
|
288
312
|
handleAriaLabel(this);
|
|
@@ -347,7 +371,7 @@ export class Q2Input {
|
|
|
347
371
|
const inputClasses = ['input-field'];
|
|
348
372
|
if (hasCustomDisplaySlot)
|
|
349
373
|
inputClasses.push('sr');
|
|
350
|
-
return (h(Fragment, null, hasCustomDisplaySlot && (h("div", { class: "custom-display-container" }, h("slot", { name: "custom-display" }))), h("input", { class: inputClasses.join(' '), id: this.inputId, type: this.computedType, size: this.formattedValueObject.prefix ? 10 : undefined, max: this.max, min: this.min, step: this.step, "aria-current": this.current || undefined, "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.hideLabel && this.label ? loc(this.label) : undefined, autocomplete: this.computedAutocomplete, autocapitalize: this.autocapitalize === 'on' ? 'on' : 'off', autocorrect: this.autocorrect === 'on' ? 'on' : 'off', placeholder: (this.placeholder && loc(this.placeholder)) || undefined, role: (this.role && `${this.role}`) || undefined, "test-id": "inputField", readonly: !!this.readonly, disabled: !!this.disabled, onFocus: this.onInputFocus, onBlur: this.onInputBlur, onKeyDown: this.onInputKeydown, onInput: this.onInputInput, onPaste: this.onInputPaste })));
|
|
374
|
+
return (h(Fragment, null, hasCustomDisplaySlot && (h("div", { class: "custom-display-container" }, h("slot", { name: "custom-display" }))), h("input", { class: inputClasses.join(' '), id: this.inputId, type: this.computedType, size: this.formattedValueObject.prefix ? 10 : undefined, max: this.max, min: this.min, step: this.step, "aria-current": this.current || undefined, "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.hideLabel && this.label ? loc(this.label) : undefined, autocomplete: this.computedAutocomplete, autocapitalize: this.autocapitalize === 'on' ? 'on' : 'off', autocorrect: this.autocorrect === 'on' ? 'on' : 'off', placeholder: (this.placeholder && loc(this.placeholder)) || undefined, role: (this.role && `${this.role}`) || undefined, "test-id": "inputField", readonly: !!this.readonly, disabled: !!this.disabled, onFocus: this.onInputFocus, onBlur: this.onInputBlur, onClick: this.onInputClick, onKeyDown: this.onInputKeydown, onInput: this.onInputInput, onPaste: this.onInputPaste, inputmode: this.inputMode })));
|
|
351
375
|
}
|
|
352
376
|
/* tslint:enable:cyclomatic-complexity */
|
|
353
377
|
pseudoInputDOM() {
|
|
@@ -361,6 +385,10 @@ export class Q2Input {
|
|
|
361
385
|
}
|
|
362
386
|
return (h("div", { class: "pseudo-input-container" }, h("button", { class: "input-field", type: "button", id: this.inputId, "aria-describedby": this.inputDescribedBy, "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 === 'true' ? 'true' : 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" }, h("div", { class: "custom-display-container" }, h("slot", { name: "custom-display" }, h("span", { class: showPlaceholder ? 'placeholder-text' : '' }, showPlaceholder ? this.placeholder : this.value))))));
|
|
363
387
|
}
|
|
388
|
+
placeCursorAtEnd() {
|
|
389
|
+
const { inputField } = this;
|
|
390
|
+
inputField.selectionStart = inputField.selectionEnd = inputField.value.length;
|
|
391
|
+
}
|
|
364
392
|
calculateCursorPositionOnInput() {
|
|
365
393
|
const input = this.inputField;
|
|
366
394
|
const formattedLength = this.formattedValueObject.formattedValue.length;
|
|
@@ -374,9 +402,10 @@ export class Q2Input {
|
|
|
374
402
|
};
|
|
375
403
|
}
|
|
376
404
|
calculateCursorPositionOnFocus() {
|
|
377
|
-
|
|
378
|
-
const
|
|
379
|
-
const
|
|
405
|
+
var _a, _b, _c;
|
|
406
|
+
const { inputField } = this;
|
|
407
|
+
const valueLength = (_b = (_a = inputField === null || inputField === void 0 ? void 0 : inputField.value) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
|
|
408
|
+
const startingPosition = (_c = inputField === null || inputField === void 0 ? void 0 : inputField.selectionStart) !== null && _c !== void 0 ? _c : valueLength;
|
|
380
409
|
return {
|
|
381
410
|
startingPosition,
|
|
382
411
|
valueLength,
|
|
@@ -76,6 +76,6 @@ button {
|
|
|
76
76
|
font-weight: var(--tct-optgroup-header-font-weight, var(--t-optgroup-header-font-weight, 600));
|
|
77
77
|
text-transform: var(--tct-optgroup-header-text-transform, var(--t-optgroup-header-text-transform, uppercase));
|
|
78
78
|
position: sticky;
|
|
79
|
-
top: var(--comp-multi-select-header-height,
|
|
80
|
-
z-index:
|
|
79
|
+
top: calc(var(--comp-multi-select-header-height, 0px) + var(--tct-optgroup-top, var(--t-optgroup-top, 0px)));
|
|
80
|
+
z-index: 5;
|
|
81
81
|
}
|
|
@@ -2,17 +2,14 @@ import { h, Host } from '@stencil/core';
|
|
|
2
2
|
export class Q2Option {
|
|
3
3
|
constructor() {
|
|
4
4
|
this.role = 'option';
|
|
5
|
-
this.tabindex = '-1';
|
|
6
5
|
this.display = undefined;
|
|
7
6
|
this.value = undefined;
|
|
8
7
|
this.disabled = undefined;
|
|
9
|
-
this.optionId = undefined;
|
|
10
8
|
this.disabledGroup = undefined;
|
|
11
9
|
this.selected = undefined;
|
|
12
10
|
this.hidden = undefined;
|
|
13
11
|
this.multiline = undefined;
|
|
14
12
|
this.active = undefined;
|
|
15
|
-
this.noSelect = undefined;
|
|
16
13
|
this._multiSelectHidden = false;
|
|
17
14
|
}
|
|
18
15
|
componentWillLoad() {
|
|
@@ -26,7 +23,7 @@ export class Q2Option {
|
|
|
26
23
|
render() {
|
|
27
24
|
const { disabled, disabledGroup, selected, _multiSelectHidden } = this;
|
|
28
25
|
const isDisabled = disabled || disabledGroup;
|
|
29
|
-
return (h(Host, { "aria-disabled": isDisabled ? 'true' : undefined, "aria-selected": selected ? 'true' : undefined, "aria-hidden": _multiSelectHidden ? 'true' : undefined }, this.selected && h("q2-icon", { type: "checkmark" }), h("div", { class: "content" }, h("slot", null))));
|
|
26
|
+
return (h(Host, { tabindex: "-1", "aria-disabled": isDisabled ? 'true' : undefined, "aria-selected": selected ? 'true' : undefined, "aria-hidden": _multiSelectHidden ? 'true' : undefined }, this.selected && h("q2-icon", { type: "checkmark" }), h("div", { class: "content" }, h("slot", null))));
|
|
30
27
|
}
|
|
31
28
|
static get is() { return "q2-option"; }
|
|
32
29
|
static get encapsulation() { return "shadow"; }
|
|
@@ -46,8 +43,8 @@ export class Q2Option {
|
|
|
46
43
|
"type": "string",
|
|
47
44
|
"mutable": false,
|
|
48
45
|
"complexType": {
|
|
49
|
-
"original": "
|
|
50
|
-
"resolved": "
|
|
46
|
+
"original": "'option' | 'menuitem'",
|
|
47
|
+
"resolved": "\"menuitem\" | \"option\"",
|
|
51
48
|
"references": {}
|
|
52
49
|
},
|
|
53
50
|
"required": false,
|
|
@@ -60,24 +57,6 @@ export class Q2Option {
|
|
|
60
57
|
"reflect": true,
|
|
61
58
|
"defaultValue": "'option'"
|
|
62
59
|
},
|
|
63
|
-
"tabindex": {
|
|
64
|
-
"type": "string",
|
|
65
|
-
"mutable": false,
|
|
66
|
-
"complexType": {
|
|
67
|
-
"original": "string",
|
|
68
|
-
"resolved": "string",
|
|
69
|
-
"references": {}
|
|
70
|
-
},
|
|
71
|
-
"required": false,
|
|
72
|
-
"optional": false,
|
|
73
|
-
"docs": {
|
|
74
|
-
"tags": [],
|
|
75
|
-
"text": ""
|
|
76
|
-
},
|
|
77
|
-
"attribute": "tabindex",
|
|
78
|
-
"reflect": true,
|
|
79
|
-
"defaultValue": "'-1'"
|
|
80
|
-
},
|
|
81
60
|
"display": {
|
|
82
61
|
"type": "string",
|
|
83
62
|
"mutable": true,
|
|
@@ -129,23 +108,6 @@ export class Q2Option {
|
|
|
129
108
|
"attribute": "disabled",
|
|
130
109
|
"reflect": true
|
|
131
110
|
},
|
|
132
|
-
"optionId": {
|
|
133
|
-
"type": "string",
|
|
134
|
-
"mutable": false,
|
|
135
|
-
"complexType": {
|
|
136
|
-
"original": "string",
|
|
137
|
-
"resolved": "string",
|
|
138
|
-
"references": {}
|
|
139
|
-
},
|
|
140
|
-
"required": false,
|
|
141
|
-
"optional": false,
|
|
142
|
-
"docs": {
|
|
143
|
-
"tags": [],
|
|
144
|
-
"text": ""
|
|
145
|
-
},
|
|
146
|
-
"attribute": "option-id",
|
|
147
|
-
"reflect": true
|
|
148
|
-
},
|
|
149
111
|
"disabledGroup": {
|
|
150
112
|
"type": "boolean",
|
|
151
113
|
"mutable": false,
|
|
@@ -231,23 +193,6 @@ export class Q2Option {
|
|
|
231
193
|
"attribute": "active",
|
|
232
194
|
"reflect": true
|
|
233
195
|
},
|
|
234
|
-
"noSelect": {
|
|
235
|
-
"type": "boolean",
|
|
236
|
-
"mutable": false,
|
|
237
|
-
"complexType": {
|
|
238
|
-
"original": "boolean",
|
|
239
|
-
"resolved": "boolean",
|
|
240
|
-
"references": {}
|
|
241
|
-
},
|
|
242
|
-
"required": false,
|
|
243
|
-
"optional": false,
|
|
244
|
-
"docs": {
|
|
245
|
-
"tags": [],
|
|
246
|
-
"text": ""
|
|
247
|
-
},
|
|
248
|
-
"attribute": "_no-select",
|
|
249
|
-
"reflect": true
|
|
250
|
-
},
|
|
251
196
|
"_multiSelectHidden": {
|
|
252
197
|
"type": "boolean",
|
|
253
198
|
"mutable": false,
|
|
@@ -78,6 +78,13 @@ button {
|
|
|
78
78
|
gap: var(--tct-scale-1, var(--app-scale-1x, 5px));
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
:host(:focus),
|
|
82
|
+
:host(:hover),
|
|
83
|
+
:host([active]) {
|
|
84
|
+
position: relative;
|
|
85
|
+
z-index: 1;
|
|
86
|
+
}
|
|
87
|
+
|
|
81
88
|
:host([multiline]) {
|
|
82
89
|
--comp-padding: var(--app-scale-2, 10px) var(--app-scale-2, 10px);
|
|
83
90
|
--comp-selected-icon-size: var(--tct-option-selected-icon-size, var(--t-option-selected-icon-size, 26px));
|