@dnb/eufemia 9.16.0 → 9.17.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 +55 -0
- package/assets/assets/icons/above_the_line.svg +1 -1
- package/assets/assets/icons/eufemia-icons-pdf-categorized.tgz +0 -0
- package/assets/assets/icons/eufemia-icons-pdf.tgz +0 -0
- package/assets/assets/icons/facebook.svg +3 -0
- package/assets/assets/icons/facebook_medium.svg +3 -0
- package/assets/assets/icons/fridge.svg +1 -1
- package/assets/assets/icons/information_circled.svg +2 -1
- package/assets/assets/icons/information_circled_medium.svg +2 -1
- package/assets/assets/icons/instagram.svg +5 -0
- package/assets/assets/icons/instagram_medium.svg +12 -0
- package/assets/assets/icons/linkedin.svg +3 -0
- package/assets/assets/icons/linkedin_medium.svg +3 -0
- package/assets/assets/icons/motorcycle_medium.svg +2 -2
- package/assets/assets/icons/paragraph.svg +1 -1
- package/assets/assets/icons/scooter_medium.svg +2 -2
- package/assets/assets/icons/tag.svg +4 -0
- package/assets/assets/icons/tag_medium.svg +4 -0
- package/assets/icons/above_the_line.svg +1 -1
- package/assets/icons/eufemia-icons-pdf-categorized.tgz +0 -0
- package/assets/icons/eufemia-icons-pdf.tgz +0 -0
- package/assets/icons/facebook.svg +3 -0
- package/assets/icons/facebook_medium.svg +3 -0
- package/assets/icons/fridge.svg +1 -1
- package/assets/icons/information_circled.svg +2 -1
- package/assets/icons/information_circled_medium.svg +2 -1
- package/assets/icons/instagram.svg +5 -0
- package/assets/icons/instagram_medium.svg +12 -0
- package/assets/icons/linkedin.svg +3 -0
- package/assets/icons/linkedin_medium.svg +3 -0
- package/assets/icons/motorcycle_medium.svg +2 -2
- package/assets/icons/paragraph.svg +1 -1
- package/assets/icons/scooter_medium.svg +2 -2
- package/assets/icons/tag.svg +4 -0
- package/assets/icons/tag_medium.svg +4 -0
- package/cjs/components/accordion/Accordion.d.ts +1 -1
- package/cjs/components/autocomplete/style/dnb-autocomplete.css +6 -3
- package/cjs/components/autocomplete/style/dnb-autocomplete.min.css +1 -1
- package/cjs/components/breadcrumb/Breadcrumb.js +23 -22
- package/cjs/components/breadcrumb/BreadcrumbItem.js +6 -6
- package/cjs/components/breadcrumb/style/_breadcrumb.scss +7 -5
- package/cjs/components/breadcrumb/style/dnb-breadcrumb.css +10 -10
- package/cjs/components/breadcrumb/style/dnb-breadcrumb.min.css +1 -1
- package/cjs/components/button/Button.d.ts +0 -1
- package/cjs/components/button/Button.js +100 -144
- package/cjs/components/button/style/dnb-button.css +1 -1
- package/cjs/components/button/style/dnb-button.min.css +1 -1
- package/cjs/components/button/style/themes/dnb-button-theme-open-banking.css +6 -14
- package/cjs/components/button/style/themes/dnb-button-theme-open-banking.min.css +1 -1
- package/cjs/components/button/style/themes/dnb-button-theme-ui.css +6 -14
- package/cjs/components/button/style/themes/dnb-button-theme-ui.min.css +1 -1
- package/cjs/components/button/style/themes/dnb-button-theme-ui.scss +6 -18
- package/cjs/components/checkbox/style/dnb-checkbox.css +1 -1
- package/cjs/components/checkbox/style/dnb-checkbox.min.css +1 -1
- package/cjs/components/date-picker/style/dnb-date-picker.css +11 -8
- package/cjs/components/date-picker/style/dnb-date-picker.min.css +2 -2
- package/cjs/components/dropdown/style/dnb-dropdown.css +2 -2
- package/cjs/components/dropdown/style/dnb-dropdown.min.css +1 -1
- package/cjs/components/form-set/FormSet.d.ts +1 -1
- package/cjs/components/form-status/style/_form-status.scss +1 -1
- package/cjs/components/form-status/style/dnb-form-status.css +1 -1
- package/cjs/components/form-status/style/dnb-form-status.min.css +1 -1
- package/cjs/components/global-error/style/dnb-global-error.css +1 -1
- package/cjs/components/global-error/style/dnb-global-error.min.css +1 -1
- package/cjs/components/global-status/GlobalStatus.js +21 -73
- package/cjs/components/global-status/style/_global-status.scss +14 -15
- package/cjs/components/global-status/style/dnb-global-status.css +15 -19
- package/cjs/components/global-status/style/dnb-global-status.min.css +1 -1
- package/cjs/components/global-status/style/themes/dnb-global-status-theme-ui.css +2 -48
- package/cjs/components/global-status/style/themes/dnb-global-status-theme-ui.min.css +1 -1
- package/cjs/components/global-status/style/themes/dnb-global-status-theme-ui.scss +2 -36
- package/cjs/components/help-button/HelpButton.js +2 -2
- package/cjs/components/input/style/_input.scss +5 -1
- package/cjs/components/input/style/dnb-input.css +5 -2
- package/cjs/components/input/style/dnb-input.min.css +2 -2
- package/cjs/components/input/style/themes/dnb-input-theme-ui.css +11 -2
- package/cjs/components/input/style/themes/dnb-input-theme-ui.min.css +1 -1
- package/cjs/components/input/style/themes/dnb-input-theme-ui.scss +4 -1
- package/cjs/components/input-masked/InputMasked.d.ts +2 -2
- package/cjs/components/input-masked/InputMaskedElement.js +2 -7
- package/cjs/components/input-masked/InputMaskedHooks.js +79 -36
- package/cjs/components/input-masked/InputMaskedUtils.js +34 -18
- package/cjs/components/input-masked/TextMask.js +1 -1
- package/cjs/components/input-masked/style/_input-masked.scss +1 -3
- package/cjs/components/input-masked/style/dnb-input-masked.css +6 -3
- package/cjs/components/input-masked/style/dnb-input-masked.min.css +2 -2
- package/cjs/components/modal/Modal.js +1 -1
- package/cjs/components/modal/ModalContent.js +44 -28
- package/cjs/components/modal/style/_modal-mixins.scss +4 -4
- package/cjs/components/modal/style/_modal.scss +14 -31
- package/cjs/components/modal/style/dnb-modal.css +29 -47
- package/cjs/components/modal/style/dnb-modal.min.css +1 -1
- package/cjs/components/number-format/NumberUtils.d.ts +2 -2
- package/cjs/components/pagination/Pagination.d.ts +6 -0
- package/cjs/components/pagination/Pagination.js +2 -0
- package/cjs/components/pagination/PaginationBar.js +1 -1
- package/cjs/components/pagination/PaginationInfinity.js +152 -89
- package/cjs/components/pagination/PaginationProvider.js +65 -68
- package/cjs/components/pagination/style/dnb-pagination.css +1 -1
- package/cjs/components/pagination/style/dnb-pagination.min.css +1 -1
- package/cjs/components/radio/style/dnb-radio.css +1 -1
- package/cjs/components/radio/style/dnb-radio.min.css +1 -1
- package/cjs/components/section/style/themes/dnb-section-theme-ui.css +79 -21
- package/cjs/components/section/style/themes/dnb-section-theme-ui.min.css +1 -1
- package/cjs/components/section/style/themes/dnb-section-theme-ui.scss +16 -3
- package/cjs/components/slider/style/dnb-slider.css +2 -2
- package/cjs/components/slider/style/dnb-slider.min.css +1 -1
- package/cjs/components/step-indicator/StepIndicator.d.ts +1 -1
- package/cjs/components/step-indicator/StepIndicator.js +4 -98
- package/cjs/components/step-indicator/StepIndicatorContext.d.ts +1 -0
- package/cjs/components/step-indicator/StepIndicatorContext.js +221 -19
- package/cjs/components/step-indicator/StepIndicatorItem.js +3 -6
- package/cjs/components/step-indicator/StepIndicatorModal.js +40 -49
- package/cjs/components/step-indicator/StepIndicatorProps.js +1 -1
- package/cjs/components/step-indicator/StepIndicatorSidebar.d.ts +39 -0
- package/cjs/components/step-indicator/StepIndicatorSidebar.js +57 -54
- package/cjs/components/step-indicator/StepIndicatorTriggerButton.js +3 -3
- package/cjs/components/step-indicator/style/_step-indicator.scss +25 -4
- package/cjs/components/step-indicator/style/dnb-step-indicator.css +21 -6
- package/cjs/components/step-indicator/style/dnb-step-indicator.min.css +1 -1
- package/cjs/components/switch/style/dnb-switch.css +1 -1
- package/cjs/components/switch/style/dnb-switch.min.css +1 -1
- package/cjs/components/tabs/style/_tabs.scss +5 -1
- package/cjs/components/tabs/style/dnb-tabs.css +4 -1
- package/cjs/components/tabs/style/dnb-tabs.min.css +1 -1
- package/cjs/components/tabs/style/themes/dnb-tabs-theme-ui.css +37 -34
- package/cjs/components/tabs/style/themes/dnb-tabs-theme-ui.min.css +1 -1
- package/cjs/components/tabs/style/themes/dnb-tabs-theme-ui.scss +12 -9
- package/cjs/components/textarea/style/_textarea.scss +4 -0
- package/cjs/components/textarea/style/dnb-textarea.css +4 -1
- package/cjs/components/textarea/style/dnb-textarea.min.css +1 -1
- package/cjs/components/toggle-button/ToggleButton.js +6 -2
- package/cjs/components/toggle-button/style/dnb-toggle-button.css +4 -4
- package/cjs/components/toggle-button/style/dnb-toggle-button.min.css +1 -1
- package/cjs/icons/above_the_line.js +1 -1
- package/cjs/icons/facebook.js +35 -0
- package/cjs/icons/facebook_medium.js +35 -0
- package/cjs/icons/fridge.js +1 -1
- package/cjs/icons/icons-meta.json +24 -0
- package/cjs/icons/icons-pdf.lock +1 -1
- package/cjs/icons/icons-svg.lock +1 -1
- package/cjs/icons/index.d.ts +16 -0
- package/cjs/icons/index.js +64 -0
- package/cjs/icons/information_circled.js +11 -4
- package/cjs/icons/information_circled_medium.js +10 -4
- package/cjs/icons/instagram.js +47 -0
- package/cjs/icons/instagram_medium.js +54 -0
- package/cjs/icons/linkedin.js +32 -0
- package/cjs/icons/linkedin_medium.js +32 -0
- package/cjs/icons/motorcycle_medium.js +2 -2
- package/cjs/icons/paragraph.js +1 -1
- package/cjs/icons/scooter_medium.js +2 -2
- package/cjs/icons/secondary_icons.js +32 -0
- package/cjs/icons/secondary_icons_medium.js +32 -0
- package/cjs/icons/tag.js +41 -0
- package/cjs/icons/tag_medium.js +41 -0
- package/cjs/shared/EventEmitter.js +6 -8
- package/cjs/shared/component-helper.js +108 -74
- package/cjs/shared/helpers.js +55 -19
- package/cjs/style/dnb-ui-components.css +85 -83
- package/cjs/style/dnb-ui-components.min.css +5 -5
- package/cjs/style/themes/theme-open-banking/dnb-theme-open-banking.css +141 -133
- package/cjs/style/themes/theme-open-banking/dnb-theme-open-banking.min.css +4 -4
- package/cjs/style/themes/theme-ui/dnb-theme-ui.css +135 -119
- package/cjs/style/themes/theme-ui/dnb-theme-ui.min.css +4 -4
- package/components/accordion/Accordion.d.ts +1 -1
- package/components/autocomplete/style/dnb-autocomplete.css +6 -3
- package/components/autocomplete/style/dnb-autocomplete.min.css +1 -1
- package/components/breadcrumb/Breadcrumb.js +9 -7
- package/components/breadcrumb/Breadcrumb.tsx +20 -5
- package/components/breadcrumb/BreadcrumbItem.js +4 -4
- package/components/breadcrumb/BreadcrumbItem.tsx +12 -5
- package/components/breadcrumb/style/_breadcrumb.scss +7 -5
- package/components/breadcrumb/style/dnb-breadcrumb.css +10 -10
- package/components/breadcrumb/style/dnb-breadcrumb.min.css +1 -1
- package/components/button/Button.d.ts +0 -1
- package/components/button/Button.js +95 -135
- package/components/button/style/dnb-button.css +1 -1
- package/components/button/style/dnb-button.min.css +1 -1
- package/components/button/style/themes/dnb-button-theme-open-banking.css +6 -14
- package/components/button/style/themes/dnb-button-theme-open-banking.min.css +1 -1
- package/components/button/style/themes/dnb-button-theme-ui.css +6 -14
- package/components/button/style/themes/dnb-button-theme-ui.min.css +1 -1
- package/components/button/style/themes/dnb-button-theme-ui.scss +6 -18
- package/components/checkbox/style/dnb-checkbox.css +1 -1
- package/components/checkbox/style/dnb-checkbox.min.css +1 -1
- package/components/date-picker/style/dnb-date-picker.css +11 -8
- package/components/date-picker/style/dnb-date-picker.min.css +2 -2
- package/components/dropdown/style/dnb-dropdown.css +2 -2
- package/components/dropdown/style/dnb-dropdown.min.css +1 -1
- package/components/form-set/FormSet.d.ts +1 -1
- package/components/form-status/style/_form-status.scss +1 -1
- package/components/form-status/style/dnb-form-status.css +1 -1
- package/components/form-status/style/dnb-form-status.min.css +1 -1
- package/components/global-error/style/dnb-global-error.css +1 -1
- package/components/global-error/style/dnb-global-error.min.css +1 -1
- package/components/global-status/GlobalStatus.js +18 -71
- package/components/global-status/style/_global-status.scss +14 -15
- package/components/global-status/style/dnb-global-status.css +15 -19
- package/components/global-status/style/dnb-global-status.min.css +1 -1
- package/components/global-status/style/themes/dnb-global-status-theme-ui.css +2 -48
- package/components/global-status/style/themes/dnb-global-status-theme-ui.min.css +1 -1
- package/components/global-status/style/themes/dnb-global-status-theme-ui.scss +2 -36
- package/components/help-button/HelpButton.js +2 -2
- package/components/input/style/_input.scss +5 -1
- package/components/input/style/dnb-input.css +5 -2
- package/components/input/style/dnb-input.min.css +2 -2
- package/components/input/style/themes/dnb-input-theme-ui.css +11 -2
- package/components/input/style/themes/dnb-input-theme-ui.min.css +1 -1
- package/components/input/style/themes/dnb-input-theme-ui.scss +4 -1
- package/components/input-masked/InputMasked.d.ts +2 -2
- package/components/input-masked/InputMaskedElement.js +2 -6
- package/components/input-masked/InputMaskedHooks.js +76 -36
- package/components/input-masked/InputMaskedUtils.js +32 -17
- package/components/input-masked/TextMask.js +1 -1
- package/components/input-masked/style/_input-masked.scss +1 -3
- package/components/input-masked/style/dnb-input-masked.css +6 -3
- package/components/input-masked/style/dnb-input-masked.min.css +2 -2
- package/components/modal/Modal.js +1 -1
- package/components/modal/ModalContent.js +43 -27
- package/components/modal/style/_modal-mixins.scss +4 -4
- package/components/modal/style/_modal.scss +14 -31
- package/components/modal/style/dnb-modal.css +29 -47
- package/components/modal/style/dnb-modal.min.css +1 -1
- package/components/number-format/NumberUtils.d.ts +2 -2
- package/components/pagination/Pagination.d.ts +6 -0
- package/components/pagination/Pagination.js +2 -0
- package/components/pagination/PaginationBar.js +1 -1
- package/components/pagination/PaginationInfinity.js +137 -67
- package/components/pagination/PaginationProvider.js +64 -68
- package/components/pagination/style/dnb-pagination.css +1 -1
- package/components/pagination/style/dnb-pagination.min.css +1 -1
- package/components/radio/style/dnb-radio.css +1 -1
- package/components/radio/style/dnb-radio.min.css +1 -1
- package/components/section/style/themes/dnb-section-theme-ui.css +79 -21
- package/components/section/style/themes/dnb-section-theme-ui.min.css +1 -1
- package/components/section/style/themes/dnb-section-theme-ui.scss +16 -3
- package/components/slider/style/dnb-slider.css +2 -2
- package/components/slider/style/dnb-slider.min.css +1 -1
- package/components/step-indicator/StepIndicator.d.ts +1 -1
- package/components/step-indicator/StepIndicator.js +4 -91
- package/components/step-indicator/StepIndicatorContext.d.ts +1 -0
- package/components/step-indicator/StepIndicatorContext.js +196 -18
- package/components/step-indicator/StepIndicatorItem.js +2 -5
- package/components/step-indicator/StepIndicatorModal.js +33 -32
- package/components/step-indicator/StepIndicatorProps.js +1 -1
- package/components/step-indicator/StepIndicatorSidebar.d.ts +39 -0
- package/components/step-indicator/StepIndicatorSidebar.js +54 -52
- package/components/step-indicator/StepIndicatorTriggerButton.js +3 -3
- package/components/step-indicator/style/_step-indicator.scss +25 -4
- package/components/step-indicator/style/dnb-step-indicator.css +21 -6
- package/components/step-indicator/style/dnb-step-indicator.min.css +1 -1
- package/components/switch/style/dnb-switch.css +1 -1
- package/components/switch/style/dnb-switch.min.css +1 -1
- package/components/tabs/style/_tabs.scss +5 -1
- package/components/tabs/style/dnb-tabs.css +4 -1
- package/components/tabs/style/dnb-tabs.min.css +1 -1
- package/components/tabs/style/themes/dnb-tabs-theme-ui.css +37 -34
- package/components/tabs/style/themes/dnb-tabs-theme-ui.min.css +1 -1
- package/components/tabs/style/themes/dnb-tabs-theme-ui.scss +12 -9
- package/components/textarea/style/_textarea.scss +4 -0
- package/components/textarea/style/dnb-textarea.css +4 -1
- package/components/textarea/style/dnb-textarea.min.css +1 -1
- package/components/toggle-button/ToggleButton.js +6 -2
- package/components/toggle-button/style/dnb-toggle-button.css +4 -4
- package/components/toggle-button/style/dnb-toggle-button.min.css +1 -1
- package/es/components/accordion/Accordion.d.ts +1 -1
- package/es/components/autocomplete/style/dnb-autocomplete.css +6 -3
- package/es/components/autocomplete/style/dnb-autocomplete.min.css +1 -1
- package/es/components/breadcrumb/Breadcrumb.js +9 -7
- package/es/components/breadcrumb/Breadcrumb.tsx +20 -5
- package/es/components/breadcrumb/BreadcrumbItem.js +4 -4
- package/es/components/breadcrumb/BreadcrumbItem.tsx +12 -5
- package/es/components/breadcrumb/style/_breadcrumb.scss +7 -5
- package/es/components/breadcrumb/style/dnb-breadcrumb.css +10 -10
- package/es/components/breadcrumb/style/dnb-breadcrumb.min.css +1 -1
- package/es/components/button/Button.d.ts +0 -1
- package/es/components/button/Button.js +88 -114
- package/es/components/button/style/dnb-button.css +1 -1
- package/es/components/button/style/dnb-button.min.css +1 -1
- package/es/components/button/style/themes/dnb-button-theme-open-banking.css +6 -14
- package/es/components/button/style/themes/dnb-button-theme-open-banking.min.css +1 -1
- package/es/components/button/style/themes/dnb-button-theme-ui.css +6 -14
- package/es/components/button/style/themes/dnb-button-theme-ui.min.css +1 -1
- package/es/components/button/style/themes/dnb-button-theme-ui.scss +6 -18
- package/es/components/checkbox/style/dnb-checkbox.css +1 -1
- package/es/components/checkbox/style/dnb-checkbox.min.css +1 -1
- package/es/components/date-picker/style/dnb-date-picker.css +11 -8
- package/es/components/date-picker/style/dnb-date-picker.min.css +2 -2
- package/es/components/dropdown/style/dnb-dropdown.css +2 -2
- package/es/components/dropdown/style/dnb-dropdown.min.css +1 -1
- package/es/components/form-set/FormSet.d.ts +1 -1
- package/es/components/form-status/style/_form-status.scss +1 -1
- package/es/components/form-status/style/dnb-form-status.css +1 -1
- package/es/components/form-status/style/dnb-form-status.min.css +1 -1
- package/es/components/global-error/style/dnb-global-error.css +1 -1
- package/es/components/global-error/style/dnb-global-error.min.css +1 -1
- package/es/components/global-status/GlobalStatus.js +18 -67
- package/es/components/global-status/style/_global-status.scss +14 -15
- package/es/components/global-status/style/dnb-global-status.css +15 -19
- package/es/components/global-status/style/dnb-global-status.min.css +1 -1
- package/es/components/global-status/style/themes/dnb-global-status-theme-ui.css +2 -48
- package/es/components/global-status/style/themes/dnb-global-status-theme-ui.min.css +1 -1
- package/es/components/global-status/style/themes/dnb-global-status-theme-ui.scss +2 -36
- package/es/components/help-button/HelpButton.js +2 -2
- package/es/components/input/style/_input.scss +5 -1
- package/es/components/input/style/dnb-input.css +5 -2
- package/es/components/input/style/dnb-input.min.css +2 -2
- package/es/components/input/style/themes/dnb-input-theme-ui.css +11 -2
- package/es/components/input/style/themes/dnb-input-theme-ui.min.css +1 -1
- package/es/components/input/style/themes/dnb-input-theme-ui.scss +4 -1
- package/es/components/input-masked/InputMasked.d.ts +2 -2
- package/es/components/input-masked/InputMaskedElement.js +2 -6
- package/es/components/input-masked/InputMaskedHooks.js +70 -31
- package/es/components/input-masked/InputMaskedUtils.js +31 -16
- package/es/components/input-masked/TextMask.js +1 -1
- package/es/components/input-masked/style/_input-masked.scss +1 -3
- package/es/components/input-masked/style/dnb-input-masked.css +6 -3
- package/es/components/input-masked/style/dnb-input-masked.min.css +2 -2
- package/es/components/modal/Modal.js +1 -1
- package/es/components/modal/ModalContent.js +32 -19
- package/es/components/modal/style/_modal-mixins.scss +4 -4
- package/es/components/modal/style/_modal.scss +14 -31
- package/es/components/modal/style/dnb-modal.css +29 -47
- package/es/components/modal/style/dnb-modal.min.css +1 -1
- package/es/components/number-format/NumberUtils.d.ts +2 -2
- package/es/components/pagination/Pagination.d.ts +6 -0
- package/es/components/pagination/Pagination.js +2 -0
- package/es/components/pagination/PaginationBar.js +1 -1
- package/es/components/pagination/PaginationInfinity.js +110 -37
- package/es/components/pagination/PaginationProvider.js +57 -61
- package/es/components/pagination/style/dnb-pagination.css +1 -1
- package/es/components/pagination/style/dnb-pagination.min.css +1 -1
- package/es/components/radio/style/dnb-radio.css +1 -1
- package/es/components/radio/style/dnb-radio.min.css +1 -1
- package/es/components/section/style/themes/dnb-section-theme-ui.css +79 -21
- package/es/components/section/style/themes/dnb-section-theme-ui.min.css +1 -1
- package/es/components/section/style/themes/dnb-section-theme-ui.scss +16 -3
- package/es/components/slider/style/dnb-slider.css +2 -2
- package/es/components/slider/style/dnb-slider.min.css +1 -1
- package/es/components/step-indicator/StepIndicator.d.ts +1 -1
- package/es/components/step-indicator/StepIndicator.js +3 -79
- package/es/components/step-indicator/StepIndicatorContext.d.ts +1 -0
- package/es/components/step-indicator/StepIndicatorContext.js +165 -17
- package/es/components/step-indicator/StepIndicatorItem.js +1 -5
- package/es/components/step-indicator/StepIndicatorModal.js +31 -34
- package/es/components/step-indicator/StepIndicatorProps.js +1 -1
- package/es/components/step-indicator/StepIndicatorSidebar.d.ts +39 -0
- package/es/components/step-indicator/StepIndicatorSidebar.js +44 -46
- package/es/components/step-indicator/StepIndicatorTriggerButton.js +3 -3
- package/es/components/step-indicator/style/_step-indicator.scss +25 -4
- package/es/components/step-indicator/style/dnb-step-indicator.css +21 -6
- package/es/components/step-indicator/style/dnb-step-indicator.min.css +1 -1
- package/es/components/switch/style/dnb-switch.css +1 -1
- package/es/components/switch/style/dnb-switch.min.css +1 -1
- package/es/components/tabs/style/_tabs.scss +5 -1
- package/es/components/tabs/style/dnb-tabs.css +4 -1
- package/es/components/tabs/style/dnb-tabs.min.css +1 -1
- package/es/components/tabs/style/themes/dnb-tabs-theme-ui.css +37 -34
- package/es/components/tabs/style/themes/dnb-tabs-theme-ui.min.css +1 -1
- package/es/components/tabs/style/themes/dnb-tabs-theme-ui.scss +12 -9
- package/es/components/textarea/style/_textarea.scss +4 -0
- package/es/components/textarea/style/dnb-textarea.css +4 -1
- package/es/components/textarea/style/dnb-textarea.min.css +1 -1
- package/es/components/toggle-button/ToggleButton.js +6 -2
- package/es/components/toggle-button/style/dnb-toggle-button.css +4 -4
- package/es/components/toggle-button/style/dnb-toggle-button.min.css +1 -1
- package/es/icons/above_the_line.js +1 -1
- package/es/icons/facebook.js +23 -0
- package/es/icons/facebook_medium.js +23 -0
- package/es/icons/fridge.js +1 -1
- package/es/icons/icons-meta.json +24 -0
- package/es/icons/icons-pdf.lock +1 -1
- package/es/icons/icons-svg.lock +1 -1
- package/es/icons/index.d.ts +16 -0
- package/es/icons/index.js +9 -1
- package/es/icons/information_circled.js +11 -4
- package/es/icons/information_circled_medium.js +10 -4
- package/es/icons/instagram.js +35 -0
- package/es/icons/instagram_medium.js +42 -0
- package/es/icons/linkedin.js +20 -0
- package/es/icons/linkedin_medium.js +20 -0
- package/es/icons/motorcycle_medium.js +2 -2
- package/es/icons/paragraph.js +1 -1
- package/es/icons/scooter_medium.js +2 -2
- package/es/icons/secondary_icons.js +5 -1
- package/es/icons/secondary_icons_medium.js +5 -1
- package/es/icons/tag.js +29 -0
- package/es/icons/tag_medium.js +29 -0
- package/es/shared/EventEmitter.js +5 -8
- package/es/shared/component-helper.js +58 -49
- package/es/shared/helpers.js +28 -12
- package/es/style/dnb-ui-components.css +85 -83
- package/es/style/dnb-ui-components.min.css +5 -5
- package/es/style/themes/theme-open-banking/dnb-theme-open-banking.css +141 -133
- package/es/style/themes/theme-open-banking/dnb-theme-open-banking.min.css +4 -4
- package/es/style/themes/theme-ui/dnb-theme-ui.css +135 -119
- package/es/style/themes/theme-ui/dnb-theme-ui.min.css +4 -4
- package/esm/components/accordion/Accordion.d.ts +1 -1
- package/esm/components/autocomplete/style/dnb-autocomplete.css +6 -3
- package/esm/components/autocomplete/style/dnb-autocomplete.min.css +1 -1
- package/esm/components/breadcrumb/Breadcrumb.js +9 -7
- package/esm/components/breadcrumb/Breadcrumb.tsx +20 -5
- package/esm/components/breadcrumb/BreadcrumbItem.js +4 -4
- package/esm/components/breadcrumb/BreadcrumbItem.tsx +12 -5
- package/esm/components/breadcrumb/style/_breadcrumb.scss +7 -5
- package/esm/components/breadcrumb/style/dnb-breadcrumb.css +10 -10
- package/esm/components/breadcrumb/style/dnb-breadcrumb.min.css +1 -1
- package/esm/components/button/Button.d.ts +0 -1
- package/esm/components/button/Button.js +95 -135
- package/esm/components/button/style/dnb-button.css +1 -1
- package/esm/components/button/style/dnb-button.min.css +1 -1
- package/esm/components/button/style/themes/dnb-button-theme-open-banking.css +6 -14
- package/esm/components/button/style/themes/dnb-button-theme-open-banking.min.css +1 -1
- package/esm/components/button/style/themes/dnb-button-theme-ui.css +6 -14
- package/esm/components/button/style/themes/dnb-button-theme-ui.min.css +1 -1
- package/esm/components/button/style/themes/dnb-button-theme-ui.scss +6 -18
- package/esm/components/checkbox/style/dnb-checkbox.css +1 -1
- package/esm/components/checkbox/style/dnb-checkbox.min.css +1 -1
- package/esm/components/date-picker/style/dnb-date-picker.css +11 -8
- package/esm/components/date-picker/style/dnb-date-picker.min.css +2 -2
- package/esm/components/dropdown/style/dnb-dropdown.css +2 -2
- package/esm/components/dropdown/style/dnb-dropdown.min.css +1 -1
- package/esm/components/form-set/FormSet.d.ts +1 -1
- package/esm/components/form-status/style/_form-status.scss +1 -1
- package/esm/components/form-status/style/dnb-form-status.css +1 -1
- package/esm/components/form-status/style/dnb-form-status.min.css +1 -1
- package/esm/components/global-error/style/dnb-global-error.css +1 -1
- package/esm/components/global-error/style/dnb-global-error.min.css +1 -1
- package/esm/components/global-status/GlobalStatus.js +18 -71
- package/esm/components/global-status/style/_global-status.scss +14 -15
- package/esm/components/global-status/style/dnb-global-status.css +15 -19
- package/esm/components/global-status/style/dnb-global-status.min.css +1 -1
- package/esm/components/global-status/style/themes/dnb-global-status-theme-ui.css +2 -48
- package/esm/components/global-status/style/themes/dnb-global-status-theme-ui.min.css +1 -1
- package/esm/components/global-status/style/themes/dnb-global-status-theme-ui.scss +2 -36
- package/esm/components/help-button/HelpButton.js +2 -2
- package/esm/components/input/style/_input.scss +5 -1
- package/esm/components/input/style/dnb-input.css +5 -2
- package/esm/components/input/style/dnb-input.min.css +2 -2
- package/esm/components/input/style/themes/dnb-input-theme-ui.css +11 -2
- package/esm/components/input/style/themes/dnb-input-theme-ui.min.css +1 -1
- package/esm/components/input/style/themes/dnb-input-theme-ui.scss +4 -1
- package/esm/components/input-masked/InputMasked.d.ts +2 -2
- package/esm/components/input-masked/InputMaskedElement.js +2 -6
- package/esm/components/input-masked/InputMaskedHooks.js +76 -36
- package/esm/components/input-masked/InputMaskedUtils.js +32 -17
- package/esm/components/input-masked/TextMask.js +1 -1
- package/esm/components/input-masked/style/_input-masked.scss +1 -3
- package/esm/components/input-masked/style/dnb-input-masked.css +6 -3
- package/esm/components/input-masked/style/dnb-input-masked.min.css +2 -2
- package/esm/components/modal/Modal.js +1 -1
- package/esm/components/modal/ModalContent.js +43 -27
- package/esm/components/modal/style/_modal-mixins.scss +4 -4
- package/esm/components/modal/style/_modal.scss +14 -31
- package/esm/components/modal/style/dnb-modal.css +29 -47
- package/esm/components/modal/style/dnb-modal.min.css +1 -1
- package/esm/components/number-format/NumberUtils.d.ts +2 -2
- package/esm/components/pagination/Pagination.d.ts +6 -0
- package/esm/components/pagination/Pagination.js +2 -0
- package/esm/components/pagination/PaginationBar.js +1 -1
- package/esm/components/pagination/PaginationInfinity.js +137 -67
- package/esm/components/pagination/PaginationProvider.js +64 -68
- package/esm/components/pagination/style/dnb-pagination.css +1 -1
- package/esm/components/pagination/style/dnb-pagination.min.css +1 -1
- package/esm/components/radio/style/dnb-radio.css +1 -1
- package/esm/components/radio/style/dnb-radio.min.css +1 -1
- package/esm/components/section/style/themes/dnb-section-theme-ui.css +79 -21
- package/esm/components/section/style/themes/dnb-section-theme-ui.min.css +1 -1
- package/esm/components/section/style/themes/dnb-section-theme-ui.scss +16 -3
- package/esm/components/slider/style/dnb-slider.css +2 -2
- package/esm/components/slider/style/dnb-slider.min.css +1 -1
- package/esm/components/step-indicator/StepIndicator.d.ts +1 -1
- package/esm/components/step-indicator/StepIndicator.js +4 -91
- package/esm/components/step-indicator/StepIndicatorContext.d.ts +1 -0
- package/esm/components/step-indicator/StepIndicatorContext.js +196 -18
- package/esm/components/step-indicator/StepIndicatorItem.js +2 -5
- package/esm/components/step-indicator/StepIndicatorModal.js +33 -32
- package/esm/components/step-indicator/StepIndicatorProps.js +1 -1
- package/esm/components/step-indicator/StepIndicatorSidebar.d.ts +39 -0
- package/esm/components/step-indicator/StepIndicatorSidebar.js +54 -52
- package/esm/components/step-indicator/StepIndicatorTriggerButton.js +3 -3
- package/esm/components/step-indicator/style/_step-indicator.scss +25 -4
- package/esm/components/step-indicator/style/dnb-step-indicator.css +21 -6
- package/esm/components/step-indicator/style/dnb-step-indicator.min.css +1 -1
- package/esm/components/switch/style/dnb-switch.css +1 -1
- package/esm/components/switch/style/dnb-switch.min.css +1 -1
- package/esm/components/tabs/style/_tabs.scss +5 -1
- package/esm/components/tabs/style/dnb-tabs.css +4 -1
- package/esm/components/tabs/style/dnb-tabs.min.css +1 -1
- package/esm/components/tabs/style/themes/dnb-tabs-theme-ui.css +37 -34
- package/esm/components/tabs/style/themes/dnb-tabs-theme-ui.min.css +1 -1
- package/esm/components/tabs/style/themes/dnb-tabs-theme-ui.scss +12 -9
- package/esm/components/textarea/style/_textarea.scss +4 -0
- package/esm/components/textarea/style/dnb-textarea.css +4 -1
- package/esm/components/textarea/style/dnb-textarea.min.css +1 -1
- package/esm/components/toggle-button/ToggleButton.js +6 -2
- package/esm/components/toggle-button/style/dnb-toggle-button.css +4 -4
- package/esm/components/toggle-button/style/dnb-toggle-button.min.css +1 -1
- package/esm/dnb-ui-basis.min.mjs +5 -0
- package/esm/dnb-ui-components.min.mjs +17 -0
- package/esm/dnb-ui-elements.min.mjs +17 -0
- package/esm/dnb-ui-extensions.min.mjs +17 -0
- package/esm/dnb-ui-icons.min.mjs +1 -0
- package/esm/dnb-ui-lib.min.mjs +17 -0
- package/esm/dnb-ui-web-components.min.mjs +17 -0
- package/esm/icons/above_the_line.js +1 -1
- package/esm/icons/facebook.js +23 -0
- package/esm/icons/facebook_medium.js +23 -0
- package/esm/icons/fridge.js +1 -1
- package/esm/icons/icons-meta.json +24 -0
- package/esm/icons/icons-pdf.lock +1 -1
- package/esm/icons/icons-svg.lock +1 -1
- package/esm/icons/index.d.ts +16 -0
- package/esm/icons/index.js +9 -1
- package/esm/icons/information_circled.js +11 -4
- package/esm/icons/information_circled_medium.js +10 -4
- package/esm/icons/instagram.js +35 -0
- package/esm/icons/instagram_medium.js +42 -0
- package/esm/icons/linkedin.js +20 -0
- package/esm/icons/linkedin_medium.js +20 -0
- package/esm/icons/motorcycle_medium.js +2 -2
- package/esm/icons/paragraph.js +1 -1
- package/esm/icons/scooter_medium.js +2 -2
- package/esm/icons/secondary_icons.js +5 -1
- package/esm/icons/secondary_icons_medium.js +5 -1
- package/esm/icons/tag.js +29 -0
- package/esm/icons/tag_medium.js +29 -0
- package/esm/shared/EventEmitter.js +6 -8
- package/esm/shared/component-helper.js +94 -58
- package/esm/shared/helpers.js +36 -12
- package/esm/style/dnb-ui-components.css +85 -83
- package/esm/style/dnb-ui-components.min.css +5 -5
- package/esm/style/themes/theme-open-banking/dnb-theme-open-banking.css +141 -133
- package/esm/style/themes/theme-open-banking/dnb-theme-open-banking.min.css +4 -4
- package/esm/style/themes/theme-ui/dnb-theme-ui.css +135 -119
- package/esm/style/themes/theme-ui/dnb-theme-ui.min.css +4 -4
- package/icons/above_the_line.js +1 -1
- package/icons/facebook.js +23 -0
- package/icons/facebook_medium.js +23 -0
- package/icons/fridge.js +1 -1
- package/icons/icons-meta.json +24 -0
- package/icons/icons-pdf.lock +1 -1
- package/icons/icons-svg.lock +1 -1
- package/icons/index.d.ts +16 -0
- package/icons/index.js +9 -1
- package/icons/information_circled.js +11 -4
- package/icons/information_circled_medium.js +10 -4
- package/icons/instagram.js +35 -0
- package/icons/instagram_medium.js +42 -0
- package/icons/linkedin.js +20 -0
- package/icons/linkedin_medium.js +20 -0
- package/icons/motorcycle_medium.js +2 -2
- package/icons/paragraph.js +1 -1
- package/icons/scooter_medium.js +2 -2
- package/icons/secondary_icons.js +5 -1
- package/icons/secondary_icons_medium.js +5 -1
- package/icons/tag.js +29 -0
- package/icons/tag_medium.js +29 -0
- package/package.json +2 -2
- package/shared/EventEmitter.js +6 -8
- package/shared/component-helper.js +94 -58
- package/shared/helpers.js +36 -12
- package/style/dnb-ui-components.css +85 -83
- package/style/dnb-ui-components.min.css +5 -5
- package/style/themes/theme-open-banking/dnb-theme-open-banking.css +141 -133
- package/style/themes/theme-open-banking/dnb-theme-open-banking.min.css +4 -4
- package/style/themes/theme-ui/dnb-theme-ui.css +135 -119
- package/style/themes/theme-ui/dnb-theme-ui.min.css +4 -4
- package/umd/dnb-ui-basis.min.js +12 -0
- package/umd/dnb-ui-components.min.js +24 -0
- package/umd/dnb-ui-elements.min.js +24 -0
- package/umd/dnb-ui-extensions.min.js +24 -0
- package/umd/dnb-ui-icons.min.js +1 -0
- package/umd/dnb-ui-lib.min.js +24 -0
- package/umd/dnb-ui-web-components.min.js +24 -0
- package/cjs/components/breadcrumb/Breadcrumb.tsx +0 -244
- package/cjs/components/breadcrumb/BreadcrumbItem.tsx +0 -111
- package/cjs/shared/interfaces.tsx +0 -14
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "core-js/modules/es.object.to-string.js";
|
|
1
2
|
import "core-js/modules/es.reflect.construct.js";
|
|
2
3
|
import "core-js/modules/es.object.keys.js";
|
|
3
4
|
import "core-js/modules/es.symbol.js";
|
|
@@ -20,23 +21,13 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
20
21
|
|
|
21
22
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
22
23
|
|
|
23
|
-
import "core-js/modules/es.regexp.exec.js";
|
|
24
|
-
import "core-js/modules/es.string.replace.js";
|
|
25
|
-
import "core-js/modules/es.parse-float.js";
|
|
26
|
-
import "core-js/modules/es.array.reduce.js";
|
|
27
|
-
import "core-js/modules/es.object.to-string.js";
|
|
28
|
-
import "core-js/modules/es.array.includes.js";
|
|
29
|
-
import "core-js/modules/es.string.includes.js";
|
|
30
|
-
|
|
31
24
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
32
25
|
|
|
33
26
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
34
27
|
|
|
35
28
|
import React from 'react';
|
|
36
29
|
import PropTypes from 'prop-types';
|
|
37
|
-
import
|
|
38
|
-
import { makeUniqueId, warn, registerElement, processChildren, extendPropsWithContext } from '../../shared/component-helper';
|
|
39
|
-
import EventEmitter from '../../shared/EventEmitter';
|
|
30
|
+
import { makeUniqueId, warn, registerElement } from '../../shared/component-helper';
|
|
40
31
|
import StepIndicatorSidebar from './StepIndicatorSidebar';
|
|
41
32
|
import StepIndicatorModal from './StepIndicatorModal';
|
|
42
33
|
import StepIndicatorList from './StepIndicatorList';
|
|
@@ -59,12 +50,6 @@ var StepIndicator = function (_React$PureComponent) {
|
|
|
59
50
|
return typeof process !== 'undefined' && process.env.NODE_ENV === 'development';
|
|
60
51
|
});
|
|
61
52
|
|
|
62
|
-
_defineProperty(_assertThisInitialized(_this), "setActiveStep", function (activeStep) {
|
|
63
|
-
_this.setState({
|
|
64
|
-
activeStep: activeStep
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
|
|
68
53
|
_this.state = {
|
|
69
54
|
isV1: !props.mode,
|
|
70
55
|
sidebar_id: props.internalId || props.sidebar_id || makeUniqueId()
|
|
@@ -90,46 +75,15 @@ var StepIndicator = function (_React$PureComponent) {
|
|
|
90
75
|
warn('StepIndicator: `show_numbers` is deprecated. Use `hide_numbers` instead.');
|
|
91
76
|
}
|
|
92
77
|
|
|
93
|
-
_this._eventEmitter = EventEmitter.createInstance(_this.state.sidebar_id);
|
|
94
|
-
|
|
95
|
-
if (!_this.state.listOfReachedSteps) {
|
|
96
|
-
_this.state.listOfReachedSteps = [];
|
|
97
|
-
}
|
|
98
|
-
|
|
99
78
|
return _this;
|
|
100
79
|
}
|
|
101
80
|
|
|
102
81
|
_createClass(StepIndicator, [{
|
|
103
|
-
key: "componentWillUnmount",
|
|
104
|
-
value: function componentWillUnmount() {
|
|
105
|
-
if (this._eventEmitter) {
|
|
106
|
-
this._eventEmitter.remove();
|
|
107
|
-
|
|
108
|
-
this._eventEmitter = null;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}, {
|
|
112
|
-
key: "getContextData",
|
|
113
|
-
value: function getContextData() {
|
|
114
|
-
var _data$step_title, _data$step_title_exte;
|
|
115
|
-
|
|
116
|
-
var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.context;
|
|
117
|
-
var data = extendPropsWithContext(this.props, StepIndicator.defaultProps, {
|
|
118
|
-
skeleton: context === null || context === void 0 ? void 0 : context.skeleton
|
|
119
|
-
}, context.getTranslation(this.props).StepIndicator, context.FormRow, context.StepIndicator);
|
|
120
|
-
data.stepsLabel = (_data$step_title = data.step_title) === null || _data$step_title === void 0 ? void 0 : _data$step_title.replace('%step', this.state.activeStep + 1).replace('%count', this.state.countSteps);
|
|
121
|
-
data.stepsLabelExtended = (_data$step_title_exte = data.step_title_extended) === null || _data$step_title_exte === void 0 ? void 0 : _data$step_title_exte.replace('%step', this.state.activeStep + 1).replace('%count', this.state.countSteps);
|
|
122
|
-
return data;
|
|
123
|
-
}
|
|
124
|
-
}, {
|
|
125
82
|
key: "render",
|
|
126
83
|
value: function render() {
|
|
127
|
-
var contextData = this.getContextData(this.context);
|
|
128
|
-
|
|
129
84
|
if (this.state.isV1) {
|
|
130
|
-
return React.createElement(StepIndicatorProvider, _extends({}, this.
|
|
85
|
+
return React.createElement(StepIndicatorProvider, _extends({}, this.props, {
|
|
131
86
|
sidebar_id: this.state.sidebar_id,
|
|
132
|
-
setActiveStep: this.setActiveStep,
|
|
133
87
|
listAttributes: this.props,
|
|
134
88
|
isV1: this.state.isV1
|
|
135
89
|
}), _div || (_div = React.createElement("div", {
|
|
@@ -141,9 +95,8 @@ var StepIndicator = function (_React$PureComponent) {
|
|
|
141
95
|
warn('StepIndicator needs an unique "sidebar_id" property, also on the <StepIndicator.Sidebar... />');
|
|
142
96
|
}
|
|
143
97
|
|
|
144
|
-
return React.createElement(StepIndicatorProvider, _extends({}, this.
|
|
98
|
+
return React.createElement(StepIndicatorProvider, _extends({}, this.props, {
|
|
145
99
|
sidebar_id: this.state.sidebar_id,
|
|
146
|
-
setActiveStep: this.setActiveStep,
|
|
147
100
|
isV1: this.state.isV1
|
|
148
101
|
}), _div2 || (_div2 = React.createElement("div", {
|
|
149
102
|
className: "dnb-step-indicator-v2"
|
|
@@ -154,44 +107,6 @@ var StepIndicator = function (_React$PureComponent) {
|
|
|
154
107
|
value: function enableWebComponent() {
|
|
155
108
|
registerElement(StepIndicator === null || StepIndicator === void 0 ? void 0 : StepIndicator.tagName, StepIndicator, StepIndicator.defaultProps);
|
|
156
109
|
}
|
|
157
|
-
}, {
|
|
158
|
-
key: "getData",
|
|
159
|
-
value: function getData(props) {
|
|
160
|
-
var res = [];
|
|
161
|
-
if (props.data) res = props.data;else res = processChildren(props);
|
|
162
|
-
if (typeof res === 'string') return res[0] === '[' ? JSON.parse(res) : [];
|
|
163
|
-
return res || [];
|
|
164
|
-
}
|
|
165
|
-
}, {
|
|
166
|
-
key: "getDerivedStateFromProps",
|
|
167
|
-
value: function getDerivedStateFromProps(props, state) {
|
|
168
|
-
state.data = StepIndicator.getData(props);
|
|
169
|
-
state.countSteps = state.data.length;
|
|
170
|
-
|
|
171
|
-
if (props.current_step !== null && props.current_step !== state._current_step) {
|
|
172
|
-
state.activeStep = parseFloat(props.current_step) || 0;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
if (props.active_item !== null && props.active_item !== state._active_item) {
|
|
176
|
-
state.activeStep = parseFloat(props.active_item) || 0;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
if (props.active_url && state.data.length > 0) {
|
|
180
|
-
state.activeStep = state.data.reduce(function (acc, _ref, i) {
|
|
181
|
-
var url = _ref.url;
|
|
182
|
-
return url && (url === state.current_step || url === props.active_url) ? i : acc;
|
|
183
|
-
}, parseFloat(state.current_step) || 0);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
if (!state.listOfReachedSteps.includes(state.activeStep)) {
|
|
187
|
-
state.listOfReachedSteps.push(state.activeStep);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
state._current_step = props.current_step;
|
|
191
|
-
state._active_item = props.active_item;
|
|
192
|
-
state._active_url = props.active_url;
|
|
193
|
-
return state;
|
|
194
|
-
}
|
|
195
110
|
}]);
|
|
196
111
|
|
|
197
112
|
return StepIndicator;
|
|
@@ -199,8 +114,6 @@ var StepIndicator = function (_React$PureComponent) {
|
|
|
199
114
|
|
|
200
115
|
_defineProperty(StepIndicator, "tagName", 'dnb-step-indicator');
|
|
201
116
|
|
|
202
|
-
_defineProperty(StepIndicator, "contextType", Context);
|
|
203
|
-
|
|
204
117
|
_defineProperty(StepIndicator, "Sidebar", StepIndicatorSidebar);
|
|
205
118
|
|
|
206
119
|
_defineProperty(StepIndicator, "defaultProps", _objectSpread({
|
|
@@ -2,12 +2,14 @@ import "core-js/modules/es.reflect.construct.js";
|
|
|
2
2
|
import "core-js/modules/es.symbol.js";
|
|
3
3
|
import "core-js/modules/es.object.get-own-property-descriptor.js";
|
|
4
4
|
import "core-js/modules/es.object.get-own-property-descriptors.js";
|
|
5
|
-
import
|
|
5
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
6
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
7
7
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
8
|
+
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
8
9
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
9
10
|
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
10
11
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
12
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
11
13
|
|
|
12
14
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
13
15
|
|
|
@@ -24,13 +26,21 @@ import "core-js/modules/es.object.keys.js";
|
|
|
24
26
|
import "core-js/modules/es.array.includes.js";
|
|
25
27
|
import "core-js/modules/web.dom-collections.for-each.js";
|
|
26
28
|
import "core-js/modules/es.string.starts-with.js";
|
|
29
|
+
import "core-js/modules/es.parse-float.js";
|
|
30
|
+
import "core-js/modules/es.array.reduce.js";
|
|
31
|
+
import "core-js/modules/es.string.includes.js";
|
|
32
|
+
import "core-js/modules/es.regexp.exec.js";
|
|
33
|
+
import "core-js/modules/es.string.replace.js";
|
|
34
|
+
import "core-js/modules/es.object.entries.js";
|
|
27
35
|
import React from 'react';
|
|
28
36
|
import PropTypes from 'prop-types';
|
|
29
|
-
import
|
|
37
|
+
import Context from '../../shared/Context';
|
|
30
38
|
import { stepIndicatorDefaultProps } from './StepIndicatorProps';
|
|
39
|
+
import { processChildren, extendPropsWithContext } from '../../shared/component-helper';
|
|
40
|
+
import { onMediaQueryChange } from '../../shared/MediaQueryUtils';
|
|
31
41
|
var filterAttributes = Object.keys(stepIndicatorDefaultProps).filter(function (item) {
|
|
32
42
|
return !['class', 'className'].includes(item);
|
|
33
|
-
}).concat(['internalId', 'hasSidebar', 'hideSidebar', 'mainTitle', 'stepsLabel', 'stepsLabelExtended', 'listOfReachedSteps', 'setActiveStep', 'activeStep', 'countSteps', 'innerRef', 'filterAttributes', 'listAttributes', 'onChangeState', 'isV1', 'activeUrl']);
|
|
43
|
+
}).concat(['internalId', 'isSidebar', 'hasSidebar', 'hideSidebar', 'sidebarIsVisible', 'mainTitle', 'stepsLabel', 'stepsLabelExtended', 'listOfReachedSteps', 'setActiveStep', 'activeStep', 'countSteps', 'openState', 'onChangeState', 'openHandler', 'closeHandler', 'innerRef', 'hasSkeletonData', 'filterAttributes', 'listAttributes', 'onChangeState', 'isV1', 'activeUrl']);
|
|
34
44
|
var StepIndicatorContext = React.createContext(null);
|
|
35
45
|
export default StepIndicatorContext;
|
|
36
46
|
export var StepIndicatorProvider = function (_React$PureComponent) {
|
|
@@ -44,8 +54,45 @@ export var StepIndicatorProvider = function (_React$PureComponent) {
|
|
|
44
54
|
_classCallCheck(this, StepIndicatorProvider);
|
|
45
55
|
|
|
46
56
|
_this = _super.call(this, props);
|
|
47
|
-
|
|
48
|
-
_this
|
|
57
|
+
|
|
58
|
+
_defineProperty(_assertThisInitialized(_this), "setActiveStep", function (activeStep) {
|
|
59
|
+
_this.setState({
|
|
60
|
+
activeStep: activeStep
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
_defineProperty(_assertThisInitialized(_this), "onChangeState", function () {
|
|
65
|
+
_this.setState({
|
|
66
|
+
openState: false
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
_defineProperty(_assertThisInitialized(_this), "openHandler", function () {
|
|
71
|
+
_this.setState({
|
|
72
|
+
openState: true
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
_defineProperty(_assertThisInitialized(_this), "closeHandler", function () {
|
|
77
|
+
_this.setState({
|
|
78
|
+
openState: false
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
_this.state = {
|
|
83
|
+
hasSidebar: true,
|
|
84
|
+
hideSidebar: false,
|
|
85
|
+
activeStep: undefined,
|
|
86
|
+
setActiveStep: _this.setActiveStep,
|
|
87
|
+
onChangeState: _this.onChangeState,
|
|
88
|
+
openHandler: _this.openHandler,
|
|
89
|
+
closeHandler: _this.closeHandler
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
if (!_this.state.listOfReachedSteps) {
|
|
93
|
+
_this.state.listOfReachedSteps = [];
|
|
94
|
+
}
|
|
95
|
+
|
|
49
96
|
return _this;
|
|
50
97
|
}
|
|
51
98
|
|
|
@@ -54,30 +101,73 @@ export var StepIndicatorProvider = function (_React$PureComponent) {
|
|
|
54
101
|
value: function componentDidMount() {
|
|
55
102
|
var _this2 = this;
|
|
56
103
|
|
|
57
|
-
this.
|
|
58
|
-
|
|
59
|
-
|
|
104
|
+
this._isMounted = true;
|
|
105
|
+
|
|
106
|
+
if (!this.props.isV1) {
|
|
107
|
+
var _document;
|
|
108
|
+
|
|
109
|
+
this._mediaQueryListener = onMediaQueryChange({
|
|
110
|
+
min: '0',
|
|
111
|
+
max: 'medium'
|
|
112
|
+
}, function (hideSidebar) {
|
|
113
|
+
_this2.setState({
|
|
114
|
+
hideSidebar: hideSidebar
|
|
115
|
+
});
|
|
116
|
+
}, {
|
|
117
|
+
runOnInit: true
|
|
118
|
+
});
|
|
119
|
+
var container = (_document = document) === null || _document === void 0 ? void 0 : _document.getElementById('sidebar__' + this.props.sidebar_id);
|
|
120
|
+
this.setState({
|
|
121
|
+
hasSidebar: Boolean(container)
|
|
122
|
+
});
|
|
123
|
+
}
|
|
60
124
|
}
|
|
61
125
|
}, {
|
|
62
126
|
key: "componentWillUnmount",
|
|
63
127
|
value: function componentWillUnmount() {
|
|
64
|
-
if (this.
|
|
65
|
-
this.
|
|
66
|
-
|
|
67
|
-
this._eventEmitter = null;
|
|
128
|
+
if (this._mediaQueryListener) {
|
|
129
|
+
this._mediaQueryListener();
|
|
68
130
|
}
|
|
69
131
|
}
|
|
70
132
|
}, {
|
|
71
133
|
key: "componentDidUpdate",
|
|
72
134
|
value: function componentDidUpdate() {
|
|
73
|
-
this.
|
|
135
|
+
this.setState(this.makeContextValue());
|
|
136
|
+
}
|
|
137
|
+
}, {
|
|
138
|
+
key: "getGlobalContext",
|
|
139
|
+
value: function getGlobalContext() {
|
|
140
|
+
var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.context;
|
|
141
|
+
var data = extendPropsWithContext(this.props, stepIndicatorDefaultProps, {
|
|
142
|
+
skeleton: context === null || context === void 0 ? void 0 : context.skeleton
|
|
143
|
+
}, context.getTranslation(context).StepIndicator, context.FormRow, context.StepIndicator);
|
|
144
|
+
return data;
|
|
145
|
+
}
|
|
146
|
+
}, {
|
|
147
|
+
key: "makeContextValue",
|
|
148
|
+
value: function makeContextValue() {
|
|
149
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
150
|
+
_ref$state = _ref.state,
|
|
151
|
+
state = _ref$state === void 0 ? _objectSpread({}, this.state) : _ref$state,
|
|
152
|
+
_ref$props = _ref.props,
|
|
153
|
+
props = _ref$props === void 0 ? this.props : _ref$props,
|
|
154
|
+
_ref$context = _ref.context,
|
|
155
|
+
context = _ref$context === void 0 ? this.context : _ref$context;
|
|
156
|
+
|
|
157
|
+
var globalContext = this.getGlobalContext(context);
|
|
158
|
+
var value = extendSafe({
|
|
159
|
+
filterAttributes: filterAttributes
|
|
160
|
+
}, globalContext, {
|
|
161
|
+
defaultProps: stepIndicatorDefaultProps,
|
|
162
|
+
props: props
|
|
163
|
+
}, state);
|
|
164
|
+
value.sidebarIsVisible = value.hasSidebar && !value.hideSidebar;
|
|
165
|
+
return value;
|
|
74
166
|
}
|
|
75
167
|
}, {
|
|
76
168
|
key: "render",
|
|
77
169
|
value: function render() {
|
|
78
|
-
var value =
|
|
79
|
-
filterAttributes: filterAttributes
|
|
80
|
-
}, this.props), this.state);
|
|
170
|
+
var value = this.makeContextValue();
|
|
81
171
|
|
|
82
172
|
if (typeof window !== 'undefined' && window.IS_TEST) {
|
|
83
173
|
value.no_animation = true;
|
|
@@ -92,11 +182,99 @@ export var StepIndicatorProvider = function (_React$PureComponent) {
|
|
|
92
182
|
value: value
|
|
93
183
|
}, this.props.children);
|
|
94
184
|
}
|
|
185
|
+
}], [{
|
|
186
|
+
key: "getData",
|
|
187
|
+
value: function getData(props) {
|
|
188
|
+
var res = [];
|
|
189
|
+
if (props.data) res = props.data;else res = processChildren(props);
|
|
190
|
+
if (typeof res === 'string') return res[0] === '[' ? JSON.parse(res) : [];
|
|
191
|
+
return res || [];
|
|
192
|
+
}
|
|
193
|
+
}, {
|
|
194
|
+
key: "getDerivedStateFromProps",
|
|
195
|
+
value: function getDerivedStateFromProps(props, state) {
|
|
196
|
+
var _state$data, _state$step_title, _state$data2, _state$step_title_ext, _state$data3;
|
|
197
|
+
|
|
198
|
+
if (props.data) {
|
|
199
|
+
state.data = StepIndicatorProvider.getData(props);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
state.countSteps = (_state$data = state.data) === null || _state$data === void 0 ? void 0 : _state$data.length;
|
|
203
|
+
|
|
204
|
+
if (parseFloat(props.current_step) > -1 && props.current_step !== state._current_step) {
|
|
205
|
+
state.activeStep = parseFloat(props.current_step) || 0;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if (props.active_item !== null && props.active_item !== state._active_item) {
|
|
209
|
+
state.activeStep = parseFloat(props.active_item) || 0;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
if (props.active_url && state.data.length > 0) {
|
|
213
|
+
state.activeStep = state.data.reduce(function (acc, _ref2, i) {
|
|
214
|
+
var url = _ref2.url;
|
|
215
|
+
return url && (url === state.current_step || url === props.active_url) ? i : acc;
|
|
216
|
+
}, parseFloat(state.current_step) || 0);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
if (!state.listOfReachedSteps.includes(state.activeStep)) {
|
|
220
|
+
state.listOfReachedSteps.push(state.activeStep);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
state.stepsLabel = (_state$step_title = state.step_title) === null || _state$step_title === void 0 ? void 0 : _state$step_title.replace('%step', (state.activeStep || 0) + 1).replace('%count', ((_state$data2 = state.data) === null || _state$data2 === void 0 ? void 0 : _state$data2.length) || 1);
|
|
224
|
+
state.stepsLabelExtended = (_state$step_title_ext = state.step_title_extended) === null || _state$step_title_ext === void 0 ? void 0 : _state$step_title_ext.replace('%step', (state.activeStep || 0) + 1).replace('%count', ((_state$data3 = state.data) === null || _state$data3 === void 0 ? void 0 : _state$data3.length) || 1);
|
|
225
|
+
state._current_step = props.current_step;
|
|
226
|
+
state._active_item = props.active_item;
|
|
227
|
+
state._active_url = props.active_url;
|
|
228
|
+
return state;
|
|
229
|
+
}
|
|
95
230
|
}]);
|
|
96
231
|
|
|
97
232
|
return StepIndicatorProvider;
|
|
98
233
|
}(React.PureComponent);
|
|
234
|
+
|
|
235
|
+
_defineProperty(StepIndicatorProvider, "contextType", Context);
|
|
236
|
+
|
|
237
|
+
_defineProperty(StepIndicatorProvider, "defaultProps", {
|
|
238
|
+
isSidebar: false
|
|
239
|
+
});
|
|
240
|
+
|
|
99
241
|
process.env.NODE_ENV !== "production" ? StepIndicatorProvider.propTypes = {
|
|
100
242
|
sidebar_id: PropTypes.string.isRequired,
|
|
101
|
-
children: PropTypes.node.isRequired
|
|
102
|
-
|
|
243
|
+
children: PropTypes.node.isRequired,
|
|
244
|
+
isSidebar: PropTypes.bool
|
|
245
|
+
} : void 0;
|
|
246
|
+
|
|
247
|
+
function extendSafe() {
|
|
248
|
+
var obj = {};
|
|
249
|
+
|
|
250
|
+
for (var _len = arguments.length, objects = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
251
|
+
objects[_key] = arguments[_key];
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
objects.forEach(function (itm) {
|
|
255
|
+
if (itm.defaultProps && itm.props) {
|
|
256
|
+
itm = Object.entries(itm.props).reduce(function (acc, _ref3) {
|
|
257
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
258
|
+
k = _ref4[0],
|
|
259
|
+
v = _ref4[1];
|
|
260
|
+
|
|
261
|
+
if (itm.defaultProps[k] !== v) {
|
|
262
|
+
acc[k] = v;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
return acc;
|
|
266
|
+
}, {});
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
Object.entries(itm).forEach(function (_ref5) {
|
|
270
|
+
var _ref6 = _slicedToArray(_ref5, 2),
|
|
271
|
+
k = _ref6[0],
|
|
272
|
+
v = _ref6[1];
|
|
273
|
+
|
|
274
|
+
if (!obj[k] || obj[k] && v) {
|
|
275
|
+
obj[k] = v;
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
});
|
|
279
|
+
return obj;
|
|
280
|
+
}
|
|
@@ -18,6 +18,7 @@ import "core-js/modules/es.string.includes.js";
|
|
|
18
18
|
import "core-js/modules/es.array.concat.js";
|
|
19
19
|
import "core-js/modules/es.regexp.exec.js";
|
|
20
20
|
import "core-js/modules/es.string.replace.js";
|
|
21
|
+
import "core-js/modules/es.parse-float.js";
|
|
21
22
|
|
|
22
23
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
23
24
|
|
|
@@ -31,7 +32,6 @@ import AnimateHeight from '../../shared/AnimateHeight';
|
|
|
31
32
|
import Button from '../button/Button';
|
|
32
33
|
import Icon from '../icon/Icon';
|
|
33
34
|
import { WarnIcon, InfoIcon, ErrorIcon } from '../../components/form-status/FormStatus';
|
|
34
|
-
import EventEmitter from '../../shared/EventEmitter';
|
|
35
35
|
import StepIndicatorContext from './StepIndicatorContext';
|
|
36
36
|
import { deprecated_v1 } from './StepIndicatorItem-v1';
|
|
37
37
|
|
|
@@ -80,7 +80,6 @@ var StepIndicatorItem = function (_React$PureComponent) {
|
|
|
80
80
|
return typeof process !== 'undefined' && process.env.NODE_ENV === 'development';
|
|
81
81
|
});
|
|
82
82
|
|
|
83
|
-
_this._eventEmitter = EventEmitter.createInstance(context.sidebar_id);
|
|
84
83
|
_this._heightAnim = new AnimateHeight({
|
|
85
84
|
animate: !isTrue(context.no_animation)
|
|
86
85
|
});
|
|
@@ -99,8 +98,6 @@ var StepIndicatorItem = function (_React$PureComponent) {
|
|
|
99
98
|
key: "componentWillUnmount",
|
|
100
99
|
value: function componentWillUnmount() {
|
|
101
100
|
this._heightAnim.remove();
|
|
102
|
-
|
|
103
|
-
this._eventEmitter.remove();
|
|
104
101
|
}
|
|
105
102
|
}, {
|
|
106
103
|
key: "getSnapshotBeforeUpdate",
|
|
@@ -165,7 +162,7 @@ var StepIndicatorItem = function (_React$PureComponent) {
|
|
|
165
162
|
var isVisited = currentItemNum < activeStep;
|
|
166
163
|
var id = "".concat(sidebar_id || makeUniqueId(), "-").concat(currentItemNum);
|
|
167
164
|
var ariaLabel = step_title === null || step_title === void 0 ? void 0 : step_title.replace('%step', currentItemNum + 1).replace('%count', countSteps);
|
|
168
|
-
var isCurrent = currentItemNum === activeStep || isTrue(is_current);
|
|
165
|
+
var isCurrent = currentItemNum === activeStep || isTrue(is_current) && isNaN(parseFloat(activeStep));
|
|
169
166
|
var element = React.createElement(StepItemWrapper, {
|
|
170
167
|
number: currentItemNum + 1,
|
|
171
168
|
hide_numbers: hide_numbers,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import "core-js/modules/es.object.to-string.js";
|
|
2
2
|
import "core-js/modules/es.reflect.construct.js";
|
|
3
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
3
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
5
4
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
6
5
|
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
@@ -9,17 +8,18 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConst
|
|
|
9
8
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
10
9
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
11
10
|
|
|
12
|
-
var _StepIndicatorList;
|
|
11
|
+
var _StepIndicatorList, _StepIndicatorList2;
|
|
13
12
|
|
|
14
13
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
15
14
|
|
|
16
15
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
17
16
|
|
|
18
17
|
import React from 'react';
|
|
18
|
+
import ReactDOM from 'react-dom';
|
|
19
19
|
import Modal from '../modal/Modal';
|
|
20
20
|
import StepIndicatorTriggerButton from './StepIndicatorTriggerButton';
|
|
21
21
|
import StepIndicatorList from './StepIndicatorList';
|
|
22
|
-
import StepIndicatorContext
|
|
22
|
+
import StepIndicatorContext from './StepIndicatorContext';
|
|
23
23
|
|
|
24
24
|
var StepIndicatorModal = function (_React$PureComponent) {
|
|
25
25
|
_inherits(StepIndicatorModal, _React$PureComponent);
|
|
@@ -33,47 +33,51 @@ var StepIndicatorModal = function (_React$PureComponent) {
|
|
|
33
33
|
|
|
34
34
|
_this = _super.call(this, props);
|
|
35
35
|
|
|
36
|
-
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
37
|
-
open_state: false
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
_defineProperty(_assertThisInitialized(_this), "onChangeState", function () {
|
|
41
|
-
_this.setState({
|
|
42
|
-
open_state: false
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
_defineProperty(_assertThisInitialized(_this), "openHandler", function () {
|
|
47
|
-
_this.setState({
|
|
48
|
-
open_state: true
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
|
|
52
36
|
_defineProperty(_assertThisInitialized(_this), "closeHandler", function () {
|
|
53
|
-
_this
|
|
54
|
-
open_state: false
|
|
55
|
-
});
|
|
37
|
+
var _this$context;
|
|
56
38
|
|
|
57
39
|
if (_this.context.hasSidebar) {
|
|
58
40
|
var _this$_triggerRef$cur;
|
|
59
41
|
|
|
60
42
|
(_this$_triggerRef$cur = _this._triggerRef.current) === null || _this$_triggerRef$cur === void 0 ? void 0 : _this$_triggerRef$cur.focus();
|
|
61
43
|
}
|
|
44
|
+
|
|
45
|
+
(_this$context = _this.context).closeHandler.apply(_this$context, arguments);
|
|
62
46
|
});
|
|
63
47
|
|
|
64
48
|
_this._triggerRef = React.createRef();
|
|
49
|
+
_this.state = {
|
|
50
|
+
container: null
|
|
51
|
+
};
|
|
65
52
|
return _this;
|
|
66
53
|
}
|
|
67
54
|
|
|
68
55
|
_createClass(StepIndicatorModal, [{
|
|
56
|
+
key: "componentDidMount",
|
|
57
|
+
value: function componentDidMount() {
|
|
58
|
+
var container = document.getElementById('sidebar__' + this.context.sidebar_id);
|
|
59
|
+
this.setState({
|
|
60
|
+
container: container
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}, {
|
|
64
|
+
key: "renderPortal",
|
|
65
|
+
value: function renderPortal() {
|
|
66
|
+
if (!this.state.container) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return ReactDOM.createPortal(_StepIndicatorList || (_StepIndicatorList = React.createElement(StepIndicatorList, null)), this.state.container);
|
|
71
|
+
}
|
|
72
|
+
}, {
|
|
69
73
|
key: "render",
|
|
70
74
|
value: function render() {
|
|
71
|
-
if (this.context.
|
|
72
|
-
return
|
|
75
|
+
if (this.context.sidebarIsVisible) {
|
|
76
|
+
return this.renderPortal();
|
|
73
77
|
}
|
|
74
78
|
|
|
75
79
|
return React.createElement(React.Fragment, null, React.createElement(StepIndicatorTriggerButton, {
|
|
76
|
-
on_click: this.openHandler,
|
|
80
|
+
on_click: this.context.openHandler,
|
|
77
81
|
inner_ref: this._triggerRef
|
|
78
82
|
}), React.createElement(Modal, {
|
|
79
83
|
id: this.context.sidebar_id,
|
|
@@ -81,19 +85,16 @@ var StepIndicatorModal = function (_React$PureComponent) {
|
|
|
81
85
|
trigger_hidden: true,
|
|
82
86
|
mode: "drawer",
|
|
83
87
|
animation_direction: "bottom",
|
|
84
|
-
open_state: this.
|
|
85
|
-
on_open: this.openHandler,
|
|
88
|
+
open_state: this.context.openState,
|
|
89
|
+
on_open: this.context.openHandler,
|
|
86
90
|
on_close: this.closeHandler
|
|
87
|
-
}, React.createElement(
|
|
88
|
-
sidebar_id: this.context.sidebar_id,
|
|
89
|
-
onChangeState: this.onChangeState
|
|
90
|
-
}), React.createElement(Modal.Content, {
|
|
91
|
+
}, React.createElement(Modal.Content, {
|
|
91
92
|
style_type: "white"
|
|
92
93
|
}, React.createElement("div", {
|
|
93
94
|
className: "dnb-step-indicator-v2"
|
|
94
95
|
}, React.createElement("p", {
|
|
95
96
|
className: "dnb-p dnb-step-indicator__label"
|
|
96
|
-
}, this.context.stepsLabelExtended),
|
|
97
|
+
}, this.context.stepsLabelExtended), _StepIndicatorList2 || (_StepIndicatorList2 = React.createElement(StepIndicatorList, null))))));
|
|
97
98
|
}
|
|
98
99
|
}]);
|
|
99
100
|
|
|
@@ -28,7 +28,7 @@ export var stepIndicatorPropTypes = _objectSpread(_objectSpread({
|
|
|
28
28
|
is_active: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
29
29
|
url_future: PropTypes.string,
|
|
30
30
|
url_passed: PropTypes.string
|
|
31
|
-
}))])
|
|
31
|
+
}))]),
|
|
32
32
|
overview_title: PropTypes.string,
|
|
33
33
|
step_title_extended: PropTypes.string,
|
|
34
34
|
step_title: PropTypes.string,
|
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
export type StepIndicatorSidebarMode = 'static' | 'strict' | 'loose';
|
|
3
|
+
export type StepIndicatorSidebarCurrentStep = string | number;
|
|
4
|
+
export type StepIndicatorSidebarData =
|
|
5
|
+
| string
|
|
6
|
+
| string[]
|
|
7
|
+
| {
|
|
8
|
+
title: string | React.ReactNode;
|
|
9
|
+
is_current?: boolean;
|
|
10
|
+
inactive?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
status?: string | React.ReactNode;
|
|
13
|
+
status_state?: 'warn' | 'info' | 'error';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Will be called once the users clicks on the current or another step. Will be emitted on every click. Returns an object `{ event, item, current_step }`.
|
|
17
|
+
*/
|
|
18
|
+
on_click?: (...args: any[]) => any;
|
|
19
|
+
on_render?: (...args: any[]) => any;
|
|
20
|
+
url?: string;
|
|
21
|
+
is_active?: string | boolean;
|
|
22
|
+
url_future?: string;
|
|
23
|
+
url_passed?: string;
|
|
24
|
+
}[];
|
|
2
25
|
|
|
3
26
|
/**
|
|
4
27
|
* NB: Do not change the docs (comments) in here. The docs are updated during build time by "generateTypes.js" and "fetchPropertiesFromDocs.js".
|
|
@@ -9,7 +32,23 @@ export interface StepIndicatorSidebarProps
|
|
|
9
32
|
* An unique string based ID in order to bind together the main component and the sidebar (`<StepIndicator.Sidebar />`). Both have to get the same ID.
|
|
10
33
|
*/
|
|
11
34
|
sidebar_id: string;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* 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.
|
|
38
|
+
*/
|
|
39
|
+
mode?: StepIndicatorSidebarMode;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Defines the active number marked step starting by 0. Defaults to `0`.
|
|
43
|
+
*/
|
|
44
|
+
current_step?: StepIndicatorSidebarCurrentStep;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Defines the data/steps showing up in a JavaScript Array or JSON format like `[{title,is_current}]`. See parameters and example above.
|
|
48
|
+
*/
|
|
49
|
+
data?: StepIndicatorSidebarData;
|
|
12
50
|
internalId?: string;
|
|
51
|
+
showInitialData?: boolean;
|
|
13
52
|
}
|
|
14
53
|
export default class StepIndicatorSidebar extends React.Component<
|
|
15
54
|
StepIndicatorSidebarProps,
|