q2-tecton-elements 1.26.1 → 1.27.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/{index-d62f5a7e.js → index-ffd19146.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/q2-action-sheet.cjs.entry.js +1 -1
- package/dist/cjs/q2-avatar.cjs.entry.js +1 -1
- package/dist/cjs/q2-badge_2.cjs.entry.js +4 -4
- package/dist/cjs/q2-btn_2.cjs.entry.js +7 -5
- package/dist/cjs/q2-calendar.cjs.entry.js +3 -3
- 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 +6 -5
- package/dist/cjs/q2-checkbox.cjs.entry.js +3 -3
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
- package/dist/cjs/q2-dropdown.cjs.entry.js +3 -2
- 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 +2 -2
- package/dist/cjs/q2-month-picker.cjs.entry.js +1 -1
- package/dist/cjs/q2-optgroup_2.cjs.entry.js +2 -2
- package/dist/cjs/q2-option-list_2.cjs.entry.js +66 -25
- package/dist/cjs/q2-pagination.cjs.entry.js +18 -16
- package/dist/cjs/q2-pill.cjs.entry.js +82 -14
- package/dist/cjs/q2-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/q2-radio.cjs.entry.js +2 -2
- package/dist/cjs/q2-section.cjs.entry.js +1 -1
- package/dist/cjs/q2-select.cjs.entry.js +24 -19
- 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 +11 -4
- package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
- package/dist/cjs/q2-textarea.cjs.entry.js +1 -1
- package/dist/cjs/q2-tooltip.cjs.entry.js +1 -1
- package/dist/collection/components/q2-avatar/styles.css +14 -14
- package/dist/collection/components/q2-btn/index.js +22 -3
- package/dist/collection/components/q2-btn/styles.css +26 -11
- package/dist/collection/components/q2-calendar/index.js +1 -1
- package/dist/collection/components/q2-calendar/styles.css +7 -1
- package/dist/collection/components/q2-carousel-pane/index.js +15 -6
- package/dist/collection/components/q2-checkbox/index.js +6 -3
- package/dist/collection/components/q2-checkbox/styles.css +1 -0
- package/dist/collection/components/q2-checkbox-group/index.js +5 -4
- package/dist/collection/components/q2-dropdown/index.js +20 -1
- package/dist/collection/components/q2-input/index.js +6 -6
- package/dist/collection/components/q2-input/styles.css +4 -0
- package/dist/collection/components/q2-message/index.js +1 -1
- package/dist/collection/components/q2-option/index.js +21 -9
- package/dist/collection/components/q2-option-list/index.js +55 -14
- package/dist/collection/components/q2-pagination/index.js +16 -14
- package/dist/collection/components/q2-pagination/styles.css +5 -0
- package/dist/collection/components/q2-pill/index.js +84 -14
- package/dist/collection/components/q2-popover/index.js +10 -10
- package/dist/collection/components/q2-radio/index.js +20 -8
- package/dist/collection/components/q2-radio/styles.css +2 -0
- package/dist/collection/components/q2-select/index.js +40 -17
- package/dist/collection/components/q2-select/styles.css +41 -3
- package/dist/collection/components/q2-stepper/index.js +5 -2
- package/dist/collection/components/q2-stepper-pane/index.js +5 -2
- package/dist/collection/components/q2-tab-pane/index.js +20 -8
- package/dist/collection/components/q2-tag/index.js +10 -3
- package/dist/collection/utils/index.js +1 -1
- package/dist/components/index10.js +1 -1
- package/dist/components/index12.js +1 -1
- package/dist/components/index13.js +55 -14
- package/dist/components/index14.js +10 -10
- package/dist/components/index15.js +2 -2
- package/dist/components/index3.js +1 -1
- package/dist/components/index5.js +7 -4
- package/dist/components/index8.js +4 -4
- package/dist/components/q2-calendar.js +2 -2
- package/dist/components/q2-checkbox-group.js +5 -4
- package/dist/components/q2-checkbox.js +2 -2
- package/dist/components/q2-dropdown.js +3 -1
- package/dist/components/q2-pagination.js +18 -16
- package/dist/components/q2-pill.js +82 -14
- package/dist/components/q2-radio.js +1 -1
- package/dist/components/q2-select.js +25 -19
- package/dist/components/q2-tag.js +10 -3
- package/dist/docs.json +167 -46
- package/dist/esm/{index-5040cd84.js → index-a0cc60e3.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/q2-action-sheet.entry.js +1 -1
- package/dist/esm/q2-avatar.entry.js +1 -1
- package/dist/esm/q2-badge_2.entry.js +4 -4
- package/dist/esm/q2-btn_2.entry.js +7 -5
- package/dist/esm/q2-calendar.entry.js +3 -3
- 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 +6 -5
- package/dist/esm/q2-checkbox.entry.js +3 -3
- package/dist/esm/q2-dropdown-item.entry.js +1 -1
- package/dist/esm/q2-dropdown.entry.js +3 -2
- 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 +2 -2
- package/dist/esm/q2-month-picker.entry.js +1 -1
- package/dist/esm/q2-optgroup_2.entry.js +2 -2
- package/dist/esm/q2-option-list_2.entry.js +66 -25
- package/dist/esm/q2-pagination.entry.js +18 -16
- package/dist/esm/q2-pill.entry.js +82 -14
- package/dist/esm/q2-radio-group.entry.js +1 -1
- package/dist/esm/q2-radio.entry.js +2 -2
- package/dist/esm/q2-section.entry.js +1 -1
- package/dist/esm/q2-select.entry.js +24 -19
- 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 +11 -4
- package/dist/esm/q2-tecton-elements.js +1 -1
- package/dist/esm/q2-textarea.entry.js +1 -1
- package/dist/esm/q2-tooltip.entry.js +1 -1
- package/dist/q2-tecton-elements/p-04b9a7ee.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-c506314d.entry.js → p-05bdc0aa.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-f5c9ef75.entry.js → p-0b8943da.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-ece7a1ca.entry.js → p-12e65423.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-f3096cce.entry.js → p-1d28c600.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-839ef27d.js → p-2453cd92.js} +1 -1
- package/dist/q2-tecton-elements/{p-a1f91d8c.entry.js → p-256e5161.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-5878b8bd.entry.js → p-25ea01d3.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-2b8a8981.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-e4aa271e.entry.js → p-31b655b6.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-396fd275.entry.js +1 -0
- package/dist/q2-tecton-elements/p-3dca7465.entry.js +1 -0
- package/dist/q2-tecton-elements/p-521c9085.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-bfaff58b.entry.js → p-5a670d93.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-72374b8e.entry.js +1 -0
- package/dist/q2-tecton-elements/p-8545c3cb.entry.js +1 -0
- package/dist/q2-tecton-elements/p-85e780b2.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-18808c27.entry.js → p-869e899c.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-8e652d59.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-74ac19cd.entry.js → p-9292bd80.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-fbe8b4c0.entry.js → p-9367dc29.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-bc8a507b.entry.js → p-949fa312.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-a8258fb1.entry.js → p-a298cbfb.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-aae8b9fc.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-bea1fda1.entry.js → p-ac6dd5b1.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-8b5639a1.entry.js → p-bafb5e70.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-a411f2f3.entry.js → p-be0d3bfe.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-c1d33fd2.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-1cc42a02.entry.js → p-d06d752f.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-7b124d8c.entry.js → p-d69cb7d1.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-bda877fe.entry.js → p-edcf49fd.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-8954cc63.entry.js → p-ef657f8f.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-0cbad3bc.entry.js → p-f3e4bb52.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-7d35c1a1.entry.js → p-fb768d19.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-87cecc80.entry.js → p-fcad1609.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-7eca74d4.entry.js → p-fe3625ad.entry.js} +1 -1
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/test/helpers.js +20 -1
- package/dist/types/components/q2-btn/index.d.ts +2 -0
- package/dist/types/components/q2-carousel-pane/index.d.ts +12 -0
- package/dist/types/components/q2-checkbox/index.d.ts +4 -0
- package/dist/types/components/q2-checkbox-group/index.d.ts +1 -1
- package/dist/types/components/q2-dropdown/index.d.ts +1 -0
- package/dist/types/components/q2-input/index.d.ts +1 -1
- package/dist/types/components/q2-option/index.d.ts +16 -0
- package/dist/types/components/q2-option-list/index.d.ts +6 -0
- package/dist/types/components/q2-pagination/index.d.ts +1 -1
- package/dist/types/components/q2-pill/index.d.ts +6 -2
- package/dist/types/components/q2-radio/index.d.ts +16 -0
- package/dist/types/components/q2-select/index.d.ts +3 -2
- package/dist/types/components/q2-stepper/index.d.ts +4 -0
- package/dist/types/components/q2-stepper-pane/index.d.ts +4 -0
- package/dist/types/components/q2-tab-pane/index.d.ts +16 -0
- package/dist/types/components/q2-tag/index.d.ts +1 -1
- package/dist/types/components.d.ts +150 -0
- package/dist/types/workspace/workspace/{tecton-production_release_1.26.x → tecton-production_release_1.27.x}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +1 -0
- package/package.json +3 -3
- package/dist/q2-tecton-elements/p-09639e95.entry.js +0 -1
- package/dist/q2-tecton-elements/p-0b82891e.entry.js +0 -1
- package/dist/q2-tecton-elements/p-224d3c31.entry.js +0 -1
- package/dist/q2-tecton-elements/p-4734a577.entry.js +0 -1
- package/dist/q2-tecton-elements/p-55d192b3.entry.js +0 -1
- package/dist/q2-tecton-elements/p-721d0aee.entry.js +0 -1
- package/dist/q2-tecton-elements/p-73643653.entry.js +0 -1
- package/dist/q2-tecton-elements/p-8d703466.entry.js +0 -1
- package/dist/q2-tecton-elements/p-a7679912.entry.js +0 -1
- package/dist/q2-tecton-elements/p-aafb9537.entry.js +0 -1
- package/dist/q2-tecton-elements/p-b8420bfe.entry.js +0 -1
|
@@ -116,8 +116,8 @@ export class Q2Input {
|
|
|
116
116
|
this.textHidden = undefined;
|
|
117
117
|
this.badgeValue = undefined;
|
|
118
118
|
this.badgeTheme = undefined;
|
|
119
|
-
this.ariaControls = undefined;
|
|
120
119
|
this.role = undefined;
|
|
120
|
+
this.ariaControls = undefined;
|
|
121
121
|
this.ariaOwns = undefined;
|
|
122
122
|
this.ariaHaspopup = undefined;
|
|
123
123
|
this.ariaExpanded = undefined;
|
|
@@ -362,7 +362,7 @@ export class Q2Input {
|
|
|
362
362
|
}
|
|
363
363
|
/* tslint:disable:cyclomatic-complexity */
|
|
364
364
|
inputContainerDOM() {
|
|
365
|
-
return (h("div", { class: "input-container", tabindex: -1 }, h("div", { class: "input-icons-container-left" }, this.formattedValueObject.prefix && (h("span", { class: "input-prefix" }, this.formattedValueObject.prefix)), this.computedIconLeft && (h("q2-icon", { type: this.computedIconLeft, class: this.computedClassForIconLeft })), this.showIconSeparator && h("div", { class: "vertical-separator" }), this.hasError && this.type === 'currency' && (h("q2-icon", { type: "error", class: "icon-error" }))), this.pseudo ? this.pseudoInputDOM() : this.standardInputDOM(), h("div", { class: "input-icons-container-right" }, this.canClear && (h("q2-btn", { class: "btn-clear", ariaLabel: loc('tecton.element.input.clear', [this.label]), "test-id": "clearButton", onClick: this.onClearInput }, h("q2-icon", { type: "close", class: "icon-clear" }))), ['password', 'text', 'ssn'].includes(this.type) && this.showVisibilityToggle && (h("q2-btn", { class: "btn-visibility-toggle", "test-id": "toggleVisibilityButton", onClick: this.onToggleVisibility }, this.visibilityToggleText)), this.formattedValueObject.suffix && (h("span", { class: "input-suffix" }, this.formattedValueObject.suffix)), this.badgeValue && (h("q2-badge", { size: "large", theme: this.badgeTheme }, this.badgeValue)), this.iconRight && !this.formattedValueObject.suffix && (h("q2-icon", { type: this.iconRight, class: "icon-right" })), this.hasError && this.type !== 'currency' && (h("q2-icon", { type: "error", class: "icon-error" })))));
|
|
365
|
+
return (h("div", { class: "input-container", tabindex: -1, "test-id": "inputContainer" }, h("div", { class: "input-icons-container-left" }, this.formattedValueObject.prefix && (h("span", { class: "input-prefix" }, this.formattedValueObject.prefix)), this.computedIconLeft && (h("q2-icon", { type: this.computedIconLeft, class: this.computedClassForIconLeft })), this.showIconSeparator && h("div", { class: "vertical-separator" }), this.hasError && this.type === 'currency' && (h("q2-icon", { type: "error", class: "icon-error", "test-id": "iconError" }))), this.pseudo ? this.pseudoInputDOM() : this.standardInputDOM(), h("div", { class: "input-icons-container-right" }, this.canClear && (h("q2-btn", { class: "btn-clear", ariaLabel: loc('tecton.element.input.clear', [this.label]), "test-id": "clearButton", onClick: this.onClearInput }, h("q2-icon", { type: "close", class: "icon-clear" }))), ['password', 'text', 'ssn'].includes(this.type) && this.showVisibilityToggle && (h("q2-btn", { class: "btn-visibility-toggle", "test-id": "toggleVisibilityButton", onClick: this.onToggleVisibility }, this.visibilityToggleText)), this.formattedValueObject.suffix && (h("span", { class: "input-suffix" }, this.formattedValueObject.suffix)), this.badgeValue && (h("q2-badge", { size: "large", theme: this.badgeTheme }, this.badgeValue)), this.iconRight && !this.formattedValueObject.suffix && (h("q2-icon", { type: this.iconRight, class: "icon-right" })), this.hasError && this.type !== 'currency' && (h("q2-icon", { type: "error", class: "icon-error" })))));
|
|
366
366
|
}
|
|
367
367
|
/* tslint:enable:cyclomatic-complexity */
|
|
368
368
|
/* tslint:disable:cyclomatic-complexity */
|
|
@@ -889,7 +889,7 @@ export class Q2Input {
|
|
|
889
889
|
"attribute": "badge-theme",
|
|
890
890
|
"reflect": true
|
|
891
891
|
},
|
|
892
|
-
"
|
|
892
|
+
"role": {
|
|
893
893
|
"type": "string",
|
|
894
894
|
"mutable": false,
|
|
895
895
|
"complexType": {
|
|
@@ -903,10 +903,10 @@ export class Q2Input {
|
|
|
903
903
|
"tags": [],
|
|
904
904
|
"text": ""
|
|
905
905
|
},
|
|
906
|
-
"attribute": "
|
|
906
|
+
"attribute": "role",
|
|
907
907
|
"reflect": false
|
|
908
908
|
},
|
|
909
|
-
"
|
|
909
|
+
"ariaControls": {
|
|
910
910
|
"type": "string",
|
|
911
911
|
"mutable": false,
|
|
912
912
|
"complexType": {
|
|
@@ -920,7 +920,7 @@ export class Q2Input {
|
|
|
920
920
|
"tags": [],
|
|
921
921
|
"text": ""
|
|
922
922
|
},
|
|
923
|
-
"attribute": "
|
|
923
|
+
"attribute": "aria-controls",
|
|
924
924
|
"reflect": false
|
|
925
925
|
},
|
|
926
926
|
"ariaOwns": {
|
|
@@ -196,8 +196,12 @@ label {
|
|
|
196
196
|
white-space: nowrap;
|
|
197
197
|
overflow: hidden;
|
|
198
198
|
text-overflow: ellipsis;
|
|
199
|
+
display: block;
|
|
199
200
|
}
|
|
200
201
|
|
|
202
|
+
.custom-display-container {
|
|
203
|
+
max-width: 100%;
|
|
204
|
+
}
|
|
201
205
|
.has-custom-display .custom-display-container {
|
|
202
206
|
--comp-default-padding: var(--app-scale-2x, 10px) var(--app-scale-2x, 10px) var(--app-scale-3x, 15px);
|
|
203
207
|
padding: var(--tct-input-padding, var(--t-input-padding, var(--comp-default-padding)));
|
|
@@ -32,7 +32,7 @@ export class Q2Message {
|
|
|
32
32
|
const addAriaHiddenForAriaLive = isFirefox && this.presentToggle;
|
|
33
33
|
const addDivForAriaLive = !isFirefox && this.presentToggle;
|
|
34
34
|
const { description } = this;
|
|
35
|
-
return (h("div", { tabindex: "-1", class: "message", role: description ? undefined : 'alert', "aria-live": description ? undefined : 'assertive', "aria-atomic": description ? undefined : 'true', "aria-relevant": description ? undefined : 'all' }, this.appearance === 'standard' ? generateIcon(this.type) : '', addDivForAriaLive && h("div", { class: "sr" }), h("div", { class: "message-content", "aria-hidden": addAriaHiddenForAriaLive ? 'true' : undefined }, h("slot", null))));
|
|
35
|
+
return (h("div", { tabindex: "-1", class: "message", role: description ? undefined : 'alert', "aria-live": description ? undefined : 'assertive', "aria-atomic": description ? undefined : 'true', "aria-relevant": description ? undefined : 'all', "test-id": "messageContainer" }, this.appearance === 'standard' ? generateIcon(this.type) : '', addDivForAriaLive && h("div", { class: "sr" }), h("div", { class: "message-content", "aria-hidden": addAriaHiddenForAriaLive ? 'true' : undefined }, h("slot", null))));
|
|
36
36
|
}
|
|
37
37
|
static get is() { return "q2-message"; }
|
|
38
38
|
static get encapsulation() { return "shadow"; }
|
|
@@ -23,7 +23,7 @@ export class Q2Option {
|
|
|
23
23
|
render() {
|
|
24
24
|
const { disabled, disabledGroup, selected, _multiSelectHidden } = this;
|
|
25
25
|
const isDisabled = disabled || disabledGroup;
|
|
26
|
-
return (h(Host, { tabindex: "-1", "aria-disabled": isDisabled ? 'true' : undefined, "aria-selected": selected
|
|
26
|
+
return (h(Host, { tabindex: "-1", "aria-disabled": isDisabled ? 'true' : undefined, "aria-selected": `${!!selected}`, "aria-hidden": _multiSelectHidden ? 'true' : undefined }, this.selected && h("q2-icon", { type: "checkmark" }), h("div", { class: "content" }, h("slot", null))));
|
|
27
27
|
}
|
|
28
28
|
static get is() { return "q2-option"; }
|
|
29
29
|
static get encapsulation() { return "shadow"; }
|
|
@@ -50,8 +50,11 @@ export class Q2Option {
|
|
|
50
50
|
"required": false,
|
|
51
51
|
"optional": false,
|
|
52
52
|
"docs": {
|
|
53
|
-
"tags": [
|
|
54
|
-
|
|
53
|
+
"tags": [{
|
|
54
|
+
"name": "private",
|
|
55
|
+
"text": undefined
|
|
56
|
+
}],
|
|
57
|
+
"text": "Used by q2-option-list to set a role on the option"
|
|
55
58
|
},
|
|
56
59
|
"attribute": "role",
|
|
57
60
|
"reflect": true,
|
|
@@ -119,8 +122,11 @@ export class Q2Option {
|
|
|
119
122
|
"required": false,
|
|
120
123
|
"optional": false,
|
|
121
124
|
"docs": {
|
|
122
|
-
"tags": [
|
|
123
|
-
|
|
125
|
+
"tags": [{
|
|
126
|
+
"name": "private",
|
|
127
|
+
"text": undefined
|
|
128
|
+
}],
|
|
129
|
+
"text": "Used by q2-radio-group to disable all options in the group"
|
|
124
130
|
},
|
|
125
131
|
"attribute": "disabled-group",
|
|
126
132
|
"reflect": true
|
|
@@ -136,8 +142,11 @@ export class Q2Option {
|
|
|
136
142
|
"required": false,
|
|
137
143
|
"optional": false,
|
|
138
144
|
"docs": {
|
|
139
|
-
"tags": [
|
|
140
|
-
|
|
145
|
+
"tags": [{
|
|
146
|
+
"name": "private",
|
|
147
|
+
"text": undefined
|
|
148
|
+
}],
|
|
149
|
+
"text": "Used by q2-option-list to indicate the option is selected"
|
|
141
150
|
},
|
|
142
151
|
"attribute": "selected",
|
|
143
152
|
"reflect": true
|
|
@@ -187,8 +196,11 @@ export class Q2Option {
|
|
|
187
196
|
"required": false,
|
|
188
197
|
"optional": false,
|
|
189
198
|
"docs": {
|
|
190
|
-
"tags": [
|
|
191
|
-
|
|
199
|
+
"tags": [{
|
|
200
|
+
"name": "private",
|
|
201
|
+
"text": undefined
|
|
202
|
+
}],
|
|
203
|
+
"text": "Used by q2-option-list to indicate the option is active"
|
|
192
204
|
},
|
|
193
205
|
"attribute": "active",
|
|
194
206
|
"reflect": true
|
|
@@ -3,6 +3,56 @@ import { isEventFromElement, nextPaint, overrideFocus, waitForNextPaint } from '
|
|
|
3
3
|
export class Q2OptionList {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.scheduledAfterRender = [];
|
|
6
|
+
this.keyStore = {
|
|
7
|
+
queue: [],
|
|
8
|
+
lastPressedAt: new Date(),
|
|
9
|
+
};
|
|
10
|
+
this.searchAndFocus = (keyValue, shouldSelect) => {
|
|
11
|
+
// pseudo search in non-searchable select
|
|
12
|
+
const reorder = () => {
|
|
13
|
+
this.pivotIndex = this.pivotIndex === undefined ? 0 : (this.activeIndex || 0) + 1;
|
|
14
|
+
const list = this.allOptions.map((element, index) => ({ element, index }));
|
|
15
|
+
return [...list.slice(this.pivotIndex), ...list.slice(0, this.pivotIndex)];
|
|
16
|
+
};
|
|
17
|
+
const buildQueue = () => {
|
|
18
|
+
const now = new Date();
|
|
19
|
+
if (now.getTime() - this.keyStore.lastPressedAt.getTime() > 1000) {
|
|
20
|
+
// empty stored keys if delay > 1s
|
|
21
|
+
this.keyStore.queue.length = 0;
|
|
22
|
+
}
|
|
23
|
+
if (this.keyStore.queue.length !== 1 || this.keyStore.queue[0] !== keyValue) {
|
|
24
|
+
this.keyStore.queue.push(keyValue);
|
|
25
|
+
}
|
|
26
|
+
this.keyStore.lastPressedAt = now;
|
|
27
|
+
};
|
|
28
|
+
const searchIndex = (list) => {
|
|
29
|
+
const keyStr = this.keyStore.queue.join('');
|
|
30
|
+
return list.find(v => {
|
|
31
|
+
return (!v.element.disabled &&
|
|
32
|
+
v.element.display &&
|
|
33
|
+
(v.element.display.match(new RegExp(`^${keyStr}`, 'i')) ||
|
|
34
|
+
v.element.display.replace(/\s/g, '').match(new RegExp(`^${keyStr}`, 'i'))));
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
const setFocus = ({ index }) => {
|
|
38
|
+
if (this.multiple) {
|
|
39
|
+
// multiple: should open to make sure that which options are selected
|
|
40
|
+
this.openDropdownWithActiveElement(index);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
this.activeIndex = index;
|
|
44
|
+
if (shouldSelect)
|
|
45
|
+
this.selectOption(this.allOptions[index]);
|
|
46
|
+
else
|
|
47
|
+
this.setActiveElement(index);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
buildQueue();
|
|
51
|
+
const matched = searchIndex(reorder());
|
|
52
|
+
if (matched) {
|
|
53
|
+
setFocus(matched);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
6
56
|
/// Event Handlers ///
|
|
7
57
|
/* tslint:disable:cyclomatic-complexity */
|
|
8
58
|
this.externalKeydownHandler = (event) => {
|
|
@@ -92,7 +142,7 @@ export class Q2OptionList {
|
|
|
92
142
|
let newOption;
|
|
93
143
|
switch (key) {
|
|
94
144
|
case ' ':
|
|
95
|
-
if (this.searchString) {
|
|
145
|
+
if (this.searchString && !this.multiple) {
|
|
96
146
|
if (customSearch)
|
|
97
147
|
break;
|
|
98
148
|
this.searchOptions(key, false);
|
|
@@ -162,6 +212,8 @@ export class Q2OptionList {
|
|
|
162
212
|
case 'Tab':
|
|
163
213
|
if (shiftKey)
|
|
164
214
|
break;
|
|
215
|
+
if (this.multiple && this.role === 'listbox')
|
|
216
|
+
break;
|
|
165
217
|
newOption = allOptions.find(element => element.active);
|
|
166
218
|
if (!newOption || newOption.disabled)
|
|
167
219
|
return;
|
|
@@ -408,19 +460,8 @@ export class Q2OptionList {
|
|
|
408
460
|
}, 2000);
|
|
409
461
|
}
|
|
410
462
|
searchOptions(key, shouldSelect) {
|
|
411
|
-
this.
|
|
412
|
-
|
|
413
|
-
searchString = searchString.replace(/[^\w\s]/gi, '');
|
|
414
|
-
this.searchString = searchString;
|
|
415
|
-
const searchRegEx = new RegExp(`^${searchString}`, 'i');
|
|
416
|
-
const { allOptions } = this;
|
|
417
|
-
const foundIndex = allOptions.findIndex(option => option.value === searchString || option.textContent.trim().match(searchRegEx));
|
|
418
|
-
if (foundIndex === -1)
|
|
419
|
-
return;
|
|
420
|
-
if (shouldSelect)
|
|
421
|
-
this.selectOption(this.allOptions[foundIndex]);
|
|
422
|
-
else
|
|
423
|
-
this.setActiveElement(foundIndex);
|
|
463
|
+
this.searchString = key;
|
|
464
|
+
this.searchAndFocus(key, shouldSelect);
|
|
424
465
|
}
|
|
425
466
|
/// Watchers ///
|
|
426
467
|
showSelectedUpdated(showSelected) {
|
|
@@ -17,6 +17,20 @@ export class Q2Pagination {
|
|
|
17
17
|
}
|
|
18
18
|
this.change.emit({ page });
|
|
19
19
|
};
|
|
20
|
+
this.checkSize = () => {
|
|
21
|
+
const { hostElement, containerElement } = this;
|
|
22
|
+
const isOverflowing = this.containerWidth > hostElement.clientWidth;
|
|
23
|
+
this.isSmall = isOverflowing;
|
|
24
|
+
if (isOverflowing)
|
|
25
|
+
return;
|
|
26
|
+
nextPaint(() => {
|
|
27
|
+
const containerWidthHasNotChanged = this.containerWidth === containerElement.clientWidth;
|
|
28
|
+
if (containerWidthHasNotChanged)
|
|
29
|
+
return;
|
|
30
|
+
this.containerWidth = containerElement.clientWidth;
|
|
31
|
+
this.checkSize();
|
|
32
|
+
});
|
|
33
|
+
};
|
|
20
34
|
this.recordType = undefined;
|
|
21
35
|
this.perPage = undefined;
|
|
22
36
|
this.total = undefined;
|
|
@@ -32,12 +46,14 @@ export class Q2Pagination {
|
|
|
32
46
|
return;
|
|
33
47
|
this.containerWidth = this.containerElement.clientWidth;
|
|
34
48
|
this.resizeObserver = new ResizeObserver(() => this.checkSize());
|
|
49
|
+
window.addEventListener('resize', this.checkSize);
|
|
35
50
|
this.resizeObserver.observe(this.hostElement);
|
|
36
51
|
overrideFocus(this.hostElement);
|
|
37
52
|
}
|
|
38
53
|
disconnectedCallback() {
|
|
39
54
|
var _a;
|
|
40
55
|
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
56
|
+
window.removeEventListener('resize', this.checkSize);
|
|
41
57
|
}
|
|
42
58
|
onHostElementFocus(event) {
|
|
43
59
|
var _a;
|
|
@@ -78,20 +94,6 @@ export class Q2Pagination {
|
|
|
78
94
|
return pages;
|
|
79
95
|
return Math.ceil(total / perPage);
|
|
80
96
|
}
|
|
81
|
-
checkSize() {
|
|
82
|
-
const { hostElement, containerElement } = this;
|
|
83
|
-
const isOverflowing = this.containerWidth > hostElement.clientWidth;
|
|
84
|
-
this.isSmall = isOverflowing;
|
|
85
|
-
if (isOverflowing)
|
|
86
|
-
return;
|
|
87
|
-
nextPaint(() => {
|
|
88
|
-
const containerWidthHasNotChanged = this.containerWidth === containerElement.clientWidth;
|
|
89
|
-
if (containerWidthHasNotChanged)
|
|
90
|
-
return;
|
|
91
|
-
this.containerWidth = containerElement.clientWidth;
|
|
92
|
-
this.checkSize();
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
97
|
////////// OBSERVERS //////////
|
|
96
98
|
render() {
|
|
97
99
|
const { pagesOnly, isFullViewHidden, recordTypeWithDefault: recordType, totalPages, totalWithDefault: total, pageWithDefault: page, currentRange, } = this;
|
|
@@ -107,6 +107,11 @@ button {
|
|
|
107
107
|
align-items: center;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
q2-btn {
|
|
111
|
+
--tct-btn-border-radius: var(--tct-pagination-btn-border-radius, var(--t-pagination-btn-border-radius));
|
|
112
|
+
--tct-btn-border: var(--tct-pagination-btn-border, var(--t-pagination-btn-border));
|
|
113
|
+
}
|
|
114
|
+
|
|
110
115
|
q2-icon {
|
|
111
116
|
--tct-icon-size: var(--tct-pagination-icon-size, var(--t-pagination-icon-size, 12px));
|
|
112
117
|
color: var(--tct-pagination-icon-color, var(--t-pagination-icon-color, var(--t-text, #4d4d4d)));
|
|
@@ -6,12 +6,30 @@ export class Q2Pill {
|
|
|
6
6
|
var _a;
|
|
7
7
|
this.scheduledAfterRender = [];
|
|
8
8
|
/// Helpers ///
|
|
9
|
+
this.syncValueProperties = () => {
|
|
10
|
+
const { value, selectedOptions } = this;
|
|
11
|
+
if (!!(selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.length))
|
|
12
|
+
this.selectedOptionsChanged(selectedOptions);
|
|
13
|
+
else if (value)
|
|
14
|
+
this.valueChanged(value);
|
|
15
|
+
};
|
|
16
|
+
this.getOption = async (value) => {
|
|
17
|
+
if (this.optionList) {
|
|
18
|
+
const options = await this.optionList.getOptions();
|
|
19
|
+
return options.find(option => option.value === value);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
return this.hostElement.querySelector(`q2-option[value="${value}"]`);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
9
25
|
this.updateSelectedOptionElements = async () => {
|
|
10
26
|
var _a;
|
|
11
27
|
const { selectedOptions } = this;
|
|
12
28
|
const selectedValues = selectedOptions.map(option => option.value);
|
|
13
29
|
const options = await ((_a = this.optionList) === null || _a === void 0 ? void 0 : _a.getOptions());
|
|
14
|
-
|
|
30
|
+
if (this.hasOptions)
|
|
31
|
+
this.active = !!selectedValues.length;
|
|
32
|
+
this.selectedOptionElements = (options === null || options === void 0 ? void 0 : options.filter(option => selectedValues.includes(option.value))) || [];
|
|
15
33
|
};
|
|
16
34
|
this.determineHasOptions = () => {
|
|
17
35
|
const hasOptions = !!this.hostElement.querySelectorAll('q2-option').length;
|
|
@@ -19,6 +37,7 @@ export class Q2Pill {
|
|
|
19
37
|
};
|
|
20
38
|
this.clearSelectedOptions = () => {
|
|
21
39
|
this.selectedOptions = [];
|
|
40
|
+
this.value = null;
|
|
22
41
|
this.active = false;
|
|
23
42
|
this.open = false;
|
|
24
43
|
this.primaryBtn.focus();
|
|
@@ -51,9 +70,10 @@ export class Q2Pill {
|
|
|
51
70
|
}
|
|
52
71
|
};
|
|
53
72
|
this.handleKeydown = async (event) => {
|
|
54
|
-
event.
|
|
55
|
-
if (!this.hasOptions || this.disabled)
|
|
73
|
+
const isTabMetaOrCtrl = event.metaKey || event.ctrlKey || event.key === 'Tab';
|
|
74
|
+
if (!this.hasOptions || this.disabled || isTabMetaOrCtrl)
|
|
56
75
|
return;
|
|
76
|
+
event.preventDefault();
|
|
57
77
|
if (shouldShowActionSheet(this, event)) {
|
|
58
78
|
this.executeActionSheet(event);
|
|
59
79
|
}
|
|
@@ -61,6 +81,13 @@ export class Q2Pill {
|
|
|
61
81
|
this.optionList.handleExternalKeydown(event);
|
|
62
82
|
}
|
|
63
83
|
};
|
|
84
|
+
this.handleButtonFocusout = async (event) => {
|
|
85
|
+
var _a;
|
|
86
|
+
const relatedTarget = event.relatedTarget;
|
|
87
|
+
if ((_a = (relatedTarget === null || relatedTarget === void 0 ? void 0 : relatedTarget.tagName) === 'Q2-OPTION') !== null && _a !== void 0 ? _a : false)
|
|
88
|
+
return;
|
|
89
|
+
this.open = false;
|
|
90
|
+
};
|
|
64
91
|
this.handleChange = event => {
|
|
65
92
|
event.stopPropagation();
|
|
66
93
|
if (!this.hasOptions)
|
|
@@ -75,7 +102,10 @@ export class Q2Pill {
|
|
|
75
102
|
const target = event.target;
|
|
76
103
|
if (target.localName === 'click-elsewhere') {
|
|
77
104
|
event.stopPropagation();
|
|
78
|
-
|
|
105
|
+
const { popoverElement } = this;
|
|
106
|
+
if (!popoverElement)
|
|
107
|
+
return;
|
|
108
|
+
popoverElement.open = false;
|
|
79
109
|
}
|
|
80
110
|
};
|
|
81
111
|
this.hoist = !!((_a = window.Tecton) === null || _a === void 0 ? void 0 : _a.useActionSheets);
|
|
@@ -101,6 +131,7 @@ export class Q2Pill {
|
|
|
101
131
|
}
|
|
102
132
|
componentDidLoad() {
|
|
103
133
|
overrideFocus(this.hostElement);
|
|
134
|
+
this.syncValueProperties();
|
|
104
135
|
}
|
|
105
136
|
componentDidRender() {
|
|
106
137
|
this.scheduledAfterRender.forEach(fn => fn());
|
|
@@ -130,12 +161,22 @@ export class Q2Pill {
|
|
|
130
161
|
const result = await showActionSheetList(this, event);
|
|
131
162
|
this.handleSelectionChanges(result);
|
|
132
163
|
}
|
|
133
|
-
handleSelectionChanges(changeDetails) {
|
|
164
|
+
async handleSelectionChanges(changeDetails) {
|
|
165
|
+
const { multiple } = this;
|
|
134
166
|
const { value = '', values = [] } = changeDetails;
|
|
135
|
-
const isActive = !!values.length;
|
|
167
|
+
const isActive = multiple ? !!values.length : !!value;
|
|
136
168
|
if (!this.hostElement.onchange) {
|
|
137
|
-
|
|
138
|
-
|
|
169
|
+
if (multiple) {
|
|
170
|
+
this.selectedOptions = values;
|
|
171
|
+
this.value = undefined;
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
const selectedOption = await this.getOption(value);
|
|
175
|
+
this.selectedOptions = selectedOption
|
|
176
|
+
? [{ value: selectedOption.value, display: selectedOption.display }]
|
|
177
|
+
: undefined;
|
|
178
|
+
this.value = selectedOption.value || undefined;
|
|
179
|
+
}
|
|
139
180
|
}
|
|
140
181
|
this.change.emit({
|
|
141
182
|
value,
|
|
@@ -144,8 +185,35 @@ export class Q2Pill {
|
|
|
144
185
|
});
|
|
145
186
|
}
|
|
146
187
|
/// Watchers ///
|
|
147
|
-
|
|
148
|
-
|
|
188
|
+
async valueChanged(newValue) {
|
|
189
|
+
var _a, _b;
|
|
190
|
+
const { multiple, selectedOptions } = this;
|
|
191
|
+
const firstValue = (_b = (_a = selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions[0]) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : null;
|
|
192
|
+
if (multiple)
|
|
193
|
+
return;
|
|
194
|
+
if (newValue === firstValue)
|
|
195
|
+
this.updateSelectedOptionElements();
|
|
196
|
+
else {
|
|
197
|
+
const selectedOption = await this.getOption(newValue);
|
|
198
|
+
const { value, display } = selectedOption || { value: newValue, display: null };
|
|
199
|
+
this.selectedOptions = [{ value, display }];
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
selectedOptionsChanged(newValue) {
|
|
203
|
+
var _a, _b;
|
|
204
|
+
const { multiple } = this;
|
|
205
|
+
const firstValue = (_b = (_a = newValue === null || newValue === void 0 ? void 0 : newValue[0]) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : null;
|
|
206
|
+
if (multiple) {
|
|
207
|
+
if (this.value)
|
|
208
|
+
this.value = null;
|
|
209
|
+
this.updateSelectedOptionElements();
|
|
210
|
+
}
|
|
211
|
+
else if (this.value === firstValue) {
|
|
212
|
+
this.updateSelectedOptionElements();
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
this.value = firstValue;
|
|
216
|
+
}
|
|
149
217
|
}
|
|
150
218
|
/// Listeners ///
|
|
151
219
|
delegateFocus(event) {
|
|
@@ -159,7 +227,6 @@ export class Q2Pill {
|
|
|
159
227
|
if (open)
|
|
160
228
|
return;
|
|
161
229
|
this.optionList.setActiveElement(null);
|
|
162
|
-
this.primaryBtn.focus();
|
|
163
230
|
}
|
|
164
231
|
/// DOM ///
|
|
165
232
|
generateIcon() {
|
|
@@ -176,7 +243,7 @@ export class Q2Pill {
|
|
|
176
243
|
wrapperClassNames.push('has-icon');
|
|
177
244
|
if (hasOptions)
|
|
178
245
|
wrapperClassNames.push('has-options');
|
|
179
|
-
return (h("click-elsewhere", { onChange: this.onClickElsewhere }, h("div", { class: wrapperClassNames.join(' ') }, h("div", { class: "btn-height-wrapper", ref: el => (this.primaryBtnWrapper = el), onClick: this.handleWrapperClick, tabIndex: -1 }, h("button", { class: "btn-primary", "test-id": "btn-control", type: "button", ref: el => (this.primaryBtn = el), onClick: this.handleClick, onKeyDown: this.handleKeydown, disabled: this.disabled, "aria-selected": !hasOptions && active ? 'true' : 'false', "aria-roledescription": !hasOptions && 'filter', "aria-controls": hasOptions && 'option-list', "aria-haspopup": hasOptions && 'true', "aria-expanded": (hasOptions && `${!!open}`) || undefined, "aria-label": this.maxLength && this.buttonContent }, this.truncatedButtonContent, !hasOptions && active && h("span", { class: "sr" }, "(", loc('tecton.element.pill.active'), ")"))), this.generateIcon()), this.hasOptions && (h("q2-popover", { ref: el => (this.popoverElement = el), controlElement: this.primaryBtn, open: this.open, minHeight: this.popoverMinHeight, direction: this.popoverDirection, align: "right" }, h("q2-option-list", { role: "menu", ref: el => (this.optionList = el), id: "option-list", onChange: this.handleChange, multiple: this.multiple, selectedOptions: this.selectedOptions, onReady: () => this.updateSelectedOptionElements() }, h("slot", null))))));
|
|
246
|
+
return (h("click-elsewhere", { onChange: this.onClickElsewhere }, h("div", { class: wrapperClassNames.join(' ') }, h("div", { class: "btn-height-wrapper", ref: el => (this.primaryBtnWrapper = el), onClick: this.handleWrapperClick, tabIndex: -1 }, h("button", { class: "btn-primary", "test-id": "btn-control", type: "button", ref: el => (this.primaryBtn = el), onClick: this.handleClick, onKeyDown: this.handleKeydown, onFocusout: this.handleButtonFocusout, disabled: this.disabled, "aria-selected": !hasOptions && active ? 'true' : 'false', "aria-roledescription": !hasOptions && 'filter', "aria-controls": hasOptions && 'option-list', "aria-haspopup": hasOptions && 'true', "aria-expanded": (hasOptions && `${!!open}`) || undefined, "aria-label": this.maxLength && this.buttonContent }, this.truncatedButtonContent, !hasOptions && active && h("span", { class: "sr" }, "(", loc('tecton.element.pill.active'), ")"))), this.generateIcon()), this.hasOptions && (h("q2-popover", { ref: el => (this.popoverElement = el), controlElement: this.primaryBtn, open: this.open, minHeight: this.popoverMinHeight, direction: this.popoverDirection, align: "right" }, h("q2-option-list", { role: "menu", ref: el => (this.optionList = el), id: "option-list", onChange: this.handleChange, multiple: this.multiple, selectedOptions: this.selectedOptions, onReady: () => this.updateSelectedOptionElements() }, h("slot", null))))));
|
|
180
247
|
}
|
|
181
248
|
static get is() { return "q2-pill"; }
|
|
182
249
|
static get encapsulation() { return "shadow"; }
|
|
@@ -314,7 +381,7 @@ export class Q2Pill {
|
|
|
314
381
|
},
|
|
315
382
|
"value": {
|
|
316
383
|
"type": "string",
|
|
317
|
-
"mutable":
|
|
384
|
+
"mutable": true,
|
|
318
385
|
"complexType": {
|
|
319
386
|
"original": "string",
|
|
320
387
|
"resolved": "string",
|
|
@@ -436,8 +503,11 @@ export class Q2Pill {
|
|
|
436
503
|
static get elementRef() { return "hostElement"; }
|
|
437
504
|
static get watchers() {
|
|
438
505
|
return [{
|
|
506
|
+
"propName": "value",
|
|
507
|
+
"methodName": "valueChanged"
|
|
508
|
+
}, {
|
|
439
509
|
"propName": "selectedOptions",
|
|
440
|
-
"methodName": "
|
|
510
|
+
"methodName": "selectedOptionsChanged"
|
|
441
511
|
}];
|
|
442
512
|
}
|
|
443
513
|
static get listeners() {
|
|
@@ -51,6 +51,7 @@ export class Q2Popover {
|
|
|
51
51
|
if (this.open)
|
|
52
52
|
return;
|
|
53
53
|
this.currentDirection = undefined;
|
|
54
|
+
this.containerElement.style.removeProperty('display');
|
|
54
55
|
this.containerElement.style.removeProperty('--comp-pop-max-height');
|
|
55
56
|
}, { once: true });
|
|
56
57
|
this.show = false;
|
|
@@ -84,9 +85,8 @@ export class Q2Popover {
|
|
|
84
85
|
const { containerElement, contentElement, direction, controlElement, currentDirection } = this;
|
|
85
86
|
if (containerElement)
|
|
86
87
|
containerElement.style.maxHeight = null;
|
|
87
|
-
// If direction
|
|
88
|
-
|
|
89
|
-
return this.setDirectionAndShow(direction);
|
|
88
|
+
// If the direction is already set then use it, otherwise use the current direction
|
|
89
|
+
const currentOrStatedDirection = direction !== null && direction !== void 0 ? direction : currentDirection;
|
|
90
90
|
// Set the container to block so we can get the height
|
|
91
91
|
containerElement.style.setProperty('display', 'block');
|
|
92
92
|
await waitForNextPaint();
|
|
@@ -105,13 +105,13 @@ export class Q2Popover {
|
|
|
105
105
|
const canShowFullSizeAbove = contentHeight <= topOffset;
|
|
106
106
|
let determinedDirection;
|
|
107
107
|
// Show the full-size popover below or above if it will fit
|
|
108
|
-
if (
|
|
108
|
+
if (currentOrStatedDirection === 'down' && canShowFullSizeBelow)
|
|
109
109
|
return this.setDirectionAndShow('down');
|
|
110
|
-
else if (
|
|
110
|
+
else if (currentOrStatedDirection === 'up' && canShowFullSizeAbove)
|
|
111
111
|
return this.setDirectionAndShow('up');
|
|
112
|
-
else if (
|
|
112
|
+
else if (currentOrStatedDirection === undefined && canShowFullSizeBelow)
|
|
113
113
|
determinedDirection = 'down';
|
|
114
|
-
else if (
|
|
114
|
+
else if (currentOrStatedDirection === undefined && canShowFullSizeAbove)
|
|
115
115
|
determinedDirection = 'up';
|
|
116
116
|
if (determinedDirection)
|
|
117
117
|
return this.setDirectionAndShow(determinedDirection);
|
|
@@ -120,11 +120,11 @@ export class Q2Popover {
|
|
|
120
120
|
const displayBuffer = 5;
|
|
121
121
|
const canShowMinHeightBelow = bottomOffset >= minHeight + displayBuffer;
|
|
122
122
|
let maxHeight;
|
|
123
|
-
if (
|
|
123
|
+
if (currentOrStatedDirection === 'down') {
|
|
124
124
|
maxHeight = Math.max(bottomOffset - displayBuffer, minHeight);
|
|
125
125
|
determinedDirection = 'down';
|
|
126
126
|
}
|
|
127
|
-
else if (
|
|
127
|
+
else if (currentOrStatedDirection === 'up') {
|
|
128
128
|
maxHeight = Math.max(topOffset - displayBuffer, minHeight);
|
|
129
129
|
determinedDirection = 'up';
|
|
130
130
|
}
|
|
@@ -150,7 +150,7 @@ export class Q2Popover {
|
|
|
150
150
|
const containerClasses = ['container', this.currentDirection];
|
|
151
151
|
if (this.show)
|
|
152
152
|
containerClasses.push('show');
|
|
153
|
-
return (h("div", { ref: el => (this.containerElement = el), class: containerClasses.join(' '),
|
|
153
|
+
return (h("div", { ref: el => (this.containerElement = el), class: containerClasses.join(' '), "test-id": "outerContainer" }, h("div", { ref: el => (this.contentElement = el), class: "content" }, h("slot", null))));
|
|
154
154
|
}
|
|
155
155
|
static get is() { return "q2-popover"; }
|
|
156
156
|
static get encapsulation() { return "shadow"; }
|
|
@@ -171,8 +171,11 @@ export class Q2Radio {
|
|
|
171
171
|
"required": false,
|
|
172
172
|
"optional": false,
|
|
173
173
|
"docs": {
|
|
174
|
-
"tags": [
|
|
175
|
-
|
|
174
|
+
"tags": [{
|
|
175
|
+
"name": "private",
|
|
176
|
+
"text": undefined
|
|
177
|
+
}],
|
|
178
|
+
"text": "Used by q2-radio-group to apply a name to all options in the group"
|
|
176
179
|
},
|
|
177
180
|
"attribute": "name",
|
|
178
181
|
"reflect": true
|
|
@@ -188,8 +191,11 @@ export class Q2Radio {
|
|
|
188
191
|
"required": false,
|
|
189
192
|
"optional": false,
|
|
190
193
|
"docs": {
|
|
191
|
-
"tags": [
|
|
192
|
-
|
|
194
|
+
"tags": [{
|
|
195
|
+
"name": "private",
|
|
196
|
+
"text": undefined
|
|
197
|
+
}],
|
|
198
|
+
"text": "Used by q2-radio-group to disable all options in the group"
|
|
193
199
|
},
|
|
194
200
|
"attribute": "group-disabled",
|
|
195
201
|
"reflect": false,
|
|
@@ -206,8 +212,11 @@ export class Q2Radio {
|
|
|
206
212
|
"required": false,
|
|
207
213
|
"optional": false,
|
|
208
214
|
"docs": {
|
|
209
|
-
"tags": [
|
|
210
|
-
|
|
215
|
+
"tags": [{
|
|
216
|
+
"name": "private",
|
|
217
|
+
"text": undefined
|
|
218
|
+
}],
|
|
219
|
+
"text": "Used by q2-radio-group to make all options in the group readonly"
|
|
211
220
|
},
|
|
212
221
|
"attribute": "group-readonly",
|
|
213
222
|
"reflect": false,
|
|
@@ -224,8 +233,11 @@ export class Q2Radio {
|
|
|
224
233
|
"required": false,
|
|
225
234
|
"optional": false,
|
|
226
235
|
"docs": {
|
|
227
|
-
"tags": [
|
|
228
|
-
|
|
236
|
+
"tags": [{
|
|
237
|
+
"name": "private",
|
|
238
|
+
"text": undefined
|
|
239
|
+
}],
|
|
240
|
+
"text": "Used by q2-radio-group to make the options display as tiles"
|
|
229
241
|
},
|
|
230
242
|
"attribute": "group-tile-layout",
|
|
231
243
|
"reflect": false,
|
|
@@ -75,6 +75,7 @@ button {
|
|
|
75
75
|
margin-bottom: var(--tct-radio-margin-vertical, var(--tct-scale-2, 10px));
|
|
76
76
|
}
|
|
77
77
|
.radio-container label[for] {
|
|
78
|
+
color: var(--tct-radio-label-color);
|
|
78
79
|
font-weight: var(--tct-radio-font-weight, var(--tct-checkbox-font-weight, 400));
|
|
79
80
|
align-items: center;
|
|
80
81
|
cursor: pointer;
|
|
@@ -117,6 +118,7 @@ button {
|
|
|
117
118
|
flex-wrap: wrap;
|
|
118
119
|
}
|
|
119
120
|
.radio-tile label[for] {
|
|
121
|
+
color: var(--tct-radio-label-color);
|
|
120
122
|
align-items: center;
|
|
121
123
|
border-radius: 3px;
|
|
122
124
|
border: 2px solid var(--tct-radio-stroke-color, var(--t-a11y-gray-color-AA, #949494));
|