@paperless/core 1.38.6 → 1.38.7

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 CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.38.7](https://github.com/ionic-team/stencil-component-starter/compare/v1.38.6...v1.38.7) (2024-07-16)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **molecules/stepper:** Remove the correct ones now ([54148ab](https://github.com/ionic-team/stencil-component-starter/commit/54148ab9a3ec679aaa87615fabdaf1d99ab8c3a9))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [1.38.6](https://github.com/ionic-team/stencil-component-starter/compare/v1.38.5...v1.38.6) (2024-07-16)
7
18
 
8
19
  **Note:** Version bump only for package @paperless/core
@@ -0,0 +1,2 @@
1
+ import{r as t,h as e,H as i,g as s}from"./p-e4d5e7a7.js";const o=".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}*{box-sizing:border-box}:host{display:flex}:host([direction=horizontal]){align-items:flex-end;height:auto}:host([direction=vertical]){align-items:flex-start;flex-direction:column;flex-wrap:wrap;min-height:100%;width:100%}:host([direction=vertical][content-position=start]){align-items:flex-end}.static{position:static!important}";const r=class{constructor(e){t(this,e);this._rendering=false;this._loaded=false;this.activeStep=1;this.direction="horizontal";this.contentPosition="end"}componentDidLoad(){this._loaded=true;this._generateSteps(true)}render(){return e(i,{class:"p-stepper"},e("slot",{onSlotchange:()=>this._generateSteps()}))}async _generateSteps(t=false){if(!t&&(!this._el||this._rendering||!this._loaded)){return}this._rendering=true;let e=this.activeStep-1||0;const i=this._el.querySelectorAll("p-stepper-item");if(!this.activeStep||e<0){for(let t=0;t<(i===null||i===void 0?void 0:i.length);t++){const s=i.item(t);if(s.active){e=t}if(e<0&&s.finished){e=t+1}}}for(let t=0;t<(i===null||i===void 0?void 0:i.length);t++){let s=false;const o=i.item(t);o.active=t===e;o.finished=t<e;if(o.direction!==this.direction){s=true}o.direction=this.direction;o.align=t===0?"start":t===(i===null||i===void 0?void 0:i.length)-1?"end":"center";o.contentPosition=this.contentPosition;if(t<i.length-1){const i=o.nextElementSibling;if(i&&i.tagName.toLowerCase()==="p-stepper-item"){if(s){await new Promise((t=>setTimeout(t,10)))}const r=(o.clientHeight>16?o.clientHeight-16:o.clientHeight)/2;const n=document.createElement("p-stepper-line");n.direction=this.direction;n.active=t<=e;if(r>0&&this.direction==="vertical"){n.style.marginTop=`-${r/16}rem`;n.style.marginBottom=`-${r/16}rem`;n.style.minHeight=`calc(1rem + ${r*2/16}rem)`}this._el.insertBefore(n,i);const l=n.previousElementSibling;if(l&&l.tagName.toLowerCase()==="p-stepper-line"){l.remove()}continue}}if(t>0){const t=o.previousElementSibling;if(t.tagName.toLowerCase()==="p-stepper-line"){t.direction=this.direction;t.active=o.active||o.finished}}}const s=this._el.querySelectorAll("p-stepper-line + p-stepper-line, p-stepper-line:not(:has(+ p-stepper-item))");for(let t=s.length-1;t>=0;t--){const e=s.item(t);e.remove()}setTimeout((()=>this._rendering=false),100)}get _el(){return s(this)}static get watchers(){return{activeStep:["_generateSteps"]}}};r.style=o;export{r as p_stepper};
2
+ //# sourceMappingURL=p-c7c6176b.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["stepperComponentCss","Stepper","this","_rendering","_loaded","componentDidLoad","_generateSteps","render","h","Host","class","onSlotchange","firstLoad","_el","activeStep","items","querySelectorAll","i","length","item","active","finished","directionChanged","direction","align","contentPosition","nextItem","nextElementSibling","tagName","toLowerCase","Promise","resolve","setTimeout","heightDiff","clientHeight","stepperLine","document","createElement","style","marginTop","marginBottom","minHeight","insertBefore","previous","previousElementSibling","remove","previousItem","lines","j","line"],"sources":["src/components/molecules/stepper/stepper.component.scss?tag=p-stepper&encapsulation=shadow","src/components/molecules/stepper/stepper.component.tsx"],"sourcesContent":[":host {\n\t@apply flex;\n}\n\n:host([direction='horizontal']) {\n\t@apply h-auto items-end;\n}\n\n:host([direction='vertical']) {\n\t@apply flex-col flex-wrap items-start;\n\t@apply w-full min-h-full;\n}\n\n:host([direction='vertical'][content-position='start']) {\n\t@apply items-end;\n}\n","import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\n@Component({\n\ttag: 'p-stepper',\n\tstyleUrl: 'stepper.component.scss',\n\tshadow: true,\n})\nexport class Stepper {\n\t/**\n\t * The currently active step\n\t */\n\t@Prop() activeStep: number = 1;\n\n\t/**\n\t * The direction of the stepper\n\t */\n\t@Prop({ reflect: true }) direction: 'horizontal' | 'vertical' =\n\t\t'horizontal';\n\n\t/**\n\t * The position of the content in case of vertical direction\n\t */\n\t@Prop({ reflect: true }) contentPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\tprivate _rendering = false;\n\tprivate _loaded = false;\n\n\t// private _steps: Array<HTMLPStepperItemElement>;\n\n\tcomponentDidLoad() {\n\t\tthis._loaded = true;\n\t\tthis._generateSteps(true);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class=\"p-stepper\">\n\t\t\t\t<slot onSlotchange={() => this._generateSteps()} />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Watch('activeStep')\n\tprivate async _generateSteps(firstLoad = false) {\n\t\tif (!firstLoad && (!this._el || this._rendering || !this._loaded)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._rendering = true;\n\n\t\tlet activeStep = this.activeStep - 1 || 0;\n\t\tconst items = this._el.querySelectorAll('p-stepper-item');\n\n\t\tif (!this.activeStep || activeStep < 0) {\n\t\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\t\tconst item = items.item(i) as any;\n\n\t\t\t\tif (item.active) {\n\t\t\t\t\tactiveStep = i;\n\t\t\t\t}\n\n\t\t\t\tif (activeStep < 0 && item.finished) {\n\t\t\t\t\tactiveStep = i + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\tlet directionChanged = false;\n\t\t\tconst item = items.item(i) as any;\n\n\t\t\titem.active = i === activeStep;\n\t\t\titem.finished = i < activeStep;\n\n\t\t\tif (item.direction !== this.direction) {\n\t\t\t\tdirectionChanged = true;\n\t\t\t}\n\n\t\t\titem.direction = this.direction;\n\t\t\titem.align =\n\t\t\t\ti === 0 ? 'start' : i === items?.length - 1 ? 'end' : 'center';\n\t\t\titem.contentPosition = this.contentPosition;\n\n\t\t\tif (i < items.length - 1) {\n\t\t\t\tconst nextItem = item.nextElementSibling;\n\n\t\t\t\tif (\n\t\t\t\t\tnextItem &&\n\t\t\t\t\tnextItem.tagName.toLowerCase() === 'p-stepper-item'\n\t\t\t\t) {\n\t\t\t\t\t// super hacky, but we want to wait for the css of the `item.direction` change to be applied before querying for the item.clientHeight\n\t\t\t\t\t// otherwise we always get the initial \"16\"\n\t\t\t\t\tif (directionChanged) {\n\t\t\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, 10));\n\t\t\t\t\t}\n\n\t\t\t\t\tconst heightDiff =\n\t\t\t\t\t\t(item.clientHeight > 16\n\t\t\t\t\t\t\t? item.clientHeight - 16\n\t\t\t\t\t\t\t: item.clientHeight) / 2;\n\n\t\t\t\t\tconst stepperLine =\n\t\t\t\t\t\tdocument.createElement('p-stepper-line');\n\n\t\t\t\t\tstepperLine.direction = this.direction;\n\t\t\t\t\tstepperLine.active = i <= activeStep;\n\n\t\t\t\t\tif (heightDiff > 0 && this.direction === 'vertical') {\n\t\t\t\t\t\tstepperLine.style.marginTop = `-${heightDiff / 16}rem`;\n\t\t\t\t\t\tstepperLine.style.marginBottom = `-${\n\t\t\t\t\t\t\theightDiff / 16\n\t\t\t\t\t\t}rem`;\n\t\t\t\t\t\tstepperLine.style.minHeight = `calc(1rem + ${\n\t\t\t\t\t\t\t(heightDiff * 2) / 16\n\t\t\t\t\t\t}rem)`;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._el.insertBefore(stepperLine, nextItem);\n\n\t\t\t\t\tconst previous = stepperLine.previousElementSibling;\n\t\t\t\t\tif (\n\t\t\t\t\t\tprevious &&\n\t\t\t\t\t\tprevious.tagName.toLowerCase() === 'p-stepper-line'\n\t\t\t\t\t) {\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\t\t\t}\n\n\t\t\tif (i > 0) {\n\t\t\t\tconst previousItem = item.previousElementSibling;\n\t\t\t\tif (previousItem.tagName.toLowerCase() === 'p-stepper-line') {\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 + p-stepper-line, p-stepper-line:not(:has(+ p-stepper-item))'\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\tsetTimeout(() => (this._rendering = false), 100);\n\t}\n}\n"],"mappings":"yDAAA,MAAMA,EAAsB,if,MCOfC,EAAO,M,yBAsBXC,KAAAC,WAAa,MACbD,KAAAE,QAAU,M,gBAnBW,E,eAM5B,a,qBAK2D,K,CAY5D,gBAAAC,GACCH,KAAKE,QAAU,KACfF,KAAKI,eAAe,K,CAGrB,MAAAC,GACC,OACCC,EAACC,EAAI,CAACC,MAAM,aACXF,EAAA,QAAMG,aAAc,IAAMT,KAAKI,mB,CAM1B,oBAAMA,CAAeM,EAAY,OACxC,IAAKA,KAAeV,KAAKW,KAAOX,KAAKC,aAAeD,KAAKE,SAAU,CAClE,M,CAGDF,KAAKC,WAAa,KAElB,IAAIW,EAAaZ,KAAKY,WAAa,GAAK,EACxC,MAAMC,EAAQb,KAAKW,IAAIG,i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,Q,CAIrB/B,KAAKW,IAAI6B,aAAaP,EAAaT,GAEnC,MAAMiB,EAAWR,EAAYS,uBAC7B,GACCD,GACAA,EAASf,QAAQC,gBAAkB,iBAClC,CACDc,EAASE,Q,CAGV,Q,EAIF,GAAI5B,EAAI,EAAG,CACV,MAAM6B,EAAe3B,EAAKyB,uBAC1B,GAAIE,EAAalB,QAAQC,gBAAkB,iBAAkB,CAC5DiB,EAAavB,UAAYrB,KAAKqB,UAC9BuB,EAAa1B,OAASD,EAAKC,QAAUD,EAAKE,Q,GAK7C,MAAM0B,EAAQ7C,KAAKW,IAAIG,iBACtB,+EAED,IAAK,IAAIgC,EAAID,EAAM7B,OAAS,EAAG8B,GAAK,EAAGA,IAAK,CAC3C,MAAMC,EAAOF,EAAM5B,KAAK6B,GACxBC,EAAKJ,Q,CAGNb,YAAW,IAAO9B,KAAKC,WAAa,OAAQ,I"}
@@ -1,2 +1,2 @@
1
- import{p as e,b as a}from"./p-e4d5e7a7.js";export{s as setNonce}from"./p-e4d5e7a7.js";const t=()=>{const a=import.meta.url;const t={};if(a!==""){t.resourcesUrl=new URL(".",a).href}return e(t)};t().then((e=>a(JSON.parse('[["p-e4110d85",[[4,"p-button",{"variant":[1],"underline":[4],"href":[1],"target":[1],"size":[1],"type":[1],"loading":[4],"chevron":[8],"chevronPosition":[1,"chevron-position"],"disabled":[4],"icon":[1],"iconOnly":[4,"icon-only"],"iconPosition":[1,"icon-position"],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"],"inheritText":[4,"inherit-text"]},[[2,"click","handleClick"]]],[1,"p-loader",{"show":[4],"variant":[1],"color":[1],"modalTitle":[1,"modal-title"],"modalDescription":[1,"modal-description"]}],[0,"p-icon",{"variant":[1],"size":[1],"rotate":[2],"flip":[1]}]]],["p-a9ebacc8",[[4,"p-table",{"items":[1],"loading":[4],"headerLoading":[4,"header-loading"],"footerLoading":[4,"footer-loading"],"amountOfLoadingRows":[2,"amount-of-loading-rows"],"enableRowSelection":[4,"enable-row-selection"],"rowSelectionLimit":[2,"row-selection-limit"],"enableRowClick":[4,"enable-row-click"],"selectedRows":[16],"enableFloatingMenu":[4,"enable-floating-menu"],"floatingMenuAmountSelectedTemplate":[16],"selectionKey":[1,"selection-key"],"canSelectKey":[1,"can-select-key"],"enableHeader":[4,"enable-header"],"quickFilters":[16],"activeQuickFilterIdentifier":[1,"active-quick-filter-identifier"],"enableSearch":[4,"enable-search"],"query":[1025],"enableFilter":[4,"enable-filter"],"selectedFiltersAmount":[2,"selected-filters-amount"],"filterButtonTemplate":[16],"enableAction":[4,"enable-action"],"actionButtonLoading":[4,"action-button-loading"],"actionButtonEnabled":[4,"action-button-enabled"],"actionButtonIcon":[1,"action-button-icon"],"actionButtonText":[1,"action-button-text"],"actionButtonTemplate":[16],"enableFooter":[4,"enable-footer"],"enablePageSize":[4,"enable-page-size"],"enablePagination":[4,"enable-pagination"],"enableExport":[4,"enable-export"],"page":[1538],"total":[2],"pageSize":[2,"page-size"],"pageSizeOptions":[16],"hideOnSinglePage":[4,"hide-on-single-page"],"emptyStateHeader":[16],"emptyStateContent":[16],"emptyStateAction":[16],"enableEmptyStateAction":[4,"enable-empty-state-action"],"emptyStateFilteredHeader":[16],"emptyStateFilteredContent":[16],"shadow":[4],"_locales":[32],"_columns":[32],"_items":[32]},[[16,"localeChanged","_setLocales"],[16,"tableDefinitionChanged","onTableDefinitionUpdated"],[4,"keydown","keyDown"],[4,"keyup","keyUp"],[4,"visibilitychange","visibilityChange"]],{"items":["_parseItems"]}]]],["p-22a84714",[[0,"p-select",{"items":[1],"multi":[516],"icon":[1],"query":[1],"placeholder":[1],"autocompletePlaceholder":[1,"autocomplete-placeholder"],"value":[8],"displayKey":[1,"display-key"],"dropdownDisplayKey":[1,"dropdown-display-key"],"selectionDisplayKey":[1,"selection-display-key"],"valueKey":[1,"value-key"],"avatarKey":[1,"avatar-key"],"avatarLettersKey":[1,"avatar-letters-key"],"identifierKey":[1,"identifier-key"],"queryKey":[1,"query-key"],"autoSelectFirst":[4,"auto-select-first"],"showChevron":[4,"show-chevron"],"maxDisplayedItems":[2,"max-displayed-items"],"enableAutocomplete":[4,"enable-autocomplete"],"asyncFilter":[4,"async-filter"],"loading":[4],"enableSelectAll":[4,"enable-select-all"],"selectAllText":[1,"select-all-text"],"selectAllIcon":[1,"select-all-icon"],"size":[1],"prefix":[1],"label":[1],"helper":[1],"required":[516],"error":[513],"disabled":[516],"showAddItem":[4,"show-add-item"],"addItemText":[1,"add-item-text"],"emptyStateText":[1,"empty-state-text"],"_showDropdown":[32],"_selectedItem":[32],"_allSelected":[32],"_amountHidden":[32]},[[6,"click","documentClickHandler"]],{"value":["_valueChange"],"items":["itemChanges"],"_showDropdown":["_showDropdownChanges"],"multi":["multiChanges"]}]]],["p-3969a78e",[[1,"p-modal",{"size":[1],"variant":[1],"header":[1],"show":[4],"applyBlur":[4,"apply-blur"],"showClose":[4,"show-close"],"showMobileFooter":[4,"show-mobile-footer"],"backdropClickClose":[4,"backdrop-click-close"],"scrollLock":[4,"scroll-lock"],"padding":[4],"_closing":[32]},[[8,"closeModal","handleCloseModal"]]]]],["p-c9b840a7",[[0,"p-datepicker",{"placeholder":[1],"value":[1],"preselectToday":[4,"preselect-today"],"disabledDates":[1,"disabled-dates"],"minDate":[1,"min-date"],"maxDate":[1,"max-date"],"disableWeekends":[4,"disable-weekends"],"mode":[1],"format":[1],"size":[1],"prefix":[1],"label":[1],"helper":[1],"required":[516],"error":[513],"disabled":[516],"_showDropdown":[32],"_value":[32],"_minDate":[32],"_maxDate":[32],"_disabledDates":[32]},[[6,"click","documentClickHandler"]],{"value":["parseValue"],"minDate":["parseMinDate"],"maxDate":["parseMaxDate"],"disabledDates":["parseDisabledDates"]}]]],["p-60400a89",[[1,"p-drawer",{"header":[1],"show":[4],"applyBlur":[4,"apply-blur"],"showClose":[4,"show-close"],"backdropClickClose":[4,"backdrop-click-close"],"canClose":[4,"can-close"],"scrollLock":[4,"scroll-lock"],"_closing":[32]},[[8,"closeDrawer","handleCloseDrawer"],[8,"forceCloseDrawer","handleForceCloseDrawer"]]]]],["p-699e0b35",[[1,"p-attachment",{"mode":[1],"loading":[4],"error":[1],"downloading":[4]}]]],["p-179efb16",[[1,"p-navbar",{"closeText":[1,"close-text"],"menuText":[1,"menu-text"],"_showMenu":[32]},[[8,"closeNavbar","handleCloseNavbar"],[8,"openNavbar","handleOpenNavbar"]]]]],["p-2d3ff364",[[1,"p-profile",{"variant":[1],"size":[513],"_dropdownOpen":[32]}]]],["p-4c30c74b",[[1,"p-toast",{"variant":[1],"header":[1],"content":[1],"enableAction":[4,"enable-action"],"actionIcon":[1,"action-icon"],"actionIconFlip":[1,"action-icon-flip"],"actionIconRotate":[2,"action-icon-rotate"]}]]],["p-a2b552f9",[[1,"p-divider",{"variant":[513]}]]],["p-d0796984",[[1,"p-accordion",{"header":[1],"open":[4],"closeable":[4],"openable":[4]}]]],["p-fffaacc2",[[1,"p-navigation-item",{"active":[4],"icon":[1],"counter":[8],"href":[1],"target":[1]}]]],["p-f9e9370b",[[4,"p-card-header",{"header":[1],"arrow":[4]}]]],["p-cb2674b5",[[1,"p-content-slider",{"hideMobileIndicator":[4,"hide-mobile-indicator"],"disableDrag":[4,"disable-drag"],"disableAutoCenter":[4,"disable-auto-center"],"disableIndicatorClick":[4,"disable-indicator-click"],"_visibleIndex":[32],"_outerHeight":[32],"_totalWidth":[32],"_dragging":[32]},[[9,"mouseup","mouseUpHandler"],[9,"touchend","mouseUpHandler"],[9,"resize","resizeHandler"]]]]],["p-7bf042c9",[[1,"p-cropper",{"variant":[513],"value":[8],"returnType":[1,"return-type"],"_loaded":[32],"_currentScale":[32]},[[9,"resize","onResize"]]]]],["p-97bcf0b5",[[1,"p-info-panel",{"variant":[1],"header":[1],"content":[1],"closeable":[4]}]]],["p-cf7bd354",[[4,"p-status",{"variant":[1],"icon":[1],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"]}]]],["p-d8641c29",[[1,"p-stepper-line",{"active":[516],"direction":[513]}]]],["p-e74e8edd",[[1,"p-stepper",{"activeStep":[2,"active-step"],"direction":[513],"contentPosition":[513,"content-position"]},null,{"activeStep":["_generateSteps"]}]]],["p-eebab75d",[[1,"p-stepper-item",{"align":[513],"direction":[513],"contentPosition":[513,"content-position"],"finished":[516],"active":[516]}]]],["p-ec29eed0",[[1,"p-tab-group"]]],["p-af6b813e",[[4,"p-avatar-group",{"extra":[2]}]]],["p-8426ca20",[[4,"p-card-body",{"inheritText":[516,"inherit-text"]}]]],["p-f0f1a46b",[[1,"p-card-container",{"hoverable":[516],"shadow":[516]}]]],["p-bbe63029",[[1,"p-layout",{"variant":[1]}]]],["p-7793ba3a",[[1,"p-tab-item",{"active":[4]}]]],["p-4dc5647e",[[0,"p-table-column",{"path":[1537],"type":[1537],"name":[1537],"useSlot":[1540,"use-slot"],"hasCheckbox":[1540,"has-checkbox"],"align":[1537],"isLast":[1540,"is-last"],"sizes":[1032]}]]],["p-606ad811",[[1,"p-toast-container",{"placement":[1]}]]],["p-dace47c5",[[1,"p-calendar",{"variant":[1],"value":[1],"preselectToday":[4,"preselect-today"],"disabledDates":[1,"disabled-dates"],"minDate":[1,"min-date"],"maxDate":[1,"max-date"],"disableWeekends":[4,"disable-weekends"],"mode":[1],"_view":[32],"_viewDate":[32],"_value":[32],"_minDate":[32],"_maxDate":[32],"_disabledDates":[32]},null,{"value":["_parseValue"],"minDate":["_parseMinDate"],"maxDate":["_parseMaxDate"],"disabledDates":["_parseDisabledDates"]}]]],["p-0cbff44f",[[0,"p-avatar",{"variant":[513],"size":[513],"defaultImage":[1,"default-image"],"src":[1],"letters":[1],"_src":[32],"_failed":[32]},null,{"src":["onSrchChange"]}]]],["p-2becd73c",[[1,"p-counter",{"variant":[1],"size":[1]}]]],["p-ec15ee73",[[1,"p-slider-indicator",{"active":[4]}]]],["p-4e9e4ce2",[[1,"p-drawer-header",{"showClose":[4,"show-close"]}],[1,"p-drawer-body",{"variant":[1]}],[4,"p-drawer-container",{"closing":[4]}]]],["p-b848c222",[[1,"p-backdrop",{"variant":[1],"applyBlur":[4,"apply-blur"],"closing":[4],"scrollLock":[4,"scroll-lock"]},[[2,"click","handleClick"]]]]],["p-bf1ffb6a",[[1,"p-modal-header",{"showClose":[4,"show-close"]}],[1,"p-modal-footer"],[1,"p-modal-body",{"variant":[1],"rounded":[4],"padding":[4]}],[4,"p-modal-container",{"size":[1],"closing":[4]}]]],["p-2cd5062f",[[1,"p-label",{"variant":[513],"behavior":[513],"iconPosition":[1,"icon-position"],"icon":[513],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"],"size":[513],"keepMobileContent":[516,"keep-mobile-content"]}],[1,"p-segment-item",{"active":[4],"iconOnly":[4,"icon-only"],"size":[513],"icon":[1],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"]}],[4,"p-segment-container"]]],["p-8873dc41",[[4,"p-dropdown-menu-container",{"maxWidth":[4,"max-width"],"fullWidth":[4,"full-width"],"scrollable":[8]}]]],["p-d9267cc3",[[1,"p-dropdown-menu-item",{"active":[4],"variant":[1],"enableHover":[4,"enable-hover"],"icon":[1]}],[1,"p-dropdown",{"placement":[513],"strategy":[1],"show":[4],"calculateWidth":[4,"calculate-width"],"applyMaxWidth":[4,"apply-max-width"],"applyFullWidth":[4,"apply-full-width"],"scrollable":[8],"insideClick":[4,"inside-click"],"disableTriggerClick":[4,"disable-trigger-click"],"applyChevron":[4,"apply-chevron"],"chevronPosition":[1,"chevron-position"],"chevronDirection":[1,"chevron-direction"]},[[6,"click","documentClickHandler"]],{"show":["onShowChange"]}]]],["p-35c563a7",[[1,"p-page-size-select",{"size":[1538],"sizeOptions":[16],"chevronPosition":[1,"chevron-position"],"buttonSize":[1,"button-size"],"buttonTemplate":[16],"itemTemplate":[16],"hidden":[4],"_locales":[32]},[[16,"localeChanged","_setLocales"]]],[0,"p-pagination",{"page":[1538],"pageSize":[2,"page-size"],"hideOnSinglePage":[4,"hide-on-single-page"],"total":[2]},null,{"page":["pageChangeHandler"],"pageSize":["pageChangeHandler"],"total":["pageChangeHandler"]}],[1,"p-pagination-item",{"active":[4]}]]],["p-1ddbc9f2",[[1,"p-tooltip",{"variant":[1],"content":[8],"placement":[1],"strategy":[1],"enableUserInput":[4,"enable-user-input"],"show":[4],"canManuallyClose":[4,"can-manually-close"]},[[2,"click","clickHandler"],[6,"click","documentClickHandler"],[1,"mouseenter","mouseEnterHandler"],[0,"focus","mouseEnterHandler"],[1,"mouseleave","mouseLeaveHandler"],[0,"blur","mouseLeaveHandler"]],{"show":["onShowChange"]}]]],["p-13e80641",[[1,"p-input-group",{"size":[1],"prefix":[1],"suffix":[1],"icon":[1],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"],"iconPosition":[1,"icon-position"],"label":[1],"helper":[1],"required":[516],"error":[513],"disabled":[516],"focused":[516],"forceShowTooltip":[516,"force-show-tooltip"],"focusMethod":[1,"focus-method"],"errorVariant":[1,"error-variant"],"_forceShowTooltip":[32]},[[0,"focusin","handleFocusIn"],[0,"focusout","handleFocusOut"]]],[1,"p-helper",{"placement":[1]}],[1,"p-input-error",{"error":[1],"forceShowTooltip":[4,"force-show-tooltip"],"_showTooltip":[32]}]]],["p-1079ffc6",[[1,"p-table-header",{"quickFilters":[16],"activeQuickFilterIdentifier":[1,"active-quick-filter-identifier"],"loading":[4],"enableSearch":[4,"enable-search"],"itemsSelectedAmount":[2,"items-selected-amount"],"query":[1025],"enableFilter":[4,"enable-filter"],"selectedFiltersAmount":[2,"selected-filters-amount"],"filterButtonTemplate":[16],"enableAction":[4,"enable-action"],"actionLoading":[4,"action-loading"],"actionIcon":[1,"action-icon"],"actionText":[1,"action-text"],"canUseAction":[1028,"can-use-action"],"actionButtonTemplate":[16],"_locales":[32]},[[16,"localeChanged","_setLocales"]]],[1,"p-table-footer",{"enablePageSize":[4,"enable-page-size"],"enablePagination":[4,"enable-pagination"],"enableExport":[4,"enable-export"],"loading":[4],"page":[1538],"total":[2],"pageSize":[2,"page-size"],"pageSizeOptions":[16],"hideOnSinglePage":[4,"hide-on-single-page"],"_locales":[32]},[[16,"localeChanged","_setLocales"]]],[4,"p-table-cell",{"variant":[1],"index":[2],"rowIndex":[2,"row-index"],"definition":[16],"item":[8],"value":[8],"checkbox":[8],"template":[16]}],[1,"p-table-row",{"variant":[1],"enableHover":[4,"enable-hover"]}],[1,"p-floating-menu-container",{"usedInTable":[4,"used-in-table"]}],[1,"p-floating-menu-item",{"hover":[516]}],[0,"p-illustration",{"variant":[1]}],[1,"p-table-container",{"shadow":[4]}]]]]'),e)));
1
+ import{p as e,b as a}from"./p-e4d5e7a7.js";export{s as setNonce}from"./p-e4d5e7a7.js";const t=()=>{const a=import.meta.url;const t={};if(a!==""){t.resourcesUrl=new URL(".",a).href}return e(t)};t().then((e=>a(JSON.parse('[["p-e4110d85",[[4,"p-button",{"variant":[1],"underline":[4],"href":[1],"target":[1],"size":[1],"type":[1],"loading":[4],"chevron":[8],"chevronPosition":[1,"chevron-position"],"disabled":[4],"icon":[1],"iconOnly":[4,"icon-only"],"iconPosition":[1,"icon-position"],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"],"inheritText":[4,"inherit-text"]},[[2,"click","handleClick"]]],[1,"p-loader",{"show":[4],"variant":[1],"color":[1],"modalTitle":[1,"modal-title"],"modalDescription":[1,"modal-description"]}],[0,"p-icon",{"variant":[1],"size":[1],"rotate":[2],"flip":[1]}]]],["p-a9ebacc8",[[4,"p-table",{"items":[1],"loading":[4],"headerLoading":[4,"header-loading"],"footerLoading":[4,"footer-loading"],"amountOfLoadingRows":[2,"amount-of-loading-rows"],"enableRowSelection":[4,"enable-row-selection"],"rowSelectionLimit":[2,"row-selection-limit"],"enableRowClick":[4,"enable-row-click"],"selectedRows":[16],"enableFloatingMenu":[4,"enable-floating-menu"],"floatingMenuAmountSelectedTemplate":[16],"selectionKey":[1,"selection-key"],"canSelectKey":[1,"can-select-key"],"enableHeader":[4,"enable-header"],"quickFilters":[16],"activeQuickFilterIdentifier":[1,"active-quick-filter-identifier"],"enableSearch":[4,"enable-search"],"query":[1025],"enableFilter":[4,"enable-filter"],"selectedFiltersAmount":[2,"selected-filters-amount"],"filterButtonTemplate":[16],"enableAction":[4,"enable-action"],"actionButtonLoading":[4,"action-button-loading"],"actionButtonEnabled":[4,"action-button-enabled"],"actionButtonIcon":[1,"action-button-icon"],"actionButtonText":[1,"action-button-text"],"actionButtonTemplate":[16],"enableFooter":[4,"enable-footer"],"enablePageSize":[4,"enable-page-size"],"enablePagination":[4,"enable-pagination"],"enableExport":[4,"enable-export"],"page":[1538],"total":[2],"pageSize":[2,"page-size"],"pageSizeOptions":[16],"hideOnSinglePage":[4,"hide-on-single-page"],"emptyStateHeader":[16],"emptyStateContent":[16],"emptyStateAction":[16],"enableEmptyStateAction":[4,"enable-empty-state-action"],"emptyStateFilteredHeader":[16],"emptyStateFilteredContent":[16],"shadow":[4],"_locales":[32],"_columns":[32],"_items":[32]},[[16,"localeChanged","_setLocales"],[16,"tableDefinitionChanged","onTableDefinitionUpdated"],[4,"keydown","keyDown"],[4,"keyup","keyUp"],[4,"visibilitychange","visibilityChange"]],{"items":["_parseItems"]}]]],["p-22a84714",[[0,"p-select",{"items":[1],"multi":[516],"icon":[1],"query":[1],"placeholder":[1],"autocompletePlaceholder":[1,"autocomplete-placeholder"],"value":[8],"displayKey":[1,"display-key"],"dropdownDisplayKey":[1,"dropdown-display-key"],"selectionDisplayKey":[1,"selection-display-key"],"valueKey":[1,"value-key"],"avatarKey":[1,"avatar-key"],"avatarLettersKey":[1,"avatar-letters-key"],"identifierKey":[1,"identifier-key"],"queryKey":[1,"query-key"],"autoSelectFirst":[4,"auto-select-first"],"showChevron":[4,"show-chevron"],"maxDisplayedItems":[2,"max-displayed-items"],"enableAutocomplete":[4,"enable-autocomplete"],"asyncFilter":[4,"async-filter"],"loading":[4],"enableSelectAll":[4,"enable-select-all"],"selectAllText":[1,"select-all-text"],"selectAllIcon":[1,"select-all-icon"],"size":[1],"prefix":[1],"label":[1],"helper":[1],"required":[516],"error":[513],"disabled":[516],"showAddItem":[4,"show-add-item"],"addItemText":[1,"add-item-text"],"emptyStateText":[1,"empty-state-text"],"_showDropdown":[32],"_selectedItem":[32],"_allSelected":[32],"_amountHidden":[32]},[[6,"click","documentClickHandler"]],{"value":["_valueChange"],"items":["itemChanges"],"_showDropdown":["_showDropdownChanges"],"multi":["multiChanges"]}]]],["p-3969a78e",[[1,"p-modal",{"size":[1],"variant":[1],"header":[1],"show":[4],"applyBlur":[4,"apply-blur"],"showClose":[4,"show-close"],"showMobileFooter":[4,"show-mobile-footer"],"backdropClickClose":[4,"backdrop-click-close"],"scrollLock":[4,"scroll-lock"],"padding":[4],"_closing":[32]},[[8,"closeModal","handleCloseModal"]]]]],["p-c9b840a7",[[0,"p-datepicker",{"placeholder":[1],"value":[1],"preselectToday":[4,"preselect-today"],"disabledDates":[1,"disabled-dates"],"minDate":[1,"min-date"],"maxDate":[1,"max-date"],"disableWeekends":[4,"disable-weekends"],"mode":[1],"format":[1],"size":[1],"prefix":[1],"label":[1],"helper":[1],"required":[516],"error":[513],"disabled":[516],"_showDropdown":[32],"_value":[32],"_minDate":[32],"_maxDate":[32],"_disabledDates":[32]},[[6,"click","documentClickHandler"]],{"value":["parseValue"],"minDate":["parseMinDate"],"maxDate":["parseMaxDate"],"disabledDates":["parseDisabledDates"]}]]],["p-60400a89",[[1,"p-drawer",{"header":[1],"show":[4],"applyBlur":[4,"apply-blur"],"showClose":[4,"show-close"],"backdropClickClose":[4,"backdrop-click-close"],"canClose":[4,"can-close"],"scrollLock":[4,"scroll-lock"],"_closing":[32]},[[8,"closeDrawer","handleCloseDrawer"],[8,"forceCloseDrawer","handleForceCloseDrawer"]]]]],["p-699e0b35",[[1,"p-attachment",{"mode":[1],"loading":[4],"error":[1],"downloading":[4]}]]],["p-179efb16",[[1,"p-navbar",{"closeText":[1,"close-text"],"menuText":[1,"menu-text"],"_showMenu":[32]},[[8,"closeNavbar","handleCloseNavbar"],[8,"openNavbar","handleOpenNavbar"]]]]],["p-2d3ff364",[[1,"p-profile",{"variant":[1],"size":[513],"_dropdownOpen":[32]}]]],["p-4c30c74b",[[1,"p-toast",{"variant":[1],"header":[1],"content":[1],"enableAction":[4,"enable-action"],"actionIcon":[1,"action-icon"],"actionIconFlip":[1,"action-icon-flip"],"actionIconRotate":[2,"action-icon-rotate"]}]]],["p-a2b552f9",[[1,"p-divider",{"variant":[513]}]]],["p-d0796984",[[1,"p-accordion",{"header":[1],"open":[4],"closeable":[4],"openable":[4]}]]],["p-fffaacc2",[[1,"p-navigation-item",{"active":[4],"icon":[1],"counter":[8],"href":[1],"target":[1]}]]],["p-f9e9370b",[[4,"p-card-header",{"header":[1],"arrow":[4]}]]],["p-cb2674b5",[[1,"p-content-slider",{"hideMobileIndicator":[4,"hide-mobile-indicator"],"disableDrag":[4,"disable-drag"],"disableAutoCenter":[4,"disable-auto-center"],"disableIndicatorClick":[4,"disable-indicator-click"],"_visibleIndex":[32],"_outerHeight":[32],"_totalWidth":[32],"_dragging":[32]},[[9,"mouseup","mouseUpHandler"],[9,"touchend","mouseUpHandler"],[9,"resize","resizeHandler"]]]]],["p-7bf042c9",[[1,"p-cropper",{"variant":[513],"value":[8],"returnType":[1,"return-type"],"_loaded":[32],"_currentScale":[32]},[[9,"resize","onResize"]]]]],["p-97bcf0b5",[[1,"p-info-panel",{"variant":[1],"header":[1],"content":[1],"closeable":[4]}]]],["p-cf7bd354",[[4,"p-status",{"variant":[1],"icon":[1],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"]}]]],["p-d8641c29",[[1,"p-stepper-line",{"active":[516],"direction":[513]}]]],["p-c7c6176b",[[1,"p-stepper",{"activeStep":[2,"active-step"],"direction":[513],"contentPosition":[513,"content-position"]},null,{"activeStep":["_generateSteps"]}]]],["p-eebab75d",[[1,"p-stepper-item",{"align":[513],"direction":[513],"contentPosition":[513,"content-position"],"finished":[516],"active":[516]}]]],["p-ec29eed0",[[1,"p-tab-group"]]],["p-af6b813e",[[4,"p-avatar-group",{"extra":[2]}]]],["p-8426ca20",[[4,"p-card-body",{"inheritText":[516,"inherit-text"]}]]],["p-f0f1a46b",[[1,"p-card-container",{"hoverable":[516],"shadow":[516]}]]],["p-bbe63029",[[1,"p-layout",{"variant":[1]}]]],["p-7793ba3a",[[1,"p-tab-item",{"active":[4]}]]],["p-4dc5647e",[[0,"p-table-column",{"path":[1537],"type":[1537],"name":[1537],"useSlot":[1540,"use-slot"],"hasCheckbox":[1540,"has-checkbox"],"align":[1537],"isLast":[1540,"is-last"],"sizes":[1032]}]]],["p-606ad811",[[1,"p-toast-container",{"placement":[1]}]]],["p-dace47c5",[[1,"p-calendar",{"variant":[1],"value":[1],"preselectToday":[4,"preselect-today"],"disabledDates":[1,"disabled-dates"],"minDate":[1,"min-date"],"maxDate":[1,"max-date"],"disableWeekends":[4,"disable-weekends"],"mode":[1],"_view":[32],"_viewDate":[32],"_value":[32],"_minDate":[32],"_maxDate":[32],"_disabledDates":[32]},null,{"value":["_parseValue"],"minDate":["_parseMinDate"],"maxDate":["_parseMaxDate"],"disabledDates":["_parseDisabledDates"]}]]],["p-0cbff44f",[[0,"p-avatar",{"variant":[513],"size":[513],"defaultImage":[1,"default-image"],"src":[1],"letters":[1],"_src":[32],"_failed":[32]},null,{"src":["onSrchChange"]}]]],["p-2becd73c",[[1,"p-counter",{"variant":[1],"size":[1]}]]],["p-ec15ee73",[[1,"p-slider-indicator",{"active":[4]}]]],["p-4e9e4ce2",[[1,"p-drawer-header",{"showClose":[4,"show-close"]}],[1,"p-drawer-body",{"variant":[1]}],[4,"p-drawer-container",{"closing":[4]}]]],["p-b848c222",[[1,"p-backdrop",{"variant":[1],"applyBlur":[4,"apply-blur"],"closing":[4],"scrollLock":[4,"scroll-lock"]},[[2,"click","handleClick"]]]]],["p-bf1ffb6a",[[1,"p-modal-header",{"showClose":[4,"show-close"]}],[1,"p-modal-footer"],[1,"p-modal-body",{"variant":[1],"rounded":[4],"padding":[4]}],[4,"p-modal-container",{"size":[1],"closing":[4]}]]],["p-2cd5062f",[[1,"p-label",{"variant":[513],"behavior":[513],"iconPosition":[1,"icon-position"],"icon":[513],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"],"size":[513],"keepMobileContent":[516,"keep-mobile-content"]}],[1,"p-segment-item",{"active":[4],"iconOnly":[4,"icon-only"],"size":[513],"icon":[1],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"]}],[4,"p-segment-container"]]],["p-8873dc41",[[4,"p-dropdown-menu-container",{"maxWidth":[4,"max-width"],"fullWidth":[4,"full-width"],"scrollable":[8]}]]],["p-d9267cc3",[[1,"p-dropdown-menu-item",{"active":[4],"variant":[1],"enableHover":[4,"enable-hover"],"icon":[1]}],[1,"p-dropdown",{"placement":[513],"strategy":[1],"show":[4],"calculateWidth":[4,"calculate-width"],"applyMaxWidth":[4,"apply-max-width"],"applyFullWidth":[4,"apply-full-width"],"scrollable":[8],"insideClick":[4,"inside-click"],"disableTriggerClick":[4,"disable-trigger-click"],"applyChevron":[4,"apply-chevron"],"chevronPosition":[1,"chevron-position"],"chevronDirection":[1,"chevron-direction"]},[[6,"click","documentClickHandler"]],{"show":["onShowChange"]}]]],["p-35c563a7",[[1,"p-page-size-select",{"size":[1538],"sizeOptions":[16],"chevronPosition":[1,"chevron-position"],"buttonSize":[1,"button-size"],"buttonTemplate":[16],"itemTemplate":[16],"hidden":[4],"_locales":[32]},[[16,"localeChanged","_setLocales"]]],[0,"p-pagination",{"page":[1538],"pageSize":[2,"page-size"],"hideOnSinglePage":[4,"hide-on-single-page"],"total":[2]},null,{"page":["pageChangeHandler"],"pageSize":["pageChangeHandler"],"total":["pageChangeHandler"]}],[1,"p-pagination-item",{"active":[4]}]]],["p-1ddbc9f2",[[1,"p-tooltip",{"variant":[1],"content":[8],"placement":[1],"strategy":[1],"enableUserInput":[4,"enable-user-input"],"show":[4],"canManuallyClose":[4,"can-manually-close"]},[[2,"click","clickHandler"],[6,"click","documentClickHandler"],[1,"mouseenter","mouseEnterHandler"],[0,"focus","mouseEnterHandler"],[1,"mouseleave","mouseLeaveHandler"],[0,"blur","mouseLeaveHandler"]],{"show":["onShowChange"]}]]],["p-13e80641",[[1,"p-input-group",{"size":[1],"prefix":[1],"suffix":[1],"icon":[1],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"],"iconPosition":[1,"icon-position"],"label":[1],"helper":[1],"required":[516],"error":[513],"disabled":[516],"focused":[516],"forceShowTooltip":[516,"force-show-tooltip"],"focusMethod":[1,"focus-method"],"errorVariant":[1,"error-variant"],"_forceShowTooltip":[32]},[[0,"focusin","handleFocusIn"],[0,"focusout","handleFocusOut"]]],[1,"p-helper",{"placement":[1]}],[1,"p-input-error",{"error":[1],"forceShowTooltip":[4,"force-show-tooltip"],"_showTooltip":[32]}]]],["p-1079ffc6",[[1,"p-table-header",{"quickFilters":[16],"activeQuickFilterIdentifier":[1,"active-quick-filter-identifier"],"loading":[4],"enableSearch":[4,"enable-search"],"itemsSelectedAmount":[2,"items-selected-amount"],"query":[1025],"enableFilter":[4,"enable-filter"],"selectedFiltersAmount":[2,"selected-filters-amount"],"filterButtonTemplate":[16],"enableAction":[4,"enable-action"],"actionLoading":[4,"action-loading"],"actionIcon":[1,"action-icon"],"actionText":[1,"action-text"],"canUseAction":[1028,"can-use-action"],"actionButtonTemplate":[16],"_locales":[32]},[[16,"localeChanged","_setLocales"]]],[1,"p-table-footer",{"enablePageSize":[4,"enable-page-size"],"enablePagination":[4,"enable-pagination"],"enableExport":[4,"enable-export"],"loading":[4],"page":[1538],"total":[2],"pageSize":[2,"page-size"],"pageSizeOptions":[16],"hideOnSinglePage":[4,"hide-on-single-page"],"_locales":[32]},[[16,"localeChanged","_setLocales"]]],[4,"p-table-cell",{"variant":[1],"index":[2],"rowIndex":[2,"row-index"],"definition":[16],"item":[8],"value":[8],"checkbox":[8],"template":[16]}],[1,"p-table-row",{"variant":[1],"enableHover":[4,"enable-hover"]}],[1,"p-floating-menu-container",{"usedInTable":[4,"used-in-table"]}],[1,"p-floating-menu-item",{"hover":[516]}],[0,"p-illustration",{"variant":[1]}],[1,"p-table-container",{"shadow":[4]}]]]]'),e)));
2
2
  //# sourceMappingURL=paperless.esm.js.map
@@ -17,15 +17,13 @@ const Stepper = class {
17
17
  }
18
18
  // private _steps: Array<HTMLPStepperItemElement>;
19
19
  componentDidLoad() {
20
- setTimeout(() => {
21
- this._generateSteps(true);
22
- this._loaded = true;
23
- }, 500);
20
+ this._loaded = true;
21
+ this._generateSteps(true);
24
22
  }
25
23
  render() {
26
24
  return (index.h(index.Host, { class: "p-stepper" }, index.h("slot", { onSlotchange: () => this._generateSteps() })));
27
25
  }
28
- _generateSteps(firstLoad = false) {
26
+ async _generateSteps(firstLoad = false) {
29
27
  if (!firstLoad && (!this._el || this._rendering || !this._loaded)) {
30
28
  return;
31
29
  }
@@ -44,9 +42,13 @@ const Stepper = class {
44
42
  }
45
43
  }
46
44
  for (let i = 0; i < (items === null || items === void 0 ? void 0 : items.length); i++) {
45
+ let directionChanged = false;
47
46
  const item = items.item(i);
48
47
  item.active = i === activeStep;
49
48
  item.finished = i < activeStep;
49
+ if (item.direction !== this.direction) {
50
+ directionChanged = true;
51
+ }
50
52
  item.direction = this.direction;
51
53
  item.align =
52
54
  i === 0 ? 'start' : i === (items === null || items === void 0 ? void 0 : items.length) - 1 ? 'end' : 'center';
@@ -55,6 +57,11 @@ const Stepper = class {
55
57
  const nextItem = item.nextElementSibling;
56
58
  if (nextItem &&
57
59
  nextItem.tagName.toLowerCase() === 'p-stepper-item') {
60
+ // super hacky, but we want to wait for the css of the `item.direction` change to be applied before querying for the item.clientHeight
61
+ // otherwise we always get the initial "16"
62
+ if (directionChanged) {
63
+ await new Promise((resolve) => setTimeout(resolve, 10));
64
+ }
58
65
  const heightDiff = (item.clientHeight > 16
59
66
  ? item.clientHeight - 16
60
67
  : item.clientHeight) / 2;
@@ -67,6 +74,11 @@ const Stepper = class {
67
74
  stepperLine.style.minHeight = `calc(1rem + ${(heightDiff * 2) / 16}rem)`;
68
75
  }
69
76
  this._el.insertBefore(stepperLine, nextItem);
77
+ const previous = stepperLine.previousElementSibling;
78
+ if (previous &&
79
+ previous.tagName.toLowerCase() === 'p-stepper-line') {
80
+ previous.remove();
81
+ }
70
82
  continue;
71
83
  }
72
84
  }
@@ -78,16 +90,10 @@ const Stepper = class {
78
90
  }
79
91
  }
80
92
  }
81
- const lines = this._el.querySelectorAll('p-stepper-line');
93
+ const lines = this._el.querySelectorAll('p-stepper-line + p-stepper-line, p-stepper-line:not(:has(+ p-stepper-item))');
82
94
  for (let j = lines.length - 1; j >= 0; j--) {
83
95
  const line = lines.item(j);
84
- const next = line === null || line === void 0 ? void 0 : line.nextElementSibling;
85
- if (next && next.tagName.toLowerCase() === 'p-stepper-line') {
86
- next.remove();
87
- }
88
- if (!next) {
89
- line.remove();
90
- }
96
+ line.remove();
91
97
  }
92
98
  setTimeout(() => (this._rendering = false), 100);
93
99
  }
