q2-tecton-elements 1.21.2 → 1.22.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/installCanvasRenderer-b4d10c92.js +38433 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/q2-badge_2.cjs.entry.js +5 -3
- package/dist/cjs/q2-calendar.cjs.entry.js +75 -55
- package/dist/cjs/q2-carousel.cjs.entry.js +3 -3
- package/dist/cjs/q2-chart-bar.cjs.entry.js +4679 -0
- package/dist/cjs/q2-chart-donut.cjs.entry.js +357 -35592
- package/dist/cjs/q2-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
- package/dist/cjs/q2-radio.cjs.entry.js +1 -1
- package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/q2-calendar/index.js +43 -2
- package/dist/collection/components/q2-chart-bar/index.js +466 -0
- package/dist/collection/components/q2-chart-bar/styles.css +85 -0
- package/dist/collection/components/q2-chart-donut/index.js +3 -3
- package/dist/collection/components/q2-checkbox/styles.css +5 -1
- package/dist/collection/components/q2-editable-field/styles.css +1 -1
- package/dist/collection/components/q2-input/formatting/phone.js +2 -2
- package/dist/collection/components/q2-input/index.js +21 -0
- package/dist/collection/components/q2-input/styles.css +2 -2
- package/dist/collection/components/q2-radio/styles.css +1 -1
- package/dist/collection/utils/charting.js +182 -0
- package/dist/components/click-elsewhere.d.ts +11 -0
- package/dist/components/click-elsewhere.js +6 -0
- package/dist/components/index.d.ts +62 -0
- package/dist/components/index.js +42 -0
- package/dist/components/index10.js +84 -0
- package/dist/components/index11.js +383 -0
- package/dist/components/index12.js +125 -0
- package/dist/components/index13.js +602 -0
- package/dist/components/index2.js +100 -0
- package/dist/components/index3.js +90 -0
- package/dist/components/index4.js +62 -0
- package/dist/components/index5.js +146 -0
- package/dist/components/index6.js +145 -0
- package/dist/components/index7.js +2960 -0
- package/dist/components/index8.js +3356 -0
- package/dist/components/index9.js +101 -0
- package/dist/components/installCanvasRenderer.js +38282 -0
- package/dist/components/q2-avatar.d.ts +11 -0
- package/dist/components/q2-avatar.js +6 -0
- package/dist/components/q2-badge.d.ts +11 -0
- package/dist/components/q2-badge.js +6 -0
- package/dist/components/q2-btn.d.ts +11 -0
- package/dist/components/q2-btn.js +6 -0
- package/dist/components/q2-calendar.d.ts +11 -0
- package/dist/components/q2-calendar.js +3755 -0
- package/dist/components/q2-card.d.ts +11 -0
- package/dist/components/q2-card.js +187 -0
- package/dist/components/q2-carousel-pane.d.ts +11 -0
- package/dist/components/q2-carousel-pane.js +97 -0
- package/dist/components/q2-carousel.d.ts +11 -0
- package/dist/components/q2-carousel.js +5379 -0
- package/dist/components/q2-chart-bar.d.ts +11 -0
- package/dist/components/q2-chart-bar.js +4710 -0
- package/dist/components/q2-chart-donut.d.ts +11 -0
- package/dist/components/q2-chart-donut.js +4887 -0
- package/dist/components/q2-checkbox-group.d.ts +11 -0
- package/dist/components/q2-checkbox-group.js +114 -0
- package/dist/components/q2-checkbox.d.ts +11 -0
- package/dist/components/q2-checkbox.js +138 -0
- package/dist/components/q2-dropdown-item.d.ts +11 -0
- package/dist/components/q2-dropdown-item.js +6 -0
- package/dist/components/q2-dropdown.d.ts +11 -0
- package/dist/components/q2-dropdown.js +345 -0
- package/dist/components/q2-editable-field.d.ts +11 -0
- package/dist/components/q2-editable-field.js +220 -0
- package/dist/components/q2-icon.d.ts +11 -0
- package/dist/components/q2-icon.js +6 -0
- package/dist/components/q2-input.d.ts +11 -0
- package/dist/components/q2-input.js +6 -0
- package/dist/components/q2-loading-element.d.ts +11 -0
- package/dist/components/q2-loading-element.js +52 -0
- package/dist/components/q2-loading.d.ts +11 -0
- package/dist/components/q2-loading.js +6 -0
- package/dist/components/q2-loc.d.ts +11 -0
- package/dist/components/q2-loc.js +40 -0
- package/dist/components/q2-message.d.ts +11 -0
- package/dist/components/q2-message.js +6 -0
- package/dist/components/q2-month-picker.d.ts +11 -0
- package/dist/components/q2-month-picker.js +189 -0
- package/dist/components/q2-optgroup.d.ts +11 -0
- package/dist/components/q2-optgroup.js +75 -0
- package/dist/components/q2-option-list.d.ts +11 -0
- package/dist/components/q2-option-list.js +6 -0
- package/dist/components/q2-option.d.ts +11 -0
- package/dist/components/q2-option.js +81 -0
- package/dist/components/q2-pagination.d.ts +11 -0
- package/dist/components/q2-pagination.js +184 -0
- package/dist/components/q2-pill.d.ts +11 -0
- package/dist/components/q2-pill.js +216 -0
- package/dist/components/q2-popover.d.ts +11 -0
- package/dist/components/q2-popover.js +6 -0
- package/dist/components/q2-radio-group.d.ts +11 -0
- package/dist/components/q2-radio-group.js +191 -0
- package/dist/components/q2-radio.d.ts +11 -0
- package/dist/components/q2-radio.js +105 -0
- package/dist/components/q2-section.d.ts +11 -0
- package/dist/components/q2-section.js +218 -0
- package/dist/components/q2-select.d.ts +11 -0
- package/dist/components/q2-select.js +817 -0
- package/dist/components/q2-stepper-pane.d.ts +11 -0
- package/dist/components/q2-stepper-pane.js +92 -0
- package/dist/components/q2-stepper-vertical.d.ts +11 -0
- package/dist/components/q2-stepper-vertical.js +311 -0
- package/dist/components/q2-stepper.d.ts +11 -0
- package/dist/components/q2-stepper.js +252 -0
- package/dist/components/q2-tab-container.d.ts +11 -0
- package/dist/components/q2-tab-container.js +288 -0
- package/dist/components/q2-tab-pane.d.ts +11 -0
- package/dist/components/q2-tab-pane.js +58 -0
- package/dist/components/q2-tag.d.ts +11 -0
- package/dist/components/q2-tag.js +156 -0
- package/dist/components/q2-textarea.d.ts +11 -0
- package/dist/components/q2-textarea.js +265 -0
- package/dist/components/q2-tooltip.d.ts +11 -0
- package/dist/components/q2-tooltip.js +112 -0
- package/dist/components/shapes.js +91 -0
- package/dist/components/tecton-tab-pane.d.ts +11 -0
- package/dist/components/tecton-tab-pane.js +111 -0
- package/dist/esm/installCanvasRenderer-0143b52d.js +38282 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/q2-badge_2.entry.js +5 -3
- package/dist/esm/q2-calendar.entry.js +75 -55
- package/dist/esm/q2-carousel.entry.js +3 -3
- package/dist/esm/q2-chart-bar.entry.js +4675 -0
- package/dist/esm/q2-chart-donut.entry.js +171 -35406
- package/dist/esm/q2-checkbox.entry.js +1 -1
- package/dist/esm/q2-editable-field.entry.js +1 -1
- package/dist/esm/q2-radio.entry.js +1 -1
- package/dist/esm/q2-tecton-elements.js +1 -1
- package/dist/q2-tecton-elements/p-1f85cced.js +39 -0
- package/dist/q2-tecton-elements/{p-89608314.entry.js → p-4625184b.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-9772b15f.entry.js → p-520c40f6.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-6b52a262.entry.js +1 -0
- package/dist/q2-tecton-elements/p-c4640b55.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-7e8f43d1.entry.js → p-cf41970f.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-e4dc9ac0.entry.js +1 -0
- package/dist/q2-tecton-elements/p-f35bf6a3.entry.js +1 -0
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/types/components/q2-calendar/index.d.ts +3 -0
- package/dist/types/components/q2-chart-bar/index.d.ts +40 -0
- package/dist/types/components/q2-chart-donut/index.d.ts +7 -10
- package/dist/types/components/q2-input/index.d.ts +1 -0
- package/dist/types/components.d.ts +50 -3
- package/dist/types/utils/charting.d.ts +14 -0
- package/package.json +6 -3
- package/dist/q2-tecton-elements/p-0766a694.entry.js +0 -1
- package/dist/q2-tecton-elements/p-5f064e1e.entry.js +0 -39
- package/dist/q2-tecton-elements/p-8d25ec52.entry.js +0 -1
- /package/dist/types/workspace/workspace/{tecton-production_release_1.21.x → tecton-production_release_1.22.x}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface Q2StepperPane extends Components.Q2StepperPane, HTMLElement {}
|
|
4
|
+
export const Q2StepperPane: {
|
|
5
|
+
prototype: Q2StepperPane;
|
|
6
|
+
new (): Q2StepperPane;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Fragment } from '@stencil/core/internal/client';
|
|
2
|
+
import { c as createGuid, n as nextPaint, l as loc } from './index13.js';
|
|
3
|
+
|
|
4
|
+
const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:block;position:relative}";
|
|
5
|
+
|
|
6
|
+
const Q2StepperPane$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.__attachShadow();
|
|
11
|
+
this.statusChange = createEvent(this, "statusChange", 7);
|
|
12
|
+
this.activeChange = createEvent(this, "activeChange", 7);
|
|
13
|
+
this.label = undefined;
|
|
14
|
+
this.description = undefined;
|
|
15
|
+
this.isActive = undefined;
|
|
16
|
+
this.showWithChildren = undefined;
|
|
17
|
+
this.status = undefined;
|
|
18
|
+
this.isChildActive = false;
|
|
19
|
+
}
|
|
20
|
+
/// LifeCycle Hooks ///
|
|
21
|
+
connectedCallback() {
|
|
22
|
+
if (!this.hostElement.id)
|
|
23
|
+
this.hostElement.id = `step-${createGuid()}`;
|
|
24
|
+
}
|
|
25
|
+
componentWillLoad() {
|
|
26
|
+
this.checkForActiveChildren();
|
|
27
|
+
}
|
|
28
|
+
/// Watchers and Listeners ///
|
|
29
|
+
statusChanged(status) {
|
|
30
|
+
this.statusChange.emit({
|
|
31
|
+
status,
|
|
32
|
+
isActive: !!this.isActive,
|
|
33
|
+
id: this.hostElement.id,
|
|
34
|
+
host: this.hostElement,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
isActiveChanged(isActive) {
|
|
38
|
+
this.activeChange.emit({
|
|
39
|
+
status: this.status || '',
|
|
40
|
+
isActive,
|
|
41
|
+
id: this.hostElement.id,
|
|
42
|
+
host: this.hostElement,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
checkForActiveChildren() {
|
|
46
|
+
if (!this.showWithChildren)
|
|
47
|
+
return;
|
|
48
|
+
nextPaint(() => {
|
|
49
|
+
setTimeout(() => {
|
|
50
|
+
this.isChildActive = !!this.hostElement.querySelector("[slot='children'] > q2-stepper-pane[is-active]");
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/// DOM ///
|
|
55
|
+
render() {
|
|
56
|
+
const { label, description, isActive } = this;
|
|
57
|
+
return (h(Fragment, null, h("div", { role: "tabpanel", "aria-label": label && loc(label), "aria-description": description && loc(description), tabindex: "0", hidden: !isActive && !(this.isChildActive && this.showWithChildren) }, h("slot", null)), h("slot", { name: "children" })));
|
|
58
|
+
}
|
|
59
|
+
get hostElement() { return this; }
|
|
60
|
+
static get watchers() { return {
|
|
61
|
+
"status": ["statusChanged"],
|
|
62
|
+
"isActive": ["isActiveChanged"],
|
|
63
|
+
"showWithChildren": ["checkForActiveChildren"]
|
|
64
|
+
}; }
|
|
65
|
+
static get style() { return stylesCss; }
|
|
66
|
+
}, [1, "q2-stepper-pane", {
|
|
67
|
+
"label": [513],
|
|
68
|
+
"description": [513],
|
|
69
|
+
"isActive": [516, "is-active"],
|
|
70
|
+
"showWithChildren": [516, "show-with-children"],
|
|
71
|
+
"status": [513],
|
|
72
|
+
"isChildActive": [32]
|
|
73
|
+
}, [[0, "activeChange", "checkForActiveChildren"]]]);
|
|
74
|
+
function defineCustomElement$1() {
|
|
75
|
+
if (typeof customElements === "undefined") {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const components = ["q2-stepper-pane"];
|
|
79
|
+
components.forEach(tagName => { switch (tagName) {
|
|
80
|
+
case "q2-stepper-pane":
|
|
81
|
+
if (!customElements.get(tagName)) {
|
|
82
|
+
customElements.define(tagName, Q2StepperPane$1);
|
|
83
|
+
}
|
|
84
|
+
break;
|
|
85
|
+
} });
|
|
86
|
+
}
|
|
87
|
+
defineCustomElement$1();
|
|
88
|
+
|
|
89
|
+
const Q2StepperPane = Q2StepperPane$1;
|
|
90
|
+
const defineCustomElement = defineCustomElement$1;
|
|
91
|
+
|
|
92
|
+
export { Q2StepperPane, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface Q2StepperVertical extends Components.Q2StepperVertical, HTMLElement {}
|
|
4
|
+
export const Q2StepperVertical: {
|
|
5
|
+
prototype: Q2StepperVertical;
|
|
6
|
+
new (): Q2StepperVertical;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Fragment } from '@stencil/core/internal/client';
|
|
2
|
+
import { o as overrideFocus, c as createGuid, i as isEventFromElement, l as loc } from './index13.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './index7.js';
|
|
4
|
+
|
|
5
|
+
const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:grid;grid-template-columns:var(--tct-advanced-stepper-list-width, var(--t-advanced-stepper-list-width, 180px)) 1fr;gap:var(--tct-advanced-stepper-layout-gap, var(--t-advanced-stepper-layout-gap, 120px))}.step-label,.step-child-label{color:var(--comp-btn-label-color);font-size:var(--comp-btn-label-font-size);font-weight:var(--comp-label-font-weight, 400);height:1.5em}.step-label{text-overflow:ellipsis;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}[aria-selected=true] .step-label{font-weight:var(--tct-advanced-stepper-btn-active-font-weight, var(--t-advanced-stepper-btn-active-font-weight, 600))}[aria-describedby] .step-label{-webkit-line-clamp:1}.step-child-label{grid-area:content;color:var(--comp-btn-label-color)}.step-description{color:var(--tct-advanced-stepper-description-color, var(--t-advanced-stepper-description-color, var(--t-textA, rgba(77, 77, 77, 0.77))));font-size:var(--tct-advanced-stepper-description-font-size, var(--t-advanced-stepper-description-font-size, var(--app-font-size-small, 12px)));padding-bottom:0.2em}ul{--comp-top-btn-icon-size:var(--tct-advanced-stepper-btn-icon-size, var(--t-advanced-stepper-btn-icon-size, 24px));--comp-btn-icon-size:var(--comp-top-btn-icon-size);--comp-btn-content-gap:var(--tct-advanced-stepper-btn-gap, var(--t-advanced-stepper-btn-gap, var(--app-scale-3x, 15px)));--comp-btn-label-font-size:var-list(var-prefixer(advanced-stepper-btn-label-font-size), 16px);--comp-btn-label-color:var(--tct-advanced-stepper-label-color, var(--t-advanced-stepper-label-color, var(--t-text, #4d4d4d)));--comp-tween:var(--tct-advanced-stepper-tween, var(--t-advanced-stepper-tween, var(--app-tween-1, 0.2s ease)));list-style:none;margin:0;padding:0}ul ul{--comp-btn-icon-size:var(--tct-advanced-stepper-child-btn-icon-size, var(--t-advanced-stepper-child-btn-icon-size, 12px));--comp-btn-content-gap:var(--tct-advanced-stepper-btn-gap, var(--t-advanced-stepper-btn-gap, var(--app-scale-2x, 10px)));--comp-btn-label-font-size:var-list(\n var-prefixer(advanced-stepper-child-btn-label-font-size),\n --app-font-size-small,\n 12px\n )}ul ul[aria-hidden=true]{display:none}.step-btn,.step-child-btn{display:grid;grid-template-columns:var(--comp-btn-icon-size) 1fr;gap:var(--comp-btn-content-gap);text-align:var(--tct-advanced-stepper-btn-text-align, var(--t-advanced-stepper-btn-text-align, start));grid-template-areas:\"icon content\";align-items:center;width:100%;position:relative;background:transparent;border:0;cursor:pointer;padding:0;transition-property:box-shadow;outline:none}.step-btn[aria-disabled],.step-child-btn[aria-disabled]{cursor:default;--comp-label-font-weight:300;--comp-btn-label-color:var(--tct-advanced-stepper-btn-locked-color, var(--t-advanced-stepper-btn-locked-color, var(--t-textA, rgba(77, 77, 77, 0.77))))}.step-btn[aria-selected=true],.step-child-btn[aria-selected=true]{--comp-label-font-weight:600}.step-btn{min-height:var(--tct-advanced-stepper-btn-height, var(--t-advanced-stepper-btn-height, 40px));font-size:var(--tct-advanced-stepper-btn-font-size, var(--t-advanced-stepper-btn-font-size, 16px));--comp-active-color:var(--t-primary, #0079c1)}.step-btn.status-complete{--comp-active-color:var(--const-stoplight-success, #0e8a00)}.step-btn.status-error{--comp-active-color:var(--const-stoplight-alert, #c30000)}.step-btn.status-locked{cursor:not-allowed}.step-child-btn{--comp-active-color:var(--t-primary, #0079c1);min-height:var(--tct-advanced-stepper-child-btn-height, var(--t-advanced-stepper-child-btn-height, 30px));padding-left:var(--tct-advanced-stepper-child-btn-left-padding, var(--t-advanced-stepper-child-btn-left-padding, var(--app-scale-2x, 10px)));font-size:var(--tct-advanced-stepper-child-btn-font-size, var(--t-advanced-stepper-child-btn-font-size, 12px));border-left-width:var(--tct-advanced-stepper-child-btn-left-border-width, var(--t-advanced-stepper-child-btn-left-border-width, 3px));border-left-style:var(--tct-advanced-stepper-child-btn-left-border-style, var(--t-advanced-stepper-child-btn-left-border-style, solid));border-left-color:transparent}.step-child-btn[aria-selected=true]{--comp-btn-label-color:var(--comp-active-color);border-left-color:var(--comp-active-color)}.step-child-btn.status-error{--comp-btn-label-color:var(--const-stoplight-alert, #c30000);--comp-active-color:var(--const-stoplight-alert, #c30000)}.step-child-btn.status-locked{cursor:not-allowed}.step-content{grid-area:content}.step-icon,.step-bubble,.step-child-icon{grid-area:icon;width:var(--comp-btn-icon-size);height:var(--comp-btn-icon-size);line-height:0}.step-icon q2-icon,.step-bubble q2-icon,.step-child-icon q2-icon{width:var(--comp-btn-icon-size);height:var(--comp-btn-icon-size);--tct-icon-fill:var(--comp-active-color)}.step-icon,.step-bubble{background:var(--t-primary, #0079c1);color:var(--t-base, #ffffff);border-radius:50%}.status-complete .step-icon,.status-error .step-icon,.status-complete .step-bubble,.status-error .step-bubble{background:var(--comp-active-color)}.step-icon q2-icon,.step-bubble q2-icon{--tct-icon-fill:var(--comp-active-color)}.step-icon q2-icon:before,.step-bubble q2-icon:before{content:\"\";display:block;background:var(--t-base, #ffffff);position:absolute;width:80%;height:80%;left:11%;top:11%;border-radius:50%}.status-locked .step-icon,.status-locked .step-bubble{background:var(--t-gray-12, #d9d9d9);color:var(--t-text, #4d4d4d)}[aria-selected=true] .step-icon,[aria-selected=true] .step-bubble{box-shadow:0 0 0 2px var(--t-base, #ffffff), 0 0 0 4px var(--comp-active-color)}.step-bubble{display:flex;justify-content:center;align-items:center;line-height:0}.step-child-icon q2-icon{--tct-icon-stroke-primary:var(--comp-active-color);--tct-icon-stroke-secondary:var(--comp-active-color)}[aria-selected=true] .step-child-icon q2-icon{fill:var(--comp-active-color);--tct-icon-stroke-secondary:var(--t-base, #ffffff)}.spacer{height:0;border-left-width:var(--tct-advanced-stepper-child-border-width, var(--t-advanced-stepper-child-border-width, 1px));border-left-style:var(--tct-advanced-stepper-child-border-style, var(--t-advanced-stepper-child-border-style, solid));border-left-color:var(--tct-advanced-stepper-child-border-color, var(--t-advanced-stepper-child-border-color, var(--t-gray-12, #d9d9d9)));overflow:hidden;margin-left:calc(var(--comp-top-btn-icon-size) / 2);transition:height var(--comp-tween)}.spacer.has-sibling{height:var(--tct-advanced-stepper-spacer-height, var(--t-advanced-stepper-spacer-height, var(--app-scale-6x, 30px)))}.spacer ul{opacity:0;transition:opacity var(--comp-tween)}.spacer.is-opening ul,.spacer.is-open ul{display:block;opacity:1 !important}.spacer.is-open{overflow:visible}";
|
|
6
|
+
|
|
7
|
+
const Q2AdvancedStepper = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
this.__attachShadow();
|
|
12
|
+
this.change = createEvent(this, "change", 7);
|
|
13
|
+
this.scheduledAfterRender = [];
|
|
14
|
+
this.determinePaneChanges = (mutations) => {
|
|
15
|
+
mutations.forEach(mutation => {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
if (mutation.type !== 'childList')
|
|
18
|
+
return;
|
|
19
|
+
if (!mutation.addedNodes.length && !mutation.removedNodes.length)
|
|
20
|
+
return;
|
|
21
|
+
if (((_a = mutation.addedNodes[0]) === null || _a === void 0 ? void 0 : _a.nodeType) !== Node.ELEMENT_NODE &&
|
|
22
|
+
((_b = mutation.removedNodes[0]) === null || _b === void 0 ? void 0 : _b.nodeType) !== Node.ELEMENT_NODE)
|
|
23
|
+
return;
|
|
24
|
+
this.buildPaneList();
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
this.buildPaneList = () => {
|
|
28
|
+
const { allRootPanes } = this;
|
|
29
|
+
if (!allRootPanes.length)
|
|
30
|
+
return;
|
|
31
|
+
this.structuredPanes = Array.from(allRootPanes).reduce((accum, pane) => {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
const children = Array.from((_b = (_a = pane.querySelector('[slot=children]')) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : [])
|
|
34
|
+
.filter(({ tagName }) => tagName === 'Q2-STEPPER-PANE')
|
|
35
|
+
.map(this.extractDetails);
|
|
36
|
+
accum.push(Object.assign(Object.assign({}, this.extractDetails(pane)), { children }));
|
|
37
|
+
return accum;
|
|
38
|
+
}, []);
|
|
39
|
+
};
|
|
40
|
+
/// Event Handlers ///
|
|
41
|
+
this.onStepClick = (event, stepId) => {
|
|
42
|
+
event.stopPropagation();
|
|
43
|
+
const { currentStepId } = this;
|
|
44
|
+
if (stepId === currentStepId)
|
|
45
|
+
return;
|
|
46
|
+
const selectedStep = this.allPanes.find(pane => pane.id === stepId);
|
|
47
|
+
this.change.emit({
|
|
48
|
+
selectedStep,
|
|
49
|
+
selectedStepId: stepId,
|
|
50
|
+
currentStepId,
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
this.onStepKeyDown = (event, stepId) => {
|
|
54
|
+
const { key } = event;
|
|
55
|
+
let selectedStepId;
|
|
56
|
+
switch (key) {
|
|
57
|
+
case 'ArrowUp':
|
|
58
|
+
case 'ArrowLeft':
|
|
59
|
+
event.preventDefault();
|
|
60
|
+
selectedStepId = this.getStepId(stepId, 'prev');
|
|
61
|
+
break;
|
|
62
|
+
case 'ArrowDown':
|
|
63
|
+
case 'ArrowRight':
|
|
64
|
+
event.preventDefault();
|
|
65
|
+
selectedStepId = this.getStepId(stepId, 'next');
|
|
66
|
+
break;
|
|
67
|
+
case 'Home':
|
|
68
|
+
event.preventDefault();
|
|
69
|
+
selectedStepId = this.getStepId(stepId, 'first');
|
|
70
|
+
break;
|
|
71
|
+
case 'End':
|
|
72
|
+
event.preventDefault();
|
|
73
|
+
selectedStepId = this.getStepId(stepId, 'last');
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
if (!selectedStepId)
|
|
77
|
+
return;
|
|
78
|
+
this.focusStepBtn(selectedStepId, true);
|
|
79
|
+
};
|
|
80
|
+
this.currentStepId = undefined;
|
|
81
|
+
this.structuredPanes = [];
|
|
82
|
+
}
|
|
83
|
+
/// LifeCycle Hooks ///
|
|
84
|
+
componentWillLoad() {
|
|
85
|
+
this.setDefaultPane();
|
|
86
|
+
this.buildPaneList();
|
|
87
|
+
const observer = new MutationObserver(this.determinePaneChanges);
|
|
88
|
+
const observerOptions = {
|
|
89
|
+
childList: true,
|
|
90
|
+
};
|
|
91
|
+
observer.observe(this.hostElement, observerOptions);
|
|
92
|
+
this.allRootPanes.forEach(pane => {
|
|
93
|
+
const childrenSlot = pane.querySelector('[slot=children]');
|
|
94
|
+
if (childrenSlot)
|
|
95
|
+
observer.observe(childrenSlot, observerOptions);
|
|
96
|
+
});
|
|
97
|
+
this.mutationObserver = observer;
|
|
98
|
+
}
|
|
99
|
+
componentDidLoad() {
|
|
100
|
+
overrideFocus(this.hostElement);
|
|
101
|
+
setTimeout(() => this.showStep(this.currentStepId), 0);
|
|
102
|
+
}
|
|
103
|
+
componentWillUpdate() {
|
|
104
|
+
this.expandedStepChildrenList = null;
|
|
105
|
+
}
|
|
106
|
+
componentDidRender() {
|
|
107
|
+
this.scheduledAfterRender.forEach(fn => fn());
|
|
108
|
+
this.scheduledAfterRender = [];
|
|
109
|
+
this.openCurrentStepChildren();
|
|
110
|
+
}
|
|
111
|
+
disconnectedCallback() {
|
|
112
|
+
this.mutationObserver.disconnect();
|
|
113
|
+
this.mutationObserver = null;
|
|
114
|
+
}
|
|
115
|
+
/// Getters ///
|
|
116
|
+
get allRootPanes() {
|
|
117
|
+
return Array.from(this.hostElement.querySelectorAll(':scope > q2-stepper-pane'));
|
|
118
|
+
}
|
|
119
|
+
get allPanes() {
|
|
120
|
+
return Array.from(this.hostElement.querySelectorAll('q2-stepper-pane'));
|
|
121
|
+
}
|
|
122
|
+
/// Helpers ///
|
|
123
|
+
setDefaultPane() {
|
|
124
|
+
if (this.currentStepId)
|
|
125
|
+
return;
|
|
126
|
+
const firstEnabledStep = this.hostElement.querySelector('q2-stepper-pane');
|
|
127
|
+
if (!firstEnabledStep)
|
|
128
|
+
return;
|
|
129
|
+
if (!firstEnabledStep.id)
|
|
130
|
+
firstEnabledStep.id = `step-${createGuid()}`;
|
|
131
|
+
this.currentStepId = firstEnabledStep.id;
|
|
132
|
+
}
|
|
133
|
+
getStepId(currentStepId, goTo) {
|
|
134
|
+
const allEnabledStepBtns = Array.from(this.hostElement.shadowRoot.querySelectorAll('ul:not([aria-hidden="true"]) > li > button:not([aria-disabled="true"])'));
|
|
135
|
+
const currentStepIndex = allEnabledStepBtns.findIndex(btn => btn.getAttribute('aria-controls') === currentStepId);
|
|
136
|
+
let nextStepIndex;
|
|
137
|
+
switch (goTo) {
|
|
138
|
+
case 'prev':
|
|
139
|
+
nextStepIndex = Math.max(currentStepIndex - 1, 0);
|
|
140
|
+
break;
|
|
141
|
+
case 'next':
|
|
142
|
+
nextStepIndex = Math.min(currentStepIndex + 1, allEnabledStepBtns.length - 1);
|
|
143
|
+
break;
|
|
144
|
+
case 'first':
|
|
145
|
+
nextStepIndex = 0;
|
|
146
|
+
break;
|
|
147
|
+
case 'last':
|
|
148
|
+
nextStepIndex = allEnabledStepBtns.length - 1;
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
return allEnabledStepBtns[nextStepIndex].getAttribute('aria-controls');
|
|
152
|
+
}
|
|
153
|
+
showStep(stepId) {
|
|
154
|
+
this.scheduledAfterRender.push(this.resizeIframe);
|
|
155
|
+
this.showStepPane(stepId);
|
|
156
|
+
this.focusStepBtn(stepId);
|
|
157
|
+
}
|
|
158
|
+
extractDetails(pane) {
|
|
159
|
+
const { label, description, status } = pane;
|
|
160
|
+
if (!pane.id)
|
|
161
|
+
pane.id = `step-${createGuid()}`;
|
|
162
|
+
return {
|
|
163
|
+
id: pane.id,
|
|
164
|
+
label,
|
|
165
|
+
description,
|
|
166
|
+
status,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
resizeIframe() {
|
|
170
|
+
var _a, _b;
|
|
171
|
+
return (_b = (_a = window === null || window === void 0 ? void 0 : window.TectonElements) === null || _a === void 0 ? void 0 : _a.resizeIframe) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
172
|
+
}
|
|
173
|
+
openCurrentStepChildren() {
|
|
174
|
+
const { expandedStepChildrenList } = this;
|
|
175
|
+
const allSpacers = this.hostElement.shadowRoot.querySelectorAll('.spacer');
|
|
176
|
+
allSpacers.forEach(spacer => {
|
|
177
|
+
if (expandedStepChildrenList && spacer.contains(expandedStepChildrenList)) {
|
|
178
|
+
spacer.style.height = `${expandedStepChildrenList.clientHeight}px`;
|
|
179
|
+
if (spacer.classList.contains('is-open'))
|
|
180
|
+
return;
|
|
181
|
+
spacer.classList.add('is-opening');
|
|
182
|
+
spacer.addEventListener('transitionend', () => {
|
|
183
|
+
spacer.classList.remove('is-opening');
|
|
184
|
+
spacer.classList.add('is-open');
|
|
185
|
+
this.resizeIframe();
|
|
186
|
+
}, { once: true });
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
spacer.removeAttribute('style');
|
|
190
|
+
spacer.classList.remove('is-open', 'is-opening');
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
showStepPane(stepId) {
|
|
195
|
+
this.allPanes.forEach(pane => {
|
|
196
|
+
if (pane.isActive || pane.id === stepId) {
|
|
197
|
+
pane.isActive = stepId === pane.id;
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
focusStepBtn(stepId, forceFocus) {
|
|
202
|
+
const stepBtn = this.hostElement.shadowRoot.querySelector(`button[aria-controls="${stepId}"]`);
|
|
203
|
+
const isComponentActive = document.activeElement === this.hostElement;
|
|
204
|
+
if (!stepBtn)
|
|
205
|
+
return;
|
|
206
|
+
if (isComponentActive || forceFocus) {
|
|
207
|
+
stepBtn.focus();
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
/// Listeners ///
|
|
211
|
+
defaultChangeHandler(event) {
|
|
212
|
+
const { hostElement } = this;
|
|
213
|
+
if (event.target === hostElement && !hostElement.getAttribute('onchange') && !!event.detail) {
|
|
214
|
+
this.currentStepId = event.detail.selectedStepId;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
delegateFocus(event) {
|
|
218
|
+
if (!isEventFromElement(event, this.hostElement))
|
|
219
|
+
return;
|
|
220
|
+
this.focusStepBtn(this.currentStepId, true);
|
|
221
|
+
}
|
|
222
|
+
statusChangeHandler() {
|
|
223
|
+
this.buildPaneList();
|
|
224
|
+
}
|
|
225
|
+
/// Watchers ///
|
|
226
|
+
currentStepChanged(stepId) {
|
|
227
|
+
this.showStep(stepId);
|
|
228
|
+
}
|
|
229
|
+
/// DOM ///
|
|
230
|
+
renderStepBtn(pane, index) {
|
|
231
|
+
const { currentStepId, structuredPanes } = this;
|
|
232
|
+
const isLastStep = index === structuredPanes.length - 1;
|
|
233
|
+
const { id, label, description, status } = pane;
|
|
234
|
+
const stepNumber = index + 1;
|
|
235
|
+
const isCurrentStep = id === currentStepId;
|
|
236
|
+
const labelId = label && `label-${id}`;
|
|
237
|
+
const isLocked = status === 'locked';
|
|
238
|
+
const stepLabel = label && loc(label);
|
|
239
|
+
const descriptionId = label && description && `description-${id}`;
|
|
240
|
+
const btnLabel = !label && loc('tecton.element.advancedStepper.number', [`${stepNumber}`, `${structuredPanes.length}`]);
|
|
241
|
+
let statusIcon;
|
|
242
|
+
if (status === 'complete')
|
|
243
|
+
statusIcon = 'success-filled';
|
|
244
|
+
else if (status === 'error')
|
|
245
|
+
statusIcon = 'warning-filled';
|
|
246
|
+
const stepClasses = ['step-btn'];
|
|
247
|
+
if (status)
|
|
248
|
+
stepClasses.push(`status-${status}`);
|
|
249
|
+
const childIds = pane.children.map(child => child.id);
|
|
250
|
+
const isExpanded = isCurrentStep || childIds.includes(currentStepId);
|
|
251
|
+
return (h("li", { role: "presentation" }, h("button", { class: stepClasses.join(' '), type: "button", "aria-labelledby": labelId, "aria-describedBy": descriptionId, "aria-label": btnLabel, "aria-selected": `${isCurrentStep}`, "aria-expanded": !!pane.children.length ? `${isExpanded}` : null, "aria-controls": id, "aria-disabled": isLocked ? 'true' : null, role: "tab", tabIndex: isCurrentStep ? 0 : -1, onKeyDown: ev => !isLocked && this.onStepKeyDown(ev, id), onClick: ev => !isLocked && this.onStepClick(ev, id) }, statusIcon ? (h("div", { class: "step-icon" }, h("q2-icon", { type: statusIcon }))) : (h("div", { class: "step-bubble" }, stepNumber)), label && (h("div", null, h("div", { class: "step-label", id: labelId }, stepLabel), description && (h("div", { class: "step-description", id: descriptionId }, loc(description)))))), this.renderSpacer(pane, stepLabel, isExpanded, isLastStep)));
|
|
252
|
+
}
|
|
253
|
+
renderSpacer(pane, stepLabel, isExpanded, isLastStep) {
|
|
254
|
+
const shouldRender = (isLastStep && !!pane.children.length) || !isLastStep;
|
|
255
|
+
const spacerClasses = ['spacer'];
|
|
256
|
+
if (!isLastStep)
|
|
257
|
+
spacerClasses.push('has-sibling');
|
|
258
|
+
return (shouldRender && (h("div", { class: spacerClasses.join(' ') }, !!pane.children.length && (h("ul", { ref: el => isExpanded && (this.expandedStepChildrenList = el), "aria-hidden": `${!isExpanded}` }, pane.children.map((child, index, children) => this.renderChildStepBtn(child, index, children.length, stepLabel)))))));
|
|
259
|
+
}
|
|
260
|
+
renderChildStepBtn(pane, index, children, parentLabel) {
|
|
261
|
+
const { currentStepId } = this;
|
|
262
|
+
const { id, label, status } = pane;
|
|
263
|
+
const stepNumber = index + 1;
|
|
264
|
+
const labelId = label && `label-${id}`;
|
|
265
|
+
const isCurrentStep = id === currentStepId;
|
|
266
|
+
const isLocked = status === 'locked';
|
|
267
|
+
const btnLabel = !label && loc('tecton.element.advancedStepper.childNumber', [`${stepNumber}`, `${children}`, parentLabel]);
|
|
268
|
+
let statusIcon;
|
|
269
|
+
if (status === 'error')
|
|
270
|
+
statusIcon = 'warning-filled';
|
|
271
|
+
const stepClasses = ['step-child-btn'];
|
|
272
|
+
if (status)
|
|
273
|
+
stepClasses.push(`status-${status}`);
|
|
274
|
+
return (h("li", { role: "presentation" }, h("button", { class: stepClasses.join(' '), type: "button", "aria-labelledby": labelId, "aria-label": btnLabel, "aria-selected": `${isCurrentStep}`, "aria-controls": id, "aria-disabled": isLocked ? 'true' : null, role: "tab", tabIndex: isCurrentStep ? 0 : -1, onKeyDown: ev => !isLocked && this.onStepKeyDown(ev, id), onClick: ev => !isLocked && this.onStepClick(ev, id) }, statusIcon && (h("div", { class: "step-child-icon" }, h("q2-icon", { type: statusIcon }))), label && (h("div", { class: "step-child-label", id: labelId }, loc(label))))));
|
|
275
|
+
}
|
|
276
|
+
render() {
|
|
277
|
+
return (h(Fragment, null, h("ul", { role: "tablist" }, this.structuredPanes.map((pane, index) => this.renderStepBtn(pane, index))), h("div", null, h("slot", null))));
|
|
278
|
+
}
|
|
279
|
+
get hostElement() { return this; }
|
|
280
|
+
static get watchers() { return {
|
|
281
|
+
"currentStepId": ["currentStepChanged"]
|
|
282
|
+
}; }
|
|
283
|
+
static get style() { return stylesCss; }
|
|
284
|
+
}, [1, "q2-stepper-vertical", {
|
|
285
|
+
"currentStepId": [1537, "current-step-id"],
|
|
286
|
+
"structuredPanes": [32]
|
|
287
|
+
}, [[0, "change", "defaultChangeHandler"], [0, "focus", "delegateFocus"], [0, "statusChange", "statusChangeHandler"]]]);
|
|
288
|
+
function defineCustomElement$1() {
|
|
289
|
+
if (typeof customElements === "undefined") {
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
const components = ["q2-stepper-vertical", "q2-icon"];
|
|
293
|
+
components.forEach(tagName => { switch (tagName) {
|
|
294
|
+
case "q2-stepper-vertical":
|
|
295
|
+
if (!customElements.get(tagName)) {
|
|
296
|
+
customElements.define(tagName, Q2AdvancedStepper);
|
|
297
|
+
}
|
|
298
|
+
break;
|
|
299
|
+
case "q2-icon":
|
|
300
|
+
if (!customElements.get(tagName)) {
|
|
301
|
+
defineCustomElement$2();
|
|
302
|
+
}
|
|
303
|
+
break;
|
|
304
|
+
} });
|
|
305
|
+
}
|
|
306
|
+
defineCustomElement$1();
|
|
307
|
+
|
|
308
|
+
const Q2StepperVertical = Q2AdvancedStepper;
|
|
309
|
+
const defineCustomElement = defineCustomElement$1;
|
|
310
|
+
|
|
311
|
+
export { Q2StepperVertical, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface Q2Stepper extends Components.Q2Stepper, HTMLElement {}
|
|
4
|
+
export const Q2Stepper: {
|
|
5
|
+
prototype: Q2Stepper;
|
|
6
|
+
new (): Q2Stepper;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|