@ukic/web-components 3.25.0 → 3.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/OpenInNew.js +5 -0
- package/components/OpenInNew.js.map +1 -0
- package/components/check-icon.js +8 -0
- package/components/check-icon.js.map +1 -0
- package/components/chevron-icon.js +8 -0
- package/components/chevron-icon.js.map +1 -0
- package/components/close-icon.js +10 -0
- package/components/close-icon.js.map +1 -0
- package/components/constants.js +184 -0
- package/components/constants.js.map +1 -0
- package/components/custom-elements.d.ts +2 -0
- package/components/helpers.js +547 -0
- package/components/helpers.js.map +1 -0
- package/components/ic-accordion-group.d.ts +11 -0
- package/components/ic-accordion-group.js +191 -0
- package/components/ic-accordion-group.js.map +1 -0
- package/components/ic-accordion.d.ts +11 -0
- package/components/ic-accordion.js +188 -0
- package/components/ic-accordion.js.map +1 -0
- package/components/ic-action-chip.d.ts +11 -0
- package/components/ic-action-chip.js +164 -0
- package/components/ic-action-chip.js.map +1 -0
- package/components/ic-alert.d.ts +11 -0
- package/components/ic-alert.js +193 -0
- package/components/ic-alert.js.map +1 -0
- package/components/ic-back-to-top.d.ts +11 -0
- package/components/ic-back-to-top.js +216 -0
- package/components/ic-back-to-top.js.map +1 -0
- package/components/ic-badge.d.ts +11 -0
- package/components/ic-badge.js +222 -0
- package/components/ic-badge.js.map +1 -0
- package/components/ic-breadcrumb-group.d.ts +11 -0
- package/components/ic-breadcrumb-group.js +278 -0
- package/components/ic-breadcrumb-group.js.map +1 -0
- package/components/ic-breadcrumb.d.ts +11 -0
- package/components/ic-breadcrumb.js +8 -0
- package/components/ic-breadcrumb.js.map +1 -0
- package/components/ic-breadcrumb2.js +145 -0
- package/components/ic-breadcrumb2.js.map +1 -0
- package/components/ic-button.d.ts +11 -0
- package/components/ic-button.js +8 -0
- package/components/ic-button.js.map +1 -0
- package/components/ic-button2.js +509 -0
- package/components/ic-button2.js.map +1 -0
- package/components/ic-card-horizontal.d.ts +11 -0
- package/components/ic-card-horizontal.js +214 -0
- package/components/ic-card-horizontal.js.map +1 -0
- package/components/ic-card-vertical.d.ts +11 -0
- package/components/ic-card-vertical.js +219 -0
- package/components/ic-card-vertical.js.map +1 -0
- package/components/ic-checkbox-group.d.ts +11 -0
- package/components/ic-checkbox-group.js +198 -0
- package/components/ic-checkbox-group.js.map +1 -0
- package/components/ic-checkbox.d.ts +11 -0
- package/components/ic-checkbox.js +202 -0
- package/components/ic-checkbox.js.map +1 -0
- package/components/ic-chip.d.ts +11 -0
- package/components/ic-chip.js +183 -0
- package/components/ic-chip.js.map +1 -0
- package/components/ic-classification-banner.d.ts +11 -0
- package/components/ic-classification-banner.js +102 -0
- package/components/ic-classification-banner.js.map +1 -0
- package/components/ic-data-list.d.ts +11 -0
- package/components/ic-data-list.js +63 -0
- package/components/ic-data-list.js.map +1 -0
- package/components/ic-data-row.d.ts +11 -0
- package/components/ic-data-row.js +115 -0
- package/components/ic-data-row.js.map +1 -0
- package/components/ic-dialog.d.ts +11 -0
- package/components/ic-dialog.js +366 -0
- package/components/ic-dialog.js.map +1 -0
- package/components/ic-divider.d.ts +11 -0
- package/components/ic-divider.js +8 -0
- package/components/ic-divider.js.map +1 -0
- package/components/ic-divider2.js +148 -0
- package/components/ic-divider2.js.map +1 -0
- package/components/ic-empty-state.d.ts +11 -0
- package/components/ic-empty-state.js +82 -0
- package/components/ic-empty-state.js.map +1 -0
- package/components/ic-footer-link-group.d.ts +11 -0
- package/components/ic-footer-link-group.js +101 -0
- package/components/ic-footer-link-group.js.map +1 -0
- package/components/ic-footer-link.d.ts +11 -0
- package/components/ic-footer-link.js +95 -0
- package/components/ic-footer-link.js.map +1 -0
- package/components/ic-footer.d.ts +11 -0
- package/components/ic-footer.js +156 -0
- package/components/ic-footer.js.map +1 -0
- package/components/ic-hero.d.ts +11 -0
- package/components/ic-hero.js +145 -0
- package/components/ic-hero.js.map +1 -0
- package/components/ic-horizontal-scroll.d.ts +11 -0
- package/components/ic-horizontal-scroll.js +8 -0
- package/components/ic-horizontal-scroll.js.map +1 -0
- package/components/ic-horizontal-scroll2.js +240 -0
- package/components/ic-horizontal-scroll2.js.map +1 -0
- package/components/ic-input-component-container.d.ts +11 -0
- package/components/ic-input-component-container.js +8 -0
- package/components/ic-input-component-container.js.map +1 -0
- package/components/ic-input-component-container2.js +95 -0
- package/components/ic-input-component-container2.js.map +1 -0
- package/components/ic-input-container.d.ts +11 -0
- package/components/ic-input-container.js +8 -0
- package/components/ic-input-container.js.map +1 -0
- package/components/ic-input-container2.js +47 -0
- package/components/ic-input-container2.js.map +1 -0
- package/components/ic-input-label.d.ts +11 -0
- package/components/ic-input-label.js +8 -0
- package/components/ic-input-label.js.map +1 -0
- package/components/ic-input-label2.js +121 -0
- package/components/ic-input-label2.js.map +1 -0
- package/components/ic-input-validation.d.ts +11 -0
- package/components/ic-input-validation.js +8 -0
- package/components/ic-input-validation.js.map +1 -0
- package/components/ic-input-validation2.js +90 -0
- package/components/ic-input-validation2.js.map +1 -0
- package/components/ic-layout-grid-item.d.ts +11 -0
- package/components/ic-layout-grid-item.js +95 -0
- package/components/ic-layout-grid-item.js.map +1 -0
- package/components/ic-layout-grid.d.ts +11 -0
- package/components/ic-layout-grid.js +188 -0
- package/components/ic-layout-grid.js.map +1 -0
- package/components/ic-link.d.ts +11 -0
- package/components/ic-link.js +8 -0
- package/components/ic-link.js.map +1 -0
- package/components/ic-link2.js +135 -0
- package/components/ic-link2.js.map +1 -0
- package/components/ic-loading-indicator.d.ts +11 -0
- package/components/ic-loading-indicator.js +8 -0
- package/components/ic-loading-indicator.js.map +1 -0
- package/components/ic-loading-indicator2.js +278 -0
- package/components/ic-loading-indicator2.js.map +1 -0
- package/components/ic-menu-group.d.ts +11 -0
- package/components/ic-menu-group.js +47 -0
- package/components/ic-menu-group.js.map +1 -0
- package/components/ic-menu-item.d.ts +11 -0
- package/components/ic-menu-item.js +8 -0
- package/components/ic-menu-item.js.map +1 -0
- package/components/ic-menu-item2.js +171 -0
- package/components/ic-menu-item2.js.map +1 -0
- package/components/ic-menu.d.ts +11 -0
- package/components/ic-menu.js +8 -0
- package/components/ic-menu.js.map +1 -0
- package/components/ic-menu2.js +2590 -0
- package/components/ic-menu2.js.map +1 -0
- package/components/ic-navigation-button.d.ts +11 -0
- package/components/ic-navigation-button.js +175 -0
- package/components/ic-navigation-button.js.map +1 -0
- package/components/ic-navigation-group.d.ts +11 -0
- package/components/ic-navigation-group.js +326 -0
- package/components/ic-navigation-group.js.map +1 -0
- package/components/ic-navigation-item.d.ts +11 -0
- package/components/ic-navigation-item.js +294 -0
- package/components/ic-navigation-item.js.map +1 -0
- package/components/ic-navigation-menu.d.ts +11 -0
- package/components/ic-navigation-menu.js +8 -0
- package/components/ic-navigation-menu.js.map +1 -0
- package/components/ic-navigation-menu2.js +188 -0
- package/components/ic-navigation-menu2.js.map +1 -0
- package/components/ic-page-header.d.ts +11 -0
- package/components/ic-page-header.js +196 -0
- package/components/ic-page-header.js.map +1 -0
- package/components/ic-pagination-bar.d.ts +11 -0
- package/components/ic-pagination-bar.js +523 -0
- package/components/ic-pagination-bar.js.map +1 -0
- package/components/ic-pagination-item.d.ts +11 -0
- package/components/ic-pagination-item.js +8 -0
- package/components/ic-pagination-item.js.map +1 -0
- package/components/ic-pagination-item2.js +107 -0
- package/components/ic-pagination-item2.js.map +1 -0
- package/components/ic-pagination.d.ts +11 -0
- package/components/ic-pagination.js +8 -0
- package/components/ic-pagination.js.map +1 -0
- package/components/ic-pagination2.js +379 -0
- package/components/ic-pagination2.js.map +1 -0
- package/components/ic-popover-menu.d.ts +11 -0
- package/components/ic-popover-menu.js +369 -0
- package/components/ic-popover-menu.js.map +1 -0
- package/components/ic-radio-group.d.ts +11 -0
- package/components/ic-radio-group.js +317 -0
- package/components/ic-radio-group.js.map +1 -0
- package/components/ic-radio-option.d.ts +11 -0
- package/components/ic-radio-option.js +211 -0
- package/components/ic-radio-option.js.map +1 -0
- package/components/ic-search-bar.d.ts +11 -0
- package/components/ic-search-bar.js +719 -0
- package/components/ic-search-bar.js.map +1 -0
- package/components/ic-section-container.d.ts +11 -0
- package/components/ic-section-container.js +8 -0
- package/components/ic-section-container.js.map +1 -0
- package/components/ic-section-container2.js +50 -0
- package/components/ic-section-container2.js.map +1 -0
- package/components/ic-select.d.ts +11 -0
- package/components/ic-select.js +8 -0
- package/components/ic-select.js.map +1 -0
- package/components/ic-select2.js +806 -0
- package/components/ic-select2.js.map +1 -0
- package/components/ic-side-navigation.d.ts +11 -0
- package/components/ic-side-navigation.js +568 -0
- package/components/ic-side-navigation.js.map +1 -0
- package/components/ic-skeleton.d.ts +11 -0
- package/components/ic-skeleton.js +81 -0
- package/components/ic-skeleton.js.map +1 -0
- package/components/ic-skip-link.d.ts +11 -0
- package/components/ic-skip-link.js +91 -0
- package/components/ic-skip-link.js.map +1 -0
- package/components/ic-status-tag.d.ts +11 -0
- package/components/ic-status-tag.js +85 -0
- package/components/ic-status-tag.js.map +1 -0
- package/components/ic-step.d.ts +11 -0
- package/components/ic-step.js +200 -0
- package/components/ic-step.js.map +1 -0
- package/components/ic-stepper.d.ts +11 -0
- package/components/ic-stepper.js +340 -0
- package/components/ic-stepper.js.map +1 -0
- package/components/ic-switch.d.ts +11 -0
- package/components/ic-switch.js +164 -0
- package/components/ic-switch.js.map +1 -0
- package/components/ic-tab-context.d.ts +11 -0
- package/components/ic-tab-context.js +275 -0
- package/components/ic-tab-context.js.map +1 -0
- package/components/ic-tab-group.d.ts +11 -0
- package/components/ic-tab-group.js +89 -0
- package/components/ic-tab-group.js.map +1 -0
- package/components/ic-tab-panel.d.ts +11 -0
- package/components/ic-tab-panel.js +63 -0
- package/components/ic-tab-panel.js.map +1 -0
- package/components/ic-tab.d.ts +11 -0
- package/components/ic-tab.js +143 -0
- package/components/ic-tab.js.map +1 -0
- package/components/ic-text-field.d.ts +11 -0
- package/components/ic-text-field.js +8 -0
- package/components/ic-text-field.js.map +1 -0
- package/components/ic-text-field2.js +532 -0
- package/components/ic-text-field2.js.map +1 -0
- package/components/ic-theme.d.ts +11 -0
- package/components/ic-theme.js +105 -0
- package/components/ic-theme.js.map +1 -0
- package/components/ic-toast-region.d.ts +11 -0
- package/components/ic-toast-region.js +76 -0
- package/components/ic-toast-region.js.map +1 -0
- package/components/ic-toast.d.ts +11 -0
- package/components/ic-toast.js +295 -0
- package/components/ic-toast.js.map +1 -0
- package/components/ic-toggle-button-group.d.ts +11 -0
- package/components/ic-toggle-button-group.js +323 -0
- package/components/ic-toggle-button-group.js.map +1 -0
- package/components/ic-toggle-button.d.ts +11 -0
- package/components/ic-toggle-button.js +235 -0
- package/components/ic-toggle-button.js.map +1 -0
- package/components/ic-tooltip.d.ts +11 -0
- package/components/ic-tooltip.js +8 -0
- package/components/ic-tooltip.js.map +1 -0
- package/components/ic-tooltip2.js +2078 -0
- package/components/ic-tooltip2.js.map +1 -0
- package/components/ic-top-navigation.d.ts +11 -0
- package/components/ic-top-navigation.js +320 -0
- package/components/ic-top-navigation.js.map +1 -0
- package/components/ic-typography.d.ts +11 -0
- package/components/ic-typography.js +8 -0
- package/components/ic-typography.js.map +1 -0
- package/components/ic-typography2.js +228 -0
- package/components/ic-typography2.js.map +1 -0
- package/components/index.d.ts +33 -0
- package/components/index.js +4 -0
- package/components/index.js.map +1 -0
- package/components/package.json +9 -0
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js +63 -37
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-pagination_3.cjs.entry.js +17 -17
- package/dist/cjs/ic-pagination_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-section-container.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-top-navigation.cjs.entry.js +12 -8
- package/dist/cjs/ic-top-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ic-menu/ic-menu.css +19 -0
- package/dist/collection/components/ic-menu/ic-menu.js +62 -36
- package/dist/collection/components/ic-menu/ic-menu.js.map +1 -1
- package/dist/collection/components/ic-menu/ic-menu.types.js.map +1 -1
- package/dist/collection/components/ic-select/ic-select.js +17 -17
- package/dist/collection/components/ic-select/ic-select.js.map +1 -1
- package/dist/collection/components/ic-select/ic-select_(single).stories.js +54 -0
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.js +33 -9
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.js.map +1 -1
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.stories.js +26 -0
- package/dist/components/ic-menu2.js +63 -37
- package/dist/components/ic-menu2.js.map +1 -1
- package/dist/components/ic-page-header.js.map +1 -1
- package/dist/components/ic-popover-menu.js.map +1 -1
- package/dist/components/ic-radio-group.js.map +1 -1
- package/dist/components/ic-radio-option.js.map +1 -1
- package/dist/components/ic-select2.js +17 -17
- package/dist/components/ic-select2.js.map +1 -1
- package/dist/components/ic-top-navigation.js +13 -8
- package/dist/components/ic-top-navigation.js.map +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-46e5a58b.entry.js → p-12474095.entry.js} +2 -2
- package/dist/core/p-12474095.entry.js.map +1 -0
- package/dist/core/p-98dee727.entry.js.map +1 -1
- package/dist/core/p-d1220d2a.entry.js.map +1 -1
- package/dist/core/p-e0b66371.entry.js +2 -0
- package/dist/core/p-e0b66371.entry.js.map +1 -0
- package/dist/core/{p-171a19bf.entry.js → p-fdc4376e.entry.js} +2 -2
- package/dist/core/p-fdc4376e.entry.js.map +1 -0
- package/dist/esm/core.js +1 -1
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-input-component-container_3.entry.js +63 -37
- package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
- package/dist/esm/ic-pagination_3.entry.js +17 -17
- package/dist/esm/ic-pagination_3.entry.js.map +1 -1
- package/dist/esm/ic-section-container.entry.js.map +1 -1
- package/dist/esm/ic-top-navigation.entry.js +12 -8
- package/dist/esm/ic-top-navigation.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ic-menu/ic-menu.types.d.ts +1 -0
- package/dist/types/components/ic-top-navigation/ic-top-navigation.d.ts +4 -1
- package/dist/types/components.d.ts +10 -2
- package/hydrate/index.js +93 -62
- package/hydrate/index.mjs +93 -62
- package/package.json +4 -2
- package/vscode-data.json +5 -1
- package/dist/core/p-171a19bf.entry.js.map +0 -1
- package/dist/core/p-343670b4.entry.js +0 -2
- package/dist/core/p-343670b4.entry.js.map +0 -1
- package/dist/core/p-46e5a58b.entry.js.map +0 -1
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { c as checkIcon } from './check-icon.js';
|
|
3
|
+
import { m as isPropDefined, i as isSlotUsed } from './helpers.js';
|
|
4
|
+
import { d as defineCustomElement$3 } from './ic-loading-indicator2.js';
|
|
5
|
+
import { d as defineCustomElement$2 } from './ic-typography2.js';
|
|
6
|
+
|
|
7
|
+
const warningIcon = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8
|
+
<path d="M7.99935 4.32666L13.0193 13H2.97935L7.99935 4.32666ZM7.99935 1.66666L0.666016 14.3333H15.3327L7.99935 1.66666ZM8.66602 11H7.33268V12.3333H8.66602V11ZM8.66602 6.99999H7.33268V9.66666H8.66602V6.99999Z" fill="currentColor"/>
|
|
9
|
+
</svg>`;
|
|
10
|
+
|
|
11
|
+
const icStepCss = ":host{display:flex;flex:auto;--ic-typography-color:currentcolor}.step{display:flex;flex:1 1 0}.step-icon{display:flex;justify-content:center}.heading,::slotted([slot=\"heading\"]),.subheading,.step-status,.next-step{white-space:pre-line}.next-step{color:var(--ic-stepper-compact-step-next-text)}.visually-hidden{position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden}.visually-hidden:dir(rtl){right:-9999px}:host(.ic-step-compact){-moz-column-gap:var(--ic-space-sm);column-gap:var(--ic-space-sm);--compact-step-inner-color:var(--ic-step-indicator-status-current);--compact-step-outer-color:var(--ic-step-indicator-status-remaining);--compact-step-circular-line-width:var(--ic-space-xxs)}:host(.ic-step-compact) .step{-moz-column-gap:var(--ic-space-sm);column-gap:var(--ic-space-sm)}:host(.ic-step-compact) .step:not(.current){display:none;opacity:0;visibility:hidden}.compact-step-progress-indicator{margin:var(--ic-space-xs) 0 0}:host ic-loading-indicator::part(ic-loading-container){border-radius:50%}:host() ic-loading-indicator::part(ic-loading-container){background-color:var(--ic-step-indicator-background)}:host(.ic-step-compact) .heading-area{display:flex;flex-direction:column;width:14.25rem}:host(.ic-step-compact) .heading,:host(.ic-step-compact) ::slotted([slot=\"heading\"]){color:var(--ic-stepper-compact-step-title)}:host(.ic-step-compact) .disabled .heading,:host(.ic-step-compact) .disabled ::slotted([slot=\"heading\"]){color:var(--ic-stepper-compact-step-title-disabled)}.info-line{display:flex;-moz-column-gap:var(--ic-space-xs);column-gap:var(--ic-space-xs)}.step-status{display:flex;color:var(--ic-stepper-compact-step-requirement-text);-moz-column-gap:var(--ic-space-xxxs);column-gap:var(--ic-space-xxxs)}.compact-step-completed .step-status{color:var(--ic-stepper-compact-step-completed-text)}.compact-step-disabled :is(.heading,.step-status){color:var(--ic-stepper-compact-step-requirement-text-disabled)}.step-num{color:var(--ic-stepper-compact-step-stage-text);white-space:nowrap}:host(.ic-step-compact) .step-icon{margin:var(--ic-space-xxxs)}:host(.ic-step-compact) .step-icon svg{width:var(--ic-space-md);height:var(--ic-space-md)}:host(.ic-step-default) .step{flex-direction:column}:host(.ic-step-default.last-step){flex-grow:initial}.step-top{display:flex;width:100%;align-items:center;align-self:flex-start;height:2.5rem}:host(.ic-step-default) .step-icon{border-radius:50%;background-color:var(--ic-step-number-inactive)}.step-icon-inner{width:var(--ic-space-xl);height:var(--ic-space-xl);display:flex;justify-content:center;align-items:center;border-radius:50%;color:var(--ic-step-number-text-inactive)}:host(.ic-step-default) .current{color:var(--ic-status-info-default)}:host(.ic-step-default) .heading-area{margin:var(--ic-space-xs) 0;padding-right:var(--ic-space-xs);width:100%}:host(.ic-step-default) .heading,:host(.ic-step-default) ::slotted([slot=\"heading\"]),.subheading{width:-moz-fit-content;width:fit-content}.heading,::slotted([slot=\"heading\"]){color:var(--ic-step-title)}.current .heading,.current ::slotted([slot=\"heading\"]){color:var(--ic-step-title-current)}.completed .heading,.completed ::slotted([slot=\"heading\"]){color:var(--ic-step-title-success)}.disabled .heading,.disabled ::slotted([slot=\"heading\"]){color:var(--ic-step-title-disabled)}.subheading{color:var(--ic-step-title-status-text-inactive)}.current .subheading{color:var(--ic-step-title-status-text-current)}.disabled .subheading{color:var(--ic-step-title-status-text-disabled)}:host(.ic-step-default) .completed{color:var(--ic-status-success-default)}.active .step-icon-inner{box-shadow:inset var(--ic-step-number-inactive-outline) 0 0 0 0.125rem}.current .step-icon-inner{background-color:var(--ic-step-number-background-active);color:var(--ic-step-number-text-current)}.disabled{color:var(--ic-color-text-disabled-mid)}.disabled .step-icon-inner{border:var(--ic-border-width) dashed var(--ic-step-number-disabled);width:calc(var(--ic-space-xl) - var(--ic-space-xxxs));height:calc(var(--ic-space-xl) - var(--ic-space-xxxs));color:var(--ic-step-number-text-disabled)}.disabled .step-icon{background-color:transparent !important}.completed .step-icon-inner{background:var(--ic-step-number-background-success);box-shadow:inset var(--ic-step-number-background-success) 0 0 0\n var(--ic-space-xxxs);border-radius:100%}:host(.ic-step-default) .current .step-icon{border:var(--ic-space-xxxs) solid var(--ic-step-number-current-outline);padding:var(--ic-space-xxxs);margin:0 calc(-1 * var(--ic-space-xxxs));background-color:var(--ic-step-number-current-outer-fill);}.step-connect{height:var(--ic-space-xxxs);background-color:var(--ic-stepper-connector-remaining-status);margin:0 var(--ic-space-xs);border-radius:var(--ic-space-xxs);width:100%}.aligned-full-width.step-connect{min-width:6.25rem;width:100%}.disabled .step-connect{height:0;background-color:rgb(0 0 0 / 0%);border-top:0.125rem dashed var(--ic-stepper-connector-disabled);border-radius:0}.completed .step-connect{background-color:var(--ic-stepper-connector-success)}.step-connect-inner{width:70%;display:flex;flex:auto;height:var(--ic-space-xxxs);border-radius:var(--ic-space-xxs);background-color:var(--ic-stepper-connector-current-status)}.step-icon-inner .check-icon{padding-top:var(--ic-space-xxs)}.step-icon-inner .check-icon svg{width:var(--ic-space-md);height:auto}.step-icon-inner .check-icon>svg>path{fill:var(--ic-step-number-icon-success)}@media (forced-colors: active){.compact-step-disabled :is(.heading,.step-status){color:GrayText}.step-connect:not(.disabled .step-connect){border:var(--ic-border-hc)}.active .step-icon-inner,.completed .step-icon-inner,.current .step-icon-inner{forced-color-adjust:none;box-shadow:inset canvastext 0 0 0 0.125rem;background-color:transparent;color:canvastext}:host(.ic-step-default) .current .step-icon{padding:0;border:none}.disabled,.disabled .heading-area,.disabled .step-icon-inner,.disabled .heading,.disabled ::slotted([slot=\"heading\"]){color:GrayText}.step-connect-inner,.completed .step-connect{background-color:canvastext}.step-icon-inner .check-icon>svg>path{fill:canvastext}}";
|
|
12
|
+
const IcStepStyle0 = icStepCss;
|
|
13
|
+
|
|
14
|
+
const Step = /*@__PURE__*/ proxyCustomElement(class Step extends HTMLElement {
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
this.__registerHost();
|
|
18
|
+
this.__attachShadow();
|
|
19
|
+
/**
|
|
20
|
+
* @internal If `true`, and a compact stepper is being used, the current step will be the only step in view.
|
|
21
|
+
*/
|
|
22
|
+
this.current = false;
|
|
23
|
+
/**
|
|
24
|
+
* Words within the component that can be replaced to translate the component into a different language
|
|
25
|
+
*/
|
|
26
|
+
this.icI18n = {
|
|
27
|
+
next: "Next",
|
|
28
|
+
step: "Step",
|
|
29
|
+
steps: "Steps",
|
|
30
|
+
of: "of",
|
|
31
|
+
lastStep: "Last step",
|
|
32
|
+
completed: "Completed",
|
|
33
|
+
notRequired: "Not required",
|
|
34
|
+
required: "Required",
|
|
35
|
+
optional: "Optional",
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* @internal Sets the theme color to the dark or light theme color. "inherit" will set the color based on the system settings or ic-theme component.
|
|
39
|
+
*/
|
|
40
|
+
this.theme = "inherit";
|
|
41
|
+
/**
|
|
42
|
+
* The state of the step within the stepper.
|
|
43
|
+
*/
|
|
44
|
+
this.type = "active";
|
|
45
|
+
}
|
|
46
|
+
typeChangeHandler() {
|
|
47
|
+
if (this.variant === "compact" && this.type === "current") {
|
|
48
|
+
this.current = true;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
this.current = false;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
render() {
|
|
55
|
+
var _a, _b;
|
|
56
|
+
const { compactStepStyling, current, heading, icI18n, lastStep, lastStepNum, nextStepHeading, progress, status, stepNum, subheading, theme, type, variant, } = this;
|
|
57
|
+
// ARIA LABEL
|
|
58
|
+
let ariaLabel = "";
|
|
59
|
+
const hasHeading = (isPropDefined(heading) && heading !== "") ||
|
|
60
|
+
isSlotUsed(this.el, "heading");
|
|
61
|
+
if (type === "completed") {
|
|
62
|
+
ariaLabel = `. ${icI18n.completed}`;
|
|
63
|
+
}
|
|
64
|
+
else if (type === "disabled") {
|
|
65
|
+
ariaLabel = `. ${icI18n.notRequired}`;
|
|
66
|
+
}
|
|
67
|
+
else if (status === "required") {
|
|
68
|
+
ariaLabel = `. ${icI18n.required}`;
|
|
69
|
+
}
|
|
70
|
+
else if (status === "optional") {
|
|
71
|
+
ariaLabel = `. ${icI18n.optional}`;
|
|
72
|
+
}
|
|
73
|
+
// STEP STATUS
|
|
74
|
+
let stepStatus;
|
|
75
|
+
if (status && isPropDefined(status)) {
|
|
76
|
+
stepStatus = status[0].toUpperCase() + status.slice(1);
|
|
77
|
+
}
|
|
78
|
+
// STEP TYPE
|
|
79
|
+
let stepType;
|
|
80
|
+
if (type === "disabled" || compactStepStyling === "disabled") {
|
|
81
|
+
stepType = icI18n.notRequired;
|
|
82
|
+
}
|
|
83
|
+
else if (compactStepStyling === "completed") {
|
|
84
|
+
stepType = icI18n.completed;
|
|
85
|
+
}
|
|
86
|
+
// STATUS ICON FOR COMPACT STEP
|
|
87
|
+
let statusIcon;
|
|
88
|
+
if (type === "completed" || compactStepStyling === "completed") {
|
|
89
|
+
statusIcon = (h("span", { key: '4d1011a9a12449bd324aff3f404522fde6912be3', class: "check-icon step-icon", "aria-hidden": "true", innerHTML: checkIcon }));
|
|
90
|
+
}
|
|
91
|
+
else if (type === "disabled" || compactStepStyling === "disabled") {
|
|
92
|
+
statusIcon = (h("span", { key: '7825f61e87546bcaa9100c439239022abb0f3eb7', class: "warning-icon step-icon", "aria-hidden": "true", innerHTML: warningIcon }));
|
|
93
|
+
}
|
|
94
|
+
// COMPACT STEP COMPONENT
|
|
95
|
+
const compactStep = (h("div", { key: '82c7c26c90ce286582f7ef477129d2ce241200c1', class: {
|
|
96
|
+
["step"]: true,
|
|
97
|
+
["current"]: !!current,
|
|
98
|
+
[`compact-step-${compactStepStyling}`]: !!compactStepStyling,
|
|
99
|
+
["disabled"]: type === "disabled" || compactStepStyling === "disabled",
|
|
100
|
+
} }, h("ic-loading-indicator", { key: 'd3d1b2aa382bd8b307433f16aa05f644b275902f', class: {
|
|
101
|
+
"compact-step-progress-indicator": true,
|
|
102
|
+
"not-required": type === "disabled" || compactStepStyling === "disabled",
|
|
103
|
+
}, "aria-hidden": "true", size: "small", "inner-label": stepNum, progress: progress }), h("div", { key: 'd0f78f477b4fe29b2ac33798712b70c0c3d2ce41', class: "heading-area" }, isSlotUsed(this.el, "heading") ? (h("slot", { name: "heading" })) : (h("ic-typography", { variant: "h4", class: "heading" }, heading)), h("div", { key: 'f9a074c126d393ec82cf72621e5941c32dbd72fb', class: "info-line" }, h("ic-typography", { key: '1b6bd91bcb1013fa1e23a9e9af49d3da1f25448e', variant: "caption", class: "step-num" }, `${stepNum} ${icI18n.of} ${lastStepNum}`, h("span", { key: '753bbc4c12a2b968cde11238f46ff4ffbc4f39fd', class: "visually-hidden" }, ` ${icI18n.steps}`)), (this.subheading ||
|
|
104
|
+
type === "completed" ||
|
|
105
|
+
type === "disabled" ||
|
|
106
|
+
(this.variant === "compact" &&
|
|
107
|
+
!!compactStepStyling &&
|
|
108
|
+
compactStepStyling !== "active") ||
|
|
109
|
+
!!status) && (h("div", { key: '93968f9752cf90df5f67994a3942f38d94323b50', class: "step-status" }, statusIcon !== undefined && statusIcon, (subheading || stepType) && (h("ic-typography", { key: 'd1879f9dc5a7ea2e9b468fc95593056527e08095', variant: "caption" }, subheading !== null && isPropDefined(subheading)
|
|
110
|
+
? subheading
|
|
111
|
+
: type === "disabled" ||
|
|
112
|
+
(variant === "compact" &&
|
|
113
|
+
compactStepStyling === "disabled") ||
|
|
114
|
+
type === "completed" ||
|
|
115
|
+
(variant === "compact" &&
|
|
116
|
+
compactStepStyling === "completed")
|
|
117
|
+
? stepType
|
|
118
|
+
: status && stepStatus))))), lastStep ? (h("ic-typography", { variant: "subtitle-small", class: "next-step" }, icI18n.lastStep)) : (isPropDefined(nextStepHeading) && (h("ic-typography", { variant: "subtitle-small", class: "next-step" }, icI18n.next, h("span", { class: "visually-hidden" }, " ", icI18n.step), ":", " ", this.nextStepHeading))))));
|
|
119
|
+
// ICON FOR DEFAULT STEP
|
|
120
|
+
let icon;
|
|
121
|
+
if (type !== "completed") {
|
|
122
|
+
icon = (h("ic-typography", { key: 'e76d3c6f2fc82ae27e9f19af2ad29374c75271b1', variant: "subtitle-small" }, h("span", { key: '2ada7f696f0e90ecca298a2109d9aaeb70777a1a', class: "step-icon-inner", "aria-hidden": "true" }, this.stepNum)));
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
icon = (h("div", { key: '195a5f5dd31061a4059020d7fa1d65b15eb29a11', class: "step-icon-inner", "aria-hidden": "true" }, h("span", { key: 'd11d3bf512968fa286309bcd69faa20cd12d3396', class: "check-icon", innerHTML: checkIcon })));
|
|
126
|
+
}
|
|
127
|
+
// STEP CONNECT FOR DEFAULT STEP
|
|
128
|
+
const partialBar = type === "current" && (h("div", { key: '5564ceeb1d40367572f3ae679e7212a2a2a53578', class: "step-connect-inner" }));
|
|
129
|
+
const finalStep = !lastStep && (h("div", { key: 'fae846f5c7d46ad65c7d21a2785526ed6d841444', class: {
|
|
130
|
+
["step-connect"]: true,
|
|
131
|
+
["aligned-full-width"]: !!(((_a = this.el.parentElement) === null || _a === void 0 ? void 0 : _a.classList.contains("ic-stepper-default")) &&
|
|
132
|
+
!this.el.parentElement.classList.contains("ic-stepper-aligned-left")),
|
|
133
|
+
} }, partialBar));
|
|
134
|
+
// DEFAULT STEP COMPONENT
|
|
135
|
+
const defaultStep = (h("div", { key: 'f02d7139a59a46207e7bd308cf90ffd42c14a93e', class: {
|
|
136
|
+
["step"]: true,
|
|
137
|
+
[`${type}`]: true,
|
|
138
|
+
} }, h("div", { key: 'd3cb91eb9ae01c50255fefe75c9cf15dac9899a2', class: "step-top" }, h("div", { key: '71afc47b70d57c6d98aacd824c304e661d97a97d', class: "step-icon" }, icon), finalStep), (hasHeading || subheading || status) && (h("div", { key: '7b11bdfc83c4071d6aff8f026e7ab32f2033a666', class: "heading-area" }, isSlotUsed(this.el, "heading") ? (h("slot", { name: "heading" })) : (h("ic-typography", { variant: "subtitle-large", class: "heading" }, heading)), hasHeading && (subheading || status) && (h("ic-typography", { key: '10da1844c1af5252f89bc59254e23c45c5400a2d', variant: "caption", class: "subheading" }, subheading !== null && isPropDefined(subheading)
|
|
139
|
+
? subheading
|
|
140
|
+
: stepStatus))))));
|
|
141
|
+
return (h(Host, { key: '6605252cf1e05ba81b2adbcf6e41f2c9c23b1f09', role: "listitem", "aria-label": `${icI18n.step} ${stepNum}${ariaLabel}`, "aria-current": (current || type === "current") && "step", class: {
|
|
142
|
+
["aligned-full-width"]: !!(((_b = this.el.parentElement) === null || _b === void 0 ? void 0 : _b.classList.contains("ic-stepper-default")) &&
|
|
143
|
+
!this.el.parentElement.classList.contains("ic-stepper-aligned-left")),
|
|
144
|
+
[`ic-step-${variant}`]: true,
|
|
145
|
+
[`ic-theme-${theme}`]: this.theme !== "inherit",
|
|
146
|
+
} }, variant === "compact" ? compactStep : defaultStep));
|
|
147
|
+
}
|
|
148
|
+
get el() { return this; }
|
|
149
|
+
static get watchers() { return {
|
|
150
|
+
"type": ["typeChangeHandler"]
|
|
151
|
+
}; }
|
|
152
|
+
static get style() { return IcStepStyle0; }
|
|
153
|
+
}, [1, "ic-step", {
|
|
154
|
+
"compactStepStyling": [1, "compact-step-styling"],
|
|
155
|
+
"current": [1028],
|
|
156
|
+
"icI18n": [16],
|
|
157
|
+
"lastStep": [4, "last-step"],
|
|
158
|
+
"lastStepNum": [2, "last-step-num"],
|
|
159
|
+
"nextStepHeading": [1, "next-step-heading"],
|
|
160
|
+
"progress": [2],
|
|
161
|
+
"stepNum": [2, "step-num"],
|
|
162
|
+
"status": [1],
|
|
163
|
+
"subheading": [1],
|
|
164
|
+
"heading": [1],
|
|
165
|
+
"theme": [1],
|
|
166
|
+
"variant": [1],
|
|
167
|
+
"type": [1]
|
|
168
|
+
}, undefined, {
|
|
169
|
+
"type": ["typeChangeHandler"]
|
|
170
|
+
}]);
|
|
171
|
+
function defineCustomElement$1() {
|
|
172
|
+
if (typeof customElements === "undefined") {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
const components = ["ic-step", "ic-loading-indicator", "ic-typography"];
|
|
176
|
+
components.forEach(tagName => { switch (tagName) {
|
|
177
|
+
case "ic-step":
|
|
178
|
+
if (!customElements.get(tagName)) {
|
|
179
|
+
customElements.define(tagName, Step);
|
|
180
|
+
}
|
|
181
|
+
break;
|
|
182
|
+
case "ic-loading-indicator":
|
|
183
|
+
if (!customElements.get(tagName)) {
|
|
184
|
+
defineCustomElement$3();
|
|
185
|
+
}
|
|
186
|
+
break;
|
|
187
|
+
case "ic-typography":
|
|
188
|
+
if (!customElements.get(tagName)) {
|
|
189
|
+
defineCustomElement$2();
|
|
190
|
+
}
|
|
191
|
+
break;
|
|
192
|
+
} });
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const IcStep = Step;
|
|
196
|
+
const defineCustomElement = defineCustomElement$1;
|
|
197
|
+
|
|
198
|
+
export { IcStep, defineCustomElement };
|
|
199
|
+
|
|
200
|
+
//# sourceMappingURL=ic-step.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"ic-step.js","mappings":";;;;;;;;;;AAAA,MAAM,SAAS,GAAG,mgMAAmgM,CAAC;AACthM,qBAAe,SAAS;;MCmBX,IAAI;IALjB;;;;;;;QAgB2B,YAAO,GAAa,KAAK,CAAC;;;;QAK3C,WAAM,GAAe;YAC3B,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,OAAO;YACd,EAAE,EAAE,IAAI;YACR,QAAQ,EAAE,WAAW;YACrB,SAAS,EAAE,WAAW;YACtB,WAAW,EAAE,cAAc;YAC3B,QAAQ,EAAE,UAAU;YACpB,QAAQ,EAAE,UAAU;SACrB,CAAC;;;;QA6CM,UAAK,GAAiB,SAAS,CAAC;;;;QAUhC,SAAI,GAAiB,QAAQ,CAAC;KAsPvC;IAnPC,iBAAiB;QACf,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE;YACzD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;SACrB;aAAM;YACL,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;SACtB;KACF;IAED,MAAM;;QACJ,MAAM,EACJ,kBAAkB,EAClB,OAAO,EACP,OAAO,EACP,MAAM,EACN,QAAQ,EACR,WAAW,EACX,eAAe,EACf,QAAQ,EACR,MAAM,EACN,OAAO,EACP,UAAU,EACV,KAAK,EACL,IAAI,EACJ,OAAO,GACR,GAAG,IAAI,CAAC;;QAGT,IAAI,SAAS,GAAG,EAAE,CAAC;QAEnB,MAAM,UAAU,GAC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,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,SAAS,CAAC,QAAQ,CAAC,yBAAyB,CAAC,CACrE;gBACD,CAAC,WAAW,OAAO,EAAE,GAAG,IAAI;gBAC5B,CAAC,YAAY,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,KAAK,SAAS;aAChD,IAEA,OAAO,KAAK,SAAS,GAAG,WAAW,GAAG,WAAW,CAC7C,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/ic-step/ic-step.css?tag=ic-step&encapsulation=shadow","src/components/ic-step/ic-step.tsx"],"sourcesContent":["/* SHARED STYLING */\n:host {\n display: flex;\n flex: auto;\n\n --ic-typography-color: currentcolor;\n}\n\n.step {\n display: flex;\n flex: 1 1 0;\n}\n\n.step-icon {\n display: flex;\n justify-content: center;\n}\n\n.heading,\n::slotted([slot=\"heading\"]),\n.subheading,\n.step-status,\n.next-step {\n white-space: pre-line;\n}\n\n.next-step {\n color: var(--ic-stepper-compact-step-next-text);\n}\n\n.visually-hidden {\n position: absolute;\n left: -9999px;\n top: auto;\n width: 1px;\n height: 1px;\n overflow: hidden;\n}\n\n.visually-hidden:dir(rtl) {\n right: -9999px;\n}\n\n/* COMPACT STEP STYLING */\n:host(.ic-step-compact) {\n -moz-column-gap: var(--ic-space-sm);\n column-gap: var(--ic-space-sm);\n\n --compact-step-inner-color: var(--ic-step-indicator-status-current);\n --compact-step-outer-color: var(--ic-step-indicator-status-remaining);\n --compact-step-circular-line-width: var(--ic-space-xxs);\n}\n\n:host(.ic-step-compact) .step {\n -moz-column-gap: var(--ic-space-sm);\n column-gap: var(--ic-space-sm);\n}\n\n:host(.ic-step-compact) .step:not(.current) {\n display: none;\n opacity: 0;\n visibility: hidden;\n}\n\n.compact-step-progress-indicator {\n margin: var(--ic-space-xs) 0 0;\n}\n\n:host ic-loading-indicator::part(ic-loading-container) {\n border-radius: 50%;\n}\n\n:host() ic-loading-indicator::part(ic-loading-container) {\n background-color: var(--ic-step-indicator-background);\n}\n\n:host(.ic-step-compact) .heading-area {\n display: flex;\n flex-direction: column;\n width: 14.25rem;\n}\n\n:host(.ic-step-compact) .heading,\n:host(.ic-step-compact) ::slotted([slot=\"heading\"]) {\n color: var(--ic-stepper-compact-step-title);\n}\n\n:host(.ic-step-compact) .disabled .heading,\n:host(.ic-step-compact) .disabled ::slotted([slot=\"heading\"]) {\n color: var(--ic-stepper-compact-step-title-disabled);\n}\n\n.info-line {\n display: flex;\n -moz-column-gap: var(--ic-space-xs);\n column-gap: var(--ic-space-xs);\n}\n\n.step-status {\n display: flex;\n color: var(--ic-stepper-compact-step-requirement-text);\n -moz-column-gap: var(--ic-space-xxxs);\n column-gap: var(--ic-space-xxxs);\n}\n\n.compact-step-completed .step-status {\n color: var(--ic-stepper-compact-step-completed-text);\n}\n\n.compact-step-disabled :is(.heading, .step-status) {\n color: var(--ic-stepper-compact-step-requirement-text-disabled);\n}\n\n.step-num {\n color: var(--ic-stepper-compact-step-stage-text);\n white-space: nowrap;\n}\n\n:host(.ic-step-compact) .step-icon {\n margin: var(--ic-space-xxxs);\n}\n\n:host(.ic-step-compact) .step-icon svg {\n width: var(--ic-space-md);\n height: var(--ic-space-md);\n}\n\n/* DEFAULT STEP STYLING */\n:host(.ic-step-default) .step {\n flex-direction: column;\n}\n\n:host(.ic-step-default.last-step) {\n flex-grow: initial;\n}\n\n.step-top {\n display: flex;\n width: 100%;\n align-items: center;\n align-self: flex-start;\n height: 2.5rem;\n}\n\n:host(.ic-step-default) .step-icon {\n border-radius: 50%;\n background-color: var(--ic-step-number-inactive);\n}\n\n.step-icon-inner {\n width: var(--ic-space-xl);\n height: var(--ic-space-xl);\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n color: var(--ic-step-number-text-inactive);\n}\n\n:host(.ic-step-default) .current {\n color: var(--ic-status-info-default);\n}\n\n:host(.ic-step-default) .heading-area {\n margin: var(--ic-space-xs) 0;\n padding-right: var(--ic-space-xs);\n width: 100%;\n}\n\n:host(.ic-step-default) .heading,\n:host(.ic-step-default) ::slotted([slot=\"heading\"]),\n.subheading {\n width: -moz-fit-content;\n width: fit-content;\n}\n\n.heading,\n::slotted([slot=\"heading\"]) {\n color: var(--ic-step-title);\n}\n\n.current .heading,\n.current ::slotted([slot=\"heading\"]) {\n color: var(--ic-step-title-current);\n}\n\n.completed .heading,\n.completed ::slotted([slot=\"heading\"]) {\n color: var(--ic-step-title-success);\n}\n\n.disabled .heading,\n.disabled ::slotted([slot=\"heading\"]) {\n color: var(--ic-step-title-disabled);\n}\n\n.subheading {\n color: var(--ic-step-title-status-text-inactive);\n}\n\n.current .subheading {\n color: var(--ic-step-title-status-text-current);\n}\n\n.disabled .subheading {\n color: var(--ic-step-title-status-text-disabled);\n}\n\n:host(.ic-step-default) .completed {\n color: var(--ic-status-success-default);\n}\n\n.active .step-icon-inner {\n box-shadow: inset var(--ic-step-number-inactive-outline) 0 0 0 0.125rem;\n}\n\n.current .step-icon-inner {\n background-color: var(--ic-step-number-background-active);\n color: var(--ic-step-number-text-current);\n}\n\n.disabled {\n color: var(--ic-color-text-disabled-mid);\n}\n\n.disabled .step-icon-inner {\n border: var(--ic-border-width) dashed var(--ic-step-number-disabled);\n width: calc(var(--ic-space-xl) - var(--ic-space-xxxs));\n height: calc(var(--ic-space-xl) - var(--ic-space-xxxs));\n color: var(--ic-step-number-text-disabled);\n}\n\n.disabled .step-icon {\n background-color: transparent !important;\n}\n\n.completed .step-icon-inner {\n background: var(--ic-step-number-background-success);\n box-shadow: inset var(--ic-step-number-background-success) 0 0 0\n var(--ic-space-xxxs);\n border-radius: 100%;\n}\n\n:host(.ic-step-default) .current .step-icon {\n border: var(--ic-space-xxxs) solid var(--ic-step-number-current-outline);\n padding: var(--ic-space-xxxs);\n margin: 0 calc(-1 * var(--ic-space-xxxs));\n background-color: var(--ic-step-number-current-outer-fill);\n\n /* compensating for the circle being bigger than other steps */\n}\n\n.step-connect {\n height: var(--ic-space-xxxs);\n background-color: var(--ic-stepper-connector-remaining-status);\n margin: 0 var(--ic-space-xs);\n border-radius: var(--ic-space-xxs);\n width: 100%;\n}\n\n.aligned-full-width.step-connect {\n min-width: 6.25rem;\n width: 100%;\n}\n\n.disabled .step-connect {\n height: 0;\n background-color: rgb(0 0 0 / 0%);\n border-top: 0.125rem dashed var(--ic-stepper-connector-disabled);\n border-radius: 0;\n}\n\n.completed .step-connect {\n background-color: var(--ic-stepper-connector-success);\n}\n\n.step-connect-inner {\n width: 70%;\n display: flex;\n flex: auto;\n height: var(--ic-space-xxxs);\n border-radius: var(--ic-space-xxs);\n background-color: var(--ic-stepper-connector-current-status);\n}\n\n.step-icon-inner .check-icon {\n padding-top: var(--ic-space-xxs);\n}\n\n.step-icon-inner .check-icon svg {\n width: var(--ic-space-md);\n height: auto;\n}\n\n.step-icon-inner .check-icon > svg > path {\n fill: var(--ic-step-number-icon-success);\n}\n\n/** High Contrast **/\n@media (forced-colors: active) {\n /* COMPACT STEP */\n .compact-step-disabled :is(.heading, .step-status) {\n color: GrayText;\n }\n\n /* DEFAULT STEP */\n .step-connect:not(.disabled .step-connect) {\n border: var(--ic-border-hc);\n }\n\n .active .step-icon-inner,\n .completed .step-icon-inner,\n .current .step-icon-inner {\n forced-color-adjust: none;\n box-shadow: inset canvastext 0 0 0 0.125rem;\n background-color: transparent;\n color: canvastext;\n }\n\n :host(.ic-step-default) .current .step-icon {\n padding: 0;\n border: none;\n }\n\n .disabled,\n .disabled .heading-area,\n .disabled .step-icon-inner,\n .disabled .heading,\n .disabled ::slotted([slot=\"heading\"]) {\n color: GrayText;\n }\n\n .step-connect-inner,\n .completed .step-connect {\n background-color: canvastext;\n }\n\n .step-icon-inner .check-icon > svg > path {\n fill: canvastext;\n }\n}\n","import { Component, Host, h, Prop, Element, Watch } from \"@stencil/core\";\nimport checkIcon from \"../../assets/check-icon.svg\";\nimport warningIcon from \"../../assets/warning-icon-outline.svg\";\nimport {\n IcStepVariants,\n IcStepStatuses,\n IcStepTypes,\n IcStepI18n,\n} from \"./ic-step.types\";\nimport { isPropDefined, isSlotUsed } from \"../../utils/helpers\";\nimport { IcThemeMode } from \"../../utils/types\";\n\n/**\n * @slot heading - Content will be rendered in place of the heading prop.\n */\n@Component({\n tag: \"ic-step\",\n styleUrl: \"ic-step.css\",\n shadow: true,\n})\nexport class Step {\n @Element() el: HTMLIcStepElement;\n\n /**\n * @internal If a compact stepper is being used, this sets the styling of the step.\n */\n @Prop() compactStepStyling?: IcStepTypes;\n\n /**\n * @internal If `true`, and a compact stepper is being used, the current step will be the only step in view.\n */\n @Prop({ mutable: true }) current?: boolean = false;\n\n /**\n * Words within the component that can be replaced to translate the component into a different language\n */\n @Prop() icI18n: IcStepI18n = {\n next: \"Next\",\n step: \"Step\",\n steps: \"Steps\",\n of: \"of\",\n lastStep: \"Last step\",\n completed: \"Completed\",\n notRequired: \"Not required\",\n required: \"Required\",\n optional: \"Optional\",\n };\n\n /**\n * @internal If `true`, the step will be marked as being the last one in the series. This is managed by ic-stepper.\n */\n @Prop() lastStep!: boolean;\n\n /**\n * @internal The step number of the final step. This is managed by ic-stepper.\n */\n @Prop() lastStepNum?: number;\n\n /**\n * @internal The name of the next step. This is managed by ic-stepper.\n */\n @Prop() nextStepHeading?: string;\n\n /**\n * @internal The progress of the next step, calculated by dividing the current step number by the total number of steps. This is managed by ic-stepper.\n */\n @Prop() progress?: number;\n\n /**\n * @internal The step number, managed by ic-stepper.\n */\n @Prop() stepNum?: number;\n\n /**\n * The status of the step. Use this prop to display a status message on the step if it is required or optional.\n */\n @Prop() status?: IcStepStatuses;\n\n /**\n * Additional information about the step. Use this prop to override the default step status messaging displayed when selecting a step type or step status.\n */\n @Prop() subheading?: string;\n\n /**\n * The title of the step within the stepper.\n */\n @Prop() heading?: string;\n\n /**\n * @internal Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop() theme?: IcThemeMode = \"inherit\";\n\n /**\n * @internal The variant of the step. This is managed by ic-stepper.\n */\n @Prop() variant!: IcStepVariants;\n\n /**\n * The state of the step within the stepper.\n */\n @Prop() type?: IcStepTypes = \"active\";\n\n @Watch(\"type\")\n typeChangeHandler(): void {\n if (this.variant === \"compact\" && this.type === \"current\") {\n this.current = true;\n } else {\n this.current = false;\n }\n }\n\n render() {\n const {\n compactStepStyling,\n current,\n heading,\n icI18n,\n lastStep,\n lastStepNum,\n nextStepHeading,\n progress,\n status,\n stepNum,\n subheading,\n theme,\n type,\n variant,\n } = this;\n\n // ARIA LABEL\n let ariaLabel = \"\";\n\n const hasHeading =\n (isPropDefined(heading) && heading !== \"\") ||\n isSlotUsed(this.el, \"heading\");\n\n if (type === \"completed\") {\n ariaLabel = `. ${icI18n.completed}`;\n } else if (type === \"disabled\") {\n ariaLabel = `. ${icI18n.notRequired}`;\n } else if (status === \"required\") {\n ariaLabel = `. ${icI18n.required}`;\n } else if (status === \"optional\") {\n ariaLabel = `. ${icI18n.optional}`;\n }\n\n // STEP STATUS\n let stepStatus;\n if (status && isPropDefined(status)) {\n stepStatus = status[0].toUpperCase() + status.slice(1);\n }\n\n // STEP TYPE\n let stepType;\n if (type === \"disabled\" || compactStepStyling === \"disabled\") {\n stepType = icI18n.notRequired;\n } else if (compactStepStyling === \"completed\") {\n stepType = icI18n.completed;\n }\n\n // STATUS ICON FOR COMPACT STEP\n let statusIcon;\n if (type === \"completed\" || compactStepStyling === \"completed\") {\n statusIcon = (\n <span\n class=\"check-icon step-icon\"\n aria-hidden=\"true\"\n innerHTML={checkIcon}\n ></span>\n );\n } else if (type === \"disabled\" || compactStepStyling === \"disabled\") {\n statusIcon = (\n <span\n class=\"warning-icon step-icon\"\n aria-hidden=\"true\"\n innerHTML={warningIcon}\n ></span>\n );\n }\n\n // COMPACT STEP COMPONENT\n const compactStep = (\n <div\n class={{\n [\"step\"]: true,\n [\"current\"]: !!current,\n [`compact-step-${compactStepStyling}`]: !!compactStepStyling,\n [\"disabled\"]:\n type === \"disabled\" || compactStepStyling === \"disabled\",\n }}\n >\n <ic-loading-indicator\n class={{\n \"compact-step-progress-indicator\": true,\n \"not-required\":\n type === \"disabled\" || compactStepStyling === \"disabled\",\n }}\n aria-hidden=\"true\"\n size=\"small\"\n inner-label={stepNum}\n progress={progress}\n ></ic-loading-indicator>\n <div class=\"heading-area\">\n {isSlotUsed(this.el, \"heading\") ? (\n <slot name=\"heading\"></slot>\n ) : (\n <ic-typography variant=\"h4\" class=\"heading\">\n {heading}\n </ic-typography>\n )}\n <div class=\"info-line\">\n <ic-typography variant=\"caption\" class=\"step-num\">\n {`${stepNum} ${icI18n.of} ${lastStepNum}`}\n <span class=\"visually-hidden\">{` ${icI18n.steps}`}</span>\n </ic-typography>\n {(this.subheading ||\n type === \"completed\" ||\n type === \"disabled\" ||\n (this.variant === \"compact\" &&\n !!compactStepStyling &&\n compactStepStyling !== \"active\") ||\n !!status) && (\n <div class=\"step-status\">\n {statusIcon !== undefined && statusIcon}\n {(subheading || stepType) && (\n <ic-typography variant=\"caption\">\n {subheading !== null && isPropDefined(subheading)\n ? subheading\n : type === \"disabled\" ||\n (variant === \"compact\" &&\n compactStepStyling === \"disabled\") ||\n type === \"completed\" ||\n (variant === \"compact\" &&\n compactStepStyling === \"completed\")\n ? stepType\n : status && stepStatus}\n </ic-typography>\n )}\n </div>\n )}\n </div>\n {lastStep ? (\n <ic-typography variant=\"subtitle-small\" class=\"next-step\">\n {icI18n.lastStep}\n </ic-typography>\n ) : (\n isPropDefined(nextStepHeading) && (\n <ic-typography variant=\"subtitle-small\" class=\"next-step\">\n {icI18n.next}\n <span class=\"visually-hidden\"> {icI18n.step}</span>:{\" \"}\n {this.nextStepHeading}\n </ic-typography>\n )\n )}\n </div>\n </div>\n );\n\n // ICON FOR DEFAULT STEP\n let icon;\n if (type !== \"completed\") {\n icon = (\n <ic-typography variant=\"subtitle-small\">\n <span class=\"step-icon-inner\" aria-hidden=\"true\">\n {this.stepNum}\n </span>\n </ic-typography>\n );\n } else {\n icon = (\n <div class=\"step-icon-inner\" aria-hidden=\"true\">\n <span class=\"check-icon\" innerHTML={checkIcon}></span>\n </div>\n );\n }\n\n // STEP CONNECT FOR DEFAULT STEP\n const partialBar = type === \"current\" && (\n <div class=\"step-connect-inner\"></div>\n );\n\n const finalStep = !lastStep && (\n <div\n class={{\n [\"step-connect\"]: true,\n [\"aligned-full-width\"]: !!(\n this.el.parentElement?.classList.contains(\"ic-stepper-default\") &&\n !this.el.parentElement.classList.contains(\"ic-stepper-aligned-left\")\n ),\n }}\n >\n {partialBar}\n </div>\n );\n\n // DEFAULT STEP COMPONENT\n const defaultStep = (\n <div\n class={{\n [\"step\"]: true,\n [`${type}`]: true,\n }}\n >\n <div class=\"step-top\">\n <div class=\"step-icon\">{icon}</div>\n {finalStep}\n </div>\n {(hasHeading || subheading || status) && (\n <div class=\"heading-area\">\n {isSlotUsed(this.el, \"heading\") ? (\n <slot name=\"heading\"></slot>\n ) : (\n <ic-typography variant=\"subtitle-large\" class=\"heading\">\n {heading}\n </ic-typography>\n )}\n {hasHeading && (subheading || status) && (\n <ic-typography variant=\"caption\" class=\"subheading\">\n {subheading !== null && isPropDefined(subheading)\n ? subheading\n : stepStatus}\n </ic-typography>\n )}\n </div>\n )}\n </div>\n );\n\n return (\n <Host\n role=\"listitem\"\n aria-label={`${icI18n.step} ${stepNum}${ariaLabel}`}\n aria-current={(current || type === \"current\") && \"step\"}\n class={{\n [\"aligned-full-width\"]: !!(\n this.el.parentElement?.classList.contains(\"ic-stepper-default\") &&\n !this.el.parentElement.classList.contains(\"ic-stepper-aligned-left\")\n ),\n [`ic-step-${variant}`]: true,\n [`ic-theme-${theme}`]: this.theme !== \"inherit\",\n }}\n >\n {variant === \"compact\" ? compactStep : defaultStep}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../dist/types/components";
|
|
2
|
+
|
|
3
|
+
interface IcStepper extends Components.IcStepper, HTMLElement {}
|
|
4
|
+
export const IcStepper: {
|
|
5
|
+
prototype: IcStepper;
|
|
6
|
+
new (): IcStepper;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { p as pxToRem, c as checkResizeObserver } from './helpers.js';
|
|
3
|
+
|
|
4
|
+
const icStepperCss = ":host{display:flex;width:100%}.step-item-list{display:flex;margin:0;padding:0}:host(.ic-stepper-default:not(.ic-stepper-aligned-left)) .step-item-list{flex:auto}:host(.ic-stepper-compact) ul ::slotted(ic-step){display:none}:host(.ic-stepper-compact) ul ::slotted(ic-step.show){display:flex}:host(.ic-stepper-compact) ul ::slotted(ic-step.hide){display:none;opacity:0;visibility:hidden}";
|
|
5
|
+
const IcStepperStyle0 = icStepperCss;
|
|
6
|
+
|
|
7
|
+
const Stepper = /*@__PURE__*/ proxyCustomElement(class Stepper extends HTMLElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
this.__attachShadow();
|
|
12
|
+
var _a;
|
|
13
|
+
this.resizeObserver = null;
|
|
14
|
+
this.visuallyHidden = "visually-hidden";
|
|
15
|
+
this.alignedFullWidth = true;
|
|
16
|
+
this.autoSetStepTitles = true;
|
|
17
|
+
this.lastStepWidth = 0;
|
|
18
|
+
this.noOfResizes = 0;
|
|
19
|
+
this.stepperWidth = (_a = document
|
|
20
|
+
.querySelector("ic-stepper")) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().width;
|
|
21
|
+
this.stepTypes = [];
|
|
22
|
+
this.variantOverride = this.variant !== "compact";
|
|
23
|
+
/**
|
|
24
|
+
* The alignment of the default stepper within its container.
|
|
25
|
+
*/
|
|
26
|
+
this.aligned = "full-width";
|
|
27
|
+
/**
|
|
28
|
+
* The length of the connector between each step in pixels. Minimum length is 100px.
|
|
29
|
+
*/
|
|
30
|
+
this.connectorWidth = 100;
|
|
31
|
+
/**
|
|
32
|
+
* If `true`, the information about each step, i.e. step title, step subtitle and step status, will be hidden on all default steps. The information about each step will still be visible in the compact variant of the stepper.
|
|
33
|
+
*/
|
|
34
|
+
this.hideStepInfo = false;
|
|
35
|
+
/**
|
|
36
|
+
* Provide alternative values for text in all child steps. For the purpose of translating the application into other languages.
|
|
37
|
+
*/
|
|
38
|
+
this.icI18n = {
|
|
39
|
+
next: "Next",
|
|
40
|
+
step: "Step",
|
|
41
|
+
steps: "Steps",
|
|
42
|
+
of: "of",
|
|
43
|
+
lastStep: "Last step",
|
|
44
|
+
completed: "Completed",
|
|
45
|
+
notRequired: "Not required",
|
|
46
|
+
required: "Required",
|
|
47
|
+
optional: "Optional",
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Sets the theme color to the dark or light theme color. "inherit" will set the color based on the system settings or ic-theme component.
|
|
51
|
+
*/
|
|
52
|
+
this.theme = "inherit";
|
|
53
|
+
/**
|
|
54
|
+
* The variant of the stepper.
|
|
55
|
+
*/
|
|
56
|
+
this.variant = "default";
|
|
57
|
+
this.stepHeading = (step, includeAutogeneratedTitles = false) => {
|
|
58
|
+
var _a, _b, _c, _d;
|
|
59
|
+
if (step.hasAttribute("heading") && step.getAttribute("heading") !== "") {
|
|
60
|
+
return step.getAttribute("heading") || undefined;
|
|
61
|
+
}
|
|
62
|
+
const headingSlot = (_a = step.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('slot[name="heading"]');
|
|
63
|
+
const assignedNodes = ((_b = headingSlot === null || headingSlot === void 0 ? void 0 : headingSlot.assignedNodes) === null || _b === void 0 ? void 0 : _b.call(headingSlot)) || [];
|
|
64
|
+
for (const node of assignedNodes) {
|
|
65
|
+
const text = node.nodeType === Node.TEXT_NODE
|
|
66
|
+
? (_c = node.textContent) === null || _c === void 0 ? void 0 : _c.trim()
|
|
67
|
+
: (_d = node.innerText) === null || _d === void 0 ? void 0 : _d.trim();
|
|
68
|
+
if (text)
|
|
69
|
+
return text;
|
|
70
|
+
}
|
|
71
|
+
if (includeAutogeneratedTitles && step.heading) {
|
|
72
|
+
return step.heading;
|
|
73
|
+
}
|
|
74
|
+
return undefined;
|
|
75
|
+
};
|
|
76
|
+
// Get all steps currently within this stepper
|
|
77
|
+
this.getChildren = () => {
|
|
78
|
+
this.steps = Array.from(this.el.querySelectorAll("ic-step"));
|
|
79
|
+
this.stepsWithStepTitles = this.steps.filter((step) => !!this.stepHeading(step, false));
|
|
80
|
+
};
|
|
81
|
+
// Inform the user that stepTitles are required on all steps in a compact stepper
|
|
82
|
+
this.checkStepTitles = () => {
|
|
83
|
+
if (this.stepsWithStepTitles.length < this.steps.length &&
|
|
84
|
+
this.variantOverride &&
|
|
85
|
+
this.variant === "compact") {
|
|
86
|
+
this.noOfResizes = this.noOfResizes + 1;
|
|
87
|
+
if (this.noOfResizes === 1) {
|
|
88
|
+
console.error(`The prop 'heading' is required for all steps of the Stepper component (compact variant)`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
this.setStepTypes = () => {
|
|
93
|
+
this.getChildren();
|
|
94
|
+
this.stepTypes = [];
|
|
95
|
+
for (let i = 0; i < this.steps.length; i++) {
|
|
96
|
+
this.stepTypes.push("active");
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
this.setStepperWidth = () => {
|
|
100
|
+
this.alignedFullWidth =
|
|
101
|
+
this.variant === "default" && this.aligned === "full-width";
|
|
102
|
+
const lastStep = this.steps[this.steps.length - 1];
|
|
103
|
+
lastStep.style.maxWidth = "none";
|
|
104
|
+
if (this.alignedFullWidth) {
|
|
105
|
+
this.stepperWidth = this.el.offsetWidth;
|
|
106
|
+
lastStep.style.maxWidth = pxToRem(`${this.stepperWidth / this.steps.length}px`);
|
|
107
|
+
this.lastStepWidth = lastStep.offsetWidth;
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
this.initialiseStepStates = () => {
|
|
111
|
+
this.steps.forEach((step, index) => {
|
|
112
|
+
var _a, _b, _c;
|
|
113
|
+
// Set language
|
|
114
|
+
if (this.icI18n !== undefined) {
|
|
115
|
+
step.icI18n = this.icI18n;
|
|
116
|
+
}
|
|
117
|
+
// Set variant
|
|
118
|
+
step.variant = this.variant;
|
|
119
|
+
// Assign stepNum to each step
|
|
120
|
+
step.stepNum = index + 1;
|
|
121
|
+
// Assign lastStep to final step
|
|
122
|
+
step.lastStep = index === this.steps.length - 1;
|
|
123
|
+
step.lastStepNum = this.steps.length;
|
|
124
|
+
if (step.type !== "current") {
|
|
125
|
+
step.current = false;
|
|
126
|
+
this.stepTypes[index] = step.type;
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
step.current = true;
|
|
130
|
+
}
|
|
131
|
+
const stepTitleArea = step.shadowRoot &&
|
|
132
|
+
step.shadowRoot.querySelector(".step > .heading-area");
|
|
133
|
+
if (this.stepsWithStepTitles.length == 0 && this.variantOverride) {
|
|
134
|
+
if (this.variant === "compact") {
|
|
135
|
+
this.autoSetStepTitles = true;
|
|
136
|
+
if (this.autoSetStepTitles) {
|
|
137
|
+
step.heading = "Step " + step.stepNum;
|
|
138
|
+
stepTitleArea &&
|
|
139
|
+
((_a = stepTitleArea === null || stepTitleArea === void 0 ? void 0 : stepTitleArea.querySelector(".heading")) === null || _a === void 0 ? void 0 : _a.setAttribute("aria-hidden", "true"));
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
if (this.variant === "default") {
|
|
143
|
+
this.autoSetStepTitles = false;
|
|
144
|
+
if (!this.autoSetStepTitles) {
|
|
145
|
+
step.heading = undefined;
|
|
146
|
+
stepTitleArea &&
|
|
147
|
+
((_b = stepTitleArea === null || stepTitleArea === void 0 ? void 0 : stepTitleArea.querySelector(".heading")) === null || _b === void 0 ? void 0 : _b.removeAttribute("aria-hidden"));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
if (this.variant === "compact") {
|
|
152
|
+
if (step.current === true || step.type === "current") {
|
|
153
|
+
step.classList.remove("hide");
|
|
154
|
+
step.classList.add("show");
|
|
155
|
+
}
|
|
156
|
+
else if (step.classList.contains("show")) {
|
|
157
|
+
step.classList.remove("show");
|
|
158
|
+
step.classList.add("hide");
|
|
159
|
+
}
|
|
160
|
+
if (!step.lastStep) {
|
|
161
|
+
const nextStep = this.steps[index + 1];
|
|
162
|
+
step.nextStepHeading = this.stepHeading(nextStep, true);
|
|
163
|
+
step.progress = (step.stepNum / this.steps.length) * 100;
|
|
164
|
+
}
|
|
165
|
+
else if (step.lastStep && this.stepTypes[index] !== "completed") {
|
|
166
|
+
step.progress = 95;
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
step.progress = 100;
|
|
170
|
+
}
|
|
171
|
+
if (this.hideStepInfo && stepTitleArea !== null) {
|
|
172
|
+
stepTitleArea.classList.remove(this.visuallyHidden);
|
|
173
|
+
}
|
|
174
|
+
step.compactStepStyling = this.stepTypes[index];
|
|
175
|
+
}
|
|
176
|
+
if (this.variant === "default") {
|
|
177
|
+
if (!step.lastStep) {
|
|
178
|
+
if (this.alignedFullWidth && this.stepperWidth !== undefined) {
|
|
179
|
+
step.style.width = pxToRem(`${(this.stepperWidth - this.lastStepWidth) /
|
|
180
|
+
(this.steps.length - 1)}px`);
|
|
181
|
+
step.style.minWidth = pxToRem("148px");
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
else if (step.lastStep) {
|
|
185
|
+
step.classList.add("last-step");
|
|
186
|
+
if (this.alignedFullWidth) {
|
|
187
|
+
step.style.maxWidth = `${this.lastStepWidth}px`;
|
|
188
|
+
}
|
|
189
|
+
else if (this.connectorWidth) {
|
|
190
|
+
step.style.maxWidth =
|
|
191
|
+
this.connectorWidth > 100
|
|
192
|
+
? pxToRem(`${this.connectorWidth + 48}px`)
|
|
193
|
+
: pxToRem("148px");
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
if (this.aligned === "left" && this.connectorWidth) {
|
|
197
|
+
step.style.width =
|
|
198
|
+
this.connectorWidth > 100
|
|
199
|
+
? pxToRem(`${this.connectorWidth + 48}px`)
|
|
200
|
+
: pxToRem("148px");
|
|
201
|
+
const stepConnect = (_c = step.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector(".step > .step-top > .step-connect");
|
|
202
|
+
if (stepConnect) {
|
|
203
|
+
stepConnect.style.width =
|
|
204
|
+
this.connectorWidth > 100
|
|
205
|
+
? pxToRem(`${this.connectorWidth}px`)
|
|
206
|
+
: pxToRem("100px");
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (this.hideStepInfo && stepTitleArea !== null) {
|
|
210
|
+
stepTitleArea.classList.add(this.visuallyHidden);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
};
|
|
215
|
+
this.setHideStepInfo = () => {
|
|
216
|
+
this.steps.forEach((step) => {
|
|
217
|
+
var _a, _b, _c;
|
|
218
|
+
const stepTitleArea = (_a = step.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".step > .heading-area");
|
|
219
|
+
if (stepTitleArea) {
|
|
220
|
+
if (this.hideStepInfo) {
|
|
221
|
+
(_b = stepTitleArea.classList) === null || _b === void 0 ? void 0 : _b.add(this.visuallyHidden);
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
(_c = stepTitleArea.classList) === null || _c === void 0 ? void 0 : _c.remove(this.visuallyHidden);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
};
|
|
229
|
+
this.overrideVariant = () => {
|
|
230
|
+
if (this.variantOverride) {
|
|
231
|
+
let minDefaultStepperWidth = 148 * this.steps.length;
|
|
232
|
+
if (this.aligned === "left" &&
|
|
233
|
+
this.connectorWidth &&
|
|
234
|
+
this.connectorWidth > 100) {
|
|
235
|
+
minDefaultStepperWidth = (this.connectorWidth + 48) * this.steps.length;
|
|
236
|
+
}
|
|
237
|
+
if (this.el.clientWidth < minDefaultStepperWidth) {
|
|
238
|
+
this.variant = "compact";
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
this.variant = "default";
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
this.resizeObserverCallback = () => {
|
|
246
|
+
this.getChildren();
|
|
247
|
+
this.checkStepTitles();
|
|
248
|
+
this.overrideVariant();
|
|
249
|
+
this.setStepperWidth();
|
|
250
|
+
this.initialiseStepStates();
|
|
251
|
+
this.handleThemeChange();
|
|
252
|
+
};
|
|
253
|
+
this.runResizeObserver = () => {
|
|
254
|
+
this.resizeObserver = new ResizeObserver(() => {
|
|
255
|
+
this.resizeObserverCallback();
|
|
256
|
+
});
|
|
257
|
+
this.resizeObserver.observe(this.el);
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
handleThemeChange() {
|
|
261
|
+
this.getChildren();
|
|
262
|
+
this.steps.forEach((step) => {
|
|
263
|
+
step.theme = this.theme;
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
handlePropChange() {
|
|
267
|
+
this.setHideStepInfo();
|
|
268
|
+
this.getChildren();
|
|
269
|
+
}
|
|
270
|
+
disconnectedCallback() {
|
|
271
|
+
if (this.resizeObserver !== null) {
|
|
272
|
+
this.resizeObserver.disconnect();
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
componentWillLoad() {
|
|
276
|
+
this.setStepTypes();
|
|
277
|
+
this.handleThemeChange();
|
|
278
|
+
if (this.variant === "compact") {
|
|
279
|
+
this.variantOverride = false;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
componentWillRender() {
|
|
283
|
+
this.initialiseStepStates();
|
|
284
|
+
}
|
|
285
|
+
componentDidLoad() {
|
|
286
|
+
checkResizeObserver(this.runResizeObserver);
|
|
287
|
+
}
|
|
288
|
+
render() {
|
|
289
|
+
return (h(Host, { key: '4fbff633235fba3d0c146427b74d1c4e69cff419', class: {
|
|
290
|
+
[`ic-stepper-${this.variant}`]: true,
|
|
291
|
+
["ic-stepper-aligned-left"]: this.variant === "default" && this.aligned === "left",
|
|
292
|
+
[`ic-theme-${this.theme}`]: this.theme !== "inherit",
|
|
293
|
+
} }, h("ul", { key: '452b6724f1b286aa3ff75fd460cdc4dfa36e8e55', class: "step-item-list" }, h("slot", { key: 'e6e6465ee3c505fab2bbe1c7c502defa7e587571' }))));
|
|
294
|
+
}
|
|
295
|
+
get el() { return this; }
|
|
296
|
+
static get watchers() { return {
|
|
297
|
+
"theme": ["handleThemeChange"],
|
|
298
|
+
"hideStepInfo": ["handlePropChange"],
|
|
299
|
+
"variant": ["handlePropChange"]
|
|
300
|
+
}; }
|
|
301
|
+
static get style() { return IcStepperStyle0; }
|
|
302
|
+
}, [1, "ic-stepper", {
|
|
303
|
+
"aligned": [1],
|
|
304
|
+
"connectorWidth": [2, "connector-width"],
|
|
305
|
+
"hideStepInfo": [4, "hide-step-info"],
|
|
306
|
+
"icI18n": [16],
|
|
307
|
+
"theme": [1],
|
|
308
|
+
"variant": [1025],
|
|
309
|
+
"alignedFullWidth": [32],
|
|
310
|
+
"autoSetStepTitles": [32],
|
|
311
|
+
"lastStepWidth": [32],
|
|
312
|
+
"noOfResizes": [32],
|
|
313
|
+
"stepperWidth": [32],
|
|
314
|
+
"stepTypes": [32],
|
|
315
|
+
"variantOverride": [32]
|
|
316
|
+
}, undefined, {
|
|
317
|
+
"theme": ["handleThemeChange"],
|
|
318
|
+
"hideStepInfo": ["handlePropChange"],
|
|
319
|
+
"variant": ["handlePropChange"]
|
|
320
|
+
}]);
|
|
321
|
+
function defineCustomElement$1() {
|
|
322
|
+
if (typeof customElements === "undefined") {
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
const components = ["ic-stepper"];
|
|
326
|
+
components.forEach(tagName => { switch (tagName) {
|
|
327
|
+
case "ic-stepper":
|
|
328
|
+
if (!customElements.get(tagName)) {
|
|
329
|
+
customElements.define(tagName, Stepper);
|
|
330
|
+
}
|
|
331
|
+
break;
|
|
332
|
+
} });
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
const IcStepper = Stepper;
|
|
336
|
+
const defineCustomElement = defineCustomElement$1;
|
|
337
|
+
|
|
338
|
+
export { IcStepper, defineCustomElement };
|
|
339
|
+
|
|
340
|
+
//# sourceMappingURL=ic-stepper.js.map
|