@@ -1 +1 @@
1
- {"file":"p-stepper.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,mBAAmB,GAAG,gfAAgf;;MCO/f,OAAO;;;IAsBX,eAAU,GAAG,KAAK,CAAC;IACnB,YAAO,GAAG,KAAK,CAAC;sBAnBK,CAAC;qBAM7B,YAAY;2BAK+C,KAAK;;;EAYjE,gBAAgB;IACf,UAAU,CAAC;MACV,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;MAC1B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;KACpB,EAAE,GAAG,CAAC,CAAC;GACR;EAED,MAAM;IACL,QACCA,QAACC,UAAI,IAAC,KAAK,EAAC,WAAW,IACtBD,kBAAM,YAAY,EAAE,MAAM,IAAI,CAAC,cAAc,EAAE,GAAI,CAC7C,EACN;GACF;EAGO,cAAc,CAAC,SAAS,GAAG,KAAK;IACvC,IAAI,CAAC,SAAS,KAAK,CAAC,IA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AS,CAAC;UACxC,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC;SACnD;OACD;KACD;IAED,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IAC1D,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;MAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;MAC3B,MAAM,IAAI,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,kBAAkB,CAAC;MACtC,IAAI,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,gBAAgB,EAAE;QAC5D,IAAI,CAAC,MAAM,EAAE,CAAC;OACd;MAED,IAAI,CAAC,IAAI,EAAE;QACV,IAAI,CAAC,MAAM,EAAE,CAAC;OACd;KACD;IAED,UAAU,CAAC,OAAO,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;GACjD;;;;;;;;;;","names":["h","Host"],"sources":["src/components/molecules/stepper/stepper.component.scss?tag=p-stepper&encapsulation=shadow","src/components/molecules/stepper/stepper.component.tsx"],"sourcesContent":[":host {\n\t@apply flex;\n}\n\n:host([direction='horizontal']) {\n\t@apply h-auto items-end;\n}\n\n:host([direction='vertical']) {\n\t@apply flex-col flex-wrap items-start;\n\t@apply w-full min-h-full;\n}\n\n:host([direction='vertical'][content-position='start']) {\n\t@apply items-end;\n}\n","import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\n@Component({\n\ttag: 'p-stepper',\n\tstyleUrl: 'stepper.component.scss',\n\tshadow: true,\n})\nexport class Stepper {\n\t/**\n\t * The currently active step\n\t */\n\t@Prop() activeStep: number = 1;\n\n\t/**\n\t * The direction of the stepper\n\t */\n\t@Prop({ reflect: true }) direction: 'horizontal' | 'vertical' =\n\t\t'horizontal';\n\n\t/**\n\t * The position of the content in case of vertical direction\n\t */\n\t@Prop({ reflect: true }) contentPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\tprivate _rendering = false;\n\tprivate _loaded = false;\n\n\t// private _steps: Array<HTMLPStepperItemElement>;\n\n\tcomponentDidLoad() {\n\t\tsetTimeout(() => {\n\t\t\tthis._generateSteps(true);\n\t\t\tthis._loaded = true;\n\t\t}, 500);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class=\"p-stepper\">\n\t\t\t\t<slot onSlotchange={() => this._generateSteps()} />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Watch('activeStep')\n\tprivate _generateSteps(firstLoad = false) {\n\t\tif (!firstLoad && (!this._el || this._rendering || !this._loaded)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._rendering = true;\n\n\t\tlet activeStep = this.activeStep - 1 || 0;\n\t\tconst items = this._el.querySelectorAll('p-stepper-item');\n\n\t\tif (!this.activeStep || activeStep < 0) {\n\t\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\t\tconst item = items.item(i) as any;\n\n\t\t\t\tif (item.active) {\n\t\t\t\t\tactiveStep = i;\n\t\t\t\t}\n\n\t\t\t\tif (activeStep < 0 && item.finished) {\n\t\t\t\t\tactiveStep = i + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\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\titem.active = i === activeStep;\n\t\t\titem.finished = i < activeStep;\n\t\t\titem.direction = this.direction;\n\t\t\titem.align =\n\t\t\t\ti === 0 ? 'start' : i === items?.length - 1 ? 'end' : 'center';\n\t\t\titem.contentPosition = this.contentPosition;\n\n\t\t\tif (i < items.length - 1) {\n\t\t\t\tconst nextItem = item.nextElementSibling;\n\t\t\t\tif (\n\t\t\t\t\tnextItem &&\n\t\t\t\t\tnextItem.tagName.toLowerCase() === 'p-stepper-item'\n\t\t\t\t) {\n\t\t\t\t\tconst heightDiff =\n\t\t\t\t\t\t(item.clientHeight > 16\n\t\t\t\t\t\t\t? item.clientHeight - 16\n\t\t\t\t\t\t\t: item.clientHeight) / 2;\n\n\t\t\t\t\tconst stepperLine =\n\t\t\t\t\t\tdocument.createElement('p-stepper-line');\n\n\t\t\t\t\tstepperLine.direction = this.direction;\n\t\t\t\t\tstepperLine.active = i <= activeStep;\n\n\t\t\t\t\tif (heightDiff > 0 && this.direction === 'vertical') {\n\t\t\t\t\t\tstepperLine.style.marginTop = `-${heightDiff / 16}rem`;\n\t\t\t\t\t\tstepperLine.style.marginBottom = `-${\n\t\t\t\t\t\t\theightDiff / 16\n\t\t\t\t\t\t}rem`;\n\t\t\t\t\t\tstepperLine.style.minHeight = `calc(1rem + ${\n\t\t\t\t\t\t\t(heightDiff * 2) / 16\n\t\t\t\t\t\t}rem)`;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._el.insertBefore(stepperLine, nextItem);\n\n\t\t\t\t\tcontinue;\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 (previousItem.tagName.toLowerCase() === 'p-stepper-line') {\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('p-stepper-line');\n\t\tfor (let j = lines.length - 1; j >= 0; j--) {\n\t\t\tconst line = lines.item(j);\n\t\t\tconst next = line?.nextElementSibling;\n\t\t\tif (next && next.tagName.toLowerCase() === 'p-stepper-line') {\n\t\t\t\tnext.remove();\n\t\t\t}\n\n\t\t\tif (!next) {\n\t\t\t\tline.remove();\n\t\t\t}\n\t\t}\n\n\t\tsetTimeout(() => (this._rendering = false), 100);\n\t}\n}\n"],"version":3}
1
+ {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CAAC,EAAE,CAAC,EAAE,EAAE;MAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;MAC3B,IAAI,CAAC,MAAM,EAAE,CAAC;KACd;IAED,UAAU,CAAC,OAAO,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;GACjD;;;;;;;;;;","names":["h","Host"],"sources":["src/components/molecules/stepper/stepper.component.scss?tag=p-stepper&encapsulation=shadow","src/components/molecules/stepper/stepper.component.tsx"],"sourcesContent":[":host {\n\t@apply flex;\n}\n\n:host([direction='horizontal']) {\n\t@apply h-auto items-end;\n}\n\n:host([direction='vertical']) {\n\t@apply flex-col flex-wrap items-start;\n\t@apply w-full min-h-full;\n}\n\n:host([direction='vertical'][content-position='start']) {\n\t@apply items-end;\n}\n","import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\n@Component({\n\ttag: 'p-stepper',\n\tstyleUrl: 'stepper.component.scss',\n\tshadow: true,\n})\nexport class Stepper {\n\t/**\n\t * The currently active step\n\t */\n\t@Prop() activeStep: number = 1;\n\n\t/**\n\t * The direction of the stepper\n\t */\n\t@Prop({ reflect: true }) direction: 'horizontal' | 'vertical' =\n\t\t'horizontal';\n\n\t/**\n\t * The position of the content in case of vertical direction\n\t */\n\t@Prop({ reflect: true }) contentPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\tprivate _rendering = false;\n\tprivate _loaded = false;\n\n\t// private _steps: Array<HTMLPStepperItemElement>;\n\n\tcomponentDidLoad() {\n\t\tthis._loaded = true;\n\t\tthis._generateSteps(true);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class=\"p-stepper\">\n\t\t\t\t<slot onSlotchange={() => this._generateSteps()} />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Watch('activeStep')\n\tprivate async _generateSteps(firstLoad = false) {\n\t\tif (!firstLoad && (!this._el || this._rendering || !this._loaded)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._rendering = true;\n\n\t\tlet activeStep = this.activeStep - 1 || 0;\n\t\tconst items = this._el.querySelectorAll('p-stepper-item');\n\n\t\tif (!this.activeStep || activeStep < 0) {\n\t\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\t\tconst item = items.item(i) as any;\n\n\t\t\t\tif (item.active) {\n\t\t\t\t\tactiveStep = i;\n\t\t\t\t}\n\n\t\t\t\tif (activeStep < 0 && item.finished) {\n\t\t\t\t\tactiveStep = i + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\tlet directionChanged = false;\n\t\t\tconst item = items.item(i) as any;\n\n\t\t\titem.active = i === activeStep;\n\t\t\titem.finished = i < activeStep;\n\n\t\t\tif (item.direction !== this.direction) {\n\t\t\t\tdirectionChanged = true;\n\t\t\t}\n\n\t\t\titem.direction = this.direction;\n\t\t\titem.align =\n\t\t\t\ti === 0 ? 'start' : i === items?.length - 1 ? 'end' : 'center';\n\t\t\titem.contentPosition = this.contentPosition;\n\n\t\t\tif (i < items.length - 1) {\n\t\t\t\tconst nextItem = item.nextElementSibling;\n\n\t\t\t\tif (\n\t\t\t\t\tnextItem &&\n\t\t\t\t\tnextItem.tagName.toLowerCase() === 'p-stepper-item'\n\t\t\t\t) {\n\t\t\t\t\t// super hacky, but we want to wait for the css of the `item.direction` change to be applied before querying for the item.clientHeight\n\t\t\t\t\t// otherwise we always get the initial \"16\"\n\t\t\t\t\tif (directionChanged) {\n\t\t\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, 10));\n\t\t\t\t\t}\n\n\t\t\t\t\tconst heightDiff =\n\t\t\t\t\t\t(item.clientHeight > 16\n\t\t\t\t\t\t\t? item.clientHeight - 16\n\t\t\t\t\t\t\t: item.clientHeight) / 2;\n\n\t\t\t\t\tconst stepperLine =\n\t\t\t\t\t\tdocument.createElement('p-stepper-line');\n\n\t\t\t\t\tstepperLine.direction = this.direction;\n\t\t\t\t\tstepperLine.active = i <= activeStep;\n\n\t\t\t\t\tif (heightDiff > 0 && this.direction === 'vertical') {\n\t\t\t\t\t\tstepperLine.style.marginTop = `-${heightDiff / 16}rem`;\n\t\t\t\t\t\tstepperLine.style.marginBottom = `-${\n\t\t\t\t\t\t\theightDiff / 16\n\t\t\t\t\t\t}rem`;\n\t\t\t\t\t\tstepperLine.style.minHeight = `calc(1rem + ${\n\t\t\t\t\t\t\t(heightDiff * 2) / 16\n\t\t\t\t\t\t}rem)`;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._el.insertBefore(stepperLine, nextItem);\n\n\t\t\t\t\tconst previous = stepperLine.previousElementSibling;\n\t\t\t\t\tif (\n\t\t\t\t\t\tprevious &&\n\t\t\t\t\t\tprevious.tagName.toLowerCase() === 'p-stepper-line'\n\t\t\t\t\t) {\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\t\t\t}\n\n\t\t\tif (i > 0) {\n\t\t\t\tconst previousItem = item.previousElementSibling;\n\t\t\t\tif (previousItem.tagName.toLowerCase() === 'p-stepper-line') {\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 + p-stepper-line, p-stepper-line:not(:has(+ p-stepper-item))'\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\tsetTimeout(() => (this._rendering = false), 100);\n\t}\n}\n"],"version":3}
@@ -9,15 +9,13 @@ export class Stepper {
9
9
  }
10
10
  // private _steps: Array<HTMLPStepperItemElement>;
11
11
  componentDidLoad() {
12
- setTimeout(() => {
13
- this._generateSteps(true);
14
- this._loaded = true;
15
- }, 500);
12
+ this._loaded = true;
13
+ this._generateSteps(true);
16
14
  }
17
15
  render() {
18
16
  return (h(Host, { class: "p-stepper" }, h("slot", { onSlotchange: () => this._generateSteps() })));
19
17
  }
20
- _generateSteps(firstLoad = false) {
18
+ async _generateSteps(firstLoad = false) {
21
19
  if (!firstLoad && (!this._el || this._rendering || !this._loaded)) {
22
20
  return;
23
21
  }
@@ -36,9 +34,13 @@ export class Stepper {
36
34
  }
37
35
  }
38
36
  for (let i = 0; i < (items === null || items === void 0 ? void 0 : items.length); i++) {
37
+ let directionChanged = false;
39
38
  const item = items.item(i);
40
39
  item.active = i === activeStep;
41
40
  item.finished = i < activeStep;
41
+ if (item.direction !== this.direction) {
42
+ directionChanged = true;
43
+ }
42
44
  item.direction = this.direction;
43
45
  item.align =
44
46
  i === 0 ? 'start' : i === (items === null || items === void 0 ? void 0 : items.length) - 1 ? 'end' : 'center';
@@ -47,6 +49,11 @@ export class Stepper {
47
49
  const nextItem = item.nextElementSibling;
48
50
  if (nextItem &&
49
51
  nextItem.tagName.toLowerCase() === 'p-stepper-item') {
52
+ // super hacky, but we want to wait for the css of the `item.direction` change to be applied before querying for the item.clientHeight
53
+ // otherwise we always get the initial "16"
54
+ if (directionChanged) {
55
+ await new Promise((resolve) => setTimeout(resolve, 10));
56
+ }
50
57
  const heightDiff = (item.clientHeight > 16
51
58
  ? item.clientHeight - 16
52
59
  : item.clientHeight) / 2;
@@ -59,6 +66,11 @@ export class Stepper {
59
66
  stepperLine.style.minHeight = `calc(1rem + ${(heightDiff * 2) / 16}rem)`;
60
67
  }
61
68
  this._el.insertBefore(stepperLine, nextItem);
69
+ const previous = stepperLine.previousElementSibling;
70
+ if (previous &&
71
+ previous.tagName.toLowerCase() === 'p-stepper-line') {
72
+ previous.remove();
73
+ }
62
74
  continue;
63
75
  }
64
76
  }
@@ -70,16 +82,10 @@ export class Stepper {
70
82
  }
71
83
  }
72
84
  }
73
- const lines = this._el.querySelectorAll('p-stepper-line');
85
+ const lines = this._el.querySelectorAll('p-stepper-line + p-stepper-line, p-stepper-line:not(:has(+ p-stepper-item))');
74
86
  for (let j = lines.length - 1; j >= 0; j--) {
75
87
  const line = lines.item(j);
76
- const next = line === null || line === void 0 ? void 0 : line.nextElementSibling;
77
- if (next && next.tagName.toLowerCase() === 'p-stepper-line') {
78
- next.remove();
79
- }
80
- if (!next) {
81
- line.remove();
82
- }
88
+ line.remove();
83
89
  }
84
90
  setTimeout(() => (this._rendering = false), 100);
85
91
  }
@@ -1 +1 @@
1
- {"version":3,"file":"stepper.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/stepper/stepper.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAOzE,MAAM,OAAO,OAAO;;IAsBX,eAAU,GAAG,KAAK,CAAC;IACnB,YAAO,GAAG,KAAK,CAAC;sBAnBK,CAAC;qBAM7B,YAAY;2BAK+C,KAAK;;EAUjE,kDAAkD;EAElD,gBAAgB;IACf,UAAU,CAAC,GAAG,EAAE;MACf,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;MAC1B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACrB,CAAC,EAAE,GAAG,CAAC,CAAC;EACT,CAAC;EAED,MAAM;IACL,OAAO,CACN,EAAC,IAAI,IAAC,KAAK,EAAC,WAAW;MACtB,YAAM,YAAY,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE,GAAI,CAC7C,CACP,CAAC;EACH,CAAC;EAGO,cAAc,CAAC,SAAS,GAAG,KAAK;IACvC,IAAI,CAAC,SAAS,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;MAClE,OAAO;KACP;IAED,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IAEvB,IAAI,UAAU,G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QAAQ,CAAC;SACnD;OACD;KACD;IAED,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IAC1D,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;MAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;MAC3B,MAAM,IAAI,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,kBAAkB,CAAC;MACtC,IAAI,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,gBAAgB,EAAE;QAC5D,IAAI,CAAC,MAAM,EAAE,CAAC;OACd;MAED,IAAI,CAAC,IAAI,EAAE;QACV,IAAI,CAAC,MAAM,EAAE,CAAC;OACd;KACD;IAED,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;EAClD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\n@Component({\n\ttag: 'p-stepper',\n\tstyleUrl: 'stepper.component.scss',\n\tshadow: true,\n})\nexport class Stepper {\n\t/**\n\t * The currently active step\n\t */\n\t@Prop() activeStep: number = 1;\n\n\t/**\n\t * The direction of the stepper\n\t */\n\t@Prop({ reflect: true }) direction: 'horizontal' | 'vertical' =\n\t\t'horizontal';\n\n\t/**\n\t * The position of the content in case of vertical direction\n\t */\n\t@Prop({ reflect: true }) contentPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\tprivate _rendering = false;\n\tprivate _loaded = false;\n\n\t// private _steps: Array<HTMLPStepperItemElement>;\n\n\tcomponentDidLoad() {\n\t\tsetTimeout(() => {\n\t\t\tthis._generateSteps(true);\n\t\t\tthis._loaded = true;\n\t\t}, 500);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class=\"p-stepper\">\n\t\t\t\t<slot onSlotchange={() => this._generateSteps()} />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Watch('activeStep')\n\tprivate _generateSteps(firstLoad = false) {\n\t\tif (!firstLoad && (!this._el || this._rendering || !this._loaded)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._rendering = true;\n\n\t\tlet activeStep = this.activeStep - 1 || 0;\n\t\tconst items = this._el.querySelectorAll('p-stepper-item');\n\n\t\tif (!this.activeStep || activeStep < 0) {\n\t\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\t\tconst item = items.item(i) as any;\n\n\t\t\t\tif (item.active) {\n\t\t\t\t\tactiveStep = i;\n\t\t\t\t}\n\n\t\t\t\tif (activeStep < 0 && item.finished) {\n\t\t\t\t\tactiveStep = i + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\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\titem.active = i === activeStep;\n\t\t\titem.finished = i < activeStep;\n\t\t\titem.direction = this.direction;\n\t\t\titem.align =\n\t\t\t\ti === 0 ? 'start' : i === items?.length - 1 ? 'end' : 'center';\n\t\t\titem.contentPosition = this.contentPosition;\n\n\t\t\tif (i < items.length - 1) {\n\t\t\t\tconst nextItem = item.nextElementSibling;\n\t\t\t\tif (\n\t\t\t\t\tnextItem &&\n\t\t\t\t\tnextItem.tagName.toLowerCase() === 'p-stepper-item'\n\t\t\t\t) {\n\t\t\t\t\tconst heightDiff =\n\t\t\t\t\t\t(item.clientHeight > 16\n\t\t\t\t\t\t\t? item.clientHeight - 16\n\t\t\t\t\t\t\t: item.clientHeight) / 2;\n\n\t\t\t\t\tconst stepperLine =\n\t\t\t\t\t\tdocument.createElement('p-stepper-line');\n\n\t\t\t\t\tstepperLine.direction = this.direction;\n\t\t\t\t\tstepperLine.active = i <= activeStep;\n\n\t\t\t\t\tif (heightDiff > 0 && this.direction === 'vertical') {\n\t\t\t\t\t\tstepperLine.style.marginTop = `-${heightDiff / 16}rem`;\n\t\t\t\t\t\tstepperLine.style.marginBottom = `-${\n\t\t\t\t\t\t\theightDiff / 16\n\t\t\t\t\t\t}rem`;\n\t\t\t\t\t\tstepperLine.style.minHeight = `calc(1rem + ${\n\t\t\t\t\t\t\t(heightDiff * 2) / 16\n\t\t\t\t\t\t}rem)`;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._el.insertBefore(stepperLine, nextItem);\n\n\t\t\t\t\tcontinue;\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 (previousItem.tagName.toLowerCase() === 'p-stepper-line') {\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('p-stepper-line');\n\t\tfor (let j = lines.length - 1; j >= 0; j--) {\n\t\t\tconst line = lines.item(j);\n\t\t\tconst next = line?.nextElementSibling;\n\t\t\tif (next && next.tagName.toLowerCase() === 'p-stepper-line') {\n\t\t\t\tnext.remove();\n\t\t\t}\n\n\t\t\tif (!next) {\n\t\t\t\tline.remove();\n\t\t\t}\n\t\t}\n\n\t\tsetTimeout(() => (this._rendering = false), 100);\n\t}\n}\n"]}
1
+ {"version":3,"file":"stepper.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/stepper/stepper.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAOzE,MAAM,OAAO,OAAO;;IAsBX,eAAU,GAAG,KAAK,CAAC;IACn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AAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;MAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;MAC3B,IAAI,CAAC,MAAM,EAAE,CAAC;KACd;IAED,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;EAClD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\n@Component({\n\ttag: 'p-stepper',\n\tstyleUrl: 'stepper.component.scss',\n\tshadow: true,\n})\nexport class Stepper {\n\t/**\n\t * The currently active step\n\t */\n\t@Prop() activeStep: number = 1;\n\n\t/**\n\t * The direction of the stepper\n\t */\n\t@Prop({ reflect: true }) direction: 'horizontal' | 'vertical' =\n\t\t'horizontal';\n\n\t/**\n\t * The position of the content in case of vertical direction\n\t */\n\t@Prop({ reflect: true }) contentPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\tprivate _rendering = false;\n\tprivate _loaded = false;\n\n\t// private _steps: Array<HTMLPStepperItemElement>;\n\n\tcomponentDidLoad() {\n\t\tthis._loaded = true;\n\t\tthis._generateSteps(true);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class=\"p-stepper\">\n\t\t\t\t<slot onSlotchange={() => this._generateSteps()} />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Watch('activeStep')\n\tprivate async _generateSteps(firstLoad = false) {\n\t\tif (!firstLoad && (!this._el || this._rendering || !this._loaded)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._rendering = true;\n\n\t\tlet activeStep = this.activeStep - 1 || 0;\n\t\tconst items = this._el.querySelectorAll('p-stepper-item');\n\n\t\tif (!this.activeStep || activeStep < 0) {\n\t\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\t\tconst item = items.item(i) as any;\n\n\t\t\t\tif (item.active) {\n\t\t\t\t\tactiveStep = i;\n\t\t\t\t}\n\n\t\t\t\tif (activeStep < 0 && item.finished) {\n\t\t\t\t\tactiveStep = i + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\tlet directionChanged = false;\n\t\t\tconst item = items.item(i) as any;\n\n\t\t\titem.active = i === activeStep;\n\t\t\titem.finished = i < activeStep;\n\n\t\t\tif (item.direction !== this.direction) {\n\t\t\t\tdirectionChanged = true;\n\t\t\t}\n\n\t\t\titem.direction = this.direction;\n\t\t\titem.align =\n\t\t\t\ti === 0 ? 'start' : i === items?.length - 1 ? 'end' : 'center';\n\t\t\titem.contentPosition = this.contentPosition;\n\n\t\t\tif (i < items.length - 1) {\n\t\t\t\tconst nextItem = item.nextElementSibling;\n\n\t\t\t\tif (\n\t\t\t\t\tnextItem &&\n\t\t\t\t\tnextItem.tagName.toLowerCase() === 'p-stepper-item'\n\t\t\t\t) {\n\t\t\t\t\t// super hacky, but we want to wait for the css of the `item.direction` change to be applied before querying for the item.clientHeight\n\t\t\t\t\t// otherwise we always get the initial \"16\"\n\t\t\t\t\tif (directionChanged) {\n\t\t\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, 10));\n\t\t\t\t\t}\n\n\t\t\t\t\tconst heightDiff =\n\t\t\t\t\t\t(item.clientHeight > 16\n\t\t\t\t\t\t\t? item.clientHeight - 16\n\t\t\t\t\t\t\t: item.clientHeight) / 2;\n\n\t\t\t\t\tconst stepperLine =\n\t\t\t\t\t\tdocument.createElement('p-stepper-line');\n\n\t\t\t\t\tstepperLine.direction = this.direction;\n\t\t\t\t\tstepperLine.active = i <= activeStep;\n\n\t\t\t\t\tif (heightDiff > 0 && this.direction === 'vertical') {\n\t\t\t\t\t\tstepperLine.style.marginTop = `-${heightDiff / 16}rem`;\n\t\t\t\t\t\tstepperLine.style.marginBottom = `-${\n\t\t\t\t\t\t\theightDiff / 16\n\t\t\t\t\t\t}rem`;\n\t\t\t\t\t\tstepperLine.style.minHeight = `calc(1rem + ${\n\t\t\t\t\t\t\t(heightDiff * 2) / 16\n\t\t\t\t\t\t}rem)`;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._el.insertBefore(stepperLine, nextItem);\n\n\t\t\t\t\tconst previous = stepperLine.previousElementSibling;\n\t\t\t\t\tif (\n\t\t\t\t\t\tprevious &&\n\t\t\t\t\t\tprevious.tagName.toLowerCase() === 'p-stepper-line'\n\t\t\t\t\t) {\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\t\t\t}\n\n\t\t\tif (i > 0) {\n\t\t\t\tconst previousItem = item.previousElementSibling;\n\t\t\t\tif (previousItem.tagName.toLowerCase() === 'p-stepper-line') {\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 + p-stepper-line, p-stepper-line:not(:has(+ p-stepper-item))'\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\tsetTimeout(() => (this._rendering = false), 100);\n\t}\n}\n"]}
@@ -16,15 +16,13 @@ const Stepper = /*@__PURE__*/ proxyCustomElement(class Stepper extends HTMLEleme
16
16
  }
