q2-tecton-elements 1.9.7 → 1.10.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/cjs/{icons-077ed9b7.js → icons-fa5f4367.js} +22 -22
- package/dist/cjs/index-14348270.js +557 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/q2-avatar.cjs.entry.js +1 -1
- package/dist/cjs/q2-btn_2.cjs.entry.js +4 -4
- package/dist/cjs/q2-calendar.cjs.entry.js +2 -2
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +2 -2
- package/dist/cjs/q2-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
- package/dist/cjs/q2-dropdown.cjs.entry.js +2 -2
- package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
- package/dist/cjs/q2-icon.cjs.entry.js +23 -10
- package/dist/cjs/q2-input.cjs.entry.js +8 -3
- package/dist/cjs/q2-loc.cjs.entry.js +1 -1
- package/dist/cjs/q2-optgroup.cjs.entry.js +1 -1
- package/dist/cjs/q2-option.cjs.entry.js +43 -5
- package/dist/cjs/q2-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/q2-radio.cjs.entry.js +1 -1
- package/dist/cjs/q2-section.cjs.entry.js +1 -1
- package/dist/cjs/q2-select.cjs.entry.js +104 -62
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +27 -0
- package/dist/cjs/q2-stepper.cjs.entry.js +187 -0
- package/dist/cjs/q2-tab-container.cjs.entry.js +12 -464
- 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 +3 -0
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/q2-btn/index.js +3 -3
- package/dist/collection/components/q2-calendar/styles.css +18 -0
- package/dist/collection/components/q2-checkbox-group/styles.css +12 -2
- package/dist/collection/components/q2-dropdown/styles.css +18 -0
- package/dist/collection/components/q2-icon/icons.js +22 -22
- package/dist/collection/components/q2-icon/index.js +41 -9
- package/dist/collection/components/q2-icon/styles.css +33 -42
- package/dist/collection/components/q2-input/index.js +7 -2
- package/dist/collection/components/q2-option/index.js +104 -8
- package/dist/collection/components/q2-option/styles.css +31 -37
- package/dist/collection/components/q2-select/index.js +106 -62
- package/dist/collection/components/q2-select/styles.css +18 -0
- package/dist/collection/components/q2-stepper/index.js +283 -0
- package/dist/collection/components/q2-stepper/styles.css +253 -0
- package/dist/collection/components/q2-stepper-pane/index.js +76 -0
- package/dist/collection/components/q2-stepper-pane/styles.css +70 -0
- package/dist/collection/components/q2-tab-container/index.js +2 -9
- package/dist/collection/components/tecton-tab-pane/index.js +3 -0
- package/dist/collection/utils/index.js +23 -2
- package/dist/esm/{icons-5506a72c.js → icons-17612675.js} +22 -22
- package/dist/esm/index-da24669a.js +548 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/q2-avatar.entry.js +1 -1
- package/dist/esm/q2-btn_2.entry.js +4 -4
- package/dist/esm/q2-calendar.entry.js +2 -2
- package/dist/esm/q2-carousel-pane.entry.js +1 -1
- package/dist/esm/q2-carousel.entry.js +1 -1
- package/dist/esm/q2-checkbox-group.entry.js +2 -2
- package/dist/esm/q2-checkbox.entry.js +1 -1
- package/dist/esm/q2-dropdown-item.entry.js +1 -1
- package/dist/esm/q2-dropdown.entry.js +2 -2
- package/dist/esm/q2-editable-field.entry.js +1 -1
- package/dist/esm/q2-icon.entry.js +23 -10
- package/dist/esm/q2-input.entry.js +8 -3
- package/dist/esm/q2-loc.entry.js +1 -1
- package/dist/esm/q2-optgroup.entry.js +1 -1
- package/dist/esm/q2-option.entry.js +44 -6
- package/dist/esm/q2-radio-group.entry.js +1 -1
- package/dist/esm/q2-radio.entry.js +1 -1
- package/dist/esm/q2-section.entry.js +1 -1
- package/dist/esm/q2-select.entry.js +104 -62
- package/dist/esm/q2-stepper-pane.entry.js +23 -0
- package/dist/esm/q2-stepper.entry.js +183 -0
- package/dist/esm/q2-tab-container.entry.js +2 -454
- 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 +3 -0
- package/dist/q2-tecton-elements/{p-f1ec7948.entry.js → p-2a28baa9.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-9f328dbd.entry.js → p-2c2a5d58.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-93799868.entry.js → p-2f2bbed9.entry.js} +3 -3
- package/dist/q2-tecton-elements/p-37d281b7.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-dfe693e9.entry.js → p-3f2590c0.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-4d283b84.entry.js +1 -0
- package/dist/q2-tecton-elements/p-5289f040.entry.js +1 -0
- package/dist/q2-tecton-elements/p-576509e6.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-c6d4933e.entry.js → p-64eef8d1.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-89ae4f7b.entry.js → p-65894494.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-6ed006a7.entry.js +1 -0
- package/dist/q2-tecton-elements/p-6f570344.js +1 -0
- package/dist/q2-tecton-elements/{p-0c23d50a.entry.js → p-7520656d.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-7c06467f.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-ccb8126f.entry.js → p-82b24667.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-ec245511.entry.js → p-86116f5c.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-ed433950.entry.js → p-891ca6f8.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-8b4f6d3f.entry.js +1 -0
- package/dist/q2-tecton-elements/p-98bb1355.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-0e9e5b53.entry.js → p-9b420e22.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-aaa55918.js +1 -0
- package/dist/q2-tecton-elements/{p-915ce8d8.entry.js → p-c14e0622.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-c92e3bc2.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-7a952b02.entry.js → p-d0d605dc.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-e3a27b97.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-72f9686c.entry.js → p-ebee91e2.entry.js} +1 -1
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/types/components/q2-icon/index.d.ts +1 -0
- package/dist/types/components/q2-option/index.d.ts +9 -2
- package/dist/types/components/q2-select/index.d.ts +4 -1
- package/dist/types/components/q2-stepper/index.d.ts +33 -0
- package/dist/types/components/q2-stepper-pane/index.d.ts +9 -0
- package/dist/types/components/tecton-tab-pane/index.d.ts +1 -0
- package/dist/types/components.d.ts +46 -0
- package/dist/types/global.d.ts +1 -0
- package/dist/types/utils/index.d.ts +5 -2
- package/dist/types/workspace/workspace/{_tecton-production_release_1.9.x → tecton-production_release_1.10.x}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +0 -0
- package/package.json +2 -2
- package/dist/cjs/index-2dcb1a72.js +0 -99
- package/dist/esm/index-f3de8cee.js +0 -91
- package/dist/q2-tecton-elements/p-031a8f06.js +0 -1
- package/dist/q2-tecton-elements/p-0feefe56.js +0 -1
- package/dist/q2-tecton-elements/p-1022a1c6.entry.js +0 -1
- package/dist/q2-tecton-elements/p-12f6dc10.entry.js +0 -1
- package/dist/q2-tecton-elements/p-1ece7876.entry.js +0 -1
- package/dist/q2-tecton-elements/p-5da60194.entry.js +0 -1
- package/dist/q2-tecton-elements/p-b0cb8867.entry.js +0 -1
- package/dist/q2-tecton-elements/p-b6436a3a.entry.js +0 -1
- package/dist/q2-tecton-elements/p-d93abdce.entry.js +0 -1
- package/dist/q2-tecton-elements/p-e5e8eac3.entry.js +0 -1
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { Component, Prop, h, Element, State, Watch, Listen, Event, Fragment } from '@stencil/core';
|
|
2
|
+
import { loc, addSmoothScrollPolyfill } from 'src/utils';
|
|
3
|
+
addSmoothScrollPolyfill();
|
|
4
|
+
export class Q2Stepper {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.currentStep = 1;
|
|
7
|
+
this.scrollEnabled = false;
|
|
8
|
+
this.showScrollLeft = false;
|
|
9
|
+
this.showScrollRight = false;
|
|
10
|
+
this.scheduledAfterRender = [];
|
|
11
|
+
////////// EVENT HANDLERS ////////
|
|
12
|
+
this.onSlotChange = () => {
|
|
13
|
+
this.checkForPanes();
|
|
14
|
+
this.checkScrollState();
|
|
15
|
+
};
|
|
16
|
+
this.onScrollBtnClick = (direction) => {
|
|
17
|
+
const scrollAmount = Math.floor(this.listElement.clientWidth / 2);
|
|
18
|
+
this.listElement.scrollBy({
|
|
19
|
+
left: direction === 'left' ? -scrollAmount : scrollAmount,
|
|
20
|
+
behavior: 'smooth'
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
this.onStepClick = (event, selectedStep) => {
|
|
24
|
+
event.stopPropagation();
|
|
25
|
+
const { currentStep, stepCount, lastEnabledStep } = this;
|
|
26
|
+
if (selectedStep > lastEnabledStep || selectedStep === currentStep)
|
|
27
|
+
return;
|
|
28
|
+
this.change.emit({
|
|
29
|
+
selectedStep,
|
|
30
|
+
lastEnabledStep,
|
|
31
|
+
currentStep,
|
|
32
|
+
stepCount
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
this.onStepKeyDown = (event, stepNumber) => {
|
|
36
|
+
const { lastEnabledStep, stepCount } = this;
|
|
37
|
+
const { key } = event;
|
|
38
|
+
let selectedStep;
|
|
39
|
+
switch (key) {
|
|
40
|
+
case 'ArrowLeft':
|
|
41
|
+
event.preventDefault();
|
|
42
|
+
selectedStep = Math.max(stepNumber - 1, 0);
|
|
43
|
+
break;
|
|
44
|
+
case 'ArrowRight':
|
|
45
|
+
event.preventDefault();
|
|
46
|
+
selectedStep = Math.min(stepNumber + 1, stepCount);
|
|
47
|
+
break;
|
|
48
|
+
case 'Home':
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
selectedStep = 1;
|
|
51
|
+
break;
|
|
52
|
+
case 'End':
|
|
53
|
+
event.preventDefault();
|
|
54
|
+
selectedStep = lastEnabledStep;
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
if (!selectedStep)
|
|
58
|
+
return;
|
|
59
|
+
this.focusStep(selectedStep, true);
|
|
60
|
+
};
|
|
61
|
+
this.checkForPanes = () => {
|
|
62
|
+
const { allPanes } = this;
|
|
63
|
+
if (!allPanes.length)
|
|
64
|
+
return;
|
|
65
|
+
this.stepCount = allPanes.length;
|
|
66
|
+
};
|
|
67
|
+
this.checkScrollState = () => {
|
|
68
|
+
const { scrollLeft, scrollWidth, clientWidth } = this.listElement;
|
|
69
|
+
this.scrollEnabled = scrollWidth > clientWidth;
|
|
70
|
+
this.showScrollLeft = !!scrollLeft;
|
|
71
|
+
this.showScrollRight = scrollWidth !== scrollLeft + clientWidth;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
////////// LIFECYCLE HOOKS ////////
|
|
75
|
+
componentWillLoad() {
|
|
76
|
+
if (!this.lastEnabledStep)
|
|
77
|
+
this.lastEnabledStep = this.currentStep || 1;
|
|
78
|
+
this.resizeObserver = new ResizeObserver(() => this.checkScrollState());
|
|
79
|
+
this.checkForPanes();
|
|
80
|
+
}
|
|
81
|
+
componentDidLoad() {
|
|
82
|
+
this.resizeObserver.observe(this.listElement);
|
|
83
|
+
this.checkScrollState();
|
|
84
|
+
setTimeout(() => this.showStep(this.currentStep || 1), 0);
|
|
85
|
+
}
|
|
86
|
+
componentDidRender() {
|
|
87
|
+
this.scheduledAfterRender.forEach(fn => fn());
|
|
88
|
+
this.scheduledAfterRender = [];
|
|
89
|
+
}
|
|
90
|
+
disconnectedCallback() {
|
|
91
|
+
this.resizeObserver.disconnect();
|
|
92
|
+
}
|
|
93
|
+
////////// WATCHER METHODS ////////
|
|
94
|
+
currentStepChanged(stepNumber) {
|
|
95
|
+
this.showStep(stepNumber);
|
|
96
|
+
}
|
|
97
|
+
////////// HOST EVENTS ////////
|
|
98
|
+
defaultChangeHandler(event) {
|
|
99
|
+
const { hostElement } = this;
|
|
100
|
+
if (event.target === hostElement &&
|
|
101
|
+
!hostElement.getAttribute('onchange') &&
|
|
102
|
+
!!event.detail) {
|
|
103
|
+
this.currentStep = event.detail.selectedStep;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
////////// GETTER METHODS ////////
|
|
107
|
+
get allPanes() {
|
|
108
|
+
return this.hostElement.querySelectorAll('q2-stepper-pane');
|
|
109
|
+
}
|
|
110
|
+
////////// HELPER METHODS ////////
|
|
111
|
+
showStep(stepNumber) {
|
|
112
|
+
if (stepNumber > this.lastEnabledStep) {
|
|
113
|
+
const { currentStep, stepCount } = this;
|
|
114
|
+
this.lastEnabledStep = stepNumber;
|
|
115
|
+
this.change.emit({
|
|
116
|
+
selectedStep: null,
|
|
117
|
+
lastEnabledStep: stepNumber,
|
|
118
|
+
currentStep,
|
|
119
|
+
stepCount
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
this.scheduledAfterRender.push(this.resizeIframe);
|
|
123
|
+
this.showStepPane(stepNumber);
|
|
124
|
+
this.focusStep(stepNumber, this.scrollEnabled);
|
|
125
|
+
}
|
|
126
|
+
resizeIframe() {
|
|
127
|
+
var _a;
|
|
128
|
+
return (_a = window === null || window === void 0 ? void 0 : window.TectonElements) === null || _a === void 0 ? void 0 : _a.resizeIframe();
|
|
129
|
+
}
|
|
130
|
+
showStepPane(stepNumber) {
|
|
131
|
+
this.allPanes.forEach((pane, index) => {
|
|
132
|
+
pane.isActive = stepNumber === index + 1;
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
focusStep(stepNumber, scrollIntoView) {
|
|
136
|
+
var _a;
|
|
137
|
+
const stepListItem = this.listElement.children[stepNumber - 1];
|
|
138
|
+
const isActive = document.activeElement === this.hostElement;
|
|
139
|
+
if (!stepListItem)
|
|
140
|
+
return;
|
|
141
|
+
if (isActive) {
|
|
142
|
+
(_a = stepListItem.firstElementChild) === null || _a === void 0 ? void 0 : _a.focus();
|
|
143
|
+
}
|
|
144
|
+
if (scrollIntoView) {
|
|
145
|
+
const left = stepListItem.offsetLeft - this.listElement.clientWidth / 2;
|
|
146
|
+
this.listElement.scrollTo({
|
|
147
|
+
left,
|
|
148
|
+
behavior: 'smooth'
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
////////// RENDER METHODS ////////
|
|
153
|
+
renderStepBtn(stepIndex) {
|
|
154
|
+
var _a;
|
|
155
|
+
const { allPanes, stepCount, currentStep, lastEnabledStep } = this;
|
|
156
|
+
const { id, label, description } = (_a = allPanes === null || allPanes === void 0 ? void 0 : allPanes[stepIndex]) !== null && _a !== void 0 ? _a : {};
|
|
157
|
+
const stepNumber = stepIndex + 1;
|
|
158
|
+
const isCurrentStep = stepNumber === currentStep;
|
|
159
|
+
const labelId = label && `label-${id}`;
|
|
160
|
+
const descriptionId = label && description && `description-${id}`;
|
|
161
|
+
const btnLabel = !label && loc('tecton.element.stepper.number', [`${stepNumber}`, `${stepCount}`]);
|
|
162
|
+
return (h("li", { role: "presentation" },
|
|
163
|
+
h("button", { class: "step-btn", type: "button", "aria-labelledby": labelId, "aria-describedBy": descriptionId, "aria-label": btnLabel, "aria-selected": isCurrentStep, "aria-controls": id, "aria-disabled": stepNumber > lastEnabledStep ? 'true' : null, role: "tab", tabIndex: isCurrentStep ? 0 : -1, onKeyDown: ev => this.onStepKeyDown(ev, stepNumber), onClick: ev => this.onStepClick(ev, stepNumber) },
|
|
164
|
+
h("div", { class: "step-bubble" }, stepNumber),
|
|
165
|
+
label && (h(Fragment, null,
|
|
166
|
+
h("div", { class: "step-label", id: labelId }, loc(label)),
|
|
167
|
+
description && (h("div", { class: "step-description", id: descriptionId }, loc(description)))))),
|
|
168
|
+
stepIndex ? h("hr", null) : ''));
|
|
169
|
+
}
|
|
170
|
+
render() {
|
|
171
|
+
const { stepCount, scrollEnabled, showScrollLeft, showScrollRight } = this;
|
|
172
|
+
const containerClasses = ['step-container'];
|
|
173
|
+
if (scrollEnabled)
|
|
174
|
+
containerClasses.push('has-scroll');
|
|
175
|
+
return (h(Fragment, null,
|
|
176
|
+
h("div", { class: containerClasses.join(' ') },
|
|
177
|
+
scrollEnabled && (h(Fragment, null,
|
|
178
|
+
h("div", { class: "gradient-left", hidden: !showScrollLeft }),
|
|
179
|
+
h("div", { class: "gradient-right", hidden: !showScrollRight }),
|
|
180
|
+
h("q2-btn", { class: "btn-left", hidden: !this.showScrollLeft, onClick: () => this.onScrollBtnClick('left') },
|
|
181
|
+
h("q2-icon", { type: "chevron-left" })),
|
|
182
|
+
h("q2-btn", { class: "btn-right", hidden: !this.showScrollRight, onClick: () => this.onScrollBtnClick('right') },
|
|
183
|
+
h("q2-icon", { type: "chevron-right" })))),
|
|
184
|
+
h("ul", { onScroll: this.checkScrollState, ref: el => (this.listElement = el), role: "tablist" }, [...Array(stepCount).keys()].map(stepIndex => this.renderStepBtn(stepIndex)))),
|
|
185
|
+
h("div", null,
|
|
186
|
+
h("slot", { onSlotchange: () => this.onSlotChange() }))));
|
|
187
|
+
}
|
|
188
|
+
static get is() { return "q2-stepper"; }
|
|
189
|
+
static get encapsulation() { return "shadow"; }
|
|
190
|
+
static get originalStyleUrls() { return {
|
|
191
|
+
"$": ["styles.scss"]
|
|
192
|
+
}; }
|
|
193
|
+
static get styleUrls() { return {
|
|
194
|
+
"$": ["styles.css"]
|
|
195
|
+
}; }
|
|
196
|
+
static get properties() { return {
|
|
197
|
+
"currentStep": {
|
|
198
|
+
"type": "number",
|
|
199
|
+
"mutable": true,
|
|
200
|
+
"complexType": {
|
|
201
|
+
"original": "number",
|
|
202
|
+
"resolved": "number",
|
|
203
|
+
"references": {}
|
|
204
|
+
},
|
|
205
|
+
"required": false,
|
|
206
|
+
"optional": false,
|
|
207
|
+
"docs": {
|
|
208
|
+
"tags": [],
|
|
209
|
+
"text": ""
|
|
210
|
+
},
|
|
211
|
+
"attribute": "current-step",
|
|
212
|
+
"reflect": true,
|
|
213
|
+
"defaultValue": "1"
|
|
214
|
+
},
|
|
215
|
+
"stepCount": {
|
|
216
|
+
"type": "number",
|
|
217
|
+
"mutable": true,
|
|
218
|
+
"complexType": {
|
|
219
|
+
"original": "number",
|
|
220
|
+
"resolved": "number",
|
|
221
|
+
"references": {}
|
|
222
|
+
},
|
|
223
|
+
"required": false,
|
|
224
|
+
"optional": false,
|
|
225
|
+
"docs": {
|
|
226
|
+
"tags": [],
|
|
227
|
+
"text": ""
|
|
228
|
+
},
|
|
229
|
+
"attribute": "step-count",
|
|
230
|
+
"reflect": false
|
|
231
|
+
},
|
|
232
|
+
"lastEnabledStep": {
|
|
233
|
+
"type": "number",
|
|
234
|
+
"mutable": true,
|
|
235
|
+
"complexType": {
|
|
236
|
+
"original": "number",
|
|
237
|
+
"resolved": "number",
|
|
238
|
+
"references": {}
|
|
239
|
+
},
|
|
240
|
+
"required": false,
|
|
241
|
+
"optional": false,
|
|
242
|
+
"docs": {
|
|
243
|
+
"tags": [],
|
|
244
|
+
"text": ""
|
|
245
|
+
},
|
|
246
|
+
"attribute": "last-enabled-step",
|
|
247
|
+
"reflect": false
|
|
248
|
+
}
|
|
249
|
+
}; }
|
|
250
|
+
static get states() { return {
|
|
251
|
+
"scrollEnabled": {},
|
|
252
|
+
"showScrollLeft": {},
|
|
253
|
+
"showScrollRight": {}
|
|
254
|
+
}; }
|
|
255
|
+
static get events() { return [{
|
|
256
|
+
"method": "change",
|
|
257
|
+
"name": "change",
|
|
258
|
+
"bubbles": true,
|
|
259
|
+
"cancelable": true,
|
|
260
|
+
"composed": true,
|
|
261
|
+
"docs": {
|
|
262
|
+
"tags": [],
|
|
263
|
+
"text": ""
|
|
264
|
+
},
|
|
265
|
+
"complexType": {
|
|
266
|
+
"original": "any",
|
|
267
|
+
"resolved": "any",
|
|
268
|
+
"references": {}
|
|
269
|
+
}
|
|
270
|
+
}]; }
|
|
271
|
+
static get elementRef() { return "hostElement"; }
|
|
272
|
+
static get watchers() { return [{
|
|
273
|
+
"propName": "currentStep",
|
|
274
|
+
"methodName": "currentStepChanged"
|
|
275
|
+
}]; }
|
|
276
|
+
static get listeners() { return [{
|
|
277
|
+
"name": "change",
|
|
278
|
+
"method": "defaultChangeHandler",
|
|
279
|
+
"target": undefined,
|
|
280
|
+
"capture": false,
|
|
281
|
+
"passive": false
|
|
282
|
+
}]; }
|
|
283
|
+
}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
* {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
*:active {
|
|
6
|
+
outline: none;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
*:focus {
|
|
10
|
+
outline: none;
|
|
11
|
+
box-shadow: var(--const-global-focus);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host {
|
|
15
|
+
box-shadow: none !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
::-moz-focus-inner {
|
|
19
|
+
border: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
input,
|
|
23
|
+
textarea,
|
|
24
|
+
button {
|
|
25
|
+
font-family: inherit;
|
|
26
|
+
font-size: inherit;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:host(.sr),
|
|
30
|
+
:host(.sr) button {
|
|
31
|
+
border: 0;
|
|
32
|
+
clip: rect(0 0 0 0);
|
|
33
|
+
height: 1px;
|
|
34
|
+
margin: -1px;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
padding: 0;
|
|
37
|
+
position: absolute;
|
|
38
|
+
width: 1px;
|
|
39
|
+
white-space: nowrap;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.sr,
|
|
43
|
+
.sr button {
|
|
44
|
+
border: 0;
|
|
45
|
+
clip: rect(0 0 0 0);
|
|
46
|
+
height: 1px;
|
|
47
|
+
margin: -1px;
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
padding: 0;
|
|
50
|
+
position: absolute;
|
|
51
|
+
width: 1px;
|
|
52
|
+
white-space: nowrap;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.hidden {
|
|
56
|
+
display: none;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:host([hidden]) {
|
|
60
|
+
display: none;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.invisible {
|
|
64
|
+
visibility: hidden;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:host {
|
|
68
|
+
display: block;
|
|
69
|
+
position: relative;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
ul {
|
|
73
|
+
--comp-bullet-bg: var(--tct-stepper-bullet-active-bg, var(--t-stepper-bullet-active-bg, var(--t-primary, #0079c1)));
|
|
74
|
+
--comp-bullet-font-color: var(--tct-stepper-bullet-active-font-color, var(--t-stepper-bullet-active-font-color, var(--t-primary-font-color, #ffffff)));
|
|
75
|
+
--comp-bullet-size: var(--tct-stepper-bullet-size, var(--t-stepper-bullet-size, 18px));
|
|
76
|
+
--comp-bullet-gap: var(--tct-stepper-bullet-padding, var(--t-stepper-bullet-padding, var(--app-scale-2x, 10px)));
|
|
77
|
+
--comp-bullet-border-offset: var(--tct-stepper-bullet-border-offset, var(--t-stepper-bullet-border-offset, 4px));
|
|
78
|
+
--comp-bullet-border: var(--tct-stepper-bullet-border, var(--t-stepper-bullet-border, 2px solid var(--t-primary-l3)));
|
|
79
|
+
--comp-bullet-font-size: var(--tct-stepper-bullet-font-size, var(--t-stepper-bullet-font-size, var(--app-font-size-small, 12px)));
|
|
80
|
+
--comp-step-width: var(--tct-stepper-step-width, var(--t-stepper-step-width, var(--t-stepper-step-width, 80px)));
|
|
81
|
+
--comp-step-gap: var(--tct-stepper-step-gap, var(--t-stepper-step-gap, 5px));
|
|
82
|
+
--comp-tween: var(--tct-stepper-tween, var(--t-stepper-tween, var(--app-tween-1, 0.2s ease)));
|
|
83
|
+
overflow-x: auto;
|
|
84
|
+
display: flex;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
list-style: none;
|
|
87
|
+
padding: 0;
|
|
88
|
+
padding: var(--tct-stepper-list-padding, var(--t-stepper-list-padding, 2px));
|
|
89
|
+
margin: 0;
|
|
90
|
+
gap: var(--comp-step-gap);
|
|
91
|
+
--comp-scrollbar-size: var(--tct-scrollbar-size, var(--app-scale-1x, 5px));
|
|
92
|
+
--comp-scrollbar-border-radius: var(--tct-scrollbar-border-radius, var(--app-border-radius-1, 3px));
|
|
93
|
+
--comp-scrollbar-color: var(--tct-scrollbar-color, var(--t-a11y-gray-color, #747474));
|
|
94
|
+
scrollbar-width: thin;
|
|
95
|
+
scrollbar-color: var(--comp-scrollbar-color) transparent;
|
|
96
|
+
}
|
|
97
|
+
ul::-webkit-scrollbar {
|
|
98
|
+
width: var(--comp-scrollbar-size);
|
|
99
|
+
height: var(--comp-scrollbar-size);
|
|
100
|
+
margin: 5px;
|
|
101
|
+
}
|
|
102
|
+
ul::-webkit-scrollbar-thumb {
|
|
103
|
+
background: var(--comp-scrollbar-color);
|
|
104
|
+
border-radius: var(--comp-scrollbar-border-radius);
|
|
105
|
+
}
|
|
106
|
+
ul::-webkit-scrollbar-track {
|
|
107
|
+
background: transparent;
|
|
108
|
+
border-radius: var(--comp-scrollbar-border-radius);
|
|
109
|
+
}
|
|
110
|
+
.has-scroll ul {
|
|
111
|
+
justify-content: unset;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
li {
|
|
115
|
+
min-height: var(--tct-stepper-min-height, var(--t-stepper-min-height, 50px));
|
|
116
|
+
flex: 0 0 auto;
|
|
117
|
+
position: relative;
|
|
118
|
+
width: var(--comp-step-width);
|
|
119
|
+
text-align: center;
|
|
120
|
+
max-width: 150px;
|
|
121
|
+
min-width: 80px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.step-btn {
|
|
125
|
+
position: relative;
|
|
126
|
+
background: transparent;
|
|
127
|
+
border: 0;
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
display: flex;
|
|
130
|
+
flex-direction: column;
|
|
131
|
+
align-items: center;
|
|
132
|
+
height: calc(100% - 4px);
|
|
133
|
+
width: 100%;
|
|
134
|
+
transition: var(--comp-tween);
|
|
135
|
+
padding: 0;
|
|
136
|
+
transition-property: box-shadow;
|
|
137
|
+
outline: none;
|
|
138
|
+
}
|
|
139
|
+
.step-btn[aria-disabled] {
|
|
140
|
+
cursor: default;
|
|
141
|
+
}
|
|
142
|
+
.step-btn[aria-disabled], .step-btn[aria-disabled] + hr {
|
|
143
|
+
--comp-bullet-font-color: var(--tct-stepper-bullet-inactive-font-color, var(--t-stepper-bullet-inactive-font-color, var(--t-text, #4d4d4d)));
|
|
144
|
+
--comp-bullet-bg: var(--tct-stepper-bullet-inactive-bg, var(--t-stepper-bullet-inactive-bg, var(--t-gray12, #d9d9d9)));
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.step-bubble {
|
|
148
|
+
margin: var(--comp-bullet-gap) auto;
|
|
149
|
+
background: var(--comp-bullet-bg);
|
|
150
|
+
color: var(--comp-bullet-font-color);
|
|
151
|
+
width: var(--comp-bullet-size);
|
|
152
|
+
height: var(--comp-bullet-size);
|
|
153
|
+
min-height: var(--comp-bullet-size);
|
|
154
|
+
font-size: var(--comp-bullet-font-size);
|
|
155
|
+
transition: var(--comp-tween);
|
|
156
|
+
transition-property: background, color;
|
|
157
|
+
border-radius: 50%;
|
|
158
|
+
position: relative;
|
|
159
|
+
}
|
|
160
|
+
[aria-selected] .step-bubble {
|
|
161
|
+
font-weight: var(--tct-stepper-bullet-active-font-weight, var(--t-stepper-bullet-active-font-weight, 600));
|
|
162
|
+
}
|
|
163
|
+
[aria-selected] .step-bubble:before {
|
|
164
|
+
content: "";
|
|
165
|
+
position: absolute;
|
|
166
|
+
inset: calc(var(--comp-bullet-border-offset) * -1);
|
|
167
|
+
width: calc(var(--comp-bullet-size) + var(--comp-bullet-border-offset));
|
|
168
|
+
height: calc(var(--comp-bullet-size) + var(--comp-bullet-border-offset));
|
|
169
|
+
border-radius: 50%;
|
|
170
|
+
border: var(--comp-bullet-border);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
hr {
|
|
174
|
+
width: calc( var(--comp-step-width) - var(--comp-step-gap) - var(--comp-bullet-gap) - var(--comp-bullet-size) );
|
|
175
|
+
top: calc(calc(var(--comp-bullet-size) / 2) + var(--comp-bullet-gap));
|
|
176
|
+
left: calc(calc(var(--comp-step-width) * -0.5) + var(--comp-step-gap) + var(--comp-bullet-gap));
|
|
177
|
+
border: 0;
|
|
178
|
+
border-top: 1px solid var(--comp-bullet-bg);
|
|
179
|
+
height: 0;
|
|
180
|
+
position: absolute;
|
|
181
|
+
margin: 0;
|
|
182
|
+
transition: border var(--comp-tween);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.step-container {
|
|
186
|
+
position: relative;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.step-label {
|
|
190
|
+
color: var(--tct-stepper-title-color, var(--t-stepper-title-color, var(--t-text, #4d4d4d)));
|
|
191
|
+
font-size: var(--tct-stepper-title-font-size, var(--t-stepper-title-font-size, var(--app-font-size-small, 12px)));
|
|
192
|
+
height: 1.5em;
|
|
193
|
+
display: -webkit-box;
|
|
194
|
+
-webkit-line-clamp: 2;
|
|
195
|
+
-webkit-box-orient: vertical;
|
|
196
|
+
overflow: hidden;
|
|
197
|
+
text-overflow: ellipsis;
|
|
198
|
+
}
|
|
199
|
+
[aria-selected] .step-label {
|
|
200
|
+
font-weight: var(--tct-stepper-active-font-weight, var(--t-stepper-active-font-weight, 600));
|
|
201
|
+
}
|
|
202
|
+
[aria-describedby] .step-label {
|
|
203
|
+
-webkit-line-clamp: 1;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.step-description {
|
|
207
|
+
color: var(--tct-stepper-description-color, var(--t-stepper-description-color, var(--t-textA, rgba(77, 77, 77, 0.77))));
|
|
208
|
+
font-size: var(--tct-stepper-description-font-size, var(--t-stepper-description-font-size, var(--app-font-size-small, 12px)));
|
|
209
|
+
display: -webkit-box;
|
|
210
|
+
-webkit-line-clamp: 4;
|
|
211
|
+
-webkit-box-orient: vertical;
|
|
212
|
+
overflow: hidden;
|
|
213
|
+
text-overflow: ellipsis;
|
|
214
|
+
padding-bottom: 0.2em;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.gradient-left,
|
|
218
|
+
.gradient-right {
|
|
219
|
+
z-index: 1;
|
|
220
|
+
position: absolute;
|
|
221
|
+
top: 0;
|
|
222
|
+
height: 100%;
|
|
223
|
+
width: 18px;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.gradient-left {
|
|
227
|
+
background-image: linear-gradient(to right, var(--t-base), var(--t-base-a0));
|
|
228
|
+
left: 0;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.gradient-right {
|
|
232
|
+
background-image: linear-gradient(to right, var(--t-base-a0), var(--t-base));
|
|
233
|
+
right: 0;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.btn-left,
|
|
237
|
+
.btn-right {
|
|
238
|
+
--tct-icon-size: 18px;
|
|
239
|
+
--tct-btn-icon-hover-bg: transparent;
|
|
240
|
+
--tct-btn-icon-width: 22px;
|
|
241
|
+
--tct-icon-stroke-primary: var(--tct-stepper-scroll-arrow-color, var(--t-stepper-scroll-arrow-color, var(--t-text, #4d4d4d)));
|
|
242
|
+
position: absolute;
|
|
243
|
+
top: calc(50% - 22px);
|
|
244
|
+
z-index: 2;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.btn-left {
|
|
248
|
+
left: 0;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.btn-right {
|
|
252
|
+
right: 0;
|
|
253
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Component, Prop, h, Element } from '@stencil/core';
|
|
2
|
+
import { createGuid, loc } from 'src/utils';
|
|
3
|
+
export class Q2StepperPane {
|
|
4
|
+
////////// LIFECYCLE HOOKS ////////
|
|
5
|
+
connectedCallback() {
|
|
6
|
+
if (!this.hostElement.id)
|
|
7
|
+
this.hostElement.id = `step-${createGuid()}`;
|
|
8
|
+
}
|
|
9
|
+
render() {
|
|
10
|
+
const { label, description, isActive } = this;
|
|
11
|
+
return (h("div", { role: "tabpanel", "aria-label": label && loc(label), "aria-description": description && loc(description), tabindex: "0", hidden: !isActive },
|
|
12
|
+
h("slot", null)));
|
|
13
|
+
}
|
|
14
|
+
static get is() { return "q2-stepper-pane"; }
|
|
15
|
+
static get encapsulation() { return "shadow"; }
|
|
16
|
+
static get originalStyleUrls() { return {
|
|
17
|
+
"$": ["styles.scss"]
|
|
18
|
+
}; }
|
|
19
|
+
static get styleUrls() { return {
|
|
20
|
+
"$": ["styles.css"]
|
|
21
|
+
}; }
|
|
22
|
+
static get properties() { return {
|
|
23
|
+
"label": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"mutable": false,
|
|
26
|
+
"complexType": {
|
|
27
|
+
"original": "string",
|
|
28
|
+
"resolved": "string",
|
|
29
|
+
"references": {}
|
|
30
|
+
},
|
|
31
|
+
"required": false,
|
|
32
|
+
"optional": false,
|
|
33
|
+
"docs": {
|
|
34
|
+
"tags": [],
|
|
35
|
+
"text": ""
|
|
36
|
+
},
|
|
37
|
+
"attribute": "label",
|
|
38
|
+
"reflect": true
|
|
39
|
+
},
|
|
40
|
+
"description": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"mutable": false,
|
|
43
|
+
"complexType": {
|
|
44
|
+
"original": "string",
|
|
45
|
+
"resolved": "string",
|
|
46
|
+
"references": {}
|
|
47
|
+
},
|
|
48
|
+
"required": false,
|
|
49
|
+
"optional": false,
|
|
50
|
+
"docs": {
|
|
51
|
+
"tags": [],
|
|
52
|
+
"text": ""
|
|
53
|
+
},
|
|
54
|
+
"attribute": "description",
|
|
55
|
+
"reflect": true
|
|
56
|
+
},
|
|
57
|
+
"isActive": {
|
|
58
|
+
"type": "boolean",
|
|
59
|
+
"mutable": false,
|
|
60
|
+
"complexType": {
|
|
61
|
+
"original": "boolean",
|
|
62
|
+
"resolved": "boolean",
|
|
63
|
+
"references": {}
|
|
64
|
+
},
|
|
65
|
+
"required": false,
|
|
66
|
+
"optional": false,
|
|
67
|
+
"docs": {
|
|
68
|
+
"tags": [],
|
|
69
|
+
"text": ""
|
|
70
|
+
},
|
|
71
|
+
"attribute": "is-active",
|
|
72
|
+
"reflect": true
|
|
73
|
+
}
|
|
74
|
+
}; }
|
|
75
|
+
static get elementRef() { return "hostElement"; }
|
|
76
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
* {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
*:active {
|
|
6
|
+
outline: none;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
*:focus {
|
|
10
|
+
outline: none;
|
|
11
|
+
box-shadow: var(--const-global-focus);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host {
|
|
15
|
+
box-shadow: none !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
::-moz-focus-inner {
|
|
19
|
+
border: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
input,
|
|
23
|
+
textarea,
|
|
24
|
+
button {
|
|
25
|
+
font-family: inherit;
|
|
26
|
+
font-size: inherit;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:host(.sr),
|
|
30
|
+
:host(.sr) button {
|
|
31
|
+
border: 0;
|
|
32
|
+
clip: rect(0 0 0 0);
|
|
33
|
+
height: 1px;
|
|
34
|
+
margin: -1px;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
padding: 0;
|
|
37
|
+
position: absolute;
|
|
38
|
+
width: 1px;
|
|
39
|
+
white-space: nowrap;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.sr,
|
|
43
|
+
.sr button {
|
|
44
|
+
border: 0;
|
|
45
|
+
clip: rect(0 0 0 0);
|
|
46
|
+
height: 1px;
|
|
47
|
+
margin: -1px;
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
padding: 0;
|
|
50
|
+
position: absolute;
|
|
51
|
+
width: 1px;
|
|
52
|
+
white-space: nowrap;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.hidden {
|
|
56
|
+
display: none;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:host([hidden]) {
|
|
60
|
+
display: none;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.invisible {
|
|
64
|
+
visibility: hidden;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:host {
|
|
68
|
+
display: block;
|
|
69
|
+
position: relative;
|
|
70
|
+
}
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import { Component, Prop, Element, Event, State, Listen, Watch, h } from '@stencil/core';
|
|
2
|
-
import { createGuid, loc } from 'src/utils';
|
|
3
|
-
|
|
4
|
-
// enable scroll animation polyfill only on safari
|
|
2
|
+
import { createGuid, loc, addSmoothScrollPolyfill } from 'src/utils';
|
|
3
|
+
addSmoothScrollPolyfill();
|
|
5
4
|
const userAgent = navigator.userAgent.toLowerCase();
|
|
6
|
-
const isSafari = userAgent.includes('safari') && !userAgent.includes('chrome');
|
|
7
5
|
const isFirefox = userAgent.includes('firefox');
|
|
8
|
-
if (isSafari) {
|
|
9
|
-
// smooth scroll is not supported on safari
|
|
10
|
-
smoothscroll.polyfill();
|
|
11
|
-
window['__forceSmoothScrollPolyfill__'] = true;
|
|
12
|
-
}
|
|
13
6
|
export class Q2TabContainer {
|
|
14
7
|
constructor() {
|
|
15
8
|
this.noPrint = false;
|