q2-tecton-elements 1.71.2 → 1.72.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/bundle-report.json +1282 -594
- package/dist/cjs/click-elsewhere_3.cjs.entry.js +10 -9
- package/dist/cjs/{index-SpDCZABA.js → index-BY3aao8R.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{q2-action-group_2.cjs.entry.js → q2-action-group.cjs.entry.js} +1 -89
- package/dist/cjs/q2-action-sheet.cjs.entry.js +1 -1
- package/dist/cjs/q2-badge_2.cjs.entry.js +113 -12
- package/dist/cjs/q2-btn_2.cjs.entry.js +2 -2
- package/dist/cjs/q2-calendar.cjs.entry.js +7 -5
- package/dist/cjs/q2-card-image.cjs.entry.js +4 -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 +2 -2
- package/dist/cjs/q2-checkbox_2.cjs.entry.js +3 -3
- package/dist/cjs/q2-context.cjs.entry.js +4 -3
- package/dist/cjs/q2-data-table.cjs.entry.js +2 -2
- package/dist/cjs/q2-detail.cjs.entry.js +1 -1
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
- package/dist/cjs/q2-dropdown.cjs.entry.js +3 -3
- package/dist/cjs/q2-editable-field.cjs.entry.js +38 -37
- package/dist/cjs/q2-file-picker.cjs.entry.js +60 -4
- package/dist/cjs/q2-icon.cjs.entry.js +1 -1
- package/dist/cjs/q2-item.cjs.entry.js +2 -2
- package/dist/cjs/q2-link_2.cjs.entry.js +1 -1
- package/dist/cjs/q2-loc.cjs.entry.js +1 -1
- package/dist/cjs/q2-message.cjs.entry.js +2 -2
- package/dist/cjs/q2-meter.cjs.entry.js +1 -1
- package/dist/cjs/q2-modal.cjs.entry.js +59 -17
- package/dist/cjs/q2-month-picker.cjs.entry.js +1 -1
- package/dist/cjs/q2-optgroup.cjs.entry.js +1 -1
- package/dist/cjs/q2-option.cjs.entry.js +1 -1
- package/dist/cjs/q2-otp.cjs.entry.js +1 -1
- package/dist/cjs/q2-pagination.cjs.entry.js +1 -1
- package/dist/cjs/q2-pill.cjs.entry.js +2 -2
- package/dist/cjs/q2-radio-group.cjs.entry.js +22 -4
- package/dist/cjs/q2-radio.cjs.entry.js +3 -3
- package/dist/cjs/q2-relative-time.cjs.entry.js +3 -3
- package/dist/cjs/q2-resize-observer.cjs.entry.js +92 -0
- package/dist/cjs/q2-search.cjs.entry.js +2 -2
- package/dist/cjs/q2-section.cjs.entry.js +7 -7
- package/dist/cjs/q2-select.cjs.entry.js +35 -19
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +2 -2
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js +2 -2
- package/dist/cjs/q2-stepper.cjs.entry.js +1 -1
- package/dist/cjs/q2-surface.cjs.entry.js +1 -1
- package/dist/cjs/q2-tab-container.cjs.entry.js +2 -2
- package/dist/cjs/q2-tab-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
- package/dist/cjs/q2-textarea.cjs.entry.js +1 -1
- package/dist/cjs/q2-toast.cjs.entry.js +1 -1
- package/dist/cjs/q2-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/tecton-tab-pane.cjs.entry.js +5 -3
- package/dist/collection/components/q2-btn/q2-btn.css +79 -21
- package/dist/collection/components/q2-btn/test/q2-btn-test.vr.js +156 -3
- package/dist/collection/components/q2-calendar/q2-calendar.css +3 -0
- package/dist/collection/components/q2-calendar/q2-calendar.js +5 -3
- package/dist/collection/components/q2-calendar/test/q2-calendar-test.vr.js +23 -2
- package/dist/collection/components/q2-card/test/q2-card-test.vr.js +4 -0
- package/dist/collection/components/q2-card-image/q2-card-image.css +89 -134
- package/dist/collection/components/q2-card-image/q2-card-image.js +4 -4
- package/dist/collection/components/q2-card-image/test/q2-card-image-test.vr.js +4 -0
- package/dist/collection/components/q2-carousel/test/q2-carousel-test.vr.js +13 -0
- package/dist/collection/components/q2-checkbox/q2-checkbox.css +2 -2
- package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.css +2 -0
- package/dist/collection/components/q2-context/q2-context.css +5 -0
- package/dist/collection/components/q2-context/q2-context.js +2 -1
- package/dist/collection/components/q2-context/test/q2-context-test.vr.js +11 -1
- package/dist/collection/components/q2-data-table/q2-data-table.css +3 -0
- package/dist/collection/components/q2-data-table/test/q2-data-table-test.vr.js +5 -0
- package/dist/collection/components/q2-dropdown/q2-dropdown.css +2 -0
- package/dist/collection/components/q2-dropdown/q2-dropdown.js +1 -1
- package/dist/collection/components/q2-dropdown/test/q2-dropdown-test.vr.js +30 -0
- package/dist/collection/components/q2-editable-field/q2-editable-field.css +2 -0
- package/dist/collection/components/q2-editable-field/q2-editable-field.js +38 -43
- package/dist/collection/components/q2-file-picker/q2-file-picker.css +27 -0
- package/dist/collection/components/q2-file-picker/q2-file-picker.js +98 -2
- package/dist/collection/components/q2-file-picker/test/q2-file-picker-test.vr.js +22 -0
- package/dist/collection/components/q2-input/q2-input.css +67 -1
- package/dist/collection/components/q2-input/q2-input.js +155 -13
- package/dist/collection/components/q2-input/test/q2-input-test.vr.js +35 -0
- package/dist/collection/components/q2-item/q2-item.css +3 -1
- package/dist/collection/components/q2-item/test/q2-item-test.vr.js +6 -0
- package/dist/collection/components/q2-message/q2-message.css +5 -5
- package/dist/collection/components/q2-modal/q2-modal.css +40 -3
- package/dist/collection/components/q2-modal/q2-modal.js +100 -16
- package/dist/collection/components/q2-modal/test/q2-modal-test.vr.js +25 -0
- package/dist/collection/components/q2-pill/q2-pill.css +2 -2
- package/dist/collection/components/q2-popover/q2-popover.css +3 -2
- package/dist/collection/components/q2-popover/q2-popover.js +8 -7
- package/dist/collection/components/q2-radio/q2-radio.css +158 -104
- package/dist/collection/components/q2-radio/q2-radio.js +1 -1
- package/dist/collection/components/q2-radio/test/q2-radio-test.vr.js +25 -2
- package/dist/collection/components/q2-radio-group/q2-radio-group.css +39 -2
- package/dist/collection/components/q2-radio-group/q2-radio-group.js +68 -2
- package/dist/collection/components/q2-radio-group/test/q2-radio-group-test.vr.js +43 -1
- package/dist/collection/components/q2-relative-time/q2-relative-time.js +2 -2
- package/dist/collection/components/q2-search/q2-search.css +2 -0
- package/dist/collection/components/q2-section/q2-section.css +2 -0
- package/dist/collection/components/q2-section/q2-section.js +6 -6
- package/dist/collection/components/q2-select/q2-select.css +3 -0
- package/dist/collection/components/q2-select/q2-select.js +37 -18
- package/dist/collection/components/q2-select/test/q2-select-test.vr.js +13 -0
- package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js +1 -1
- package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js +1 -1
- package/dist/collection/components/q2-surface/q2-surface.js +1 -1
- package/dist/collection/components/q2-tab-container/q2-tab-container.js +1 -1
- package/dist/collection/components/q2-tab-pane/q2-tab-pane.js +1 -1
- package/dist/collection/components/q2-tag/q2-tag.js +1 -1
- package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js +5 -3
- package/dist/collection/utils/index.js +1 -1
- package/dist/collection/utils/test/vr-helpers.js +16 -2
- package/dist/components/index2.js +1 -1
- package/dist/components/q2-btn2.js +1 -1
- package/dist/components/q2-calendar.js +11 -9
- package/dist/components/q2-card-image.js +24 -24
- package/dist/components/q2-checkbox-group.js +6 -6
- package/dist/components/q2-checkbox2.js +1 -1
- package/dist/components/q2-context.js +27 -26
- package/dist/components/q2-data-table.js +1 -1
- package/dist/components/q2-dropdown.js +21 -21
- package/dist/components/q2-editable-field.js +33 -35
- package/dist/components/q2-file-picker.js +70 -10
- package/dist/components/q2-input2.js +268 -163
- package/dist/components/q2-item2.js +1 -1
- package/dist/components/q2-message2.js +24 -24
- package/dist/components/q2-modal.js +96 -78
- package/dist/components/q2-pill.js +1 -1
- package/dist/components/q2-popover2.js +29 -26
- package/dist/components/q2-radio-group.js +70 -40
- package/dist/components/q2-radio.js +40 -55
- package/dist/components/q2-relative-time.js +5 -5
- package/dist/components/q2-search.js +1 -1
- package/dist/components/q2-section.js +33 -33
- package/dist/components/q2-select2.js +46 -39
- package/dist/components/q2-stepper-pane.js +15 -11
- package/dist/components/q2-stepper-vertical.js +4 -4
- package/dist/components/q2-surface.js +3 -3
- package/dist/components/q2-tab-container.js +21 -21
- package/dist/components/q2-tab-pane.js +2 -2
- package/dist/components/q2-tag2.js +5 -5
- package/dist/components/tecton-tab-pane.js +8 -7
- package/dist/esm/click-elsewhere_3.entry.js +10 -9
- package/dist/esm/{index-Cps4jSQM.js → index-DJw6Feh0.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{q2-action-group_2.entry.js → q2-action-group.entry.js} +3 -90
- package/dist/esm/q2-action-sheet.entry.js +1 -1
- package/dist/esm/q2-badge_2.entry.js +113 -12
- package/dist/esm/q2-btn_2.entry.js +2 -2
- package/dist/esm/q2-calendar.entry.js +7 -5
- package/dist/esm/q2-card-image.entry.js +4 -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 +2 -2
- package/dist/esm/q2-checkbox_2.entry.js +3 -3
- package/dist/esm/q2-context.entry.js +4 -3
- package/dist/esm/q2-data-table.entry.js +2 -2
- package/dist/esm/q2-detail.entry.js +1 -1
- package/dist/esm/q2-dropdown-item.entry.js +1 -1
- package/dist/esm/q2-dropdown.entry.js +3 -3
- package/dist/esm/q2-editable-field.entry.js +38 -37
- package/dist/esm/q2-file-picker.entry.js +60 -4
- package/dist/esm/q2-icon.entry.js +1 -1
- package/dist/esm/q2-item.entry.js +2 -2
- package/dist/esm/q2-link_2.entry.js +1 -1
- package/dist/esm/q2-loc.entry.js +1 -1
- package/dist/esm/q2-message.entry.js +2 -2
- package/dist/esm/q2-meter.entry.js +1 -1
- package/dist/esm/q2-modal.entry.js +59 -17
- package/dist/esm/q2-month-picker.entry.js +1 -1
- package/dist/esm/q2-optgroup.entry.js +1 -1
- package/dist/esm/q2-option.entry.js +1 -1
- package/dist/esm/q2-otp.entry.js +1 -1
- package/dist/esm/q2-pagination.entry.js +1 -1
- package/dist/esm/q2-pill.entry.js +2 -2
- package/dist/esm/q2-radio-group.entry.js +22 -4
- package/dist/esm/q2-radio.entry.js +3 -3
- package/dist/esm/q2-relative-time.entry.js +3 -3
- package/dist/esm/q2-resize-observer.entry.js +90 -0
- package/dist/esm/q2-search.entry.js +2 -2
- package/dist/esm/q2-section.entry.js +7 -7
- package/dist/esm/q2-select.entry.js +35 -19
- package/dist/esm/q2-stepper-pane.entry.js +2 -2
- package/dist/esm/q2-stepper-vertical.entry.js +2 -2
- package/dist/esm/q2-stepper.entry.js +1 -1
- package/dist/esm/q2-surface.entry.js +1 -1
- package/dist/esm/q2-tab-container.entry.js +2 -2
- package/dist/esm/q2-tab-pane.entry.js +1 -1
- package/dist/esm/q2-tecton-elements.js +1 -1
- package/dist/esm/q2-textarea.entry.js +1 -1
- package/dist/esm/q2-toast.entry.js +1 -1
- package/dist/esm/q2-tooltip.entry.js +1 -1
- package/dist/esm/tecton-tab-pane.entry.js +5 -3
- package/dist/q2-tecton-elements/click-elsewhere_3.entry.js +32 -29
- package/dist/q2-tecton-elements/{index-Cps4jSQM.js → index-DJw6Feh0.js} +1 -1
- package/dist/q2-tecton-elements/{q2-action-group_2.entry.js → q2-action-group.entry.js} +35 -113
- package/dist/q2-tecton-elements/q2-action-sheet.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-badge_2.entry.js +240 -140
- package/dist/q2-tecton-elements/q2-btn_2.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-calendar.entry.js +14 -12
- package/dist/q2-tecton-elements/q2-card-image.entry.js +9 -9
- package/dist/q2-tecton-elements/q2-card.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-carousel-pane.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-carousel.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-chart-area.entry.js +31 -31
- package/dist/q2-tecton-elements/q2-chart-bar.entry.js +16 -16
- package/dist/q2-tecton-elements/q2-chart-donut.entry.js +6 -6
- package/dist/q2-tecton-elements/q2-checkbox-group.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-checkbox_2.entry.js +7 -7
- package/dist/q2-tecton-elements/q2-context.entry.js +22 -21
- package/dist/q2-tecton-elements/q2-data-table.entry.js +34 -34
- package/dist/q2-tecton-elements/q2-detail.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-dropdown-item.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-dropdown.entry.js +15 -15
- package/dist/q2-tecton-elements/q2-editable-field.entry.js +38 -40
- package/dist/q2-tecton-elements/q2-file-picker.entry.js +61 -6
- package/dist/q2-tecton-elements/q2-icon.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-item.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-link_2.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-loc.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-message.entry.js +24 -24
- package/dist/q2-tecton-elements/q2-meter.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-modal.entry.js +61 -45
- package/dist/q2-tecton-elements/q2-month-picker.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-optgroup.entry.js +11 -11
- package/dist/q2-tecton-elements/q2-option.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-otp.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-pagination.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-pill.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-radio-group.entry.js +55 -34
- package/dist/q2-tecton-elements/q2-radio.entry.js +38 -53
- package/dist/q2-tecton-elements/q2-relative-time.entry.js +12 -12
- package/dist/q2-tecton-elements/q2-resize-observer.entry.js +81 -0
- package/dist/q2-tecton-elements/q2-search.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-section.entry.js +33 -33
- package/dist/q2-tecton-elements/q2-select.entry.js +27 -20
- package/dist/q2-tecton-elements/q2-stepper-pane.entry.js +20 -16
- package/dist/q2-tecton-elements/q2-stepper-vertical.entry.js +5 -5
- package/dist/q2-tecton-elements/q2-stepper.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-surface.entry.js +3 -3
- package/dist/q2-tecton-elements/q2-tab-container.entry.js +20 -20
- package/dist/q2-tecton-elements/q2-tab-pane.entry.js +4 -4
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/q2-tecton-elements/q2-textarea.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-toast.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-tooltip.entry.js +1 -1
- package/dist/q2-tecton-elements/tecton-tab-pane.entry.js +8 -7
- package/dist/types/components/q2-card-image/q2-card-image.d.ts +1 -1
- package/dist/types/components/q2-dropdown/test/q2-dropdown-test.vr.d.ts +1 -0
- package/dist/types/components/q2-editable-field/q2-editable-field.d.ts +6 -1
- package/dist/types/components/q2-file-picker/q2-file-picker.d.ts +20 -0
- package/dist/types/components/q2-input/q2-input.d.ts +28 -2
- package/dist/types/components/q2-modal/q2-modal.d.ts +10 -1
- package/dist/types/components/q2-radio-group/q2-radio-group.d.ts +14 -0
- package/dist/types/components/q2-select/q2-select.d.ts +8 -2
- package/dist/types/components.d.ts +119 -11
- package/dist/types/utils/test/vr-helpers.d.ts +2 -0
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h, Host, Fragment, } from "@stencil/core";
|
|
2
2
|
import { createGuid, getAriaValueFromProp, renderLabel, loc, renderMessages, setMessageHeight, handleAriaLabel, overrideFocus, isEventFromElement, isMobile, hasSlotContent, nextPaint, } from "../../utils/index";
|
|
3
3
|
import mirrorEmit from "../../utils/mirror-emit";
|
|
4
|
-
import formatCurrency from "./formatting/currency";
|
|
4
|
+
import formatCurrency, { currencyFormats } from "./formatting/currency";
|
|
5
5
|
import formatPhoneNumber from "./formatting/phone";
|
|
6
6
|
import formatSSN from "./formatting/ssn";
|
|
7
7
|
import formatTIN from "./formatting/tin";
|
|
@@ -60,8 +60,6 @@ export class Q2Input {
|
|
|
60
60
|
// #region State Properties
|
|
61
61
|
this.checkSlotCount = 0;
|
|
62
62
|
this.isSmall = false;
|
|
63
|
-
// #endregion
|
|
64
|
-
// #region Public Property API
|
|
65
63
|
/**
|
|
66
64
|
* Sets readonly to true on the input without adding the "read only" label.
|
|
67
65
|
*
|
|
@@ -87,7 +85,7 @@ export class Q2Input {
|
|
|
87
85
|
/**
|
|
88
86
|
* Displays a toggle button at the end of the input field which shows or hides the actual value.
|
|
89
87
|
* @info
|
|
90
|
-
*
|
|
88
|
+
* Applicable when `type` is `text`, `password`, `ssn`, or `tin`, or when `visibleLastCount` is set.
|
|
91
89
|
*/
|
|
92
90
|
this.showVisibilityToggle = false;
|
|
93
91
|
/** Specifies the field's expected [input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types), and provides the optimal keyboard on mobile devices. */
|
|
@@ -123,6 +121,7 @@ export class Q2Input {
|
|
|
123
121
|
mirrorEmit(this, ['clear', 'tctClear'], { source: 'input' });
|
|
124
122
|
}
|
|
125
123
|
this.setCursorPosition(cursorPosition);
|
|
124
|
+
this.scheduleVisibleLastScrollSync();
|
|
126
125
|
};
|
|
127
126
|
this.initMutationObserver = () => {
|
|
128
127
|
if (!('MutationObserver' in window))
|
|
@@ -158,6 +157,7 @@ export class Q2Input {
|
|
|
158
157
|
this.onInputClick = () => {
|
|
159
158
|
if (this.shouldCursorStayAtEnd)
|
|
160
159
|
this.placeCursorAtEnd();
|
|
160
|
+
this.scheduleVisibleLastScrollSync();
|
|
161
161
|
};
|
|
162
162
|
this.onInputFocus = () => {
|
|
163
163
|
if (this.inputField.tagName === 'INPUT') {
|
|
@@ -169,6 +169,7 @@ export class Q2Input {
|
|
|
169
169
|
this.setCursorPosition(this.calculateCursorPositionOnFocus());
|
|
170
170
|
}
|
|
171
171
|
this.isClickEvent = false;
|
|
172
|
+
this.syncVisibleLastScroll();
|
|
172
173
|
});
|
|
173
174
|
}
|
|
174
175
|
this.hasFocus = true;
|
|
@@ -211,6 +212,9 @@ export class Q2Input {
|
|
|
211
212
|
this.handleDataInput(newFormattedValue);
|
|
212
213
|
}
|
|
213
214
|
};
|
|
215
|
+
this.onInputScroll = () => {
|
|
216
|
+
this.syncVisibleLastScroll();
|
|
217
|
+
};
|
|
214
218
|
this.onMutationObserved = () => {
|
|
215
219
|
// Updating checkSlotCount to force re-render when slot content changes
|
|
216
220
|
this.checkSlotCount = this.checkSlotCount + 1;
|
|
@@ -223,8 +227,18 @@ export class Q2Input {
|
|
|
223
227
|
};
|
|
224
228
|
this.onToggleVisibility = () => {
|
|
225
229
|
this.hostElement.dispatchEvent(new FocusEvent('focus'));
|
|
230
|
+
if (this.normalizedVisibleLastCount !== undefined) {
|
|
231
|
+
this.value = this.formattedValueObject.value;
|
|
232
|
+
}
|
|
226
233
|
this.textHidden = !this.textHidden;
|
|
227
234
|
};
|
|
235
|
+
this.syncVisibleLastScroll = () => {
|
|
236
|
+
var _a, _b;
|
|
237
|
+
if (!this.visibleLastContentRef)
|
|
238
|
+
return;
|
|
239
|
+
const scrollLeft = (_b = (_a = this.inputField) === null || _a === void 0 ? void 0 : _a.scrollLeft) !== null && _b !== void 0 ? _b : 0;
|
|
240
|
+
this.visibleLastContentRef.style.setProperty('--tct-input-visible-last-count-scroll-left', `${scrollLeft}px`);
|
|
241
|
+
};
|
|
228
242
|
this.validateInput = () => {
|
|
229
243
|
var _a, _b, _c;
|
|
230
244
|
this.validity = (_a = this.inputRef) === null || _a === void 0 ? void 0 : _a.validity;
|
|
@@ -268,6 +282,7 @@ export class Q2Input {
|
|
|
268
282
|
componentDidRender() {
|
|
269
283
|
this.scheduledAfterRender.forEach(fn => fn());
|
|
270
284
|
this.scheduledAfterRender = [];
|
|
285
|
+
this.syncVisibleLastScroll();
|
|
271
286
|
}
|
|
272
287
|
// #endregion
|
|
273
288
|
// #region Listeners
|
|
@@ -371,6 +386,16 @@ export class Q2Input {
|
|
|
371
386
|
hintsObserver() {
|
|
372
387
|
this.hasFocus && this.scheduledAfterRender.push(() => setMessageHeight(this));
|
|
373
388
|
}
|
|
389
|
+
textHiddenObserver() {
|
|
390
|
+
if (!this.textHidden) {
|
|
391
|
+
this.scheduledAfterRender.push(() => {
|
|
392
|
+
this.inputField.value = this.formattedValueObject.formattedValue;
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
else {
|
|
396
|
+
this.scheduleVisibleLastScrollSync();
|
|
397
|
+
}
|
|
398
|
+
}
|
|
374
399
|
typeObserver() {
|
|
375
400
|
this.formatAndUpdateValueFromProp();
|
|
376
401
|
}
|
|
@@ -434,13 +459,34 @@ export class Q2Input {
|
|
|
434
459
|
return this.iconLeft;
|
|
435
460
|
}
|
|
436
461
|
get computedType() {
|
|
437
|
-
if (
|
|
462
|
+
if (this.textHidden &&
|
|
463
|
+
(['password', 'text', 'ssn', 'tin'].includes(this.type) || this.normalizedVisibleLastCount !== undefined)) {
|
|
438
464
|
return 'password';
|
|
439
465
|
}
|
|
440
|
-
|
|
441
|
-
|
|
466
|
+
return (this.type && inputTypeMap[this.type]) || 'text';
|
|
467
|
+
}
|
|
468
|
+
get currencyCode() {
|
|
469
|
+
if (this.type !== 'currency')
|
|
470
|
+
return;
|
|
471
|
+
const formatModifier = this.formatModifier === undefined ? 'USD' : this.formatModifier || '';
|
|
472
|
+
const currencyCode = formatModifier.includes('-integer') ? formatModifier.split('-integer')[0] : formatModifier;
|
|
473
|
+
return currencyFormats[currencyCode] ? currencyCode : undefined;
|
|
474
|
+
}
|
|
475
|
+
get currencyDescription() {
|
|
476
|
+
const currencyCode = this.currencyCode;
|
|
477
|
+
if (!currencyCode)
|
|
478
|
+
return;
|
|
479
|
+
try {
|
|
480
|
+
const locale = document.documentElement.lang || 'en-US';
|
|
481
|
+
return new Intl.DisplayNames(locale, { type: 'currency' }).of(currencyCode) || currencyCode;
|
|
482
|
+
}
|
|
483
|
+
catch (_a) {
|
|
484
|
+
return currencyCode;
|
|
442
485
|
}
|
|
443
486
|
}
|
|
487
|
+
get currencyDescriptionId() {
|
|
488
|
+
return `${this.inputId}-currency-description`;
|
|
489
|
+
}
|
|
444
490
|
get hasCustomDisplaySlot() {
|
|
445
491
|
return hasSlotContent(this.hostElement, 'custom-display');
|
|
446
492
|
}
|
|
@@ -457,7 +503,14 @@ export class Q2Input {
|
|
|
457
503
|
return this.valid && !this.hasError;
|
|
458
504
|
}
|
|
459
505
|
get inputDescribedBy() {
|
|
460
|
-
|
|
506
|
+
const descriptions = [];
|
|
507
|
+
if (this.currencyDescription)
|
|
508
|
+
descriptions.push(this.currencyDescriptionId);
|
|
509
|
+
if (this._ariaDescription)
|
|
510
|
+
descriptions.push(`${this.inputId}-aria-description`);
|
|
511
|
+
if (this.showMessages || this.hasError)
|
|
512
|
+
descriptions.push(`${this.inputId}-description`);
|
|
513
|
+
return descriptions.length ? descriptions.join(' ') : undefined;
|
|
461
514
|
}
|
|
462
515
|
get inputField() {
|
|
463
516
|
return this.hostElement.shadowRoot.querySelector('.input-field');
|
|
@@ -498,11 +551,44 @@ export class Q2Input {
|
|
|
498
551
|
];
|
|
499
552
|
return maskedTypes.includes(this.type);
|
|
500
553
|
}
|
|
554
|
+
get maskedDisplayParts() {
|
|
555
|
+
var _a, _b;
|
|
556
|
+
if (!this.textHidden)
|
|
557
|
+
return { maskedCharacters: [], visibleValue: '' };
|
|
558
|
+
const visibleCount = this.normalizedVisibleLastCount;
|
|
559
|
+
const value = (_b = (_a = this.formattedValueObject) === null || _a === void 0 ? void 0 : _a.formattedValue) !== null && _b !== void 0 ? _b : '';
|
|
560
|
+
if (visibleCount === undefined || !value)
|
|
561
|
+
return { maskedCharacters: [], visibleValue: '' };
|
|
562
|
+
const characters = Array.from(value);
|
|
563
|
+
if (visibleCount >= characters.length)
|
|
564
|
+
return { maskedCharacters: [], visibleValue: value };
|
|
565
|
+
const visibleStart = characters.length - visibleCount;
|
|
566
|
+
return {
|
|
567
|
+
maskedCharacters: characters.slice(0, visibleStart),
|
|
568
|
+
visibleValue: characters.slice(visibleStart).join(''),
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
get maskedDisplayValue() {
|
|
572
|
+
const { maskedCharacters, visibleValue } = this.maskedDisplayParts;
|
|
573
|
+
return `${'*'.repeat(maskedCharacters.length)}${visibleValue}`;
|
|
574
|
+
}
|
|
501
575
|
get messages() {
|
|
502
576
|
return ((this.errors && this.errors.length > 0 && this.errors) ||
|
|
503
577
|
(this.hints && this.hints.length > 0 && this.hints) ||
|
|
504
578
|
[]);
|
|
505
579
|
}
|
|
580
|
+
get normalizedVisibleLastCount() {
|
|
581
|
+
const unsupportedTypes = ['currency', 'password', 'date'];
|
|
582
|
+
if (unsupportedTypes.includes(this.type))
|
|
583
|
+
return;
|
|
584
|
+
const visibleLastCountProp = this.visibleLastCount;
|
|
585
|
+
if (visibleLastCountProp === undefined || visibleLastCountProp === null || visibleLastCountProp === '')
|
|
586
|
+
return;
|
|
587
|
+
const visibleLastCount = Number(visibleLastCountProp);
|
|
588
|
+
if (!Number.isFinite(visibleLastCount) || visibleLastCount < 0)
|
|
589
|
+
return;
|
|
590
|
+
return Math.floor(visibleLastCount);
|
|
591
|
+
}
|
|
506
592
|
get shouldCursorStartAtEnd() {
|
|
507
593
|
return this.type === 'currency';
|
|
508
594
|
}
|
|
@@ -515,6 +601,10 @@ export class Q2Input {
|
|
|
515
601
|
get showMessages() {
|
|
516
602
|
return this.messages.length > 0 && !this.hideMessages;
|
|
517
603
|
}
|
|
604
|
+
get showVisibilityToggleButton() {
|
|
605
|
+
return (this.showVisibilityToggle &&
|
|
606
|
+
(['password', 'text', 'ssn', 'tin'].includes(this.type) || this.normalizedVisibleLastCount !== undefined));
|
|
607
|
+
}
|
|
518
608
|
get stringValue() {
|
|
519
609
|
const notCoercable = Object.prototype.toString.call(this.value) === '[object Object]';
|
|
520
610
|
return notCoercable ? '' : (this.value && String(this.value)) || '';
|
|
@@ -693,6 +783,11 @@ export class Q2Input {
|
|
|
693
783
|
const { inputField } = this;
|
|
694
784
|
inputField.selectionStart = inputField.selectionEnd = inputField.value.length;
|
|
695
785
|
}
|
|
786
|
+
scheduleVisibleLastScrollSync() {
|
|
787
|
+
if (!this.maskedDisplayValue)
|
|
788
|
+
return;
|
|
789
|
+
nextPaint(this.syncVisibleLastScroll);
|
|
790
|
+
}
|
|
696
791
|
setCursorPosition(cursorData) {
|
|
697
792
|
if (this.canSetSelection && !cursorData.hasSelection) {
|
|
698
793
|
const input = this.inputField;
|
|
@@ -724,7 +819,7 @@ export class Q2Input {
|
|
|
724
819
|
}
|
|
725
820
|
renderInputContainerDOM() {
|
|
726
821
|
const { hasInputLeftSlot, hasInputRightSlot } = this;
|
|
727
|
-
return (h("div", { class: "input-container", tabindex: -1, "test-id": "inputContainer" }, h("div", { class: "input-icons-container-left" }, this.formattedValueObject.prefix && (h("div", { class: "input-prefix" }, this.formattedValueObject.prefix)), this.computedIconLeft && (h("div", null, h("q2-icon", { type: this.computedIconLeft, class: this.computedClassForIconLeft }))), hasInputLeftSlot && h("slot", { name: "input-left" }), this.showIconSeparator && h("div", { class: "vertical-separator" }), this.hasError && this.type === 'currency' && (h("div", { "test-id": "divIconError", onClick: this.onRefocusInput }, h("q2-icon", { type: "error", class: "icon-error", "test-id": "iconError" }))), this.hasValidState && this.type === 'currency' && (h("div", { class: "input-valid-icon-container", "test-id": "divIconValid" }, h("q2-icon", { type: "success", class: "icon-valid", "test-id": "iconValid" })))), this.pseudo ? this.renderPseudoInputDOM() : this.renderStandardInputDOM(), h("div", { class: "input-icons-container-right" }, h("q2-btn", { class: this.clearClasses.join(' '), label: loc('tecton.element.input.clear', [this.label]), hideLabel: true, "test-id": "clearButton", onMouseDown: e => e.preventDefault(), onClick: this.onClearInput, onKeyDown: e => e.stopPropagation() }, h("q2-icon", { type: "close", class: "icon-clear" })),
|
|
822
|
+
return (h("div", { class: "input-container", tabindex: -1, "test-id": "inputContainer" }, h("div", { class: "input-icons-container-left" }, this.formattedValueObject.prefix && (h("div", { class: "input-prefix", "aria-hidden": this.type === 'currency' ? 'true' : undefined }, this.formattedValueObject.prefix)), this.computedIconLeft && (h("div", null, h("q2-icon", { type: this.computedIconLeft, class: this.computedClassForIconLeft }))), hasInputLeftSlot && h("slot", { name: "input-left" }), this.showIconSeparator && h("div", { class: "vertical-separator" }), this.hasError && this.type === 'currency' && (h("div", { "test-id": "divIconError", onClick: this.onRefocusInput }, h("q2-icon", { type: "error", class: "icon-error", "test-id": "iconError" }))), this.hasValidState && this.type === 'currency' && (h("div", { class: "input-valid-icon-container", "test-id": "divIconValid" }, h("q2-icon", { type: "success", class: "icon-valid", "test-id": "iconValid" })))), this.pseudo ? this.renderPseudoInputDOM() : this.renderStandardInputDOM(), h("div", { class: "input-icons-container-right" }, h("q2-btn", { class: this.clearClasses.join(' '), label: loc('tecton.element.input.clear', [this.label]), hideLabel: true, "test-id": "clearButton", onMouseDown: e => e.preventDefault(), onClick: this.onClearInput, onKeyDown: e => e.stopPropagation() }, h("q2-icon", { type: "close", class: "icon-clear" })), this.showVisibilityToggleButton && (h("q2-btn", { class: "btn-visibility-toggle", "test-id": "toggleVisibilityButton", onClick: this.onToggleVisibility, label: loc(this.visibilityToggleAriaLabel, { label: this.label }), "hide-label": true }, this.visibilityToggleText)), this.formattedValueObject.suffix && (h("span", { class: "input-suffix", "aria-hidden": this.type === 'currency' ? 'true' : undefined }, this.formattedValueObject.suffix)), this.badgeValue && (h("q2-badge", { size: "large", theme: this.badgeTheme }, this.badgeValue)), this.hasValidState && this.type !== 'currency' && (h("div", { class: "input-valid-icon-container", "test-id": "divIconValid" }, h("q2-icon", { type: "success", class: "icon-valid", "test-id": "iconValid" }))), this.hasError && this.type !== 'currency' && (h("div", { "test-id": "divIconError", onClick: this.onRefocusInput }, h("q2-icon", { type: "error", class: "icon-error", "test-id": "iconError" }))), this.iconRight && !this.formattedValueObject.suffix && (h("div", null, h("q2-icon", { type: this.iconRight, class: "icon-right" }))), hasInputRightSlot && h("slot", { name: "input-right" })), this.currencyDescription && (h("span", { id: this.currencyDescriptionId, class: "sr" }, this.currencyDescription))));
|
|
728
823
|
}
|
|
729
824
|
renderPseudoInputDOM() {
|
|
730
825
|
const showPlaceholder = !this.value && !!this.placeholder;
|
|
@@ -735,13 +830,16 @@ export class Q2Input {
|
|
|
735
830
|
const { hasCustomDisplaySlot } = this;
|
|
736
831
|
const inputClasses = ['input-field'];
|
|
737
832
|
const { ariaOwns, ariaHaspopup, ariaActivedescendant, ariaExpanded } = this.ariaAttributes;
|
|
833
|
+
const { maskedCharacters, visibleValue } = this.maskedDisplayParts;
|
|
738
834
|
if (hasCustomDisplaySlot)
|
|
739
835
|
inputClasses.push('sr');
|
|
740
|
-
|
|
836
|
+
if (this.maskedDisplayValue)
|
|
837
|
+
inputClasses.push('has-visible-last-count');
|
|
838
|
+
return (h(Fragment, null, hasCustomDisplaySlot && (h("div", { class: "custom-display-container" }, h("slot", { name: "custom-display" }))), h("div", { class: "standard-input-container" }, this.maskedDisplayValue && (h("span", { class: "visible-last-count-value", "aria-hidden": "true" }, h("span", { ref: el => (this.visibleLastContentRef = el), class: "visible-last-count-content" }, maskedCharacters.map(character => (h("span", { class: "visible-last-count-character", "data-character": character }, h("span", { class: "visible-last-count-mask" }, "*")))), h("span", { class: "visible-last-count-visible-value" }, visibleValue)))), h("input", { ref: el => (this.inputRef = el), class: inputClasses.join(' '), id: this.inputId, type: this.computedType, size: this.formattedValueObject.prefix ? 10 : undefined, maxlength: ['date', 'currency'].includes(this.type) ? undefined : this.maxlength || 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-owns": ariaOwns, "aria-haspopup": ariaHaspopup, "aria-activedescendant": ariaActivedescendant, "aria-expanded": ariaExpanded || undefined, role: this._role || undefined, autocomplete: this.computedAutocomplete, autocapitalize: this.autocapitalize, autocorrect: this.autocorrect === 'on' ? 'on' : 'off', autofocus: this.autofocus, placeholder: (this.placeholder && loc(this.placeholder)) || undefined, "test-id": "inputField", readonly: this.readonly || this._preventEntry, disabled: !!this.disabled, onFocus: this.onInputFocus, onBlur: this.onInputBlur, onClick: this.onInputClick, onKeyDown: this.onInputKeydown, onMouseDown: this.onInputMousedown, onInput: this.onInputInput, onScroll: this.onInputScroll, onPaste: this.onInputPaste, inputmode: this.inputMode, pattern: this.pattern || undefined }))));
|
|
741
839
|
}
|
|
742
840
|
render() {
|
|
743
841
|
const { ariaControls, ariaExpanded } = this.ariaAttributes;
|
|
744
|
-
return (h(Host, { key: '
|
|
842
|
+
return (h(Host, { key: 'aea772f2158fa032157fcbb26bb49a97dc2e5a1b', role: this._role, "aria-controls": ariaControls, "aria-expanded": ariaExpanded }, h("div", { key: '6b0cdf179216c359cb2db01176f563d77c19780e', class: this.wrapperClasses }, this._ariaDescription && (h("span", { key: '816be1dac83810f66ee0204a5be1a8421833e20b', id: `${this.inputId}-aria-description`, class: "sr" }, this._ariaDescription)), h("div", { key: '1e4fd3b4bbe5103b7bad2af07ebfecb36c3d1743', class: "label-wrapper" }, renderLabel(this), this.renderCountDOM()), this.renderInputContainerDOM(), renderMessages(this))));
|
|
745
843
|
}
|
|
746
844
|
static get is() { return "q2-input"; }
|
|
747
845
|
static get encapsulation() { return "shadow"; }
|
|
@@ -757,6 +855,28 @@ export class Q2Input {
|
|
|
757
855
|
}
|
|
758
856
|
static get properties() {
|
|
759
857
|
return {
|
|
858
|
+
"_ariaDescription": {
|
|
859
|
+
"type": "string",
|
|
860
|
+
"mutable": false,
|
|
861
|
+
"complexType": {
|
|
862
|
+
"original": "string",
|
|
863
|
+
"resolved": "string",
|
|
864
|
+
"references": {}
|
|
865
|
+
},
|
|
866
|
+
"required": false,
|
|
867
|
+
"optional": false,
|
|
868
|
+
"docs": {
|
|
869
|
+
"tags": [{
|
|
870
|
+
"name": "private",
|
|
871
|
+
"text": undefined
|
|
872
|
+
}],
|
|
873
|
+
"text": "Provides additional descriptive text for the native input."
|
|
874
|
+
},
|
|
875
|
+
"getter": false,
|
|
876
|
+
"setter": false,
|
|
877
|
+
"reflect": false,
|
|
878
|
+
"attribute": "_aria-description"
|
|
879
|
+
},
|
|
760
880
|
"_preventEntry": {
|
|
761
881
|
"type": "boolean",
|
|
762
882
|
"mutable": true,
|
|
@@ -1526,7 +1646,7 @@ export class Q2Input {
|
|
|
1526
1646
|
"docs": {
|
|
1527
1647
|
"tags": [{
|
|
1528
1648
|
"name": "info",
|
|
1529
|
-
"text": "
|
|
1649
|
+
"text": "Applicable when `type` is `text`, `password`, `ssn`, or `tin`, or when `visibleLastCount` is set."
|
|
1530
1650
|
}],
|
|
1531
1651
|
"text": "Displays a toggle button at the end of the input field which shows or hides the actual value."
|
|
1532
1652
|
},
|
|
@@ -1570,7 +1690,7 @@ export class Q2Input {
|
|
|
1570
1690
|
"optional": false,
|
|
1571
1691
|
"docs": {
|
|
1572
1692
|
"tags": [],
|
|
1573
|
-
"text": "Controls visibility of the value
|
|
1693
|
+
"text": "Controls visibility of the value. When `visibleLastCount` is set, hidden values keep the specified number of\ntrailing characters visible.\nWhen the input type is `password`, it will default to `true`, hiding the text."
|
|
1574
1694
|
},
|
|
1575
1695
|
"getter": false,
|
|
1576
1696
|
"setter": false,
|
|
@@ -1666,6 +1786,25 @@ export class Q2Input {
|
|
|
1666
1786
|
"setter": false,
|
|
1667
1787
|
"reflect": false,
|
|
1668
1788
|
"attribute": "value"
|
|
1789
|
+
},
|
|
1790
|
+
"visibleLastCount": {
|
|
1791
|
+
"type": "number",
|
|
1792
|
+
"mutable": false,
|
|
1793
|
+
"complexType": {
|
|
1794
|
+
"original": "number",
|
|
1795
|
+
"resolved": "number",
|
|
1796
|
+
"references": {}
|
|
1797
|
+
},
|
|
1798
|
+
"required": false,
|
|
1799
|
+
"optional": false,
|
|
1800
|
+
"docs": {
|
|
1801
|
+
"tags": [],
|
|
1802
|
+
"text": "Controls the number of trailing characters that remain visible when the field value is masked by `textHidden`\nor the visibility toggle. The element's `value` and emitted event details remain unmasked."
|
|
1803
|
+
},
|
|
1804
|
+
"getter": false,
|
|
1805
|
+
"setter": false,
|
|
1806
|
+
"reflect": true,
|
|
1807
|
+
"attribute": "visible-last-count"
|
|
1669
1808
|
}
|
|
1670
1809
|
};
|
|
1671
1810
|
}
|
|
@@ -2008,6 +2147,9 @@ export class Q2Input {
|
|
|
2008
2147
|
}, {
|
|
2009
2148
|
"propName": "hints",
|
|
2010
2149
|
"methodName": "hintsObserver"
|
|
2150
|
+
}, {
|
|
2151
|
+
"propName": "textHidden",
|
|
2152
|
+
"methodName": "textHiddenObserver"
|
|
2011
2153
|
}, {
|
|
2012
2154
|
"propName": "type",
|
|
2013
2155
|
"methodName": "typeObserver"
|
|
@@ -5,6 +5,18 @@ const HINTS = ['Save more than you spend.', 'Wear sunscreen.', 'Hug a panda.'];
|
|
|
5
5
|
const ERRORS = ['This field is required.', 'The value entered is invalid.', 'The value offends me.'];
|
|
6
6
|
const VARIANTS = [
|
|
7
7
|
{ name: 'default', html: '<q2-input label="My input" placeholder="Enter text here"></q2-input>' },
|
|
8
|
+
{
|
|
9
|
+
name: 'letter-spacing-override',
|
|
10
|
+
html: `<style>
|
|
11
|
+
q2-input {
|
|
12
|
+
--tct-input-label-letter-spacing: initial;
|
|
13
|
+
letter-spacing: 0.12em !important;
|
|
14
|
+
}
|
|
15
|
+
</style>
|
|
16
|
+
<div style="width: 220px">
|
|
17
|
+
<q2-input label="Account holder full legal name" placeholder="Enter a name" optional></q2-input>
|
|
18
|
+
</div>`,
|
|
19
|
+
},
|
|
8
20
|
{
|
|
9
21
|
name: 'type-credit-card',
|
|
10
22
|
html: '<q2-input label="My input" placeholder="Enter text here" type="credit-card"></q2-input>',
|
|
@@ -21,6 +33,14 @@ const VARIANTS = [
|
|
|
21
33
|
name: 'visibility-toggle',
|
|
22
34
|
html: '<q2-input label="My input" placeholder="Enter text here" type="password" show-visibility-toggle="true" value="hunter2"></q2-input>',
|
|
23
35
|
},
|
|
36
|
+
{
|
|
37
|
+
name: 'clearable',
|
|
38
|
+
html: '<q2-input label="My input" clearable value="Clearable value"></q2-input>',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'visible-last-count',
|
|
42
|
+
html: '<q2-input label="Account number" type="numeric" visible-last-count="4" text-hidden show-visibility-toggle="true" value="1234567890"></q2-input>',
|
|
43
|
+
},
|
|
24
44
|
{
|
|
25
45
|
name: 'slotted',
|
|
26
46
|
html: `<q2-input label="My input" placeholder="Enter text here" optional>
|
|
@@ -102,6 +122,21 @@ test.describe('q2-input — variants × themes', () => {
|
|
|
102
122
|
}
|
|
103
123
|
}
|
|
104
124
|
});
|
|
125
|
+
test.describe('q2-input — single messages', () => {
|
|
126
|
+
for (const property of ['hints', 'errors']) {
|
|
127
|
+
test(`q2-input--single-${property}--focus`, async ({ page }) => {
|
|
128
|
+
await setupPage(page, '<q2-input label="My input"></q2-input>', {
|
|
129
|
+
theme: 'default-2026',
|
|
130
|
+
setupLoc: true,
|
|
131
|
+
});
|
|
132
|
+
await page.locator('q2-input').evaluate((element, messageProperty) => {
|
|
133
|
+
element[messageProperty] = ['A single message.'];
|
|
134
|
+
}, property);
|
|
135
|
+
await page.locator('q2-input input').first().focus();
|
|
136
|
+
await expect(page).toHaveScreenshot(`q2-input--single-${property}--focus--default-2026.png`);
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
});
|
|
105
140
|
// 'optional' exercises --tct-input-font-size + --tct-input-label-font-size + --tct-input-label-optional-font-size.
|
|
106
141
|
// 'visibility-toggle' exercises --tct-input-visibility-toggle-font-size.
|
|
107
142
|
// New inline variants cover the remaining tokens:
|
|
@@ -245,7 +245,6 @@ button {
|
|
|
245
245
|
.action {
|
|
246
246
|
--tct-radio-label-hidden-columns: 18px;
|
|
247
247
|
--tct-radio-label-margin-right: 0;
|
|
248
|
-
--tct-radio-margin: 0;
|
|
249
248
|
align-items: var(--tct-item-action-align-items, center);
|
|
250
249
|
display: flex;
|
|
251
250
|
grid-row: 1;
|
|
@@ -261,6 +260,9 @@ button {
|
|
|
261
260
|
--tct-icon-size: var(--tct-item-action-icon-size, var(--app-scale-6x, 30px));
|
|
262
261
|
--tct-btn-icon-padding: var(--tct-item-action-btn-icon-padding, 0);
|
|
263
262
|
}
|
|
263
|
+
.action ::slotted(q2-icon) {
|
|
264
|
+
--tct-icon-size: var(--const-px-18, 18px);
|
|
265
|
+
}
|
|
264
266
|
|
|
265
267
|
.body {
|
|
266
268
|
color: var(--tct-item-body-color, inherit);
|
|
@@ -10,6 +10,7 @@ const DROPDOWN_OPTIONS = `
|
|
|
10
10
|
`;
|
|
11
11
|
const DROPDOWN_ACTION = `<q2-dropdown slot="action" type="icon" label="My dropdown" icon="options" popover-alignment="left" hide-label="">${DROPDOWN_OPTIONS}</q2-dropdown>`;
|
|
12
12
|
const BUTTON_ACTION = `<q2-btn intent="workflow-primary" slot="action">Action</q2-btn>`;
|
|
13
|
+
const ICON_ACTION = `<q2-icon slot="action" type="options"></q2-icon>`;
|
|
13
14
|
const ICON_BUTTON_ACTION = `<q2-btn slot="action" intent="workflow-primary"><q2-icon type="edit"></q2-icon></q2-btn>`;
|
|
14
15
|
const CHECKBOX_ACTION = `<q2-checkbox label="Item checkbox" hide-label slot="action"></q2-checkbox>`;
|
|
15
16
|
const PILL_ACTION = `<q2-pill label="Item pill" slot="action"></q2-pill>`;
|
|
@@ -46,6 +47,11 @@ const VARIANTS = [
|
|
|
46
47
|
html: `<q2-item>${AVATAR_DECORATOR}${FULL_CONTENT}${ICON_BUTTON_ACTION}</q2-item>`,
|
|
47
48
|
states: ['resting'],
|
|
48
49
|
},
|
|
50
|
+
{
|
|
51
|
+
name: 'action-icon',
|
|
52
|
+
html: `<q2-item>${ICON_DECORATOR}${FULL_CONTENT}${ICON_ACTION}</q2-item>`,
|
|
53
|
+
states: ['resting'],
|
|
54
|
+
},
|
|
49
55
|
{
|
|
50
56
|
name: 'action-checkbox',
|
|
51
57
|
html: `<q2-item>${AVATAR_DECORATOR}${FULL_CONTENT}${CHECKBOX_ACTION}</q2-item>`,
|
|
@@ -132,7 +132,7 @@ button {
|
|
|
132
132
|
display: grid;
|
|
133
133
|
gap: var(--tct-message-gap, 8px);
|
|
134
134
|
align-items: flex-start;
|
|
135
|
-
background: var(--comp-message-background
|
|
135
|
+
background: var(--comp-message-background);
|
|
136
136
|
color: var(--tct-message-font-color, var(--t-message-font-color, inherit));
|
|
137
137
|
box-shadow: var(--tct-message-box-shadow, var(--t-message-box-shadow, var(--app-shadow-1, inherit)));
|
|
138
138
|
border-radius: var(--tct-message-border-radius, var(--t-message-border-radius, var(--app-border-radius-1, inherit)));
|
|
@@ -204,7 +204,7 @@ button {
|
|
|
204
204
|
:host([type=info]) {
|
|
205
205
|
--comp-info-color: #0079c1;
|
|
206
206
|
--comp-bar-color: var(--tct-message-info-bar-color, var(--const-stoplight-info, var(--comp-info-color)));
|
|
207
|
-
--comp-message-background: var(--tct-message-info-background, #
|
|
207
|
+
--comp-message-background: var(--tct-message-info-background, var(--tct-message-background, color-mix(in srgb, var(--t-base, #FFFFFF), var(--comp-bar-color) 10%)));
|
|
208
208
|
}
|
|
209
209
|
:host(:not([type])) .message-icon,
|
|
210
210
|
:host(:not([type])) .message-icon,
|
|
@@ -217,7 +217,7 @@ button {
|
|
|
217
217
|
:host([type=success]) {
|
|
218
218
|
--comp-success-color: #0e8a00;
|
|
219
219
|
--comp-bar-color: var(--tct-message-success-bar-color, var(--const-stoplight-success, var(--comp-success-color)));
|
|
220
|
-
--comp-message-background: var(--tct-message-success-background, #
|
|
220
|
+
--comp-message-background: var(--tct-message-success-background, var(--tct-message-background, color-mix(in srgb, var(--t-base, #FFFFFF), var(--comp-bar-color) 10%)));
|
|
221
221
|
}
|
|
222
222
|
:host([type=success]) .message-icon {
|
|
223
223
|
--tct-icon-stroke-primary: var(--tct-stoplight-success, var(--const-stoplight-success, var(--comp-success-color)));
|
|
@@ -227,7 +227,7 @@ button {
|
|
|
227
227
|
:host([type=warning]) {
|
|
228
228
|
--comp-warning-color: #c35500;
|
|
229
229
|
--comp-bar-color: var(--tct-message-warning-bar-color, var(--const-stoplight-warning, var(--comp-warning-color)));
|
|
230
|
-
--comp-message-background: var(--tct-message-warning-background, #
|
|
230
|
+
--comp-message-background: var(--tct-message-warning-background, var(--tct-message-background, color-mix(in srgb, var(--t-base, #FFFFFF), var(--comp-bar-color) 10%)));
|
|
231
231
|
}
|
|
232
232
|
:host([type=warning]) .message-icon {
|
|
233
233
|
--tct-icon-stroke-primary: var(--tct-stoplight-warning, var(--const-stoplight-warning, var(--comp-warning-color)));
|
|
@@ -238,7 +238,7 @@ button {
|
|
|
238
238
|
:host([type=danger]) {
|
|
239
239
|
--comp-error-color: #d20a0a;
|
|
240
240
|
--comp-bar-color: var(--tct-message-error-bar-color, var(--const-stoplight-alert, var(--comp-error-color)));
|
|
241
|
-
--comp-message-background: var(--tct-message-error-background, #
|
|
241
|
+
--comp-message-background: var(--tct-message-error-background, var(--tct-message-background, color-mix(in srgb, var(--t-base, #FFFFFF), var(--comp-bar-color) 10%)));
|
|
242
242
|
}
|
|
243
243
|
:host([type=error]) .message-icon,
|
|
244
244
|
:host([type=error]) .message-icon,
|
|
@@ -131,7 +131,7 @@ dialog {
|
|
|
131
131
|
--comp-dialog-gap: var(--tct-modal-gap, var(--app-scale-2x, 10px));
|
|
132
132
|
--comp-dialog-max-width: var(--tct-modal-max-width, 600px);
|
|
133
133
|
--comp-dialog-max-height: var(--tct-modal-max-height, 100vh);
|
|
134
|
-
--comp-dialog-min-height: var(--tct-modal-min-height,
|
|
134
|
+
--comp-dialog-min-height: var(--tct-modal-min-height, inherit);
|
|
135
135
|
--comp-dialog-box-shadow: var(--tct-modal-box-shadow, var(--app-shadow-2, 0px 0px 2px rgba(0, 0, 0, 0.12), 0px 4px 8px rgba(0, 0, 0, 0.14)));
|
|
136
136
|
position: fixed;
|
|
137
137
|
top: 100%;
|
|
@@ -141,6 +141,7 @@ dialog {
|
|
|
141
141
|
transition: transform var(--tct-modal-tween, var(--app-tween-2, 0.4s ease)), opacity var(--tct-modal-tween, var(--app-tween-2, 0.4s ease));
|
|
142
142
|
width: 100%;
|
|
143
143
|
max-width: var(--comp-dialog-max-width);
|
|
144
|
+
max-height: var(--comp-dialog-max-height);
|
|
144
145
|
border: 0;
|
|
145
146
|
border-radius: var(--comp-border-radius);
|
|
146
147
|
box-shadow: var(--comp-dialog-box-shadow);
|
|
@@ -222,11 +223,12 @@ dialog[open].is-closing::backdrop {
|
|
|
222
223
|
}
|
|
223
224
|
|
|
224
225
|
.interior {
|
|
226
|
+
box-sizing: border-box;
|
|
225
227
|
display: grid;
|
|
226
228
|
min-height: var(--comp-dialog-min-height);
|
|
227
|
-
grid-template-rows: auto 1fr auto;
|
|
229
|
+
grid-template-rows: auto minmax(0, 1fr) auto;
|
|
228
230
|
gap: var(--comp-dialog-gap);
|
|
229
|
-
max-height:
|
|
231
|
+
max-height: min(var(--comp-dialog-max-height), 100vh - 2 * var(--comp-dialog-padding));
|
|
230
232
|
padding: var(--comp-dialog-padding);
|
|
231
233
|
}
|
|
232
234
|
.interior.is-list header,
|
|
@@ -263,4 +265,39 @@ header .btn-close {
|
|
|
263
265
|
grid-area: close;
|
|
264
266
|
width: var(--comp-close-button-size);
|
|
265
267
|
height: var(--comp-close-button-size);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
footer {
|
|
271
|
+
--tct-action-group-margin: var(--app-scale-2x, 10px) 0 0;
|
|
272
|
+
align-self: end;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
@media screen and (max-height: 400px) {
|
|
276
|
+
.content {
|
|
277
|
+
-webkit-mask-image: none;
|
|
278
|
+
mask-image: none;
|
|
279
|
+
overflow-y: visible;
|
|
280
|
+
}
|
|
281
|
+
.interior {
|
|
282
|
+
grid-template-rows: auto auto auto;
|
|
283
|
+
overflow-y: auto;
|
|
284
|
+
--comp-scrollbar-size: var(--tct-scrollbar-size, var(--t-scrollbar-size, var(--app-scale-1x, 5px)));
|
|
285
|
+
--comp-scrollbar-border-radius: var(--tct-scrollbar-border-radius, var(--t-scrollbar-border-radius, var(--app-border-radius-1, 4px)));
|
|
286
|
+
--comp-scrollbar-color: var(--tct-scrollbar-color, var(--t-scrollbar-color, var(--t-a11y-gray-color, #747474)));
|
|
287
|
+
scrollbar-width: thin;
|
|
288
|
+
scrollbar-color: var(--comp-scrollbar-color) transparent;
|
|
289
|
+
}
|
|
290
|
+
.interior::-webkit-scrollbar {
|
|
291
|
+
width: var(--comp-scrollbar-size);
|
|
292
|
+
height: var(--comp-scrollbar-size);
|
|
293
|
+
margin: 5px;
|
|
294
|
+
}
|
|
295
|
+
.interior::-webkit-scrollbar-thumb {
|
|
296
|
+
background: var(--comp-scrollbar-color);
|
|
297
|
+
border-radius: var(--comp-scrollbar-border-radius);
|
|
298
|
+
}
|
|
299
|
+
.interior::-webkit-scrollbar-track {
|
|
300
|
+
background: transparent;
|
|
301
|
+
border-radius: var(--comp-scrollbar-border-radius);
|
|
302
|
+
}
|
|
266
303
|
}
|