17
17
  // private _steps: Array<HTMLPStepperItemElement>;
18
18
  componentDidLoad() {
19
- setTimeout(() => {
20
- this._generateSteps(true);
21
- this._loaded = true;
22
- }, 500);
19
+ this._loaded = true;
20
+ this._generateSteps(true);
23
21
  }
24
22
  render() {
25
23
  return (h(Host, { class: "p-stepper" }, h("slot", { onSlotchange: () => this._generateSteps() })));
26
24
  }
27
- _generateSteps(firstLoad = false) {
25
+ async _generateSteps(firstLoad = false) {
28
26
  if (!firstLoad && (!this._el || this._rendering || !this._loaded)) {
29
27
  return;
30
28
  }
@@ -43,9 +41,13 @@ const Stepper = /*@__PURE__*/ proxyCustomElement(class Stepper extends HTMLEleme
43
41
  }
44
42
  }
45
43
  for (let i = 0; i < (items === null || items === void 0 ? void 0 : items.length); i++) {
44
+ let directionChanged = false;
46
45
  const item = items.item(i);
47
46
  item.active = i === activeStep;
48
47
  item.finished = i < activeStep;
48
+ if (item.direction !== this.direction) {
49
+ directionChanged = true;
50
+ }
49
51
  item.direction = this.direction;
50
52
  item.align =
51
53
  i === 0 ? 'start' : i === (items === null || items === void 0 ? void 0 : items.length) - 1 ? 'end' : 'center';
@@ -54,6 +56,11 @@ const Stepper = /*@__PURE__*/ proxyCustomElement(class Stepper extends HTMLEleme
54
56
  const nextItem = item.nextElementSibling;
55
57
  if (nextItem &&
56
58
  nextItem.tagName.toLowerCase() === 'p-stepper-item') {
59
+ // super hacky, but we want to wait for the css of the `item.direction` change to be applied before querying for the item.clientHeight
60
+ // otherwise we always get the initial "16"
61
+ if (directionChanged) {
62
+ await new Promise((resolve) => setTimeout(resolve, 10));
63
+ }
57
64
  const heightDiff = (item.clientHeight > 16
58
65
  ? item.clientHeight - 16
59
66
  : item.clientHeight) / 2;
@@ -66,6 +73,11 @@ const Stepper = /*@__PURE__*/ proxyCustomElement(class Stepper extends HTMLEleme
66
73
  stepperLine.style.minHeight = `calc(1rem + ${(heightDiff * 2) / 16}rem)`;
67
74
  }
68
75
  this._el.insertBefore(stepperLine, nextItem);
76
+ const previous = stepperLine.previousElementSibling;
77
+ if (previous &&
78
+ previous.tagName.toLowerCase() === 'p-stepper-line') {
79
+ previous.remove();
80
+ }
69
81
  continue;
70
82
  }
71
83
  }
@@ -77,16 +89,10 @@ const Stepper = /*@__PURE__*/ proxyCustomElement(class Stepper extends HTMLEleme
77
89
  }
78
90
  }
79
91
  }
