@paperless/core 2.0.1-beta.129 → 2.0.1-beta.130
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 +11 -0
- package/dist/build/p-42ae8573.entry.js +2 -0
- package/dist/build/p-42ae8573.entry.js.map +1 -0
- package/dist/build/p-530a64bf.js +2 -0
- package/dist/build/p-98b04385.entry.js +2 -0
- package/dist/build/p-98b04385.entry.js.map +1 -0
- package/dist/build/p-stepper-item.p-stepper-line.entry.esm.js.map +1 -0
- package/dist/build/p-stepper.entry.esm.js.map +1 -1
- package/dist/build/paperless.esm.js +1 -1
- package/dist/cjs/index-BDuPp9vl.js +2 -6
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/p-stepper-item.p-stepper-line.entry.cjs.js.map +1 -0
- package/dist/cjs/{p-stepper-item.cjs.entry.js → p-stepper-item_2.cjs.entry.js} +23 -2
- package/dist/cjs/p-stepper-item_2.cjs.entry.js.map +1 -0
- package/dist/cjs/p-stepper.cjs.entry.js +52 -19
- package/dist/cjs/p-stepper.cjs.entry.js.map +1 -1
- package/dist/cjs/p-stepper.entry.cjs.js.map +1 -1
- package/dist/cjs/paperless.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/organisms/stepper/stepper.component.js +80 -21
- package/dist/collection/components/organisms/stepper/stepper.component.js.map +1 -1
- package/dist/{esm/p-stepper-item.entry.js → components/p-C9Hyi74u.js} +33 -12
- package/dist/components/p-C9Hyi74u.js.map +1 -0
- package/dist/components/p-stepper-item.js +1 -142
- package/dist/components/p-stepper-item.js.map +1 -1
- package/dist/components/p-stepper.js +63 -22
- package/dist/components/p-stepper.js.map +1 -1
- package/dist/esm/index-DhGo7hbh.js +2 -6
- package/dist/esm/loader.js +1 -1
- package/dist/esm/p-stepper-item.p-stepper-line.entry.js.map +1 -0
- package/dist/esm/p-stepper-item_2.entry.js +146 -0
- package/dist/esm/p-stepper-item_2.entry.js.map +1 -0
- package/dist/esm/p-stepper.entry.js +53 -20
- package/dist/esm/p-stepper.entry.js.map +1 -1
- package/dist/esm/paperless.js +1 -1
- package/dist/index.html +1 -1
- package/dist/paperless/p-42ae8573.entry.js +2 -0
- package/dist/paperless/p-42ae8573.entry.js.map +1 -0
- package/dist/paperless/p-98b04385.entry.js +2 -0
- package/dist/paperless/p-98b04385.entry.js.map +1 -0
- package/dist/paperless/p-stepper-item.p-stepper-line.entry.esm.js.map +1 -0
- package/dist/paperless/p-stepper.entry.esm.js.map +1 -1
- package/dist/paperless/paperless.esm.js +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/dist/types/components/organisms/stepper/stepper.component.d.ts +13 -0
- package/dist/types/components.d.ts +10 -0
- package/package.json +1 -1
- package/dist/build/p-2a7c9b4d.entry.js +0 -2
- package/dist/build/p-2a7c9b4d.entry.js.map +0 -1
- package/dist/build/p-503eb4b9.entry.js +0 -2
- package/dist/build/p-503eb4b9.entry.js.map +0 -1
- package/dist/build/p-542ef3ae.entry.js +0 -2
- package/dist/build/p-542ef3ae.entry.js.map +0 -1
- package/dist/build/p-cfe710ef.js +0 -2
- package/dist/build/p-stepper-item.entry.esm.js.map +0 -1
- package/dist/build/p-stepper-line.entry.esm.js.map +0 -1
- package/dist/cjs/p-stepper-item.cjs.entry.js.map +0 -1
- package/dist/cjs/p-stepper-item.entry.cjs.js.map +0 -1
- package/dist/cjs/p-stepper-line.cjs.entry.js +0 -28
- package/dist/cjs/p-stepper-line.cjs.entry.js.map +0 -1
- package/dist/cjs/p-stepper-line.entry.cjs.js.map +0 -1
- package/dist/esm/p-stepper-item.entry.js.map +0 -1
- package/dist/esm/p-stepper-line.entry.js +0 -26
- package/dist/esm/p-stepper-line.entry.js.map +0 -1
- package/dist/paperless/p-2a7c9b4d.entry.js +0 -2
- package/dist/paperless/p-2a7c9b4d.entry.js.map +0 -1
- package/dist/paperless/p-503eb4b9.entry.js +0 -2
- package/dist/paperless/p-503eb4b9.entry.js.map +0 -1
- package/dist/paperless/p-542ef3ae.entry.js +0 -2
- package/dist/paperless/p-542ef3ae.entry.js.map +0 -1
- package/dist/paperless/p-stepper-item.entry.esm.js.map +0 -1
- package/dist/paperless/p-stepper-line.entry.esm.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h } from "@stencil/core";
|
|
1
|
+
import { Fragment, h, } from "@stencil/core";
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
3
|
const stepper = cva(['flex gap-2'], {
|
|
4
4
|
variants: {
|
|
@@ -13,6 +13,10 @@ const stepper = cva(['flex gap-2'], {
|
|
|
13
13
|
},
|
|
14
14
|
});
|
|
15
15
|
export class Stepper {
|
|
16
|
+
/**
|
|
17
|
+
* The steps but as a property, can also be used via slot
|
|
18
|
+
*/
|
|
19
|
+
steps;
|
|
16
20
|
/**
|
|
17
21
|
* The currently active step
|
|
18
22
|
*/
|
|
@@ -38,11 +42,15 @@ export class Stepper {
|
|
|
38
42
|
*/
|
|
39
43
|
_el;
|
|
40
44
|
_generatedOnce = false;
|
|
45
|
+
_loaded = false;
|
|
41
46
|
_generateTimeout;
|
|
42
47
|
_resizeObserver;
|
|
48
|
+
_hasSlotItems = false;
|
|
43
49
|
componentDidLoad() {
|
|
50
|
+
this._hasSlotItems = !!this._el.querySelector(':scope > *');
|
|
44
51
|
this._resizeObserver = new ResizeObserver(() => this._generateLinesOnce());
|
|
45
52
|
this._resizeObserver.observe(this._el);
|
|
53
|
+
this._loaded = true;
|
|
46
54
|
}
|
|
47
55
|
disconnectCallback() {
|
|
48
56
|
if (this._resizeObserver) {
|
|
@@ -50,10 +58,33 @@ export class Stepper {
|
|
|
50
58
|
}
|
|
51
59
|
}
|
|
52
60
|
render() {
|
|
53
|
-
|
|
61
|
+
if (!this._loaded) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (!this._hasSlotItems) {
|
|
65
|
+
const steps = typeof this.steps === 'string' ? JSON.parse(this.steps) : this.steps;
|
|
66
|
+
if (!steps?.length) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const items = steps.map((step, index) => {
|
|
70
|
+
const item = this._getItem(typeof step === 'string'
|
|
71
|
+
? {
|
|
72
|
+
active: false,
|
|
73
|
+
finished: false,
|
|
74
|
+
content: step,
|
|
75
|
+
}
|
|
76
|
+
: step, index);
|
|
77
|
+
return (h(Fragment, null, item, index < steps.length - 1 && this._getLine(index)));
|
|
78
|
+
});
|
|
79
|
+
return (h("div", { class: stepper({
|
|
80
|
+
direction: this.direction,
|
|
81
|
+
generatedOnce: true,
|
|
82
|
+
}) }, items));
|
|
83
|
+
}
|
|
84
|
+
return (h("div", { class: stepper({
|
|
54
85
|
direction: this.direction,
|
|
55
86
|
generatedOnce: this._generatedOnce,
|
|
56
|
-
}) }, h("slot", {
|
|
87
|
+
}) }, h("slot", { onSlotchange: () => this._generateLinesOnce() })));
|
|
57
88
|
}
|
|
58
89
|
_onAlignChange() {
|
|
59
90
|
this._generateLinesOnce();
|
|
@@ -64,45 +95,47 @@ export class Stepper {
|
|
|
64
95
|
_onActiveStepChange() {
|
|
65
96
|
this._generateLinesOnce();
|
|
66
97
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
98
|
+
_getItem(data, i) {
|
|
99
|
+
const activeStep = this.activeStep - 1 || 0;
|
|
100
|
+
return (h("p-stepper-item", { active: this.enableAutoStatus ? i === activeStep : data.active, finished: this.enableAutoStatus ? i < activeStep : data.finished, number: i + 1, align: this.direction === 'vertical' ? this.align : 'start', contentPosition: this.contentPosition }, data.content));
|
|
101
|
+
}
|
|
102
|
+
_getLine(i) {
|
|
103
|
+
const activeStep = this.activeStep - 1 || 0;
|
|
104
|
+
return (h("p-stepper-line", { active: i < activeStep, direction: this.direction }));
|
|
105
|
+
}
|
|
106
|
+
_checkItems(items) {
|
|
107
|
+
const activeStep = this.activeStep - 1 || 0;
|
|
70
108
|
for (let i = 0; i < items?.length; i++) {
|
|
71
109
|
const item = items.item(i);
|
|
72
110
|
if (this.enableAutoStatus) {
|
|
73
111
|
item.active = i === activeStep;
|
|
74
112
|
item.finished = i < activeStep;
|
|
75
113
|
}
|
|
76
|
-
if (!this.activeStep || activeStep < 0) {
|
|
77
|
-
if (item.active) {
|
|
78
|
-
activeStep = i;
|
|
79
|
-
}
|
|
80
|
-
if (activeStep < 0 && item.finished) {
|
|
81
|
-
activeStep = i + 1;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
114
|
item.number = i + 1;
|
|
85
115
|
item.align = this.direction === 'vertical' ? this.align : 'start';
|
|
86
116
|
item.contentPosition = this.contentPosition;
|
|
87
117
|
}
|
|
88
118
|
}
|
|
89
119
|
_generateLinesOnce() {
|
|
120
|
+
if (!this._hasSlotItems) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
90
123
|
if (this._generateTimeout) {
|
|
91
124
|
clearTimeout(this._generateTimeout);
|
|
92
125
|
this._generateTimeout = null;
|
|
93
126
|
}
|
|
94
127
|
this._generateTimeout = setTimeout(() => {
|
|
95
|
-
this.
|
|
96
|
-
this.
|
|
128
|
+
const items = this._el.querySelectorAll('p-stepper-item');
|
|
129
|
+
this._checkItems(items);
|
|
130
|
+
this._generateLines(items);
|
|
97
131
|
this._generateTimeout = null;
|
|
98
|
-
}
|
|
132
|
+
});
|
|
99
133
|
}
|
|
100
|
-
_generateLines() {
|
|
134
|
+
_generateLines(items) {
|
|
101
135
|
if (!this._el) {
|
|
102
136
|
return;
|
|
103
137
|
}
|
|
104
138
|
let activeStep = this.activeStep - 1 || 0;
|
|
105
|
-
const items = this._el.querySelectorAll('p-stepper-item');
|
|
106
139
|
for (let i = 0; i < items?.length; i++) {
|
|
107
140
|
const item = items.item(i);
|
|
108
141
|
if (i < items.length - 1) {
|
|
@@ -140,7 +173,7 @@ export class Stepper {
|
|
|
140
173
|
line.remove();
|
|
141
174
|
}
|
|
142
175
|
if (!this._generatedOnce) {
|
|
143
|
-
setTimeout(() => (this._generatedOnce = true),
|
|
176
|
+
setTimeout(() => (this._generatedOnce = true), 0);
|
|
144
177
|
}
|
|
145
178
|
}
|
|
146
179
|
_setLineData(stepperLine, item, nextItem, i, activeStep) {
|
|
@@ -181,6 +214,31 @@ export class Stepper {
|
|
|
181
214
|
}
|
|
182
215
|
static get properties() {
|
|
183
216
|
return {
|
|
217
|
+
"steps": {
|
|
218
|
+
"type": "string",
|
|
219
|
+
"attribute": "steps",
|
|
220
|
+
"mutable": false,
|
|
221
|
+
"complexType": {
|
|
222
|
+
"original": "string | string[] | StepperStepItemObj[]",
|
|
223
|
+
"resolved": "StepperStepItemObj[] | string | string[]",
|
|
224
|
+
"references": {
|
|
225
|
+
"StepperStepItemObj": {
|
|
226
|
+
"location": "local",
|
|
227
|
+
"path": "/home/runner/work/Paperless/Paperless/packages/core/src/components/organisms/stepper/stepper.component.tsx",
|
|
228
|
+
"id": "src/components/organisms/stepper/stepper.component.tsx::StepperStepItemObj"
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
"required": false,
|
|
233
|
+
"optional": false,
|
|
234
|
+
"docs": {
|
|
235
|
+
"tags": [],
|
|
236
|
+
"text": "The steps but as a property, can also be used via slot"
|
|
237
|
+
},
|
|
238
|
+
"getter": false,
|
|
239
|
+
"setter": false,
|
|
240
|
+
"reflect": false
|
|
241
|
+
},
|
|
184
242
|
"activeStep": {
|
|
185
243
|
"type": "number",
|
|
186
244
|
"attribute": "active-step",
|
|
@@ -285,7 +343,8 @@ export class Stepper {
|
|
|
285
343
|
}
|
|
286
344
|
static get states() {
|
|
287
345
|
return {
|
|
288
|
-
"_generatedOnce": {}
|
|
346
|
+
"_generatedOnce": {},
|
|
347
|
+
"_loaded": {}
|
|
289
348
|
};
|
|
290
349
|
}
|
|
291
350
|
static get elementRef() { return "_el"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stepper.component.js","sourceRoot":"","sources":["../../../../src/components/organisms/stepper/stepper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AU,GAAG,EAAE,KAAK,CAAC;gBACvD,WAAW,IAAI,UAAU,CAAC;YAC3B,CAAC;YAED,IAAI,IAAI,CAAC,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,EAAE,CAAC;gBACrD,WAAW,CAAC,KAAK,CAAC,YAAY,GAAG,IAAI,cAAc,GAAG,EAAE,KAAK,CAAC;gBAC9D,WAAW,IAAI,cAAc,CAAC;YAC/B,CAAC;YAED,WAAW,CAAC,KAAK,CAAC,SAAS,GAAG,QAAQ,WAAW,GAAG,EAAE,MAAM,CAAC;QAC9D,CAAC;IACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, Prop, State, Watch } from '@stencil/core';\nimport { cva } from 'class-variance-authority';\n\nconst stepper = cva(['flex gap-2'], {\n\tvariants: {\n\t\tdirection: {\n\t\t\tvertical: 'w-full flex-col flex-wrap',\n\t\t\thorizontal: 'h-auto items-center',\n\t\t},\n\t\tgeneratedOnce: {\n\t\t\ttrue: 'opacity-100',\n\t\t\tfalse: 'opacity-0',\n\t\t},\n\t},\n});\n\n@Component({\n\ttag: 'p-stepper',\n\tstyleUrl: 'stepper.component.css',\n\tshadow: true,\n})\nexport class Stepper {\n\t/**\n\t * The currently active step\n\t */\n\t@Prop() activeStep: number = 1;\n\n\t/**\n\t * Wether to automatically apply active & finished to items\n\t */\n\t@Prop() enableAutoStatus: boolean = true;\n\n\t/**\n\t * The direction of the stepper\n\t */\n\t@Prop() direction: 'horizontal' | 'vertical' = 'horizontal';\n\n\t/**\n\t * The alignment of the content in case of vertical direction\n\t */\n\t@Prop() align: 'start' | 'center' | 'end' = 'center';\n\n\t/**\n\t * The position of the content in case of vertical direction\n\t */\n\t@Prop() contentPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _generatedOnce = false;\n\n\tprivate _generateTimeout: NodeJS.Timeout | undefined;\n\tprivate _resizeObserver: ResizeObserver;\n\n\tcomponentDidLoad() {\n\t\tthis._resizeObserver = new ResizeObserver(() => this._generateLinesOnce());\n\t\tthis._resizeObserver.observe(this._el);\n\t}\n\n\tdisconnectCallback() {\n\t\tif (this._resizeObserver) {\n\t\t\tthis._resizeObserver.disconnect();\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclass={stepper({\n\t\t\t\t\tdirection: this.direction,\n\t\t\t\t\tgeneratedOnce: this._generatedOnce,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<slot onSlotchange={() => this._generateLinesOnce()} />\n\t\t\t</div>\n\t\t);\n\t}\n\n\t@Watch('align')\n\tprotected _onAlignChange() {\n\t\tthis._generateLinesOnce();\n\t}\n\n\t@Watch('direction')\n\tprotected _onDirectionChange() {\n\t\tthis._generateLinesOnce();\n\t}\n\n\t@Watch('activeStep')\n\tprotected _onActiveStepChange() {\n\t\tthis._generateLinesOnce();\n\t}\n\n\tprivate _checkItems() {\n\t\tlet activeStep = this.activeStep - 1 || 0;\n\t\tconst items = this._el.querySelectorAll('p-stepper-item');\n\n\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\tconst item = items.item(i) as any;\n\n\t\t\tif (this.enableAutoStatus) {\n\t\t\t\titem.active = i === activeStep;\n\t\t\t\titem.finished = i < activeStep;\n\t\t\t}\n\n\t\t\tif (!this.activeStep || activeStep < 0) {\n\t\t\t\tif (item.active) {\n\t\t\t\t\tactiveStep = i;\n\t\t\t\t}\n\n\t\t\t\tif (activeStep < 0 && item.finished) {\n\t\t\t\t\tactiveStep = i + 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\titem.number = i + 1;\n\t\t\titem.align = this.direction === 'vertical' ? this.align : 'start';\n\t\t\titem.contentPosition = this.contentPosition;\n\t\t}\n\t}\n\n\tprivate _generateLinesOnce() {\n\t\tif (this._generateTimeout) {\n\t\t\tclearTimeout(this._generateTimeout);\n\t\t\tthis._generateTimeout = null;\n\t\t}\n\n\t\tthis._generateTimeout = setTimeout(() => {\n\t\t\tthis._checkItems();\n\t\t\tthis._generateLines();\n\t\t\tthis._generateTimeout = null;\n\t\t}, 20);\n\t}\n\n\tprivate _generateLines() {\n\t\tif (!this._el) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet activeStep = this.activeStep - 1 || 0;\n\t\tconst items = this._el.querySelectorAll('p-stepper-item');\n\n\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\tconst item = items.item(i) as any;\n\n\t\t\tif (i < items.length - 1) {\n\t\t\t\tlet nextItem = item.nextElementSibling;\n\n\t\t\t\tif (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-item') {\n\t\t\t\t\tconst stepperLine = document.createElement('p-stepper-line');\n\t\t\t\t\tthis._el.insertBefore(stepperLine, nextItem);\n\t\t\t\t\tthis._setLineData(stepperLine, item, nextItem, i, activeStep);\n\n\t\t\t\t\tconst previous = stepperLine.previousElementSibling;\n\t\t\t\t\tif (previous && previous.tagName.toLowerCase() === 'p-stepper-line') {\n\t\t\t\t\t\tprevious.remove();\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-line') {\n\t\t\t\t\tconst stepperLine = nextItem;\n\t\t\t\t\tnextItem = nextItem.nextElementSibling;\n\n\t\t\t\t\tif (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-item') {\n\t\t\t\t\t\tthis._setLineData(stepperLine, item, nextItem, i, activeStep);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (i > 0) {\n\t\t\t\tconst previousItem = item.previousElementSibling;\n\t\t\t\tif (\n\t\t\t\t\tpreviousItem &&\n\t\t\t\t\tpreviousItem.tagName.toLowerCase() === 'p-stepper-line'\n\t\t\t\t) {\n\t\t\t\t\tpreviousItem.direction = this.direction;\n\t\t\t\t\tpreviousItem.active = item.active || item.finished;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst lines = this._el.querySelectorAll(\n\t\t\t'p-stepper-line:not(:has(+ p-stepper-item)), p-stepper-line:first-child'\n\t\t);\n\t\tfor (let j = lines.length - 1; j >= 0; j--) {\n\t\t\tconst line = lines.item(j);\n\t\t\tline.remove();\n\t\t}\n\n\t\tif (!this._generatedOnce) {\n\t\t\tsetTimeout(() => (this._generatedOnce = true), 50);\n\t\t}\n\t}\n\n\tprivate _setLineData(\n\t\tstepperLine: HTMLPStepperLineElement,\n\t\titem: HTMLPStepperItemElement,\n\t\tnextItem: HTMLPStepperItemElement,\n\t\ti: number,\n\t\tactiveStep: number\n\t) {\n\t\tlet heightDiff = item.clientHeight - 24;\n\t\tlet heightDiffNext = nextItem.clientHeight - 24;\n\n\t\tif (this.align === 'center') {\n\t\t\theightDiff = heightDiff / 2;\n\t\t\theightDiffNext = heightDiffNext / 2;\n\t\t}\n\n\t\tstepperLine.direction = this.direction;\n\t\tstepperLine.active = i < activeStep;\n\n\t\tif (heightDiff > 0 && this.direction === 'vertical') {\n\t\t\tlet totalHeight = 0;\n\n\t\t\tstepperLine.style.marginTop = '0';\n\t\t\tstepperLine.style.marginBottom = '0';\n\n\t\t\tif (this.align === 'start' || this.align === 'center') {\n\t\t\t\tstepperLine.style.marginTop = `-${heightDiff / 16}rem`;\n\t\t\t\ttotalHeight += heightDiff;\n\t\t\t}\n\n\t\t\tif (this.align === 'center' || this.align === 'end') {\n\t\t\t\tstepperLine.style.marginBottom = `-${heightDiffNext / 16}rem`;\n\t\t\t\ttotalHeight += heightDiffNext;\n\t\t\t}\n\n\t\t\tstepperLine.style.minHeight = `calc(${totalHeight / 16}rem)`;\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"stepper.component.js","sourceRoot":"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va } from 'class-variance-authority';\n\nexport interface StepperStepItemObj {\n\tcontent: string;\n\tactive: boolean;\n\tfinished: boolean;\n}\n\nconst stepper = cva(['flex gap-2'], {\n\tvariants: {\n\t\tdirection: {\n\t\t\tvertical: 'w-full flex-col flex-wrap',\n\t\t\thorizontal: 'h-auto items-center',\n\t\t},\n\t\tgeneratedOnce: {\n\t\t\ttrue: 'opacity-100',\n\t\t\tfalse: 'opacity-0',\n\t\t},\n\t},\n});\n\n@Component({\n\ttag: 'p-stepper',\n\tstyleUrl: 'stepper.component.css',\n\tshadow: true,\n})\nexport class Stepper {\n\t/**\n\t * The steps but as a property, can also be used via slot\n\t */\n\t@Prop() steps: string | string[] | StepperStepItemObj[];\n\n\t/**\n\t * The currently active step\n\t */\n\t@Prop() activeStep: number = 1;\n\n\t/**\n\t * Wether to automatically apply active & finished to items\n\t */\n\t@Prop() enableAutoStatus: boolean = true;\n\n\t/**\n\t * The direction of the stepper\n\t */\n\t@Prop() direction: 'horizontal' | 'vertical' = 'horizontal';\n\n\t/**\n\t * The alignment of the content in case of vertical direction\n\t */\n\t@Prop() align: 'start' | 'center' | 'end' = 'center';\n\n\t/**\n\t * The position of the content in case of vertical direction\n\t */\n\t@Prop() contentPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _generatedOnce = false;\n\t@State() private _loaded = false;\n\n\tprivate _generateTimeout: NodeJS.Timeout | undefined;\n\tprivate _resizeObserver: ResizeObserver;\n\n\tprivate _hasSlotItems = false;\n\n\tcomponentDidLoad() {\n\t\tthis._hasSlotItems = !!this._el.querySelector(':scope > *');\n\n\t\tthis._resizeObserver = new ResizeObserver(() => this._generateLinesOnce());\n\t\tthis._resizeObserver.observe(this._el);\n\n\t\tthis._loaded = true;\n\t}\n\n\tdisconnectCallback() {\n\t\tif (this._resizeObserver) {\n\t\t\tthis._resizeObserver.disconnect();\n\t\t}\n\t}\n\n\trender() {\n\t\tif (!this._loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._hasSlotItems) {\n\t\t\tconst steps =\n\t\t\t\ttypeof this.steps === 'string' ? JSON.parse(this.steps) : this.steps;\n\t\t\tif (!steps?.length) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst items = steps.map((step, index) => {\n\t\t\t\tconst item = this._getItem(\n\t\t\t\t\ttypeof step === 'string'\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tactive: false,\n\t\t\t\t\t\t\t\tfinished: false,\n\t\t\t\t\t\t\t\tcontent: step,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: step,\n\t\t\t\t\tindex\n\t\t\t\t);\n\t\t\t\treturn (\n\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t{item}\n\t\t\t\t\t\t{index < steps.length - 1 && this._getLine(index)}\n\t\t\t\t\t</Fragment>\n\t\t\t\t);\n\t\t\t});\n\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tclass={stepper({\n\t\t\t\t\t\tdirection: this.direction,\n\t\t\t\t\t\tgeneratedOnce: true,\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t{items}\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclass={stepper({\n\t\t\t\t\tdirection: this.direction,\n\t\t\t\t\tgeneratedOnce: this._generatedOnce,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<slot onSlotchange={() => this._generateLinesOnce()} />\n\t\t\t</div>\n\t\t);\n\t}\n\n\t@Watch('align')\n\tprotected _onAlignChange() {\n\t\tthis._generateLinesOnce();\n\t}\n\n\t@Watch('direction')\n\tprotected _onDirectionChange() {\n\t\tthis._generateLinesOnce();\n\t}\n\n\t@Watch('activeStep')\n\tprotected _onActiveStepChange() {\n\t\tthis._generateLinesOnce();\n\t}\n\n\tprivate _getItem(data: StepperStepItemObj, i: number) {\n\t\tconst activeStep = this.activeStep - 1 || 0;\n\n\t\treturn (\n\t\t\t<p-stepper-item\n\t\t\t\tactive={this.enableAutoStatus ? i === activeStep : data.active}\n\t\t\t\tfinished={this.enableAutoStatus ? i < activeStep : data.finished}\n\t\t\t\tnumber={i + 1}\n\t\t\t\talign={this.direction === 'vertical' ? this.align : 'start'}\n\t\t\t\tcontentPosition={this.contentPosition}\n\t\t\t>\n\t\t\t\t{data.content}\n\t\t\t</p-stepper-item>\n\t\t);\n\t}\n\n\tprivate _getLine(i: number) {\n\t\tconst activeStep = this.activeStep - 1 || 0;\n\t\treturn (\n\t\t\t<p-stepper-line\n\t\t\t\tactive={i < activeStep}\n\t\t\t\tdirection={this.direction}\n\t\t\t/>\n\t\t);\n\t}\n\n\tprivate _checkItems(items: NodeListOf<HTMLPStepperItemElement>) {\n\t\tconst activeStep = this.activeStep - 1 || 0;\n\n\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\tconst item = items.item(i) as any;\n\n\t\t\tif (this.enableAutoStatus) {\n\t\t\t\titem.active = i === activeStep;\n\t\t\t\titem.finished = i < activeStep;\n\t\t\t}\n\n\t\t\titem.number = i + 1;\n\t\t\titem.align = this.direction === 'vertical' ? this.align : 'start';\n\t\t\titem.contentPosition = this.contentPosition;\n\t\t}\n\t}\n\n\tprivate _generateLinesOnce() {\n\t\tif (!this._hasSlotItems) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._generateTimeout) {\n\t\t\tclearTimeout(this._generateTimeout);\n\t\t\tthis._generateTimeout = null;\n\t\t}\n\n\t\tthis._generateTimeout = setTimeout(() => {\n\t\t\tconst items = this._el.querySelectorAll('p-stepper-item');\n\t\t\tthis._checkItems(items);\n\t\t\tthis._generateLines(items);\n\t\t\tthis._generateTimeout = null;\n\t\t});\n\t}\n\n\tprivate _generateLines(items: NodeListOf<HTMLPStepperItemElement>) {\n\t\tif (!this._el) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet activeStep = this.activeStep - 1 || 0;\n\n\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\tconst item = items.item(i) as any;\n\n\t\t\tif (i < items.length - 1) {\n\t\t\t\tlet nextItem = item.nextElementSibling;\n\n\t\t\t\tif (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-item') {\n\t\t\t\t\tconst stepperLine = document.createElement('p-stepper-line');\n\t\t\t\t\tthis._el.insertBefore(stepperLine, nextItem);\n\t\t\t\t\tthis._setLineData(stepperLine, item, nextItem, i, activeStep);\n\n\t\t\t\t\tconst previous = stepperLine.previousElementSibling;\n\t\t\t\t\tif (previous && previous.tagName.toLowerCase() === 'p-stepper-line') {\n\t\t\t\t\t\tprevious.remove();\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-line') {\n\t\t\t\t\tconst stepperLine = nextItem;\n\t\t\t\t\tnextItem = nextItem.nextElementSibling;\n\n\t\t\t\t\tif (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-item') {\n\t\t\t\t\t\tthis._setLineData(stepperLine, item, nextItem, i, activeStep);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (i > 0) {\n\t\t\t\tconst previousItem = item.previousElementSibling;\n\t\t\t\tif (\n\t\t\t\t\tpreviousItem &&\n\t\t\t\t\tpreviousItem.tagName.toLowerCase() === 'p-stepper-line'\n\t\t\t\t) {\n\t\t\t\t\tpreviousItem.direction = this.direction;\n\t\t\t\t\tpreviousItem.active = item.active || item.finished;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst lines = this._el.querySelectorAll(\n\t\t\t'p-stepper-line:not(:has(+ p-stepper-item)), p-stepper-line:first-child'\n\t\t);\n\t\tfor (let j = lines.length - 1; j >= 0; j--) {\n\t\t\tconst line = lines.item(j);\n\t\t\tline.remove();\n\t\t}\n\n\t\tif (!this._generatedOnce) {\n\t\t\tsetTimeout(() => (this._generatedOnce = true), 0);\n\t\t}\n\t}\n\n\tprivate _setLineData(\n\t\tstepperLine: HTMLPStepperLineElement,\n\t\titem: HTMLPStepperItemElement,\n\t\tnextItem: HTMLPStepperItemElement,\n\t\ti: number,\n\t\tactiveStep: number\n\t) {\n\t\tlet heightDiff = item.clientHeight - 24;\n\t\tlet heightDiffNext = nextItem.clientHeight - 24;\n\n\t\tif (this.align === 'center') {\n\t\t\theightDiff = heightDiff / 2;\n\t\t\theightDiffNext = heightDiffNext / 2;\n\t\t}\n\n\t\tstepperLine.direction = this.direction;\n\t\tstepperLine.active = i < activeStep;\n\n\t\tif (heightDiff > 0 && this.direction === 'vertical') {\n\t\t\tlet totalHeight = 0;\n\n\t\t\tstepperLine.style.marginTop = '0';\n\t\t\tstepperLine.style.marginBottom = '0';\n\n\t\t\tif (this.align === 'start' || this.align === 'center') {\n\t\t\t\tstepperLine.style.marginTop = `-${heightDiff / 16}rem`;\n\t\t\t\ttotalHeight += heightDiff;\n\t\t\t}\n\n\t\t\tif (this.align === 'center' || this.align === 'end') {\n\t\t\t\tstepperLine.style.marginBottom = `-${heightDiffNext / 16}rem`;\n\t\t\t\ttotalHeight += heightDiffNext;\n\t\t\t}\n\n\t\t\tstepperLine.style.minHeight = `calc(${totalHeight / 16}rem)`;\n\t\t}\n\t}\n}\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as cva } from './
|
|
3
|
-
import { a as asBoolean } from './
|
|
4
|
-
import './clsx-ChV9xqsO.js';
|
|
1
|
+
import { p as proxyCustomElement, H, h } from './p-tdjn65Lz.js';
|
|
2
|
+
import { c as cva } from './p-CBWjHURv.js';
|
|
3
|
+
import { a as asBoolean } from './p-C5CTp9IA.js';
|
|
5
4
|
|
|
6
5
|
const stepperItemComponentCss = "*{box-sizing:border-box}.static{position:static!important}.mt-\\[1px\\]{margin-top:1px!important}.flex{display:flex!important}.h-6{height:1.5rem!important}.w-6{width:1.5rem!important}.flex-1{flex:1 1 0%!important}.flex-row-reverse{flex-direction:row-reverse!important}.items-start{align-items:flex-start!important}.items-end{align-items:flex-end!important}.items-center{align-items:center!important}.justify-center{justify-content:center!important}.gap-2{gap:.5rem!important}.rounded-full{border-radius:9999px!important}.border{border-width:1px!important}.border-solid{border-style:solid!important}.border-dark-teal-400{--tw-border-opacity:1!important;border-color:rgb(51 116 109/var(--tw-border-opacity,1))!important}.bg-dark-teal-400{--tw-bg-opacity:1!important;background-color:rgb(51 116 109/var(--tw-bg-opacity,1))!important}.bg-dark-teal-50{--tw-bg-opacity:1!important;background-color:rgb(229 238 237/var(--tw-bg-opacity,1))!important}.text-center{text-align:center!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.font-medium{font-weight:500!important}.text-black-teal-400{--tw-text-opacity:1!important;color:rgb(53 85 80/var(--tw-text-opacity,1))!important}.text-black-teal-500{--tw-text-opacity:1!important;color:rgb(3 42 36/var(--tw-text-opacity,1))!important}.text-dark-teal-400{--tw-text-opacity:1!important;color:rgb(51 116 109/var(--tw-text-opacity,1))!important}.text-white{--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}";
|
|
7
6
|
|
|
@@ -81,9 +80,11 @@ const content = cva('text-sm font-medium flex-1 mt-[1px]', {
|
|
|
81
80
|
},
|
|
82
81
|
],
|
|
83
82
|
});
|
|
84
|
-
const StepperItem = class {
|
|
85
|
-
constructor(
|
|
86
|
-
|
|
83
|
+
const StepperItem = /*@__PURE__*/ proxyCustomElement(class StepperItem extends H {
|
|
84
|
+
constructor() {
|
|
85
|
+
super();
|
|
86
|
+
this.__registerHost();
|
|
87
|
+
this.__attachShadow();
|
|
87
88
|
}
|
|
88
89
|
/**
|
|
89
90
|
* The number of the step
|
|
@@ -117,10 +118,30 @@ const StepperItem = class {
|
|
|
117
118
|
finished: asBoolean(this.finished),
|
|
118
119
|
}) }, h("slot", { key: 'd1a37d6d005c8666c9763ac5e804352f759447ca' }))));
|
|
119
120
|
}
|
|
120
|
-
}
|
|
121
|
-
|
|
121
|
+
static get style() { return stepperItemComponentCss; }
|
|
122
|
+
}, [1, "p-stepper-item", {
|
|
123
|
+
"number": [2],
|
|
124
|
+
"align": [1],
|
|
125
|
+
"contentPosition": [1, "content-position"],
|
|
126
|
+
"finished": [4],
|
|
127
|
+
"active": [4]
|
|
128
|
+
}]);
|
|
129
|
+
function defineCustomElement() {
|
|
130
|
+
if (typeof customElements === "undefined") {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
const components = ["p-stepper-item"];
|
|
134
|
+
components.forEach(tagName => { switch (tagName) {
|
|
135
|
+
case "p-stepper-item":
|
|
136
|
+
if (!customElements.get(tagName)) {
|
|
137
|
+
customElements.define(tagName, StepperItem);
|
|
138
|
+
}
|
|
139
|
+
break;
|
|
140
|
+
} });
|
|
141
|
+
}
|
|
142
|
+
defineCustomElement();
|
|
122
143
|
|
|
123
|
-
export { StepperItem as
|
|
124
|
-
//# sourceMappingURL=p-
|
|
144
|
+
export { StepperItem as S, defineCustomElement as d };
|
|
145
|
+
//# sourceMappingURL=p-C9Hyi74u.js.map
|
|
125
146
|
|
|
126
|
-
//# sourceMappingURL=p-
|
|
147
|
+
//# sourceMappingURL=p-C9Hyi74u.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-C9Hyi74u.js","mappings":";;;;AAAA,MAAM,uBAAuB,GAAG,q+CAAq+C;;ACIrgD,MAAM,IAAI,GAAG,GAAG,CAAC,YAAY,EAAE;AAC9B,IAAA,QAAQ,EAAE;AACT,QAAA,KAAK,EAAE;AACN,YAAA,KAAK,EAAE,aAAa;AACpB,YAAA,MAAM,EAAE,cAAc;AACtB,YAAA,GAAG,EAAE,WAAW;AAChB,SAAA;AACD,QAAA,eAAe,EAAE;AAChB,YAAA,KAAK,EAAE,kBAAkB;AACzB,YAAA,GAAG,EAAE,IAAI;AACT,SAAA;AACD,KAAA;AACD,CAAA,CAAC;AAEF,MAAM,MAAM,GAAG,GAAG,CACjB;IACC,0CAA0C;IAC1C,iCAAiC;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p-stepper-item&encapsulation=shadow","src/components/atoms/stepper/item/stepper-item.component.tsx"],"sourcesContent":["","import { Component, h, Prop } from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport { asBoolean } from '../../../../utils/as-boolean';\n\nconst item = cva('flex gap-2', {\n\tvariants: {\n\t\talign: {\n\t\t\tstart: 'items-start',\n\t\t\tcenter: 'items-center',\n\t\t\tend: 'items-end',\n\t\t},\n\t\tcontentPosition: {\n\t\t\tstart: 'flex-row-reverse',\n\t\t\tend: null,\n\t\t},\n\t},\n});\n\nconst circle = cva(\n\t[\n\t\t'h-6 w-6 flex items-center justify-center',\n\t\t'text-sm text-center font-medium',\n\t\t'border border-solid border-dark-teal-400',\n\t\t'rounded-full',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tfinished: {\n\t\t\t\ttrue: null,\n\t\t\t\tfalse: null,\n\t\t\t},\n\t\t\tactive: {\n\t\t\t\ttrue: null,\n\t\t\t\tfalse: null,\n\t\t\t},\n\t\t},\n\t\tcompoundVariants: [\n\t\t\t{\n\t\t\t\tfinished: false,\n\t\t\t\tactive: false,\n\t\t\t\tclass: 'text-dark-teal-400 bg-dark-teal-50',\n\t\t\t},\n\t\t\t{\n\t\t\t\tactive: true,\n\t\t\t\tfinished: false,\n\t\t\t\tclass: 'text-white bg-dark-teal-400',\n\t\t\t},\n\t\t\t{\n\t\t\t\tactive: false,\n\t\t\t\tfinished: true,\n\t\t\t\tclass: 'text-white bg-dark-teal-400',\n\t\t\t},\n\t\t],\n\t}\n);\n\nconst content = cva('text-sm font-medium flex-1 mt-[1px]', {\n\tvariants: {\n\t\tfinished: {\n\t\t\ttrue: null,\n\t\t\tfalse: null,\n\t\t},\n\t\tactive: {\n\t\t\ttrue: null,\n\t\t\tfalse: null,\n\t\t},\n\t},\n\tcompoundVariants: [\n\t\t{\n\t\t\tfinished: false,\n\t\t\tactive: false,\n\t\t\tclass: 'text-black-teal-400',\n\t\t},\n\t\t{\n\t\t\tactive: true,\n\t\t\tfinished: false,\n\t\t\tclass: 'text-black-teal-500',\n\t\t},\n\t\t{\n\t\t\tactive: false,\n\t\t\tfinished: true,\n\t\t\tclass: 'text-black-teal-500',\n\t\t},\n\t],\n});\n\n@Component({\n\ttag: 'p-stepper-item',\n\tstyleUrl: 'stepper-item.component.css',\n\tshadow: true,\n})\nexport class StepperItem {\n\t/**\n\t * The number of the step\n\t */\n\t@Prop() number: number = 1;\n\n\t/**\n\t * The alignment of the content in case of vertical direction\n\t */\n\t@Prop() align: 'start' | 'center' | 'end' = 'center';\n\n\t/**\n\t * The position of the content in case of vertical direction\n\t */\n\t@Prop() contentPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * Wether the step is finished\n\t */\n\t@Prop() finished: boolean = false;\n\n\t/**\n\t * Wether the step is active\n\t */\n\t@Prop() active: boolean = false;\n\n\trender() {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclass={item({\n\t\t\t\t\talign: this.align,\n\t\t\t\t\tcontentPosition: this.contentPosition,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tclass={circle({\n\t\t\t\t\t\tactive: asBoolean(this.active),\n\t\t\t\t\t\tfinished: asBoolean(this.finished),\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t{this.number}\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\tclass={content({\n\t\t\t\t\t\tactive: asBoolean(this.active),\n\t\t\t\t\t\tfinished: asBoolean(this.finished),\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t<slot />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n}\n"],"version":3}
|
|
@@ -1,145 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as cva } from './p-CBWjHURv.js';
|
|
3
|
-
import { a as asBoolean } from './p-C5CTp9IA.js';
|
|
4
|
-
|
|
5
|
-
const stepperItemComponentCss = "*{box-sizing:border-box}.static{position:static!important}.mt-\\[1px\\]{margin-top:1px!important}.flex{display:flex!important}.h-6{height:1.5rem!important}.w-6{width:1.5rem!important}.flex-1{flex:1 1 0%!important}.flex-row-reverse{flex-direction:row-reverse!important}.items-start{align-items:flex-start!important}.items-end{align-items:flex-end!important}.items-center{align-items:center!important}.justify-center{justify-content:center!important}.gap-2{gap:.5rem!important}.rounded-full{border-radius:9999px!important}.border{border-width:1px!important}.border-solid{border-style:solid!important}.border-dark-teal-400{--tw-border-opacity:1!important;border-color:rgb(51 116 109/var(--tw-border-opacity,1))!important}.bg-dark-teal-400{--tw-bg-opacity:1!important;background-color:rgb(51 116 109/var(--tw-bg-opacity,1))!important}.bg-dark-teal-50{--tw-bg-opacity:1!important;background-color:rgb(229 238 237/var(--tw-bg-opacity,1))!important}.text-center{text-align:center!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.font-medium{font-weight:500!important}.text-black-teal-400{--tw-text-opacity:1!important;color:rgb(53 85 80/var(--tw-text-opacity,1))!important}.text-black-teal-500{--tw-text-opacity:1!important;color:rgb(3 42 36/var(--tw-text-opacity,1))!important}.text-dark-teal-400{--tw-text-opacity:1!important;color:rgb(51 116 109/var(--tw-text-opacity,1))!important}.text-white{--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}";
|
|
6
|
-
|
|
7
|
-
const item = cva('flex gap-2', {
|
|
8
|
-
variants: {
|
|
9
|
-
align: {
|
|
10
|
-
start: 'items-start',
|
|
11
|
-
center: 'items-center',
|
|
12
|
-
end: 'items-end',
|
|
13
|
-
},
|
|
14
|
-
contentPosition: {
|
|
15
|
-
start: 'flex-row-reverse',
|
|
16
|
-
end: null,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
const circle = cva([
|
|
21
|
-
'h-6 w-6 flex items-center justify-center',
|
|
22
|
-
'text-sm text-center font-medium',
|
|
23
|
-
'border border-solid border-dark-teal-400',
|
|
24
|
-
'rounded-full',
|
|
25
|
-
], {
|
|
26
|
-
variants: {
|
|
27
|
-
finished: {
|
|
28
|
-
true: null,
|
|
29
|
-
false: null,
|
|
30
|
-
},
|
|
31
|
-
active: {
|
|
32
|
-
true: null,
|
|
33
|
-
false: null,
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
compoundVariants: [
|
|
37
|
-
{
|
|
38
|
-
finished: false,
|
|
39
|
-
active: false,
|
|
40
|
-
class: 'text-dark-teal-400 bg-dark-teal-50',
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
active: true,
|
|
44
|
-
finished: false,
|
|
45
|
-
class: 'text-white bg-dark-teal-400',
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
active: false,
|
|
49
|
-
finished: true,
|
|
50
|
-
class: 'text-white bg-dark-teal-400',
|
|
51
|
-
},
|
|
52
|
-
],
|
|
53
|
-
});
|
|
54
|
-
const content = cva('text-sm font-medium flex-1 mt-[1px]', {
|
|
55
|
-
variants: {
|
|
56
|
-
finished: {
|
|
57
|
-
true: null,
|
|
58
|
-
false: null,
|
|
59
|
-
},
|
|
60
|
-
active: {
|
|
61
|
-
true: null,
|
|
62
|
-
false: null,
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
compoundVariants: [
|
|
66
|
-
{
|
|
67
|
-
finished: false,
|
|
68
|
-
active: false,
|
|
69
|
-
class: 'text-black-teal-400',
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
active: true,
|
|
73
|
-
finished: false,
|
|
74
|
-
class: 'text-black-teal-500',
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
active: false,
|
|
78
|
-
finished: true,
|
|
79
|
-
class: 'text-black-teal-500',
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
});
|
|
83
|
-
const StepperItem = /*@__PURE__*/ proxyCustomElement(class StepperItem extends H {
|
|
84
|
-
constructor() {
|
|
85
|
-
super();
|
|
86
|
-
this.__registerHost();
|
|
87
|
-
this.__attachShadow();
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* The number of the step
|
|
91
|
-
*/
|
|
92
|
-
number = 1;
|
|
93
|
-
/**
|
|
94
|
-
* The alignment of the content in case of vertical direction
|
|
95
|
-
*/
|
|
96
|
-
align = 'center';
|
|
97
|
-
/**
|
|
98
|
-
* The position of the content in case of vertical direction
|
|
99
|
-
*/
|
|
100
|
-
contentPosition = 'end';
|
|
101
|
-
/**
|
|
102
|
-
* Wether the step is finished
|
|
103
|
-
*/
|
|
104
|
-
finished = false;
|
|
105
|
-
/**
|
|
106
|
-
* Wether the step is active
|
|
107
|
-
*/
|
|
108
|
-
active = false;
|
|
109
|
-
render() {
|
|
110
|
-
return (h("div", { key: '46db52b42cff8898eb2f537d47708ba768929048', class: item({
|
|
111
|
-
align: this.align,
|
|
112
|
-
contentPosition: this.contentPosition,
|
|
113
|
-
}) }, h("div", { key: '72a63859b7ebb91e5f08c20956f0abcfc84bbaf6', class: circle({
|
|
114
|
-
active: asBoolean(this.active),
|
|
115
|
-
finished: asBoolean(this.finished),
|
|
116
|
-
}) }, this.number), h("div", { key: '1c836c89f03e5a91de235ba2542954a9dd455fb9', class: content({
|
|
117
|
-
active: asBoolean(this.active),
|
|
118
|
-
finished: asBoolean(this.finished),
|
|
119
|
-
}) }, h("slot", { key: 'd1a37d6d005c8666c9763ac5e804352f759447ca' }))));
|
|
120
|
-
}
|
|
121
|
-
static get style() { return stepperItemComponentCss; }
|
|
122
|
-
}, [1, "p-stepper-item", {
|
|
123
|
-
"number": [2],
|
|
124
|
-
"align": [1],
|
|
125
|
-
"contentPosition": [1, "content-position"],
|
|
126
|
-
"finished": [4],
|
|
127
|
-
"active": [4]
|
|
128
|
-
}]);
|
|
129
|
-
function defineCustomElement$1() {
|
|
130
|
-
if (typeof customElements === "undefined") {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
const components = ["p-stepper-item"];
|
|
134
|
-
components.forEach(tagName => { switch (tagName) {
|
|
135
|
-
case "p-stepper-item":
|
|
136
|
-
if (!customElements.get(tagName)) {
|
|
137
|
-
customElements.define(tagName, StepperItem);
|
|
138
|
-
}
|
|
139
|
-
break;
|
|
140
|
-
} });
|
|
141
|
-
}
|
|
142
|
-
defineCustomElement$1();
|
|
1
|
+
import { S as StepperItem, d as defineCustomElement$1 } from './p-C9Hyi74u.js';
|
|
143
2
|
|
|
144
3
|
const PStepperItem = StepperItem;
|
|
145
4
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-stepper-item.js","mappings":"
|
|
1
|
+
{"file":"p-stepper-item.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|