igniteui-webcomponents 7.0.1 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/components/combo/themes/shared/combo.common.css.js +1 -1
- package/components/combo/themes/shared/combo.common.css.js.map +1 -1
- package/components/combo/types.js.map +1 -1
- package/components/common/definitions/defineAllComponents.js +4 -0
- package/components/common/definitions/defineAllComponents.js.map +1 -1
- package/components/common/mixins/forms/form-transformers.js.map +1 -1
- package/components/common/util.d.ts +11 -1
- package/components/common/util.js +3 -0
- package/components/common/util.js.map +1 -1
- package/components/date-picker/date-picker.js.map +1 -1
- package/components/file-input/file-input.js.map +1 -1
- package/components/highlight/highlight.d.ts +130 -0
- package/components/highlight/highlight.js +77 -0
- package/components/highlight/highlight.js.map +1 -0
- package/components/highlight/service.d.ts +58 -0
- package/components/highlight/service.js +132 -0
- package/components/highlight/service.js.map +1 -0
- package/components/highlight/themes/dark/highlight.bootstrap.css.js +3 -0
- package/components/highlight/themes/dark/highlight.bootstrap.css.js.map +1 -0
- package/components/highlight/themes/dark/highlight.fluent.css.d.ts +1 -0
- package/components/highlight/themes/dark/highlight.fluent.css.js +3 -0
- package/components/highlight/themes/dark/highlight.fluent.css.js.map +1 -0
- package/components/highlight/themes/dark/highlight.indigo.css.d.ts +1 -0
- package/components/highlight/themes/dark/highlight.indigo.css.js +3 -0
- package/components/highlight/themes/dark/highlight.indigo.css.js.map +1 -0
- package/components/highlight/themes/dark/highlight.material.css.d.ts +1 -0
- package/components/highlight/themes/dark/highlight.material.css.js +3 -0
- package/components/highlight/themes/dark/highlight.material.css.js.map +1 -0
- package/components/highlight/themes/dark/highlight.shared.css.d.ts +1 -0
- package/components/highlight/themes/dark/highlight.shared.css.js +3 -0
- package/components/highlight/themes/dark/highlight.shared.css.js.map +1 -0
- package/components/highlight/themes/light/highlight.bootstrap.css.d.ts +1 -0
- package/components/highlight/themes/light/highlight.bootstrap.css.js +3 -0
- package/components/highlight/themes/light/highlight.bootstrap.css.js.map +1 -0
- package/components/highlight/themes/light/highlight.fluent.css.d.ts +1 -0
- package/components/highlight/themes/light/highlight.fluent.css.js +3 -0
- package/components/highlight/themes/light/highlight.fluent.css.js.map +1 -0
- package/components/highlight/themes/light/highlight.indigo.css.d.ts +1 -0
- package/components/highlight/themes/light/highlight.indigo.css.js +3 -0
- package/components/highlight/themes/light/highlight.indigo.css.js.map +1 -0
- package/components/highlight/themes/light/highlight.material.css.d.ts +1 -0
- package/components/highlight/themes/light/highlight.material.css.js +3 -0
- package/components/highlight/themes/light/highlight.material.css.js.map +1 -0
- package/components/highlight/themes/light/highlight.shared.css.d.ts +1 -0
- package/components/highlight/themes/light/highlight.shared.css.js +3 -0
- package/components/highlight/themes/light/highlight.shared.css.js.map +1 -0
- package/components/highlight/themes/shared/highlight.common.css.d.ts +1 -0
- package/components/highlight/themes/shared/highlight.common.css.js +3 -0
- package/components/highlight/themes/shared/highlight.common.css.js.map +1 -0
- package/components/highlight/themes/themes.d.ts +2 -0
- package/components/highlight/themes/themes.js +47 -0
- package/components/highlight/themes/themes.js.map +1 -0
- package/components/splitter/splitter.d.ts +240 -0
- package/components/splitter/splitter.js +608 -0
- package/components/splitter/splitter.js.map +1 -0
- package/components/splitter/themes/dark/splitter.bootstrap.css.d.ts +1 -0
- package/components/splitter/themes/dark/splitter.bootstrap.css.js +3 -0
- package/components/splitter/themes/dark/splitter.bootstrap.css.js.map +1 -0
- package/components/splitter/themes/dark/splitter.fluent.css.d.ts +1 -0
- package/components/splitter/themes/dark/splitter.fluent.css.js +3 -0
- package/components/splitter/themes/dark/splitter.fluent.css.js.map +1 -0
- package/components/splitter/themes/dark/splitter.indigo.css.d.ts +1 -0
- package/components/splitter/themes/dark/splitter.indigo.css.js +3 -0
- package/components/splitter/themes/dark/splitter.indigo.css.js.map +1 -0
- package/components/splitter/themes/dark/splitter.material.css.d.ts +1 -0
- package/components/splitter/themes/dark/splitter.material.css.js +3 -0
- package/components/splitter/themes/dark/splitter.material.css.js.map +1 -0
- package/components/splitter/themes/dark/splitter.shared.css.d.ts +1 -0
- package/components/splitter/themes/dark/splitter.shared.css.js +3 -0
- package/components/splitter/themes/dark/splitter.shared.css.js.map +1 -0
- package/components/splitter/themes/light/splitter.bootstrap.css.d.ts +1 -0
- package/components/splitter/themes/light/splitter.bootstrap.css.js +3 -0
- package/components/splitter/themes/light/splitter.bootstrap.css.js.map +1 -0
- package/components/splitter/themes/light/splitter.fluent.css.d.ts +1 -0
- package/components/splitter/themes/light/splitter.fluent.css.js +3 -0
- package/components/splitter/themes/light/splitter.fluent.css.js.map +1 -0
- package/components/splitter/themes/light/splitter.indigo.css.d.ts +1 -0
- package/components/splitter/themes/light/splitter.indigo.css.js +3 -0
- package/components/splitter/themes/light/splitter.indigo.css.js.map +1 -0
- package/components/splitter/themes/light/splitter.material.css.d.ts +1 -0
- package/components/splitter/themes/light/splitter.material.css.js +3 -0
- package/components/splitter/themes/light/splitter.material.css.js.map +1 -0
- package/components/splitter/themes/light/splitter.shared.css.d.ts +1 -0
- package/components/splitter/themes/light/splitter.shared.css.js +3 -0
- package/components/splitter/themes/light/splitter.shared.css.js.map +1 -0
- package/components/splitter/themes/shared/splitter.common.css.d.ts +1 -0
- package/components/splitter/themes/shared/splitter.common.css.js +3 -0
- package/components/splitter/themes/shared/splitter.common.css.js.map +1 -0
- package/components/splitter/themes/shared/splitter.indigo.css.d.ts +1 -0
- package/components/splitter/themes/shared/splitter.indigo.css.js +3 -0
- package/components/splitter/themes/shared/splitter.indigo.css.js.map +1 -0
- package/components/splitter/themes/splitter.base.css.d.ts +1 -0
- package/components/splitter/themes/splitter.base.css.js +3 -0
- package/components/splitter/themes/splitter.base.css.js.map +1 -0
- package/components/splitter/themes/themes.d.ts +2 -0
- package/components/splitter/themes/themes.js +48 -0
- package/components/splitter/themes/themes.js.map +1 -0
- package/components/splitter/types.d.ts +39 -0
- package/components/splitter/types.js +2 -0
- package/components/splitter/types.js.map +1 -0
- package/components/stepper/{animations.d.ts → common/animations.d.ts} +2 -2
- package/components/stepper/{animations.js → common/animations.js} +2 -2
- package/components/stepper/common/animations.js.map +1 -0
- package/components/stepper/common/context.d.ts +9 -0
- package/components/stepper/common/context.js +3 -0
- package/components/stepper/common/context.js.map +1 -0
- package/components/stepper/common/state.d.ts +67 -0
- package/components/stepper/common/state.js +134 -0
- package/components/stepper/common/state.js.map +1 -0
- package/components/stepper/common/types.js +2 -0
- package/components/stepper/common/types.js.map +1 -0
- package/components/stepper/step.d.ts +101 -55
- package/components/stepper/step.js +145 -160
- package/components/stepper/step.js.map +1 -1
- package/components/stepper/stepper.d.ts +98 -53
- package/components/stepper/stepper.js +168 -308
- package/components/stepper/stepper.js.map +1 -1
- package/components/stepper/themes/step/shared/step.bootstrap.css.js +1 -1
- package/components/stepper/themes/step/shared/step.bootstrap.css.js.map +1 -1
- package/components/stepper/themes/step/shared/step.common.css.js +1 -1
- package/components/stepper/themes/step/shared/step.common.css.js.map +1 -1
- package/components/stepper/themes/step/shared/step.indigo.css.js +1 -1
- package/components/stepper/themes/step/shared/step.indigo.css.js.map +1 -1
- package/components/stepper/themes/step/themes.js +2 -3
- package/components/stepper/themes/step/themes.js.map +1 -1
- package/components/tabs/themes/tabs.base.css.js +1 -1
- package/components/tabs/themes/tabs.base.css.js.map +1 -1
- package/components/textarea/textarea.js.map +1 -1
- package/components/types.d.ts +1 -0
- package/components/types.js.map +1 -1
- package/components/visually-hidden/visually-hidden.d.ts +49 -0
- package/components/visually-hidden/visually-hidden.js +26 -0
- package/components/visually-hidden/visually-hidden.js.map +1 -0
- package/custom-elements.json +2681 -379
- package/igniteui-webcomponents.css-data.json +2 -2
- package/igniteui-webcomponents.html-data.json +1 -1
- package/index.d.ts +6 -2
- package/index.js +2 -0
- package/index.js.map +1 -1
- package/package.json +3 -1
- package/web-types.json +3 -3
- package/components/stepper/animations.js.map +0 -1
- package/components/stepper/stepper.common.js +0 -2
- package/components/stepper/stepper.common.js.map +0 -1
- package/components/stepper/themes/step/shared/step.fluent.css.js +0 -3
- package/components/stepper/themes/step/shared/step.fluent.css.js.map +0 -1
- /package/components/{stepper/themes/step/shared/step.fluent.css.d.ts → highlight/themes/dark/highlight.bootstrap.css.d.ts} +0 -0
- /package/components/stepper/{stepper.common.d.ts → common/types.d.ts} +0 -0
|
@@ -4,89 +4,63 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
+
import { ContextProvider } from '@lit/context';
|
|
7
8
|
import { html, LitElement } from 'lit';
|
|
8
|
-
import { property
|
|
9
|
+
import { property } from 'lit/decorators.js';
|
|
9
10
|
import { addThemingController } from '../../theming/theming-controller.js';
|
|
10
|
-
import {
|
|
11
|
+
import { addInternalsController } from '../common/controllers/internals.js';
|
|
12
|
+
import { addKeybindings, arrowDown, arrowLeft, arrowRight, arrowUp, endKey, homeKey, } from '../common/controllers/key-bindings.js';
|
|
13
|
+
import { addSlotController, setSlots } from '../common/controllers/slot.js';
|
|
11
14
|
import { registerComponent } from '../common/definitions/register.js';
|
|
12
15
|
import { EventEmitterMixin } from '../common/mixins/event-emitter.js';
|
|
13
|
-
import { isLTR } from '../common/util.js';
|
|
16
|
+
import { addSafeEventListener, findElementFromEventPath, first, getRoot, isLTR, last, wrap, } from '../common/util.js';
|
|
17
|
+
import { STEPPER_CONTEXT } from './common/context.js';
|
|
18
|
+
import { createStepperState } from './common/state.js';
|
|
14
19
|
import IgcStepComponent from './step.js';
|
|
15
20
|
import { styles } from './themes/stepper/stepper.base.css.js';
|
|
16
21
|
import { styles as bootstrap } from './themes/stepper/stepper.bootstrap.css.js';
|
|
17
22
|
import { styles as fluent } from './themes/stepper/stepper.fluent.css.js';
|
|
18
23
|
import { styles as indigo } from './themes/stepper/stepper.indigo.css.js';
|
|
24
|
+
const STEPPER_SYNC_PROPERTIES = [
|
|
25
|
+
'orientation',
|
|
26
|
+
'stepType',
|
|
27
|
+
'contentTop',
|
|
28
|
+
'verticalAnimation',
|
|
29
|
+
'horizontalAnimation',
|
|
30
|
+
'animationDuration',
|
|
31
|
+
'titlePosition',
|
|
32
|
+
];
|
|
19
33
|
export default class IgcStepperComponent extends EventEmitterMixin(LitElement) {
|
|
20
34
|
static { this.tagName = 'igc-stepper'; }
|
|
21
35
|
static { this.styles = styles; }
|
|
22
36
|
static register() {
|
|
23
37
|
registerComponent(IgcStepperComponent, IgcStepComponent);
|
|
24
38
|
}
|
|
25
|
-
|
|
26
|
-
this.
|
|
27
|
-
this.steps.forEach((step) => {
|
|
28
|
-
step.orientation = this.orientation;
|
|
29
|
-
this.updateAnimation(step);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
stepTypeChange() {
|
|
33
|
-
this.steps.forEach((step) => {
|
|
34
|
-
step.stepType = this.stepType;
|
|
35
|
-
});
|
|
39
|
+
get _isHorizontal() {
|
|
40
|
+
return this.orientation === 'horizontal';
|
|
36
41
|
}
|
|
37
|
-
|
|
38
|
-
this.steps
|
|
39
|
-
step.titlePosition = this.titlePosition;
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
contentTopChange() {
|
|
43
|
-
this.steps.forEach((step) => {
|
|
44
|
-
step.contentTop = this.contentTop;
|
|
45
|
-
});
|
|
42
|
+
get steps() {
|
|
43
|
+
return this._state.steps;
|
|
46
44
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
step.visited = false;
|
|
59
|
-
}
|
|
45
|
+
constructor() {
|
|
46
|
+
super();
|
|
47
|
+
this._state = createStepperState();
|
|
48
|
+
this._contextProvider = new ContextProvider(this, {
|
|
49
|
+
context: STEPPER_CONTEXT,
|
|
50
|
+
initialValue: {
|
|
51
|
+
stepper: this,
|
|
52
|
+
state: this._state,
|
|
53
|
+
},
|
|
60
54
|
});
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
animationTypeChange() {
|
|
66
|
-
this.steps.forEach((step) => {
|
|
67
|
-
this.updateAnimation(step);
|
|
55
|
+
this._internals = addInternalsController(this, {
|
|
56
|
+
initialARIA: {
|
|
57
|
+
role: 'tablist',
|
|
58
|
+
},
|
|
68
59
|
});
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
step.animationDuration = this.animationDuration;
|
|
60
|
+
this._slots = addSlotController(this, {
|
|
61
|
+
slots: setSlots(),
|
|
62
|
+
onChange: this._handleSlotChange,
|
|
73
63
|
});
|
|
74
|
-
}
|
|
75
|
-
constructor() {
|
|
76
|
-
super();
|
|
77
|
-
this.keyDownHandlers = new Map(Object.entries({
|
|
78
|
-
Enter: this.activateStep,
|
|
79
|
-
Space: this.activateStep,
|
|
80
|
-
SpaceBar: this.activateStep,
|
|
81
|
-
' ': this.activateStep,
|
|
82
|
-
ArrowUp: this.onArrowUpKeyDown,
|
|
83
|
-
ArrowDown: this.onArrowDownKeyDown,
|
|
84
|
-
ArrowLeft: this.onArrowLeftKeyDown,
|
|
85
|
-
ArrowRight: this.onArrowRightKeyDown,
|
|
86
|
-
Home: this.onHomeKey,
|
|
87
|
-
End: this.onEndKey,
|
|
88
|
-
}));
|
|
89
|
-
this._shouldUpdateLinearState = false;
|
|
90
64
|
this.orientation = 'horizontal';
|
|
91
65
|
this.stepType = 'full';
|
|
92
66
|
this.linear = false;
|
|
@@ -95,273 +69,181 @@ export default class IgcStepperComponent extends EventEmitterMixin(LitElement) {
|
|
|
95
69
|
this.horizontalAnimation = 'slide';
|
|
96
70
|
this.animationDuration = 320;
|
|
97
71
|
this.titlePosition = 'auto';
|
|
72
|
+
addSafeEventListener(this, 'click', this._handleInteraction);
|
|
98
73
|
addThemingController(this, {
|
|
99
74
|
light: { bootstrap, fluent, indigo },
|
|
100
75
|
dark: { bootstrap, fluent, indigo },
|
|
101
76
|
});
|
|
102
|
-
this
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
77
|
+
addKeybindings(this, {
|
|
78
|
+
skip: this._skipKeyboard,
|
|
79
|
+
})
|
|
80
|
+
.set(arrowUp, this._handleArrowUp)
|
|
81
|
+
.set(arrowDown, this._handleArrowDown)
|
|
82
|
+
.set(arrowLeft, this._handleArrowLeft)
|
|
83
|
+
.set(arrowRight, this._handleArrowRight)
|
|
84
|
+
.set(homeKey, this._handleHomeKey)
|
|
85
|
+
.set(endKey, this._handleEndKey)
|
|
86
|
+
.setActivateHandler(this._handleInteraction);
|
|
87
|
+
}
|
|
88
|
+
update(properties) {
|
|
89
|
+
this._syncStepperAttributes(properties);
|
|
90
|
+
if (properties.has('orientation')) {
|
|
91
|
+
this._internals.setARIA({ ariaOrientation: this.orientation });
|
|
92
|
+
}
|
|
93
|
+
if (properties.has('linear')) {
|
|
94
|
+
this._state.setVisitedState(this.linear);
|
|
95
|
+
}
|
|
96
|
+
super.update(properties);
|
|
97
|
+
}
|
|
98
|
+
_skipKeyboard(_, event) {
|
|
99
|
+
return !findElementFromEventPath('[data-step-header]', event);
|
|
100
|
+
}
|
|
101
|
+
_handleHomeKey() {
|
|
102
|
+
this._getStepHeader(first(this._state.accessibleSteps))?.focus();
|
|
103
|
+
}
|
|
104
|
+
_handleEndKey() {
|
|
105
|
+
this._getStepHeader(last(this._state.accessibleSteps))?.focus();
|
|
106
|
+
}
|
|
107
|
+
_handleArrowDown() {
|
|
108
|
+
if (!this._isHorizontal) {
|
|
109
|
+
const step = this._getActiveStepComponent();
|
|
110
|
+
if (step) {
|
|
111
|
+
this._getStepHeader(this._getNextStep(step))?.focus();
|
|
117
112
|
}
|
|
118
|
-
});
|
|
119
|
-
this.addEventListener('stepHeaderKeydown', (event) => {
|
|
120
|
-
event.stopPropagation();
|
|
121
|
-
this.handleKeydown(event.detail.event, event.detail.focusedStep);
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
connectedCallback() {
|
|
125
|
-
super.connectedCallback();
|
|
126
|
-
this.setAttribute('role', 'tablist');
|
|
127
|
-
this.setAttribute('aria-orientation', this.orientation);
|
|
128
|
-
}
|
|
129
|
-
activateFirstStep() {
|
|
130
|
-
const firstEnabledStep = this.steps.find((s) => !s.disabled);
|
|
131
|
-
if (firstEnabledStep) {
|
|
132
|
-
this.activateStep(firstEnabledStep, false);
|
|
133
113
|
}
|
|
134
114
|
}
|
|
135
|
-
|
|
136
|
-
if (
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
else {
|
|
141
|
-
currentStep.toggleAnimation('in', 'reverse');
|
|
142
|
-
nextStep.toggleAnimation('out', 'reverse');
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
async activateStep(step, shouldEmit = true) {
|
|
146
|
-
if (step === this.activeStep) {
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
if (shouldEmit) {
|
|
150
|
-
const args = {
|
|
151
|
-
detail: {
|
|
152
|
-
owner: this,
|
|
153
|
-
oldIndex: this.activeStep.index,
|
|
154
|
-
newIndex: step.index,
|
|
155
|
-
},
|
|
156
|
-
cancelable: true,
|
|
157
|
-
};
|
|
158
|
-
this.animateSteps(step, this.activeStep);
|
|
159
|
-
const allowed = this.emitEvent('igcActiveStepChanging', args);
|
|
160
|
-
if (!allowed) {
|
|
161
|
-
return;
|
|
115
|
+
_handleArrowUp() {
|
|
116
|
+
if (!this._isHorizontal) {
|
|
117
|
+
const step = this._getActiveStepComponent();
|
|
118
|
+
if (step) {
|
|
119
|
+
this._getStepHeader(this._getPreviousStep(step))?.focus();
|
|
162
120
|
}
|
|
163
|
-
this.changeActiveStep(step);
|
|
164
|
-
this.emitEvent('igcActiveStepChanged', {
|
|
165
|
-
detail: { owner: this, index: step.index },
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
this.changeActiveStep(step);
|
|
170
121
|
}
|
|
171
122
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
123
|
+
_handleArrowLeft() {
|
|
124
|
+
const step = this._getActiveStepComponent();
|
|
125
|
+
if (step) {
|
|
126
|
+
const next = isLTR(this)
|
|
127
|
+
? this._getPreviousStep(step)
|
|
128
|
+
: this._getNextStep(step);
|
|
129
|
+
this._getStepHeader(next)?.focus();
|
|
175
130
|
}
|
|
176
|
-
step.active = true;
|
|
177
|
-
step.visited = true;
|
|
178
|
-
this.activeStep = step;
|
|
179
131
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
132
|
+
_handleArrowRight() {
|
|
133
|
+
const step = this._getActiveStepComponent();
|
|
134
|
+
if (step) {
|
|
135
|
+
const next = isLTR(this)
|
|
136
|
+
? this._getNextStep(step)
|
|
137
|
+
: this._getPreviousStep(step);
|
|
138
|
+
this._getStepHeader(next)?.focus();
|
|
186
139
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
140
|
+
}
|
|
141
|
+
_handleInteraction(event) {
|
|
142
|
+
const step = findElementFromEventPath(IgcStepComponent.tagName, event);
|
|
143
|
+
if (step && this._state.isAccessible(step)) {
|
|
144
|
+
this._activateStep(step);
|
|
191
145
|
}
|
|
192
146
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
147
|
+
_handleSlotChange() {
|
|
148
|
+
this._state.setSteps(this._slots.getAssignedElements('[default]', {
|
|
149
|
+
selector: IgcStepComponent.tagName,
|
|
150
|
+
}));
|
|
151
|
+
this._state.stepsChanged();
|
|
152
|
+
this.style.setProperty('--steps-count', this.steps.length.toString());
|
|
153
|
+
}
|
|
154
|
+
_syncStepperAttributes(properties) {
|
|
155
|
+
if (STEPPER_SYNC_PROPERTIES.some((p) => properties.has(p))) {
|
|
156
|
+
this._contextProvider.updateObservers();
|
|
198
157
|
}
|
|
199
|
-
|
|
200
|
-
|
|
158
|
+
}
|
|
159
|
+
_animateSteps(nextStep, currentStep) {
|
|
160
|
+
const steps = this._state.steps;
|
|
161
|
+
if (steps.indexOf(nextStep) > steps.indexOf(currentStep)) {
|
|
162
|
+
currentStep.toggleAnimation('out');
|
|
163
|
+
nextStep.toggleAnimation('in');
|
|
201
164
|
}
|
|
202
|
-
|
|
203
|
-
|
|
165
|
+
else {
|
|
166
|
+
currentStep.toggleAnimation('in', 'reverse');
|
|
167
|
+
nextStep.toggleAnimation('out', 'reverse');
|
|
204
168
|
}
|
|
205
169
|
}
|
|
206
|
-
|
|
207
|
-
this.
|
|
208
|
-
|
|
209
|
-
|
|
170
|
+
_emitChanging(args) {
|
|
171
|
+
return this.emitEvent('igcActiveStepChanging', {
|
|
172
|
+
detail: args,
|
|
173
|
+
cancelable: true,
|
|
174
|
+
});
|
|
210
175
|
}
|
|
211
|
-
|
|
212
|
-
this.
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
?.header?.focus();
|
|
176
|
+
_emitChanged(args) {
|
|
177
|
+
this.emitEvent('igcActiveStepChanged', {
|
|
178
|
+
detail: args,
|
|
179
|
+
});
|
|
216
180
|
}
|
|
217
|
-
|
|
218
|
-
if (
|
|
181
|
+
_activateStep(step, shouldEmit = true) {
|
|
182
|
+
if (step === this._state.activeStep) {
|
|
219
183
|
return;
|
|
220
184
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
onArrowUpKeyDown(focusedStep) {
|
|
224
|
-
if (this.orientation === 'horizontal') {
|
|
185
|
+
if (!shouldEmit) {
|
|
186
|
+
this._state.changeActiveStep(step);
|
|
225
187
|
return;
|
|
226
188
|
}
|
|
227
|
-
this.
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
else {
|
|
234
|
-
this.getNextStep(focusedStep)?.header?.focus();
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
onArrowLeftKeyDown(focusedStep) {
|
|
238
|
-
if (!isLTR(this) && this.orientation === 'horizontal') {
|
|
239
|
-
this.getNextStep(focusedStep)?.header?.focus();
|
|
240
|
-
}
|
|
241
|
-
else {
|
|
242
|
-
this.getPreviousStep(focusedStep)?.header?.focus();
|
|
189
|
+
const steps = this._state.steps;
|
|
190
|
+
const activeIndex = steps.indexOf(this._state.activeStep);
|
|
191
|
+
const index = steps.indexOf(step);
|
|
192
|
+
const args = { oldIndex: activeIndex, newIndex: index };
|
|
193
|
+
if (!this._emitChanging(args)) {
|
|
194
|
+
return;
|
|
243
195
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
if (focusedStep.index === this.steps.length - 1) {
|
|
247
|
-
return this.steps.find((step) => step.isAccessible);
|
|
196
|
+
if (this._state.activeStep) {
|
|
197
|
+
this._animateSteps(step, this._state.activeStep);
|
|
248
198
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
? nextAccessible
|
|
252
|
-
: this.steps.find((step) => step.isAccessible);
|
|
199
|
+
this._state.changeActiveStep(step);
|
|
200
|
+
this._emitChanged({ index });
|
|
253
201
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
.
|
|
259
|
-
}
|
|
260
|
-
let prevStep;
|
|
261
|
-
for (let i = focusedStep.index - 1; i >= 0; i--) {
|
|
262
|
-
const step = this.steps[i];
|
|
263
|
-
if (step.isAccessible) {
|
|
264
|
-
prevStep = step;
|
|
265
|
-
break;
|
|
202
|
+
_moveToNextStep(next = true) {
|
|
203
|
+
const step = this._state.getAdjacentStep(next);
|
|
204
|
+
if (step) {
|
|
205
|
+
if (this._state.activeStep) {
|
|
206
|
+
this._animateSteps(step, this._state.activeStep);
|
|
266
207
|
}
|
|
208
|
+
this._state.changeActiveStep(step);
|
|
267
209
|
}
|
|
268
|
-
return prevStep
|
|
269
|
-
? prevStep
|
|
270
|
-
: this.steps.filter((step) => step.isAccessible).pop();
|
|
271
210
|
}
|
|
272
|
-
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
if (firstInvalidStep) {
|
|
277
|
-
this.steps.forEach((step) => {
|
|
278
|
-
if (step.index <= firstInvalidStep.index) {
|
|
279
|
-
step.linearDisabled = false;
|
|
280
|
-
}
|
|
281
|
-
else {
|
|
282
|
-
step.linearDisabled = true;
|
|
283
|
-
}
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
|
-
else {
|
|
287
|
-
this.steps.forEach((step) => {
|
|
288
|
-
step.linearDisabled = false;
|
|
289
|
-
});
|
|
290
|
-
}
|
|
211
|
+
_getNextStep(step) {
|
|
212
|
+
const steps = this._state.accessibleSteps;
|
|
213
|
+
const next = wrap(0, steps.length - 1, steps.indexOf(step) + 1);
|
|
214
|
+
return steps[next];
|
|
291
215
|
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
if (this.orientation === 'vertical') {
|
|
297
|
-
step.animation = this.verticalAnimation;
|
|
298
|
-
}
|
|
216
|
+
_getPreviousStep(step) {
|
|
217
|
+
const steps = this._state.accessibleSteps;
|
|
218
|
+
const previous = wrap(0, steps.length - 1, steps.indexOf(step) - 1);
|
|
219
|
+
return steps[previous];
|
|
299
220
|
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
step.stepType = this.stepType;
|
|
304
|
-
step.titlePosition = this.titlePosition;
|
|
305
|
-
step.contentTop = this.contentTop;
|
|
306
|
-
step.index = index;
|
|
307
|
-
step.active = this.activeStep === step;
|
|
308
|
-
step.header?.setAttribute('aria-posinset', (index + 1).toString());
|
|
309
|
-
step.header?.setAttribute('aria-setsize', this.steps.length.toString());
|
|
310
|
-
step.header?.setAttribute('id', `igc-step-header-${index}`);
|
|
311
|
-
step.header?.setAttribute('aria-controls', `igc-step-content-${index}`);
|
|
312
|
-
if (index > 0) {
|
|
313
|
-
step.previousComplete = this.steps[index - 1].complete;
|
|
314
|
-
}
|
|
315
|
-
step.animationDuration = this.animationDuration;
|
|
316
|
-
this.updateAnimation(step);
|
|
317
|
-
});
|
|
221
|
+
_getActiveStepComponent() {
|
|
222
|
+
const active = getRoot(this).activeElement;
|
|
223
|
+
return active ? active.closest(IgcStepComponent.tagName) : null;
|
|
318
224
|
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
const lastActiveStep = this.steps
|
|
322
|
-
.reverse()
|
|
323
|
-
.find((step) => step.active);
|
|
324
|
-
if (!lastActiveStep) {
|
|
325
|
-
this.activateFirstStep();
|
|
326
|
-
}
|
|
327
|
-
else {
|
|
328
|
-
this.activateStep(lastActiveStep, false);
|
|
329
|
-
}
|
|
330
|
-
this.syncProperties();
|
|
331
|
-
if (this._shouldUpdateLinearState) {
|
|
332
|
-
this.linearChange();
|
|
333
|
-
this._shouldUpdateLinearState = false;
|
|
334
|
-
}
|
|
335
|
-
if (this.linear) {
|
|
336
|
-
this.updateStepsLinearDisabled();
|
|
337
|
-
}
|
|
225
|
+
_getStepHeader(step) {
|
|
226
|
+
return step?.renderRoot.querySelector('[data-step-header]') ?? null;
|
|
338
227
|
}
|
|
339
228
|
navigateTo(index) {
|
|
340
|
-
const step = this.steps[index];
|
|
341
|
-
if (
|
|
342
|
-
|
|
229
|
+
const step = this._state.steps[index];
|
|
230
|
+
if (step) {
|
|
231
|
+
this._activateStep(step, false);
|
|
343
232
|
}
|
|
344
|
-
this.activateStep(step, false);
|
|
345
233
|
}
|
|
346
234
|
next() {
|
|
347
|
-
this.
|
|
235
|
+
this._moveToNextStep();
|
|
348
236
|
}
|
|
349
237
|
prev() {
|
|
350
|
-
this.
|
|
238
|
+
this._moveToNextStep(false);
|
|
351
239
|
}
|
|
352
240
|
reset() {
|
|
353
|
-
this.
|
|
354
|
-
step.visited = false;
|
|
355
|
-
});
|
|
356
|
-
this.activateFirstStep();
|
|
241
|
+
this._state.reset();
|
|
357
242
|
}
|
|
358
243
|
render() {
|
|
359
|
-
return html `<slot
|
|
244
|
+
return html `<slot></slot>`;
|
|
360
245
|
}
|
|
361
246
|
}
|
|
362
|
-
__decorate([
|
|
363
|
-
queryAssignedElements({ selector: 'igc-step' })
|
|
364
|
-
], IgcStepperComponent.prototype, "steps", void 0);
|
|
365
247
|
__decorate([
|
|
366
248
|
property({ reflect: true })
|
|
367
249
|
], IgcStepperComponent.prototype, "orientation", void 0);
|
|
@@ -369,10 +251,10 @@ __decorate([
|
|
|
369
251
|
property({ reflect: true, attribute: 'step-type' })
|
|
370
252
|
], IgcStepperComponent.prototype, "stepType", void 0);
|
|
371
253
|
__decorate([
|
|
372
|
-
property({ type: Boolean })
|
|
254
|
+
property({ type: Boolean, reflect: true })
|
|
373
255
|
], IgcStepperComponent.prototype, "linear", void 0);
|
|
374
256
|
__decorate([
|
|
375
|
-
property({
|
|
257
|
+
property({ type: Boolean, reflect: true, attribute: 'content-top' })
|
|
376
258
|
], IgcStepperComponent.prototype, "contentTop", void 0);
|
|
377
259
|
__decorate([
|
|
378
260
|
property({ attribute: 'vertical-animation' })
|
|
@@ -381,31 +263,9 @@ __decorate([
|
|
|
381
263
|
property({ attribute: 'horizontal-animation' })
|
|
382
264
|
], IgcStepperComponent.prototype, "horizontalAnimation", void 0);
|
|
383
265
|
__decorate([
|
|
384
|
-
property({ attribute: 'animation-duration'
|
|
266
|
+
property({ type: Number, attribute: 'animation-duration' })
|
|
385
267
|
], IgcStepperComponent.prototype, "animationDuration", void 0);
|
|
386
268
|
__decorate([
|
|
387
269
|
property({ reflect: false, attribute: 'title-position' })
|
|
388
270
|
], IgcStepperComponent.prototype, "titlePosition", void 0);
|
|
389
|
-
__decorate([
|
|
390
|
-
watch('orientation', { waitUntilFirstUpdate: true })
|
|
391
|
-
], IgcStepperComponent.prototype, "orientationChange", null);
|
|
392
|
-
__decorate([
|
|
393
|
-
watch('stepType', { waitUntilFirstUpdate: true })
|
|
394
|
-
], IgcStepperComponent.prototype, "stepTypeChange", null);
|
|
395
|
-
__decorate([
|
|
396
|
-
watch('titlePosition', { waitUntilFirstUpdate: true })
|
|
397
|
-
], IgcStepperComponent.prototype, "titlePositionChange", null);
|
|
398
|
-
__decorate([
|
|
399
|
-
watch('contentTop', { waitUntilFirstUpdate: true })
|
|
400
|
-
], IgcStepperComponent.prototype, "contentTopChange", null);
|
|
401
|
-
__decorate([
|
|
402
|
-
watch('linear', { waitUntilFirstUpdate: true })
|
|
403
|
-
], IgcStepperComponent.prototype, "linearChange", null);
|
|
404
|
-
__decorate([
|
|
405
|
-
watch('verticalAnimation', { waitUntilFirstUpdate: true }),
|
|
406
|
-
watch('horizontalAnimation', { waitUntilFirstUpdate: true })
|
|
407
|
-
], IgcStepperComponent.prototype, "animationTypeChange", null);
|
|
408
|
-
__decorate([
|
|
409
|
-
watch('animationDuration', { waitUntilFirstUpdate: true })
|
|
410
|
-
], IgcStepperComponent.prototype, "animationDurationChange", null);
|
|
411
271
|
//# sourceMappingURL=stepper.js.map
|