80
- const lines = this._el.querySelectorAll('p-stepper-line');
92
+ const lines = this._el.querySelectorAll('p-stepper-line + p-stepper-line, p-stepper-line:not(:has(+ p-stepper-item))');
81
93
  for (let j = lines.length - 1; j >= 0; j--) {
82
94
  const line = lines.item(j);
83
- const next = line === null || line === void 0 ? void 0 : line.nextElementSibling;
84
- if (next && next.tagName.toLowerCase() === 'p-stepper-line') {
85
- next.remove();
86
- }
87
- if (!next) {
88
- line.remove();
89
- }
95
+ line.remove();
90
96
  }
91
97
  setTimeout(() => (this._rendering = false), 100);
92
98
  }
@@ -1 +1 @@
1
- {"file":"p-stepper.js","mappings":";;;AAAA,MAAM,mBAAmB,GAAG,gfAAgf;;MCO/f,OAAO;;;;;IAsBX,eAAU,GAAG,KAAK,CAAC;IACnB,YAAO,GAAG,KAAK,CAAC;sBAnBK,CAAC;qBAM7B,YAAY;2BAK+C,KAAK;;;EAYjE,gBAAgB;IACf,UAAU,CAAC;MACV,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;MAC1B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;KACpB,EAAE,GAAG,CAAC,CAAC;GACR;EAED,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAC,WAAW,IACtB,YAAM,YAAY,EAAE,MAAM,IAAI,CAAC,cAAc,EAAE,GAAI,CAC7C,EACN;GACF;EAGO,cAAc,CAAC,SAAS,GAAG,KAAK;IACvC,IAAI,CAAC,SAAS,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;MAClE,OAAO;KACP;IAED,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IAEvB,IAAI,UAAU,GAAG,IAAI,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,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AAE;MAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;MAC3B,MAAM,IAAI,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,kBAAkB,CAAC;MACtC,IAAI,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,gBAAgB,EAAE;QAC5D,IAAI,CAAC,MAAM,EAAE,CAAC;OACd;MAED,IAAI,CAAC,IAAI,EAAE;QACV,IAAI,CAAC,MAAM,EAAE,CAAC;OACd;KACD;IAED,UAAU,CAAC,OAAO,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;GACjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/molecules/stepper/stepper.component.scss?tag=p-stepper&encapsulation=shadow","src/components/molecules/stepper/stepper.component.tsx"],"sourcesContent":[":host {\n\t@apply flex;\n}\n\n:host([direction='horizontal']) {\n\t@apply h-auto items-end;\n}\n\n:host([direction='vertical']) {\n\t@apply flex-col flex-wrap items-start;\n\t@apply w-full min-h-full;\n}\n\n:host([direction='vertical'][content-position='start']) {\n\t@apply items-end;\n}\n","import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\n@Component({\n\ttag: 'p-stepper',\n\tstyleUrl: 'stepper.component.scss',\n\tshadow: true,\n})\nexport class Stepper {\n\t/**\n\t * The currently active step\n\t */\n\t@Prop() activeStep: number = 1;\n\n\t/**\n\t * The direction of the stepper\n\t */\n\t@Prop({ reflect: true }) direction: 'horizontal' | 'vertical' =\n\t\t'horizontal';\n\n\t/**\n\t * The position of the content in case of vertical direction\n\t */\n\t@Prop({ reflect: true }) contentPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\tprivate _rendering = false;\n\tprivate _loaded = false;\n\n\t// private _steps: Array<HTMLPStepperItemElement>;\n\n\tcomponentDidLoad() {\n\t\tsetTimeout(() => {\n\t\t\tthis._generateSteps(true);\n\t\t\tthis._loaded = true;\n\t\t}, 500);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class=\"p-stepper\">\n\t\t\t\t<slot onSlotchange={() => this._generateSteps()} />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Watch('activeStep')\n\tprivate _generateSteps(firstLoad = false) {\n\t\tif (!firstLoad && (!this._el || this._rendering || !this._loaded)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._rendering = true;\n\n\t\tlet activeStep = this.activeStep - 1 || 0;\n\t\tconst items = this._el.querySelectorAll('p-stepper-item');\n\n\t\tif (!this.activeStep || activeStep < 0) {\n\t\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\t\tconst item = items.item(i) as any;\n\n\t\t\t\tif (item.active) {\n\t\t\t\t\tactiveStep = i;\n\t\t\t\t}\n\n\t\t\t\tif (activeStep < 0 && item.finished) {\n\t\t\t\t\tactiveStep = i + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\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\titem.active = i === activeStep;\n\t\t\titem.finished = i < activeStep;\n\t\t\titem.direction = this.direction;\n\t\t\titem.align =\n\t\t\t\ti === 0 ? 'start' : i === items?.length - 1 ? 'end' : 'center';\n\t\t\titem.contentPosition = this.contentPosition;\n\n\t\t\tif (i < items.length - 1) {\n\t\t\t\tconst nextItem = item.nextElementSibling;\n\t\t\t\tif (\n\t\t\t\t\tnextItem &&\n\t\t\t\t\tnextItem.tagName.toLowerCase() === 'p-stepper-item'\n\t\t\t\t) {\n\t\t\t\t\tconst heightDiff =\n\t\t\t\t\t\t(item.clientHeight > 16\n\t\t\t\t\t\t\t? item.clientHeight - 16\n\t\t\t\t\t\t\t: item.clientHeight) / 2;\n\n\t\t\t\t\tconst stepperLine =\n\t\t\t\t\t\tdocument.createElement('p-stepper-line');\n\n\t\t\t\t\tstepperLine.direction = this.direction;\n\t\t\t\t\tstepperLine.active = i <= activeStep;\n\n\t\t\t\t\tif (heightDiff > 0 && this.direction === 'vertical') {\n\t\t\t\t\t\tstepperLine.style.marginTop = `-${heightDiff / 16}rem`;\n\t\t\t\t\t\tstepperLine.style.marginBottom = `-${\n\t\t\t\t\t\t\theightDiff / 16\n\t\t\t\t\t\t}rem`;\n\t\t\t\t\t\tstepperLine.style.minHeight = `calc(1rem + ${\n\t\t\t\t\t\t\t(heightDiff * 2) / 16\n\t\t\t\t\t\t}rem)`;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._el.insertBefore(stepperLine, nextItem);\n\n\t\t\t\t\tcontinue;\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 (previousItem.tagName.toLowerCase() === 'p-stepper-line') {\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('p-stepper-line');\n\t\tfor (let j = lines.length - 1; j >= 0; j--) {\n\t\t\tconst line = lines.item(j);\n\t\t\tconst next = line?.nextElementSibling;\n\t\t\tif (next && next.tagName.toLowerCase() === 'p-stepper-line') {\n\t\t\t\tnext.remove();\n\t\t\t}\n\n\t\t\tif (!next) {\n\t\t\t\tline.remove();\n\t\t\t}\n\t\t}\n\n\t\tsetTimeout(() => (this._rendering = false), 100);\n\t}\n}\n"],"version":3}
1
+ {"file":"p-stepper.js","mappings":";;;AAAA,MAAM,mBAAmB,GAAG,gfAAgf;;MCO/f,OAAO;;;;;IAsBX,eAAU,GAAG,KAAK,CAAC;IACnB,YAAO,GAAG,KAAK,CAAC;sBAnBK,CAAC;qBAM7B,YAAY;2BAK+C,KAAK;;;EAYjE,gBAAgB;IACf,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACpB,IAAI,CAAC,cAAc,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"sources":["src/components/molecules/stepper/stepper.component.scss?tag=p-stepper&encapsulation=shadow","src/components/molecules/stepper/stepper.component.tsx"],"sourcesContent":[":host {\n\t@apply flex;\n}\n\n:host([direction='horizontal']) {\n\t@apply h-auto items-end;\n}\n\n:host([direction='vertical']) {\n\t@apply flex-col flex-wrap items-start;\n\t@apply w-full min-h-full;\n}\n\n:host([direction='vertical'][content-position='start']) {\n\t@apply items-end;\n}\n","import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\n@Component({\n\ttag: 'p-stepper',\n\tstyleUrl: 'stepper.component.scss',\n\tshadow: true,\n})\nexport class Stepper {\n\t/**\n\t * The currently active step\n\t */\n\t@Prop() activeStep: number = 1;\n\n\t/**\n\t * The direction of the stepper\n\t */\n\t@Prop({ reflect: true }) direction: 'horizontal' | 'vertical' =\n\t\t'horizontal';\n\n\t/**\n\t * The position of the content in case of vertical direction\n\t */\n\t@Prop({ reflect: true }) contentPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\tprivate _rendering = false;\n\tprivate _loaded = false;\n\n\t// private _steps: Array<HTMLPStepperItemElement>;\n\n\tcomponentDidLoad() {\n\t\tthis._loaded = true;\n\t\tthis._generateSteps(true);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class=\"p-stepper\">\n\t\t\t\t<slot onSlotchange={() => this._generateSteps()} />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Watch('activeStep')\n\tprivate async _generateSteps(firstLoad = false) {\n\t\tif (!firstLoad && (!this._el || this._rendering || !this._loaded)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._rendering = true;\n\n\t\tlet activeStep = this.activeStep - 1 || 0;\n\t\tconst items = this._el.querySelectorAll('p-stepper-item');\n\n\t\tif (!this.activeStep || activeStep < 0) {\n\t\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\t\tconst item = items.item(i) as any;\n\n\t\t\t\tif (item.active) {\n\t\t\t\t\tactiveStep = i;\n\t\t\t\t}\n\n\t\t\t\tif (activeStep < 0 && item.finished) {\n\t\t\t\t\tactiveStep = i + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\tlet directionChanged = false;\n\t\t\tconst item = items.item(i) as any;\n\n\t\t\titem.active = i === activeStep;\n\t\t\titem.finished = i < activeStep;\n\n\t\t\tif (item.direction !== this.direction) {\n\t\t\t\tdirectionChanged = true;\n\t\t\t}\n\n\t\t\titem.direction = this.direction;\n\t\t\titem.align =\n\t\t\t\ti === 0 ? 'start' : i === items?.length - 1 ? 'end' : 'center';\n\t\t\titem.contentPosition = this.contentPosition;\n\n\t\t\tif (i < items.length - 1) {\n\t\t\t\tconst nextItem = item.nextElementSibling;\n\n\t\t\t\tif (\n\t\t\t\t\tnextItem &&\n\t\t\t\t\tnextItem.tagName.toLowerCase() === 'p-stepper-item'\n\t\t\t\t) {\n\t\t\t\t\t// super hacky, but we want to wait for the css of the `item.direction` change to be applied before querying for the item.clientHeight\n\t\t\t\t\t// otherwise we always get the initial \"16\"\n\t\t\t\t\tif (directionChanged) {\n\t\t\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, 10));\n\t\t\t\t\t}\n\n\t\t\t\t\tconst heightDiff =\n\t\t\t\t\t\t(item.clientHeight > 16\n\t\t\t\t\t\t\t? item.clientHeight - 16\n\t\t\t\t\t\t\t: item.clientHeight) / 2;\n\n\t\t\t\t\tconst stepperLine =\n\t\t\t\t\t\tdocument.createElement('p-stepper-line');\n\n\t\t\t\t\tstepperLine.direction = this.direction;\n\t\t\t\t\tstepperLine.active = i <= activeStep;\n\n\t\t\t\t\tif (heightDiff > 0 && this.direction === 'vertical') {\n\t\t\t\t\t\tstepperLine.style.marginTop = `-${heightDiff / 16}rem`;\n\t\t\t\t\t\tstepperLine.style.marginBottom = `-${\n\t\t\t\t\t\t\theightDiff / 16\n\t\t\t\t\t\t}rem`;\n\t\t\t\t\t\tstepperLine.style.minHeight = `calc(1rem + ${\n\t\t\t\t\t\t\t(heightDiff * 2) / 16\n\t\t\t\t\t\t}rem)`;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._el.insertBefore(stepperLine, nextItem);\n\n\t\t\t\t\tconst previous = stepperLine.previousElementSibling;\n\t\t\t\t\tif (\n\t\t\t\t\t\tprevious &&\n\t\t\t\t\t\tprevious.tagName.toLowerCase() === 'p-stepper-line'\n\t\t\t\t\t) {\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\t\t\t}\n\n\t\t\tif (i > 0) {\n\t\t\t\tconst previousItem = item.previousElementSibling;\n\t\t\t\tif (previousItem.tagName.toLowerCase() === 'p-stepper-line') {\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 + p-stepper-line, p-stepper-line:not(:has(+ p-stepper-item))'\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\tsetTimeout(() => (this._rendering = false), 100);\n\t}\n}\n"],"version":3}
@@ -13,15 +13,13 @@ const Stepper = class {
13
13
  }
14
14
  // private _steps: Array<HTMLPStepperItemElement>;
15
15
  componentDidLoad() {
16
- setTimeout(() => {
17
- this._generateSteps(true);
18
- this._loaded = true;
19
- }, 500);
16
+ this._loaded = true;
17
+ this._generateSteps(true);
20
18
  }
21
19
  render() {
22
20
  return (h(Host, { class: "p-stepper" }, h("slot", { onSlotchange: () => this._generateSteps() })));
23
21
  }
24
- _generateSteps(firstLoad = false) {
22
+ async _generateSteps(firstLoad = false) {
25
23
  if (!firstLoad && (!this._el || this._rendering || !this._loaded)) {
26
24
  return;
27
25
  }
@@ -40,9 +38,13 @@ const Stepper = class {
40
38
  }
41
39
  }
42
40
  for (let i = 0; i < (items === null || items === void 0 ? void 0 : items.length); i++) {
41
+ let directionChanged = false;
43
42
  const item = items.item(i);
44
43
  item.active = i === activeStep;
45
44
  item.finished = i < activeStep;
45
+ if (item.direction !== this.direction) {
46
+ directionChanged = true;
47
+ }
46
48
  item.direction = this.direction;
47
49
  item.align =
48
50
  i === 0 ? 'start' : i === (items === null || items === void 0 ? void 0 : items.length) - 1 ? 'end' : 'center';
@@ -51,6 +53,11 @@ const Stepper = class {
51
53
  const nextItem = item.nextElementSibling;
52
54
  if (nextItem &&
53
55
  nextItem.tagName.toLowerCase() === 'p-stepper-item') {
56
+ // super hacky, but we want to wait for the css of the `item.direction` change to be applied before querying for the item.clientHeight
57
+ // otherwise we always get the initial "16"
58
+ if (directionChanged) {
59
+ await new Promise((resolve) => setTimeout(resolve, 10));
60
+ }
54
61
  const heightDiff = (item.clientHeight > 16
55
62
  ? item.clientHeight - 16
56
63
  : item.clientHeight) / 2;
@@ -63,6 +70,11 @@ const Stepper = class {
63
70
  stepperLine.style.minHeight = `calc(1rem + ${(heightDiff * 2) / 16}rem)`;
64
71
  }
65
72
  this._el.insertBefore(stepperLine, nextItem);
73
+ const previous = stepperLine.previousElementSibling;
74
+ if (previous &&
75
+ previous.tagName.toLowerCase() === 'p-stepper-line') {
76
+ previous.remove();
77
+ }
66
78
  continue;
67
79
  }
68
80
  }
@@ -74,16 +86,10 @@ const Stepper = class {
74
86
  }
75
87
  }
76
88
  }
77
- const lines = this._el.querySelectorAll('p-stepper-line');
89
+ const lines = this._el.querySelectorAll('p-stepper-line + p-stepper-line, p-stepper-line:not(:has(+ p-stepper-item))');
78
90
  for (let j = lines.length - 1; j >= 0; j--) {
79
91
  const line = lines.item(j);
80
- const next = line === null || line === void 0 ? void 0 : line.nextElementSibling;
81
- if (next && next.tagName.toLowerCase() === 'p-stepper-line') {
82
- next.remove();
83
- }
84
- if (!next) {
85
- line.remove();
86
- }
92
+ line.remove();
87
93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AAE,CAAC;OACd;KACD;IAED,UAAU,CAAC,OAAO,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;GACjD;;;;;;;;;;","names":[],"sources":["src/components/molecules/stepper/stepper.component.scss?tag=p-stepper&encapsulation=shadow","src/components/molecules/stepper/stepper.component.tsx"],"sourcesContent":[":host {\n\t@apply flex;\n}\n\n:host([direction='horizontal']) {\n\t@apply h-auto items-end;\n}\n\n:host([direction='vertical']) {\n\t@apply flex-col flex-wrap items-start;\n\t@apply w-full min-h-full;\n}\n\n:host([direction='vertical'][content-position='start']) {\n\t@apply items-end;\n}\n","import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\n@Component({\n\ttag: 'p-stepper',\n\tstyleUrl: 'stepper.component.scss',\n\tshadow: true,\n})\nexport class Stepper {\n\t/**\n\t * The currently active step\n\t */\n\t@Prop() activeStep: number = 1;\n\n\t/**\n\t * The direction of the stepper\n\t */\n\t@Prop({ reflect: true }) direction: 'horizontal' | 'vertical' =\n\t\t'horizontal';\n\n\t/**\n\t * The position of the content in case of vertical direction\n\t */\n\t@Prop({ reflect: true }) contentPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\tprivate _rendering = false;\n\tprivate _loaded = false;\n\n\t// private _steps: Array<HTMLPStepperItemElement>;\n\n\tcomponentDidLoad() {\n\t\tsetTimeout(() => {\n\t\t\tthis._generateSteps(true);\n\t\t\tthis._loaded = true;\n\t\t}, 500);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class=\"p-stepper\">\n\t\t\t\t<slot onSlotchange={() => this._generateSteps()} />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Watch('activeStep')\n\tprivate _generateSteps(firstLoad = false) {\n\t\tif (!firstLoad && (!this._el || this._rendering || !this._loaded)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._rendering = true;\n\n\t\tlet activeStep = this.activeStep - 1 || 0;\n\t\tconst items = this._el.querySelectorAll('p-stepper-item');\n\n\t\tif (!this.activeStep || activeStep < 0) {\n\t\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\t\tconst item = items.item(i) as any;\n\n\t\t\t\tif (item.active) {\n\t\t\t\t\tactiveStep = i;\n\t\t\t\t}\n\n\t\t\t\tif (activeStep < 0 && item.finished) {\n\t\t\t\t\tactiveStep = i + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\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\titem.active = i === activeStep;\n\t\t\titem.finished = i < activeStep;\n\t\t\titem.direction = this.direction;\n\t\t\titem.align =\n\t\t\t\ti === 0 ? 'start' : i === items?.length - 1 ? 'end' : 'center';\n\t\t\titem.contentPosition = this.contentPosition;\n\n\t\t\tif (i < items.length - 1) {\n\t\t\t\tconst nextItem = item.nextElementSibling;\n\t\t\t\tif (\n\t\t\t\t\tnextItem &&\n\t\t\t\t\tnextItem.tagName.toLowerCase() === 'p-stepper-item'\n\t\t\t\t) {\n\t\t\t\t\tconst heightDiff =\n\t\t\t\t\t\t(item.clientHeight > 16\n\t\t\t\t\t\t\t? item.clientHeight - 16\n\t\t\t\t\t\t\t: item.clientHeight) / 2;\n\n\t\t\t\t\tconst stepperLine =\n\t\t\t\t\t\tdocument.createElement('p-stepper-line');\n\n\t\t\t\t\tstepperLine.direction = this.direction;\n\t\t\t\t\tstepperLine.active = i <= activeStep;\n\n\t\t\t\t\tif (heightDiff > 0 && this.direction === 'vertical') {\n\t\t\t\t\t\tstepperLine.style.marginTop = `-${heightDiff / 16}rem`;\n\t\t\t\t\t\tstepperLine.style.marginBottom = `-${\n\t\t\t\t\t\t\theightDiff / 16\n\t\t\t\t\t\t}rem`;\n\t\t\t\t\t\tstepperLine.style.minHeight = `calc(1rem + ${\n\t\t\t\t\t\t\t(heightDiff * 2) / 16\n\t\t\t\t\t\t}rem)`;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._el.insertBefore(stepperLine, nextItem);\n\n\t\t\t\t\tcontinue;\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 (previousItem.tagName.toLowerCase() === 'p-stepper-line') {\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('p-stepper-line');\n\t\tfor (let j = lines.length - 1; j >= 0; j--) {\n\t\t\tconst line = lines.item(j);\n\t\t\tconst next = line?.nextElementSibling;\n\t\t\tif (next && next.tagName.toLowerCase() === 'p-stepper-line') {\n\t\t\t\tnext.remove();\n\t\t\t}\n\n\t\t\tif (!next) {\n\t\t\t\tline.remove();\n\t\t\t}\n\t\t}\n\n\t\tsetTimeout(() => (this._rendering = false), 100);\n\t}\n}\n"],"version":3}
1
+ {"file":"p-stepper.entry.js","mappings":";;AAAA,MAAM,mBAAmB,GAAG,gfAAgf;;MCO/f,OAAO;;;IAsBX,eAAU,GAAG,KAAK,CAAC;IACnB,YAAO,GAAG,KAAK,CAAC;sBAnBK,CAAC;qBAM7B,YAAY;2BAK+C,KAAK;;;EAYjE,gBAAgB;IACf,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACpB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;GAC1B;EAED,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAC,WAAW,IACtB,YAAM,YAAY,EAAE,MAAM,IAAI,CAAC,cAAc,EAAE,GAAI,CAC7C,EACN;GACF;EAGO,MAAM,cAAc,CAAC,SAAS,GAAG,KAAK;IAC7C,IAAI,CAAC,SAAS,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;MAClE,OAAO;KACP;IAED,IAAI,CAA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AAQ;YACR,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,gBAAgB,EAClD;YACD,QAAQ,CAAC,MAAM,EAAE,CAAC;WAClB;UAED,SAAS;SACT;OACD;MAED,IAAI,CAAC,GAAG,CAAC,EAAE;QACV,MAAM,YAAY,GAAG,IAAI,CAAC,sBAAsB,CAAC;QACjD,IAAI,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,gBAAgB,EAAE;UAC5D,YAAY,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;UACxC,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC;SACnD;OACD;KACD;IAED,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAgB,CACtC,6EAA6E,CAC7E,CAAC;IACF,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;MAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;MAC3B,IAAI,CAAC,MAAM,EAAE,CAAC;KACd;IAED,UAAU,CAAC,OAAO,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;GACjD;;;;;;;;;;","names":[],"sources":["src/components/molecules/stepper/stepper.component.scss?tag=p-stepper&encapsulation=shadow","src/components/molecules/stepper/stepper.component.tsx"],"sourcesContent":[":host {\n\t@apply flex;\n}\n\n:host([direction='horizontal']) {\n\t@apply h-auto items-end;\n}\n\n:host([direction='vertical']) {\n\t@apply flex-col flex-wrap items-start;\n\t@apply w-full min-h-full;\n}\n\n:host([direction='vertical'][content-position='start']) {\n\t@apply items-end;\n}\n","import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\n@Component({\n\ttag: 'p-stepper',\n\tstyleUrl: 'stepper.component.scss',\n\tshadow: true,\n})\nexport class Stepper {\n\t/**\n\t * The currently active step\n\t */\n\t@Prop() activeStep: number = 1;\n\n\t/**\n\t * The direction of the stepper\n\t */\n\t@Prop({ reflect: true }) direction: 'horizontal' | 'vertical' =\n\t\t'horizontal';\n\n\t/**\n\t * The position of the content in case of vertical direction\n\t */\n\t@Prop({ reflect: true }) contentPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\tprivate _rendering = false;\n\tprivate _loaded = false;\n\n\t// private _steps: Array<HTMLPStepperItemElement>;\n\n\tcomponentDidLoad() {\n\t\tthis._loaded = true;\n\t\tthis._generateSteps(true);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class=\"p-stepper\">\n\t\t\t\t<slot onSlotchange={() => this._generateSteps()} />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Watch('activeStep')\n\tprivate async _generateSteps(firstLoad = false) {\n\t\tif (!firstLoad && (!this._el || this._rendering || !this._loaded)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._rendering = true;\n\n\t\tlet activeStep = this.activeStep - 1 || 0;\n\t\tconst items = this._el.querySelectorAll('p-stepper-item');\n\n\t\tif (!this.activeStep || activeStep < 0) {\n\t\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\t\tconst item = items.item(i) as any;\n\n\t\t\t\tif (item.active) {\n\t\t\t\t\tactiveStep = i;\n\t\t\t\t}\n\n\t\t\t\tif (activeStep < 0 && item.finished) {\n\t\t\t\t\tactiveStep = i + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\tlet directionChanged = false;\n\t\t\tconst item = items.item(i) as any;\n\n\t\t\titem.active = i === activeStep;\n\t\t\titem.finished = i < activeStep;\n\n\t\t\tif (item.direction !== this.direction) {\n\t\t\t\tdirectionChanged = true;\n\t\t\t}\n\n\t\t\titem.direction = this.direction;\n\t\t\titem.align =\n\t\t\t\ti === 0 ? 'start' : i === items?.length - 1 ? 'end' : 'center';\n\t\t\titem.contentPosition = this.contentPosition;\n\n\t\t\tif (i < items.length - 1) {\n\t\t\t\tconst nextItem = item.nextElementSibling;\n\n\t\t\t\tif (\n\t\t\t\t\tnextItem &&\n\t\t\t\t\tnextItem.tagName.toLowerCase() === 'p-stepper-item'\n\t\t\t\t) {\n\t\t\t\t\t// super hacky, but we want to wait for the css of the `item.direction` change to be applied before querying for the item.clientHeight\n\t\t\t\t\t// otherwise we always get the initial \"16\"\n\t\t\t\t\tif (directionChanged) {\n\t\t\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, 10));\n\t\t\t\t\t}\n\n\t\t\t\t\tconst heightDiff =\n\t\t\t\t\t\t(item.clientHeight > 16\n\t\t\t\t\t\t\t? item.clientHeight - 16\n\t\t\t\t\t\t\t: item.clientHeight) / 2;\n\n\t\t\t\t\tconst stepperLine =\n\t\t\t\t\t\tdocument.createElement('p-stepper-line');\n\n\t\t\t\t\tstepperLine.direction = this.direction;\n\t\t\t\t\tstepperLine.active = i <= activeStep;\n\n\t\t\t\t\tif (heightDiff > 0 && this.direction === 'vertical') {\n\t\t\t\t\t\tstepperLine.style.marginTop = `-${heightDiff / 16}rem`;\n\t\t\t\t\t\tstepperLine.style.marginBottom = `-${\n\t\t\t\t\t\t\theightDiff / 16\n\t\t\t\t\t\t}rem`;\n\t\t\t\t\t\tstepperLine.style.minHeight = `calc(1rem + ${\n\t\t\t\t\t\t\t(heightDiff * 2) / 16\n\t\t\t\t\t\t}rem)`;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._el.insertBefore(stepperLine, nextItem);\n\n\t\t\t\t\tconst previous = stepperLine.previousElementSibling;\n\t\t\t\t\tif (\n\t\t\t\t\t\tprevious &&\n\t\t\t\t\t\tprevious.tagName.toLowerCase() === 'p-stepper-line'\n\t\t\t\t\t) {\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\t\t\t}\n\n\t\t\tif (i > 0) {\n\t\t\t\tconst previousItem = item.previousElementSibling;\n\t\t\t\tif (previousItem.tagName.toLowerCase() === 'p-stepper-line') {\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 + p-stepper-line, p-stepper-line:not(:has(+ p-stepper-item))'\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\tsetTimeout(() => (this._rendering = false), 100);\n\t}\n}\n"],"version":3}