q2-tecton-elements 1.67.1 → 1.67.2
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 +23 -68
- package/dist/cjs/click-elsewhere.q2-option-list.q2-popover.entry.cjs.js.map +1 -1
- package/dist/cjs/click-elsewhere_3.cjs.entry.js +17 -28
- package/dist/cjs/click-elsewhere_3.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/q2-action-group_2.cjs.entry.js +2 -2
- 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-card-image.cjs.entry.js +2 -2
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +2 -2
- package/dist/cjs/q2-chart-area.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-bar.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-donut.cjs.entry.js +1 -1
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/q2-checkbox.q2-tag.entry.cjs.js.map +1 -1
- package/dist/cjs/q2-checkbox_2.cjs.entry.js +41 -11
- package/dist/cjs/q2-checkbox_2.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-context.cjs.entry.js +1 -1
- package/dist/cjs/q2-currency.cjs.entry.js +1 -1
- package/dist/cjs/q2-data-table.cjs.entry.js +1 -1
- package/dist/cjs/q2-detail.cjs.entry.js +1 -1
- package/dist/cjs/q2-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
- package/dist/cjs/q2-example.cjs.entry.js +1 -1
- package/dist/cjs/q2-form.cjs.entry.js +1 -1
- package/dist/cjs/q2-formatted-text.cjs.entry.js +1 -1
- package/dist/cjs/q2-input.cjs.entry.js +1 -1
- package/dist/cjs/q2-item.cjs.entry.js +1 -1
- package/dist/cjs/q2-legend.cjs.entry.js +1 -1
- package/dist/cjs/q2-link_2.cjs.entry.js +1 -1
- package/dist/cjs/q2-message.cjs.entry.js +1 -1
- package/dist/cjs/q2-meter.cjs.entry.js +1 -1
- package/dist/cjs/q2-modal.cjs.entry.js +1 -1
- package/dist/cjs/q2-month-picker.cjs.entry.js +2 -2
- package/dist/cjs/q2-mutation-observer.cjs.entry.js +1 -1
- package/dist/cjs/q2-optgroup.cjs.entry.js +1 -1
- package/dist/cjs/q2-pagination.cjs.entry.js +3 -3
- package/dist/cjs/q2-pill.cjs.entry.js +1 -1
- package/dist/cjs/q2-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/q2-radio.cjs.entry.js +1 -1
- package/dist/cjs/q2-relative-time.cjs.entry.js +1 -1
- package/dist/cjs/q2-section.cjs.entry.js +2 -2
- package/dist/cjs/q2-select.cjs.entry.js +1 -1
- 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-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/tecton-tab-pane.cjs.entry.js +2 -2
- package/dist/collection/components/q2-action-group/q2-action-group.js +1 -1
- package/dist/collection/components/q2-action-sheet/q2-action-sheet.js +1 -1
- package/dist/collection/components/q2-avatar/q2-avatar.js +1 -1
- package/dist/collection/components/q2-calendar/q2-month-picker.js +2 -2
- package/dist/collection/components/q2-card-image/q2-card-image.js +2 -2
- package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.js +2 -2
- package/dist/collection/components/q2-chart-area/q2-chart-area.js +1 -1
- package/dist/collection/components/q2-chart-bar/q2-chart-bar.js +1 -1
- package/dist/collection/components/q2-chart-donut/q2-chart-donut.js +1 -1
- package/dist/collection/components/q2-checkbox/q2-checkbox.css +5 -1
- package/dist/collection/components/q2-checkbox/q2-checkbox.js +45 -10
- package/dist/collection/components/q2-checkbox/q2-checkbox.js.map +1 -1
- package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.js +1 -1
- package/dist/collection/components/q2-context/q2-context.js +1 -1
- package/dist/collection/components/q2-currency/q2-currency.js +1 -1
- package/dist/collection/components/q2-data-table/q2-data-table.js +1 -1
- package/dist/collection/components/q2-detail/q2-detail.js +1 -1
- package/dist/collection/components/q2-dropdown/q2-dropdown.js +1 -1
- package/dist/collection/components/q2-editable-field/q2-editable-field.js +1 -1
- package/dist/collection/components/q2-example/q2-example.js +1 -1
- package/dist/collection/components/q2-form/q2-form.js +1 -1
- package/dist/collection/components/q2-formatted-text/q2-formatted-text.js +1 -1
- package/dist/collection/components/q2-input/q2-input.js +1 -1
- package/dist/collection/components/q2-item/q2-item.js +1 -1
- package/dist/collection/components/q2-legend/q2-legend.js +1 -1
- package/dist/collection/components/q2-list/q2-list.js +1 -1
- package/dist/collection/components/q2-message/q2-message.js +1 -1
- package/dist/collection/components/q2-meter/q2-meter.js +1 -1
- package/dist/collection/components/q2-modal/q2-modal.js +1 -1
- package/dist/collection/components/q2-mutation-observer/q2-mutation-observer.js +1 -1
- package/dist/collection/components/q2-optgroup/q2-optgroup.js +1 -1
- package/dist/collection/components/q2-pagination/q2-pagination.js +3 -3
- package/dist/collection/components/q2-pill/q2-pill.js +1 -1
- package/dist/collection/components/q2-popover/q2-popover.js +17 -48
- package/dist/collection/components/q2-popover/q2-popover.js.map +1 -1
- package/dist/collection/components/q2-radio/q2-radio.js +1 -1
- package/dist/collection/components/q2-radio-group/q2-radio-group.js +1 -1
- package/dist/collection/components/q2-relative-time/q2-relative-time.js +1 -1
- package/dist/collection/components/q2-resize-observer/q2-resize-observer.js +1 -1
- package/dist/collection/components/q2-section/q2-section.js +2 -2
- package/dist/collection/components/q2-select/q2-select.js +1 -1
- package/dist/collection/components/q2-stepper/q2-stepper.js +1 -1
- 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-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/q2-textarea/q2-textarea.js +1 -1
- package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js +2 -2
- package/dist/components/q2-action-group2.js +1 -1
- package/dist/components/q2-action-sheet.js +1 -1
- package/dist/components/q2-avatar2.js +1 -1
- package/dist/components/q2-card-image.js +2 -2
- package/dist/components/q2-carousel-pane.js +2 -2
- package/dist/components/q2-chart-area.js +1 -1
- package/dist/components/q2-chart-bar.js +1 -1
- package/dist/components/q2-chart-donut.js +1 -1
- package/dist/components/q2-checkbox-group.js +1 -1
- package/dist/components/q2-checkbox2.js +42 -11
- package/dist/components/q2-checkbox2.js.map +1 -1
- package/dist/components/q2-context.js +1 -1
- package/dist/components/q2-currency.js +1 -1
- package/dist/components/q2-data-table.js +1 -1
- package/dist/components/q2-detail.js +1 -1
- package/dist/components/q2-dropdown.js +1 -1
- package/dist/components/q2-editable-field.js +1 -1
- package/dist/components/q2-example.js +1 -1
- package/dist/components/q2-form.js +1 -1
- package/dist/components/q2-formatted-text.js +1 -1
- package/dist/components/q2-input2.js +1 -1
- package/dist/components/q2-item2.js +1 -1
- package/dist/components/q2-legend2.js +1 -1
- package/dist/components/q2-list2.js +1 -1
- package/dist/components/q2-message2.js +1 -1
- package/dist/components/q2-meter.js +1 -1
- package/dist/components/q2-modal.js +1 -1
- package/dist/components/q2-month-picker.js +2 -2
- package/dist/components/q2-mutation-observer.js +1 -1
- package/dist/components/q2-optgroup2.js +1 -1
- package/dist/components/q2-pagination.js +3 -3
- package/dist/components/q2-pill.js +1 -1
- package/dist/components/q2-popover2.js +17 -29
- package/dist/components/q2-popover2.js.map +1 -1
- package/dist/components/q2-radio-group.js +1 -1
- package/dist/components/q2-radio.js +1 -1
- package/dist/components/q2-relative-time.js +1 -1
- package/dist/components/q2-resize-observer2.js +1 -1
- package/dist/components/q2-section.js +2 -2
- package/dist/components/q2-select2.js +1 -1
- package/dist/components/q2-stepper-pane.js +1 -1
- package/dist/components/q2-stepper-vertical.js +1 -1
- package/dist/components/q2-stepper.js +1 -1
- package/dist/components/q2-tab-container.js +1 -1
- package/dist/components/q2-tab-pane.js +1 -1
- package/dist/components/q2-tag2.js +1 -1
- package/dist/components/q2-textarea.js +1 -1
- package/dist/components/tecton-tab-pane.js +2 -2
- package/dist/esm/click-elsewhere.q2-option-list.q2-popover.entry.js.map +1 -1
- package/dist/esm/click-elsewhere_3.entry.js +17 -28
- package/dist/esm/click-elsewhere_3.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/q2-action-group_2.entry.js +2 -2
- package/dist/esm/q2-action-sheet.entry.js +1 -1
- package/dist/esm/q2-avatar.entry.js +1 -1
- package/dist/esm/q2-card-image.entry.js +2 -2
- package/dist/esm/q2-carousel-pane.entry.js +2 -2
- package/dist/esm/q2-chart-area.entry.js +1 -1
- package/dist/esm/q2-chart-bar.entry.js +1 -1
- package/dist/esm/q2-chart-donut.entry.js +1 -1
- package/dist/esm/q2-checkbox-group.entry.js +1 -1
- package/dist/esm/q2-checkbox.q2-tag.entry.js.map +1 -1
- package/dist/esm/q2-checkbox_2.entry.js +41 -11
- package/dist/esm/q2-checkbox_2.entry.js.map +1 -1
- package/dist/esm/q2-context.entry.js +1 -1
- package/dist/esm/q2-currency.entry.js +1 -1
- package/dist/esm/q2-data-table.entry.js +1 -1
- package/dist/esm/q2-detail.entry.js +1 -1
- package/dist/esm/q2-dropdown.entry.js +1 -1
- package/dist/esm/q2-editable-field.entry.js +1 -1
- package/dist/esm/q2-example.entry.js +1 -1
- package/dist/esm/q2-form.entry.js +1 -1
- package/dist/esm/q2-formatted-text.entry.js +1 -1
- package/dist/esm/q2-input.entry.js +1 -1
- package/dist/esm/q2-item.entry.js +1 -1
- package/dist/esm/q2-legend.entry.js +1 -1
- package/dist/esm/q2-link_2.entry.js +1 -1
- package/dist/esm/q2-message.entry.js +1 -1
- package/dist/esm/q2-meter.entry.js +1 -1
- package/dist/esm/q2-modal.entry.js +1 -1
- package/dist/esm/q2-month-picker.entry.js +2 -2
- package/dist/esm/q2-mutation-observer.entry.js +1 -1
- package/dist/esm/q2-optgroup.entry.js +1 -1
- package/dist/esm/q2-pagination.entry.js +3 -3
- package/dist/esm/q2-pill.entry.js +1 -1
- package/dist/esm/q2-radio-group.entry.js +1 -1
- package/dist/esm/q2-radio.entry.js +1 -1
- package/dist/esm/q2-relative-time.entry.js +1 -1
- package/dist/esm/q2-section.entry.js +2 -2
- package/dist/esm/q2-select.entry.js +1 -1
- 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-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/tecton-tab-pane.entry.js +2 -2
- package/dist/q2-tecton-elements/click-elsewhere.q2-option-list.q2-popover.entry.esm.js.map +1 -1
- package/dist/q2-tecton-elements/click-elsewhere_3.entry.js +32 -39
- package/dist/q2-tecton-elements/click-elsewhere_3.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-action-group_2.entry.js +4 -4
- package/dist/q2-tecton-elements/q2-action-sheet.entry.js +40 -40
- package/dist/q2-tecton-elements/q2-avatar.entry.js +8 -8
- package/dist/q2-tecton-elements/q2-card-image.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-carousel-pane.entry.js +3 -3
- package/dist/q2-tecton-elements/q2-chart-area.entry.js +6 -6
- package/dist/q2-tecton-elements/q2-chart-bar.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-chart-donut.entry.js +6 -6
- package/dist/q2-tecton-elements/q2-checkbox-group.entry.js +6 -6
- package/dist/q2-tecton-elements/q2-checkbox.q2-tag.entry.esm.js.map +1 -1
- package/dist/q2-tecton-elements/q2-checkbox_2.entry.js +70 -28
- package/dist/q2-tecton-elements/q2-checkbox_2.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-context.entry.js +15 -15
- package/dist/q2-tecton-elements/q2-currency.entry.js +8 -8
- package/dist/q2-tecton-elements/q2-data-table.entry.js +3 -3
- package/dist/q2-tecton-elements/q2-detail.entry.js +3 -3
- package/dist/q2-tecton-elements/q2-dropdown.entry.js +17 -17
- package/dist/q2-tecton-elements/q2-editable-field.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-example.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-form.entry.js +7 -7
- package/dist/q2-tecton-elements/q2-formatted-text.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-input.entry.js +3 -3
- package/dist/q2-tecton-elements/q2-item.entry.js +13 -13
- package/dist/q2-tecton-elements/q2-legend.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-link_2.entry.js +6 -6
- package/dist/q2-tecton-elements/q2-message.entry.js +6 -6
- package/dist/q2-tecton-elements/q2-meter.entry.js +13 -13
- package/dist/q2-tecton-elements/q2-modal.entry.js +46 -46
- package/dist/q2-tecton-elements/q2-month-picker.entry.js +30 -30
- package/dist/q2-tecton-elements/q2-mutation-observer.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-optgroup.entry.js +4 -4
- package/dist/q2-tecton-elements/q2-pagination.entry.js +26 -26
- package/dist/q2-tecton-elements/q2-pill.entry.js +12 -12
- package/dist/q2-tecton-elements/q2-radio-group.entry.js +21 -21
- package/dist/q2-tecton-elements/q2-radio.entry.js +8 -8
- package/dist/q2-tecton-elements/q2-relative-time.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-section.entry.js +21 -21
- package/dist/q2-tecton-elements/q2-select.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-stepper-pane.entry.js +11 -11
- package/dist/q2-tecton-elements/q2-stepper-vertical.entry.js +4 -4
- package/dist/q2-tecton-elements/q2-stepper.entry.js +12 -12
- package/dist/q2-tecton-elements/q2-tab-container.entry.js +17 -17
- package/dist/q2-tecton-elements/q2-tab-pane.entry.js +2 -2
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/q2-tecton-elements/q2-textarea.entry.js +2 -2
- package/dist/q2-tecton-elements/tecton-tab-pane.entry.js +6 -6
- package/dist/types/components/q2-checkbox/q2-checkbox.d.ts +8 -1
- package/dist/types/components/q2-popover/q2-popover.d.ts +0 -6
- package/dist/types/components.d.ts +0 -10
- package/package.json +3 -3
|
@@ -208,7 +208,7 @@ export class Q2ActionSheet {
|
|
|
208
208
|
}
|
|
209
209
|
const appearance = (data === null || data === void 0 ? void 0 : data.appearance) || 'slot';
|
|
210
210
|
const interiorClasses = `interior is-${appearance}`;
|
|
211
|
-
return (h("dialog", { key: '
|
|
211
|
+
return (h("dialog", { key: '7ef6d64d3f29d01edcc5ba09c6917e08eb27ed0d', ref: el => (this.dialogElement = el), class: renderStatus, onClick: this.onClick }, h("div", { key: 'a7da46ce286106d4a14edd50a2ed926b0adb7c84', class: interiorClasses }, showHeader && (h("header", { key: '8de945c05de298bf044cb01b872e2f0db17d9910' }, h("div", { key: 'b4ec8e173b7109456d927e3f3ceeb8e6e936243d', class: "title" }, (data === null || data === void 0 ? void 0 : data.title) || this.title), !this.hideClose && (h("q2-btn", { key: 'ccb610c96edec66abf9f5b353c973e8af9702472', class: "btn-close", "test-id": "btnClose", onClick: this.onCancel, label: "tecton.element.actionSheet.close", "hide-label": true }, h("q2-icon", { key: '1989ba1b179b5053719a78a1d4b9359734f23f36', type: "close" }))))), ((_a = this.data) === null || _a === void 0 ? void 0 : _a.description) && h("p", { key: '13fc69d21bf48b27f22555630a25c7019ede5a2e' }, data.description), RenderContent && h(RenderContent, { key: 'ec78bb8ee37838b38c32405c4292b6836e5deb5f', data: this.data }))));
|
|
212
212
|
}
|
|
213
213
|
static get is() { return "q2-action-sheet"; }
|
|
214
214
|
static get encapsulation() { return "shadow"; }
|
|
@@ -90,7 +90,7 @@ export class Q2Avatar {
|
|
|
90
90
|
const isLoaded = this.isLoaded;
|
|
91
91
|
const showInitials = (this.name || this.initials) && (!this.src || this.badSrc);
|
|
92
92
|
const showFallback = !this.name && !this.initials && (!this.src || this.badSrc);
|
|
93
|
-
return (h("div", { key: '
|
|
93
|
+
return (h("div", { key: '905b33762261d024a3fc93b855f41ad34cd3ebb9', class: `avatar-wrapper size-${this.size}` }, this.hasDecorator && (h("div", { key: '2f56e72f62c7dc93e46861fedcb23dbb3b9f356a', class: "decorator" }, h("slot", { key: '367d339e3cb1d7cb967588c9f16aaac43fb113ae', name: "decorator" }))), showImg && (h("img", { key: 'aa8d8377e42e1dfbf23f293a94f4098b5048ed7a', class: `${isLoaded ? 'avatar-img' : 'avatar-img-default'}`, "test-id": "userImage", src: this.src, onError: this.onError, onLoad: this.onLoad, alt: this.name || '' })), showInitials && (h("svg", { key: '01b678b18936040e367c6ccb1e693109058ec65b', viewBox: "0 0 100 100", preserveAspectRatio: "xMidYMid meet", "test-id": "userInitials", class: `avatar-initials initials-size-${computedInitials.length}`, "aria-label": this.name, "aria-hidden": !this.name && 'true' }, h("text", { key: '00e6e13fff99f79ed2c1aef06706a46b8db39836', x: "50", y: "50", "dominant-baseline": "central", "text-anchor": "middle", "aria-hidden": "true" }, computedInitials))), showFallback && (h("div", { key: '8b11436b66465ff1894129484bb245f80a36ffbe', "test-id": "fallbackIcon", class: "fallback" }, h("q2-icon", { key: '4813df821c1e7d89b338885f791db2cd3bbf0e8b', type: this.icon })))));
|
|
94
94
|
}
|
|
95
95
|
static get is() { return "q2-avatar"; }
|
|
96
96
|
static get encapsulation() { return "shadow"; }
|
|
@@ -134,10 +134,10 @@ export class Q2MonthPicker {
|
|
|
134
134
|
// #endregion
|
|
135
135
|
// #region Render Methods
|
|
136
136
|
render() {
|
|
137
|
-
return (h("div", { key: '
|
|
137
|
+
return (h("div", { key: 'c80017d8e2998167716488b46dd52cecfc47dcc5', class: "month-container", onKeyDown: this.onMonthKeydown }, h("div", { key: '7f14b1eac6019175522e7c5fc4b5b5b0b2967723', class: "navigation" }, h("q2-btn", { key: '4cc17ededea2f273f45b27e4ddee49cd6ac5b412', class: "year-btn", onClick: () => this.viewChange.emit({
|
|
138
138
|
view: 'year',
|
|
139
139
|
selectedYear: this.year,
|
|
140
|
-
}) }, h("span", { key: '
|
|
140
|
+
}) }, h("span", { key: '8165df4a38cfe5793689cb45bca424aaf6bcbf64', class: "year" }, this.year), h("q2-icon", { key: '827073a13b6d003b328a0fd8f8525b9b2a013ff2', class: "year-icon off", type: "chevron-down" })), h("div", { key: '5b46832d6adc2f00e5a7db0f43446b9c6b89ecad', class: "month-controller" }, h("div", { key: '8d25fa53c29f394461217255b6feb0ccd35ff884', class: "cal-year-prev-next" }, h("q2-btn", { key: '7c9b873b8111b50fe82d138e9f826c3cf3bbfff7', label: loc('tecton.element.calendar.previousYear'), "hide-label": true, class: "cal-nav-btn prev-year", "test-id": "previousYearButton", onClick: () => this.selectYear(this.year - 1) }, h("q2-icon", { key: '5b1f1906753a8b759c0b620deb49869834193035', type: "arrow-left" })), h("q2-btn", { key: 'dac82b2f5d88ecdc6d7fb0566fd4847615269949', label: loc('tecton.element.calendar.nextYear'), "hide-label": true, class: "cal-nav-btn next-year", "test-id": "nextYearButton", onClick: () => this.selectYear(this.year + 1) }, h("q2-icon", { key: 'db889911237e7655047f33e8e19b845de8203f57', type: "arrow-right" }))))), h("div", { key: '4a4740d1513e1f970ef2754a1a7ac24299e1683c', class: "month-list", onClick: this.onMonthSelection }, this.months.map((month, index) => (h("div", { class: "month" }, h("span", { role: "button", class: "month-button", "data-index": index, "aria-label": month.label, tabindex: index === this.focusedIndex ? 0 : -1 }, month.abbr))))), this.today && (h("div", { key: '26ac01a5dc62b4c1f97701f19bd81e8d6569e9f1', class: "today-label" }, loc('tecton.element.calendar.today'), ": ", this.today))));
|
|
141
141
|
}
|
|
142
142
|
static get is() { return "q2-month-picker"; }
|
|
143
143
|
static get encapsulation() { return "shadow"; }
|
|
@@ -367,11 +367,11 @@ export class Q2CardImage {
|
|
|
367
367
|
render() {
|
|
368
368
|
const cardContent = this.clickable ? (h("q2-btn", { disabled: this.disabled, label: this.accessibilityLabel, hideLabel: true, onClick: this.handleCardClick }, this.renderCardContent())) : (this.renderCardContent());
|
|
369
369
|
const showBanner = !!this.cardStatus && this.size === 'large';
|
|
370
|
-
return (h(Host, { key: '
|
|
370
|
+
return (h(Host, { key: 'f8ff5ff3349340873c965ac61f4411575fea0e7a', class: {
|
|
371
371
|
[`${this.orientation}`]: true,
|
|
372
372
|
'has-action': this.hasActionSlotContent,
|
|
373
373
|
'has-banner': showBanner,
|
|
374
|
-
} }, this.renderStatusBanner(), h("div", { key: '
|
|
374
|
+
} }, this.renderStatusBanner(), h("div", { key: 'e665a74e47232275906e499e02d513ea20cdd21b', class: "card-wrapper" }, cardContent, this.renderAction())));
|
|
375
375
|
}
|
|
376
376
|
static get is() { return "q2-card-image"; }
|
|
377
377
|
static get encapsulation() { return "shadow"; }
|
|
@@ -97,12 +97,12 @@ export class Q2CarouselPane {
|
|
|
97
97
|
// #region Render Methods
|
|
98
98
|
render() {
|
|
99
99
|
const { label } = this;
|
|
100
|
-
return (h(Host, { key: '
|
|
100
|
+
return (h(Host, { key: '82eb1502a11ae372d979f81043dc2defc4bb45ac', class: this.generatePaneClass(this.currentPaneIndex), tabIndex: this.isActivePane ? 0 : -1, role: "group", "aria-roledescription": "slide", "aria-hidden": this.isActivePane ? undefined : 'true', "aria-label": label
|
|
101
101
|
? loc(label)
|
|
102
102
|
: loc('tecton.element.carousel.itemDescription', [
|
|
103
103
|
(this.currentPaneIndex + 1).toString(),
|
|
104
104
|
(this.siblingCount || 0).toString(),
|
|
105
|
-
]), onClick: this.paneClicked }, h("article", { key: '
|
|
105
|
+
]), onClick: this.paneClicked }, h("article", { key: '1d67b902248a3fec6cdca88199f3f206c9702188', class: "q2-carousel-pane-main-content" }, h("slot", { key: 'd22aac4e2004baa840182c119751923c023dde29' }))));
|
|
106
106
|
}
|
|
107
107
|
static get is() { return "q2-carousel-pane"; }
|
|
108
108
|
static get originalStyleUrls() {
|
|
@@ -252,7 +252,7 @@ export class Q2ChartArea {
|
|
|
252
252
|
// #endregion
|
|
253
253
|
// #region Render Methods
|
|
254
254
|
render() {
|
|
255
|
-
return (h("div", { key: '
|
|
255
|
+
return (h("div", { key: '37129ccaf8f459d8a600de7f0c4a2d28a0d8acc3', class: "container" }, h("div", { key: 'eb1e9f5290cc300f848721e093eac01efd5f52f6', ref: el => (this.chartContainer = el), class: "chart-container", role: "img", "test-id": "areaChartContainer" })));
|
|
256
256
|
}
|
|
257
257
|
static get is() { return "q2-chart-area"; }
|
|
258
258
|
static get encapsulation() { return "shadow"; }
|
|
@@ -189,7 +189,7 @@ export class Q2ChartBar {
|
|
|
189
189
|
// #endregion
|
|
190
190
|
// #region Render Methods
|
|
191
191
|
render() {
|
|
192
|
-
return (h("div", { key: '
|
|
192
|
+
return (h("div", { key: 'e0ef7177ebb56392ef550b5190a28d34bd93c1a2', class: "container" }, h("div", { key: '8be60d7c6c0ca570fb3515998a47862aa6a29676', ref: el => (this.chartContainer = el), class: "chart-container", role: "img", "test-id": "barChartContainer" })));
|
|
193
193
|
}
|
|
194
194
|
static get is() { return "q2-chart-bar"; }
|
|
195
195
|
static get encapsulation() { return "shadow"; }
|
|
@@ -520,7 +520,7 @@ export class Q2ChartDonut {
|
|
|
520
520
|
} })), !!name && h("div", { class: "name" }, name), !isNaN(value) && h("div", { class: "value" }, displayValue))));
|
|
521
521
|
}
|
|
522
522
|
render() {
|
|
523
|
-
return (h("click-elsewhere", { key: '
|
|
523
|
+
return (h("click-elsewhere", { key: 'eb78727bb8c480478cde795c1e6bd744f988480f', onChange: this.onClickElsewhere }, h("figure", { key: '041df945c97ac0e291340123b54b3c0c14d2981e' }, h("div", { key: '550a9445398812293af981ff10d4109ed23657c9', class: "container" }, h("div", { key: '48d7a6a9639c4a3f19ec1534d08d456474a206d7', ref: el => (this.chartContainer = el), "aria-describedby": !this.isClickable ? 'center-card-description' : undefined, class: "chart-container", role: "img", "test-id": "chartContainer", onClick: this.onContainerClick, tabIndex: !this.isClickable ? 0 : undefined, onKeyDown: !this.isClickable ? this.onButtonKeyDown : undefined }), this.renderCenterBlock()), this.showLegend && (h("figcaption", { key: '7764c5810953930a594449817e2906699346df6c' }, h("q2-legend", { key: '7674d2cfd8da31367f4e1b56d42f09b79f4ba99b', class: "legend", data: this.legendData, format: this.format, hoveredItemId: this.legendHoveredId, onClick: this.onLegendClick, onMouseleave: this.onLegendMouseleave, onMouseenter: this.onLegendMouseenter, selectedItemId: this.selectedId }))))));
|
|
524
524
|
}
|
|
525
525
|
static get is() { return "q2-chart-donut"; }
|
|
526
526
|
static get encapsulation() { return "shadow"; }
|
|
@@ -106,9 +106,10 @@ button {
|
|
|
106
106
|
--comp-checkbox-description-stroke-width: var(--tct-checkbox-description-stroke-width, var(--comp-checkbox-bold-fallback-stroke-width));
|
|
107
107
|
--comp-checkbox-description-focused-stroke-width: var(--tct-checkbox-description-focused-stroke-width, var(--comp-checkbox-bold-fallback-stroke-width));
|
|
108
108
|
--comp-checkbox-description-hover-stroke-width: var(--tct-checkbox-description-hover-stroke-width, var(--comp-checkbox-bold-fallback-stroke-width));
|
|
109
|
+
--comp-checkbox-toggle-circle-fill-active: var(--tct-checkbox-toggle-active-fill, var(--tct-checkbox-toggle-active-color, var(--comp-checkbox-toggle-color)));
|
|
109
110
|
display: grid;
|
|
110
111
|
grid-template-areas: "svg label" "svg description";
|
|
111
|
-
align-items:
|
|
112
|
+
align-items: start;
|
|
112
113
|
gap: var(--comp-checkbox-gap);
|
|
113
114
|
grid-template-columns: var(--comp-control-width) calc(100% - var(--comp-control-width) - var(--comp-checkbox-default-column-gap));
|
|
114
115
|
}
|
|
@@ -429,6 +430,9 @@ label {
|
|
|
429
430
|
-webkit-text-stroke-width: var(--tct-checkbox-description-active-stroke-width, unset);
|
|
430
431
|
text-stroke-width: var(--tct-checkbox-description-active-stroke-width, unset);
|
|
431
432
|
}
|
|
433
|
+
:host(:is(:not([checked]), [checked=false])):host(:is(:not([disabled]), [disabled=false]):is(:not([group-disabled]), [group-disabled=false])) :active .toggle-circle {
|
|
434
|
+
fill: var(--comp-checkbox-toggle-circle-fill-active);
|
|
435
|
+
}
|
|
432
436
|
:host(:is(:not([checked]), [checked=false])):host([has-error]:not([has-error=false])) .toggle-track {
|
|
433
437
|
box-shadow: inset 0 0 0 1px var(--comp-checkbox-toggle-error-color);
|
|
434
438
|
fill: var(--comp-checkbox-toggle-track-fill-error);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h } from "@stencil/core";
|
|
1
|
+
import { h, } from "@stencil/core";
|
|
2
2
|
import { createGuid, handleAriaLabel, isEventFromElement, loc, overrideFocus } from "../../utils/index";
|
|
3
3
|
import mirrorEmit from "../../utils/mirror-emit";
|
|
4
4
|
/**
|
|
@@ -10,6 +10,9 @@ export class Q2Checkbox {
|
|
|
10
10
|
constructor() {
|
|
11
11
|
// #region Own Properties
|
|
12
12
|
this._id = `checkbox-${createGuid()}`;
|
|
13
|
+
// #endregion
|
|
14
|
+
// #region State Properties
|
|
15
|
+
this.hasDescription = false;
|
|
13
16
|
/** The state of the checkbox. This modifies the visual appearance of the element. */
|
|
14
17
|
this.checked = false;
|
|
15
18
|
/** Determines if the component should display in an errant state. */
|
|
@@ -32,12 +35,18 @@ export class Q2Checkbox {
|
|
|
32
35
|
}
|
|
33
36
|
// #endregion
|
|
34
37
|
// #region Component Lifecycle Events
|
|
38
|
+
disconnectedCallback() {
|
|
39
|
+
var _a;
|
|
40
|
+
(_a = this.descriptionObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
41
|
+
}
|
|
35
42
|
componentWillLoad() {
|
|
36
43
|
handleAriaLabel(this);
|
|
44
|
+
this.checkForDescription();
|
|
37
45
|
}
|
|
38
46
|
componentDidLoad() {
|
|
39
47
|
overrideFocus(this.hostElement);
|
|
40
48
|
this.hostElement.click = () => this.inputElement.click();
|
|
49
|
+
this.setupDescriptionObserver();
|
|
41
50
|
}
|
|
42
51
|
// #endregion
|
|
43
52
|
// #region Listeners
|
|
@@ -57,15 +66,27 @@ export class Q2Checkbox {
|
|
|
57
66
|
}
|
|
58
67
|
// #endregion
|
|
59
68
|
// #region Local Methods
|
|
60
|
-
get
|
|
61
|
-
const
|
|
62
|
-
|
|
69
|
+
get ariaLabelledBy() {
|
|
70
|
+
const hasLabel = !!loc(this.label) ||
|
|
71
|
+
!!this.hostElement.querySelector('[slot="label"]') ||
|
|
72
|
+
Array.from(this.hostElement.childNodes).some(node => { var _a; return !(node instanceof HTMLElement && node.getAttribute('slot')) && !!((_a = node.textContent) === null || _a === void 0 ? void 0 : _a.trim()); });
|
|
73
|
+
if (!hasLabel && !this._tooltip)
|
|
63
74
|
return undefined;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
75
|
+
const ids = [];
|
|
76
|
+
if (hasLabel)
|
|
77
|
+
ids.push(this.labelId);
|
|
78
|
+
if (this._tooltip)
|
|
79
|
+
ids.push(this.tooltipId);
|
|
80
|
+
return ids.join(' ');
|
|
81
|
+
}
|
|
82
|
+
get labelId() {
|
|
83
|
+
return `label-${this._id}`;
|
|
84
|
+
}
|
|
85
|
+
get tooltipId() {
|
|
86
|
+
return `tooltip-${this._id}`;
|
|
87
|
+
}
|
|
88
|
+
checkForDescription() {
|
|
89
|
+
this.hasDescription = !!this.description || !!this.hostElement.querySelector('[slot="description"]');
|
|
69
90
|
}
|
|
70
91
|
handleChangeEvent(event) {
|
|
71
92
|
if (this.readonly ||
|
|
@@ -78,6 +99,15 @@ export class Q2Checkbox {
|
|
|
78
99
|
}
|
|
79
100
|
this.checked = event.detail.checked;
|
|
80
101
|
}
|
|
102
|
+
setupDescriptionObserver() {
|
|
103
|
+
this.descriptionObserver = new MutationObserver(() => {
|
|
104
|
+
this.checkForDescription();
|
|
105
|
+
});
|
|
106
|
+
this.descriptionObserver.observe(this.hostElement, {
|
|
107
|
+
childList: true,
|
|
108
|
+
subtree: true,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
81
111
|
// #endregion
|
|
82
112
|
// #region Render Methods
|
|
83
113
|
renderCheckboxSVG() {
|
|
@@ -102,7 +132,7 @@ export class Q2Checkbox {
|
|
|
102
132
|
const textLabelClasses = ['label-text'];
|
|
103
133
|
if (this.hideLabel)
|
|
104
134
|
textLabelClasses.push('sr');
|
|
105
|
-
return (h("div", { key: '
|
|
135
|
+
return (h("div", { key: '85510401109c8178df2030f13f9ae5bf25a1712b', class: "container" }, h("input", { key: '04e5acd4a3261aa0878560985567547dd860c24a', ref: el => (this.inputElement = el), "aria-describedby": this.hasDescription ? 'description' : undefined, "aria-invalid": this.hasError === undefined ? undefined : `${this.hasError}`, "aria-labelledby": this.ariaLabelledBy, checked: this.indeterminate || this.checked || false, class: "sr", disabled: !!this.disabled || !!this.groupDisabled, id: this._id, name: this.name || this._id, onClick: this.onInputClick, "test-id": "q2CheckboxInnerCheckBox", type: "checkbox", value: this.value }), h("label", { key: '57906a968d98516db9be351beca12e3b6e4e2f28', htmlFor: this._id, class: "label-control", "test-id": "checkboxButton", "aria-hidden": "true" }, this.renderCheckboxSVG()), h("div", { key: 'b28bc3f3f807318a4c9efa4942d7235ab05cfc19', class: textLabelClasses.join(' ') }, h("label", { key: '1606b6ac48fd7726f291a2c393d5988ddf35203f', "test-id": "checkboxLabel", htmlFor: this._id, id: this.labelId }, h("div", { key: '1de9ab5c373a5a8f0ed903897fd4ebac84816d83', class: "label-content" }, loc(this.label), h("slot", { key: '3e9bf0f5a40a7683281a2ecb00fb29109919a919' }), h("slot", { key: 'ba1f1b47cfb77fef629225625c8b5a0adc63c2aa', name: "label" })))), this._tooltip && (h("span", { key: '1d6f82a46450ba5c40d10a1d82b422a83417ce6c', id: this.tooltipId, class: "sr", "test-id": "checkboxTooltipText" }, this._tooltip)), this.hasDescription && (h("div", { key: '2055226d379a78b9569a2a2af59287f9170b4e7a', class: "description-text", "test-id": "checkboxDescription", id: "description" }, loc(this.description), h("slot", { key: '01549fb0ef8c939037eb0d0960905de58222b22d', name: "description" })))));
|
|
106
136
|
}
|
|
107
137
|
static get is() { return "q2-checkbox"; }
|
|
108
138
|
static get encapsulation() { return "shadow"; }
|
|
@@ -444,6 +474,11 @@ export class Q2Checkbox {
|
|
|
444
474
|
}
|
|
445
475
|
};
|
|
446
476
|
}
|
|
477
|
+
static get states() {
|
|
478
|
+
return {
|
|
479
|
+
"hasDescription": {}
|
|
480
|
+
};
|
|
481
|
+
}
|
|
447
482
|
static get events() {
|
|
448
483
|
return [{
|
|
449
484
|
"method": "change",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"q2-checkbox.js","sourceRoot":"","sources":["../../../../src/components/q2-checkbox/q2-checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAsB,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,eAAe,CAAC;AACpH,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,kBAAkB,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAChG,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAE7C;;;;GAIG;AAEH,MAAM,OAAO,UAAU;IADvB;QAEI,yBAAyB;QAEzB,QAAG,GAAW,YAAY,UAAU,EAAE,EAAE,CAAC;QA2BzC,qFAAqF;QAErF,YAAO,GAAY,KAAK,CAAC;QAoBzB,qEAAqE;QAErE,aAAQ,GAAY,KAAK,CAAC;QA8H1B,iBAAY,GAAG,CAAC,KAAY,EAAE,EAAE;YAC5B,KAAK,CAAC,eAAe,EAAE,CAAC;YACxB,KAAK,CAAC,cAAc,EAAE,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,GAAG,EAC3B,OAAO,EAAE,IAAI,CAAC,YAAY,aAClB,yBAAyB,EACjC,IAAI,EAAC,UAAU,EACf,KAAK,EAAE,IAAI,CAAC,KAAK,GACnB;YACF,8DACI,OAAO,EAAE,IAAI,CAAC,GAAG,EACjB,KAAK,EAAC,eAAe,aACb,gBAAgB,gBACZ,IAAI,CAAC,iBAAiB,IAEjC,IAAI,CAAC,iBAAiB,EAAE,CACrB;YACR,4DAAK,KAAK,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC;gBAClC,yEACY,eAAe,EACvB,OAAO,EAAE,IAAI,CAAC,GAAG,iBACL,MAAM;oBAElB,4DAAK,KAAK,EAAC,eAAe;wBACrB,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC;wBAChB,8DAAQ,CACN,CACF,CACN;YACL,IAAI,CAAC,WAAW,IAAI,CACjB,4DACI,KAAK,EAAC,kBAAkB,aAChB,qBAAqB,EAC7B,EAAE,EAAC,aAAa,IAEf,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CACpB,CACT,CACC,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGJ","sourcesContent":["import { Component, ComponentInterface, Prop, Element, Listen, Watch, Event, EventEmitter, h } from '@stencil/core';\nimport { createGuid, handleAriaLabel, isEventFromElement, loc, overrideFocus } from 'src/utils';\nimport mirrorEmit from '@/utils/mirror-emit';\n\n/**\n * @name Checkbox\n * @category Forms\n * @summary Use as a single binary choice; nest within a Checkbox Group for grouped selection.\n */\n@Component({ tag: 'q2-checkbox', shadow: true, styleUrl: 'q2-checkbox.scss' })\nexport class Q2Checkbox implements ComponentInterface {\n // #region Own Properties\n\n _id: string = `checkbox-${createGuid()}`;\n inputElement: HTMLInputElement;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region Public Property API\n\n /**\n * @private\n * Tooltip text set by a parent q2-tooltip component for accessibility.\n */\n @Prop()\n _tooltip: string;\n\n /** Determine which side of the label the checkbox will render on. */\n @Prop({ reflect: true })\n alignment: string;\n\n /** @deprecated */\n @Prop({ reflect: true, mutable: true })\n ariaLabel: string;\n\n /** The state of the checkbox. This modifies the visual appearance of the element. */\n @Prop({ reflect: true, mutable: true })\n checked: boolean = false;\n\n /**\n * Populates a description that is displayed beneath the label.\n * @localizable\n */\n @Prop({ reflect: true })\n description: string;\n\n /** Disables the checkbox and prevents interaction. */\n @Prop({ reflect: true })\n disabled: boolean;\n\n /**\n * Used by q2-checkbox-group to disable all checkboxes in the group\n * @private\n */\n @Prop({ reflect: true })\n groupDisabled: boolean;\n\n /** Determines if the component should display in an errant state. */\n @Prop({ reflect: true })\n hasError: boolean = false;\n\n /**\n * Hide's the field's `<label>` element from view.\n *\n * @warning\n * Only use when a visible label is impractical.\n */\n @Prop({ reflect: true, mutable: true })\n hideLabel: boolean;\n\n /**\n * Used on a parent checkbox in a checkbox group (e.g. \"Select All\") to indicate that some, but not all, checkboxes in a group are checked.\n *\n * When `true`, the \"indeterminate\" selection style is applied.\n * To apply the standard \"checked\" selection style, `checked` must be true, and `indeterminate` must be `false`.\n */\n @Prop({ reflect: true })\n indeterminate: boolean;\n\n /**\n * The visible label text for the checkbox. Appears to the right of the box for 'default' and 'favorite' checkboxes, and to the left for 'toggle' checkboxes.\n * Yielded content will be adjacent to this text.\n * @localizable\n */\n @Prop({ reflect: true, mutable: true })\n label: string;\n\n /** A static string used to establish a symbolic relationship between checkboxes. */\n @Prop({ reflect: true })\n name: string;\n\n /** The field is not interactive, but remains focusable. */\n @Prop({ reflect: true })\n readonly: boolean;\n\n /** The field is not interactive, but remains focusable. */\n @Prop({ reflect: true })\n slotReadonly: boolean;\n\n /** The visual style of the checkbox. This does not need to be defined for a standard checkbox. */\n @Prop({ reflect: true })\n type: 'favorite' | 'toggle';\n\n /** A static reference value for the checkbox. */\n @Prop({ reflect: true })\n value: string;\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when the checkbox is toggled.\n * @deprecated Use 'tctChange' instead\n * @legacyEvent\n */\n @Event()\n change: EventEmitter<{ value: string; checked: boolean }>;\n\n /**\n * Emitted when the checkbox is toggled.\n * @legacyEvent\n */\n @Event()\n tctChange: EventEmitter<{ value: string; checked: boolean }>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n componentWillLoad() {\n handleAriaLabel(this);\n }\n\n componentDidLoad(): void {\n overrideFocus(this.hostElement);\n this.hostElement.click = () => this.inputElement.click();\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('change')\n defaultChangeHandler(event: CustomEvent) {\n // We use setTimeout to give an opportunity to call preventDefault\n setTimeout(() => this.handleChangeEvent(event), 0);\n }\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (!isEventFromElement(event, this.hostElement)) return;\n this.hostElement.shadowRoot.querySelector('input').focus();\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('ariaLabel')\n ariaLabelObserver() {\n handleAriaLabel(this);\n }\n\n // #endregion\n // #region Local Methods\n\n get composedAriaLabel(): string | undefined {\n const baseText = loc(this.label) || undefined;\n if (!this._tooltip && !baseText) return undefined;\n if (!this._tooltip) return baseText;\n if (!baseText) return this._tooltip;\n return `${baseText} - ${this._tooltip}`;\n }\n\n handleChangeEvent(event: CustomEvent<{ checked: boolean; value: string }>) {\n if (\n this.readonly ||\n this.disabled ||\n this.hostElement.onchange ||\n event.defaultPrevented ||\n event.target !== this.hostElement ||\n !event.detail\n ) {\n return;\n }\n this.checked = event.detail.checked;\n }\n\n onInputClick = (event: Event) => {\n event.stopPropagation();\n event.preventDefault();\n\n const isNotInteractive = this.disabled || this.readonly || this.slotReadonly;\n if (isNotInteractive) return;\n if (!(event.target instanceof HTMLInputElement)) return;\n const { value, checked } = event.target;\n\n mirrorEmit(this, ['change', 'tctChange'], {\n value,\n checked,\n });\n this.inputElement.focus();\n };\n\n // #endregion\n // #region Render Methods\n\n renderCheckboxSVG() {\n if (this.type === 'favorite') {\n return (\n <q2-icon\n type=\"star\"\n class=\"checkbox-icon\"\n />\n );\n }\n\n if (this.type === 'toggle') {\n return this.renderToggleSVG();\n }\n\n return (\n <svg\n aria-hidden=\"true\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n class=\"checkbox-icon\"\n focusable=\"false\"\n >\n <rect\n x=\"1\"\n y=\"1\"\n width=\"18\"\n height=\"18\"\n rx=\"3\"\n />\n {(this.checked || this.indeterminate) && this.renderCheckBoxSVGFill()}\n </svg>\n );\n }\n\n renderCheckBoxSVGFill() {\n if (this.indeterminate) {\n return (\n <line\n class=\"checkbox-fill indeterminate-fill\"\n x1=\"4\"\n y1=\"10\"\n x2=\"16\"\n y2=\"10\"\n />\n );\n }\n return (\n <polyline\n class=\"checkbox-fill checked-fill\"\n points=\"5 11 8.5 14.5 15 6\"\n key={`checkmark-${this.checked}`}\n />\n );\n }\n\n renderToggleSVG() {\n return (\n <div class=\"toggle-svg-container\">\n <svg\n aria-hidden=\"true\"\n focusable=\"false\"\n viewBox=\"0 0 38 24\"\n class=\"toggle-track\"\n test-id=\"toggleTrack\"\n >\n <rect\n width=\"38\"\n height=\"24\"\n rx=\"12\"\n ></rect>\n </svg>\n <svg\n aria-hidden=\"true\"\n focusable=\"false\"\n viewBox=\"0 0 18 18\"\n class=\"toggle-indicator\"\n test-id=\"toggleIndicator\"\n >\n <defs>\n {/* Mask for the X icon */}\n <mask\n id=\"xMask\"\n maskUnits=\"userSpaceOnUse\"\n >\n <rect\n width=\"18\"\n height=\"18\"\n fill=\"white\"\n ></rect>\n <line\n class=\"toggle-icon\"\n x1=\"6.5\"\n y1=\"6.5\"\n x2=\"11.5\"\n y2=\"11.5\"\n stroke=\"black\"\n stroke-width=\"2\"\n ></line>\n <line\n class=\"toggle-icon\"\n x1=\"6.5\"\n y1=\"11.5\"\n x2=\"11.5\"\n y2=\"6.5\"\n stroke=\"black\"\n stroke-width=\"2\"\n ></line>\n </mask>\n {/* Mask for the checkmark icon */}\n <mask id=\"checkMask\">\n <rect\n width=\"18\"\n height=\"18\"\n fill=\"white\"\n />\n <polyline\n class=\"toggle-icon\"\n points=\"6,8.5 8.5,11 12.5,6.5\"\n fill=\"none\"\n />\n </mask>\n </defs>\n <circle\n class=\"toggle-circle\"\n cx=\"9\"\n cy=\"9\"\n r=\"9\"\n mask=\"url(#xMask)\"\n ></circle>\n </svg>\n </div>\n );\n }\n\n render() {\n const textLabelClasses = ['label-text'];\n if (this.hideLabel) textLabelClasses.push('sr');\n return (\n <div class=\"container\">\n <input\n ref={el => (this.inputElement = el)}\n aria-describedby={this.description ? 'description' : undefined}\n aria-invalid={this.hasError === undefined ? undefined : `${this.hasError}`}\n checked={this.indeterminate || this.checked || false}\n class=\"sr\"\n disabled={!!this.disabled || !!this.groupDisabled}\n id={this._id}\n name={this.name || this._id}\n onClick={this.onInputClick}\n test-id=\"q2CheckboxInnerCheckBox\"\n type=\"checkbox\"\n value={this.value}\n />\n <label\n htmlFor={this._id}\n class=\"label-control\"\n test-id=\"checkboxButton\"\n aria-label={this.composedAriaLabel}\n >\n {this.renderCheckboxSVG()}\n </label>\n <div class={textLabelClasses.join(' ')}>\n <label\n test-id=\"checkboxLabel\"\n htmlFor={this._id}\n aria-hidden=\"true\"\n >\n <div class=\"label-content\">\n {loc(this.label)}\n <slot />\n </div>\n </label>\n </div>\n {this.description && (\n <div\n class=\"description-text\"\n test-id=\"checkboxDescription\"\n id=\"description\"\n >\n {loc(this.description)}\n </div>\n )}\n </div>\n );\n }\n\n // #endregion\n}\n"]}
|
|
1
|
+
{"version":3,"file":"q2-checkbox.js","sourceRoot":"","sources":["../../../../src/components/q2-checkbox/q2-checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EAET,OAAO,EACP,KAAK,EAEL,CAAC,EACD,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,GACR,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,kBAAkB,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAChG,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAE7C;;;;GAIG;AAEH,MAAM,OAAO,UAAU;IADvB;QAEI,yBAAyB;QAEzB,QAAG,GAAW,YAAY,UAAU,EAAE,EAAE,CAAC;QAUzC,aAAa;QACb,2BAA2B;QAG3B,mBAAc,GAAY,KAAK,CAAC;QAoBhC,qFAAqF;QAErF,YAAO,GAAY,KAAK,CAAC;QAoBzB,qEAAqE;QAErE,aAAQ,GAAY,KAAK,CAAC;QAsJ1B,iBAAY,GAAG,CAAC,KAAY,EAAE,EAAE;YAC5B,KAAK,CAAC,eAAe,EAAE,CAAC;YACxB,KAAK,CAAC,cAAc,EAAE,CAAC;YAEvB,MAAM,gBAAgB,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,YAAY,CAAC;YAC7E,IAAI,gBAAgB;gBAAE,OAAO;YAC7B,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,YAAY,gBAAgB,CAAC;gBAAE,OAAO;YACxD,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;YAExC,UAAU,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,WAAW,C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,EAAE,EAAE,IAAI,CAAC,OAAO;oBAEhB,4DAAK,KAAK,EAAC,eAAe;wBACrB,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC;wBAChB,8DAAQ;wBACR,6DAAM,IAAI,EAAC,OAAO,GAAG,CACnB,CACF,CACN;YACL,IAAI,CAAC,QAAQ,IAAI,CACd,6DACI,EAAE,EAAE,IAAI,CAAC,SAAS,EAClB,KAAK,EAAC,IAAI,aACF,qBAAqB,IAE5B,IAAI,CAAC,QAAQ,CACX,CACV;YACA,IAAI,CAAC,cAAc,IAAI,CACpB,4DACI,KAAK,EAAC,kBAAkB,aAChB,qBAAqB,EAC7B,EAAE,EAAC,aAAa;gBAEf,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC;gBACtB,6DAAM,IAAI,EAAC,aAAa,GAAG,CACzB,CACT,CACC,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGJ","sourcesContent":["import {\n Component,\n ComponentInterface,\n Element,\n Event,\n EventEmitter,\n h,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { createGuid, handleAriaLabel, isEventFromElement, loc, overrideFocus } from 'src/utils';\nimport mirrorEmit from '@/utils/mirror-emit';\n\n/**\n * @name Checkbox\n * @category Forms\n * @summary Use as a single binary choice; nest within a Checkbox Group for grouped selection.\n */\n@Component({ tag: 'q2-checkbox', shadow: true, styleUrl: 'q2-checkbox.scss' })\nexport class Q2Checkbox implements ComponentInterface {\n // #region Own Properties\n\n _id: string = `checkbox-${createGuid()}`;\n descriptionObserver: MutationObserver;\n inputElement: HTMLInputElement;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region State Properties\n\n @State()\n hasDescription: boolean = false;\n\n // #endregion\n // #region Public Property API\n\n /**\n * @private\n * Tooltip text set by a parent q2-tooltip component for accessibility.\n */\n @Prop()\n _tooltip: string;\n\n /** Determine which side of the label the checkbox will render on. */\n @Prop({ reflect: true })\n alignment: string;\n\n /** @deprecated */\n @Prop({ reflect: true, mutable: true })\n ariaLabel: string;\n\n /** The state of the checkbox. This modifies the visual appearance of the element. */\n @Prop({ reflect: true, mutable: true })\n checked: boolean = false;\n\n /**\n * Populates a description that is displayed beneath the label.\n * @localizable\n */\n @Prop({ reflect: true })\n description: string;\n\n /** Disables the checkbox and prevents interaction. */\n @Prop({ reflect: true })\n disabled: boolean;\n\n /**\n * Used by q2-checkbox-group to disable all checkboxes in the group\n * @private\n */\n @Prop({ reflect: true })\n groupDisabled: boolean;\n\n /** Determines if the component should display in an errant state. */\n @Prop({ reflect: true })\n hasError: boolean = false;\n\n /**\n * Hide's the field's `<label>` element from view.\n *\n * @warning\n * Only use when a visible label is impractical.\n */\n @Prop({ reflect: true, mutable: true })\n hideLabel: boolean;\n\n /**\n * Used on a parent checkbox in a checkbox group (e.g. \"Select All\") to indicate that some, but not all, checkboxes in a group are checked.\n *\n * When `true`, the \"indeterminate\" selection style is applied.\n * To apply the standard \"checked\" selection style, `checked` must be true, and `indeterminate` must be `false`.\n */\n @Prop({ reflect: true })\n indeterminate: boolean;\n\n /**\n * The visible label text for the checkbox. Appears to the right of the box for 'default' and 'favorite' checkboxes, and to the left for 'toggle' checkboxes.\n * Yielded content will be adjacent to this text.\n * @localizable\n */\n @Prop({ reflect: true, mutable: true })\n label: string;\n\n /** A static string used to establish a symbolic relationship between checkboxes. */\n @Prop({ reflect: true })\n name: string;\n\n /** The field is not interactive, but remains focusable. */\n @Prop({ reflect: true })\n readonly: boolean;\n\n /** The field is not interactive, but remains focusable. */\n @Prop({ reflect: true })\n slotReadonly: boolean;\n\n /** The visual style of the checkbox. This does not need to be defined for a standard checkbox. */\n @Prop({ reflect: true })\n type: 'favorite' | 'toggle';\n\n /** A static reference value for the checkbox. */\n @Prop({ reflect: true })\n value: string;\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when the checkbox is toggled.\n * @deprecated Use 'tctChange' instead\n * @legacyEvent\n */\n @Event()\n change: EventEmitter<{ value: string; checked: boolean }>;\n\n /**\n * Emitted when the checkbox is toggled.\n * @legacyEvent\n */\n @Event()\n tctChange: EventEmitter<{ value: string; checked: boolean }>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n disconnectedCallback(): void {\n this.descriptionObserver?.disconnect();\n }\n\n componentWillLoad() {\n handleAriaLabel(this);\n this.checkForDescription();\n }\n\n componentDidLoad(): void {\n overrideFocus(this.hostElement);\n this.hostElement.click = () => this.inputElement.click();\n this.setupDescriptionObserver();\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('change')\n defaultChangeHandler(event: CustomEvent) {\n // We use setTimeout to give an opportunity to call preventDefault\n setTimeout(() => this.handleChangeEvent(event), 0);\n }\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (!isEventFromElement(event, this.hostElement)) return;\n this.hostElement.shadowRoot.querySelector('input').focus();\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('ariaLabel')\n ariaLabelObserver() {\n handleAriaLabel(this);\n }\n\n // #endregion\n // #region Local Methods\n\n get ariaLabelledBy(): string | undefined {\n const hasLabel =\n !!loc(this.label) ||\n !!this.hostElement.querySelector('[slot=\"label\"]') ||\n Array.from(this.hostElement.childNodes).some(\n node => !(node instanceof HTMLElement && node.getAttribute('slot')) && !!node.textContent?.trim()\n );\n if (!hasLabel && !this._tooltip) return undefined;\n const ids = [];\n if (hasLabel) ids.push(this.labelId);\n if (this._tooltip) ids.push(this.tooltipId);\n return ids.join(' ');\n }\n\n get labelId(): string {\n return `label-${this._id}`;\n }\n\n get tooltipId(): string {\n return `tooltip-${this._id}`;\n }\n\n checkForDescription() {\n this.hasDescription = !!this.description || !!this.hostElement.querySelector('[slot=\"description\"]');\n }\n\n handleChangeEvent(event: CustomEvent<{ checked: boolean; value: string }>) {\n if (\n this.readonly ||\n this.disabled ||\n this.hostElement.onchange ||\n event.defaultPrevented ||\n event.target !== this.hostElement ||\n !event.detail\n ) {\n return;\n }\n this.checked = event.detail.checked;\n }\n\n onInputClick = (event: Event) => {\n event.stopPropagation();\n event.preventDefault();\n\n const isNotInteractive = this.disabled || this.readonly || this.slotReadonly;\n if (isNotInteractive) return;\n if (!(event.target instanceof HTMLInputElement)) return;\n const { value, checked } = event.target;\n\n mirrorEmit(this, ['change', 'tctChange'], {\n value,\n checked,\n });\n this.inputElement.focus();\n };\n\n setupDescriptionObserver() {\n this.descriptionObserver = new MutationObserver(() => {\n this.checkForDescription();\n });\n\n this.descriptionObserver.observe(this.hostElement, {\n childList: true,\n subtree: true,\n });\n }\n\n // #endregion\n // #region Render Methods\n\n renderCheckboxSVG() {\n if (this.type === 'favorite') {\n return (\n <q2-icon\n type=\"star\"\n class=\"checkbox-icon\"\n />\n );\n }\n\n if (this.type === 'toggle') {\n return this.renderToggleSVG();\n }\n\n return (\n <svg\n aria-hidden=\"true\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n class=\"checkbox-icon\"\n focusable=\"false\"\n >\n <rect\n x=\"1\"\n y=\"1\"\n width=\"18\"\n height=\"18\"\n rx=\"3\"\n />\n {(this.checked || this.indeterminate) && this.renderCheckBoxSVGFill()}\n </svg>\n );\n }\n\n renderCheckBoxSVGFill() {\n if (this.indeterminate) {\n return (\n <line\n class=\"checkbox-fill indeterminate-fill\"\n x1=\"4\"\n y1=\"10\"\n x2=\"16\"\n y2=\"10\"\n />\n );\n }\n return (\n <polyline\n class=\"checkbox-fill checked-fill\"\n points=\"5 11 8.5 14.5 15 6\"\n key={`checkmark-${this.checked}`}\n />\n );\n }\n\n renderToggleSVG() {\n return (\n <div class=\"toggle-svg-container\">\n <svg\n aria-hidden=\"true\"\n focusable=\"false\"\n viewBox=\"0 0 38 24\"\n class=\"toggle-track\"\n test-id=\"toggleTrack\"\n >\n <rect\n width=\"38\"\n height=\"24\"\n rx=\"12\"\n ></rect>\n </svg>\n <svg\n aria-hidden=\"true\"\n focusable=\"false\"\n viewBox=\"0 0 18 18\"\n class=\"toggle-indicator\"\n test-id=\"toggleIndicator\"\n >\n <defs>\n {/* Mask for the X icon */}\n <mask\n id=\"xMask\"\n maskUnits=\"userSpaceOnUse\"\n >\n <rect\n width=\"18\"\n height=\"18\"\n fill=\"white\"\n ></rect>\n <line\n class=\"toggle-icon\"\n x1=\"6.5\"\n y1=\"6.5\"\n x2=\"11.5\"\n y2=\"11.5\"\n stroke=\"black\"\n stroke-width=\"2\"\n ></line>\n <line\n class=\"toggle-icon\"\n x1=\"6.5\"\n y1=\"11.5\"\n x2=\"11.5\"\n y2=\"6.5\"\n stroke=\"black\"\n stroke-width=\"2\"\n ></line>\n </mask>\n {/* Mask for the checkmark icon */}\n <mask id=\"checkMask\">\n <rect\n width=\"18\"\n height=\"18\"\n fill=\"white\"\n />\n <polyline\n class=\"toggle-icon\"\n points=\"6,8.5 8.5,11 12.5,6.5\"\n fill=\"none\"\n />\n </mask>\n </defs>\n <circle\n class=\"toggle-circle\"\n cx=\"9\"\n cy=\"9\"\n r=\"9\"\n mask=\"url(#xMask)\"\n ></circle>\n </svg>\n </div>\n );\n }\n\n render() {\n const textLabelClasses = ['label-text'];\n if (this.hideLabel) textLabelClasses.push('sr');\n return (\n <div class=\"container\">\n <input\n ref={el => (this.inputElement = el)}\n aria-describedby={this.hasDescription ? 'description' : undefined}\n aria-invalid={this.hasError === undefined ? undefined : `${this.hasError}`}\n aria-labelledby={this.ariaLabelledBy}\n checked={this.indeterminate || this.checked || false}\n class=\"sr\"\n disabled={!!this.disabled || !!this.groupDisabled}\n id={this._id}\n name={this.name || this._id}\n onClick={this.onInputClick}\n test-id=\"q2CheckboxInnerCheckBox\"\n type=\"checkbox\"\n value={this.value}\n />\n <label\n htmlFor={this._id}\n class=\"label-control\"\n test-id=\"checkboxButton\"\n aria-hidden=\"true\"\n >\n {this.renderCheckboxSVG()}\n </label>\n <div class={textLabelClasses.join(' ')}>\n <label\n test-id=\"checkboxLabel\"\n htmlFor={this._id}\n id={this.labelId}\n >\n <div class=\"label-content\">\n {loc(this.label)}\n <slot />\n <slot name=\"label\" />\n </div>\n </label>\n </div>\n {this._tooltip && (\n <span\n id={this.tooltipId}\n class=\"sr\"\n test-id=\"checkboxTooltipText\"\n >\n {this._tooltip}\n </span>\n )}\n {this.hasDescription && (\n <div\n class=\"description-text\"\n test-id=\"checkboxDescription\"\n id=\"description\"\n >\n {loc(this.description)}\n <slot name=\"description\" />\n </div>\n )}\n </div>\n );\n }\n\n // #endregion\n}\n"]}
|
|
@@ -120,7 +120,7 @@ export class Q2CheckboxGroup {
|
|
|
120
120
|
render() {
|
|
121
121
|
const showLabel = this.label || this.optional || this.readonly;
|
|
122
122
|
const showLabelRow = (showLabel && !this.hideLabel) || this.hasError;
|
|
123
|
-
return (h(Fragment, { key: '
|
|
123
|
+
return (h(Fragment, { key: '4e9159cc489b8c2ed9adf3c8263355994364780e' }, showLabelRow && (h("div", { key: '85c21ddc03d2abaf4e78b1922dcf3705ec673fc9', class: "label-row" }, showLabel && !this.hideLabel && h("div", { key: '071eb3359b048a5e7f89f7c525362e065707a8fe', class: "group-legend" }, renderLabel(this)), this.hasError && (h("q2-icon", { key: '76a591fb52671d43351322faa488608128320183', type: "error", "test-id": "iconError" })))), h("fieldset", { key: '0bcc9a5419df7ab0bf2abfc6189983e6cf5bd779', onChange: this.onInnerCheckboxChange, "aria-invalid": this.hasError ? `${this.hasError}` : undefined }, showLabel && h("legend", { key: 'c6a5f3ec8289091b6d113a36d2fed9b83a5c7088', class: "sr-only" }, renderLabel(this)), this.inputDom())));
|
|
124
124
|
}
|
|
125
125
|
static get is() { return "q2-checkbox-group"; }
|
|
126
126
|
static get encapsulation() { return "shadow"; }
|
|
@@ -129,7 +129,7 @@ export class Q2Context {
|
|
|
129
129
|
// #endregion
|
|
130
130
|
// #region Render Methods
|
|
131
131
|
render() {
|
|
132
|
-
return (h("div", { key: '
|
|
132
|
+
return (h("div", { key: '8bd2bf977388c552b749af93f1682eb5b491b241', class: "context-wrapper" }, h("q2-item", { key: '38c657ce812b32b18acd97cfac8aa50c8c904587', class: "context-item" }, this.hasDecoratorSlotContent && (h("slot", { key: '7816474bd52a207930abfd8cf6d37a7eab5348a3', name: "decorator", slot: "decorator" })), h("div", { key: 'e19e91cf7181beb57e1790313e46010208573017', class: "context-body", slot: "body" }, h("slot", { key: '9f7eee48cfe8993cea5f001e6096330fdff91f42', name: "header" }), h("slot", { key: 'a50f7afcaca2907254eac06b30edba31a96b248b', name: "description" })), this.hasAffordanceSlotContent && (h("slot", { key: '00b35f4f191919c971a25f20c7771d787d52603a', name: "affordance", slot: "action" }))), this.separator && (h("div", { key: 'db2ba58244c8040cd73e30c69abd0068f8573e42', class: "separator", role: "separator" })), this.hasActionGroupSlotContent && (h("q2-action-group", { key: 'c530b882cda2655633efaaf3088c878b96fa3ccb', class: "action-group", orientation: "horizontal" }, h("slot", { key: '3aff5167bf8d7707181af5874fffbf7f94485405', name: "action-group" }))), this.hasFooterSlotContent && h("slot", { key: 'b47f8995b3f027dc726772c82edb6981ff4ae757', name: "footer" })));
|
|
133
133
|
}
|
|
134
134
|
static get is() { return "q2-context"; }
|
|
135
135
|
static get encapsulation() { return "shadow"; }
|
|
@@ -141,7 +141,7 @@ export class Q2Currency {
|
|
|
141
141
|
// #region Render Methods
|
|
142
142
|
render() {
|
|
143
143
|
const { hasPlusMinusSign, plusMinusSign, currencyIsFront, currencySymbol, shouldSuperscriptSymbol, amountCore, fraction, shouldSuperscriptFraction, readableCurrency, currencyClasses, signDisplay, isNegativeAmount, } = this;
|
|
144
|
-
return (h("div", { key: '
|
|
144
|
+
return (h("div", { key: 'a600525cc214be0a670d8faa90c22583bb142a5a', "test-id": "q2CurrencyInner", class: currencyClasses, "aria-label": readableCurrency }, signDisplay === 'accounting' && isNegativeAmount && h("span", { key: '40a2b4736c8afc5b7939391fe90600d79d584c66' }, '('), hasPlusMinusSign && h("span", { key: '6f5755d3e4681168e523c9549a0fa2ce60ad49fc' }, plusMinusSign), currencyIsFront && h("span", { key: '006b2ab6a62e7f1f5bf413ce767763d1c8b6fa57', class: shouldSuperscriptSymbol ? 'superscript' : '' }, currencySymbol), h("span", { key: '96b0d7262fa2bcf8b9039fba828d937e88c0fc00' }, amountCore), h("span", { key: 'fa848c80fe88cff6de78a1386c4473413f0cda18', class: shouldSuperscriptFraction ? 'superscript' : '' }, fraction), !currencyIsFront && h("span", { key: '0a39e489c17f33846af1587603a2e9ae21bd5f78', class: shouldSuperscriptSymbol ? 'superscript' : '' }, currencySymbol), signDisplay === 'accounting' && isNegativeAmount && h("span", { key: '9e088b3f70a82bb7bb0ab1d8a59e1eadd837178a' }, ')')));
|
|
145
145
|
}
|
|
146
146
|
static get is() { return "q2-currency"; }
|
|
147
147
|
static get encapsulation() { return "shadow"; }
|
|
@@ -398,7 +398,7 @@ export class Q2DataTable {
|
|
|
398
398
|
// #region Render Methods
|
|
399
399
|
render() {
|
|
400
400
|
const { caption } = this;
|
|
401
|
-
return (h("div", { key: '
|
|
401
|
+
return (h("div", { key: 'ee7b81a0e49d8be037696fb1e275f90fe5547f8b', class: "container" }, h("table", { key: 'a5ee5ad79d6ed0b5e911611f9e15fb2130c69894' }, caption && h("caption", { key: 'ba4ea123b1b9fe1bda5734dcd789889db8d992b9', class: this.hideCaption ? 'sr' : undefined }, caption), this.renderTableColGroup(), this.renderTableHeader(), this.renderEmptyState(), this.renderTableRows())));
|
|
402
402
|
}
|
|
403
403
|
renderCellContent(cell) {
|
|
404
404
|
if (!cell)
|
|
@@ -107,7 +107,7 @@ export class Q2Detail {
|
|
|
107
107
|
// #endregion
|
|
108
108
|
// #region Render Methods
|
|
109
109
|
render() {
|
|
110
|
-
return (h("div", { key: '
|
|
110
|
+
return (h("div", { key: 'e9fe9f1d23de26052a90b499865c30908942d90e', class: this.detailClasses }, this.hasLabel && (h("div", { key: '74575c0c28fd5493cec9b04e4693f66812863946', class: this.labelClasses, "aria-describedby": !!this.description ? 'label-description' : undefined }, !!this.label ? loc(this.label) : this.hasLabelSlotContent ? h("slot", { name: "label" }) : '')), this.hasDescripiton && (h("div", { key: 'd9bef4e29bfc54e6149d57322833f6184572b863', id: "label-description", class: this.descriptionClasses }, !!this.description ? loc(this.description) : this.hasDefaultSlotContent ? h("slot", null) : ''))));
|
|
111
111
|
}
|
|
112
112
|
static get is() { return "q2-detail"; }
|
|
113
113
|
static get encapsulation() { return "shadow"; }
|
|
@@ -366,7 +366,7 @@ export class Q2Dropdown {
|
|
|
366
366
|
// #region Render Methods
|
|
367
367
|
render() {
|
|
368
368
|
const btnProps = this.toggleButtonProps;
|
|
369
|
-
return (h("click-elsewhere", { key: '
|
|
369
|
+
return (h("click-elsewhere", { key: 'b6e82a77840792da2ab918048abf38578ec4ccb3', class: this.open ? 'dropdown-open' : '', onChange: this.onClickElsewhere, "test-id": "dropdownContainer" }, h("q2-btn", { key: '5c26f1d198bd92ba61ac51080a3f8e2769d07b01', tabIndex: 0, ref: el => (this.controlElement = el), class: btnProps.className, onClick: this.onToggleClick, onKeyDown: this.onToggleKeydown, fab: btnProps.fab, intent: btnProps.intent, onFocusout: this.handleFocusOut, active: btnProps.active, disabled: btnProps.disabled, ariaExpanded: `${!!btnProps.ariaExpanded}`, label: this.hideLabel && this.label ? loc(this.label) : undefined, hideLabel: this.hideLabel, ariaHasPopup: "menu", "test-id": "dropdownButton", block: this.block, description: loc('tecton.element.dropdown.itemCount', [this.determineDropdownItemCount]) }, this.hasCustomControl ? (h("div", { "test-id": "dropdownControl", class: btnProps.custom ? '' : 'hidden' }, h("slot", { name: "control" }))) : (h(Fragment, null, this.label && !this.hideLabel && (h("span", { class: "dropdown-button-text" }, loc(this.label))), this.icon ? h("q2-icon", { type: this.icon }) : ' '))), h("q2-popover", { key: '4db48630a62011863293587a76a17448a503df9d', ref: el => (this.popoverElement = el), controlElement: this.controlElement, open: this.open, "max-height": this.popoverMaxHeight, onFocusout: this.handleFocusOut, minHeight: this.popoverMinHeight, direction: this.popoverDirection, align: this.popoverAlignment, mode: this.popoverMode || undefined, block: this.block }, h("slot", { key: '20cf54aca49692025c64ca230433366e14a242df', name: "popover-top" }), h("q2-option-list", { key: 'f2f8b61de7682fda8b18ddee17995fbbe1529ff7', onPopoverState: this.onPopoverState, id: "option-list", ref: el => (this.optionList = el), type: "menu", label: loc('tecton.element.optionList.label', [this.optionListLabel]), "no-select": true }, h("slot", { key: '380049eda306cad1283f509977cfc32924f86d22' })), h("slot", { key: 'bc02de04e8e0ca08205425ced651183535a80c78', name: "popover-bottom" }))));
|
|
370
370
|
}
|
|
371
371
|
static get is() { return "q2-dropdown"; }
|
|
372
372
|
static get encapsulation() { return "shadow"; }
|
|
@@ -206,7 +206,7 @@ export class Q2EditableField {
|
|
|
206
206
|
// #endregion
|
|
207
207
|
// #region Render Methods
|
|
208
208
|
render() {
|
|
209
|
-
return (h("div", { key: '
|
|
209
|
+
return (h("div", { key: 'bd5759fc666e43c948cf4826e2075ba5566038cc' }, this.generateEditStateDOM(), this.generateReadStateDOM()));
|
|
210
210
|
}
|
|
211
211
|
static get is() { return "q2-editable-field"; }
|
|
212
212
|
static get encapsulation() { return "shadow"; }
|
|
@@ -118,7 +118,7 @@ export class Q2Example {
|
|
|
118
118
|
}, onClick: () => this.tctClick.emit(), role: "menu" }, h("slot", null))));
|
|
119
119
|
}
|
|
120
120
|
render() {
|
|
121
|
-
return h(Host, { key: '
|
|
121
|
+
return h(Host, { key: '6ffb94ccdcae5f6a0762f80b2d022997345f5cc0', attribute: "navigation" }, this.renderMenuInner());
|
|
122
122
|
}
|
|
123
123
|
static get is() { return "q2-example"; }
|
|
124
124
|
static get encapsulation() { return "shadow"; }
|
|
@@ -13,7 +13,7 @@ export class Q2Form {
|
|
|
13
13
|
// #endregion
|
|
14
14
|
// #region Render Methods
|
|
15
15
|
render() {
|
|
16
|
-
return (h("div", { key: '
|
|
16
|
+
return (h("div", { key: '6720d1cf81a23420db41de84fce56398ff932018', class: "container" }, h("slot", { key: '48165fa24f2eb15d66fdfa63b6c122c0dc320714' })));
|
|
17
17
|
}
|
|
18
18
|
static get is() { return "q2-form"; }
|
|
19
19
|
static get encapsulation() { return "shadow"; }
|
|
@@ -71,7 +71,7 @@ export class Q2FormattedText {
|
|
|
71
71
|
// #region Render Methods
|
|
72
72
|
render() {
|
|
73
73
|
const { formattedTextClasses } = this;
|
|
74
|
-
return (h("div", { key: '
|
|
74
|
+
return (h("div", { key: '0e3cb56f89a3ab403b45b411a4cd38ec267ed58b', class: formattedTextClasses, "aria-label": this.formattedValue }, h("span", { key: 'a9bb42690d67bce14debcb99db50c63582c6ba63' }, this.formattedValue)));
|
|
75
75
|
}
|
|
76
76
|
static get is() { return "q2-formatted-text"; }
|
|
77
77
|
static get encapsulation() { return "shadow"; }
|
|
@@ -722,7 +722,7 @@ export class Q2Input {
|
|
|
722
722
|
}
|
|
723
723
|
render() {
|
|
724
724
|
const { ariaControls, ariaExpanded } = this.ariaAttributes;
|
|
725
|
-
return (h(Host, { key: '
|
|
725
|
+
return (h(Host, { key: '5cd0ac01d09732c81c59519cd04a998ff99e4dea', role: this._role, "aria-controls": ariaControls, "aria-expanded": ariaExpanded }, h("div", { key: '3907d95e0564a7e5f53148f6bdd02f0d51dcc8b6', class: this.wrapperClasses }, h("div", { key: '73857901c65827a40b17a56e8a1ac4d1d9c4faf7', class: "label-wrapper" }, renderLabel(this), this.renderCountDOM()), this.renderInputContainerDOM(), renderMessages(this))));
|
|
726
726
|
}
|
|
727
727
|
static get is() { return "q2-input"; }
|
|
728
728
|
static get encapsulation() { return "shadow"; }
|
|
@@ -121,7 +121,7 @@ export class Q2Item {
|
|
|
121
121
|
// #region Render Methods
|
|
122
122
|
render() {
|
|
123
123
|
const { clickable } = this;
|
|
124
|
-
return (h("div", { key: '
|
|
124
|
+
return (h("div", { key: '3bd899fe8e37940635740451ebcf07407103e5e8', "test-id": "itemContainer", class: this.itemClasses, ref: el => (this.itemElement = el), role: clickable ? 'button' : undefined, tabIndex: clickable ? 0 : undefined }, this.hasDecoratorSlotContent && (h("div", { key: '57a84cb0e340658499cfc3283f65d425519fcfcb', class: this.decoratorClasses }, h("slot", { key: 'ef0b095c055d0ceed0fe18ecb4d1b2565f3bdb82', name: "decorator" }, h("slot", { key: 'ec695f3ab95be46331cec70b270a1f0434444fff', name: "bullet" })))), h("div", { key: '263e6a9ebe842c2430cb263fe8ea1e523f286a17', class: this.mainClasses }, this.hasHeaderSlotContent && (h("div", { key: '6340f074d8b489e37f21b57b89038f323e5a2533', class: "header" }, h("slot", { key: '2ec1a529cd639a520a4b873d2898b88470a2c16a', name: "header" }))), this.hasBodySlotContent && (h("div", { key: '1d38f6795a8ee607eb93e1ff31ddab54dcd41c79', class: "body" }, h("slot", { key: '73fe582085a453608301236160cd260474d338c5', name: "body" })))), this.hasActionSlotContent && (h("div", { key: '0fd2164d9ab710b54655e325aa328d4e236a7bd7', class: this.actionClasses }, h("slot", { key: 'ce2cb3c08a76f136858a1e8ce2db30b822e17b82', name: "action" }))), this.hasFooterSlotContent && (h("div", { key: '700c9f3faa4dc6f5c0e22d18470614c028c6c8d5', class: this.footerClasses }, h("slot", { key: 'b3fe3d2477936abcf950c8a7565372456023462f', name: "footer" })))));
|
|
125
125
|
}
|
|
126
126
|
static get is() { return "q2-item"; }
|
|
127
127
|
static get encapsulation() { return "shadow"; }
|
|
@@ -110,7 +110,7 @@ export class Q2Legend {
|
|
|
110
110
|
// #endregion
|
|
111
111
|
// #region Render Methods
|
|
112
112
|
render() {
|
|
113
|
-
return (h("click-elsewhere", { key: '
|
|
113
|
+
return (h("click-elsewhere", { key: 'ab6f88f29a37f3b48c7bee9bc1263142d9376b3c', onChange: () => this.onClickElsewhere(this) }, h("ul", { key: 'aa6443ae74f0d89965963195c479aab4f95fa667' }, this.dataWithClasses.map(item => (h("li", { class: "item" }, h("button", { "test-id": "item", "aria-label": `${item.name} ${this.formatValue(item.value)}`, class: item.classes, onClick: event => this.onClick(event, item), onMouseEnter: event => this.onMouseEnter(event, item), onMouseLeave: event => this.onMouseLeave(event, item) }, h("span", { "test-id": "itemColor", class: "item-color-indicator", style: { backgroundColor: item.color }, "aria-hidden": "true" }), h("span", { "test-id": "itemName", class: "item-name" }, item.name), h("span", { id: `item-${item.id}`, "test-id": "itemValue", class: "item-value" }, this.formatValue(item.value)))))))));
|
|
114
114
|
}
|
|
115
115
|
static get is() { return "q2-legend"; }
|
|
116
116
|
static get encapsulation() { return "shadow"; }
|
|
@@ -69,7 +69,7 @@ export class Q2List {
|
|
|
69
69
|
// #endregion
|
|
70
70
|
// #region Render Methods
|
|
71
71
|
render() {
|
|
72
|
-
return (h("div", { key: '
|
|
72
|
+
return (h("div", { key: '5602927af6da7b334c38f7d2cc207633d6089f7c', class: this.listClasses, ref: el => (this.listElement = el) }, (this.hasFilterSlot || this.hasLabelContent) && (h("div", { key: '23ae73b5b842f17d45f9f82b06db79e8ea5c1796', class: this.headerClasses }, h("div", { key: '428117b7ffeadbfe4a53d39bf95d16cae1c26148', class: "label" }, this.label), this.hasFilterSlot && h("slot", { key: '3c5c29226478ba20fbe691b4265a2966b43f3fcb', name: "filter" }))), h("div", { key: '358b66a87ce56416c1dd42b8cc8a480996e2bdaf', role: "list" }, h("slot", { key: '8eabad8c7f15fac806588c651abf4ee400994d52' }))));
|
|
73
73
|
}
|
|
74
74
|
static get is() { return "q2-list"; }
|
|
75
75
|
static get encapsulation() { return "shadow"; }
|
|
@@ -66,7 +66,7 @@ export class Q2Message {
|
|
|
66
66
|
const addDivForAriaLive = !isFirefox && this.presentToggle;
|
|
67
67
|
const { description } = this;
|
|
68
68
|
const messageLabel = loc(`tecton.element.message.type.${this.type ? this.type : 'info'}`);
|
|
69
|
-
return (h("div", { key: '
|
|
69
|
+
return (h("div", { key: 'b65f9feaee320f96a3f745eb4231510eab67aba6', tabindex: "-1", class: "message", role: description ? undefined : 'alert', "aria-live": description ? undefined : 'assertive', "aria-atomic": description ? undefined : 'true', "aria-relevant": description && addAriaHiddenForAriaLive ? undefined : 'all', "test-id": "messageContainer" }, h("div", { key: '66b9440bf994341ff365766a1241f56556fffe57', class: "bar", "test-id": "bar" }), this.appearance === 'standard' ? this.messageIcon(this.type) : '', addDivForAriaLive && h("div", { key: '47269ca27bc9c952249f574ab98e45d026125228', class: "sr" }), h("div", { key: '63a91696622f38741d5d403fe81262e2d5458328', class: "sr message-label" }, messageLabel), h("div", { key: '544cecc85e943f0156b63489cc78a42bec02f7c9', class: "message-content", "aria-hidden": addAriaHiddenForAriaLive ? 'true' : undefined }, h("slot", { key: '36ff0e64df72018818fd8452e847c522ea4c4039' }))));
|
|
70
70
|
}
|
|
71
71
|
static get is() { return "q2-message"; }
|
|
72
72
|
static get encapsulation() { return "shadow"; }
|
|
@@ -114,7 +114,7 @@ export class Q2Meter {
|
|
|
114
114
|
}
|
|
115
115
|
render() {
|
|
116
116
|
const [completed, suggested] = this.convertToPercentage(this.completedValue, this.suggestedValue, this.maxValue);
|
|
117
|
-
return (h("div", { key: '
|
|
117
|
+
return (h("div", { key: '656e8a53bbaf26529db53e535efcad7a22b9ee01', class: "meter-container", "aria-label": this.ariaLabel, role: "group" }, this.label && (h("div", { key: '25d53f9a1d387d4b839507239454484d9678061f', class: "label", "aria-label": loc(this.label) }, loc(this.label))), this.description && (h("div", { key: 'd5786b4e65ab5b262b82f107bb310ca27b34c4ed', class: "description", "aria-label": loc(this.description) }, loc(this.description))), this.renderBar(completed, suggested), h("div", { key: '015cc474c3113ff248982d64656218a79744e09e', class: "legends" }, h("div", { key: '1af88cd2386058a8c20f3a82d0e40ffafffc4c38', class: "left" }, this.completedValue || this.completedLabel ? (h("div", { class: "completed" }, h("div", { class: "dot" }), h("div", { class: "legend-label" }, this.completedValue, " ", loc(this.completedLabel)))) : (''), this.suggestedValue || this.suggestedLabel ? (h("div", { class: "suggested" }, h("div", { class: "dot" }), h("div", { class: "legend-label" }, this.suggestedValue, " ", loc(this.suggestedLabel)))) : ('')), h("div", { key: '22eb4ec7a86114f3f109e4adfb0acbcea9509de8', class: "right" }, h("div", { key: 'b9384865d0ef8c81569243b40ccf320efcd208ec', class: "max" }, this.maxValue, " ", loc(this.maxLabel))))));
|
|
118
118
|
}
|
|
119
119
|
static get is() { return "q2-meter"; }
|
|
120
120
|
static get encapsulation() { return "shadow"; }
|