@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
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
"use client";
|
|
2
3
|
|
|
4
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.default = void 0;
|
|
7
|
-
var _react =
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
var _SpacingHelper = require("../space/SpacingHelper");
|
|
12
|
+
var _Card = _interopRequireDefault(require("../Card"));
|
|
13
|
+
var _StepIndicatorTriggerButton = _interopRequireDefault(require("./StepIndicatorTriggerButton"));
|
|
8
14
|
var _StepIndicatorSidebar = _interopRequireDefault(require("./StepIndicatorSidebar"));
|
|
9
|
-
var
|
|
10
|
-
var _StepIndicatorContext = require("./StepIndicatorContext");
|
|
15
|
+
var _StepIndicatorList2 = _interopRequireDefault(require("./StepIndicatorList"));
|
|
16
|
+
var _StepIndicatorContext = _interopRequireWildcard(require("./StepIndicatorContext"));
|
|
11
17
|
var _StepIndicatorProps = require("./StepIndicatorProps");
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
const _excluded = ["
|
|
18
|
+
var _FormStatus = _interopRequireDefault(require("../form-status/FormStatus"));
|
|
19
|
+
var _StepIndicatorTrigger, _StepIndicatorList;
|
|
20
|
+
const _excluded = ["sidebar_id", "step_title_extended"],
|
|
21
|
+
_excluded2 = ["status", "status_state", "data", "skeleton", "current_step", "hide_numbers", "no_animation", "expandedInitially"],
|
|
22
|
+
_excluded3 = ["outset"];
|
|
15
23
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
-
function
|
|
24
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
25
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
26
|
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; }
|
|
18
27
|
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; }
|
|
19
28
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -21,28 +30,64 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
21
30
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
22
31
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
23
32
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
33
|
+
function handleDeprecatedProps(props) {
|
|
34
|
+
const {
|
|
35
|
+
sidebar_id,
|
|
36
|
+
step_title_extended
|
|
37
|
+
} = props,
|
|
38
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
39
|
+
return rest;
|
|
40
|
+
}
|
|
24
41
|
function StepIndicator(_ref) {
|
|
25
42
|
let {
|
|
43
|
+
status,
|
|
44
|
+
status_state = 'warn',
|
|
26
45
|
data = _StepIndicatorProps.stepIndicatorDefaultProps.data,
|
|
27
46
|
skeleton = _StepIndicatorProps.stepIndicatorDefaultProps.skeleton,
|
|
28
47
|
current_step = _StepIndicatorProps.stepIndicatorDefaultProps.current_step,
|
|
29
48
|
hide_numbers = _StepIndicatorProps.stepIndicatorDefaultProps.hide_numbers,
|
|
30
|
-
no_animation = _StepIndicatorProps.stepIndicatorDefaultProps.no_animation
|
|
49
|
+
no_animation = _StepIndicatorProps.stepIndicatorDefaultProps.no_animation,
|
|
50
|
+
expandedInitially = _StepIndicatorProps.stepIndicatorDefaultProps.expandedInitially
|
|
31
51
|
} = _ref,
|
|
32
|
-
restOfProps = _objectWithoutProperties(_ref,
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
52
|
+
restOfProps = _objectWithoutProperties(_ref, _excluded2);
|
|
53
|
+
const _handleDeprecatedProp = handleDeprecatedProps(_objectSpread({
|
|
54
|
+
data,
|
|
55
|
+
skeleton,
|
|
56
|
+
current_step,
|
|
57
|
+
hide_numbers,
|
|
58
|
+
no_animation,
|
|
59
|
+
expandedInitially
|
|
60
|
+
}, restOfProps)),
|
|
61
|
+
{
|
|
62
|
+
outset
|
|
63
|
+
} = _handleDeprecatedProp,
|
|
64
|
+
props = _objectWithoutProperties(_handleDeprecatedProp, _excluded3);
|
|
65
|
+
return _react.default.createElement(_StepIndicatorContext.StepIndicatorProvider, props, _react.default.createElement("div", {
|
|
44
66
|
className: "dnb-step-indicator-wrapper"
|
|
45
|
-
}, _react.default.createElement(
|
|
67
|
+
}, _react.default.createElement(_Card.default, {
|
|
68
|
+
align: "stretch",
|
|
69
|
+
className: (0, _classnames.default)('dnb-step-indicator', (0, _SpacingHelper.createSpacingClasses)(restOfProps)),
|
|
70
|
+
outset: outset
|
|
71
|
+
}, _StepIndicatorTrigger || (_StepIndicatorTrigger = _react.default.createElement(_StepIndicatorTriggerButton.default, null)), _StepIndicatorList || (_StepIndicatorList = _react.default.createElement(_StepIndicatorList2.default, null))), _react.default.createElement(StepIndicatorStatus, {
|
|
72
|
+
status: status,
|
|
73
|
+
status_state: status_state
|
|
74
|
+
})));
|
|
75
|
+
}
|
|
76
|
+
function StepIndicatorStatus(_ref2) {
|
|
77
|
+
let {
|
|
78
|
+
status,
|
|
79
|
+
status_state
|
|
80
|
+
} = _ref2;
|
|
81
|
+
const {
|
|
82
|
+
openState,
|
|
83
|
+
no_animation
|
|
84
|
+
} = (0, _react.useContext)(_StepIndicatorContext.default);
|
|
85
|
+
const show = !openState && !!status;
|
|
86
|
+
return _react.default.createElement(_FormStatus.default, {
|
|
87
|
+
show: show,
|
|
88
|
+
no_animation: no_animation,
|
|
89
|
+
state: status && status_state
|
|
90
|
+
}, status);
|
|
46
91
|
}
|
|
47
92
|
StepIndicator.Sidebar = _StepIndicatorSidebar.default;
|
|
48
93
|
StepIndicator._supportsSpacingProps = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepIndicator.js","names":["_react","_interopRequireDefault","require","_StepIndicatorSidebar","_StepIndicatorModal","_StepIndicatorContext","_StepIndicatorProps","_useId","_div","_excluded","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","ownKeys","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","_objectSpread","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","_objectWithoutProperties","_objectWithoutPropertiesLoose","indexOf","propertyIsEnumerable","StepIndicator","_ref","data","stepIndicatorDefaultProps","skeleton","current_step","hide_numbers","no_animation","restOfProps","props","sidebarId","useId","sidebar_id","createElement","StepIndicatorProvider","className","Sidebar","StepIndicatorSidebar","_supportsSpacingProps","_default","exports"],"sources":["../../../../src/components/step-indicator/StepIndicator.tsx"],"sourcesContent":["/**\n * Web StepIndicator Component\n *\n */\n\nimport React from 'react'\n\nimport StepIndicatorSidebar from './StepIndicatorSidebar'\n\nimport StepIndicatorModal from './StepIndicatorModal'\nimport {\n StepIndicatorContextValues,\n StepIndicatorProvider,\n} from './StepIndicatorContext'\n\nimport type { SpacingProps } from '../../shared/types'\nimport type { SkeletonShow } from '../Skeleton'\nimport type {\n StepIndicatorItemProps,\n StepItemWrapper,\n} from './StepIndicatorItem'\nimport { stepIndicatorDefaultProps } from './StepIndicatorProps'\nimport useId from '../../shared/helpers/useId'\nimport { StepIndicatorTriggerButtonProps } from './StepIndicatorTriggerButton'\n\nexport type StepIndicatorMode = 'static' | 'strict' | 'loose'\nexport type StepIndicatorDataItem = Pick<\n StepIndicatorItemProps,\n | 'title'\n | 'is_current'\n | 'inactive'\n | 'disabled'\n | 'status'\n | 'status_state'\n | 'on_click'\n | 'on_render'\n>\nexport type StepIndicatorData = string | string[] | StepIndicatorDataItem[]\n\nexport type StepIndicatorMouseEvent = {\n event: React.MouseEvent<HTMLButtonElement>\n item: StepIndicatorItemProps\n currentStep: number\n current_step: number\n}\n\nexport type StepIndicatorRenderCallback = {\n StepItem: typeof StepItemWrapper\n element: React.ReactNode\n attributes: React.HTMLProps<HTMLElement>\n props: StepIndicatorItemProps\n context: StepIndicatorContextValues\n}\n\nexport type StepIndicatorProps = Omit<\n React.HTMLProps<HTMLAnchorElement>,\n 'ref' | 'data'\n> &\n SpacingProps & {\n /**\n * <em>(required with `<StepIndicator.Sidebar />`)</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 */\n sidebar_id?: string\n /**\n * <em>(required)</em> 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 */\n mode: StepIndicatorMode\n /**\n * <em>(required)</em> defines the data/steps showing up in a JavaScript Array or JSON format like `[{title,is_current}]`. See parameters and the example above.\n */\n data: StepIndicatorData\n /**\n * The title shown inside the `<StepIndicatorModal />` supplemental screen reader text for the `<StepIndicatorTriggerButton />`\n * Defaults to `Steps Overview`\n */\n overview_title?: string\n /**\n * The label for `<StepIndicatorTriggerButton />` and supplemental screen reader text for `<StepIndicatorItem />`\n * This value need to contain `%step` and `%count` if you want to display the current step and total amount of steps\n * `%step` is used to place the current step into the text\n * `%count` is used to place the step total into the text\n * Defaults to `Step %step of %count`\n */\n step_title?: string\n /**\n * A descriptive label used in `<StepIndicatorModal />`\n * This value need to contain `%step` and `%count` if you want to display the current step and total amount of steps\n * `%step` is used to place the current step into the text\n * `%count` is used to place the step total into the text\n * Defaults to `You are on step %step of %count`\n */\n step_title_extended?: string\n /**\n * Defines the active number marked step starting by 0. Defaults to `0`.\n */\n current_step?: number\n /**\n * Define whether to show automatically counted numbers or not. Defaults to `false`.\n */\n hide_numbers?: boolean\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, currentStep }`.\n */\n on_click?: ({\n event,\n item,\n current_step,\n currentStep,\n }: StepIndicatorMouseEvent) => void\n /**\n * Callback function to manipulate or wrap every item. Has to return a React Node. You receive an object you can use in your custom HOC `{ StepItem, element, attributes, props, context }`.\n */\n on_item_render?: ({\n StepItem,\n element,\n attributes,\n props,\n context,\n }: StepIndicatorRenderCallback) => React.ReactNode\n /**\n * Will be called once the user visits actively a new step. Will be emitted only once. Returns an object `{ event, item, current_step, currentStep }`.\n */\n on_change?: ({\n event,\n item,\n current_step,\n currentStep,\n }: StepIndicatorMouseEvent) => void\n\n /**\n * The props for the trigger button.\n * Used internally to pass the props such as a status to the trigger button.\n */\n triggerButtonProps?: StepIndicatorTriggerButtonProps\n\n /**\n * If set to `true`, the height animation on the step items and the drawer button will be omitted. Defaults to `false`.\n */\n no_animation?: boolean\n skeleton?: SkeletonShow\n className?: string\n children?: React.ReactNode\n }\n\nfunction StepIndicator({\n data = stepIndicatorDefaultProps.data,\n skeleton = stepIndicatorDefaultProps.skeleton,\n current_step = stepIndicatorDefaultProps.current_step,\n hide_numbers = stepIndicatorDefaultProps.hide_numbers,\n no_animation = stepIndicatorDefaultProps.no_animation,\n ...restOfProps\n}: StepIndicatorProps) {\n const props = {\n data,\n skeleton,\n current_step,\n hide_numbers,\n no_animation,\n ...restOfProps,\n }\n\n const sidebarId = useId(props.sidebar_id)\n\n return (\n <StepIndicatorProvider {...props} sidebar_id={sidebarId}>\n <div className=\"dnb-step-indicator-wrapper\">\n <StepIndicatorModal />\n </div>\n </StepIndicatorProvider>\n )\n}\n\nStepIndicator.Sidebar = StepIndicatorSidebar\n\nStepIndicator._supportsSpacingProps = true\n\nexport default StepIndicator\n"],"mappings":";;;;;;AAKA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,qBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,mBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AAWA,IAAAI,mBAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAN,sBAAA,CAAAC,OAAA;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AEF;EAAU,IAAAxD,IAAA,KAAAA,IAAA,GACtDR,MAAA,CAAAY,OAAA,CAAAuD,aAAA;IAAKE,SAAS,EAAC;EAA4B,GACzCrE,MAAA,CAAAY,OAAA,CAAAuD,aAAA,CAAC/D,mBAAA,CAAAQ,OAAkB,MAAE,CAClB,CAAC,CACe,CAAC;AAE5B;AAEA0C,aAAa,CAACgB,OAAO,GAAGC,6BAAoB;AAE5CjB,aAAa,CAACkB,qBAAqB,GAAG,IAAI;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAA9D,OAAA,GAE3B0C,aAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"StepIndicator.js","names":["_react","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_SpacingHelper","_Card","_StepIndicatorTriggerButton","_StepIndicatorSidebar","_StepIndicatorList2","_StepIndicatorContext","_StepIndicatorProps","_FormStatus","_StepIndicatorTrigger","_StepIndicatorList","_excluded","_excluded2","_excluded3","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","_objectWithoutProperties","_objectWithoutPropertiesLoose","indexOf","propertyIsEnumerable","handleDeprecatedProps","props","sidebar_id","step_title_extended","rest","StepIndicator","_ref","status","status_state","data","stepIndicatorDefaultProps","skeleton","current_step","hide_numbers","no_animation","expandedInitially","restOfProps","_handleDeprecatedProp","outset","createElement","StepIndicatorProvider","className","align","classnames","createSpacingClasses","StepIndicatorStatus","_ref2","openState","useContext","StepIndicatorContext","show","state","Sidebar","StepIndicatorSidebar","_supportsSpacingProps","_default","exports"],"sources":["../../../../src/components/step-indicator/StepIndicator.tsx"],"sourcesContent":["/**\n * Web StepIndicator Component\n *\n */\n\nimport React, { useContext } from 'react'\nimport classnames from 'classnames'\n\nimport { createSpacingClasses } from '../space/SpacingHelper'\nimport Card from '../Card'\nimport StepIndicatorTriggerButton from './StepIndicatorTriggerButton'\nimport StepIndicatorSidebar from './StepIndicatorSidebar'\nimport StepIndicatorList from './StepIndicatorList'\nimport StepIndicatorContext, {\n StepIndicatorContextValues,\n StepIndicatorProvider,\n} from './StepIndicatorContext'\n\nimport type { SpacingProps } from '../../shared/types'\nimport type { SkeletonShow } from '../Skeleton'\nimport type {\n StepIndicatorItemProps,\n StepItemWrapper,\n} from './StepIndicatorItem'\nimport { stepIndicatorDefaultProps } from './StepIndicatorProps'\nimport FormStatus, {\n FormStatusState,\n FormStatusText,\n} from '../form-status/FormStatus'\n\nexport type StepIndicatorMode = 'static' | 'strict' | 'loose'\nexport type StepIndicatorDataItem = Pick<\n StepIndicatorItemProps,\n | 'title'\n | 'is_current'\n | 'inactive'\n | 'disabled'\n | 'status'\n | 'status_state'\n | 'on_click'\n | 'on_render'\n>\nexport type StepIndicatorData = string | string[] | StepIndicatorDataItem[]\n\nexport type StepIndicatorMouseEvent = {\n event: React.MouseEvent<HTMLButtonElement>\n item: StepIndicatorItemProps\n currentStep: number\n current_step: number\n}\n\nexport type StepIndicatorRenderCallback = {\n /** A component that will render the item with the correct props. */\n StepItem: typeof StepItemWrapper\n /** Element that was originally going to be rendered */\n element: React.ReactNode\n /** @deprecated never has values */\n attributes: React.HTMLProps<HTMLElement>\n props: StepIndicatorItemProps\n context: StepIndicatorContextValues\n}\n\nexport type StepIndicatorProps = Omit<\n React.HTMLProps<HTMLAnchorElement>,\n 'ref' | 'data'\n> &\n SpacingProps & {\n /**\n * <em>(required with `<StepIndicator.Sidebar />`)</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 * <em>(required)</em> 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 */\n mode: StepIndicatorMode\n /**\n * <em>(required)</em> defines the data/steps showing up in a JavaScript Array or JSON format like `[{title,is_current}]`. See parameters and the example above.\n */\n data: StepIndicatorData\n /**\n * The title shown inside the `<StepIndicatorModal />` supplemental screen reader text for the `<StepIndicatorTriggerButton />`\n * Defaults to `Steps Overview`\n */\n overview_title?: string\n /**\n * The label for `<StepIndicatorTriggerButton />` and supplemental screen reader text for `<StepIndicatorItem />`\n * This value need to contain `%step` and `%count` if you want to display the current step and total amount of steps\n * `%step` is used to place the current step into the text\n * `%count` is used to place the step total into the text\n * Defaults to `Step %step of %count`\n */\n step_title?: string\n /**\n * A descriptive label used in `<StepIndicatorModal />`\n * This value need to contain `%step` and `%count` if you want to display the current step and total amount of steps\n * `%step` is used to place the current step into the text\n * `%count` is used to place the step total into the text\n * Defaults to `You are on step %step of %count`\n * @deprecated only `step_title`is used\n */\n step_title_extended?: string\n /**\n * Defines the active number marked step starting by 0. Defaults to `0`.\n */\n current_step?: number\n /**\n * Define whether to show automatically counted numbers or not. Defaults to `false`.\n */\n hide_numbers?: boolean\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, currentStep }`.\n */\n on_click?: ({\n event,\n item,\n current_step,\n currentStep,\n }: StepIndicatorMouseEvent) => void\n /**\n * Callback function to manipulate or wrap every item. Has to return a React Node. You receive an object you can use in your custom HOC `{ StepItem, element, attributes, props, context }`.\n * @deprecated no longer does anything other than the step item `title` prop\n */\n on_item_render?: ({\n StepItem,\n element,\n attributes,\n props,\n context,\n }: StepIndicatorRenderCallback) => React.ReactNode\n /**\n * Will be called once the user visits actively a new step. Will be emitted only once. Returns an object `{ event, item, current_step, currentStep }`.\n */\n on_change?: ({\n event,\n item,\n current_step,\n currentStep,\n }: StepIndicatorMouseEvent) => void\n /**\n * Status text. Status is only shown if this prop has text. Defaults to `undefined`\n */\n status?: FormStatusText\n /**\n * The type of status for the `status` prop. Is either `info`, `error` or `warn`.\n * Defaults to `warn`.\n */\n status_state?: FormStatusState\n /**\n * If set to `true`, the height animation on the step items and the drawer button will be omitted. Defaults to `false`.\n */\n no_animation?: boolean\n /**\n * Set to `true` to have the list be expanded initially. Defaults to `false`.\n */\n expandedInitially?: boolean\n /**\n * Whether or not to break out (using negative margins) on larger screens. Defaults to `false`.\n */\n outset?: boolean\n skeleton?: SkeletonShow\n className?: string\n children?: React.ReactNode\n }\n\nfunction handleDeprecatedProps(\n props: StepIndicatorProps\n): Omit<StepIndicatorProps, 'sidebar_id' | 'step_title_extended'> {\n const { sidebar_id, step_title_extended, ...rest } = props\n return rest\n}\n\nfunction StepIndicator({\n status,\n status_state = 'warn',\n data = stepIndicatorDefaultProps.data,\n skeleton = stepIndicatorDefaultProps.skeleton,\n current_step = stepIndicatorDefaultProps.current_step,\n hide_numbers = stepIndicatorDefaultProps.hide_numbers,\n no_animation = stepIndicatorDefaultProps.no_animation,\n expandedInitially = stepIndicatorDefaultProps.expandedInitially,\n ...restOfProps\n}: StepIndicatorProps) {\n const { outset, ...props } = handleDeprecatedProps({\n data,\n skeleton,\n current_step,\n hide_numbers,\n no_animation,\n expandedInitially,\n ...restOfProps,\n })\n\n return (\n <StepIndicatorProvider {...props}>\n <div className=\"dnb-step-indicator-wrapper\">\n <Card\n align=\"stretch\"\n className={classnames(\n 'dnb-step-indicator',\n createSpacingClasses(restOfProps)\n )}\n outset={outset}\n >\n <StepIndicatorTriggerButton />\n <StepIndicatorList />\n </Card>\n <StepIndicatorStatus status={status} status_state={status_state} />\n </div>\n </StepIndicatorProvider>\n )\n}\n\nfunction StepIndicatorStatus({ status, status_state }) {\n const { openState, no_animation } = useContext(StepIndicatorContext)\n const show = !openState && !!status\n return (\n <FormStatus\n show={show}\n no_animation={no_animation}\n state={status && status_state}\n >\n {status}\n </FormStatus>\n )\n}\n/**\n * @deprecated StepIndicator.Sidebar variant is no longer supported\n */\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I,CAAC,CAACpB,MAAM;EACnC,OACE1E,MAAA,CAAAoB,OAAA,CAAAkE,aAAA,CAAC1E,WAAA,CAAAQ,OAAU;IACT6E,IAAI,EAAEA,IAAK;IACXhB,YAAY,EAAEA,YAAa;IAC3BiB,KAAK,EAAExB,MAAM,IAAIC;EAAa,GAE7BD,MACS,CAAC;AAEjB;AAIAF,aAAa,CAAC2B,OAAO,GAAGC,6BAAoB;AAE5C5B,aAAa,CAAC6B,qBAAqB,GAAG,IAAI;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAnF,OAAA,GAE3BoD,aAAa","ignoreList":[]}
|
|
@@ -6,15 +6,10 @@ import React from 'react';
|
|
|
6
6
|
import { ContextProps } from '../../shared/Context';
|
|
7
7
|
import { StepIndicatorData, StepIndicatorMode, StepIndicatorProps } from './StepIndicator';
|
|
8
8
|
import { StepIndicatorItemProps } from './StepIndicatorItem';
|
|
9
|
-
import { StepIndicatorTriggerButtonProps } from './StepIndicatorTriggerButton';
|
|
10
9
|
export type StepIndicatorContextValues = StepIndicatorProviderProps & StepIndicatorProviderStates & ContextProps;
|
|
11
10
|
declare const StepIndicatorContext: React.Context<StepIndicatorContextValues>;
|
|
12
11
|
export default StepIndicatorContext;
|
|
13
|
-
export type StepIndicatorProviderProps = Omit<StepIndicatorProps, 'mode' | 'data'> & {
|
|
14
|
-
/**
|
|
15
|
-
* <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.
|
|
16
|
-
*/
|
|
17
|
-
sidebar_id: string;
|
|
12
|
+
export type StepIndicatorProviderProps = Omit<StepIndicatorProps, 'mode' | 'data' | 'sidebar_id' | 'step_title_extended'> & {
|
|
18
13
|
/**
|
|
19
14
|
* <em>(required)</em> defines the data/steps showing up in a JavaScript Array or JSON format like `[{title,is_current}]`. See parameters and the example above.
|
|
20
15
|
*/
|
|
@@ -24,24 +19,17 @@ export type StepIndicatorProviderProps = Omit<StepIndicatorProps, 'mode' | 'data
|
|
|
24
19
|
*/
|
|
25
20
|
mode?: StepIndicatorMode;
|
|
26
21
|
children: React.ReactNode;
|
|
27
|
-
isSidebar?: boolean;
|
|
28
|
-
triggerButtonProps?: StepIndicatorTriggerButtonProps;
|
|
29
22
|
};
|
|
30
23
|
export type StepIndicatorProviderStates = {
|
|
31
24
|
data: (string | StepIndicatorItemProps)[];
|
|
32
|
-
hasSidebar: boolean;
|
|
33
|
-
hideSidebar: boolean;
|
|
34
25
|
activeStep: number;
|
|
35
26
|
openState: boolean;
|
|
36
27
|
listOfReachedSteps: number[];
|
|
37
28
|
countSteps: number;
|
|
38
29
|
stepsLabel: string;
|
|
39
|
-
stepsLabelExtended: string;
|
|
40
30
|
filterAttributes: string[];
|
|
41
31
|
setActiveStep: React.Dispatch<React.SetStateAction<number>>;
|
|
42
|
-
sidebarIsVisible: boolean;
|
|
43
|
-
onChangeState: () => void;
|
|
44
32
|
openHandler: () => void;
|
|
45
33
|
closeHandler: () => void;
|
|
46
34
|
};
|
|
47
|
-
export declare function StepIndicatorProvider(
|
|
35
|
+
export declare function StepIndicatorProvider(props: StepIndicatorProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,45 +12,22 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _Context = _interopRequireDefault(require("../../shared/Context"));
|
|
13
13
|
var _StepIndicatorProps = require("./StepIndicatorProps");
|
|
14
14
|
var _componentHelper = require("../../shared/component-helper");
|
|
15
|
-
var _MediaQueryUtils = require("../../shared/MediaQueryUtils");
|
|
16
|
-
const _excluded = ["isSidebar"];
|
|
17
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
16
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
19
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
|
-
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; }
|
|
21
|
-
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; }
|
|
22
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
23
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
24
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
25
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
26
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
27
18
|
const filterAttributes = Object.keys(_StepIndicatorProps.stepIndicatorDefaultProps).filter(item => {
|
|
28
19
|
return !['class', 'className'].includes(item);
|
|
29
|
-
}).concat(['internalId', '
|
|
20
|
+
}).concat(['internalId', 'mainTitle', 'stepsLabel', 'listOfReachedSteps', 'setActiveStep', 'activeStep', 'countSteps', 'openState', 'openHandler', 'closeHandler', 'innerRef', 'hasSkeletonData', 'filterAttributes']);
|
|
30
21
|
const StepIndicatorContext = _react.default.createContext(null);
|
|
31
22
|
var _default = exports.default = StepIndicatorContext;
|
|
32
|
-
function StepIndicatorProvider(
|
|
33
|
-
let {
|
|
34
|
-
isSidebar = false
|
|
35
|
-
} = _ref,
|
|
36
|
-
restOfProps = _objectWithoutProperties(_ref, _excluded);
|
|
37
|
-
const props = (0, _react.useMemo)(() => {
|
|
38
|
-
return _objectSpread({
|
|
39
|
-
isSidebar
|
|
40
|
-
}, restOfProps);
|
|
41
|
-
}, [isSidebar, restOfProps]);
|
|
23
|
+
function StepIndicatorProvider(props) {
|
|
42
24
|
const data = (0, _react.useMemo)(() => {
|
|
43
25
|
if (typeof props.data === 'string') {
|
|
44
26
|
return props.data[0] === '[' ? JSON.parse(props.data) : [];
|
|
45
27
|
}
|
|
46
28
|
return props.data || [];
|
|
47
29
|
}, [props]);
|
|
48
|
-
const [
|
|
49
|
-
const [hideSidebar, setHideSidebar] = (0, _react.useState)(false);
|
|
50
|
-
const [openState, setOpenState] = (0, _react.useState)(false);
|
|
51
|
-
const onChangeState = (0, _react.useCallback)(() => {
|
|
52
|
-
setOpenState(false);
|
|
53
|
-
}, []);
|
|
30
|
+
const [openState, setOpenState] = (0, _react.useState)(props.expandedInitially);
|
|
54
31
|
const openHandler = (0, _react.useCallback)(() => {
|
|
55
32
|
setOpenState(true);
|
|
56
33
|
}, []);
|
|
@@ -73,7 +50,6 @@ function StepIndicatorProvider(_ref) {
|
|
|
73
50
|
forceUpdate();
|
|
74
51
|
}, []);
|
|
75
52
|
const listOfReachedSteps = (0, _react.useRef)([activeStepRef.current].filter(Boolean)).current;
|
|
76
|
-
const mediaQueryListener = (0, _react.useRef)(null);
|
|
77
53
|
const context = (0, _react.useContext)(_Context.default);
|
|
78
54
|
const updateStepTitle = (0, _react.useCallback)(title => {
|
|
79
55
|
return title === null || title === void 0 ? void 0 : title.replace('%step', String((activeStepRef.current || 0) + 1)).replace('%count', String((data === null || data === void 0 ? void 0 : data.length) || 1));
|
|
@@ -88,43 +64,20 @@ function StepIndicatorProvider(_ref) {
|
|
|
88
64
|
defaultProps: _StepIndicatorProps.stepIndicatorDefaultProps,
|
|
89
65
|
props
|
|
90
66
|
}, {
|
|
91
|
-
hasSidebar,
|
|
92
|
-
hideSidebar,
|
|
93
67
|
activeStep: activeStepRef.current,
|
|
94
68
|
openState,
|
|
95
69
|
listOfReachedSteps,
|
|
96
70
|
data,
|
|
97
71
|
countSteps,
|
|
98
|
-
stepsLabel: updateStepTitle(globalContext.step_title)
|
|
99
|
-
stepsLabelExtended: updateStepTitle(globalContext.step_title_extended)
|
|
72
|
+
stepsLabel: updateStepTitle(globalContext.step_title)
|
|
100
73
|
}, {
|
|
101
74
|
setActiveStep,
|
|
102
|
-
onChangeState,
|
|
103
75
|
openHandler,
|
|
104
76
|
closeHandler
|
|
105
77
|
});
|
|
106
|
-
value.sidebarIsVisible = value.hasSidebar && !value.hideSidebar;
|
|
107
78
|
return value;
|
|
108
|
-
}, [closeHandler, context, countSteps, data,
|
|
79
|
+
}, [closeHandler, context, countSteps, data, listOfReachedSteps, openHandler, openState, props, setActiveStep, updateStepTitle]);
|
|
109
80
|
const contextValue = makeContextValue();
|
|
110
|
-
(0, _react.useEffect)(() => {
|
|
111
|
-
var _document;
|
|
112
|
-
const container = (_document = document) === null || _document === void 0 ? void 0 : _document.getElementById('sidebar__' + props.sidebar_id);
|
|
113
|
-
setHasSidebar(Boolean(container));
|
|
114
|
-
mediaQueryListener.current = (0, _MediaQueryUtils.onMediaQueryChange)({
|
|
115
|
-
min: '0',
|
|
116
|
-
max: 'medium'
|
|
117
|
-
}, hideSidebar => {
|
|
118
|
-
setHideSidebar(hideSidebar);
|
|
119
|
-
}, {
|
|
120
|
-
runOnInit: true
|
|
121
|
-
});
|
|
122
|
-
return () => {
|
|
123
|
-
if (mediaQueryListener.current) {
|
|
124
|
-
mediaQueryListener.current();
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
}, [props.sidebar_id]);
|
|
128
81
|
(0, _react.useEffect)(() => {
|
|
129
82
|
const currentStepFromProps = getActiveStepFromProps();
|
|
130
83
|
if (currentStepFromProps !== activeStepRef.current) {
|
|
@@ -156,16 +109,16 @@ function extendSafe() {
|
|
|
156
109
|
}
|
|
157
110
|
objects.forEach(itm => {
|
|
158
111
|
if (itm.defaultProps && itm.props) {
|
|
159
|
-
itm = Object.entries(itm.props).reduce((acc,
|
|
160
|
-
let [k, v] =
|
|
112
|
+
itm = Object.entries(itm.props).reduce((acc, _ref) => {
|
|
113
|
+
let [k, v] = _ref;
|
|
161
114
|
if (itm.defaultProps[k] !== v) {
|
|
162
115
|
acc[k] = v;
|
|
163
116
|
}
|
|
164
117
|
return acc;
|
|
165
118
|
}, {});
|
|
166
119
|
}
|
|
167
|
-
Object.entries(itm).forEach(
|
|
168
|
-
let [k, v] =
|
|
120
|
+
Object.entries(itm).forEach(_ref2 => {
|
|
121
|
+
let [k, v] = _ref2;
|
|
169
122
|
if (!obj[k] || obj[k] && v) {
|
|
170
123
|
obj[k] = v;
|
|
171
124
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepIndicatorContext.js","names":["_react","_interopRequireWildcard","require","_Context","_interopRequireDefault","_StepIndicatorProps","_componentHelper","_MediaQueryUtils","_excluded","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","_objectWithoutProperties","_objectWithoutPropertiesLoose","indexOf","propertyIsEnumerable","filterAttributes","stepIndicatorDefaultProps","item","includes","concat","StepIndicatorContext","React","createContext","_default","exports","StepIndicatorProvider","_ref","isSidebar","restOfProps","props","useMemo","data","JSON","parse","hasSidebar","setHasSidebar","useState","hideSidebar","setHideSidebar","openState","setOpenState","onChangeState","useCallback","openHandler","closeHandler","getActiveStepFromProps","current_step","dataWithItems","itemWithCurrentStep","find","is_current","countSteps","activeStepRef","useRef","forceUpdate","useReducer","setActiveStep","step","current","listOfReachedSteps","Boolean","mediaQueryListener","context","useContext","Context","updateStepTitle","title","replace","makeContextValue","globalContext","extendPropsWithContext","skeleton","getTranslation","StepIndicator","extendSafe","defaultProps","activeStep","stepsLabel","step_title","stepsLabelExtended","step_title_extended","sidebarIsVisible","contextValue","useEffect","_document","container","document","getElementById","sidebar_id","onMediaQueryChange","min","max","runOnInit","currentStepFromProps","window","key","startsWith","createElement","Provider","children","obj","_len","objects","Array","_key","itm","entries","reduce","acc","_ref2","k","v","_ref3"],"sources":["../../../../src/components/step-indicator/StepIndicatorContext.tsx"],"sourcesContent":["/**\n * Web StepIndicator Context\n *\n */\n\nimport React, {\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useReducer,\n useRef,\n useState,\n} from 'react'\nimport Context, { ContextProps } from '../../shared/Context'\nimport { stepIndicatorDefaultProps } from './StepIndicatorProps'\nimport { extendPropsWithContext } from '../../shared/component-helper'\nimport { onMediaQueryChange } from '../../shared/MediaQueryUtils'\nimport {\n StepIndicatorData,\n StepIndicatorDataItem,\n StepIndicatorMode,\n StepIndicatorProps,\n} from './StepIndicator'\nimport { StepIndicatorItemProps } from './StepIndicatorItem'\nimport { StepIndicatorTriggerButtonProps } from './StepIndicatorTriggerButton'\n\n// We use this array to filter out unwanted properties\nconst filterAttributes = Object.keys(stepIndicatorDefaultProps)\n .filter((item) => {\n return !['class', 'className'].includes(item)\n })\n .concat([\n 'internalId',\n 'isSidebar',\n 'hasSidebar',\n 'hideSidebar',\n 'sidebarIsVisible',\n 'mainTitle',\n 'stepsLabel',\n 'stepsLabelExtended',\n 'listOfReachedSteps',\n 'setActiveStep',\n 'activeStep',\n 'countSteps',\n 'openState',\n 'onChangeState',\n 'openHandler',\n 'closeHandler',\n 'innerRef',\n 'hasSkeletonData',\n 'filterAttributes',\n 'onChangeState',\n ])\n\nexport type StepIndicatorContextValues = StepIndicatorProviderProps &\n StepIndicatorProviderStates &\n ContextProps\n\nconst StepIndicatorContext =\n React.createContext<StepIndicatorContextValues>(null)\n\nexport default StepIndicatorContext\n\nexport type StepIndicatorProviderProps = Omit<\n StepIndicatorProps,\n 'mode' | 'data'\n> & {\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 */\n sidebar_id: string\n /**\n * <em>(required)</em> defines the data/steps showing up in a JavaScript Array or JSON format like `[{title,is_current}]`. See parameters and the example above.\n */\n data?: StepIndicatorData\n /**\n * <em>(required)</em> 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 */\n mode?: StepIndicatorMode\n children: React.ReactNode\n isSidebar?: boolean\n triggerButtonProps?: StepIndicatorTriggerButtonProps\n}\n\nexport type StepIndicatorProviderStates = {\n data: (string | StepIndicatorItemProps)[]\n hasSidebar: boolean\n hideSidebar: boolean\n activeStep: number\n openState: boolean\n listOfReachedSteps: number[]\n countSteps: number\n stepsLabel: string\n stepsLabelExtended: string\n filterAttributes: string[]\n setActiveStep: React.Dispatch<React.SetStateAction<number>>\n sidebarIsVisible: boolean\n onChangeState: () => void\n openHandler: () => void\n closeHandler: () => void\n}\n\nexport function StepIndicatorProvider({\n isSidebar = false,\n ...restOfProps\n}: StepIndicatorProviderProps) {\n const props = useMemo(() => {\n return { isSidebar, ...restOfProps }\n }, [isSidebar, restOfProps])\n\n const data = useMemo(() => {\n if (typeof props.data === 'string') {\n return props.data[0] === '[' ? JSON.parse(props.data) : []\n }\n\n return props.data || []\n }, [props])\n\n const [hasSidebar, setHasSidebar] = useState<boolean>(true)\n const [hideSidebar, setHideSidebar] = useState<boolean>(false)\n const [openState, setOpenState] = useState<boolean>(false)\n\n const onChangeState = useCallback(() => {\n setOpenState(false)\n }, [])\n\n const openHandler = useCallback(() => {\n setOpenState(true)\n }, [])\n\n const closeHandler = useCallback(() => {\n setOpenState(false)\n }, [])\n\n const getActiveStepFromProps = useCallback(() => {\n if (typeof data[0] === 'string') {\n return props.current_step\n }\n\n const dataWithItems = data as StepIndicatorDataItem[]\n\n const itemWithCurrentStep = dataWithItems.find(\n (item) => item.is_current\n )\n // Is current on data item has precedence(?) over current_step prop\n return itemWithCurrentStep\n ? dataWithItems.indexOf(itemWithCurrentStep)\n : props.current_step\n }, [data, props.current_step])\n\n const countSteps = data.length\n const activeStepRef = useRef<number>(getActiveStepFromProps())\n const [, forceUpdate] = useReducer(() => ({}), {})\n const setActiveStep = useCallback((step: number) => {\n activeStepRef.current = step\n forceUpdate()\n }, [])\n const listOfReachedSteps = useRef(\n [activeStepRef.current].filter(Boolean)\n ).current\n const mediaQueryListener = useRef(null)\n const context = useContext(Context)\n\n const updateStepTitle = useCallback(\n (title: string) => {\n return title\n ?.replace('%step', String((activeStepRef.current || 0) + 1))\n .replace('%count', String(data?.length || 1))\n },\n [data?.length]\n )\n\n const makeContextValue = useCallback(() => {\n const globalContext = extendPropsWithContext(\n props,\n stepIndicatorDefaultProps,\n { skeleton: context?.skeleton },\n context.getTranslation(context).StepIndicator,\n context.StepIndicator\n )\n\n const value = extendSafe(\n { filterAttributes },\n globalContext,\n // Props\n {\n defaultProps: stepIndicatorDefaultProps,\n props,\n },\n // State\n {\n hasSidebar,\n hideSidebar,\n activeStep: activeStepRef.current,\n openState,\n listOfReachedSteps,\n data,\n countSteps,\n stepsLabel: updateStepTitle(globalContext.step_title),\n stepsLabelExtended: updateStepTitle(\n globalContext.step_title_extended\n ),\n },\n // Functions\n {\n setActiveStep,\n onChangeState,\n openHandler,\n closeHandler,\n }\n ) as StepIndicatorContextValues\n\n value.sidebarIsVisible = value.hasSidebar && !value.hideSidebar\n\n return value\n }, [\n closeHandler,\n context,\n countSteps,\n data,\n hasSidebar,\n hideSidebar,\n listOfReachedSteps,\n onChangeState,\n openHandler,\n openState,\n props,\n setActiveStep,\n updateStepTitle,\n ])\n\n const contextValue = makeContextValue() as StepIndicatorContextValues\n\n // Mount and dismount\n useEffect(() => {\n const container = document?.getElementById(\n 'sidebar__' + props.sidebar_id\n )\n\n setHasSidebar(Boolean(container))\n\n mediaQueryListener.current = onMediaQueryChange(\n {\n min: '0',\n max: 'medium',\n },\n (hideSidebar) => {\n setHideSidebar(hideSidebar)\n },\n { runOnInit: true }\n )\n\n return () => {\n if (mediaQueryListener.current) {\n mediaQueryListener.current()\n }\n }\n }, [props.sidebar_id])\n\n // Keeps the activeStep state updated with changes to the current_step and data props\n useEffect(() => {\n const currentStepFromProps = getActiveStepFromProps()\n\n if (currentStepFromProps !== activeStepRef.current) {\n setActiveStep(currentStepFromProps)\n }\n }, [props.current_step, data, getActiveStepFromProps, setActiveStep])\n\n // Keeps the listOfReachedSteps state up to date with the activeStep state\n const activeStep = activeStepRef.current\n useEffect(() => {\n if (!listOfReachedSteps.includes(activeStep)) {\n listOfReachedSteps.push(activeStep)\n }\n }, [activeStep, listOfReachedSteps])\n\n if (typeof window !== 'undefined' && window['IS_TEST']) {\n contextValue['no_animation'] = true\n }\n\n // Filter out unwanted HTML attributes\n Object.keys(contextValue).forEach((key) => {\n if (key.startsWith('_')) {\n delete contextValue[key]\n }\n })\n\n return (\n <StepIndicatorContext.Provider value={contextValue}>\n {props.children}\n </StepIndicatorContext.Provider>\n )\n}\n\n/**\n * Like \"Object.assign\" – but safe\n * A new falsy value will not be used, if it exists already\n *\n * @param {...object} objects\n * @returns object\n */\nfunction extendSafe(...objects): Record<string, unknown> {\n const obj = {}\n\n objects.forEach((itm) => {\n if (itm.defaultProps && itm.props) {\n itm = Object.entries(itm.props).reduce((acc, [k, v]) => {\n if (itm.defaultProps[k] !== v) {\n acc[k] = v\n }\n return acc\n }, {})\n }\n\n Object.entries(itm).forEach(([k, v]) => {\n if (!obj[k] || (obj[k] && v)) {\n obj[k] = v\n }\n })\n })\n\n return obj\n}\n"],"mappings":";;;;;;;;;;AAKA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AASA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AAAiE,MAAAM,SAAA;AAAA,SAAAJ,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,CAAA,QAAAM,CAAA,GAAAH,wBAAA,CAAAE,CAAA,OAAAC,CAAA,IAA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,YAAY,CAACmC,CAAC,CAAC,KAAKC,CAAC,EAAE;UAC7BH,GAAG,CAACE,CAAC,CAAC,GAAGC,CAAC;QACZ;QACA,OAAOH,GAAG;MACZ,CAAC,EAAE,CAAC,CAAC,CAAC;IACR;IAEAlI,MAAM,CAACgI,OAAO,CAACD,GAAG,CAAC,CAAC5G,OAAO,CAACmH,KAAA,IAAY;MAAA,IAAX,CAACF,CAAC,EAAEC,CAAC,CAAC,GAAAC,KAAA;MACjC,IAAI,CAACZ,GAAG,CAACU,CAAC,CAAC,IAAKV,GAAG,CAACU,CAAC,CAAC,IAAIC,CAAE,EAAE;QAC5BX,GAAG,CAACU,CAAC,CAAC,GAAGC,CAAC;MACZ;IACF,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAOX,GAAG;AACZ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"StepIndicatorContext.js","names":["_react","_interopRequireWildcard","require","_Context","_interopRequireDefault","_StepIndicatorProps","_componentHelper","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","filterAttributes","keys","stepIndicatorDefaultProps","filter","item","includes","concat","StepIndicatorContext","React","createContext","_default","exports","StepIndicatorProvider","props","data","useMemo","JSON","parse","openState","setOpenState","useState","expandedInitially","openHandler","useCallback","closeHandler","getActiveStepFromProps","current_step","dataWithItems","itemWithCurrentStep","find","is_current","indexOf","countSteps","length","activeStepRef","useRef","forceUpdate","useReducer","setActiveStep","step","current","listOfReachedSteps","Boolean","context","useContext","Context","updateStepTitle","title","replace","String","makeContextValue","globalContext","extendPropsWithContext","skeleton","getTranslation","StepIndicator","value","extendSafe","defaultProps","activeStep","stepsLabel","step_title","contextValue","useEffect","currentStepFromProps","push","window","forEach","key","startsWith","createElement","Provider","children","obj","_len","arguments","objects","Array","_key","itm","entries","reduce","acc","_ref","k","v","_ref2"],"sources":["../../../../src/components/step-indicator/StepIndicatorContext.tsx"],"sourcesContent":["/**\n * Web StepIndicator Context\n *\n */\n\nimport React, {\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useReducer,\n useRef,\n useState,\n} from 'react'\nimport Context, { ContextProps } from '../../shared/Context'\nimport { stepIndicatorDefaultProps } from './StepIndicatorProps'\nimport { extendPropsWithContext } from '../../shared/component-helper'\nimport {\n StepIndicatorData,\n StepIndicatorDataItem,\n StepIndicatorMode,\n StepIndicatorProps,\n} from './StepIndicator'\nimport { StepIndicatorItemProps } from './StepIndicatorItem'\n\n// We use this array to filter out unwanted properties\nconst filterAttributes = Object.keys(stepIndicatorDefaultProps)\n .filter((item) => {\n return !['class', 'className'].includes(item)\n })\n .concat([\n 'internalId',\n 'mainTitle',\n 'stepsLabel',\n 'listOfReachedSteps',\n 'setActiveStep',\n 'activeStep',\n 'countSteps',\n 'openState',\n 'openHandler',\n 'closeHandler',\n 'innerRef',\n 'hasSkeletonData',\n 'filterAttributes',\n ])\n\nexport type StepIndicatorContextValues = StepIndicatorProviderProps &\n StepIndicatorProviderStates &\n ContextProps\n\nconst StepIndicatorContext =\n React.createContext<StepIndicatorContextValues>(null)\n\nexport default StepIndicatorContext\n\nexport type StepIndicatorProviderProps = Omit<\n StepIndicatorProps,\n 'mode' | 'data' | 'sidebar_id' | 'step_title_extended'\n> & {\n /**\n * <em>(required)</em> defines the data/steps showing up in a JavaScript Array or JSON format like `[{title,is_current}]`. See parameters and the example above.\n */\n data?: StepIndicatorData\n /**\n * <em>(required)</em> 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 */\n mode?: StepIndicatorMode\n children: React.ReactNode\n}\n\nexport type StepIndicatorProviderStates = {\n data: (string | StepIndicatorItemProps)[]\n activeStep: number\n openState: boolean\n listOfReachedSteps: number[]\n countSteps: number\n stepsLabel: string\n filterAttributes: string[]\n setActiveStep: React.Dispatch<React.SetStateAction<number>>\n openHandler: () => void\n closeHandler: () => void\n}\n\nexport function StepIndicatorProvider(props: StepIndicatorProviderProps) {\n const data = useMemo(() => {\n if (typeof props.data === 'string') {\n return props.data[0] === '[' ? JSON.parse(props.data) : []\n }\n\n return props.data || []\n }, [props])\n\n const [openState, setOpenState] = useState<boolean>(\n props.expandedInitially\n )\n\n const openHandler = useCallback(() => {\n setOpenState(true)\n }, [])\n\n const closeHandler = useCallback(() => {\n setOpenState(false)\n }, [])\n\n const getActiveStepFromProps = useCallback(() => {\n if (typeof data[0] === 'string') {\n return props.current_step\n }\n\n const dataWithItems = data as StepIndicatorDataItem[]\n\n const itemWithCurrentStep = dataWithItems.find(\n (item) => item.is_current\n )\n // Is current on data item has precedence(?) over current_step prop\n return itemWithCurrentStep\n ? dataWithItems.indexOf(itemWithCurrentStep)\n : props.current_step\n }, [data, props.current_step])\n\n const countSteps = data.length\n const activeStepRef = useRef<number>(getActiveStepFromProps())\n const [, forceUpdate] = useReducer(() => ({}), {})\n const setActiveStep = useCallback((step: number) => {\n activeStepRef.current = step\n forceUpdate()\n }, [])\n const listOfReachedSteps = useRef(\n [activeStepRef.current].filter(Boolean)\n ).current\n const context = useContext(Context)\n\n const updateStepTitle = useCallback(\n (title: string) => {\n return title\n ?.replace('%step', String((activeStepRef.current || 0) + 1))\n .replace('%count', String(data?.length || 1))\n },\n [data?.length]\n )\n\n const makeContextValue = useCallback(() => {\n const globalContext = extendPropsWithContext(\n props,\n stepIndicatorDefaultProps,\n { skeleton: context?.skeleton },\n context.getTranslation(context).StepIndicator,\n context.StepIndicator\n )\n\n const value = extendSafe(\n { filterAttributes },\n globalContext,\n // Props\n {\n defaultProps: stepIndicatorDefaultProps,\n props,\n },\n // State\n {\n activeStep: activeStepRef.current,\n openState,\n listOfReachedSteps,\n data,\n countSteps,\n stepsLabel: updateStepTitle(globalContext.step_title),\n },\n // Functions\n {\n setActiveStep,\n openHandler,\n closeHandler,\n }\n ) as StepIndicatorContextValues\n\n return value\n }, [\n closeHandler,\n context,\n countSteps,\n data,\n listOfReachedSteps,\n openHandler,\n openState,\n props,\n setActiveStep,\n updateStepTitle,\n ])\n\n const contextValue = makeContextValue() as StepIndicatorContextValues\n\n // Keeps the activeStep state updated with changes to the current_step and data props\n useEffect(() => {\n const currentStepFromProps = getActiveStepFromProps()\n\n if (currentStepFromProps !== activeStepRef.current) {\n setActiveStep(currentStepFromProps)\n }\n }, [props.current_step, data, getActiveStepFromProps, setActiveStep])\n\n // Keeps the listOfReachedSteps state up to date with the activeStep state\n const activeStep = activeStepRef.current\n useEffect(() => {\n if (!listOfReachedSteps.includes(activeStep)) {\n listOfReachedSteps.push(activeStep)\n }\n }, [activeStep, listOfReachedSteps])\n\n if (typeof window !== 'undefined' && window['IS_TEST']) {\n contextValue['no_animation'] = true\n }\n\n // Filter out unwanted HTML attributes\n Object.keys(contextValue).forEach((key) => {\n if (key.startsWith('_')) {\n delete contextValue[key]\n }\n })\n\n return (\n <StepIndicatorContext.Provider value={contextValue}>\n {props.children}\n </StepIndicatorContext.Provider>\n )\n}\n\n/**\n * Like \"Object.assign\" – but safe\n * A new falsy value will not be used, if it exists already\n *\n * @param {...object} objects\n * @returns object\n */\nfunction extendSafe(...objects): Record<string, unknown> {\n const obj = {}\n\n objects.forEach((itm) => {\n if (itm.defaultProps && itm.props) {\n itm = Object.entries(itm.props).reduce((acc, [k, v]) => {\n if (itm.defaultProps[k] !== v) {\n acc[k] = v\n }\n return acc\n }, {})\n }\n\n Object.entries(itm).forEach(([k, v]) => {\n if (!obj[k] || (obj[k] && v)) {\n obj[k] = v\n }\n })\n })\n\n return obj\n}\n"],"mappings":";;;;;;;;;;AAKA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AASA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AAAsE,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAA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ACC,CAAC,EAAEC,CAAC,CAAC,GAAAF,IAAA;QACjD,IAAIJ,GAAG,CAACrB,YAAY,CAAC0B,CAAC,CAAC,KAAKC,CAAC,EAAE;UAC7BH,GAAG,CAACE,CAAC,CAAC,GAAGC,CAAC;QACZ;QACA,OAAOH,GAAG;MACZ,CAAC,EAAE,CAAC,CAAC,CAAC;IACR;IAEA1F,MAAM,CAACwF,OAAO,CAACD,GAAG,CAAC,CAACZ,OAAO,CAACmB,KAAA,IAAY;MAAA,IAAX,CAACF,CAAC,EAAEC,CAAC,CAAC,GAAAC,KAAA;MACjC,IAAI,CAACb,GAAG,CAACW,CAAC,CAAC,IAAKX,GAAG,CAACW,CAAC,CAAC,IAAIC,CAAE,EAAE;QAC5BZ,GAAG,CAACW,CAAC,CAAC,GAAGC,CAAC;MACZ;IACF,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAOZ,GAAG;AACZ","ignoreList":[]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PropertiesTableProps } from '../../shared/types';
|
|
2
|
+
export declare const StepIndicatorProperties: PropertiesTableProps;
|
|
3
|
+
export declare const StepIndicatorEvents: PropertiesTableProps;
|
|
4
|
+
export declare const StepIndicatorStepProperties: PropertiesTableProps;
|
|
5
|
+
export declare const StepIndicatorStepEvents: PropertiesTableProps;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StepIndicatorStepProperties = exports.StepIndicatorStepEvents = exports.StepIndicatorProperties = exports.StepIndicatorEvents = void 0;
|
|
7
|
+
const StepIndicatorProperties = exports.StepIndicatorProperties = {
|
|
8
|
+
mode: {
|
|
9
|
+
doc: '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.',
|
|
10
|
+
type: [`'static'`, `'strict'`, `'loose'`],
|
|
11
|
+
status: 'required'
|
|
12
|
+
},
|
|
13
|
+
data: {
|
|
14
|
+
doc: 'Defines the data/steps showing up in a JavaScript Array or JSON format like `[{title,is_current}]`. See below for properties of `STEP_DATA`.',
|
|
15
|
+
type: ['[Step Item](#step-item-properties)[]', 'string[]'],
|
|
16
|
+
status: 'required'
|
|
17
|
+
},
|
|
18
|
+
current_step: {
|
|
19
|
+
doc: 'Defines the initial step starting from 0. Also defines the furthest step visited when `mode="strict"`. Will update to the new step if changed (but will not trigger the `on_change` event). Defaults to `0`.',
|
|
20
|
+
type: 'number',
|
|
21
|
+
status: 'optional'
|
|
22
|
+
},
|
|
23
|
+
overview_title: {
|
|
24
|
+
doc: 'The title shown inside the `<StepIndicatorModal />` supplemental screen reader text for the `<StepIndicatorTriggerButton />`. Defaults to `Steps Overview`.',
|
|
25
|
+
type: 'string',
|
|
26
|
+
status: 'optional'
|
|
27
|
+
},
|
|
28
|
+
step_title: {
|
|
29
|
+
doc: 'Label for `<StepIndicatorTriggerButton />` and screen reader text for `<StepIndicatorItem />`. Must contain `%step` and `%count` to interpolate `current_step` and `stepCount` into the text. Defaults to `Step %step of %count`.',
|
|
30
|
+
type: 'string',
|
|
31
|
+
status: 'optional'
|
|
32
|
+
},
|
|
33
|
+
hide_numbers: {
|
|
34
|
+
doc: 'Define whether to show automatically counted numbers or not. Defaults to `false`.',
|
|
35
|
+
type: 'boolean',
|
|
36
|
+
status: 'optional'
|
|
37
|
+
},
|
|
38
|
+
no_animation: {
|
|
39
|
+
doc: 'If set to `true`, the height animation on step change and list expansion will be omitted. Defaults to `false`.',
|
|
40
|
+
type: 'boolean',
|
|
41
|
+
status: 'optional'
|
|
42
|
+
},
|
|
43
|
+
expandedInitially: {
|
|
44
|
+
doc: 'Set to `true` to have the list be expanded initially. Defaults to `false`.',
|
|
45
|
+
type: 'boolean',
|
|
46
|
+
status: 'optional'
|
|
47
|
+
},
|
|
48
|
+
outset: {
|
|
49
|
+
doc: 'Same as `outset` in [Card](/uilib/components/card/properties). Defaults to `false`',
|
|
50
|
+
type: 'boolean',
|
|
51
|
+
status: 'optional'
|
|
52
|
+
},
|
|
53
|
+
status: {
|
|
54
|
+
doc: 'Text for status shown below the step indicator when it is not expanded. Defaults to `undefined`',
|
|
55
|
+
type: 'string',
|
|
56
|
+
status: 'optional'
|
|
57
|
+
},
|
|
58
|
+
status_state: {
|
|
59
|
+
doc: 'The type of status shown when the `status` prop is set. Defaults to `warn`.',
|
|
60
|
+
type: `['warn', 'info', 'error']`,
|
|
61
|
+
status: 'optional'
|
|
62
|
+
},
|
|
63
|
+
skeleton: {
|
|
64
|
+
doc: 'If set to `true`, an overlaying skeleton with animation will be shown.',
|
|
65
|
+
type: 'boolean',
|
|
66
|
+
status: 'optional'
|
|
67
|
+
},
|
|
68
|
+
'[Space](/uilib/layout/space/properties)': {
|
|
69
|
+
doc: 'Spacing properties like `top` or `bottom` are supported.',
|
|
70
|
+
type: ['string', 'object'],
|
|
71
|
+
status: 'optional'
|
|
72
|
+
},
|
|
73
|
+
sidebar_id: {
|
|
74
|
+
doc: '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.',
|
|
75
|
+
type: 'string',
|
|
76
|
+
status: 'deprecated'
|
|
77
|
+
},
|
|
78
|
+
step_title_extended: {
|
|
79
|
+
doc: 'Descriptive label for `<StepIndicatorModal />`. Must contain `%step` and `%count` to interpolate `current_step` and `stepCount` into the text. Defaults to `You are on step %step of %count`.',
|
|
80
|
+
type: 'string',
|
|
81
|
+
status: 'deprecated'
|
|
82
|
+
},
|
|
83
|
+
on_item_render: {
|
|
84
|
+
doc: 'Deprecated, just use step item `title`. Callback function whose return is rendered inside each step instead of the default render. Has to return a React Node. Receives parameter `{ StepItem, element, attributes, props, context }`, where `props` also includes all props from the step object (like `title` or `status`) and the `<StepItem>` is a component that can be used to wrap your returned content.',
|
|
85
|
+
type: 'function',
|
|
86
|
+
status: 'deprecated'
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const StepIndicatorEvents = exports.StepIndicatorEvents = {
|
|
90
|
+
on_click: {
|
|
91
|
+
doc: 'Will be called when the user clicks on any clickable step in the list. Is called right before `on_change`. Receives parameter `{ event, item, current_step, currentStep }`',
|
|
92
|
+
type: 'function',
|
|
93
|
+
status: 'optional'
|
|
94
|
+
},
|
|
95
|
+
on_change: {
|
|
96
|
+
doc: 'Will be called when the user changes step by clicking in the steps list (changing the `current_step` prop does not trigger the event). Receives parameter `{ event, item, current_step, currentStep }`',
|
|
97
|
+
type: 'function',
|
|
98
|
+
status: 'optional'
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
const StepIndicatorStepProperties = exports.StepIndicatorStepProperties = {
|
|
102
|
+
title: {
|
|
103
|
+
doc: 'The title of the step.',
|
|
104
|
+
type: ['string', 'React.ReactNode'],
|
|
105
|
+
status: 'required'
|
|
106
|
+
},
|
|
107
|
+
is_current: {
|
|
108
|
+
doc: 'If set to `true`, this item step will be set as the current selected step. This can be used instead of `current_step` on the main component.',
|
|
109
|
+
type: 'boolean',
|
|
110
|
+
status: 'optional'
|
|
111
|
+
},
|
|
112
|
+
inactive: {
|
|
113
|
+
doc: 'If set to `true`, this item step will be handled as an inactive step and will not be clickable. Defaults to `false`.',
|
|
114
|
+
type: 'boolean',
|
|
115
|
+
status: 'optional'
|
|
116
|
+
},
|
|
117
|
+
disabled: {
|
|
118
|
+
doc: 'If set to `true`, this step will be handled the same as `inactive` as well as getting a disabled mouseover and `aria-disabled="true`. Defaults to `false`.',
|
|
119
|
+
type: 'boolean',
|
|
120
|
+
status: 'optional'
|
|
121
|
+
},
|
|
122
|
+
status: {
|
|
123
|
+
doc: 'Is used to set the status text.',
|
|
124
|
+
type: ['string', 'React.ReactNode'],
|
|
125
|
+
status: 'optional'
|
|
126
|
+
},
|
|
127
|
+
status_state: {
|
|
128
|
+
doc: 'In case the status state should be `info` or `error`. Defaults to `warn`.',
|
|
129
|
+
type: [`'warn'`, `'info'`, `'error'`],
|
|
130
|
+
status: 'optional'
|
|
131
|
+
},
|
|
132
|
+
on_render: {
|
|
133
|
+
doc: 'Deprecated, just use `title`. Callback function whose return is rendered inside the step instead of the default render (or `on_item_render`). Has to return a React Node. <br/> Receives parameter `{ StepItem, element, attributes, props, context }`, where `props` also includes all props in the step object (like `title` or `status`) and the `<StepItem>` is a component that can be used to wrap your returned content.',
|
|
134
|
+
type: 'function',
|
|
135
|
+
status: 'deprecated'
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
const StepIndicatorStepEvents = exports.StepIndicatorStepEvents = {
|
|
139
|
+
on_click: {
|
|
140
|
+
doc: "Called when user clicks the step. Is called right before the main component's `on_click`. Receives parameter `{ event, item, current_step, currentStep }`",
|
|
141
|
+
type: 'function',
|
|
142
|
+
status: 'optional'
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
//# sourceMappingURL=StepIndicatorDocs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepIndicatorDocs.js","names":["StepIndicatorProperties","exports","mode","doc","type","status","data","current_step","overview_title","step_title","hide_numbers","no_animation","expandedInitially","outset","status_state","skeleton","sidebar_id","step_title_extended","on_item_render","StepIndicatorEvents","on_click","on_change","StepIndicatorStepProperties","title","is_current","inactive","disabled","on_render","StepIndicatorStepEvents"],"sources":["../../../../src/components/step-indicator/StepIndicatorDocs.ts"],"sourcesContent":["import { PropertiesTableProps } from '../../shared/types'\n\nexport const StepIndicatorProperties: PropertiesTableProps = {\n mode: {\n doc: '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 type: [`'static'`, `'strict'`, `'loose'`],\n status: 'required',\n },\n data: {\n doc: 'Defines the data/steps showing up in a JavaScript Array or JSON format like `[{title,is_current}]`. See below for properties of `STEP_DATA`.',\n type: ['[Step Item](#step-item-properties)[]', 'string[]'],\n status: 'required',\n },\n current_step: {\n doc: 'Defines the initial step starting from 0. Also defines the furthest step visited when `mode=\"strict\"`. Will update to the new step if changed (but will not trigger the `on_change` event). Defaults to `0`.',\n type: 'number',\n status: 'optional',\n },\n overview_title: {\n doc: 'The title shown inside the `<StepIndicatorModal />` supplemental screen reader text for the `<StepIndicatorTriggerButton />`. Defaults to `Steps Overview`.',\n type: 'string',\n status: 'optional',\n },\n step_title: {\n doc: 'Label for `<StepIndicatorTriggerButton />` and screen reader text for `<StepIndicatorItem />`. Must contain `%step` and `%count` to interpolate `current_step` and `stepCount` into the text. Defaults to `Step %step of %count`.',\n type: 'string',\n status: 'optional',\n },\n hide_numbers: {\n doc: 'Define whether to show automatically counted numbers or not. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n no_animation: {\n doc: 'If set to `true`, the height animation on step change and list expansion will be omitted. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n expandedInitially: {\n doc: 'Set to `true` to have the list be expanded initially. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n outset: {\n doc: 'Same as `outset` in [Card](/uilib/components/card/properties). Defaults to `false`',\n type: 'boolean',\n status: 'optional',\n },\n status: {\n doc: 'Text for status shown below the step indicator when it is not expanded. Defaults to `undefined`',\n type: 'string',\n status: 'optional',\n },\n status_state: {\n doc: 'The type of status shown when the `status` prop is set. Defaults to `warn`.',\n type: `['warn', 'info', 'error']`,\n status: 'optional',\n },\n skeleton: {\n doc: 'If set to `true`, an overlaying skeleton with animation will be shown.',\n type: 'boolean',\n status: 'optional',\n },\n '[Space](/uilib/layout/space/properties)': {\n doc: 'Spacing properties like `top` or `bottom` are supported.',\n type: ['string', 'object'],\n status: 'optional',\n },\n sidebar_id: {\n doc: '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 type: 'string',\n status: 'deprecated',\n },\n step_title_extended: {\n doc: 'Descriptive label for `<StepIndicatorModal />`. Must contain `%step` and `%count` to interpolate `current_step` and `stepCount` into the text. Defaults to `You are on step %step of %count`.',\n type: 'string',\n status: 'deprecated',\n },\n on_item_render: {\n doc: 'Deprecated, just use step item `title`. Callback function whose return is rendered inside each step instead of the default render. Has to return a React Node. Receives parameter `{ StepItem, element, attributes, props, context }`, where `props` also includes all props from the step object (like `title` or `status`) and the `<StepItem>` is a component that can be used to wrap your returned content.',\n type: 'function',\n status: 'deprecated',\n },\n}\n\nexport const StepIndicatorEvents: PropertiesTableProps = {\n on_click: {\n doc: 'Will be called when the user clicks on any clickable step in the list. Is called right before `on_change`. Receives parameter `{ event, item, current_step, currentStep }`',\n type: 'function',\n status: 'optional',\n },\n on_change: {\n doc: 'Will be called when the user changes step by clicking in the steps list (changing the `current_step` prop does not trigger the event). Receives parameter `{ event, item, current_step, currentStep }`',\n type: 'function',\n status: 'optional',\n },\n}\n\nexport const StepIndicatorStepProperties: PropertiesTableProps = {\n title: {\n doc: 'The title of the step.',\n type: ['string', 'React.ReactNode'],\n status: 'required',\n },\n is_current: {\n doc: 'If set to `true`, this item step will be set as the current selected step. This can be used instead of `current_step` on the main component.',\n type: 'boolean',\n status: 'optional',\n },\n inactive: {\n doc: 'If set to `true`, this item step will be handled as an inactive step and will not be clickable. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n disabled: {\n doc: 'If set to `true`, this step will be handled the same as `inactive` as well as getting a disabled mouseover and `aria-disabled=\"true`. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n status: {\n doc: 'Is used to set the status text.',\n type: ['string', 'React.ReactNode'],\n status: 'optional',\n },\n status_state: {\n doc: 'In case the status state should be `info` or `error`. Defaults to `warn`.',\n type: [`'warn'`, `'info'`, `'error'`],\n status: 'optional',\n },\n on_render: {\n doc: 'Deprecated, just use `title`. Callback function whose return is rendered inside the step instead of the default render (or `on_item_render`). Has to return a React Node. <br/> Receives parameter `{ StepItem, element, attributes, props, context }`, where `props` also includes all props in the step object (like `title` or `status`) and the `<StepItem>` is a component that can be used to wrap your returned content.',\n type: 'function',\n status: 'deprecated',\n },\n}\n\nexport const StepIndicatorStepEvents: PropertiesTableProps = {\n on_click: {\n doc: \"Called when user clicks the step. Is called right before the main component's `on_click`. Receives parameter `{ event, item, current_step, currentStep }`\",\n type: 'function',\n status: 'optional',\n },\n}\n"],"mappings":";;;;;;AAEO,MAAMA,uBAA6C,GAAAC,OAAA,CAAAD,uBAAA,GAAG;EAC3DE,IAAI,EAAE;IACJC,GAAG,EAAE,+OAA+O;IACpPC,IAAI,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,SAAS,CAAC;IACzCC,MAAM,EAAE;EACV,CAAC;EACDC,IAAI,EAAE;IACJH,GAAG,EAAE,8IAA8I;IACnJC,IAAI,EAAE,CAAC,sCAAsC,EAAE,UAAU,CAAC;IAC1DC,MAAM,EAAE;EACV,CAAC;EACDE,YAAY,EAAE;IACZJ,GAAG,EAAE,8MAA8M;IACnNC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDG,cAAc,EAAE;IACdL,GAAG,EAAE,6JAA6J;IAClKC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDI,UAAU,EAAE;IACVN,GAAG,EAAE,mOAAmO;IACxOC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDK,YAAY,EAAE;IACZP,GAAG,EAAE,mFAAmF;IACxFC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDM,YAAY,EAAE;IACZR,GAAG,EAAE,gHAAgH;IACrHC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDO,iBAAiB,EAAE;IACjBT,GAAG,EAAE,4EAA4E;IACjFC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDQ,MAAM,EAAE;IACNV,GAAG,EAAE,oFAAoF;IACzFC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;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