@paperless/core 2.4.1 → 2.4.3
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 +22 -0
- package/dist/{paperless/p-23d7b822.entry.js → build/p-6fdd90eb.entry.js} +2 -2
- package/dist/{paperless/p-23d7b822.entry.js.map → build/p-6fdd90eb.entry.js.map} +1 -1
- package/dist/build/p-7b6decaa.entry.js +2 -0
- package/dist/build/p-7b6decaa.entry.js.map +1 -0
- package/dist/build/{p-83b41328.js → p-b152938d.js} +1 -1
- package/dist/build/p-content-slider.entry.esm.js.map +1 -1
- package/dist/build/p-dc21ccd3.entry.js +2 -0
- package/dist/build/{p-8cc79846.entry.js.map → p-dc21ccd3.entry.js.map} +1 -1
- package/dist/build/p-stepper-item.p-stepper-line.entry.esm.js.map +1 -1
- package/dist/build/p-stepper.entry.esm.js.map +1 -1
- package/dist/build/paperless.esm.js +1 -1
- package/dist/cjs/p-content-slider.cjs.entry.js +1 -1
- package/dist/cjs/p-content-slider.cjs.entry.js.map +1 -1
- package/dist/cjs/p-content-slider.entry.cjs.js.map +1 -1
- package/dist/cjs/p-stepper-item.p-stepper-line.entry.cjs.js.map +1 -1
- package/dist/cjs/p-stepper-item_2.cjs.entry.js +3 -3
- package/dist/cjs/p-stepper-item_2.cjs.entry.js.map +1 -1
- package/dist/cjs/p-stepper.cjs.entry.js +4 -4
- package/dist/cjs/p-stepper.cjs.entry.js.map +1 -1
- package/dist/cjs/p-stepper.entry.cjs.js.map +1 -1
- package/dist/collection/components/atoms/stepper/item/stepper-item.component.css +1 -1
- package/dist/collection/components/atoms/stepper/item/stepper-item.component.js +2 -2
- package/dist/collection/components/atoms/stepper/item/stepper-item.component.js.map +1 -1
- package/dist/collection/components/molecules/content-slider/content-slider.component.css +1 -1
- package/dist/collection/components/organisms/stepper/stepper.component.js +4 -4
- package/dist/collection/components/organisms/stepper/stepper.component.js.map +1 -1
- package/dist/components/{p-DsyVC2xP.js → p-D3EM8Uiq.js} +5 -5
- package/dist/components/{p-DsyVC2xP.js.map → p-D3EM8Uiq.js.map} +1 -1
- package/dist/components/p-content-slider.js +1 -1
- package/dist/components/p-content-slider.js.map +1 -1
- package/dist/components/p-stepper-item.js +1 -1
- package/dist/components/p-stepper.js +5 -5
- package/dist/components/p-stepper.js.map +1 -1
- package/dist/esm/p-content-slider.entry.js +1 -1
- package/dist/esm/p-content-slider.entry.js.map +1 -1
- package/dist/esm/p-stepper-item.p-stepper-line.entry.js.map +1 -1
- package/dist/esm/p-stepper-item_2.entry.js +3 -3
- package/dist/esm/p-stepper-item_2.entry.js.map +1 -1
- package/dist/esm/p-stepper.entry.js +4 -4
- package/dist/esm/p-stepper.entry.js.map +1 -1
- package/dist/index.html +1 -1
- package/dist/{build/p-23d7b822.entry.js → paperless/p-6fdd90eb.entry.js} +2 -2
- package/dist/{build/p-23d7b822.entry.js.map → paperless/p-6fdd90eb.entry.js.map} +1 -1
- package/dist/paperless/p-7b6decaa.entry.js +2 -0
- package/dist/paperless/p-7b6decaa.entry.js.map +1 -0
- package/dist/paperless/p-content-slider.entry.esm.js.map +1 -1
- package/dist/paperless/p-dc21ccd3.entry.js +2 -0
- package/dist/paperless/{p-8cc79846.entry.js.map → p-dc21ccd3.entry.js.map} +1 -1
- package/dist/paperless/p-stepper-item.p-stepper-line.entry.esm.js.map +1 -1
- 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/package.json +1 -1
- package/dist/build/p-0fd02345.entry.js +0 -2
- package/dist/build/p-0fd02345.entry.js.map +0 -1
- package/dist/build/p-8cc79846.entry.js +0 -2
- package/dist/paperless/p-0fd02345.entry.js +0 -2
- package/dist/paperless/p-0fd02345.entry.js.map +0 -1
- package/dist/paperless/p-8cc79846.entry.js +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, F as Fragment } from './p-tdjn65Lz.js';
|
|
2
2
|
import { c as cva } from './p-CBWjHURv.js';
|
|
3
|
-
import { d as defineCustomElement$3 } from './p-
|
|
3
|
+
import { d as defineCustomElement$3 } from './p-D3EM8Uiq.js';
|
|
4
4
|
import { d as defineCustomElement$2 } from './p-C4WDKcUV.js';
|
|
5
5
|
|
|
6
6
|
const stepperComponentCss = "*{box-sizing:border-box}.static{position:static!important}.flex{display:flex!important}.h-auto{height:auto!important}.w-full{width:100%!important}.flex-col{flex-direction:column!important}.flex-wrap{flex-wrap:wrap!important}.items-center{align-items:center!important}.gap-2{gap:.5rem!important}.opacity-0{opacity:0!important}.opacity-100{opacity:1!important}";
|
|
@@ -205,17 +205,17 @@ const Stepper = /*@__PURE__*/ proxyCustomElement(class Stepper extends H {
|
|
|
205
205
|
stepperLine.style.marginTop = '0';
|
|
206
206
|
stepperLine.style.marginBottom = '0';
|
|
207
207
|
if (this.align === 'start' || this.align === 'center') {
|
|
208
|
-
stepperLine.style.marginTop = `-${heightDiff / 16 - (this.align === 'start' ? 1.
|
|
208
|
+
stepperLine.style.marginTop = `-${heightDiff / 16 - (this.align === 'start' ? 1.5 : 0)}rem`;
|
|
209
209
|
totalHeight += heightDiff - (this.align === 'start' ? 8 : 0);
|
|
210
210
|
if (this.align === 'start') {
|
|
211
|
-
stepperLine.style.marginBottom = `-
|
|
211
|
+
stepperLine.style.marginBottom = `-1rem`;
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
if (this.align === 'center' || this.align === 'end') {
|
|
215
|
-
stepperLine.style.marginBottom = `-${heightDiffNext / 16 - (this.align === 'end' ? 1.
|
|
215
|
+
stepperLine.style.marginBottom = `-${heightDiffNext / 16 - (this.align === 'end' ? 1.5 : 0)}rem`;
|
|
216
216
|
totalHeight += heightDiffNext - (this.align === 'end' ? 8 : 0);
|
|
217
217
|
if (this.align === 'end') {
|
|
218
|
-
stepperLine.style.marginTop = `-
|
|
218
|
+
stepperLine.style.marginTop = `-1rem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QAAQ,WAAW,GAAG,EAAE,CAAA,IAAA,CAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/organisms/stepper/stepper.component.css?tag=p-stepper&encapsulation=shadow","src/components/organisms/stepper/stepper.component.tsx"],"sourcesContent":["","import {\n\tComponent,\n\tElement,\n\tFragment,\n\th,\n\tProp,\n\tState,\n\tWatch,\n} from '@stencil/core';\nimport { cva } 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 _containerRef: HTMLDivElement;\n\tprivate _resizeObserver: ResizeObserver;\n\n\tprivate _hasSlotItems = false;\n\n\tcomponentDidLoad() {\n\t\tthis._hasSlotItems = !!this._el.querySelector(':scope > *');\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\tref={ref => this._setContainerRef(ref)}\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\tref={ref => this._setContainerRef(ref)}\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 _setContainerRef(ref: HTMLDivElement) {\n\t\tthis._containerRef = ref;\n\n\t\tif (this._resizeObserver) {\n\t\t\tthis._resizeObserver.disconnect();\n\t\t}\n\n\t\tthis._resizeObserver = new ResizeObserver(() => this._generateLinesOnce());\n\t\tthis._resizeObserver.observe(this._containerRef);\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.direction = this.direction;\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}, 50);\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\tthis._generatedOnce = true;\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 = `-${\n\t\t\t\t\theightDiff / 16 - (this.align === 'start' ? 1.25 : 0)\n\t\t\t\t}rem`;\n\t\t\t\ttotalHeight += heightDiff - (this.align === 'start' ? 8 : 0);\n\n\t\t\t\tif (this.align === 'start') {\n\t\t\t\t\tstepperLine.style.marginBottom = `-0.75rem`;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.align === 'center' || this.align === 'end') {\n\t\t\t\tstepperLine.style.marginBottom = `-${\n\t\t\t\t\theightDiffNext / 16 - (this.align === 'end' ? 1.25 : 0)\n\t\t\t\t}rem`;\n\t\t\t\ttotalHeight += heightDiffNext - (this.align === 'end' ? 8 : 0);\n\n\t\t\t\tif (this.align === 'end') {\n\t\t\t\t\tstepperLine.style.marginTop = `-0.75rem`;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstepperLine.style.minHeight = `calc(${totalHeight / 16}rem)`;\n\t\t}\n\t}\n}\n"],"version":3}
|
|
1
|
+
{"file":"p-stepper.js","mappings":";;;;;AAAA,MAAM,mBAAmB,GAAG,wWAAwW;;ACiBpY,MAAM,OAAO,GAAG,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE;AACnC,IAAA,QAAQ,EAAE;AACT,QAAA,SAAS,EAAE;AACV,YAAA,QAAQ,EAAE,2BAA2B;AACrC,YAAA,UAAU,EAAE,qBAAqB;AACjC,SAAA;AACD,QAAA,aAAa,EAAE;AACd,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,KAAK,EAAE,WAAW;AAClB,SAAA;AACD,KAAA;AACD,CAAA,CAAC;MAOW,OAAO,iBAAAA,kBAAA,CAAA,MAAA,OAAA,SAAAC,CAAA,CAAA;;;;;;AACnB;;AAEG;AACK,IAAA,KAAK;AAEb;;AAEG;IACK,UAAU,GAAW,CAAC;AAE9B;;AAEG;IACK,gBAAgB,GAAY,IAAI;AAExC;;AAEG;IACK,SAAS,GAA8B,YAAY;AAE3D;;AAEG;IACK,KAAK,GAA+B,QAAQ;AAEpD;;AAEG;IACK,eAAe,GAAoB,KAAK;;IAO/B,cAAc,GAAG,KAAK;IACtB,OAAO,GAAG,KAAK;AAExB,IAAA,gBAAgB;AAChB,IAAA,aAAa;AACb,IAAA,eAAe;IAEf,aAAa,GAAG,KAAK;IAE7B,gBAAg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AAK,GAAG,GAAG,GAAG,CAAC,CACtD,CAAA,GAAA,CAAK;AACL,gBAAA,WAAW,IAAI,cAAc,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC;AAE9D,gBAAA,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,EAAE;AACzB,oBAAA,WAAW,CAAC,KAAK,CAAC,SAAS,GAAG,OAAO;;;YAIvC,WAAW,CAAC,KAAK,CAAC,SAAS,GAAG,QAAQ,WAAW,GAAG,EAAE,CAAA,IAAA,CAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/organisms/stepper/stepper.component.css?tag=p-stepper&encapsulation=shadow","src/components/organisms/stepper/stepper.component.tsx"],"sourcesContent":["","import {\n\tComponent,\n\tElement,\n\tFragment,\n\th,\n\tProp,\n\tState,\n\tWatch,\n} from '@stencil/core';\nimport { cva } 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 _containerRef: HTMLDivElement;\n\tprivate _resizeObserver: ResizeObserver;\n\n\tprivate _hasSlotItems = false;\n\n\tcomponentDidLoad() {\n\t\tthis._hasSlotItems = !!this._el.querySelector(':scope > *');\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\tref={ref => this._setContainerRef(ref)}\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\tref={ref => this._setContainerRef(ref)}\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 _setContainerRef(ref: HTMLDivElement) {\n\t\tthis._containerRef = ref;\n\n\t\tif (this._resizeObserver) {\n\t\t\tthis._resizeObserver.disconnect();\n\t\t}\n\n\t\tthis._resizeObserver = new ResizeObserver(() => this._generateLinesOnce());\n\t\tthis._resizeObserver.observe(this._containerRef);\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.direction = this.direction;\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}, 50);\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\tthis._generatedOnce = true;\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 = `-${\n\t\t\t\t\theightDiff / 16 - (this.align === 'start' ? 1.5 : 0)\n\t\t\t\t}rem`;\n\t\t\t\ttotalHeight += heightDiff - (this.align === 'start' ? 8 : 0);\n\n\t\t\t\tif (this.align === 'start') {\n\t\t\t\t\tstepperLine.style.marginBottom = `-1rem`;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.align === 'center' || this.align === 'end') {\n\t\t\t\tstepperLine.style.marginBottom = `-${\n\t\t\t\t\theightDiffNext / 16 - (this.align === 'end' ? 1.5 : 0)\n\t\t\t\t}rem`;\n\t\t\t\ttotalHeight += heightDiffNext - (this.align === 'end' ? 8 : 0);\n\n\t\t\t\tif (this.align === 'end') {\n\t\t\t\t\tstepperLine.style.marginTop = `-1rem`;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstepperLine.style.minHeight = `calc(${totalHeight / 16}rem)`;\n\t\t}\n\t}\n}\n"],"version":3}
|
|
@@ -2,7 +2,7 @@ import { r as registerInstance, g as getElement, h, H as Host } from './index-Dh
|
|
|
2
2
|
import { c as cn } from './cn-BniKgfyU.js';
|
|
3
3
|
import './clsx-ChV9xqsO.js';
|
|
4
4
|
|
|
5
|
-
const contentSliderComponentCss = ".absolute{position:absolute!important}.relative{position:relative!important}.mt-3{margin-top:.75rem!important}.flex{display:flex!important}.w-0{width:0!important}.w-full{width:100%!important}.
|
|
5
|
+
const contentSliderComponentCss = ".absolute{position:absolute!important}.relative{position:relative!important}.z-10{z-index:10!important}.-mx-16{margin-left:-4rem!important;margin-right:-4rem!important}.mt-3{margin-top:.75rem!important}.box-content{box-sizing:content-box!important}.flex{display:flex!important}.w-0{width:0!important}.w-full{width:100%!important}.translate-x-0{--tw-translate-x:0px!important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.transform-gpu{transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.cursor-grab{cursor:grab!important}.cursor-grabbing{cursor:grabbing!important}.flex-col{flex-direction:column!important}.flex-nowrap{flex-wrap:nowrap!important}.items-center{align-items:center!important}.items-stretch{align-items:stretch!important}.justify-center{justify-content:center!important}.px-1{padding-left:.25rem!important;padding-right:.25rem!important}*{box-sizing:border-box}:host{display:flex;flex-direction:column;margin-left:-4rem;margin-right:-4rem;overflow:hidden;padding-left:4rem;padding-right:4rem}:host .slider{box-sizing:content-box;overflow:visible;position:relative}:host .slider.draggable{cursor:grab}@media (min-width:64rem){:host .slider.draggable{cursor:auto}}:host .slider.draggable.dragging{cursor:grabbing}@media (min-width:64rem){:host .slider.draggable.dragging{cursor:auto}}:host .slider.draggable.dragging .inner-slider{transition-property:none}:host .slider .inner-slider{--tw-translate-x:0px;align-items:stretch;display:flex;flex-wrap:nowrap;gap:.5rem;position:absolute;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transition-duration:.15s;transition-duration:.5s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);width:100%;will-change:transform}@media (min-width:64rem){:host .slider .inner-slider{flex-wrap:wrap;gap:1rem}}:host .slider .inner-slider>::slotted(*){flex-shrink:0;position:relative;width:100%;z-index:10}@media (min-width:40rem){:host .slider .inner-slider>::slotted(*){width:calc(50% - .5rem)}}@media (min-width:64rem){:host .slider .inner-slider>::slotted(*){flex:1 1 0%;width:0}}:host .indicator{align-items:center;display:flex;justify-content:center}@media (min-width:64rem){:host .indicator{display:none}}:host .indicator .item{margin-top:.75rem;padding-left:.25rem;padding-right:.25rem;padding-top:.25rem}@media (min-width:64rem){.desktop-xs\\:hidden{display:none!important}.desktop-xs\\:flex-wrap{flex-wrap:wrap!important}}.visible{visibility:visible!important}.static{position:static!important}.block{display:block!important}.hidden{display:none!important}.h-2{height:.5rem!important}.w-2{width:.5rem!important}.cursor-pointer{cursor:pointer!important}.resize{resize:both!important}.rounded-full{border-radius:9999px!important}.bg-indigo-300{--tw-bg-opacity:1!important;background-color:rgb(187 209 253/var(--tw-bg-opacity,1))!important}.bg-indigo-600{--tw-bg-opacity:1!important;background-color:rgb(82 138 250/var(--tw-bg-opacity,1))!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}";
|
|
6
6
|
|
|
7
7
|
const ContentSlider = class {
|
|
8
8
|
constructor(hostRef) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-content-slider.entry.js","sources":["src/components/molecules/content-slider/content-slider.component.scss?tag=p-content-slider&encapsulation=shadow","src/components/molecules/content-slider/content-slider.component.tsx"],"sourcesContent":[":host {\n\t@apply flex flex-col overflow-hidden;\n\n\t@apply p-16 -m-16;\n\n\t.slider {\n\t\t@apply overflow-visible relative box-content;\n\n\t\t&.draggable {\n\t\t\t@apply cursor-grab desktop-xs:cursor-auto;\n\n\t\t\t&.dragging {\n\t\t\t\t@apply cursor-grabbing desktop-xs:cursor-auto;\n\n\t\t\t\t.inner-slider {\n\t\t\t\t\t@apply transition-none;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t.inner-slider {\n\t\t\t@apply absolute flex flex-nowrap items-stretch w-full gap-2;\n\n\t\t\t@apply will-change-transform transform-gpu translate-x-0;\n\n\t\t\t@apply desktop-xs:gap-4 desktop-xs:flex-wrap;\n\n\t\t\t@apply transition-all;\n\t\t\ttransition-duration: 0.5s;\n\n\t\t\t> ::slotted(*) {\n\t\t\t\t@apply w-full;\n\t\t\t\t@apply flex-shrink-0 z-10;\n\n\t\t\t\t@screen tablet {\n\t\t\t\t\twidth: calc(50% - 0.5rem);\n\t\t\t\t}\n\n\t\t\t\t@screen desktop-xs {\n\t\t\t\t\t@apply w-0 flex-1;\n\t\t\t\t}\n\n\t\t\t\tposition: relative;\n\t\t\t}\n\t\t}\n\t}\n\n\t.indicator {\n\t\t@apply flex justify-center items-center desktop-xs:hidden;\n\n\t\t.item {\n\t\t\t@apply mt-3 pt-1 px-1;\n\t\t}\n\t}\n}\n","import {\n\tComponent,\n\tElement,\n\th,\n\tHost,\n\tListen,\n\tProp,\n\tState,\n} from '@stencil/core';\nimport { cn } from '../../../utils';\n\n@Component({\n\ttag: 'p-content-slider',\n\tstyleUrl: 'content-slider.component.scss',\n\tshadow: true,\n})\nexport class ContentSlider {\n\t/**\n\t * Wether to hide the indicator on mobile\n\t */\n\t@Prop() hideMobileIndicator: boolean = false;\n\n\t/**\n\t * Wether to disable dragging the content\n\t */\n\t@Prop() disableDrag: boolean = false;\n\n\t/**\n\t * Wether to disable auto centering the content\n\t */\n\t@Prop() disableAutoCenter: boolean = false;\n\n\t/**\n\t * Wether to disable clicking the indicator scrolls content\n\t */\n\t@Prop() disableIndicatorClick: boolean = false;\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _visibleIndex: number;\n\t@State() private _outerHeight = 0;\n\t@State() private _totalWidth = 0;\n\tprivate _sliderRef: HTMLElement;\n\tprivate _innerSliderRef: HTMLElement;\n\tprivate _items: HTMLElement[] = [];\n\tprivate _innerSliderResizeObserver: ResizeObserver;\n\n\t// mouse movement stuff\n\tprivate _startX: number;\n\tprivate _startMouseX: number;\n\tprivate _lastMouseX: number;\n\tprivate _lastIndex: number;\n\tprivate _shouldCheckLocation = false;\n\t@State() private _dragging = false;\n\n\tget _filteredItems() {\n\t\treturn this._items.filter(item => item.checkVisibility());\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis._innerSliderRef.style.setProperty('--tw-translate-x', `0px`);\n\t}\n\n\tdisconnectedCallback() {\n\t\tif (this._innerSliderResizeObserver) {\n\t\t\tthis._innerSliderResizeObserver.disconnect();\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class='p-content-slider'>\n\t\t\t\t<div\n\t\t\t\t\tclass={`slider ${!this.disableDrag && 'draggable'} ${\n\t\t\t\t\t\tthis._dragging && 'dragging'\n\t\t\t\t\t}`}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\theight: `${this._outerHeight}px`,\n\t\t\t\t\t}}\n\t\t\t\t\tref={el => (this._sliderRef = el)}\n\t\t\t\t\tonMouseDown={e => this._mouseDownHandler(e)}\n\t\t\t\t\tonTouchStart={e => this._mouseDownHandler(e)}\n\t\t\t\t\tonMouseMove={e => this._mouseMoveHandler(e)}\n\t\t\t\t\tonTouchMove={e => this._mouseMoveHandler(e)}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass='inner-slider'\n\t\t\t\t\t\tref={ref => this._setInnerSliderReft(ref)}\n\t\t\t\t\t\tonTransitionEnd={() => this._transitionEndHandler()}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot onSlotchange={() => this._slotChange()} />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class={`indicator ${this.hideMobileIndicator && 'hidden'}`}>\n\t\t\t\t\t{this._filteredItems.map((_, i) => (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tonClick={() => this._scrollTo(i, true)}\n\t\t\t\t\t\t\tclass={`item ${!this.disableIndicatorClick && 'cursor-pointer'}`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclass={cn('block h-2 w-2 rounded-full', {\n\t\t\t\t\t\t\t\t\t'bg-indigo-600': i === this._visibleIndex,\n\t\t\t\t\t\t\t\t\t'bg-indigo-300': i !== this._visibleIndex,\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _mouseDownHandler(e) {\n\t\tif (this.disableDrag || this._dragging) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst innerSliderStyle = getComputedStyle(this._innerSliderRef);\n\t\tif (innerSliderStyle.flexWrap === 'wrap') {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._startMouseX = e.x;\n\t\tconst sliderRect = this._sliderRef.getBoundingClientRect();\n\t\tif (e.type === 'touchstart') {\n\t\t\tthis._startMouseX = e.touches?.[0].clientX;\n\t\t}\n\n\t\tconst innerSliderRect = this._innerSliderRef.getBoundingClientRect();\n\t\tconst offsetLeft = innerSliderRect.x - sliderRect.x;\n\n\t\tthis._startX = this._startMouseX - sliderRect.x - offsetLeft;\n\t\tthis._lastIndex = this._visibleIndex;\n\t\tthis._dragging = true;\n\t}\n\n\tprivate _mouseMoveHandler(e) {\n\t\tif (!e || !this._dragging || this.disableDrag) {\n\t\t\treturn;\n\t\t}\n\n\t\te.preventDefault();\n\n\t\tthis._shouldCheckLocation = true;\n\n\t\tif (this._innerSliderRef.style.getPropertyValue('pointer-events') === '') {\n\t\t\tthis._innerSliderRef.style.pointerEvents = 'none';\n\t\t}\n\n\t\tconst sliderRect = this._sliderRef.getBoundingClientRect();\n\t\tlet x = e.clientX - sliderRect.left;\n\t\tthis._lastMouseX = e.x;\n\t\tif (e.type === 'touchmove') {\n\t\t\tx = e.touches?.[0].clientX - sliderRect.left;\n\t\t\tthis._lastMouseX = e.touches?.[0].clientX;\n\t\t}\n\n\t\tthis._innerSliderRef.style.setProperty(\n\t\t\t'--tw-translate-x',\n\t\t\t`${x - this._startX}px`\n\t\t);\n\n\t\tthis._checkBoundary();\n\t\tthis._calculateIndicator();\n\t}\n\n\tprivate _transitionEndHandler() {\n\t\tthis._calculateIndicator();\n\t}\n\n\tprivate _slotChange() {\n\t\tconst items = this._el.querySelectorAll(':scope > *');\n\t\tthis._items = Array.from(items) as HTMLElement[];\n\n\t\tsetTimeout(() => {\n\t\t\tthis._innerSliderRef.style.setProperty('--tw-translate-x', '0px');\n\t\t\tthis._calculateWidth();\n\t\t\tthis._calculateIndicator();\n\t\t}, 100);\n\t}\n\n\t@Listen('mouseup', { target: 'window' })\n\t@Listen('touchend', { target: 'window' })\n\tmouseUpHandler() {\n\t\tthis._dragging = false;\n\t\tthis._innerSliderRef.style.removeProperty('pointer-events');\n\n\t\tthis._checkLocation();\n\t}\n\n\t@Listen('resize', { target: 'window' })\n\tresizeHandler() {\n\t\tif (this._innerSliderRef) {\n\t\t\tthis._innerSliderRef.style.setProperty('--tw-translate-x', '0px');\n\t\t\tthis._calculateWidth();\n\t\t\tthis._calculateIndicator();\n\t\t}\n\t}\n\n\tprivate _setInnerSliderReft(ref) {\n\t\tthis._innerSliderRef = ref;\n\t\tthis._innerSliderResizeObserver = new ResizeObserver(() =>\n\t\t\tthis._calculateHeight()\n\t\t);\n\t\tthis._innerSliderResizeObserver.observe(this._innerSliderRef);\n\t}\n\n\tprivate _scrollTo(i: number, manual = false) {\n\t\tif (this.disableIndicatorClick && manual) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst el = this._items[i];\n\n\t\tif (i === 0) {\n\t\t\tthis._innerSliderRef.style.setProperty('--tw-translate-x', `0px`);\n\t\t\treturn;\n\t\t}\n\n\t\tconst sliderRect = this._sliderRef.getBoundingClientRect();\n\t\tconst innerSliderRect = this._innerSliderRef.getBoundingClientRect();\n\t\tconst elRect = el.getBoundingClientRect();\n\n\t\tconst offsetLeft = elRect.x - innerSliderRect.x;\n\n\t\tconst centerOffset = offsetLeft + elRect.width / 2 - sliderRect.width / 2;\n\n\t\tthis._innerSliderRef.style.setProperty(\n\t\t\t'--tw-translate-x',\n\t\t\t`-${centerOffset}px`\n\t\t);\n\n\t\tthis._checkBoundary();\n\t\tthis._calculateIndicator();\n\t}\n\n\tprivate _checkBoundary() {\n\t\tlet outer = this._sliderRef.getBoundingClientRect();\n\n\t\tconst left = parseInt(\n\t\t\tthis._innerSliderRef.style.getPropertyValue('--tw-translate-x')\n\t\t);\n\t\tif (left > 0) {\n\t\t\tthis._innerSliderRef.style.setProperty('--tw-translate-x', `0px`);\n\t\t}\n\n\t\tconst maxLeft = (this._totalWidth - outer.width) * -1;\n\t\tif (left < maxLeft) {\n\t\t\tthis._innerSliderRef.style.setProperty(\n\t\t\t\t'--tw-translate-x',\n\t\t\t\t`${maxLeft}px`\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate _calculateIndicator() {\n\t\tfor (let i = 0; i < this._filteredItems.length; i++) {\n\t\t\tconst item = this._filteredItems[i];\n\t\t\tconst visible = this._isVisible(item);\n\n\t\t\tif (visible) {\n\t\t\t\tthis._visibleIndex = i;\n\t\t\t}\n\n\t\t\tif (i === 0 && visible) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _checkLocation() {\n\t\tif (!this._shouldCheckLocation) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet scrollToIndex = null;\n\t\tif (this._lastIndex !== this._visibleIndex) {\n\t\t\tscrollToIndex = this._visibleIndex;\n\t\t}\n\n\t\tif (this._lastIndex === this._visibleIndex) {\n\t\t\tif (this._lastMouseX > this._startMouseX && this._lastIndex !== 0) {\n\t\t\t\tscrollToIndex = this._lastIndex - 1;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tthis._lastMouseX < this._startMouseX &&\n\t\t\t\tthis._lastIndex !== this._items?.length - 1\n\t\t\t) {\n\t\t\t\tscrollToIndex = this._lastIndex + 1;\n\t\t\t}\n\t\t}\n\n\t\tif (scrollToIndex !== null) {\n\t\t\tthis._shouldCheckLocation = false;\n\t\t\tsetTimeout(() => this._scrollTo(scrollToIndex), 100);\n\t\t}\n\t}\n\n\tprivate _isVisible(el: HTMLElement) {\n\t\tif (!this._el || !el) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst elRect = el.getBoundingClientRect();\n\t\tconst sliderRect = this._sliderRef.getBoundingClientRect();\n\n\t\treturn (\n\t\t\t(elRect.left >= sliderRect.left && elRect.right <= sliderRect.right) ||\n\t\t\t(this._isMobile(el) &&\n\t\t\t\telRect.left + elRect.width / 2 >= sliderRect.left &&\n\t\t\t\telRect.left + elRect.width / 2 <= sliderRect.right)\n\t\t);\n\t}\n\n\tprivate _calculateWidth() {\n\t\tlet totalWidth = 0;\n\n\t\tfor (let item of this._filteredItems) {\n\t\t\tconst rect = item.getBoundingClientRect();\n\t\t\ttotalWidth += rect.width;\n\t\t}\n\n\t\tconst sliderStyle = getComputedStyle(this._sliderRef);\n\t\tconst padding = parseInt(sliderStyle.padding) * 2;\n\n\t\tconst innerSliderStyle = getComputedStyle(this._innerSliderRef);\n\t\tconst gap =\n\t\t\tparseInt(innerSliderStyle.gap) * (this._filteredItems.length - 1);\n\n\t\ttotalWidth += padding + gap;\n\n\t\tthis._totalWidth = totalWidth;\n\t}\n\n\tprivate _calculateHeight() {\n\t\tconst items = this._filteredItems;\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst outerHeight = this._filteredItems\n\t\t\t.at(0)\n\t\t\t.getBoundingClientRect().height;\n\t\tif (outerHeight != this._outerHeight) {\n\t\t\tthis._outerHeight = outerHeight;\n\t\t}\n\t}\n\n\tprivate _isMobile(el?: HTMLElement) {\n\t\tif (!el) {\n\t\t\tel = this._filteredItems.at(0);\n\t\t}\n\n\t\tconst elRect = el.getBoundingClientRect();\n\t\tconst sliderRect = this._sliderRef.getBoundingClientRect();\n\n\t\treturn sliderRect.width - elRect.width < 10;\n\t}\n}\n"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AO,UAAU,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,GAAG,EAAE;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"p-content-slider.entry.js","sources":["src/components/molecules/content-slider/content-slider.component.scss?tag=p-content-slider&encapsulation=shadow","src/components/molecules/content-slider/content-slider.component.tsx"],"sourcesContent":[":host {\n\t@apply flex flex-col overflow-hidden;\n\n\t@apply -mx-16 px-16;\n\n\t.slider {\n\t\t@apply relative box-content overflow-visible;\n\n\t\t&.draggable {\n\t\t\t@apply cursor-grab desktop-xs:cursor-auto;\n\n\t\t\t&.dragging {\n\t\t\t\t@apply cursor-grabbing desktop-xs:cursor-auto;\n\n\t\t\t\t.inner-slider {\n\t\t\t\t\t@apply transition-none;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t.inner-slider {\n\t\t\t@apply absolute flex w-full flex-nowrap items-stretch gap-2;\n\n\t\t\t@apply translate-x-0 transform-gpu will-change-transform;\n\n\t\t\t@apply desktop-xs:flex-wrap desktop-xs:gap-4;\n\n\t\t\t@apply transition-all;\n\t\t\ttransition-duration: 0.5s;\n\n\t\t\t> ::slotted(*) {\n\t\t\t\t@apply w-full;\n\t\t\t\t@apply z-10 flex-shrink-0;\n\n\t\t\t\t@screen tablet {\n\t\t\t\t\twidth: calc(50% - 0.5rem);\n\t\t\t\t}\n\n\t\t\t\t@screen desktop-xs {\n\t\t\t\t\t@apply w-0 flex-1;\n\t\t\t\t}\n\n\t\t\t\tposition: relative;\n\t\t\t}\n\t\t}\n\t}\n\n\t.indicator {\n\t\t@apply flex items-center justify-center desktop-xs:hidden;\n\n\t\t.item {\n\t\t\t@apply mt-3 px-1 pt-1;\n\t\t}\n\t}\n}\n","import {\n\tComponent,\n\tElement,\n\th,\n\tHost,\n\tListen,\n\tProp,\n\tState,\n} from '@stencil/core';\nimport { cn } from '../../../utils';\n\n@Component({\n\ttag: 'p-content-slider',\n\tstyleUrl: 'content-slider.component.scss',\n\tshadow: true,\n})\nexport class ContentSlider {\n\t/**\n\t * Wether to hide the indicator on mobile\n\t */\n\t@Prop() hideMobileIndicator: boolean = false;\n\n\t/**\n\t * Wether to disable dragging the content\n\t */\n\t@Prop() disableDrag: boolean = false;\n\n\t/**\n\t * Wether to disable auto centering the content\n\t */\n\t@Prop() disableAutoCenter: boolean = false;\n\n\t/**\n\t * Wether to disable clicking the indicator scrolls content\n\t */\n\t@Prop() disableIndicatorClick: boolean = false;\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _visibleIndex: number;\n\t@State() private _outerHeight = 0;\n\t@State() private _totalWidth = 0;\n\tprivate _sliderRef: HTMLElement;\n\tprivate _innerSliderRef: HTMLElement;\n\tprivate _items: HTMLElement[] = [];\n\tprivate _innerSliderResizeObserver: ResizeObserver;\n\n\t// mouse movement stuff\n\tprivate _startX: number;\n\tprivate _startMouseX: number;\n\tprivate _lastMouseX: number;\n\tprivate _lastIndex: number;\n\tprivate _shouldCheckLocation = false;\n\t@State() private _dragging = false;\n\n\tget _filteredItems() {\n\t\treturn this._items.filter(item => item.checkVisibility());\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis._innerSliderRef.style.setProperty('--tw-translate-x', `0px`);\n\t}\n\n\tdisconnectedCallback() {\n\t\tif (this._innerSliderResizeObserver) {\n\t\t\tthis._innerSliderResizeObserver.disconnect();\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class='p-content-slider'>\n\t\t\t\t<div\n\t\t\t\t\tclass={`slider ${!this.disableDrag && 'draggable'} ${\n\t\t\t\t\t\tthis._dragging && 'dragging'\n\t\t\t\t\t}`}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\theight: `${this._outerHeight}px`,\n\t\t\t\t\t}}\n\t\t\t\t\tref={el => (this._sliderRef = el)}\n\t\t\t\t\tonMouseDown={e => this._mouseDownHandler(e)}\n\t\t\t\t\tonTouchStart={e => this._mouseDownHandler(e)}\n\t\t\t\t\tonMouseMove={e => this._mouseMoveHandler(e)}\n\t\t\t\t\tonTouchMove={e => this._mouseMoveHandler(e)}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass='inner-slider'\n\t\t\t\t\t\tref={ref => this._setInnerSliderReft(ref)}\n\t\t\t\t\t\tonTransitionEnd={() => this._transitionEndHandler()}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot onSlotchange={() => this._slotChange()} />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class={`indicator ${this.hideMobileIndicator && 'hidden'}`}>\n\t\t\t\t\t{this._filteredItems.map((_, i) => (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tonClick={() => this._scrollTo(i, true)}\n\t\t\t\t\t\t\tclass={`item ${!this.disableIndicatorClick && 'cursor-pointer'}`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclass={cn('block h-2 w-2 rounded-full', {\n\t\t\t\t\t\t\t\t\t'bg-indigo-600': i === this._visibleIndex,\n\t\t\t\t\t\t\t\t\t'bg-indigo-300': i !== this._visibleIndex,\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _mouseDownHandler(e) {\n\t\tif (this.disableDrag || this._dragging) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst innerSliderStyle = getComputedStyle(this._innerSliderRef);\n\t\tif (innerSliderStyle.flexWrap === 'wrap') {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._startMouseX = e.x;\n\t\tconst sliderRect = this._sliderRef.getBoundingClientRect();\n\t\tif (e.type === 'touchstart') {\n\t\t\tthis._startMouseX = e.touches?.[0].clientX;\n\t\t}\n\n\t\tconst innerSliderRect = this._innerSliderRef.getBoundingClientRect();\n\t\tconst offsetLeft = innerSliderRect.x - sliderRect.x;\n\n\t\tthis._startX = this._startMouseX - sliderRect.x - offsetLeft;\n\t\tthis._lastIndex = this._visibleIndex;\n\t\tthis._dragging = true;\n\t}\n\n\tprivate _mouseMoveHandler(e) {\n\t\tif (!e || !this._dragging || this.disableDrag) {\n\t\t\treturn;\n\t\t}\n\n\t\te.preventDefault();\n\n\t\tthis._shouldCheckLocation = true;\n\n\t\tif (this._innerSliderRef.style.getPropertyValue('pointer-events') === '') {\n\t\t\tthis._innerSliderRef.style.pointerEvents = 'none';\n\t\t}\n\n\t\tconst sliderRect = this._sliderRef.getBoundingClientRect();\n\t\tlet x = e.clientX - sliderRect.left;\n\t\tthis._lastMouseX = e.x;\n\t\tif (e.type === 'touchmove') {\n\t\t\tx = e.touches?.[0].clientX - sliderRect.left;\n\t\t\tthis._lastMouseX = e.touches?.[0].clientX;\n\t\t}\n\n\t\tthis._innerSliderRef.style.setProperty(\n\t\t\t'--tw-translate-x',\n\t\t\t`${x - this._startX}px`\n\t\t);\n\n\t\tthis._checkBoundary();\n\t\tthis._calculateIndicator();\n\t}\n\n\tprivate _transitionEndHandler() {\n\t\tthis._calculateIndicator();\n\t}\n\n\tprivate _slotChange() {\n\t\tconst items = this._el.querySelectorAll(':scope > *');\n\t\tthis._items = Array.from(items) as HTMLElement[];\n\n\t\tsetTimeout(() => {\n\t\t\tthis._innerSliderRef.style.setProperty('--tw-translate-x', '0px');\n\t\t\tthis._calculateWidth();\n\t\t\tthis._calculateIndicator();\n\t\t}, 100);\n\t}\n\n\t@Listen('mouseup', { target: 'window' })\n\t@Listen('touchend', { target: 'window' })\n\tmouseUpHandler() {\n\t\tthis._dragging = false;\n\t\tthis._innerSliderRef.style.removeProperty('pointer-events');\n\n\t\tthis._checkLocation();\n\t}\n\n\t@Listen('resize', { target: 'window' })\n\tresizeHandler() {\n\t\tif (this._innerSliderRef) {\n\t\t\tthis._innerSliderRef.style.setProperty('--tw-translate-x', '0px');\n\t\t\tthis._calculateWidth();\n\t\t\tthis._calculateIndicator();\n\t\t}\n\t}\n\n\tprivate _setInnerSliderReft(ref) {\n\t\tthis._innerSliderRef = ref;\n\t\tthis._innerSliderResizeObserver = new ResizeObserver(() =>\n\t\t\tthis._calculateHeight()\n\t\t);\n\t\tthis._innerSliderResizeObserver.observe(this._innerSliderRef);\n\t}\n\n\tprivate _scrollTo(i: number, manual = false) {\n\t\tif (this.disableIndicatorClick && manual) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst el = this._items[i];\n\n\t\tif (i === 0) {\n\t\t\tthis._innerSliderRef.style.setProperty('--tw-translate-x', `0px`);\n\t\t\treturn;\n\t\t}\n\n\t\tconst sliderRect = this._sliderRef.getBoundingClientRect();\n\t\tconst innerSliderRect = this._innerSliderRef.getBoundingClientRect();\n\t\tconst elRect = el.getBoundingClientRect();\n\n\t\tconst offsetLeft = elRect.x - innerSliderRect.x;\n\n\t\tconst centerOffset = offsetLeft + elRect.width / 2 - sliderRect.width / 2;\n\n\t\tthis._innerSliderRef.style.setProperty(\n\t\t\t'--tw-translate-x',\n\t\t\t`-${centerOffset}px`\n\t\t);\n\n\t\tthis._checkBoundary();\n\t\tthis._calculateIndicator();\n\t}\n\n\tprivate _checkBoundary() {\n\t\tlet outer = this._sliderRef.getBoundingClientRect();\n\n\t\tconst left = parseInt(\n\t\t\tthis._innerSliderRef.style.getPropertyValue('--tw-translate-x')\n\t\t);\n\t\tif (left > 0) {\n\t\t\tthis._innerSliderRef.style.setProperty('--tw-translate-x', `0px`);\n\t\t}\n\n\t\tconst maxLeft = (this._totalWidth - outer.width) * -1;\n\t\tif (left < maxLeft) {\n\t\t\tthis._innerSliderRef.style.setProperty(\n\t\t\t\t'--tw-translate-x',\n\t\t\t\t`${maxLeft}px`\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate _calculateIndicator() {\n\t\tfor (let i = 0; i < this._filteredItems.length; i++) {\n\t\t\tconst item = this._filteredItems[i];\n\t\t\tconst visible = this._isVisible(item);\n\n\t\t\tif (visible) {\n\t\t\t\tthis._visibleIndex = i;\n\t\t\t}\n\n\t\t\tif (i === 0 && visible) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _checkLocation() {\n\t\tif (!this._shouldCheckLocation) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet scrollToIndex = null;\n\t\tif (this._lastIndex !== this._visibleIndex) {\n\t\t\tscrollToIndex = this._visibleIndex;\n\t\t}\n\n\t\tif (this._lastIndex === this._visibleIndex) {\n\t\t\tif (this._lastMouseX > this._startMouseX && this._lastIndex !== 0) {\n\t\t\t\tscrollToIndex = this._lastIndex - 1;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tthis._lastMouseX < this._startMouseX &&\n\t\t\t\tthis._lastIndex !== this._items?.length - 1\n\t\t\t) {\n\t\t\t\tscrollToIndex = this._lastIndex + 1;\n\t\t\t}\n\t\t}\n\n\t\tif (scrollToIndex !== null) {\n\t\t\tthis._shouldCheckLocation = false;\n\t\t\tsetTimeout(() => this._scrollTo(scrollToIndex), 100);\n\t\t}\n\t}\n\n\tprivate _isVisible(el: HTMLElement) {\n\t\tif (!this._el || !el) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst elRect = el.getBoundingClientRect();\n\t\tconst sliderRect = this._sliderRef.getBoundingClientRect();\n\n\t\treturn (\n\t\t\t(elRect.left >= sliderRect.left && elRect.right <= sliderRect.right) ||\n\t\t\t(this._isMobile(el) &&\n\t\t\t\telRect.left + elRect.width / 2 >= sliderRect.left &&\n\t\t\t\telRect.left + elRect.width / 2 <= sliderRect.right)\n\t\t);\n\t}\n\n\tprivate _calculateWidth() {\n\t\tlet totalWidth = 0;\n\n\t\tfor (let item of this._filteredItems) {\n\t\t\tconst rect = item.getBoundingClientRect();\n\t\t\ttotalWidth += rect.width;\n\t\t}\n\n\t\tconst sliderStyle = getComputedStyle(this._sliderRef);\n\t\tconst padding = parseInt(sliderStyle.padding) * 2;\n\n\t\tconst innerSliderStyle = getComputedStyle(this._innerSliderRef);\n\t\tconst gap =\n\t\t\tparseInt(innerSliderStyle.gap) * (this._filteredItems.length - 1);\n\n\t\ttotalWidth += padding + gap;\n\n\t\tthis._totalWidth = totalWidth;\n\t}\n\n\tprivate _calculateHeight() {\n\t\tconst items = this._filteredItems;\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst outerHeight = this._filteredItems\n\t\t\t.at(0)\n\t\t\t.getBoundingClientRect().height;\n\t\tif (outerHeight != this._outerHeight) {\n\t\t\tthis._outerHeight = outerHeight;\n\t\t}\n\t}\n\n\tprivate _isMobile(el?: HTMLElement) {\n\t\tif (!el) {\n\t\t\tel = this._filteredItems.at(0);\n\t\t}\n\n\t\tconst elRect = el.getBoundingClientRect();\n\t\tconst sliderRect = this._sliderRef.getBoundingClientRect();\n\n\t\treturn sliderRect.width - elRect.width < 10;\n\t}\n}\n"],"names":[],"mappings":";;;;AAAA,MAAM,yBAAyB,GAAG,mrHAAmrH;;MCgBxsH,aAAa,GAAA,MAAA;;;;AACzB;;AAEG;IACK,mBAAmB,GAAY,KAAK;AAE5C;;AAEG;IACK,WAAW,GAAY,KAAK;AAEpC;;AAEG;IACK,iBAAiB,GAAY,KAAK;AAE1C;;AAEG;IACK,qBAAqB,GAAY,KAAK;;AAO7B,IAAA,aAAa;IACb,YAAY,GAAG,CAAC;IAChB,WAAW,GAAG,CAAC;AACxB,IAAA,UAAU;AACV,IAAA,eAAe;IACf,MAAM,GAAkB,EAAE;AAC1B,IAAA,0BAA0B;;AAG1B,IAAA,OAAO;AACP,IAAA,YAAY;AACZ,IAAA,WAAW;AACX,IAAA,UAAU;IACV,oBAAoB,GAAG,KAAK;IACnB,SAAS,GAAG,KAAK;AAElC,IAAA,IAAI,cAAc,GAAA;AACjB,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;;IAG1D,gBAAgB,GAAA;QACf,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,kBAAkB,EAAE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AAI,CAAC,KAAK,CAAC,MAAM,EAAE;YAClB;;AAGD,QAAA,MAAM,WAAW,GAAG,IAAI,CAAC;aACvB,EAAE,CAAC,CAAC;aACJ,qBAAqB,EAAE,CAAC,MAAM;AAChC,QAAA,IAAI,WAAW,IAAI,IAAI,CAAC,YAAY,EAAE;AACrC,YAAA,IAAI,CAAC,YAAY,GAAG,WAAW;;;AAIzB,IAAA,SAAS,CAAC,EAAgB,EAAA;QACjC,IAAI,CAAC,EAAE,EAAE;YACR,EAAE,GAAG,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC;;AAG/B,QAAA,MAAM,MAAM,GAAG,EAAE,CAAC,qBAAqB,EAAE;QACzC,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,qBAAqB,EAAE;QAE1D,OAAO,UAAU,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,GAAG,EAAE;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-stepper-item.p-stepper-line.entry.js","sources":["src/components/atoms/stepper/item/stepper-item.component.css?tag=p-stepper-item&encapsulation=shadow","src/components/atoms/stepper/item/stepper-item.component.tsx","src/components/atoms/stepper/line/stepper-line.component.css?tag=p-stepper-line&encapsulation=shadow","src/components/atoms/stepper/line/stepper-line.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-indigo-600',\n\t\t'rounded-full',\n\t],\n\t{\n\t\tvariants: {\n\t\t\talign: {\n\t\t\t\tstart: null,\n\t\t\t\tcenter: null,\n\t\t\t\tend: null,\n\t\t\t},\n\t\t\tdirection: {\n\t\t\t\thorizontal: null,\n\t\t\t\tvertical: null,\n\t\t\t},\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-indigo-600 bg-indigo-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-indigo-600',\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-indigo-600',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdirection: 'vertical',\n\t\t\t\talign: 'start',\n\t\t\t\tclass: 'mt-
|
|
1
|
+
{"version":3,"file":"p-stepper-item.p-stepper-line.entry.js","sources":["src/components/atoms/stepper/item/stepper-item.component.css?tag=p-stepper-item&encapsulation=shadow","src/components/atoms/stepper/item/stepper-item.component.tsx","src/components/atoms/stepper/line/stepper-line.component.css?tag=p-stepper-line&encapsulation=shadow","src/components/atoms/stepper/line/stepper-line.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-indigo-600',\n\t\t'rounded-full',\n\t],\n\t{\n\t\tvariants: {\n\t\t\talign: {\n\t\t\t\tstart: null,\n\t\t\t\tcenter: null,\n\t\t\t\tend: null,\n\t\t\t},\n\t\t\tdirection: {\n\t\t\t\thorizontal: null,\n\t\t\t\tvertical: null,\n\t\t\t},\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-indigo-600 bg-indigo-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-indigo-600',\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-indigo-600',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdirection: 'vertical',\n\t\t\t\talign: 'start',\n\t\t\t\tclass: 'mt-5',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdirection: 'vertical',\n\t\t\t\talign: 'end',\n\t\t\t\tclass: 'mb-5',\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\tdirection: {\n\t\t\thorizontal: null,\n\t\t\tvertical: 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-storm-400',\n\t\t},\n\t\t{\n\t\t\tactive: true,\n\t\t\tfinished: false,\n\t\t\tclass: 'text-storm-500',\n\t\t},\n\t\t{\n\t\t\tactive: false,\n\t\t\tfinished: true,\n\t\t\tclass: 'text-storm-500',\n\t\t},\n\t\t{\n\t\t\tdirection: 'horizontal',\n\t\t\tactive: false,\n\t\t\tclass: 'hidden desktop-xs:inline-block',\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 direction of the item\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 * 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\talign: this.align,\n\t\t\t\t\t\tdirection: this.direction,\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\tdirection: this.direction,\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",":host {\n\t@apply flex-auto;\n\t@apply block;\n\t@apply bg-off-white-700;\n}\n\n:host([direction='horizontal']) {\n\t@apply h-[1px];\n}\n\n:host([direction='vertical']) {\n\t@apply mx-[calc(0.75rem-1px)] min-h-[1rem] w-[1px];\n}\n\n:host([active='true']),\n:host([active]:not([active='false'])) {\n\t@apply bg-indigo-600;\n}\n","import { Component, h, Host, Prop } from '@stencil/core';\n\n@Component({\n\ttag: 'p-stepper-line',\n\tstyleUrl: 'stepper-line.component.css',\n\tshadow: true,\n})\nexport class StepperLine {\n\t/**\n\t * Wether the line is active\n\t */\n\t@Prop({ reflect: true }) active: boolean = false;\n\n\t/**\n\t * The direction of the stepper line\n\t */\n\t@Prop({ reflect: true }) direction: 'horizontal' | 'vertical' =\n\t\t'horizontal';\n\n\trender() {\n\t\treturn <Host />;\n\t}\n}\n"],"names":[],"mappings":";;;;;AAAA,MAAM,uBAAuB,GAAG,0oDAA0oD;;ACI1qD,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;IACjC,uCAAuC;IACvC,cAAc;CACd,EACD;AACC,IAAA,QAAQ,EAAE;AACT,QAAA,KAAK,EAAE;AACN,YAAA,KAAK,EAAE,IAAI;AACX,YAAA,MAAM,EAAE,IAAI;AACZ,YAAA,GAAG,EAAE,IAAI;AACT,SAAA;AACD,QAAA,SAAS,EAAE;AACV,YAAA,UAAU,EAAE,IAAI;AAChB,YAAA,QAAQ,EAAE,IAAI;AACd,SAAA;AACD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AAC,MAAM,CACP,EACN,CACC,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAE,OAAO,CAAC;AACd,gBAAA,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;AAC9B,gBAAA,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;gBAClC,SAAS,EAAE,IAAI,CAAC,SAAS;AACzB,aAAA,CAAC,EAAA,EAEF,CAAQ,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACH,CACD;;;;;ACjLT,MAAM,uBAAuB,GAAG,6sBAA6sB;;MCOhuB,WAAW,GAAA,MAAA;;;;AACvB;;AAEG;IACsB,MAAM,GAAY,KAAK;AAEhD;;AAEG;IACsB,SAAS,GACjC,YAAY;IAEb,MAAM,GAAA;QACL,OAAO,CAAA,CAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAG;;;;;;;"}
|
|
@@ -3,7 +3,7 @@ import { c as cva } from './index-CO0T2jO4.js';
|
|
|
3
3
|
import { a as asBoolean } from './as-boolean-C5CTp9IA.js';
|
|
4
4
|
import './clsx-ChV9xqsO.js';
|
|
5
5
|
|
|
6
|
-
const stepperItemComponentCss = "*{box-sizing:border-box}.static{position:static!important}.mb-
|
|
6
|
+
const stepperItemComponentCss = "*{box-sizing:border-box}.static{position:static!important}.mb-5{margin-bottom:1.25rem!important}.mt-5{margin-top:1.25rem!important}.mt-\\[1px\\]{margin-top:1px!important}.flex{display:flex!important}.hidden{display:none!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-indigo-600{--tw-border-opacity:1!important;border-color:rgb(82 138 250/var(--tw-border-opacity,1))!important}.bg-indigo-50{--tw-bg-opacity:1!important;background-color:rgb(241 246 255/var(--tw-bg-opacity,1))!important}.bg-indigo-600{--tw-bg-opacity:1!important;background-color:rgb(82 138 250/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-indigo-600{--tw-text-opacity:1!important;color:rgb(82 138 250/var(--tw-text-opacity,1))!important}.text-storm-400{--tw-text-opacity:1!important;color:rgb(70 75 84/var(--tw-text-opacity,1))!important}.text-storm-500{color:rgb(24 30 41/var(--tw-text-opacity,1))!important}.text-storm-500,.text-white{--tw-text-opacity:1!important}.text-white{color:rgb(255 255 255/var(--tw-text-opacity,1))!important}@media (min-width:64rem){.desktop-xs\\:inline-block{display:inline-block!important}}";
|
|
7
7
|
|
|
8
8
|
const item = cva('flex gap-2', {
|
|
9
9
|
variants: {
|
|
@@ -62,12 +62,12 @@ const circle = cva([
|
|
|
62
62
|
{
|
|
63
63
|
direction: 'vertical',
|
|
64
64
|
align: 'start',
|
|
65
|
-
class: 'mt-
|
|
65
|
+
class: 'mt-5',
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
68
|
direction: 'vertical',
|
|
69
69
|
align: 'end',
|
|
70
|
-
class: 'mb-
|
|
70
|
+
class: 'mb-5',
|
|
71
71
|
},
|
|
72
72
|
],
|
|
73
73
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-stepper-item.p-stepper-line.entry.js","mappings":";;;;;AAAA,MAAM,uBAAuB,GAAG,
|
|
1
|
+
{"file":"p-stepper-item.p-stepper-line.entry.js","mappings":";;;;;AAAA,MAAM,uBAAuB,GAAG,0oDAA0oD;;ACI1qD,MAAM,IAAI,GAAG,GAAG,CAAC,YAAY,EAAE;AAC9B,IAAA,QAAQ,EAAE;AACT,QAAA,KAAK,EAAE;AACN,YAAA,KAAK,EAAE,aAAa;AACpB,YA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;IAE/B,MAAM,GAAA;AACL,QAAA,QACC,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACC,KAAK,EAAE,IAAI,CAAC;gBACX,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,eAAe,EAAE,IAAI,CAAC,eAAe;AACrC,aAAA,CAAC,EAAA,EAEF,CACC,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAE,MAAM,CAAC;gBACb,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,SAAS,EAAE,IAAI,CAAC,SAAS;AACzB,gBAAA,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;AAC9B,gBAAA,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;AAClC,aAAA,CAAC,EAED,EAAA,IAAI,CAAC,MAAM,CACP,EACN,CACC,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAE,OAAO,CAAC;AACd,gBAAA,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;AAC9B,gBAAA,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;gBAClC,SAAS,EAAE,IAAI,CAAC,SAAS;AACzB,aAAA,CAAC,EAAA,EAEF,CAAQ,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACH,CACD;;;;;ACjLT,MAAM,uBAAuB,GAAG,6sBAA6sB;;MCOhuB,WAAW,GAAA,MAAA;;;;AACvB;;AAEG;IACsB,MAAM,GAAY,KAAK;AAEhD;;AAEG;IACsB,SAAS,GACjC,YAAY;IAEb,MAAM,GAAA;QACL,OAAO,CAAA,CAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAG;;;;;;;","names":[],"sources":["src/components/atoms/stepper/item/stepper-item.component.css?tag=p-stepper-item&encapsulation=shadow","src/components/atoms/stepper/item/stepper-item.component.tsx","src/components/atoms/stepper/line/stepper-line.component.css?tag=p-stepper-line&encapsulation=shadow","src/components/atoms/stepper/line/stepper-line.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-indigo-600',\n\t\t'rounded-full',\n\t],\n\t{\n\t\tvariants: {\n\t\t\talign: {\n\t\t\t\tstart: null,\n\t\t\t\tcenter: null,\n\t\t\t\tend: null,\n\t\t\t},\n\t\t\tdirection: {\n\t\t\t\thorizontal: null,\n\t\t\t\tvertical: null,\n\t\t\t},\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-indigo-600 bg-indigo-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-indigo-600',\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-indigo-600',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdirection: 'vertical',\n\t\t\t\talign: 'start',\n\t\t\t\tclass: 'mt-5',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdirection: 'vertical',\n\t\t\t\talign: 'end',\n\t\t\t\tclass: 'mb-5',\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\tdirection: {\n\t\t\thorizontal: null,\n\t\t\tvertical: 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-storm-400',\n\t\t},\n\t\t{\n\t\t\tactive: true,\n\t\t\tfinished: false,\n\t\t\tclass: 'text-storm-500',\n\t\t},\n\t\t{\n\t\t\tactive: false,\n\t\t\tfinished: true,\n\t\t\tclass: 'text-storm-500',\n\t\t},\n\t\t{\n\t\t\tdirection: 'horizontal',\n\t\t\tactive: false,\n\t\t\tclass: 'hidden desktop-xs:inline-block',\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 direction of the item\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 * 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\talign: this.align,\n\t\t\t\t\t\tdirection: this.direction,\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\tdirection: this.direction,\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",":host {\n\t@apply flex-auto;\n\t@apply block;\n\t@apply bg-off-white-700;\n}\n\n:host([direction='horizontal']) {\n\t@apply h-[1px];\n}\n\n:host([direction='vertical']) {\n\t@apply mx-[calc(0.75rem-1px)] min-h-[1rem] w-[1px];\n}\n\n:host([active='true']),\n:host([active]:not([active='false'])) {\n\t@apply bg-indigo-600;\n}\n","import { Component, h, Host, Prop } from '@stencil/core';\n\n@Component({\n\ttag: 'p-stepper-line',\n\tstyleUrl: 'stepper-line.component.css',\n\tshadow: true,\n})\nexport class StepperLine {\n\t/**\n\t * Wether the line is active\n\t */\n\t@Prop({ reflect: true }) active: boolean = false;\n\n\t/**\n\t * The direction of the stepper line\n\t */\n\t@Prop({ reflect: true }) direction: 'horizontal' | 'vertical' =\n\t\t'horizontal';\n\n\trender() {\n\t\treturn <Host />;\n\t}\n}\n"],"version":3}
|
|
@@ -202,17 +202,17 @@ const Stepper = class {
|
|
|
202
202
|
stepperLine.style.marginTop = '0';
|
|
203
203
|
stepperLine.style.marginBottom = '0';
|
|
204
204
|
if (this.align === 'start' || this.align === 'center') {
|
|
205
|
-
stepperLine.style.marginTop = `-${heightDiff / 16 - (this.align === 'start' ? 1.
|
|
205
|
+
stepperLine.style.marginTop = `-${heightDiff / 16 - (this.align === 'start' ? 1.5 : 0)}rem`;
|
|
206
206
|
totalHeight += heightDiff - (this.align === 'start' ? 8 : 0);
|
|
207
207
|
if (this.align === 'start') {
|
|
208
|
-
stepperLine.style.marginBottom = `-
|
|
208
|
+
stepperLine.style.marginBottom = `-1rem`;
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
if (this.align === 'center' || this.align === 'end') {
|
|
212
|
-
stepperLine.style.marginBottom = `-${heightDiffNext / 16 - (this.align === 'end' ? 1.
|
|
212
|
+
stepperLine.style.marginBottom = `-${heightDiffNext / 16 - (this.align === 'end' ? 1.5 : 0)}rem`;
|
|
213
213
|
totalHeight += heightDiffNext - (this.align === 'end' ? 8 : 0);
|
|
214
214
|
if (this.align === 'end') {
|
|
215
|
-
stepperLine.style.marginTop = `-
|
|
215
|
+
stepperLine.style.marginTop = `-1rem`;
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
stepperLine.style.minHeight = `calc(${totalHeight / 16}rem)`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-stepper.entry.js","sources":["src/components/organisms/stepper/stepper.component.css?tag=p-stepper&encapsulation=shadow","src/components/organisms/stepper/stepper.component.tsx"],"sourcesContent":["","import {\n\tComponent,\n\tElement,\n\tFragment,\n\th,\n\tProp,\n\tState,\n\tWatch,\n} from '@stencil/core';\nimport { cva } 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 _containerRef: HTMLDivElement;\n\tprivate _resizeObserver: ResizeObserver;\n\n\tprivate _hasSlotItems = false;\n\n\tcomponentDidLoad() {\n\t\tthis._hasSlotItems = !!this._el.querySelector(':scope > *');\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\tref={ref => this._setContainerRef(ref)}\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\tref={ref => this._setContainerRef(ref)}\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 _setContainerRef(ref: HTMLDivElement) {\n\t\tthis._containerRef = ref;\n\n\t\tif (this._resizeObserver) {\n\t\t\tthis._resizeObserver.disconnect();\n\t\t}\n\n\t\tthis._resizeObserver = new ResizeObserver(() => this._generateLinesOnce());\n\t\tthis._resizeObserver.observe(this._containerRef);\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.direction = this.direction;\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}, 50);\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\tthis._generatedOnce = true;\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 = `-${\n\t\t\t\t\theightDiff / 16 - (this.align === 'start' ? 1.25 : 0)\n\t\t\t\t}rem`;\n\t\t\t\ttotalHeight += heightDiff - (this.align === 'start' ? 8 : 0);\n\n\t\t\t\tif (this.align === 'start') {\n\t\t\t\t\tstepperLine.style.marginBottom = `-0.75rem`;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.align === 'center' || this.align === 'end') {\n\t\t\t\tstepperLine.style.marginBottom = `-${\n\t\t\t\t\theightDiffNext / 16 - (this.align === 'end' ? 1.25 : 0)\n\t\t\t\t}rem`;\n\t\t\t\ttotalHeight += heightDiffNext - (this.align === 'end' ? 8 : 0);\n\n\t\t\t\tif (this.align === 'end') {\n\t\t\t\t\tstepperLine.style.marginTop = `-0.75rem`;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstepperLine.style.minHeight = `calc(${totalHeight / 16}rem)`;\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;AAAA,MAAM,mBAAmB,GAAG,wWAAwW;;ACiBpY,MAAM,OAAO,GAAG,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE;AACnC,IAAA,QAAQ,EAAE;AACT,QAAA,SAAS,EAAE;AACV,YAAA,QAAQ,EAAE,2BAA2B;AACrC,YAAA,UAAU,EAAE,qBAAqB;AACjC,SAAA;AACD,QAAA,aAAa,EAAE;AACd,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,KAAK,EAAE,WAAW;AAClB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GAAA,CAAK;AACL,gBAAA,WAAW,IAAI,UAAU,IAAI,IAAI,CAAC,KAAK,KAAK,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;AAE5D,gBAAA,IAAI,IAAI,CAAC,KAAK,KAAK,OAAO,EAAE;AAC3B,oBAAA,WAAW,CAAC,KAAK,CAAC,YAAY,GAAG,UAAU;;;AAI7C,YAAA,IAAI,IAAI,CAAC,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,EAAE;gBACpD,WAAW,CAAC,KAAK,CAAC,YAAY,GAAG,CAChC,CAAA,EAAA,cAAc,GAAG,EAAE,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,GAAG,IAAI,GAAG,CAAC,CACvD,CAAA,GAAA,CAAK;AACL,gBAAA,WAAW,IAAI,cAAc,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC;AAE9D,gBAAA,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,EAAE;AACzB,oBAAA,WAAW,CAAC,KAAK,CAAC,SAAS,GAAG,UAAU;;;YAI1C,WAAW,CAAC,KAAK,CAAC,SAAS,GAAG,QAAQ,WAAW,GAAG,EAAE,CAAA,IAAA,CAAM;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"p-stepper.entry.js","sources":["src/components/organisms/stepper/stepper.component.css?tag=p-stepper&encapsulation=shadow","src/components/organisms/stepper/stepper.component.tsx"],"sourcesContent":["","import {\n\tComponent,\n\tElement,\n\tFragment,\n\th,\n\tProp,\n\tState,\n\tWatch,\n} from '@stencil/core';\nimport { cva } 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 _containerRef: HTMLDivElement;\n\tprivate _resizeObserver: ResizeObserver;\n\n\tprivate _hasSlotItems = false;\n\n\tcomponentDidLoad() {\n\t\tthis._hasSlotItems = !!this._el.querySelector(':scope > *');\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\tref={ref => this._setContainerRef(ref)}\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\tref={ref => this._setContainerRef(ref)}\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 _setContainerRef(ref: HTMLDivElement) {\n\t\tthis._containerRef = ref;\n\n\t\tif (this._resizeObserver) {\n\t\t\tthis._resizeObserver.disconnect();\n\t\t}\n\n\t\tthis._resizeObserver = new ResizeObserver(() => this._generateLinesOnce());\n\t\tthis._resizeObserver.observe(this._containerRef);\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.direction = this.direction;\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}, 50);\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\tthis._generatedOnce = true;\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 = `-${\n\t\t\t\t\theightDiff / 16 - (this.align === 'start' ? 1.5 : 0)\n\t\t\t\t}rem`;\n\t\t\t\ttotalHeight += heightDiff - (this.align === 'start' ? 8 : 0);\n\n\t\t\t\tif (this.align === 'start') {\n\t\t\t\t\tstepperLine.style.marginBottom = `-1rem`;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.align === 'center' || this.align === 'end') {\n\t\t\t\tstepperLine.style.marginBottom = `-${\n\t\t\t\t\theightDiffNext / 16 - (this.align === 'end' ? 1.5 : 0)\n\t\t\t\t}rem`;\n\t\t\t\ttotalHeight += heightDiffNext - (this.align === 'end' ? 8 : 0);\n\n\t\t\t\tif (this.align === 'end') {\n\t\t\t\t\tstepperLine.style.marginTop = `-1rem`;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstepperLine.style.minHeight = `calc(${totalHeight / 16}rem)`;\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;AAAA,MAAM,mBAAmB,GAAG,wWAAwW;;ACiBpY,MAAM,OAAO,GAAG,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE;AACnC,IAAA,QAAQ,EA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IAAI,CAAC,KAAK,KAAK,QAAQ,EAAE;gBACtD,WAAW,CAAC,KAAK,CAAC,SAAS,GAAG,CAC7B,CAAA,EAAA,UAAU,GAAG,EAAE,IAAI,IAAI,CAAC,KAAK,KAAK,OAAO,GAAG,GAAG,GAAG,CAAC,CACpD,CAAA,GAAA,CAAK;AACL,gBAAA,WAAW,IAAI,UAAU,IAAI,IAAI,CAAC,KAAK,KAAK,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;AAE5D,gBAAA,IAAI,IAAI,CAAC,KAAK,KAAK,OAAO,EAAE;AAC3B,oBAAA,WAAW,CAAC,KAAK,CAAC,YAAY,GAAG,OAAO;;;AAI1C,YAAA,IAAI,IAAI,CAAC,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,EAAE;gBACpD,WAAW,CAAC,KAAK,CAAC,YAAY,GAAG,CAChC,CAAA,EAAA,cAAc,GAAG,EAAE,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,GAAG,GAAG,GAAG,CAAC,CACtD,CAAA,GAAA,CAAK;AACL,gBAAA,WAAW,IAAI,cAAc,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC;AAE9D,gBAAA,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,EAAE;AACzB,oBAAA,WAAW,CAAC,KAAK,CAAC,SAAS,GAAG,OAAO;;;YAIvC,WAAW,CAAC,KAAK,CAAC,SAAS,GAAG,QAAQ,WAAW,GAAG,EAAE,CAAA,IAAA,CAAM;;;;;;;;;;;;;"}
|
package/dist/index.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!doctype html><html dir="ltr" lang="en"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0"> <title>Stencil Component Starter</title> <link rel="modulepreload" href="/build/p-
|
|
1
|
+
<!doctype html><html dir="ltr" lang="en"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0"> <title>Stencil Component Starter</title> <link rel="modulepreload" href="/build/p-b152938d.js"><link rel="modulepreload" href="/build/p-BmA7NKgh.js"><link rel="modulepreload" href="/build/p-C5CTp9IA.js"><link rel="modulepreload" href="/build/p-CBWjHURv.js"><link rel="modulepreload" href="/build/p-CT54OXR2.js"><link rel="modulepreload" href="/build/p-ChV9xqsO.js"><link rel="modulepreload" href="/build/p-DhGo7hbh.js"><script type="module" src="/build/p-b152938d.js" data-stencil data-resources-url="/build/" data-stencil-namespace="paperless"></script> <script nomodule="" src="/build/paperless.js" data-stencil></script> <style>.touch-none{touch-action:none!important}.font-ambit{font-family:Ambit,sans-serif!important}.font-geist{font-family:Geist,serif!important}.text-base{font-size:1rem!important;line-height:1.5rem!important}.font-bold{font-weight:700!important}.font-medium{font-weight:500!important}.lining-nums{--tw-numeric-figure:lining-nums!important}.lining-nums,.tabular-nums{font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)!important}.tabular-nums{--tw-numeric-spacing:tabular-nums!important}.text-inherit{color:inherit!important}.text-storm-300{--tw-text-opacity:1!important;color:rgb(116 120 127/var(--tw-text-opacity,1))!important}.antialiased{-webkit-font-smoothing:antialiased!important;-moz-osx-font-smoothing:grayscale!important}*{box-sizing:border-box;font-family:Geist,serif}.touch-none{touch-action:none!important}.font-ambit{font-family:Ambit,sans-serif!important}.font-geist{font-family:Geist,serif!important}.text-base{font-size:1rem!important;line-height:1.5rem!important}.font-bold{font-weight:700!important}.font-medium{font-weight:500!important}.lining-nums{--tw-numeric-figure:lining-nums!important;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)!important}.text-inherit{color:inherit!important}.text-storm-300{--tw-text-opacity:1!important;color:rgb(116 120 127/var(--tw-text-opacity,1))!important}.antialiased{-webkit-font-smoothing:antialiased!important;-moz-osx-font-smoothing:grayscale!important}@import url(https://fonts.googleapis.com/css2?family=Geist:wght@100..900&display=swap);@import url(https://fonts.cdnfonts.com/css/ambit);*,* button,.font-geist,.font-geist button{font-variant-numeric:lining-nums tabular-nums}body,html{--tw-bg-opacity:1;-webkit-font-smoothing:antialiased;background-color:rgb(255 255 255/var(--tw-bg-opacity,1));max-width:calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right));text-rendering:optimizeLegibility;width:100%}html{height:-moz-stretch;height:-webkit-stretch;height:-webkit-fill-available;height:-moz-available;height:stretch}body{--tw-text-opacity:1!important;color:rgb(116 120 127/var(--tw-text-opacity,1))!important;font-size:1rem!important;font-weight:500!important;height:calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));height:-moz-stretch;height:-webkit-stretch;height:-webkit-fill-available;height:-moz-available;height:stretch;line-height:1.5rem!important}body *{box-sizing:border-box}a,a:visited{color:inherit}h1,h2,h3,h4,h5{--tw-text-opacity:1;color:rgb(24 30 41/var(--tw-text-opacity,1));font-family:Ambit,sans-serif;font-weight:700}h1{font-size:2rem;line-height:2.5rem}h2{font-size:1.5rem;line-height:2rem}h3{font-size:1.25rem}h3,h4{line-height:1.75rem}h4{font-size:1.125rem}.scroll-lock{-webkit-overflow-scrolling:auto;overflow:hidden;overscroll-behavior:none;touch-action:none}</style> </head> <body> <p-button>Test</p-button> <script data-build="2025-07-31T11:07:57">
|
|
2
2
|
if ('serviceWorker' in navigator && location.protocol !== 'file:') {
|
|
3
3
|
window.addEventListener('load', function() {
|
|
4
4
|
navigator.serviceWorker.register('/sw.js')
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,g as e,h as i,F as s}from"./p-DhGo7hbh.js";import{c as n}from"./p-CBWjHURv.js";import"./p-ChV9xqsO.js";const r="*{box-sizing:border-box}.static{position:static!important}.flex{display:flex!important}.h-auto{height:auto!important}.w-full{width:100%!important}.flex-col{flex-direction:column!important}.flex-wrap{flex-wrap:wrap!important}.items-center{align-items:center!important}.gap-2{gap:.5rem!important}.opacity-0{opacity:0!important}.opacity-100{opacity:1!important}";const o=n(["flex gap-2"],{variants:{direction:{vertical:"w-full flex-col flex-wrap",horizontal:"h-auto items-center"},generatedOnce:{true:"opacity-100",false:"opacity-0"}}});const h=class{constructor(e){t(this,e)}steps;activeStep=1;enableAutoStatus=true;direction="horizontal";align="center";contentPosition="end";get _el(){return e(this)}_generatedOnce=false;_loaded=false;_generateTimeout;_containerRef;_resizeObserver;_hasSlotItems=false;componentDidLoad(){this._hasSlotItems=!!this._el.querySelector(":scope > *");this._loaded=true}disconnectCallback(){if(this._resizeObserver){this._resizeObserver.disconnect()}}render(){if(!this._loaded){return}if(!this._hasSlotItems){const t=typeof this.steps==="string"?JSON.parse(this.steps):this.steps;if(!t?.length){return}const e=t.map(((e,n)=>{const r=this._getItem(typeof e==="string"?{active:false,finished:false,content:e}:e,n);return i(s,null,r,n<t.length-1&&this._getLine(n))}));return i("div",{class:o({direction:this.direction,generatedOnce:true}),ref:t=>this._setContainerRef(t)},e)}return i("div",{class:o({direction:this.direction,generatedOnce:this._generatedOnce}),ref:t=>this._setContainerRef(t)},i("slot",{onSlotchange:()=>this._generateLinesOnce()}))}_onAlignChange(){this._generateLinesOnce()}_onDirectionChange(){this._generateLinesOnce()}_onActiveStepChange(){this._generateLinesOnce()}_setContainerRef(t){this._containerRef=t;if(this._resizeObserver){this._resizeObserver.disconnect()}this._resizeObserver=new ResizeObserver((()=>this._generateLinesOnce()));this._resizeObserver.observe(this._containerRef)}_getItem(t,e){const s=this.activeStep-1||0;return i("p-stepper-item",{active:this.enableAutoStatus?e===s:t.active,finished:this.enableAutoStatus?e<s:t.finished,number:e+1,align:this.direction==="vertical"?this.align:"start",contentPosition:this.contentPosition},t.content)}_getLine(t){const e=this.activeStep-1||0;return i("p-stepper-line",{active:t<e,direction:this.direction})}_checkItems(t){const e=this.activeStep-1||0;for(let i=0;i<t?.length;i++){const s=t.item(i);if(this.enableAutoStatus){s.active=i===e;s.finished=i<e}s.number=i+1;s.align=this.direction==="vertical"?this.align:"start";s.direction=this.direction;s.contentPosition=this.contentPosition}}_generateLinesOnce(){if(!this._hasSlotItems){return}if(this._generateTimeout){clearTimeout(this._generateTimeout);this._generateTimeout=null}this._generateTimeout=setTimeout((()=>{const t=this._el.querySelectorAll("p-stepper-item");this._checkItems(t);this._generateLines(t);this._generateTimeout=null}),50)}_generateLines(t){if(!this._el){return}let e=this.activeStep-1||0;for(let i=0;i<t?.length;i++){const s=t.item(i);if(i<t.length-1){let t=s.nextElementSibling;if(t&&t.tagName.toLowerCase()==="p-stepper-item"){const n=document.createElement("p-stepper-line");this._el.insertBefore(n,t);this._setLineData(n,s,t,i,e);const r=n.previousElementSibling;if(r&&r.tagName.toLowerCase()==="p-stepper-line"){r.remove()}continue}if(t&&t.tagName.toLowerCase()==="p-stepper-line"){const n=t;t=t.nextElementSibling;if(t&&t.tagName.toLowerCase()==="p-stepper-item"){this._setLineData(n,s,t,i,e)}}}if(i>0){const t=s.previousElementSibling;if(t&&t.tagName.toLowerCase()==="p-stepper-line"){t.direction=this.direction;t.active=s.active||s.finished}}}const i=this._el.querySelectorAll("p-stepper-line:not(:has(+ p-stepper-item)), p-stepper-line:first-child");for(let t=i.length-1;t>=0;t--){const e=i.item(t);e.remove()}if(!this._generatedOnce){this._generatedOnce=true}}_setLineData(t,e,i,s,n){let r=e.clientHeight-24;let o=i.clientHeight-24;if(this.align==="center"){r=r/2;o=o/2}t.direction=this.direction;t.active=s<n;if(r>0&&this.direction==="vertical"){let e=0;t.style.marginTop="0";t.style.marginBottom="0";if(this.align==="start"||this.align==="center"){t.style.marginTop=`-${r/16-(this.align==="start"?1.
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,g as e,h as i,F as s}from"./p-DhGo7hbh.js";import{c as n}from"./p-CBWjHURv.js";import"./p-ChV9xqsO.js";const r="*{box-sizing:border-box}.static{position:static!important}.flex{display:flex!important}.h-auto{height:auto!important}.w-full{width:100%!important}.flex-col{flex-direction:column!important}.flex-wrap{flex-wrap:wrap!important}.items-center{align-items:center!important}.gap-2{gap:.5rem!important}.opacity-0{opacity:0!important}.opacity-100{opacity:1!important}";const o=n(["flex gap-2"],{variants:{direction:{vertical:"w-full flex-col flex-wrap",horizontal:"h-auto items-center"},generatedOnce:{true:"opacity-100",false:"opacity-0"}}});const h=class{constructor(e){t(this,e)}steps;activeStep=1;enableAutoStatus=true;direction="horizontal";align="center";contentPosition="end";get _el(){return e(this)}_generatedOnce=false;_loaded=false;_generateTimeout;_containerRef;_resizeObserver;_hasSlotItems=false;componentDidLoad(){this._hasSlotItems=!!this._el.querySelector(":scope > *");this._loaded=true}disconnectCallback(){if(this._resizeObserver){this._resizeObserver.disconnect()}}render(){if(!this._loaded){return}if(!this._hasSlotItems){const t=typeof this.steps==="string"?JSON.parse(this.steps):this.steps;if(!t?.length){return}const e=t.map(((e,n)=>{const r=this._getItem(typeof e==="string"?{active:false,finished:false,content:e}:e,n);return i(s,null,r,n<t.length-1&&this._getLine(n))}));return i("div",{class:o({direction:this.direction,generatedOnce:true}),ref:t=>this._setContainerRef(t)},e)}return i("div",{class:o({direction:this.direction,generatedOnce:this._generatedOnce}),ref:t=>this._setContainerRef(t)},i("slot",{onSlotchange:()=>this._generateLinesOnce()}))}_onAlignChange(){this._generateLinesOnce()}_onDirectionChange(){this._generateLinesOnce()}_onActiveStepChange(){this._generateLinesOnce()}_setContainerRef(t){this._containerRef=t;if(this._resizeObserver){this._resizeObserver.disconnect()}this._resizeObserver=new ResizeObserver((()=>this._generateLinesOnce()));this._resizeObserver.observe(this._containerRef)}_getItem(t,e){const s=this.activeStep-1||0;return i("p-stepper-item",{active:this.enableAutoStatus?e===s:t.active,finished:this.enableAutoStatus?e<s:t.finished,number:e+1,align:this.direction==="vertical"?this.align:"start",contentPosition:this.contentPosition},t.content)}_getLine(t){const e=this.activeStep-1||0;return i("p-stepper-line",{active:t<e,direction:this.direction})}_checkItems(t){const e=this.activeStep-1||0;for(let i=0;i<t?.length;i++){const s=t.item(i);if(this.enableAutoStatus){s.active=i===e;s.finished=i<e}s.number=i+1;s.align=this.direction==="vertical"?this.align:"start";s.direction=this.direction;s.contentPosition=this.contentPosition}}_generateLinesOnce(){if(!this._hasSlotItems){return}if(this._generateTimeout){clearTimeout(this._generateTimeout);this._generateTimeout=null}this._generateTimeout=setTimeout((()=>{const t=this._el.querySelectorAll("p-stepper-item");this._checkItems(t);this._generateLines(t);this._generateTimeout=null}),50)}_generateLines(t){if(!this._el){return}let e=this.activeStep-1||0;for(let i=0;i<t?.length;i++){const s=t.item(i);if(i<t.length-1){let t=s.nextElementSibling;if(t&&t.tagName.toLowerCase()==="p-stepper-item"){const n=document.createElement("p-stepper-line");this._el.insertBefore(n,t);this._setLineData(n,s,t,i,e);const r=n.previousElementSibling;if(r&&r.tagName.toLowerCase()==="p-stepper-line"){r.remove()}continue}if(t&&t.tagName.toLowerCase()==="p-stepper-line"){const n=t;t=t.nextElementSibling;if(t&&t.tagName.toLowerCase()==="p-stepper-item"){this._setLineData(n,s,t,i,e)}}}if(i>0){const t=s.previousElementSibling;if(t&&t.tagName.toLowerCase()==="p-stepper-line"){t.direction=this.direction;t.active=s.active||s.finished}}}const i=this._el.querySelectorAll("p-stepper-line:not(:has(+ p-stepper-item)), p-stepper-line:first-child");for(let t=i.length-1;t>=0;t--){const e=i.item(t);e.remove()}if(!this._generatedOnce){this._generatedOnce=true}}_setLineData(t,e,i,s,n){let r=e.clientHeight-24;let o=i.clientHeight-24;if(this.align==="center"){r=r/2;o=o/2}t.direction=this.direction;t.active=s<n;if(r>0&&this.direction==="vertical"){let e=0;t.style.marginTop="0";t.style.marginBottom="0";if(this.align==="start"||this.align==="center"){t.style.marginTop=`-${r/16-(this.align==="start"?1.5:0)}rem`;e+=r-(this.align==="start"?8:0);if(this.align==="start"){t.style.marginBottom=`-1rem`}}if(this.align==="center"||this.align==="end"){t.style.marginBottom=`-${o/16-(this.align==="end"?1.5:0)}rem`;e+=o-(this.align==="end"?8:0);if(this.align==="end"){t.style.marginTop=`-1rem`}}t.style.minHeight=`calc(${e/16}rem)`}}static get watchers(){return{align:["_onAlignChange"],direction:["_onDirectionChange"],activeStep:["_onActiveStepChange"]}}};h.style=r;export{h as p_stepper};
|
|
2
|
+
//# sourceMappingURL=p-6fdd90eb.entry.js.map
|