@paperless/core 1.64.0 → 1.64.1

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.64.1](https://github.com/ionic-team/stencil-component-starter/compare/v1.64.0...v1.64.1) (2025-02-11)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **atoms/stepper:** Fix the line being active if only step 1 is active ([c22b410](https://github.com/ionic-team/stencil-component-starter/commit/c22b4104411882223f287bb319ee6c0f9e825cdf))
12
+
13
+
14
+
15
+
16
+
6
17
  # [1.64.0](https://github.com/ionic-team/stencil-component-starter/compare/v1.63.0...v1.64.0) (2025-02-10)
7
18
 
8
19
 
@@ -1,2 +1,2 @@
1
- import{r as t,h as i,H as e,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 n=class{constructor(i){t(this,i);this._loaded=false;this._delay=t=>new Promise((i=>setTimeout(i,t)));this._onSlotChange=async t=>this._generateSteps();this._generateSteps=async(t=false)=>{if(!t&&(!this._el||this._rendering||!this._loaded)){return}this._rendering=true;let i=this.activeStep-1||0;const e=this._el.querySelectorAll("p-stepper-item");if(!this.activeStep||i<0){for(let t=0;t<(e===null||e===void 0?void 0:e.length);t++){const s=e.item(t);if(s.active){i=t}if(i<0&&s.finished){i=t+1}}}for(let t=0;t<(e===null||e===void 0?void 0:e.length);t++){let s=false;const o=e.item(t);o.active=t===i;o.finished=t<i;if(o.direction!==this.direction){s=true}o.direction=this.direction;o.align=t===0?"start":t===(e===null||e===void 0?void 0:e.length)-1?"end":"center";o.contentPosition=this.contentPosition;if(t<e.length-1){const e=o.nextElementSibling;if(e&&e.tagName.toLowerCase()==="p-stepper-item"){if(s){await this._delay(10)}const n=(o.clientHeight>16?o.clientHeight-16:o.clientHeight)/2;const r=document.createElement("p-stepper-line");r.direction=this.direction;r.active=t<=i;if(n>0&&this.direction==="vertical"){r.style.marginTop=`-${n/16}rem`;r.style.marginBottom=`-${n/16}rem`;r.style.minHeight=`calc(1rem + ${n*2/16}rem)`}this._el.insertBefore(r,e);const l=r.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:not(:has(+ p-stepper-item)), p-stepper-line:first-child");for(let t=s.length-1;t>=0;t--){const i=s.item(t);i.remove()}setTimeout((()=>this._rendering=false),100)};this.activeStep=1;this.direction="horizontal";this.contentPosition="end";this._rendering=false}componentDidLoad(){this._loaded=true;this._generateSteps(true)}render(){return i(e,{class:"p-stepper"},i("slot",{onSlotchange:this._onSlotChange}))}_onActiveStepChange(){this._generateSteps()}get _el(){return s(this)}static get watchers(){return{activeStep:["_onActiveStepChange"]}}};n.style=o;export{n as p_stepper};
2
- //# sourceMappingURL=p-5fa3061e.entry.js.map
1
+ import{r as t,h as i,H as e,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 n=class{constructor(i){t(this,i);this._loaded=false;this._delay=t=>new Promise((i=>setTimeout(i,t)));this._onSlotChange=async t=>this._generateSteps();this._generateSteps=async(t=false)=>{if(!t&&(!this._el||this._rendering||!this._loaded)){return}this._rendering=true;let i=this.activeStep-1||0;const e=this._el.querySelectorAll("p-stepper-item");if(!this.activeStep||i<0){for(let t=0;t<(e===null||e===void 0?void 0:e.length);t++){const s=e.item(t);if(s.active){i=t}if(i<0&&s.finished){i=t+1}}}for(let t=0;t<(e===null||e===void 0?void 0:e.length);t++){let s=false;const o=e.item(t);o.active=t===i;o.finished=t<i;if(o.direction!==this.direction){s=true}o.direction=this.direction;o.align=t===0?"start":t===(e===null||e===void 0?void 0:e.length)-1?"end":"center";o.contentPosition=this.contentPosition;if(t<e.length-1){const e=o.nextElementSibling;if(e&&e.tagName.toLowerCase()==="p-stepper-item"){if(s){await this._delay(10)}const n=(o.clientHeight>16?o.clientHeight-16:o.clientHeight)/2;const r=document.createElement("p-stepper-line");r.direction=this.direction;r.active=t<i;if(n>0&&this.direction==="vertical"){r.style.marginTop=`-${n/16}rem`;r.style.marginBottom=`-${n/16}rem`;r.style.minHeight=`calc(1rem + ${n*2/16}rem)`}this._el.insertBefore(r,e);const l=r.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:not(:has(+ p-stepper-item)), p-stepper-line:first-child");for(let t=s.length-1;t>=0;t--){const i=s.item(t);i.remove()}setTimeout((()=>this._rendering=false),100)};this.activeStep=1;this.direction="horizontal";this.contentPosition="end";this._rendering=false}componentDidLoad(){this._loaded=true;this._generateSteps(true)}render(){return i(e,{class:"p-stepper"},i("slot",{onSlotchange:this._onSlotChange}))}_onActiveStepChange(){this._generateSteps()}get _el(){return s(this)}static get watchers(){return{activeStep:["_onActiveStepChange"]}}};n.style=o;export{n as p_stepper};
2
+ //# sourceMappingURL=p-0b0c43cc.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["stepperComponentCss","Stepper","this","_loaded","_delay","amount","Promise","resolve","setTimeout","_onSlotChange","async","_e","_generateSteps","firstLoad","_el","_rendering","activeStep","items","querySelectorAll","i","length","item","active","finished","directionChanged","direction","align","contentPosition","nextItem","nextElementSibling","tagName","toLowerCase","heightDiff","clientHeight","stepperLine","document","createElement","style","marginTop","marginBottom","minHeight","insertBefore","previous","previousElementSibling","remove","previousItem","lines","j","line","componentDidLoad","render","h","Host","class","onSlotchange","_onActiveStepChange"],"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, State, 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' = '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\t@State() private _rendering = false;\n\n\tprivate _loaded = false;\n\n\t// private _steps: Array<HTMLPStepperItemElement>;\n\n\tprivate _delay = (amount: number) =>\n\t\tnew Promise(resolve => setTimeout(resolve, amount));\n\n\tprivate _onSlotChange = async (_e: Event) => this._generateSteps();\n\n\tprivate _generateSteps = async (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 (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-item') {\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 this._delay(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 = document.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 = `-${heightDiff / 16}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 (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\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: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\tsetTimeout(() => (this._rendering = false), 100);\n\t};\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._onSlotChange} />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Watch('activeStep')\n\tprotected _onActiveStepChange() {\n\t\tthis._generateSteps();\n\t}\n}\n"],"mappings":"yDAAA,MAAMA,EAAsB,if,MCOfC,EAAO,M,yBAuBXC,KAA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l=new URL(".",a).href}return e(o)};o().then((e=>a(JSON.parse('[["p-dd070ee8",[[4,"p-button",{"as":[1],"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"],"buttonGroupPosition":[1,"button-group-position"]},[[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-0f5c5693",[[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"],"enableFilterDesktop":[4,"enable-filter-desktop"],"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],"_enableRowSelection":[32],"_rowSelectionLimit":[32],"_rowActionsFloating":[32],"_rowActionsRow":[32]},[[16,"localeChanged","_setLocales"],[16,"tableDefinitionChanged","onTableDefinitionUpdated"],[4,"keydown","keyDown"],[4,"keyup","keyUp"],[4,"visibilitychange","visibilityChange"],[9,"resize","_setRowSelectionData"]],{"items":["_parseItems"],"enableRowSelection":["_setRowSelectionData"],"rowSelectionLimit":["_setRowSelectionData"],"selectedRows":["_setRowSelectionData"]}]]],["p-f2a896ba",[[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"],"iconKey":[1,"icon-key"],"showIconInSelectedItem":[1,"show-icon-in-selected-item"],"classKey":[1,"class-key"],"applyClassOnSelectedItem":[1,"apply-class-on-selected-item"],"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-576b6378",[[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-95dc4bd3",[[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],"hideIconWhenFilled":[4,"hide-icon-when-filled"],"size":[1],"prefix":[1],"label":[1],"helper":[1],"required":[516],"error":[513],"disabled":[516],"strategy":[1],"placement":[513],"_showDropdown":[32],"_value":[32],"_minDate":[32],"_maxDate":[32],"_disabledDates":[32]},[[6,"click","documentClickHandler"]],{"value":["parseValue"],"minDate":["parseMinDate"],"maxDate":["parseMaxDate"],"disabledDates":["parseDisabledDates"]}]]],["p-5b062bc3",[[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-2c2cf3cf",[[1,"p-navigation-item",{"active":[4],"loading":[4],"icon":[1],"iconPosition":[1,"icon-position"],"counter":[8],"href":[1],"target":[1]}]]],["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-d0796984",[[1,"p-accordion",{"header":[1],"open":[4],"closeable":[4],"openable":[4]}]]],["p-8af4e8e9",[[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-b59115c3",[[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-5fa3061e",[[1,"p-stepper",{"activeStep":[2,"active-step"],"direction":[513],"contentPosition":[513,"content-position"],"_rendering":[32]},null,{"activeStep":["_onActiveStepChange"]}]]],["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-c3999d3e",[[1,"p-button-group",{"size":[1]},[[0,"slotchange","slotchange"]]]]],["p-8426ca20",[[4,"p-card-body",{"inheritText":[516,"inherit-text"]}]]],["p-ec315c58",[[1,"p-card-container",{"hoverable":[516],"shadow":[516]}]]],["p-a37d182e",[[1,"p-iban-icon",{"iban":[513],"variant":[513]}]]],["p-bbe63029",[[1,"p-layout",{"variant":[1]}]]],["p-7793ba3a",[[1,"p-tab-item",{"active":[4]}]]],["p-d7f2d4d3",[[0,"p-table-column",{"path":[1537],"type":[1537],"name":[1537],"useSlot":[1540,"use-slot"],"hasCheckbox":[1540,"has-checkbox"],"align":[1537],"isLast":[1040],"parsedSizes":[1040],"sizes":[1032]}]]],["p-6f24685c",[[0,"p-table-row-action",{"type":[1537],"icon":[1],"iconOnly":[4,"icon-only"],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"],"label":[1],"action":[16],"disabled":[4],"loading":[4],"showFunction":[16]}]]],["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-d8641c29",[[1,"p-stepper-line",{"active":[516],"direction":[513]}]]],["p-639665b1",[[1,"p-drawer-header",{"showClose":[4,"show-close"]}],[1,"p-drawer-body",{"variant":[1]}],[4,"p-drawer-container",{"closing":[4]}]]],["p-3755da14",[[1,"p-backdrop",{"variant":[1],"applyBlur":[4,"apply-blur"],"closing":[4],"scrollLock":[4,"scroll-lock"]},[[2,"click","handleClick"]]]]],["p-30c9f5e3",[[1,"p-modal-header",{"showClose":[4,"show-close"]}],[1,"p-modal-footer"],[1,"p-modal-body",{"variant":[1],"roundedBottom":[4,"rounded-bottom"],"roundedTop":[4,"rounded-top"],"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-a2b552f9",[[1,"p-divider",{"variant":[513]}]]],["p-ef0bfa6c",[[4,"p-dropdown-menu-container",{"maxWidth":[4,"max-width"],"fullWidth":[4,"full-width"],"allowOverflow":[4,"allow-overflow"],"scrollable":[8]}]]],["p-46052ca3",[[1,"p-dropdown-menu-item",{"active":[4],"variant":[1],"enableHover":[4,"enable-hover"],"icon":[1],"useContainer":[4,"use-container"]}],[1,"p-dropdown",{"placement":[513],"offset":[2],"strategy":[1],"show":[4],"calculateWidth":[4,"calculate-width"],"applyMaxWidth":[4,"apply-max-width"],"applyFullWidth":[4,"apply-full-width"],"allowOverflow":[4,"allow-overflow"],"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-00d4647f",[[1,"p-tooltip",{"variant":[1],"content":[8],"placement":[1],"offset":[2],"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-867c00e9",[[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-7d396ed7",[[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"],"enableFilterDesktop":[4,"enable-filter-desktop"],"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],"tableHasActions":[4,"table-has-actions"],"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],"disabled":[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 o=()=>{const a=import.meta.url;const o={};if(a!==""){o.resourcesUrl=new URL(".",a).href}return e(o)};o().then((e=>a(JSON.parse('[["p-dd070ee8",[[4,"p-button",{"as":[1],"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"],"buttonGroupPosition":[1,"button-group-position"]},[[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-0f5c5693",[[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"],"enableFilterDesktop":[4,"enable-filter-desktop"],"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],"_enableRowSelection":[32],"_rowSelectionLimit":[32],"_rowActionsFloating":[32],"_rowActionsRow":[32]},[[16,"localeChanged","_setLocales"],[16,"tableDefinitionChanged","onTableDefinitionUpdated"],[4,"keydown","keyDown"],[4,"keyup","keyUp"],[4,"visibilitychange","visibilityChange"],[9,"resize","_setRowSelectionData"]],{"items":["_parseItems"],"enableRowSelection":["_setRowSelectionData"],"rowSelectionLimit":["_setRowSelectionData"],"selectedRows":["_setRowSelectionData"]}]]],["p-f2a896ba",[[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"],"iconKey":[1,"icon-key"],"showIconInSelectedItem":[1,"show-icon-in-selected-item"],"classKey":[1,"class-key"],"applyClassOnSelectedItem":[1,"apply-class-on-selected-item"],"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-576b6378",[[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-95dc4bd3",[[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],"hideIconWhenFilled":[4,"hide-icon-when-filled"],"size":[1],"prefix":[1],"label":[1],"helper":[1],"required":[516],"error":[513],"disabled":[516],"strategy":[1],"placement":[513],"_showDropdown":[32],"_value":[32],"_minDate":[32],"_maxDate":[32],"_disabledDates":[32]},[[6,"click","documentClickHandler"]],{"value":["parseValue"],"minDate":["parseMinDate"],"maxDate":["parseMaxDate"],"disabledDates":["parseDisabledDates"]}]]],["p-5b062bc3",[[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-2c2cf3cf",[[1,"p-navigation-item",{"active":[4],"loading":[4],"icon":[1],"iconPosition":[1,"icon-position"],"counter":[8],"href":[1],"target":[1]}]]],["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-d0796984",[[1,"p-accordion",{"header":[1],"open":[4],"closeable":[4],"openable":[4]}]]],["p-8af4e8e9",[[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-b59115c3",[[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-0b0c43cc",[[1,"p-stepper",{"activeStep":[2,"active-step"],"direction":[513],"contentPosition":[513,"content-position"],"_rendering":[32]},null,{"activeStep":["_onActiveStepChange"]}]]],["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-c3999d3e",[[1,"p-button-group",{"size":[1]},[[0,"slotchange","slotchange"]]]]],["p-8426ca20",[[4,"p-card-body",{"inheritText":[516,"inherit-text"]}]]],["p-ec315c58",[[1,"p-card-container",{"hoverable":[516],"shadow":[516]}]]],["p-a37d182e",[[1,"p-iban-icon",{"iban":[513],"variant":[513]}]]],["p-bbe63029",[[1,"p-layout",{"variant":[1]}]]],["p-7793ba3a",[[1,"p-tab-item",{"active":[4]}]]],["p-d7f2d4d3",[[0,"p-table-column",{"path":[1537],"type":[1537],"name":[1537],"useSlot":[1540,"use-slot"],"hasCheckbox":[1540,"has-checkbox"],"align":[1537],"isLast":[1040],"parsedSizes":[1040],"sizes":[1032]}]]],["p-6f24685c",[[0,"p-table-row-action",{"type":[1537],"icon":[1],"iconOnly":[4,"icon-only"],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"],"label":[1],"action":[16],"disabled":[4],"loading":[4],"showFunction":[16]}]]],["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-d8641c29",[[1,"p-stepper-line",{"active":[516],"direction":[513]}]]],["p-639665b1",[[1,"p-drawer-header",{"showClose":[4,"show-close"]}],[1,"p-drawer-body",{"variant":[1]}],[4,"p-drawer-container",{"closing":[4]}]]],["p-3755da14",[[1,"p-backdrop",{"variant":[1],"applyBlur":[4,"apply-blur"],"closing":[4],"scrollLock":[4,"scroll-lock"]},[[2,"click","handleClick"]]]]],["p-30c9f5e3",[[1,"p-modal-header",{"showClose":[4,"show-close"]}],[1,"p-modal-footer"],[1,"p-modal-body",{"variant":[1],"roundedBottom":[4,"rounded-bottom"],"roundedTop":[4,"rounded-top"],"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-a2b552f9",[[1,"p-divider",{"variant":[513]}]]],["p-ef0bfa6c",[[4,"p-dropdown-menu-container",{"maxWidth":[4,"max-width"],"fullWidth":[4,"full-width"],"allowOverflow":[4,"allow-overflow"],"scrollable":[8]}]]],["p-46052ca3",[[1,"p-dropdown-menu-item",{"active":[4],"variant":[1],"enableHover":[4,"enable-hover"],"icon":[1],"useContainer":[4,"use-container"]}],[1,"p-dropdown",{"placement":[513],"offset":[2],"strategy":[1],"show":[4],"calculateWidth":[4,"calculate-width"],"applyMaxWidth":[4,"apply-max-width"],"applyFullWidth":[4,"apply-full-width"],"allowOverflow":[4,"allow-overflow"],"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-00d4647f",[[1,"p-tooltip",{"variant":[1],"content":[8],"placement":[1],"offset":[2],"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-867c00e9",[[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-7d396ed7",[[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"],"enableFilterDesktop":[4,"enable-filter-desktop"],"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],"tableHasActions":[4,"table-has-actions"],"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],"disabled":[516]}],[0,"p-illustration",{"variant":[1]}],[1,"p-table-container",{"shadow":[4]}]]]]'),e)));
2
2
  //# sourceMappingURL=paperless.esm.js.map
@@ -11,7 +11,7 @@ const Stepper = class {
11
11
  index.registerInstance(this, hostRef);
12
12
  this._loaded = false;
13
13
  // private _steps: Array<HTMLPStepperItemElement>;
14
- this._delay = (amount) => new Promise((resolve) => setTimeout(resolve, amount));
14
+ this._delay = (amount) => new Promise(resolve => setTimeout(resolve, amount));
15
15
  this._onSlotChange = async (_e) => this._generateSteps();
16
16
  this._generateSteps = async (firstLoad = false) => {
17
17
  if (!firstLoad && (!this._el || this._rendering || !this._loaded)) {
@@ -45,8 +45,7 @@ const Stepper = class {
45
45
  item.contentPosition = this.contentPosition;
46
46
  if (i < items.length - 1) {
47
47
  const nextItem = item.nextElementSibling;
48
- if (nextItem &&
49
- nextItem.tagName.toLowerCase() === 'p-stepper-item') {
48
+ if (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-item') {
50
49
  // super hacky, but we want to wait for the css of the `item.direction` change to be applied before querying for the item.clientHeight
51
50
  // otherwise we always get the initial "16"
52
51
  if (directionChanged) {
@@ -57,7 +56,7 @@ const Stepper = class {
57
56
  : item.clientHeight) / 2;
58
57
  const stepperLine = document.createElement('p-stepper-line');
59
58
  stepperLine.direction = this.direction;
60
- stepperLine.active = i <= activeStep;
59
+ stepperLine.active = i < activeStep;
61
60
  if (heightDiff > 0 && this.direction === 'vertical') {
62
61
  stepperLine.style.marginTop = `-${heightDiff / 16}rem`;
63
62
  stepperLine.style.marginBottom = `-${heightDiff / 16}rem`;
@@ -65,8 +64,7 @@ const Stepper = class {
65
64
  }
66
65
  this._el.insertBefore(stepperLine, nextItem);
67
66
  const previous = stepperLine.previousElementSibling;
68
- if (previous &&
69
- previous.tagName.toLowerCase() === 'p-stepper-line') {
67
+ if (previous && previous.tagName.toLowerCase() === 'p-stepper-line') {
70
68
  previous.remove();
71
69
  }
72
70
  continue;
@@ -97,7 +95,7 @@ const Stepper = class {
97
95
  this._generateSteps(true);
98
96
  }
99
97
  render() {
100
- return (index.h(index.Host, { class: "p-stepper" }, index.h("slot", { onSlotchange: this._onSlotChange })));
98
+ return (index.h(index.Host, { class: 'p-stepper' }, index.h("slot", { onSlotchange: this._onSlotChange })));
101
99
  }
102
100
  _onActiveStepChange() {
103
101
  this._generateSteps();
@@ -1 +1 @@
1
- {"file":"p-stepper.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,mBAAmB,GAAG,gfAAgf;;MCO/f,OAAO;;;IAwBX,YAAO,GAAG,KAAK,CAAC;;IAIhB,WAAM,GAAG,CAAC,MAAc,KAC/B,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IAE/C,kBAAa,GAAG,OAAO,EAAS,KAAK,IAAI,CAAC,cAAc,EAAE,CAAC;IAE3D,mBAAc,GAAG,OAAO,SAAS,GAAG,KAAK;MAChD,IAAI,CAAC,SAAS,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;QAClE,OAAO;OACP;MAED,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;MAEvB,IAAI,UAAU,GAAG,IAAI,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,CAAC;MAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;MAE1D,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,UAAU,GAAG,CAAC,EAAE;QACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,CAAA,EAAE,CAAC,EAAE,EAAE;UACvC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAQ,CAAC;UAElC,IAAI,IAAI,CAAC,MAAM,EAAE;YAChB,UAAU,GAAG,CAAC,CAAC;WACf;UAED,IAAI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G,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;QAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,CAAC,MAAM,EAAE,CAAC;OACd;MAED,UAAU,CAAC,OAAO,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;KACjD,CAAC;sBAvI2B,CAAC;qBAM7B,YAAY;2BAK+C,KAAK;sBAOnC,KAAK;;EAuHnC,gBAAgB;IACf,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACpB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;GAC1B;EAED,MAAM;IACL,QACCA,QAACC,UAAI,IAAC,KAAK,EAAC,WAAW,IACtBD,kBAAM,YAAY,EAAE,IAAI,CAAC,aAAa,GAAI,CACpC,EACN;GACF;EAGS,mBAAmB;IAC5B,IAAI,CAAC,cAAc,EAAE,CAAC;GACtB;;;;;;;;;;","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, State, 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\t@State() private _rendering = false;\n\n\tprivate _loaded = false;\n\n\t// private _steps: Array<HTMLPStepperItemElement>;\n\n\tprivate _delay = (amount: number) =>\n\t\tnew Promise((resolve) => setTimeout(resolve, amount));\n\n\tprivate _onSlotChange = async (_e: Event) => this._generateSteps();\n\n\tprivate _generateSteps = async (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 this._delay(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: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\tsetTimeout(() => (this._rendering = false), 100);\n\t};\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._onSlotChange} />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Watch('activeStep')\n\tprotected _onActiveStepChange() {\n\t\tthis._generateSteps();\n\t}\n}\n"],"version":3}
1
+ {"file":"p-stepper.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,mBAAmB,GAAG,gfAAgf;;MCO/f,OAAO;;;IAuBX,YAAO,GAAG,KAAK,CAAC;;IAIhB,WAAM,GAAG,CAAC,MAAc,KAC/B,IAAI,OAAO,CAAC,OAAO,IAAI,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IAE7C,kBAAa,GAAG,OAAO,EAAS,KAAK,IAAI,CAAC,cAAc,EAAE,CAAC;IAE3D,mBAAc,GAAG,OAAO,SAAS,GAAG,KAAK;MAChD,IAAI,CAAC,SAAS,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;QAClE,OAAO;OACP;MAED,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;MAEvB,IAAI,UAAU,GAAG,IAAI,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,CAAC;MAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;MAE1D,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,UAAU,GAAG,CAAC,EAAE;QACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,CAAA,EAAE,C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AI,IAAI,CAAC,QAAQ,CAAC;WACnD;SACD;OACD;MAED,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAgB,CACtC,wEAAwE,CACxE,CAAC;MACF,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;QAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,CAAC,MAAM,EAAE,CAAC;OACd;MAED,UAAU,CAAC,OAAO,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;KACjD,CAAC;sBA7H2B,CAAC;qBAKkC,YAAY;2BAKhB,KAAK;sBAOnC,KAAK;;EA8GnC,gBAAgB;IACf,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACpB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;GAC1B;EAED,MAAM;IACL,QACCA,QAACC,UAAI,IAAC,KAAK,EAAC,WAAW,IACtBD,kBAAM,YAAY,EAAE,IAAI,CAAC,aAAa,GAAI,CACpC,EACN;GACF;EAGS,mBAAmB;IAC5B,IAAI,CAAC,cAAc,EAAE,CAAC;GACtB;;;;;;;;;;","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, State, 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' = '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\t@State() private _rendering = false;\n\n\tprivate _loaded = false;\n\n\t// private _steps: Array<HTMLPStepperItemElement>;\n\n\tprivate _delay = (amount: number) =>\n\t\tnew Promise(resolve => setTimeout(resolve, amount));\n\n\tprivate _onSlotChange = async (_e: Event) => this._generateSteps();\n\n\tprivate _generateSteps = async (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 (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-item') {\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 this._delay(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 = document.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 = `-${heightDiff / 16}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 (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\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: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\tsetTimeout(() => (this._rendering = false), 100);\n\t};\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._onSlotChange} />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Watch('activeStep')\n\tprotected _onActiveStepChange() {\n\t\tthis._generateSteps();\n\t}\n}\n"],"version":3}
@@ -3,7 +3,7 @@ export class Stepper {
3
3
  constructor() {
4
4
  this._loaded = false;
5
5
  // private _steps: Array<HTMLPStepperItemElement>;
6
- this._delay = (amount) => new Promise((resolve) => setTimeout(resolve, amount));
6
+ this._delay = (amount) => new Promise(resolve => setTimeout(resolve, amount));
7
7
  this._onSlotChange = async (_e) => this._generateSteps();
8
8
  this._generateSteps = async (firstLoad = false) => {
9
9
  if (!firstLoad && (!this._el || this._rendering || !this._loaded)) {
@@ -37,8 +37,7 @@ export class Stepper {
37
37
  item.contentPosition = this.contentPosition;
38
38
  if (i < items.length - 1) {
39
39
  const nextItem = item.nextElementSibling;
40
- if (nextItem &&
41
- nextItem.tagName.toLowerCase() === 'p-stepper-item') {
40
+ if (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-item') {
42
41
  // super hacky, but we want to wait for the css of the `item.direction` change to be applied before querying for the item.clientHeight
43
42
  // otherwise we always get the initial "16"
44
43
  if (directionChanged) {
@@ -49,7 +48,7 @@ export class Stepper {
49
48
  : item.clientHeight) / 2;
50
49
  const stepperLine = document.createElement('p-stepper-line');
51
50
  stepperLine.direction = this.direction;
52
- stepperLine.active = i <= activeStep;
51
+ stepperLine.active = i < activeStep;
53
52
  if (heightDiff > 0 && this.direction === 'vertical') {
54
53
  stepperLine.style.marginTop = `-${heightDiff / 16}rem`;
55
54
  stepperLine.style.marginBottom = `-${heightDiff / 16}rem`;
@@ -57,8 +56,7 @@ export class Stepper {
57
56
  }
58
57
  this._el.insertBefore(stepperLine, nextItem);
59
58
  const previous = stepperLine.previousElementSibling;
60
- if (previous &&
61
- previous.tagName.toLowerCase() === 'p-stepper-line') {
59
+ if (previous && previous.tagName.toLowerCase() === 'p-stepper-line') {
62
60
  previous.remove();
63
61
  }
64
62
  continue;
@@ -89,7 +87,7 @@ export class Stepper {
89
87
  this._generateSteps(true);
90
88
  }
91
89
  render() {
92
- return (h(Host, { class: "p-stepper" }, h("slot", { onSlotchange: this._onSlotChange })));
90
+ return (h(Host, { class: 'p-stepper' }, h("slot", { onSlotchange: this._onSlotChange })));
93
91
  }
94
92
  _onActiveStepChange() {
95
93
  this._generateSteps();
@@ -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,KAAK,EAAE,MAAM,eAAe,CAAC;AAOhF,MAAM,OAAO,OAAO;;IAwBX,YAAO,GAAG,KAAK,CAAC;IAExB,kDAAkD;IAE1C,WAAM,GAAG,CAAC,MAAc,EAAE,EAAE,CACnC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IAE/C,kBAAa,GAAG,KAAK,EAAE,EAAS,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;IAE3D,mBAAc,GAAG,KAAK,EAAE,SAAS,GAAG,KAAK,EAAE,EAAE;MACpD,IAAI,CAAC,SAAS,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;QAClE,OAAO;OACP;MAED,IAAI,CAAC,UAAU,GAAG,IA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mB;IAC5B,IAAI,CAAC,cAAc,EAAE,CAAC;EACvB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, Host, Prop, State, 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\t@State() private _rendering = false;\n\n\tprivate _loaded = false;\n\n\t// private _steps: Array<HTMLPStepperItemElement>;\n\n\tprivate _delay = (amount: number) =>\n\t\tnew Promise((resolve) => setTimeout(resolve, amount));\n\n\tprivate _onSlotChange = async (_e: Event) => this._generateSteps();\n\n\tprivate _generateSteps = async (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 this._delay(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: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\tsetTimeout(() => (this._rendering = false), 100);\n\t};\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._onSlotChange} />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Watch('activeStep')\n\tprotected _onActiveStepChange() {\n\t\tthis._generateSteps();\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,KAAK,EAAE,MAAM,eAAe,CAAC;AAOhF,MAAM,OAAO,OAAO;;IAuBX,YAAO,GAAG,KAAK,CAAC;IAExB,kDAAkD;IAE1C,WAAM,GAAG,CAAC,MAAc,EAAE,EAAE,CACnC,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,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,CAAC,CAAC;IAClD,CAAC,CAAC;sBA7H2B,CAAC;qBAKkC,YAAY;2BAKhB,KAAK;sBAOnC,KAAK;;EA8GnC,gBAAgB;IACf,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACpB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;EAC3B,CAAC;EAED,MAAM;IACL,OAAO,CACN,EAAC,IAAI,IAAC,KAAK,EAAC,WAAW;MACtB,YAAM,YAAY,EAAE,IAAI,CAAC,aAAa,GAAI,CACpC,CACP,CAAC;EACH,CAAC;EAGS,mBAAmB;IAC5B,IAAI,CAAC,cAAc,EAAE,CAAC;EACvB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, Host, Prop, State, 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' = '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\t@State() private _rendering = false;\n\n\tprivate _loaded = false;\n\n\t// private _steps: Array<HTMLPStepperItemElement>;\n\n\tprivate _delay = (amount: number) =>\n\t\tnew Promise(resolve => setTimeout(resolve, amount));\n\n\tprivate _onSlotChange = async (_e: Event) => this._generateSteps();\n\n\tprivate _generateSteps = async (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 (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-item') {\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 this._delay(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 = document.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 = `-${heightDiff / 16}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 (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\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: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\tsetTimeout(() => (this._rendering = false), 100);\n\t};\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._onSlotChange} />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Watch('activeStep')\n\tprotected _onActiveStepChange() {\n\t\tthis._generateSteps();\n\t}\n}\n"]}
@@ -10,7 +10,7 @@ const Stepper = /*@__PURE__*/ proxyCustomElement(class Stepper extends HTMLEleme
10
10
  this.__attachShadow();
11
11
  this._loaded = false;
12
12
  // private _steps: Array<HTMLPStepperItemElement>;
13
- this._delay = (amount) => new Promise((resolve) => setTimeout(resolve, amount));
13
+ this._delay = (amount) => new Promise(resolve => setTimeout(resolve, amount));
14
14
  this._onSlotChange = async (_e) => this._generateSteps();
15
15
  this._generateSteps = async (firstLoad = false) => {
16
16
  if (!firstLoad && (!this._el || this._rendering || !this._loaded)) {
@@ -44,8 +44,7 @@ const Stepper = /*@__PURE__*/ proxyCustomElement(class Stepper extends HTMLEleme
44
44
  item.contentPosition = this.contentPosition;
45
45
  if (i < items.length - 1) {
46
46
  const nextItem = item.nextElementSibling;
47
- if (nextItem &&
48
- nextItem.tagName.toLowerCase() === 'p-stepper-item') {
47
+ if (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-item') {
49
48
  // super hacky, but we want to wait for the css of the `item.direction` change to be applied before querying for the item.clientHeight
50
49
  // otherwise we always get the initial "16"
51
50
  if (directionChanged) {
@@ -56,7 +55,7 @@ const Stepper = /*@__PURE__*/ proxyCustomElement(class Stepper extends HTMLEleme
56
55
  : item.clientHeight) / 2;
57
56
  const stepperLine = document.createElement('p-stepper-line');
58
57
  stepperLine.direction = this.direction;
59
- stepperLine.active = i <= activeStep;
58
+ stepperLine.active = i < activeStep;
60
59
  if (heightDiff > 0 && this.direction === 'vertical') {
61
60
  stepperLine.style.marginTop = `-${heightDiff / 16}rem`;
62
61
  stepperLine.style.marginBottom = `-${heightDiff / 16}rem`;
@@ -64,8 +63,7 @@ const Stepper = /*@__PURE__*/ proxyCustomElement(class Stepper extends HTMLEleme
64
63
  }
65
64
  this._el.insertBefore(stepperLine, nextItem);
66
65
  const previous = stepperLine.previousElementSibling;
67
- if (previous &&
68
- previous.tagName.toLowerCase() === 'p-stepper-line') {
66
+ if (previous && previous.tagName.toLowerCase() === 'p-stepper-line') {
69
67
  previous.remove();
70
68
  }
71
69
  continue;
@@ -96,7 +94,7 @@ const Stepper = /*@__PURE__*/ proxyCustomElement(class Stepper extends HTMLEleme
96
94
  this._generateSteps(true);
97
95
  }
98
96
  render() {
99
- return (h(Host, { class: "p-stepper" }, h("slot", { onSlotchange: this._onSlotChange })));
97
+ return (h(Host, { class: 'p-stepper' }, h("slot", { onSlotchange: this._onSlotChange })));
100
98
  }
101
99
  _onActiveStepChange() {
102
100
  this._generateSteps();
@@ -1 +1 @@
1
- {"file":"p-stepper.js","mappings":";;;AAAA,MAAM,mBAAmB,GAAG,gfAAgf;;MCO/f,OAAO;;;;;IAwBX,YAAO,GAAG,KAAK,CAAC;;IAIhB,WAAM,GAAG,CAAC,MAAc,KAC/B,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IAE/C,kBAAa,GAAG,OAAO,EAAS,KAAK,IAAI,CAAC,cAAc,EAAE,CAAC;IAE3D,mBAAc,GAAG,OAAO,SAAS,GAAG,KAAK;MAChD,IAAI,CAAC,SAAS,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;QAClE,OAAO;OACP;MAED,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;MAEvB,IAAI,UAAU,GAAG,IAAI,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,CAAC;MAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;MAE1D,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,UAAU,GAAG,CAAC,EAAE;QACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,CAAA,EAAE,CAAC,EAAE,EAAE;UACvC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAQ,CAAC;UAElC,IAAI,IAAI,CAAC,MAAM,EAAE;YAChB,UAAU,GAAG,CAAC,CAAC;WACf;UAED,IAAI,UAAU,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE;YACpC,UAAU,GAAG,CAAC,GAAG,CAAC,CAAC;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,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,CAAC,MAAM,EAAE,CAAC;OACd;MAED,UAAU,CAAC,OAAO,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;KACjD,CAAC;sBAvI2B,CAAC;qBAM7B,YAAY;2BAK+C,KAAK;sBAOnC,KAAK;;EAuHnC,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,IAAI,CAAC,aAAa,GAAI,CACpC,EACN;GACF;EAGS,mBAAmB;IAC5B,IAAI,CAAC,cAAc,EAAE,CAAC;GACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","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, State, 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\t@State() private _rendering = false;\n\n\tprivate _loaded = false;\n\n\t// private _steps: Array<HTMLPStepperItemElement>;\n\n\tprivate _delay = (amount: number) =>\n\t\tnew Promise((resolve) => setTimeout(resolve, amount));\n\n\tprivate _onSlotChange = async (_e: Event) => this._generateSteps();\n\n\tprivate _generateSteps = async (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 this._delay(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: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\tsetTimeout(() => (this._rendering = false), 100);\n\t};\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._onSlotChange} />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Watch('activeStep')\n\tprotected _onActiveStepChange() {\n\t\tthis._generateSteps();\n\t}\n}\n"],"version":3}
1
+ {"file":"p-stepper.js","mappings":";;;AAAA,MAAM,mBAAmB,GAAG,gfAAgf;;MCO/f,OAAO;;;;;IAuBX,YAAO,GAAG,KAAK,CAAC;;IAIhB,WAAM,GAAG,CAAC,MAAc,KAC/B,IAAI,OAAO,CAAC,OAAO,IAAI,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IAE7C,kBAAa,GAAG,OAAO,EAAS,KAAK,IAAI,CAAC,cAAc,EAAE,CAAC;IAE3D,mBAAc,GAAG,OAAO,SAAS,GAAG,KAAK;MAChD,IAAI,CAAC,SAAS,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;QAClE,OAAO;OACP;MAED,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;MAEvB,IAAI,UAAU,GAAG,IAAI,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,CAAC;MAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;MAE1D,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,UAAU,GAAG,CAAC,EAAE;QACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,CAAA,EAAE,CAAC,EAAE,EAAE;UACvC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAQ,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,GAAG,CAAC,gBAAgB,CACtC,wEAAwE,CACxE,CAAC;MACF,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;QAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,CAAC,MAAM,EAAE,CAAC;OACd;MAED,UAAU,CAAC,OAAO,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;KACjD,CAAC;sBA7H2B,CAAC;qBAKkC,YAAY;2BAKhB,KAAK;sBAOnC,KAAK;;EA8GnC,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,IAAI,CAAC,aAAa,GAAI,CACpC,EACN;GACF;EAGS,mBAAmB;IAC5B,IAAI,CAAC,cAAc,EAAE,CAAC;GACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","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, State, 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' = '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\t@State() private _rendering = false;\n\n\tprivate _loaded = false;\n\n\t// private _steps: Array<HTMLPStepperItemElement>;\n\n\tprivate _delay = (amount: number) =>\n\t\tnew Promise(resolve => setTimeout(resolve, amount));\n\n\tprivate _onSlotChange = async (_e: Event) => this._generateSteps();\n\n\tprivate _generateSteps = async (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 (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-item') {\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 this._delay(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 = document.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 = `-${heightDiff / 16}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 (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\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: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\tsetTimeout(() => (this._rendering = false), 100);\n\t};\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._onSlotChange} />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Watch('activeStep')\n\tprotected _onActiveStepChange() {\n\t\tthis._generateSteps();\n\t}\n}\n"],"version":3}
@@ -7,7 +7,7 @@ const Stepper = class {
7
7
  registerInstance(this, hostRef);
8
8
  this._loaded = false;
9
9
  // private _steps: Array<HTMLPStepperItemElement>;
10
- this._delay = (amount) => new Promise((resolve) => setTimeout(resolve, amount));
10
+ this._delay = (amount) => new Promise(resolve => setTimeout(resolve, amount));
11
11
  this._onSlotChange = async (_e) => this._generateSteps();
12
12
  this._generateSteps = async (firstLoad = false) => {
13
13
  if (!firstLoad && (!this._el || this._rendering || !this._loaded)) {
@@ -41,8 +41,7 @@ const Stepper = class {
41
41
  item.contentPosition = this.contentPosition;
42
42
  if (i < items.length - 1) {
43
43
  const nextItem = item.nextElementSibling;
44
- if (nextItem &&
45
- nextItem.tagName.toLowerCase() === 'p-stepper-item') {
44
+ if (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-item') {
46
45
  // super hacky, but we want to wait for the css of the `item.direction` change to be applied before querying for the item.clientHeight
47
46
  // otherwise we always get the initial "16"
48
47
  if (directionChanged) {
@@ -53,7 +52,7 @@ const Stepper = class {
53
52
  : item.clientHeight) / 2;
54
53
  const stepperLine = document.createElement('p-stepper-line');
55
54
  stepperLine.direction = this.direction;
56
- stepperLine.active = i <= activeStep;
55
+ stepperLine.active = i < activeStep;
57
56
  if (heightDiff > 0 && this.direction === 'vertical') {
58
57
  stepperLine.style.marginTop = `-${heightDiff / 16}rem`;
59
58
  stepperLine.style.marginBottom = `-${heightDiff / 16}rem`;
@@ -61,8 +60,7 @@ const Stepper = class {
61
60
  }
62
61
  this._el.insertBefore(stepperLine, nextItem);
63
62
  const previous = stepperLine.previousElementSibling;
64
- if (previous &&
65
- previous.tagName.toLowerCase() === 'p-stepper-line') {
63
+ if (previous && previous.tagName.toLowerCase() === 'p-stepper-line') {
66
64
  previous.remove();
67
65
  }
68
66
  continue;
@@ -93,7 +91,7 @@ const Stepper = class {
93
91
  this._generateSteps(true);
94
92
  }
95
93
  render() {
96
- return (h(Host, { class: "p-stepper" }, h("slot", { onSlotchange: this._onSlotChange })));
94
+ return (h(Host, { class: 'p-stepper' }, h("slot", { onSlotchange: this._onSlotChange })));
97
95
  }
98
96
  _onActiveStepChange() {
99
97
  this._generateSteps();
@@ -1 +1 @@
1
- {"file":"p-stepper.entry.js","mappings":";;AAAA,MAAM,mBAAmB,GAAG,gfAAgf;;MCO/f,OAAO;;;IAwBX,YAAO,GAAG,KAAK,CAAC;;IAIhB,WAAM,GAAG,CAAC,MAAc,KAC/B,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IAE/C,kBAAa,GAAG,OAAO,EAAS,KAAK,IAAI,CAAC,cAAc,EAAE,CAAC;IAE3D,mBAAc,GAAG,OAAO,SAAS,GAAG,KAAK;MAChD,IAAI,CAAC,SAAS,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;QAClE,OAAO;OACP;MAED,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;MAEvB,IAAI,UAAU,GAAG,IAAI,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,CAAC;MAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;MAE1D,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,UAAU,GAAG,CAAC,EAAE;QACvC,KAAK,IAAI,CAAC,GAAG,CAA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C,SAAS,CAAC;YACxC,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC;WACnD;SACD;OACD;MAED,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAgB,CACtC,wEAAwE,CACxE,CAAC;MACF,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;QAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,CAAC,MAAM,EAAE,CAAC;OACd;MAED,UAAU,CAAC,OAAO,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;KACjD,CAAC;sBAvI2B,CAAC;qBAM7B,YAAY;2BAK+C,KAAK;sBAOnC,KAAK;;EAuHnC,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,IAAI,CAAC,aAAa,GAAI,CACpC,EACN;GACF;EAGS,mBAAmB;IAC5B,IAAI,CAAC,cAAc,EAAE,CAAC;GACtB;;;;;;;;;;","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, State, 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\t@State() private _rendering = false;\n\n\tprivate _loaded = false;\n\n\t// private _steps: Array<HTMLPStepperItemElement>;\n\n\tprivate _delay = (amount: number) =>\n\t\tnew Promise((resolve) => setTimeout(resolve, amount));\n\n\tprivate _onSlotChange = async (_e: Event) => this._generateSteps();\n\n\tprivate _generateSteps = async (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 this._delay(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: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\tsetTimeout(() => (this._rendering = false), 100);\n\t};\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._onSlotChange} />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Watch('activeStep')\n\tprotected _onActiveStepChange() {\n\t\tthis._generateSteps();\n\t}\n}\n"],"version":3}
1
+ {"file":"p-stepper.entry.js","mappings":";;AAAA,MAAM,mBAAmB,GAAG,gfAAgf;;MCO/f,OAAO;;;IAuBX,YAAO,GAAG,KAAK,CAAC;;IAIhB,WAAM,GAAG,CAAC,MAAc,KAC/B,IAAI,OAAO,CAAC,OAAO,IAAI,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IAE7C,kBAAa,GAAG,OAAO,EAAS,KAAK,IAAI,CAAC,cAAc,EAAE,CAAC;IAE3D,mBAAc,GAAG,OAAO,SAAS,GAAG,KAAK;MAChD,IAAI,CAAC,SAAS,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;QAClE,OAAO;OACP;MAED,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;MAEvB,IAAI,UAAU,GAAG,IAAI,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,CAAC;MAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,GA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ACV,MAAM,YAAY,GAAG,IAAI,CAAC,sBAAsB,CAAC;UACjD,IAAI,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,gBAAgB,EAAE;YAC5D,YAAY,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;YACxC,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC;WACnD;SACD;OACD;MAED,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAgB,CACtC,wEAAwE,CACxE,CAAC;MACF,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;QAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,CAAC,MAAM,EAAE,CAAC;OACd;MAED,UAAU,CAAC,OAAO,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;KACjD,CAAC;sBA7H2B,CAAC;qBAKkC,YAAY;2BAKhB,KAAK;sBAOnC,KAAK;;EA8GnC,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,IAAI,CAAC,aAAa,GAAI,CACpC,EACN;GACF;EAGS,mBAAmB;IAC5B,IAAI,CAAC,cAAc,EAAE,CAAC;GACtB;;;;;;;;;;","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, State, 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' = '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\t@State() private _rendering = false;\n\n\tprivate _loaded = false;\n\n\t// private _steps: Array<HTMLPStepperItemElement>;\n\n\tprivate _delay = (amount: number) =>\n\t\tnew Promise(resolve => setTimeout(resolve, amount));\n\n\tprivate _onSlotChange = async (_e: Event) => this._generateSteps();\n\n\tprivate _generateSteps = async (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 (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-item') {\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 this._delay(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 = document.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 = `-${heightDiff / 16}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 (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\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: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\tsetTimeout(() => (this._rendering = false), 100);\n\t};\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._onSlotChange} />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Watch('activeStep')\n\tprotected _onActiveStepChange() {\n\t\tthis._generateSteps();\n\t}\n}\n"],"version":3}
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> <script type="module" src="/build/paperless.esm.js" data-stencil data-resources-url="/build/" data-stencil-namespace="paperless"></script> <script nomodule="" src="/build/paperless.js" data-stencil></script> </head> <body> <p-button>Buttono</p-button> <script data-build="2025-02-10T16:21:58">
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> <script type="module" src="/build/paperless.esm.js" data-stencil data-resources-url="/build/" data-stencil-namespace="paperless"></script> <script nomodule="" src="/build/paperless.js" data-stencil></script> </head> <body> <p-button>Buttono</p-button> <script data-build="2025-02-11T11:55:44">
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,h as i,H as e,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 n=class{constructor(i){t(this,i);this._loaded=false;this._delay=t=>new Promise((i=>setTimeout(i,t)));this._onSlotChange=async t=>this._generateSteps();this._generateSteps=async(t=false)=>{if(!t&&(!this._el||this._rendering||!this._loaded)){return}this._rendering=true;let i=this.activeStep-1||0;const e=this._el.querySelectorAll("p-stepper-item");if(!this.activeStep||i<0){for(let t=0;t<(e===null||e===void 0?void 0:e.length);t++){const s=e.item(t);if(s.active){i=t}if(i<0&&s.finished){i=t+1}}}for(let t=0;t<(e===null||e===void 0?void 0:e.length);t++){let s=false;const o=e.item(t);o.active=t===i;o.finished=t<i;if(o.direction!==this.direction){s=true}o.direction=this.direction;o.align=t===0?"start":t===(e===null||e===void 0?void 0:e.length)-1?"end":"center";o.contentPosition=this.contentPosition;if(t<e.length-1){const e=o.nextElementSibling;if(e&&e.tagName.toLowerCase()==="p-stepper-item"){if(s){await this._delay(10)}const n=(o.clientHeight>16?o.clientHeight-16:o.clientHeight)/2;const r=document.createElement("p-stepper-line");r.direction=this.direction;r.active=t<=i;if(n>0&&this.direction==="vertical"){r.style.marginTop=`-${n/16}rem`;r.style.marginBottom=`-${n/16}rem`;r.style.minHeight=`calc(1rem + ${n*2/16}rem)`}this._el.insertBefore(r,e);const l=r.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:not(:has(+ p-stepper-item)), p-stepper-line:first-child");for(let t=s.length-1;t>=0;t--){const i=s.item(t);i.remove()}setTimeout((()=>this._rendering=false),100)};this.activeStep=1;this.direction="horizontal";this.contentPosition="end";this._rendering=false}componentDidLoad(){this._loaded=true;this._generateSteps(true)}render(){return i(e,{class:"p-stepper"},i("slot",{onSlotchange:this._onSlotChange}))}_onActiveStepChange(){this._generateSteps()}get _el(){return s(this)}static get watchers(){return{activeStep:["_onActiveStepChange"]}}};n.style=o;export{n as p_stepper};
2
- //# sourceMappingURL=p-5fa3061e.entry.js.map
1
+ import{r as t,h as i,H as e,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 n=class{constructor(i){t(this,i);this._loaded=false;this._delay=t=>new Promise((i=>setTimeout(i,t)));this._onSlotChange=async t=>this._generateSteps();this._generateSteps=async(t=false)=>{if(!t&&(!this._el||this._rendering||!this._loaded)){return}this._rendering=true;let i=this.activeStep-1||0;const e=this._el.querySelectorAll("p-stepper-item");if(!this.activeStep||i<0){for(let t=0;t<(e===null||e===void 0?void 0:e.length);t++){const s=e.item(t);if(s.active){i=t}if(i<0&&s.finished){i=t+1}}}for(let t=0;t<(e===null||e===void 0?void 0:e.length);t++){let s=false;const o=e.item(t);o.active=t===i;o.finished=t<i;if(o.direction!==this.direction){s=true}o.direction=this.direction;o.align=t===0?"start":t===(e===null||e===void 0?void 0:e.length)-1?"end":"center";o.contentPosition=this.contentPosition;if(t<e.length-1){const e=o.nextElementSibling;if(e&&e.tagName.toLowerCase()==="p-stepper-item"){if(s){await this._delay(10)}const n=(o.clientHeight>16?o.clientHeight-16:o.clientHeight)/2;const r=document.createElement("p-stepper-line");r.direction=this.direction;r.active=t<i;if(n>0&&this.direction==="vertical"){r.style.marginTop=`-${n/16}rem`;r.style.marginBottom=`-${n/16}rem`;r.style.minHeight=`calc(1rem + ${n*2/16}rem)`}this._el.insertBefore(r,e);const l=r.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:not(:has(+ p-stepper-item)), p-stepper-line:first-child");for(let t=s.length-1;t>=0;t--){const i=s.item(t);i.remove()}setTimeout((()=>this._rendering=false),100)};this.activeStep=1;this.direction="horizontal";this.contentPosition="end";this._rendering=false}componentDidLoad(){this._loaded=true;this._generateSteps(true)}render(){return i(e,{class:"p-stepper"},i("slot",{onSlotchange:this._onSlotChange}))}_onActiveStepChange(){this._generateSteps()}get _el(){return s(this)}static get watchers(){return{activeStep:["_onActiveStepChange"]}}};n.style=o;export{n as p_stepper};
2
+ //# sourceMappingURL=p-0b0c43cc.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["stepperComponentCss","Stepper","this","_loaded","_delay","amount","Promise","resolve","setTimeout","_onSlotChange","async","_e","_generateSteps","firstLoad","_el","_rendering","activeStep","items","querySelectorAll","i","length","item","active","finished","directionChanged","direction","align","contentPosition","nextItem","nextElementSibling","tagName","toLowerCase","heightDiff","clientHeight","stepperLine","document","createElement","style","marginTop","marginBottom","minHeight","insertBefore","previous","previousElementSibling","remove","previousItem","lines","j","line","componentDidLoad","render","h","Host","class","onSlotchange","_onActiveStepChange"],"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, State, 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' = '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\t@State() private _rendering = false;\n\n\tprivate _loaded = false;\n\n\t// private _steps: Array<HTMLPStepperItemElement>;\n\n\tprivate _delay = (amount: number) =>\n\t\tnew Promise(resolve => setTimeout(resolve, amount));\n\n\tprivate _onSlotChange = async (_e: Event) => this._generateSteps();\n\n\tprivate _generateSteps = async (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 (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-item') {\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 this._delay(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 = document.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 = `-${heightDiff / 16}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 (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\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: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\tsetTimeout(() => (this._rendering = false), 100);\n\t};\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._onSlotChange} />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Watch('activeStep')\n\tprotected _onActiveStepChange() {\n\t\tthis._generateSteps();\n\t}\n}\n"],"mappings":"yDAAA,MAAMA,EAAsB,if,MCOfC,EAAO,M,yBAuBXC,KAAAC,QAAU,MAIVD,KAAAE,OAAUC,GACjB,IAAIC,SAAQC,GAAWC,WAAWD,EAASF,KAEpCH,KAAAO,cAAgBC,MAAOC,GAAcT,KAAKU,iBAE1CV,KAAAU,eAAiBF,MAAOG,EAAY,SAC3C,IAAKA,KAAeX,KAAKY,KAAOZ,KAAKa,aAAeb,KAAKC,SAAU,CAClE,M,CAGDD,KAAKa,WAAa,KAElB,IAAIC,EAAad,KAAKc,WAAa,GAAK,EACxC,MAAMC,EAAQf,KAAKY,IAAII,iBAAiB,kBAExC,IAAKhB,KAAKc,YAAcA,EAAa,EAAG,CACvC,IAAK,IAAIG,EAAI,EAAGA,GAAIF,IAAK,MAALA,SAAK,SAALA,EAAOG,QAAQD,IAAK,CACvC,MAAME,EAAOJ,EAAMI,KAAKF,GAExB,GAAIE,EAAKC,OAAQ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