@dnb/eufemia 10.71.2 → 10.72.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/CHANGELOG.md +7 -0
- package/cjs/components/anchor/Anchor.js +1 -0
- package/cjs/components/anchor/Anchor.js.map +1 -1
- package/cjs/components/card/CardDocs.js +1 -1
- package/cjs/components/card/CardDocs.js.map +1 -1
- package/cjs/components/help-button/HelpButtonInline.js +1 -1
- package/cjs/components/help-button/HelpButtonInline.js.map +1 -1
- package/cjs/components/section/Section.d.ts +2 -1
- package/cjs/components/section/Section.js +2 -2
- package/cjs/components/section/Section.js.map +1 -1
- package/cjs/components/section/style/dnb-section.css +4 -0
- package/cjs/components/section/style/dnb-section.min.css +1 -1
- package/cjs/components/section/style/dnb-section.scss +5 -0
- package/cjs/components/step-indicator/StepIndicator.d.ts +23 -5
- package/cjs/components/step-indicator/StepIndicator.js +66 -21
- package/cjs/components/step-indicator/StepIndicator.js.map +1 -1
- package/cjs/components/step-indicator/StepIndicatorContext.d.ts +2 -14
- package/cjs/components/step-indicator/StepIndicatorContext.js +9 -56
- package/cjs/components/step-indicator/StepIndicatorContext.js.map +1 -1
- package/cjs/components/step-indicator/StepIndicatorDocs.d.ts +5 -0
- package/cjs/components/step-indicator/StepIndicatorDocs.js +145 -0
- package/cjs/components/step-indicator/StepIndicatorDocs.js.map +1 -0
- package/cjs/components/step-indicator/StepIndicatorItem.d.ts +10 -10
- package/cjs/components/step-indicator/StepIndicatorItem.js +89 -98
- package/cjs/components/step-indicator/StepIndicatorItem.js.map +1 -1
- package/cjs/components/step-indicator/StepIndicatorList.js +33 -36
- package/cjs/components/step-indicator/StepIndicatorList.js.map +1 -1
- package/cjs/components/step-indicator/StepIndicatorProps.js +2 -1
- package/cjs/components/step-indicator/StepIndicatorProps.js.map +1 -1
- package/cjs/components/step-indicator/StepIndicatorSidebar.d.ts +8 -8
- package/cjs/components/step-indicator/StepIndicatorSidebar.js +6 -63
- package/cjs/components/step-indicator/StepIndicatorSidebar.js.map +1 -1
- package/cjs/components/step-indicator/StepIndicatorTriggerButton.d.ts +1 -7
- package/cjs/components/step-indicator/StepIndicatorTriggerButton.js +70 -38
- package/cjs/components/step-indicator/StepIndicatorTriggerButton.js.map +1 -1
- package/cjs/components/step-indicator/style/dnb-step-indicator.css +99 -56
- package/cjs/components/step-indicator/style/dnb-step-indicator.min.css +1 -1
- package/cjs/components/step-indicator/style/dnb-step-indicator.scss +112 -67
- package/cjs/components/step-indicator/style/themes/dnb-step-indicator-theme-sbanken.css +5 -62
- package/cjs/components/step-indicator/style/themes/dnb-step-indicator-theme-sbanken.min.css +1 -1
- package/cjs/components/step-indicator/style/themes/dnb-step-indicator-theme-sbanken.scss +5 -89
- package/cjs/components/step-indicator/style/themes/dnb-step-indicator-theme-ui.css +1 -65
- package/cjs/components/step-indicator/style/themes/dnb-step-indicator-theme-ui.min.css +0 -1
- package/cjs/components/step-indicator/style/themes/dnb-step-indicator-theme-ui.scss +0 -91
- package/cjs/elements/Element.d.ts +16 -2
- package/cjs/elements/Element.js +1 -1
- package/cjs/elements/Element.js.map +1 -1
- package/cjs/elements/lib.d.ts +1 -1
- package/cjs/extensions/forms/Wizard/Container/DisplaySteps.d.ts +3 -3
- package/cjs/extensions/forms/Wizard/Container/DisplaySteps.js +14 -10
- package/cjs/extensions/forms/Wizard/Container/DisplaySteps.js.map +1 -1
- package/cjs/extensions/forms/Wizard/Container/WizardContainer.d.ts +12 -0
- package/cjs/extensions/forms/Wizard/Container/WizardContainer.js +24 -13
- package/cjs/extensions/forms/Wizard/Container/WizardContainer.js.map +1 -1
- package/cjs/extensions/forms/Wizard/Container/WizardContainerDocs.js +21 -11
- package/cjs/extensions/forms/Wizard/Container/WizardContainerDocs.js.map +1 -1
- package/cjs/extensions/forms/Wizard/style/dnb-wizard-layout.css +2 -14
- package/cjs/extensions/forms/Wizard/style/dnb-wizard-layout.min.css +1 -1
- package/cjs/extensions/forms/Wizard/style/dnb-wizard-layout.scss +3 -18
- package/cjs/extensions/forms/style/dnb-forms.css +2 -13
- package/cjs/extensions/forms/style/dnb-forms.min.css +1 -1
- package/cjs/shared/Eufemia.d.ts +1 -1
- package/cjs/shared/Eufemia.js +2 -2
- package/cjs/shared/Eufemia.js.map +1 -1
- package/cjs/shared/locales/en-GB.d.ts +0 -1
- package/cjs/shared/locales/en-GB.js +1 -2
- package/cjs/shared/locales/en-GB.js.map +1 -1
- package/cjs/shared/locales/en-US.d.ts +0 -1
- package/cjs/shared/locales/index.d.ts +0 -2
- package/cjs/shared/locales/nb-NO.d.ts +0 -1
- package/cjs/shared/locales/nb-NO.js +1 -2
- package/cjs/shared/locales/nb-NO.js.map +1 -1
- package/cjs/shared/locales/sv-SE.d.ts +0 -1
- package/cjs/shared/locales/sv-SE.js +0 -1
- package/cjs/shared/locales/sv-SE.js.map +1 -1
- package/cjs/style/core/scopes.scss +1 -1
- package/cjs/style/dnb-ui-basis.css +1 -1
- package/cjs/style/dnb-ui-basis.min.css +1 -1
- package/cjs/style/dnb-ui-body.css +1 -1
- package/cjs/style/dnb-ui-body.min.css +1 -1
- package/cjs/style/dnb-ui-components.css +101 -65
- package/cjs/style/dnb-ui-components.min.css +3 -3
- package/cjs/style/dnb-ui-core.css +1 -1
- package/cjs/style/dnb-ui-core.min.css +1 -1
- package/cjs/style/dnb-ui-extensions.css +2 -13
- package/cjs/style/dnb-ui-extensions.min.css +1 -1
- package/cjs/style/dnb-ui-forms.css +2 -13
- package/cjs/style/dnb-ui-forms.min.css +1 -1
- package/cjs/style/themes/theme-eiendom/eiendom-theme-components.css +102 -142
- package/cjs/style/themes/theme-eiendom/eiendom-theme-components.min.css +4 -4
- package/cjs/style/themes/theme-eiendom/eiendom-theme-extensions.css +2 -13
- package/cjs/style/themes/theme-eiendom/eiendom-theme-extensions.min.css +1 -1
- package/cjs/style/themes/theme-eiendom/eiendom-theme-forms.css +2 -13
- package/cjs/style/themes/theme-eiendom/eiendom-theme-forms.min.css +1 -1
- package/cjs/style/themes/theme-sbanken/sbanken-theme-components.css +107 -139
- package/cjs/style/themes/theme-sbanken/sbanken-theme-components.min.css +4 -4
- package/cjs/style/themes/theme-sbanken/sbanken-theme-extensions.css +2 -13
- package/cjs/style/themes/theme-sbanken/sbanken-theme-extensions.min.css +1 -1
- package/cjs/style/themes/theme-sbanken/sbanken-theme-forms.css +2 -13
- package/cjs/style/themes/theme-sbanken/sbanken-theme-forms.min.css +1 -1
- package/cjs/style/themes/theme-ui/ui-theme-components.css +102 -142
- package/cjs/style/themes/theme-ui/ui-theme-components.min.css +4 -4
- package/cjs/style/themes/theme-ui/ui-theme-extensions.css +2 -13
- package/cjs/style/themes/theme-ui/ui-theme-extensions.min.css +1 -1
- package/cjs/style/themes/theme-ui/ui-theme-forms.css +2 -13
- package/cjs/style/themes/theme-ui/ui-theme-forms.min.css +1 -1
- package/components/anchor/Anchor.js +1 -0
- package/components/anchor/Anchor.js.map +1 -1
- package/components/card/CardDocs.js +1 -1
- package/components/card/CardDocs.js.map +1 -1
- package/components/help-button/HelpButtonInline.js +1 -1
- package/components/help-button/HelpButtonInline.js.map +1 -1
- package/components/section/Section.d.ts +2 -1
- package/components/section/Section.js +2 -2
- package/components/section/Section.js.map +1 -1
- package/components/section/style/dnb-section.css +4 -0
- package/components/section/style/dnb-section.min.css +1 -1
- package/components/section/style/dnb-section.scss +5 -0
- package/components/step-indicator/StepIndicator.d.ts +23 -5
- package/components/step-indicator/StepIndicator.js +64 -21
- package/components/step-indicator/StepIndicator.js.map +1 -1
- package/components/step-indicator/StepIndicatorContext.d.ts +2 -14
- package/components/step-indicator/StepIndicatorContext.js +9 -53
- package/components/step-indicator/StepIndicatorContext.js.map +1 -1
- package/components/step-indicator/StepIndicatorDocs.d.ts +5 -0
- package/components/step-indicator/StepIndicatorDocs.js +139 -0
- package/components/step-indicator/StepIndicatorDocs.js.map +1 -0
- package/components/step-indicator/StepIndicatorItem.d.ts +10 -10
- package/components/step-indicator/StepIndicatorItem.js +90 -99
- package/components/step-indicator/StepIndicatorItem.js.map +1 -1
- package/components/step-indicator/StepIndicatorList.js +33 -35
- package/components/step-indicator/StepIndicatorList.js.map +1 -1
- package/components/step-indicator/StepIndicatorProps.js +2 -1
- package/components/step-indicator/StepIndicatorProps.js.map +1 -1
- package/components/step-indicator/StepIndicatorSidebar.d.ts +8 -8
- package/components/step-indicator/StepIndicatorSidebar.js +6 -59
- package/components/step-indicator/StepIndicatorSidebar.js.map +1 -1
- package/components/step-indicator/StepIndicatorTriggerButton.d.ts +1 -7
- package/components/step-indicator/StepIndicatorTriggerButton.js +71 -39
- package/components/step-indicator/StepIndicatorTriggerButton.js.map +1 -1
- package/components/step-indicator/style/dnb-step-indicator.css +99 -56
- package/components/step-indicator/style/dnb-step-indicator.min.css +1 -1
- package/components/step-indicator/style/dnb-step-indicator.scss +112 -67
- package/components/step-indicator/style/themes/dnb-step-indicator-theme-sbanken.css +5 -62
- package/components/step-indicator/style/themes/dnb-step-indicator-theme-sbanken.min.css +1 -1
- package/components/step-indicator/style/themes/dnb-step-indicator-theme-sbanken.scss +5 -89
- package/components/step-indicator/style/themes/dnb-step-indicator-theme-ui.css +1 -65
- package/components/step-indicator/style/themes/dnb-step-indicator-theme-ui.min.css +0 -1
- package/components/step-indicator/style/themes/dnb-step-indicator-theme-ui.scss +0 -91
- package/elements/Element.d.ts +16 -2
- package/elements/Element.js +1 -1
- package/elements/Element.js.map +1 -1
- package/elements/lib.d.ts +1 -1
- package/es/components/anchor/Anchor.js +1 -0
- package/es/components/anchor/Anchor.js.map +1 -1
- package/es/components/card/CardDocs.js +1 -1
- package/es/components/card/CardDocs.js.map +1 -1
- package/es/components/help-button/HelpButtonInline.js +1 -1
- package/es/components/help-button/HelpButtonInline.js.map +1 -1
- package/es/components/section/Section.d.ts +2 -1
- package/es/components/section/Section.js +2 -2
- package/es/components/section/Section.js.map +1 -1
- package/es/components/section/style/dnb-section.css +4 -0
- package/es/components/section/style/dnb-section.min.css +1 -1
- package/es/components/section/style/dnb-section.scss +5 -0
- package/es/components/step-indicator/StepIndicator.d.ts +23 -5
- package/es/components/step-indicator/StepIndicator.js +63 -21
- package/es/components/step-indicator/StepIndicator.js.map +1 -1
- package/es/components/step-indicator/StepIndicatorContext.d.ts +2 -14
- package/es/components/step-indicator/StepIndicatorContext.js +5 -49
- package/es/components/step-indicator/StepIndicatorContext.js.map +1 -1
- package/es/components/step-indicator/StepIndicatorDocs.d.ts +5 -0
- package/es/components/step-indicator/StepIndicatorDocs.js +139 -0
- package/es/components/step-indicator/StepIndicatorDocs.js.map +1 -0
- package/es/components/step-indicator/StepIndicatorItem.d.ts +10 -10
- package/es/components/step-indicator/StepIndicatorItem.js +82 -88
- package/es/components/step-indicator/StepIndicatorItem.js.map +1 -1
- package/es/components/step-indicator/StepIndicatorList.js +33 -35
- package/es/components/step-indicator/StepIndicatorList.js.map +1 -1
- package/es/components/step-indicator/StepIndicatorProps.js +2 -1
- package/es/components/step-indicator/StepIndicatorProps.js.map +1 -1
- package/es/components/step-indicator/StepIndicatorSidebar.d.ts +8 -8
- package/es/components/step-indicator/StepIndicatorSidebar.js +6 -58
- package/es/components/step-indicator/StepIndicatorSidebar.js.map +1 -1
- package/es/components/step-indicator/StepIndicatorTriggerButton.d.ts +1 -7
- package/es/components/step-indicator/StepIndicatorTriggerButton.js +71 -39
- package/es/components/step-indicator/StepIndicatorTriggerButton.js.map +1 -1
- package/es/components/step-indicator/style/dnb-step-indicator.css +99 -56
- package/es/components/step-indicator/style/dnb-step-indicator.min.css +1 -1
- package/es/components/step-indicator/style/dnb-step-indicator.scss +112 -67
- package/es/components/step-indicator/style/themes/dnb-step-indicator-theme-sbanken.css +5 -62
- package/es/components/step-indicator/style/themes/dnb-step-indicator-theme-sbanken.min.css +1 -1
- package/es/components/step-indicator/style/themes/dnb-step-indicator-theme-sbanken.scss +5 -89
- package/es/components/step-indicator/style/themes/dnb-step-indicator-theme-ui.css +1 -65
- package/es/components/step-indicator/style/themes/dnb-step-indicator-theme-ui.min.css +0 -1
- package/es/components/step-indicator/style/themes/dnb-step-indicator-theme-ui.scss +0 -91
- package/es/elements/Element.d.ts +16 -2
- package/es/elements/Element.js +1 -1
- package/es/elements/Element.js.map +1 -1
- package/es/elements/lib.d.ts +1 -1
- package/es/extensions/forms/Wizard/Container/DisplaySteps.d.ts +3 -3
- package/es/extensions/forms/Wizard/Container/DisplaySteps.js +14 -10
- package/es/extensions/forms/Wizard/Container/DisplaySteps.js.map +1 -1
- package/es/extensions/forms/Wizard/Container/WizardContainer.d.ts +12 -0
- package/es/extensions/forms/Wizard/Container/WizardContainer.js +24 -13
- package/es/extensions/forms/Wizard/Container/WizardContainer.js.map +1 -1
- package/es/extensions/forms/Wizard/Container/WizardContainerDocs.js +21 -11
- package/es/extensions/forms/Wizard/Container/WizardContainerDocs.js.map +1 -1
- package/es/extensions/forms/Wizard/style/dnb-wizard-layout.css +2 -14
- package/es/extensions/forms/Wizard/style/dnb-wizard-layout.min.css +1 -1
- package/es/extensions/forms/Wizard/style/dnb-wizard-layout.scss +3 -18
- package/es/extensions/forms/style/dnb-forms.css +2 -13
- package/es/extensions/forms/style/dnb-forms.min.css +1 -1
- package/es/shared/Eufemia.d.ts +1 -1
- package/es/shared/Eufemia.js +2 -2
- package/es/shared/Eufemia.js.map +1 -1
- package/es/shared/locales/en-GB.d.ts +0 -1
- package/es/shared/locales/en-GB.js +1 -2
- package/es/shared/locales/en-GB.js.map +1 -1
- package/es/shared/locales/en-US.d.ts +0 -1
- package/es/shared/locales/index.d.ts +0 -2
- package/es/shared/locales/nb-NO.d.ts +0 -1
- package/es/shared/locales/nb-NO.js +1 -2
- package/es/shared/locales/nb-NO.js.map +1 -1
- package/es/shared/locales/sv-SE.d.ts +0 -1
- package/es/shared/locales/sv-SE.js +0 -1
- package/es/shared/locales/sv-SE.js.map +1 -1
- package/es/style/core/scopes.scss +1 -1
- package/es/style/dnb-ui-basis.css +1 -1
- package/es/style/dnb-ui-basis.min.css +1 -1
- package/es/style/dnb-ui-body.css +1 -1
- package/es/style/dnb-ui-body.min.css +1 -1
- package/es/style/dnb-ui-components.css +101 -65
- package/es/style/dnb-ui-components.min.css +3 -3
- package/es/style/dnb-ui-core.css +1 -1
- package/es/style/dnb-ui-core.min.css +1 -1
- package/es/style/dnb-ui-extensions.css +2 -13
- package/es/style/dnb-ui-extensions.min.css +1 -1
- package/es/style/dnb-ui-forms.css +2 -13
- package/es/style/dnb-ui-forms.min.css +1 -1
- package/es/style/themes/theme-eiendom/eiendom-theme-components.css +102 -142
- package/es/style/themes/theme-eiendom/eiendom-theme-components.min.css +4 -4
- package/es/style/themes/theme-eiendom/eiendom-theme-extensions.css +2 -13
- package/es/style/themes/theme-eiendom/eiendom-theme-extensions.min.css +1 -1
- package/es/style/themes/theme-eiendom/eiendom-theme-forms.css +2 -13
- package/es/style/themes/theme-eiendom/eiendom-theme-forms.min.css +1 -1
- package/es/style/themes/theme-sbanken/sbanken-theme-components.css +107 -139
- package/es/style/themes/theme-sbanken/sbanken-theme-components.min.css +4 -4
- package/es/style/themes/theme-sbanken/sbanken-theme-extensions.css +2 -13
- package/es/style/themes/theme-sbanken/sbanken-theme-extensions.min.css +1 -1
- package/es/style/themes/theme-sbanken/sbanken-theme-forms.css +2 -13
- package/es/style/themes/theme-sbanken/sbanken-theme-forms.min.css +1 -1
- package/es/style/themes/theme-ui/ui-theme-components.css +102 -142
- package/es/style/themes/theme-ui/ui-theme-components.min.css +4 -4
- package/es/style/themes/theme-ui/ui-theme-extensions.css +2 -13
- package/es/style/themes/theme-ui/ui-theme-extensions.min.css +1 -1
- package/es/style/themes/theme-ui/ui-theme-forms.css +2 -13
- package/es/style/themes/theme-ui/ui-theme-forms.min.css +1 -1
- package/esm/dnb-ui-basis.min.mjs +1 -1
- package/esm/dnb-ui-components.min.mjs +1 -1
- package/esm/dnb-ui-elements.min.mjs +1 -1
- package/esm/dnb-ui-extensions.min.mjs +1 -1
- package/esm/dnb-ui-lib.min.mjs +1 -1
- package/extensions/forms/Wizard/Container/DisplaySteps.d.ts +3 -3
- package/extensions/forms/Wizard/Container/DisplaySteps.js +14 -10
- package/extensions/forms/Wizard/Container/DisplaySteps.js.map +1 -1
- package/extensions/forms/Wizard/Container/WizardContainer.d.ts +12 -0
- package/extensions/forms/Wizard/Container/WizardContainer.js +24 -13
- package/extensions/forms/Wizard/Container/WizardContainer.js.map +1 -1
- package/extensions/forms/Wizard/Container/WizardContainerDocs.js +21 -11
- package/extensions/forms/Wizard/Container/WizardContainerDocs.js.map +1 -1
- package/extensions/forms/Wizard/style/dnb-wizard-layout.css +2 -14
- package/extensions/forms/Wizard/style/dnb-wizard-layout.min.css +1 -1
- package/extensions/forms/Wizard/style/dnb-wizard-layout.scss +3 -18
- package/extensions/forms/style/dnb-forms.css +2 -13
- package/extensions/forms/style/dnb-forms.min.css +1 -1
- package/package.json +1 -1
- package/shared/Eufemia.d.ts +1 -1
- package/shared/Eufemia.js +2 -2
- package/shared/Eufemia.js.map +1 -1
- package/shared/locales/en-GB.d.ts +0 -1
- package/shared/locales/en-GB.js +1 -2
- package/shared/locales/en-GB.js.map +1 -1
- package/shared/locales/en-US.d.ts +0 -1
- package/shared/locales/index.d.ts +0 -2
- package/shared/locales/nb-NO.d.ts +0 -1
- package/shared/locales/nb-NO.js +1 -2
- package/shared/locales/nb-NO.js.map +1 -1
- package/shared/locales/sv-SE.d.ts +0 -1
- package/shared/locales/sv-SE.js +0 -1
- package/shared/locales/sv-SE.js.map +1 -1
- package/style/core/scopes.scss +1 -1
- package/style/dnb-ui-basis.css +1 -1
- package/style/dnb-ui-basis.min.css +1 -1
- package/style/dnb-ui-body.css +1 -1
- package/style/dnb-ui-body.min.css +1 -1
- package/style/dnb-ui-components.css +101 -65
- package/style/dnb-ui-components.min.css +3 -3
- package/style/dnb-ui-core.css +1 -1
- package/style/dnb-ui-core.min.css +1 -1
- package/style/dnb-ui-extensions.css +2 -13
- package/style/dnb-ui-extensions.min.css +1 -1
- package/style/dnb-ui-forms.css +2 -13
- package/style/dnb-ui-forms.min.css +1 -1
- package/style/themes/theme-eiendom/eiendom-theme-components.css +102 -142
- package/style/themes/theme-eiendom/eiendom-theme-components.min.css +4 -4
- package/style/themes/theme-eiendom/eiendom-theme-extensions.css +2 -13
- package/style/themes/theme-eiendom/eiendom-theme-extensions.min.css +1 -1
- package/style/themes/theme-eiendom/eiendom-theme-forms.css +2 -13
- package/style/themes/theme-eiendom/eiendom-theme-forms.min.css +1 -1
- package/style/themes/theme-sbanken/sbanken-theme-components.css +107 -139
- package/style/themes/theme-sbanken/sbanken-theme-components.min.css +4 -4
- package/style/themes/theme-sbanken/sbanken-theme-extensions.css +2 -13
- package/style/themes/theme-sbanken/sbanken-theme-extensions.min.css +1 -1
- package/style/themes/theme-sbanken/sbanken-theme-forms.css +2 -13
- package/style/themes/theme-sbanken/sbanken-theme-forms.min.css +1 -1
- package/style/themes/theme-ui/ui-theme-components.css +102 -142
- package/style/themes/theme-ui/ui-theme-components.min.css +4 -4
- package/style/themes/theme-ui/ui-theme-extensions.css +2 -13
- package/style/themes/theme-ui/ui-theme-extensions.min.css +1 -1
- package/style/themes/theme-ui/ui-theme-forms.css +2 -13
- package/style/themes/theme-ui/ui-theme-forms.min.css +1 -1
- package/umd/dnb-ui-basis.min.js +1 -1
- package/umd/dnb-ui-components.min.js +1 -1
- package/umd/dnb-ui-elements.min.js +1 -1
- package/umd/dnb-ui-extensions.min.js +1 -1
- package/umd/dnb-ui-lib.min.js +1 -1
- package/cjs/components/step-indicator/StepIndicatorModal.d.ts +0 -6
- package/cjs/components/step-indicator/StepIndicatorModal.js +0 -62
- package/cjs/components/step-indicator/StepIndicatorModal.js.map +0 -1
- package/components/step-indicator/StepIndicatorModal.d.ts +0 -6
- package/components/step-indicator/StepIndicatorModal.js +0 -54
- package/components/step-indicator/StepIndicatorModal.js.map +0 -1
- package/es/components/step-indicator/StepIndicatorModal.d.ts +0 -6
- package/es/components/step-indicator/StepIndicatorModal.js +0 -53
- package/es/components/step-indicator/StepIndicatorModal.js.map +0 -1
|
@@ -4,33 +4,38 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
6
6
|
const _excluded = ["status_state", "inactive", "disabled"],
|
|
7
|
-
_excluded2 = ["
|
|
8
|
-
_excluded3 = ["children", "className", "status", "status_state", "inner_ref"];
|
|
7
|
+
_excluded2 = ["children", "className", "status", "status_state", "innerRef"];
|
|
9
8
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
9
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
10
|
import React, { useCallback, useContext, useMemo } from 'react';
|
|
12
11
|
import classnames from 'classnames';
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import
|
|
12
|
+
import { dispatchCustomElementEvent } from '../../shared/component-helper';
|
|
13
|
+
import useId from '../../shared/helpers/useId';
|
|
14
|
+
import Anchor from '../anchor/Anchor';
|
|
16
15
|
import Icon from '../icon/Icon';
|
|
17
|
-
import
|
|
16
|
+
import IconPrimary from '../icon/IconPrimary';
|
|
17
|
+
import FormStatus, { WarnIcon, InfoIcon, ErrorIcon } from '../form-status/FormStatus';
|
|
18
18
|
import StepIndicatorContext from './StepIndicatorContext';
|
|
19
19
|
import { stepIndicatorDefaultProps } from './StepIndicatorProps';
|
|
20
|
+
import Context from '../../shared/Context';
|
|
21
|
+
import { createSkeletonClass } from '../skeleton/SkeletonHelper';
|
|
20
22
|
function StepIndicatorItem(_ref) {
|
|
23
|
+
var _globalContext$formEl3;
|
|
21
24
|
let {
|
|
22
25
|
status_state: status_state_default = 'warn',
|
|
23
26
|
inactive: inactive_default = false,
|
|
24
27
|
disabled: disabled_default = false
|
|
25
28
|
} = _ref,
|
|
26
29
|
restOfProps = _objectWithoutProperties(_ref, _excluded);
|
|
30
|
+
const globalContext = React.useContext(Context);
|
|
27
31
|
const props = useMemo(() => {
|
|
32
|
+
var _globalContext$formEl, _globalContext$formEl2;
|
|
28
33
|
return _objectSpread({
|
|
29
34
|
status_state: status_state_default,
|
|
30
35
|
inactive: inactive_default,
|
|
31
|
-
disabled: disabled_default
|
|
36
|
+
disabled: (_globalContext$formEl = globalContext === null || globalContext === void 0 ? void 0 : (_globalContext$formEl2 = globalContext.formElement) === null || _globalContext$formEl2 === void 0 ? void 0 : _globalContext$formEl2.disabled) !== null && _globalContext$formEl !== void 0 ? _globalContext$formEl : disabled_default
|
|
32
37
|
}, restOfProps);
|
|
33
|
-
}, [disabled_default, inactive_default, restOfProps, status_state_default]);
|
|
38
|
+
}, [disabled_default, inactive_default, restOfProps, status_state_default, globalContext === null || globalContext === void 0 ? void 0 : (_globalContext$formEl3 = globalContext.formElement) === null || _globalContext$formEl3 === void 0 ? void 0 : _globalContext$formEl3.disabled]);
|
|
34
39
|
const context = useContext(StepIndicatorContext);
|
|
35
40
|
const onClickHandler = useCallback(({
|
|
36
41
|
event,
|
|
@@ -54,56 +59,43 @@ function StepIndicatorItem(_ref) {
|
|
|
54
59
|
}
|
|
55
60
|
if (context.activeStep !== currentItemNum) {
|
|
56
61
|
context.setActiveStep(currentItemNum);
|
|
57
|
-
if (typeof context.onChangeState === 'function') {
|
|
58
|
-
context.onChangeState();
|
|
59
|
-
}
|
|
60
62
|
dispatchCustomElementEvent(context, 'on_change', params);
|
|
61
63
|
}
|
|
62
64
|
}, [context, props]);
|
|
63
65
|
const {
|
|
64
66
|
mode,
|
|
65
|
-
filterAttributes,
|
|
66
67
|
activeStep,
|
|
67
68
|
countSteps,
|
|
68
69
|
listOfReachedSteps,
|
|
69
|
-
hide_numbers,
|
|
70
|
+
hide_numbers = stepIndicatorDefaultProps.hide_numbers,
|
|
70
71
|
on_item_render,
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
step_title,
|
|
73
|
+
no_animation,
|
|
74
|
+
skeleton
|
|
73
75
|
} = context;
|
|
74
76
|
const {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
attributes = _objectWithoutProperties(props, _excluded2);
|
|
86
|
-
Object.keys(attributes).forEach(key => {
|
|
87
|
-
if (filterAttributes.includes(key)) {
|
|
88
|
-
delete attributes[key];
|
|
89
|
-
}
|
|
90
|
-
});
|
|
77
|
+
currentItemNum,
|
|
78
|
+
title,
|
|
79
|
+
is_current,
|
|
80
|
+
inactive,
|
|
81
|
+
disabled,
|
|
82
|
+
status,
|
|
83
|
+
status_state = 'warn',
|
|
84
|
+
on_render,
|
|
85
|
+
on_click
|
|
86
|
+
} = props;
|
|
91
87
|
const hasPassedAndIsCurrent = mode === 'loose' || currentItemNum <= activeStep || listOfReachedSteps.includes(currentItemNum);
|
|
92
88
|
const isNavigatable = mode === 'strict' || mode === 'loose';
|
|
93
|
-
let isInactive = inactive || mode === 'strict' && !hasPassedAndIsCurrent;
|
|
89
|
+
let isInactive = inactive || disabled || mode === 'strict' && !hasPassedAndIsCurrent;
|
|
94
90
|
const isVisited = currentItemNum < activeStep;
|
|
95
|
-
const id = `${
|
|
91
|
+
const id = `${useId()}-${currentItemNum}`;
|
|
96
92
|
const ariaLabel = step_title === null || step_title === void 0 ? void 0 : step_title.replace('%step', String(currentItemNum + 1)).replace('%count', String(countSteps));
|
|
97
93
|
const isCurrent = currentItemNum === activeStep;
|
|
98
|
-
let element = React.createElement(StepItemWrapper,
|
|
99
|
-
number: currentItemNum + 1,
|
|
100
|
-
hide_numbers: hide_numbers,
|
|
101
|
-
status: status
|
|
102
|
-
}, title);
|
|
94
|
+
let element = React.createElement(StepItemWrapper, null, title);
|
|
103
95
|
const callbackProps = {
|
|
104
96
|
StepItem: StepItemWrapper,
|
|
105
97
|
element,
|
|
106
|
-
attributes,
|
|
98
|
+
attributes: {},
|
|
107
99
|
props,
|
|
108
100
|
context
|
|
109
101
|
};
|
|
@@ -114,7 +106,6 @@ function StepIndicatorItem(_ref) {
|
|
|
114
106
|
}
|
|
115
107
|
const itemParams = {};
|
|
116
108
|
const buttonParams = {
|
|
117
|
-
icon: 'check',
|
|
118
109
|
status,
|
|
119
110
|
status_state,
|
|
120
111
|
'aria-describedby': id
|
|
@@ -126,23 +117,54 @@ function StepIndicatorItem(_ref) {
|
|
|
126
117
|
buttonParams.disabled = true;
|
|
127
118
|
}
|
|
128
119
|
if (isNavigatable && !isInactive) {
|
|
129
|
-
buttonParams.onClick = ({
|
|
130
|
-
event
|
|
131
|
-
}) => onClickHandler({
|
|
120
|
+
buttonParams.onClick = event => onClickHandler({
|
|
132
121
|
event,
|
|
133
122
|
item: props,
|
|
134
123
|
currentItemNum
|
|
135
124
|
});
|
|
136
125
|
}
|
|
137
126
|
if (!buttonParams.onClick) {
|
|
138
|
-
buttonParams.
|
|
139
|
-
buttonParams.type = '';
|
|
140
|
-
buttonParams.on_click = undefined;
|
|
127
|
+
buttonParams.onClick = undefined;
|
|
141
128
|
isInactive = true;
|
|
142
129
|
}
|
|
130
|
+
const stateIcons = {
|
|
131
|
+
info: InfoIcon,
|
|
132
|
+
error: ErrorIcon,
|
|
133
|
+
warn: WarnIcon
|
|
134
|
+
};
|
|
143
135
|
return React.createElement("li", _extends({}, itemParams, {
|
|
144
136
|
className: classnames('dnb-step-indicator__item', itemParams.className, isCurrent && 'dnb-step-indicator__item--current', isInactive && 'dnb-step-indicator__item--inactive', isVisited && 'dnb-step-indicator__item--visited')
|
|
145
|
-
}), React.createElement(
|
|
137
|
+
}), React.createElement("div", {
|
|
138
|
+
className: 'dnb-step-indicator__item__wrapper' + (!status && isVisited ? " dnb-step-indicator__item__wrapper--check" : "")
|
|
139
|
+
}, React.createElement("span", {
|
|
140
|
+
className: classnames('dnb-step-indicator__item__bullet', isCurrent ? 'dnb-step-indicator__item__bullet--current' : !status && (isVisited ? 'dnb-step-indicator__item__bullet--check' : 'dnb-step-indicator__item__bullet--empty'), createSkeletonClass('shape', skeleton))
|
|
141
|
+
}, status && !isCurrent ? React.createElement(Icon, {
|
|
142
|
+
icon: stateIcons[status_state] || stateIcons.warn,
|
|
143
|
+
className: "dnb-step-indicator__item__icon",
|
|
144
|
+
size: "medium",
|
|
145
|
+
inheritColor: false
|
|
146
|
+
}) : React.createElement(IconPrimary, {
|
|
147
|
+
icon: "check",
|
|
148
|
+
className: 'dnb-step-indicator__item__icon' + (!isVisited ? " dnb-step-indicator__item__icon--hidden" : ""),
|
|
149
|
+
size: "auto"
|
|
150
|
+
})), React.createElement("div", {
|
|
151
|
+
className: classnames('dnb-step-indicator__item-content', createSkeletonClass('font', skeleton))
|
|
152
|
+
}, !hide_numbers && React.createElement("span", {
|
|
153
|
+
className: "dnb-step-indicator__item-content__number"
|
|
154
|
+
}, `${currentItemNum + 1}.`), React.createElement("div", {
|
|
155
|
+
className: "dnb-step-indicator__item-content__wrapper"
|
|
156
|
+
}, React.createElement(StepItemButton, _extends({}, buttonParams, {
|
|
157
|
+
className: "dnb-step-indicator__item-content__text"
|
|
158
|
+
}), element), React.createElement(FormStatus, {
|
|
159
|
+
shellSpace: {
|
|
160
|
+
top: '1rem'
|
|
161
|
+
},
|
|
162
|
+
no_animation: no_animation,
|
|
163
|
+
state: status && status_state,
|
|
164
|
+
variant: "outlined",
|
|
165
|
+
className: "dnb-step-indicator__item-content__status",
|
|
166
|
+
text: status
|
|
167
|
+
})))), React.createElement("span", {
|
|
146
168
|
id: id,
|
|
147
169
|
"aria-hidden": true,
|
|
148
170
|
className: "dnb-sr-only"
|
|
@@ -153,51 +175,23 @@ export function StepItemButton(_ref2) {
|
|
|
153
175
|
children,
|
|
154
176
|
className,
|
|
155
177
|
status,
|
|
156
|
-
status_state,
|
|
157
|
-
|
|
178
|
+
status_state = 'warn',
|
|
179
|
+
innerRef
|
|
158
180
|
} = _ref2,
|
|
159
|
-
props = _objectWithoutProperties(_ref2,
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
className: "dnb-button__icon",
|
|
169
|
-
size: "medium",
|
|
170
|
-
inherit_color: false
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
return React.createElement(Button, _extends({
|
|
174
|
-
className: classnames(className, status && `dnb-step-indicator__button__status dnb-step-indicator__button__status--${status_state}`),
|
|
175
|
-
wrap: true,
|
|
176
|
-
stretch: true,
|
|
177
|
-
variant: "secondary",
|
|
178
|
-
icon_size: "medium",
|
|
179
|
-
icon_position: "right",
|
|
180
|
-
inner_ref: inner_ref
|
|
181
|
-
}, props), React.createElement(HeightAnimation, null, children));
|
|
181
|
+
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
182
|
+
const notClickable = !props.onClick;
|
|
183
|
+
return React.createElement(Anchor, _extends({
|
|
184
|
+
element: notClickable ? 'span' : 'button',
|
|
185
|
+
type: notClickable ? undefined : 'button',
|
|
186
|
+
className: classnames(className, 'dnb-step-indicator__button', status && `dnb-step-indicator__button--has-status dnb-step-indicator__button--${status_state}`),
|
|
187
|
+
noStyle: notClickable,
|
|
188
|
+
innerRef: innerRef
|
|
189
|
+
}, props), children);
|
|
182
190
|
}
|
|
183
191
|
export function StepItemWrapper({
|
|
184
|
-
children
|
|
185
|
-
number,
|
|
186
|
-
hide_numbers = stepIndicatorDefaultProps.hide_numbers,
|
|
187
|
-
status
|
|
192
|
+
children
|
|
188
193
|
}) {
|
|
189
|
-
return React.createElement(
|
|
190
|
-
className: "dnb-step-indicator__item-content"
|
|
191
|
-
}, !hide_numbers && React.createElement("span", {
|
|
192
|
-
"aria-hidden": true,
|
|
193
|
-
className: "dnb-step-indicator__item-content__number"
|
|
194
|
-
}, number, "."), React.createElement("span", {
|
|
195
|
-
className: "dnb-step-indicator__item-content__wrapper"
|
|
196
|
-
}, React.createElement("span", {
|
|
197
|
-
className: "dnb-step-indicator__item-content__text"
|
|
198
|
-
}, children), status && React.createElement("span", {
|
|
199
|
-
className: "dnb-step-indicator__item-content__status"
|
|
200
|
-
}, status)));
|
|
194
|
+
return React.createElement(React.Fragment, null, children);
|
|
201
195
|
}
|
|
202
196
|
export default StepIndicatorItem;
|
|
203
197
|
//# sourceMappingURL=StepIndicatorItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepIndicatorItem.js","names":["React","useCallback","useContext","useMemo","classnames","makeUniqueId","dispatchCustomElementEvent","HeightAnimation","Button","Icon","WarnIcon","InfoIcon","ErrorIcon","StepIndicatorContext","stepIndicatorDefaultProps","StepIndicatorItem","_ref","status_state","status_state_default","inactive","inactive_default","disabled","disabled_default","restOfProps","_objectWithoutProperties","_excluded","props","_objectSpread","context","onClickHandler","event","item","currentItemNum","params","current_step","currentStep","onClickItem","onClickGlobal","activeStep","setActiveStep","onChangeState","mode","filterAttributes","countSteps","listOfReachedSteps","hide_numbers","on_item_render","sidebar_id","step_title","title","is_current","status","on_render","on_click","attributes","_excluded2","Object","keys","forEach","key","includes","hasPassedAndIsCurrent","isNavigatable","isInactive","isVisited","id","ariaLabel","replace","String","isCurrent","element","createElement","StepItemWrapper","number","callbackProps","StepItem","itemParams","buttonParams","icon","onClick","type","undefined","_extends","className","StepItemButton","_ref2","children","inner_ref","_excluded3","icons","info","error","warn","size","inherit_color","wrap","stretch","variant","icon_size","icon_position"],"sources":["../../../../src/components/step-indicator/StepIndicatorItem.tsx"],"sourcesContent":["/**\n * Web StepIndicator Component\n *\n */\n\nimport React, { HTMLProps, useCallback, useContext, useMemo } from 'react'\n\nimport classnames from 'classnames'\nimport {\n makeUniqueId,\n dispatchCustomElementEvent,\n} from '../../shared/component-helper'\nimport HeightAnimation from '../height-animation/HeightAnimation'\nimport Button, { ButtonProps } from '../button/Button'\nimport Icon, { IconIcon } from '../icon/Icon'\nimport { WarnIcon, InfoIcon, ErrorIcon } from '../form-status/FormStatus'\nimport StepIndicatorContext from './StepIndicatorContext'\nimport { stepIndicatorDefaultProps } from './StepIndicatorProps'\nimport {\n StepIndicatorMouseEvent,\n StepIndicatorRenderCallback,\n} from './StepIndicator'\n\nexport type StepIndicatorStatusState = 'warn' | 'info' | 'error'\nexport type StepIndicatorItemProps = Omit<\n React.HTMLProps<HTMLElement>,\n 'title' | 'data'\n> & {\n title: string | React.ReactNode\n /**\n * If set to true, this item step will be set as the current current selected step. This can be used instead of `current_step` on the component itself.\n */\n is_current?: boolean\n /**\n * If set to true, this item step will be handled as an inactive step and will not be clickable.\n * Defaults to `false`\n */\n inactive?: boolean\n /**\n * If set to true, this item step will be visible as an disabled button and will not be clickable.\n * Defaults to false.\n */\n disabled?: boolean\n /**\n * Is used to set the status text.\n */\n status?: string | React.ReactNode\n /**\n * Used to set the status state to be either `info`, `error` or `warn`.\n * Defaults to `warn`.\n */\n status_state?: StepIndicatorStatusState\n /**\n * Callback function to manipulate or wrap the step item. Has to return a React Node. You receive an object `{ StepItem, element, attributes, props, context }`.\n */\n on_render?: ({\n StepItem,\n element,\n attributes,\n props,\n context,\n }: StepIndicatorRenderCallback) => React.ReactNode\n /**\n * Will be called once the user clicks on the current or another step. Will be emitted on every click. Returns an object `{ event, item, current_step }`.\n */\n on_click?: ({\n event,\n item,\n current_step,\n currentStep,\n }: StepIndicatorMouseEvent) => void\n currentItemNum: number\n}\n\nfunction StepIndicatorItem({\n status_state: status_state_default = 'warn',\n inactive: inactive_default = false,\n disabled: disabled_default = false,\n ...restOfProps\n}: StepIndicatorItemProps) {\n const props: StepIndicatorItemProps = useMemo(() => {\n return {\n status_state: status_state_default,\n inactive: inactive_default,\n disabled: disabled_default,\n ...restOfProps,\n }\n }, [\n disabled_default,\n inactive_default,\n restOfProps,\n status_state_default,\n ])\n\n const context = useContext(StepIndicatorContext)\n\n const onClickHandler = useCallback(\n ({ event, item, currentItemNum }) => {\n const params = {\n event,\n item,\n current_step: currentItemNum,\n currentStep: currentItemNum,\n }\n\n const onClickItem = dispatchCustomElementEvent(\n {\n context,\n props,\n onClickHandler,\n },\n 'on_click',\n params\n )\n\n const onClickGlobal = dispatchCustomElementEvent(\n context,\n 'on_click',\n params\n )\n\n if (onClickItem === false || onClickGlobal === false) {\n return // stop here\n }\n\n if (context.activeStep !== currentItemNum) {\n context.setActiveStep(currentItemNum)\n if (typeof context.onChangeState === 'function') {\n context.onChangeState()\n }\n\n dispatchCustomElementEvent(context, 'on_change', params)\n }\n },\n [context, props]\n )\n\n const {\n mode,\n filterAttributes,\n activeStep,\n countSteps,\n listOfReachedSteps,\n hide_numbers,\n on_item_render,\n sidebar_id,\n step_title,\n } = context\n\n const {\n currentItemNum,\n\n title,\n is_current, // eslint-disable-line\n inactive,\n disabled,\n status,\n status_state,\n\n on_render,\n on_click, // eslint-disable-line\n\n ...attributes\n } = props\n\n Object.keys(attributes).forEach((key) => {\n if (filterAttributes.includes(key)) {\n delete attributes[key]\n }\n })\n\n const hasPassedAndIsCurrent =\n mode === 'loose' ||\n currentItemNum <= activeStep ||\n listOfReachedSteps.includes(currentItemNum)\n\n const isNavigatable = mode === 'strict' || mode === 'loose'\n\n let isInactive =\n inactive || (mode === 'strict' && !hasPassedAndIsCurrent)\n\n const isVisited = currentItemNum < activeStep\n\n const id = `${sidebar_id || makeUniqueId()}-${currentItemNum}`\n const ariaLabel = step_title\n ?.replace('%step', String(currentItemNum + 1))\n .replace('%count', String(countSteps))\n\n const isCurrent = currentItemNum === activeStep\n\n let element = (\n <StepItemWrapper\n number={currentItemNum + 1}\n hide_numbers={hide_numbers}\n status={status}\n >\n {title}\n </StepItemWrapper>\n ) as React.ReactNode\n\n const callbackProps = {\n StepItem: StepItemWrapper,\n element,\n attributes,\n props,\n context,\n }\n\n if (typeof on_render === 'function') {\n element = on_render(callbackProps)\n } else if (typeof on_item_render === 'function') {\n element = on_item_render(callbackProps)\n }\n\n const itemParams = {} as HTMLProps<HTMLLIElement>\n const buttonParams = {\n icon: 'check',\n status,\n status_state,\n 'aria-describedby': id,\n } as StepItemButtonProps\n\n if (isCurrent) {\n itemParams['aria-current'] = 'step'\n }\n\n if (disabled) {\n buttonParams.disabled = true\n }\n\n if (isNavigatable && !isInactive) {\n buttonParams.onClick = ({ event }: never) =>\n onClickHandler({\n event,\n item: props,\n currentItemNum,\n })\n }\n\n if (!buttonParams.onClick) {\n buttonParams.element = 'span'\n buttonParams.type = ''\n buttonParams.on_click = undefined\n isInactive = true\n }\n\n return (\n <li\n {...itemParams}\n className={classnames(\n 'dnb-step-indicator__item',\n isCurrent && 'dnb-step-indicator__item--current',\n isInactive && 'dnb-step-indicator__item--inactive',\n isVisited && 'dnb-step-indicator__item--visited',\n itemParams.className\n )}\n >\n <StepItemButton {...buttonParams}>{element}</StepItemButton>\n <span id={id} aria-hidden className=\"dnb-sr-only\">\n {ariaLabel}\n </span>\n </li>\n )\n}\n\nexport type StepItemButtonProps = Omit<ButtonProps, 'status_state'> & {\n status_state?: StepIndicatorStatusState\n}\n\nexport function StepItemButton({\n children,\n className,\n status,\n status_state,\n inner_ref,\n ...props\n}: StepItemButtonProps) {\n const icons: Record<StepIndicatorStatusState, IconIcon> = {\n info: InfoIcon,\n error: ErrorIcon,\n warn: WarnIcon,\n }\n\n if (status) {\n props.icon = (\n <Icon\n icon={icons[status_state] || icons.warn}\n className=\"dnb-button__icon\"\n size=\"medium\"\n inherit_color={false}\n />\n )\n }\n\n return (\n <Button\n className={classnames(\n className,\n status && 'dnb-step-indicator__button__status',\n status && `dnb-step-indicator__button__status--${status_state}`\n )}\n wrap\n stretch\n variant=\"secondary\"\n icon_size=\"medium\"\n icon_position=\"right\"\n inner_ref={inner_ref}\n {...props}\n >\n <HeightAnimation>{children}</HeightAnimation>\n </Button>\n )\n}\n\nexport type StepItemWrapperProps = React.HTMLProps<HTMLElement> & {\n children?: React.ReactNode\n number?: number\n /**\n * Define whether to show automatically counted numbers or not. Defaults to `false`.\n */\n hide_numbers?: boolean\n status?: string | React.ReactNode\n}\n\nexport function StepItemWrapper({\n children,\n number,\n hide_numbers = stepIndicatorDefaultProps.hide_numbers,\n status,\n}: StepItemWrapperProps) {\n return (\n <span className=\"dnb-step-indicator__item-content\">\n {!hide_numbers && (\n <span\n aria-hidden // because we provide the hidden aria-describedby\n className=\"dnb-step-indicator__item-content__number\"\n >\n {number}.\n </span>\n )}\n <span className=\"dnb-step-indicator__item-content__wrapper\">\n <span className=\"dnb-step-indicator__item-content__text\">\n {children}\n </span>\n {status && (\n <span className=\"dnb-step-indicator__item-content__status\">\n {status}\n </span>\n )}\n </span>\n </span>\n )\n}\n\nexport default StepIndicatorItem\n"],"mappings":";;;;;;;;;;AAKA,OAAOA,KAAK,IAAeC,WAAW,EAAEC,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAE1E,OAAOC,UAAU,MAAM,YAAY;AACnC,SACEC,YAAY,EACZC,0BAA0B,QACrB,+BAA+B;AACtC,OAAOC,eAAe,MAAM,qCAAqC;AACjE,OAAOC,MAAM,MAAuB,kBAAkB;AACtD,OAAOC,IAAI,MAAoB,cAAc;AAC7C,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,2BAA2B;AACzE,OAAOC,oBAAoB,MAAM,wBAAwB;AACzD,SAASC,yBAAyB,QAAQ,sBAAsB;AAyDhE,SAASC,iBAAiBA,CAAAC,IAAA,EAKC;EAAA,IALA;MACzBC,YAAY,EAAEC,oBAAoB,GAAG,MAAM;MAC3CC,QAAQ,EAAEC,gBAAgB,GAAG,KAAK;MAClCC,QAA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+E,QAA0B,CACtC,CAAC;AAEb;AAYA,OAAO,SAASd,eAAeA,CAAC;EAC9Bc,QAAQ;EACRb,MAAM;EACN5B,YAAY,GAAG/B,yBAAyB,CAAC+B,YAAY;EACrDM;AACoB,CAAC,EAAE;EACvB,OACEnD,KAAA,CAAAuE,aAAA;IAAMY,SAAS,EAAC;EAAkC,GAC/C,CAACtC,YAAY,IACZ7C,KAAA,CAAAuE,aAAA;IACE,mBAAW;IACXY,SAAS,EAAC;EAA0C,GAEnDV,MAAM,EAAC,GACJ,CACP,EACDzE,KAAA,CAAAuE,aAAA;IAAMY,SAAS,EAAC;EAA2C,GACzDnF,KAAA,CAAAuE,aAAA;IAAMY,SAAS,EAAC;EAAwC,GACrDG,QACG,CAAC,EACNnC,MAAM,IACLnD,KAAA,CAAAuE,aAAA;IAAMY,SAAS,EAAC;EAA0C,GACvDhC,MACG,CAEJ,CACF,CAAC;AAEX;AAEA,eAAepC,iBAAiB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"StepIndicatorItem.js","names":["React","useCallback","useContext","useMemo","classnames","dispatchCustomElementEvent","useId","Anchor","Icon","IconPrimary","FormStatus","WarnIcon","InfoIcon","ErrorIcon","StepIndicatorContext","stepIndicatorDefaultProps","Context","createSkeletonClass","StepIndicatorItem","_ref","_globalContext$formEl3","status_state","status_state_default","inactive","inactive_default","disabled","disabled_default","restOfProps","_objectWithoutProperties","_excluded","globalContext","props","_globalContext$formEl","_globalContext$formEl2","_objectSpread","formElement","context","onClickHandler","event","item","currentItemNum","params","current_step","currentStep","onClickItem","onClickGlobal","activeStep","setActiveStep","mode","countSteps","listOfReachedSteps","hide_numbers","on_item_render","step_title","no_animation","skeleton","title","is_current","status","on_render","on_click","hasPassedAndIsCurrent","includes","isNavigatable","isInactive","isVisited","id","ariaLabel","replace","String","isCurrent","element","createElement","StepItemWrapper","callbackProps","StepItem","attributes","itemParams","buttonParams","onClick","undefined","stateIcons","info","error","warn","_extends","className","icon","size","inheritColor","StepItemButton","shellSpace","top","state","variant","text","_ref2","children","innerRef","_excluded2","notClickable","type","noStyle","Fragment"],"sources":["../../../../src/components/step-indicator/StepIndicatorItem.tsx"],"sourcesContent":["/**\n * Web StepIndicator Component\n *\n */\n\nimport React, { HTMLProps, useCallback, useContext, useMemo } from 'react'\n\nimport classnames from 'classnames'\nimport { dispatchCustomElementEvent } from '../../shared/component-helper'\nimport useId from '../../shared/helpers/useId'\nimport Anchor, { AnchorAllProps } from '../anchor/Anchor'\nimport Icon, { IconIcon } from '../icon/Icon'\nimport IconPrimary from '../icon/IconPrimary'\nimport FormStatus, {\n WarnIcon,\n InfoIcon,\n ErrorIcon,\n} from '../form-status/FormStatus'\nimport StepIndicatorContext from './StepIndicatorContext'\nimport { stepIndicatorDefaultProps } from './StepIndicatorProps'\nimport {\n StepIndicatorMouseEvent,\n StepIndicatorRenderCallback,\n} from './StepIndicator'\nimport Context from '../../shared/Context'\nimport { createSkeletonClass } from '../skeleton/SkeletonHelper'\n\nexport type StepIndicatorStatusState = 'warn' | 'info' | 'error'\nexport type StepIndicatorItemProps = Omit<\n React.HTMLProps<HTMLElement>,\n 'title' | 'data'\n> & {\n title: string | React.ReactNode\n /**\n * If set to true, this item step will be set as the current current selected step. This can be used instead of `current_step` on the component itself.\n */\n is_current?: boolean\n /**\n * If set to true, this item step will be handled as an inactive step and will not be clickable.\n * Defaults to `false`\n */\n inactive?: boolean\n /**\n * If set to true, this item step will not be clickable. Same as `inactive`, but will also add the `aria-disabled=\"true\"` .\n * Defaults to false.\n */\n disabled?: boolean\n /**\n * Is used to set the status text.\n */\n status?: string | React.ReactNode\n /**\n * Used to set the status state to be either `info`, `error` or `warn`.\n * Defaults to `warn`.\n */\n status_state?: StepIndicatorStatusState\n /**\n * Callback function to manipulate or wrap the step item. Has to return a React Node. You receive an object `{ StepItem, element, attributes, props, context }`.\n * @deprecated no longer does anything other than the `title` prop\n */\n on_render?: ({\n StepItem,\n element,\n attributes,\n props,\n context,\n }: StepIndicatorRenderCallback) => React.ReactNode\n /**\n * Will be called once the user clicks on the current or another step. Will be emitted on every click. Returns an object `{ event, item, current_step }`.\n */\n on_click?: ({\n event,\n item,\n current_step,\n currentStep,\n }: StepIndicatorMouseEvent) => void\n currentItemNum: number\n}\n\nfunction StepIndicatorItem({\n status_state: status_state_default = 'warn',\n inactive: inactive_default = false,\n disabled: disabled_default = false,\n ...restOfProps\n}: StepIndicatorItemProps) {\n const globalContext = React.useContext(Context)\n\n const props: StepIndicatorItemProps = useMemo(() => {\n return {\n status_state: status_state_default,\n inactive: inactive_default,\n disabled: globalContext?.formElement?.disabled ?? disabled_default,\n ...restOfProps,\n }\n }, [\n disabled_default,\n inactive_default,\n restOfProps,\n status_state_default,\n globalContext?.formElement?.disabled,\n ])\n\n const context = useContext(StepIndicatorContext)\n\n const onClickHandler = useCallback(\n ({ event, item, currentItemNum }) => {\n const params = {\n event,\n item,\n current_step: currentItemNum,\n currentStep: currentItemNum,\n }\n\n const onClickItem = dispatchCustomElementEvent(\n {\n context,\n props,\n onClickHandler,\n },\n 'on_click',\n params\n )\n\n const onClickGlobal = dispatchCustomElementEvent(\n context,\n 'on_click',\n params\n )\n\n if (onClickItem === false || onClickGlobal === false) {\n return // stop here\n }\n\n if (context.activeStep !== currentItemNum) {\n context.setActiveStep(currentItemNum)\n dispatchCustomElementEvent(context, 'on_change', params)\n }\n },\n [context, props]\n )\n\n const {\n mode,\n activeStep,\n countSteps,\n listOfReachedSteps,\n hide_numbers = stepIndicatorDefaultProps.hide_numbers,\n on_item_render,\n step_title,\n no_animation,\n skeleton,\n } = context\n\n const {\n currentItemNum,\n\n title,\n is_current, // eslint-disable-line\n inactive,\n disabled,\n status,\n status_state = 'warn',\n\n on_render,\n on_click, // eslint-disable-line\n } = props\n\n const hasPassedAndIsCurrent =\n mode === 'loose' ||\n currentItemNum <= activeStep ||\n listOfReachedSteps.includes(currentItemNum)\n\n const isNavigatable = mode === 'strict' || mode === 'loose'\n\n let isInactive =\n inactive || disabled || (mode === 'strict' && !hasPassedAndIsCurrent)\n\n const isVisited = currentItemNum < activeStep\n\n const id = `${useId()}-${currentItemNum}`\n const ariaLabel = step_title\n ?.replace('%step', String(currentItemNum + 1))\n .replace('%count', String(countSteps))\n\n const isCurrent = currentItemNum === activeStep\n\n let element = (\n <StepItemWrapper>{title}</StepItemWrapper>\n ) as React.ReactNode\n\n // should be entirely removed in v11 as well as any other functionality associated with `on_render` and `on_item_render`\n const callbackProps = {\n StepItem: StepItemWrapper,\n element,\n attributes: {}, // deprecated in v11\n props,\n context,\n }\n\n if (typeof on_render === 'function') {\n element = on_render(callbackProps)\n } else if (typeof on_item_render === 'function') {\n element = on_item_render(callbackProps)\n }\n\n const itemParams = {} as HTMLProps<HTMLLIElement>\n const buttonParams = {\n status,\n status_state,\n 'aria-describedby': id,\n } as StepItemButtonProps\n\n if (isCurrent) {\n itemParams['aria-current'] = 'step'\n }\n\n if (disabled) {\n buttonParams.disabled = true\n }\n\n if (isNavigatable && !isInactive) {\n buttonParams.onClick = (event: never) =>\n onClickHandler({\n event,\n item: props,\n currentItemNum,\n })\n }\n\n if (!buttonParams.onClick) {\n buttonParams.onClick = undefined\n isInactive = true\n }\n\n const stateIcons: Record<StepIndicatorStatusState, IconIcon> = {\n info: InfoIcon,\n error: ErrorIcon,\n warn: WarnIcon,\n }\n\n return (\n <li\n {...itemParams}\n className={classnames(\n 'dnb-step-indicator__item',\n isCurrent && 'dnb-step-indicator__item--current',\n isInactive && 'dnb-step-indicator__item--inactive',\n isVisited && 'dnb-step-indicator__item--visited',\n itemParams.className\n )}\n >\n <div\n className={classnames(\n 'dnb-step-indicator__item__wrapper',\n !status &&\n isVisited &&\n 'dnb-step-indicator__item__wrapper--check'\n )}\n >\n <span\n className={classnames(\n 'dnb-step-indicator__item__bullet',\n isCurrent\n ? 'dnb-step-indicator__item__bullet--current'\n : !status &&\n (isVisited\n ? 'dnb-step-indicator__item__bullet--check'\n : 'dnb-step-indicator__item__bullet--empty'),\n createSkeletonClass('shape', skeleton)\n )}\n >\n {status && !isCurrent ? (\n <Icon\n icon={stateIcons[status_state] || stateIcons.warn}\n className=\"dnb-step-indicator__item__icon\"\n size=\"medium\"\n inheritColor={false}\n />\n ) : (\n <IconPrimary\n icon=\"check\"\n className={classnames(\n 'dnb-step-indicator__item__icon',\n !isVisited && 'dnb-step-indicator__item__icon--hidden'\n )}\n size=\"auto\"\n />\n )}\n </span>\n <div\n className={classnames(\n 'dnb-step-indicator__item-content',\n createSkeletonClass('font', skeleton)\n )}\n >\n {!hide_numbers && (\n <span className=\"dnb-step-indicator__item-content__number\">\n {`${currentItemNum + 1}.`}\n </span>\n )}\n <div className=\"dnb-step-indicator__item-content__wrapper\">\n <StepItemButton\n {...buttonParams}\n className=\"dnb-step-indicator__item-content__text\"\n >\n {element}\n </StepItemButton>\n <FormStatus\n shellSpace={{ top: '1rem' }}\n no_animation={no_animation}\n state={status && status_state}\n variant=\"outlined\"\n className=\"dnb-step-indicator__item-content__status\"\n text={status}\n />\n </div>\n </div>\n </div>\n <span id={id} aria-hidden className=\"dnb-sr-only\">\n {ariaLabel}\n </span>\n </li>\n )\n}\n\nexport type StepItemButtonProps = AnchorAllProps &\n Pick<StepIndicatorItemProps, 'status' | 'status_state'>\n\nexport function StepItemButton({\n children,\n className,\n status,\n status_state = 'warn',\n innerRef,\n ...props\n}: StepItemButtonProps) {\n const notClickable = !props.onClick\n\n return (\n <Anchor\n element={notClickable ? 'span' : 'button'}\n type={notClickable ? undefined : 'button'}\n className={classnames(\n className,\n 'dnb-step-indicator__button',\n status &&\n `dnb-step-indicator__button--has-status dnb-step-indicator__button--${status_state}`\n )}\n noStyle={notClickable}\n innerRef={innerRef}\n {...props}\n >\n {children}\n </Anchor>\n )\n}\n\nexport type StepItemWrapperProps = React.HTMLProps<HTMLElement> & {\n /** Content inside the step button */\n children?: React.ReactNode\n /** @deprecated can only change the render of content inside the button */\n number?: number\n /** @deprecated can only hide numbers in main component */\n hide_numbers?: boolean\n /** @deprecated can only change the render of content inside the button */\n status?: string | React.ReactNode\n}\n\nexport function StepItemWrapper({ children }: StepItemWrapperProps) {\n return <>{children}</>\n}\n\nexport default StepIndicatorItem\n"],"mappings":";;;;;;;;;AAKA,OAAOA,KAAK,IAAeC,WAAW,EAAEC,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAE1E,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,0BAA0B,QAAQ,+BAA+B;AAC1E,OAAOC,KAAK,MAAM,4BAA4B;AAC9C,OAAOC,MAAM,MAA0B,kBAAkB;AACzD,OAAOC,IAAI,MAAoB,cAAc;AAC7C,OAAOC,WAAW,MAAM,qBAAqB;AAC7C,OAAOC,UAAU,IACfC,QAAQ,EACRC,QAAQ,EACRC,SAAS,QACJ,2BAA2B;AAClC,OAAOC,oBAAoB,MAAM,wBAAwB;AACzD,SAASC,yBAAyB,QAAQ,sBAAsB;AAKhE,OAAOC,OAAO,MAAM,sBAAsB;AAC1C,SAASC,mBAAmB,QAAQ,4BAA4B;AAsDhE,SAASC,iBAAiBA,CAAAC,IAAA,EAKC;EAAA,IAAAC,sBAAA;EAAA,IALA;MACzBC,YAAY,EAAEC,oBAAoB,GAAG,MAAM;MAC3CC,QAAQ,EAAEC,gBAAgB,GAAG,KAAK;MAClCC,QAAQ,EAAEC,gBAAgB,GAAG;IAEP,CAAC,GAAAP,IAAA;IADpBQ,WAAW,GAAAC,wBAAA,CAAAT,IAAA,EAAAU,SAAA;EAEd,MAAMC,aAAa,GAAG9B,KAAK,CAACE,UAAU,CAACc,OAAO,CAAC;EAE/C,MAAMe,KAA6B,GAAG5B,OAAO,CAAC,MAAM;IAAA,IAAA6B,qBAAA,EAAAC,sBAAA;IAClD,OAAAC,aAAA;MACEb,YAAY,EAAEC,oBAAoB;MAClCC,QAAQ,EAAEC,gBAAgB;MAC1BC,QAAQ,GAAAO,qBAAA,GAAEF,aAAa,aAAbA,aAAa,wBAAAG,sBAAA,GAAbH,aAAa,CAAEK,WAAW,cAAAF,sBA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C,QAAQ;MACRX,SAAS;MACT5B,MAAM;MACNrC,YAAY,GAAG,MAAM;MACrB6E;IAEmB,CAAC,GAAAF,KAAA;IADjBjE,KAAK,GAAAH,wBAAA,CAAAoE,KAAA,EAAAG,UAAA;EAER,MAAMC,YAAY,GAAG,CAACrE,KAAK,CAACgD,OAAO;EAEnC,OACE/E,KAAA,CAAAwE,aAAA,CAACjE,MAAM,EAAA8E,QAAA;IACLd,OAAO,EAAE6B,YAAY,GAAG,MAAM,GAAG,QAAS;IAC1CC,IAAI,EAAED,YAAY,GAAGpB,SAAS,GAAG,QAAS;IAC1CM,SAAS,EAAElF,UAAU,CACnBkF,SAAS,EACT,4BAA4B,EAC5B5B,MAAM,IACJ,sEAAsErC,YAAY,EACtF,CAAE;IACFiF,OAAO,EAAEF,YAAa;IACtBF,QAAQ,EAAEA;EAAS,GACfnE,KAAK,GAERkE,QACK,CAAC;AAEb;AAaA,OAAO,SAASxB,eAAeA,CAAC;EAAEwB;AAA+B,CAAC,EAAE;EAClE,OAAOjG,KAAA,CAAAwE,aAAA,CAAAxE,KAAA,CAAAuG,QAAA,QAAGN,QAAW,CAAC;AACxB;AAEA,eAAe/E,iBAAiB","ignoreList":[]}
|
|
@@ -1,48 +1,46 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
const _excluded = ["mode", "filterAttributes", "skeleton", "data", "countSteps", "sidebar_id"];
|
|
6
4
|
import React, { useContext } from 'react';
|
|
7
5
|
import classnames from 'classnames';
|
|
8
|
-
import
|
|
9
|
-
import { createSpacingClasses } from '../space/SpacingHelper';
|
|
6
|
+
import Space from '../space/Space';
|
|
10
7
|
import { skeletonDOMAttributes, createSkeletonClass } from '../skeleton/SkeletonHelper';
|
|
8
|
+
import HeightAnimation from '../height-animation/HeightAnimation';
|
|
11
9
|
import StepIndicatorItem from './StepIndicatorItem';
|
|
12
10
|
import StepIndicatorContext from './StepIndicatorContext';
|
|
13
11
|
function StepIndicatorList() {
|
|
14
|
-
const context = useContext(StepIndicatorContext);
|
|
15
12
|
const {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
28
|
-
const listParams = {
|
|
29
|
-
className: 'dnb-step-indicator__list'
|
|
30
|
-
};
|
|
31
|
-
const Element = mode === 'static' || !context.hasSidebar ? 'div' : 'nav';
|
|
32
|
-
const ariaLabelledbyValue = combineLabelledBy(rest, params.sidebar_id);
|
|
33
|
-
if (Element === 'nav') {
|
|
34
|
-
params['aria-labelledby'] = ariaLabelledbyValue;
|
|
35
|
-
} else {
|
|
36
|
-
listParams['aria-labelledby'] = ariaLabelledbyValue;
|
|
37
|
-
}
|
|
38
|
-
Object.keys(params).forEach(key => {
|
|
39
|
-
if (filterAttributes.includes(key)) {
|
|
40
|
-
delete params[key];
|
|
41
|
-
}
|
|
42
|
-
});
|
|
13
|
+
mode,
|
|
14
|
+
skeleton,
|
|
15
|
+
openState,
|
|
16
|
+
openHandler,
|
|
17
|
+
closeHandler,
|
|
18
|
+
countSteps,
|
|
19
|
+
data,
|
|
20
|
+
no_animation
|
|
21
|
+
} = useContext(StepIndicatorContext);
|
|
22
|
+
const Element = mode === 'static' ? 'div' : 'nav';
|
|
23
|
+
const params = {};
|
|
43
24
|
skeletonDOMAttributes(params, skeleton);
|
|
44
|
-
|
|
45
|
-
|
|
25
|
+
return React.createElement(HeightAnimation, {
|
|
26
|
+
animate: !no_animation,
|
|
27
|
+
open: openState,
|
|
28
|
+
onOpen: state => {
|
|
29
|
+
if (state) {
|
|
30
|
+
openHandler();
|
|
31
|
+
} else {
|
|
32
|
+
closeHandler();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}, React.createElement(Space, {
|
|
36
|
+
innerSpace: {
|
|
37
|
+
top: 'small'
|
|
38
|
+
}
|
|
39
|
+
}, React.createElement(Element, _extends({}, params, {
|
|
40
|
+
className: classnames('dnb-step-indicator', createSkeletonClass('font', skeleton))
|
|
41
|
+
}), countSteps > 0 && React.createElement("ol", {
|
|
42
|
+
className: "dnb-step-indicator__list"
|
|
43
|
+
}, data.map((itemData, i) => {
|
|
46
44
|
const item = typeof itemData === 'string' ? {
|
|
47
45
|
title: itemData
|
|
48
46
|
} : itemData;
|
|
@@ -50,7 +48,7 @@ function StepIndicatorList() {
|
|
|
50
48
|
key: i,
|
|
51
49
|
currentItemNum: i
|
|
52
50
|
}, item));
|
|
53
|
-
})));
|
|
51
|
+
})))));
|
|
54
52
|
}
|
|
55
53
|
export default StepIndicatorList;
|
|
56
54
|
//# sourceMappingURL=StepIndicatorList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepIndicatorList.js","names":["React","useContext","classnames","
|
|
1
|
+
{"version":3,"file":"StepIndicatorList.js","names":["React","useContext","classnames","Space","skeletonDOMAttributes","createSkeletonClass","HeightAnimation","StepIndicatorItem","StepIndicatorContext","StepIndicatorList","mode","skeleton","openState","openHandler","closeHandler","countSteps","data","no_animation","Element","params","createElement","animate","open","onOpen","state","innerSpace","top","_extends","className","map","itemData","i","item","title","key","currentItemNum"],"sources":["../../../../src/components/step-indicator/StepIndicatorList.tsx"],"sourcesContent":["/**\n * Web StepIndicator Component\n *\n */\n\nimport React, { useContext } from 'react'\nimport classnames from 'classnames'\nimport Space from '../space/Space'\nimport {\n skeletonDOMAttributes,\n createSkeletonClass,\n} from '../skeleton/SkeletonHelper'\nimport HeightAnimation from '../height-animation/HeightAnimation'\nimport StepIndicatorItem from './StepIndicatorItem'\nimport StepIndicatorContext from './StepIndicatorContext'\n\nfunction StepIndicatorList() {\n const {\n mode,\n skeleton,\n openState,\n openHandler,\n closeHandler,\n countSteps,\n data,\n no_animation,\n } = useContext(StepIndicatorContext)\n const Element = mode === 'static' ? 'div' : 'nav'\n\n const params = {}\n skeletonDOMAttributes(params, skeleton)\n return (\n <HeightAnimation\n animate={!no_animation}\n open={openState}\n onOpen={(state) => {\n if (state) {\n openHandler()\n } else {\n closeHandler()\n }\n }}\n >\n <Space innerSpace={{ top: 'small' }}>\n <Element\n {...params}\n className={classnames(\n 'dnb-step-indicator',\n createSkeletonClass('font', skeleton)\n )}\n >\n {countSteps > 0 && (\n <ol className=\"dnb-step-indicator__list\">\n {data.map((itemData, i) => {\n const item =\n typeof itemData === 'string'\n ? { title: itemData }\n : itemData\n\n return (\n <StepIndicatorItem\n key={i}\n currentItemNum={i}\n {...item}\n />\n )\n })}\n </ol>\n )}\n </Element>\n </Space>\n </HeightAnimation>\n )\n}\n\nexport default StepIndicatorList\n"],"mappings":";;;AAKA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,gBAAgB;AAClC,SACEC,qBAAqB,EACrBC,mBAAmB,QACd,4BAA4B;AACnC,OAAOC,eAAe,MAAM,qCAAqC;AACjE,OAAOC,iBAAiB,MAAM,qBAAqB;AACnD,OAAOC,oBAAoB,MAAM,wBAAwB;AAEzD,SAASC,iBAAiBA,CAAA,EAAG;EAC3B,MAAM;IACJC,IAAI;IACJC,QAAQ;IACRC,SAAS;IACTC,WAAW;IACXC,YAAY;IACZC,UAAU;IACVC,IAAI;IACJC;EACF,CAAC,GAAGhB,UAAU,CAACO,oBAAoB,CAAC;EACpC,MAAMU,OAAO,GAAGR,IAAI,KAAK,QAAQ,GAAG,KAAK,GAAG,KAAK;EAEjD,MAAMS,MAAM,GAAG,CAAC,CAAC;EACjBf,qBAAqB,CAACe,MAAM,EAAER,QAAQ,CAAC;EACvC,OACEX,KAAA,CAAAoB,aAAA,CAACd,eAAe;IACde,OAAO,EAAE,CAACJ,YAAa;IACvBK,IAAI,EAAEV,SAAU;IAChBW,MAAM,EAAGC,KAAK,IAAK;MACjB,IAAIA,KAAK,EAAE;QACTX,WAAW,CAAC,CAAC;MACf,CAAC,MAAM;QACLC,YAAY,CAAC,CAAC;MAChB;IACF;EAAE,GAEFd,KAAA,CAAAoB,aAAA,CAACjB,KAAK;IAACsB,UAAU,EAAE;MAAEC,GAAG,EAAE;IAAQ;EAAE,GAClC1B,KAAA,CAAAoB,aAAA,CAACF,OAAO,EAAAS,QAAA,KACFR,MAAM;IACVS,SAAS,EAAE1B,UAAU,CACnB,oBAAoB,EACpBG,mBAAmB,CAAC,MAAM,EAAEM,QAAQ,CACtC;EAAE,IAEDI,UAAU,GAAG,CAAC,IACbf,KAAA,CAAAoB,aAAA;IAAIQ,SAAS,EAAC;EAA0B,GACrCZ,IAAI,CAACa,GAAG,CAAC,CAACC,QAAQ,EAAEC,CAAC,KAAK;IACzB,MAAMC,IAAI,GACR,OAAOF,QAAQ,KAAK,QAAQ,GACxB;MAAEG,KAAK,EAAEH;IAAS,CAAC,GACnBA,QAAQ;IAEd,OACE9B,KAAA,CAAAoB,aAAA,CAACb,iBAAiB,EAAAoB,QAAA;MAChBO,GAAG,EAAEH,CAAE;MACPI,cAAc,EAAEJ;IAAE,GACdC,IAAI,CACT,CAAC;EAEN,CAAC,CACC,CAEC,CACJ,CACQ,CAAC;AAEtB;AAEA,eAAevB,iBAAiB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepIndicatorProps.js","names":["stepIndicatorDefaultProps","data","skeleton","current_step","hide_numbers","no_animation"],"sources":["../../../../src/components/step-indicator/StepIndicatorProps.ts"],"sourcesContent":["import { StepIndicatorData, StepIndicatorProps } from './StepIndicator'\n\nexport const stepIndicatorDefaultProps: Omit<\n StepIndicatorProps,\n 'sidebar_id' | 'mode'\n> = {\n data: [] as StepIndicatorData,\n skeleton: false,\n current_step: 0,\n hide_numbers: false,\n no_animation: false,\n}\n"],"mappings":"AAEA,OAAO,MAAMA,yBAGZ,GAAG;EACFC,IAAI,EAAE,EAAuB;EAC7BC,QAAQ,EAAE,KAAK;EACfC,YAAY,EAAE,CAAC;EACfC,YAAY,EAAE,KAAK;EACnBC,YAAY,EAAE;
|
|
1
|
+
{"version":3,"file":"StepIndicatorProps.js","names":["stepIndicatorDefaultProps","data","skeleton","current_step","hide_numbers","no_animation","expandedInitially"],"sources":["../../../../src/components/step-indicator/StepIndicatorProps.ts"],"sourcesContent":["import { StepIndicatorData, StepIndicatorProps } from './StepIndicator'\n\nexport const stepIndicatorDefaultProps: Omit<\n StepIndicatorProps,\n 'sidebar_id' | 'mode'\n> = {\n data: [] as StepIndicatorData,\n skeleton: false,\n current_step: 0,\n hide_numbers: false,\n no_animation: false,\n expandedInitially: false,\n}\n"],"mappings":"AAEA,OAAO,MAAMA,yBAGZ,GAAG;EACFC,IAAI,EAAE,EAAuB;EAC7BC,QAAQ,EAAE,KAAK;EACfC,YAAY,EAAE,CAAC;EACfC,YAAY,EAAE,KAAK;EACnBC,YAAY,EAAE,KAAK;EACnBC,iBAAiB,EAAE;AACrB,CAAC","ignoreList":[]}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Web StepIndicator Component
|
|
3
|
-
*
|
|
4
|
-
*/
|
|
5
1
|
import React from 'react';
|
|
6
2
|
import { SpacingProps } from '../../shared/types';
|
|
7
3
|
import { StepIndicatorData, StepIndicatorMode, StepIndicatorProps } from '../StepIndicator';
|
|
8
4
|
export type StepIndicatorSidebarProps = SpacingProps & Pick<StepIndicatorProps, 'current_step' | 'skeleton'> & Omit<React.HTMLProps<HTMLAnchorElement>, 'ref' | 'data'> & {
|
|
9
5
|
/**
|
|
10
6
|
* Defines the data/steps showing up in a JavaScript Array or JSON format like `[{title,is_current}]`. See parameters and the example above.
|
|
7
|
+
* @deprecated StepIndicator.Sidebar variant is no longer supported
|
|
11
8
|
*/
|
|
12
9
|
data?: StepIndicatorData;
|
|
13
10
|
/**
|
|
14
11
|
* Defines how the StepIndicator should work. Use `static` for non-interactive steps. Use `strict` for a chronological step order, also, the user can navigate between visited steps. Use `loose` if the user should be able to navigate freely.
|
|
12
|
+
* @deprecated StepIndicator.Sidebar variant is no longer supported
|
|
15
13
|
*/
|
|
16
14
|
mode?: StepIndicatorMode;
|
|
17
15
|
/**
|
|
18
16
|
* Stuff
|
|
17
|
+
* @deprecated StepIndicator.Sidebar variant is no longer supported
|
|
19
18
|
*/
|
|
20
19
|
showInitialData?: boolean;
|
|
21
20
|
/**
|
|
22
21
|
* <em>(required)</em> a unique string-based ID in order to bind together the main component and the sidebar (`<StepIndicator.Sidebar />`). Both have to get the same ID.
|
|
22
|
+
* @deprecated StepIndicator.Sidebar variant is no longer supported
|
|
23
23
|
*/
|
|
24
24
|
sidebar_id: string;
|
|
25
25
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated StepIndicatorSidebar variant is no longer supported
|
|
28
|
+
*/
|
|
29
|
+
declare function StepIndicatorSidebar(props: StepIndicatorSidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
30
30
|
export default StepIndicatorSidebar;
|
|
@@ -1,61 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const _excluded = ["current_step", "data"];
|
|
8
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
|
-
import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
11
|
-
import classnames from 'classnames';
|
|
12
|
-
import { extendPropsWithContext } from '../../shared/component-helper';
|
|
13
|
-
import Context from '../../shared/Context';
|
|
14
|
-
import StepIndicatorList from './StepIndicatorList';
|
|
15
|
-
import { stepIndicatorDefaultProps } from './StepIndicatorProps';
|
|
16
|
-
import { StepIndicatorProvider } from './StepIndicatorContext';
|
|
17
|
-
import { createSpacingClasses } from '../space/SpacingHelper';
|
|
18
|
-
function StepIndicatorSidebar(_ref) {
|
|
19
|
-
let {
|
|
20
|
-
current_step = stepIndicatorDefaultProps.current_step,
|
|
21
|
-
data = stepIndicatorDefaultProps.data
|
|
22
|
-
} = _ref,
|
|
23
|
-
restOfProps = _objectWithoutProperties(_ref, _excluded);
|
|
24
|
-
const props = useMemo(() => {
|
|
25
|
-
return _objectSpread({
|
|
26
|
-
current_step,
|
|
27
|
-
data
|
|
28
|
-
}, restOfProps);
|
|
29
|
-
}, [current_step, data, restOfProps]);
|
|
30
|
-
const context = useContext(Context);
|
|
31
|
-
const [showInitialData, setShowInitialData] = useState(true);
|
|
32
|
-
const hasSkeletonData = useRef(null);
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
if (!props.showInitialData) {
|
|
35
|
-
setShowInitialData(false);
|
|
36
|
-
}
|
|
37
|
-
}, [props.showInitialData]);
|
|
38
|
-
const getContextAndProps = useCallback(() => {
|
|
39
|
-
var _providerProps$data;
|
|
40
|
-
const providerProps = extendPropsWithContext(props, stepIndicatorDefaultProps, {
|
|
41
|
-
skeleton: context === null || context === void 0 ? void 0 : context.skeleton
|
|
42
|
-
}, context.getTranslation(context).StepIndicator, context === null || context === void 0 ? void 0 : context.StepIndicator);
|
|
43
|
-
if (!(((_providerProps$data = providerProps.data) === null || _providerProps$data === void 0 ? void 0 : _providerProps$data.length) > 0)) {
|
|
44
|
-
providerProps.data = ['Loading...'];
|
|
45
|
-
providerProps.skeleton = true;
|
|
46
|
-
hasSkeletonData.current = true;
|
|
47
|
-
}
|
|
48
|
-
return providerProps;
|
|
49
|
-
}, [context, props]);
|
|
50
|
-
const providerProps = showInitialData ? getContextAndProps() : null;
|
|
51
|
-
return React.createElement("div", {
|
|
52
|
-
id: 'sidebar__' + props.sidebar_id,
|
|
53
|
-
className: classnames("dnb-step-indicator-wrapper dnb-step-indicator__sidebar", createSpacingClasses(props), hasSkeletonData.current && (providerProps === null || providerProps === void 0 ? void 0 : providerProps.skeleton) && 'dnb-step-indicator__sidebar--ssr-skeleton')
|
|
54
|
-
}, providerProps && React.createElement(StepIndicatorProvider, _extends({
|
|
55
|
-
isSidebar: true,
|
|
56
|
-
sidebar_id: props.sidebar_id
|
|
57
|
-
}, providerProps), _StepIndicatorList || (_StepIndicatorList = React.createElement(StepIndicatorList, null))));
|
|
1
|
+
var _div;
|
|
2
|
+
import React from 'react';
|
|
3
|
+
function StepIndicatorSidebar(props) {
|
|
4
|
+
return _div || (_div = React.createElement("div", {
|
|
5
|
+
className: "dnb-step-indicator__sidebar"
|
|
6
|
+
}));
|
|
58
7
|
}
|
|
59
|
-
StepIndicatorSidebar._supportsSpacingProps = true;
|
|
60
8
|
export default StepIndicatorSidebar;
|
|
61
9
|
//# sourceMappingURL=StepIndicatorSidebar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepIndicatorSidebar.js","names":["React","
|
|
1
|
+
{"version":3,"file":"StepIndicatorSidebar.js","names":["React","StepIndicatorSidebar","props","_div","createElement","className"],"sources":["../../../../src/components/step-indicator/StepIndicatorSidebar.tsx"],"sourcesContent":["import React from 'react'\nimport { SpacingProps } from '../../shared/types'\nimport {\n StepIndicatorData,\n StepIndicatorMode,\n StepIndicatorProps,\n} from '../StepIndicator'\n\nexport type StepIndicatorSidebarProps = SpacingProps &\n Pick<StepIndicatorProps, 'current_step' | 'skeleton'> &\n Omit<React.HTMLProps<HTMLAnchorElement>, 'ref' | 'data'> & {\n /**\n * Defines the data/steps showing up in a JavaScript Array or JSON format like `[{title,is_current}]`. See parameters and the example above.\n * @deprecated StepIndicator.Sidebar variant is no longer supported\n */\n data?: StepIndicatorData\n /**\n * Defines how the StepIndicator should work. Use `static` for non-interactive steps. Use `strict` for a chronological step order, also, the user can navigate between visited steps. Use `loose` if the user should be able to navigate freely.\n * @deprecated StepIndicator.Sidebar variant is no longer supported\n */\n mode?: StepIndicatorMode\n /**\n * Stuff\n * @deprecated StepIndicator.Sidebar variant is no longer supported\n */\n showInitialData?: boolean\n /**\n * <em>(required)</em> a unique string-based ID in order to bind together the main component and the sidebar (`<StepIndicator.Sidebar />`). Both have to get the same ID.\n * @deprecated StepIndicator.Sidebar variant is no longer supported\n */\n sidebar_id: string\n }\n\n/**\n * @deprecated StepIndicatorSidebar variant is no longer supported\n */\nfunction StepIndicatorSidebar(props: StepIndicatorSidebarProps) {\n return <div className=\"dnb-step-indicator__sidebar\"></div>\n}\n\nexport default StepIndicatorSidebar\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AAoCzB,SAASC,oBAAoBA,CAACC,KAAgC,EAAE;EAC9D,OAAAC,IAAA,KAAAA,IAAA,GAAOH,KAAA,CAAAI,aAAA;IAAKC,SAAS,EAAC;EAA6B,CAAM,CAAC;AAC5D;AAEA,eAAeJ,oBAAoB","ignoreList":[]}
|