@dnb/eufemia 9.17.2 → 9.18.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 +14 -0
- package/cjs/components/Tag.d.ts +14 -0
- package/cjs/components/Tag.js +52 -0
- package/cjs/components/accordion/Accordion.d.ts +7 -7
- package/cjs/components/autocomplete/Autocomplete.d.ts +13 -13
- package/cjs/components/button/Button.d.ts +7 -7
- package/cjs/components/button/Button.js +6 -4
- package/cjs/components/checkbox/Checkbox.d.ts +3 -3
- package/cjs/components/date-picker/DatePicker.d.ts +14 -14
- package/cjs/components/date-picker/DatePickerAddon.d.ts +1 -1
- package/cjs/components/date-picker/DatePickerCalendar.d.ts +1 -1
- package/cjs/components/date-picker/DatePickerInput.d.ts +1 -1
- package/cjs/components/dropdown/Dropdown.d.ts +9 -9
- package/cjs/components/form-row/FormRow.d.ts +4 -4
- package/cjs/components/form-set/FormSet.d.ts +5 -5
- package/cjs/components/global-error/GlobalError.d.ts +1 -1
- package/cjs/components/global-status/GlobalStatus.d.ts +5 -5
- package/cjs/components/heading/Heading.d.ts +2 -2
- package/cjs/components/heading/HeadingProvider.d.ts +2 -2
- package/cjs/components/icon/Icon.d.ts +1 -1
- package/cjs/components/icon-primary/IconPrimary.d.ts +1 -1
- package/cjs/components/index.d.ts +2 -0
- package/cjs/components/index.js +8 -0
- package/cjs/components/input/Input.d.ts +9 -9
- package/cjs/components/input-masked/InputMasked.d.ts +11 -11
- package/cjs/components/input-masked/InputMasked.js +6 -3
- package/cjs/components/input-masked/InputMaskedHooks.js +26 -34
- package/cjs/components/input-masked/InputMaskedUtils.js +9 -20
- package/cjs/components/lib.js +9 -0
- package/cjs/components/modal/Modal.js +123 -271
- package/cjs/components/modal/ModalContent.js +145 -243
- package/cjs/components/modal/ModalRoot.js +194 -0
- package/cjs/components/modal/components/CloseButton.js +125 -0
- package/cjs/components/modal/components/ModalHeader.js +124 -0
- package/cjs/components/modal/{ModalHeader.js → components/ModalHeaderBar.js} +50 -162
- package/cjs/components/modal/{ModalInner.js → components/ModalInner.js} +11 -19
- package/cjs/components/modal/helpers.js +80 -0
- package/cjs/components/modal/types.js +1 -0
- package/cjs/components/number-format/NumberFormat.d.ts +8 -8
- package/cjs/components/pagination/Pagination.d.ts +30 -30
- package/cjs/components/pagination/PaginationProvider.d.ts +2 -2
- package/cjs/components/radio/Radio.d.ts +4 -4
- package/cjs/components/radio/RadioGroup.d.ts +3 -3
- package/cjs/components/section/Section.d.ts +3 -2
- package/cjs/components/skeleton/Skeleton.d.ts +2 -2
- package/cjs/components/slider/Slider.d.ts +4 -4
- package/cjs/components/step-indicator/StepIndicator.d.ts +5 -5
- package/cjs/components/step-indicator/StepIndicatorContext.d.ts +1 -1
- package/cjs/components/step-indicator/StepIndicatorItem.d.ts +2 -2
- package/cjs/components/step-indicator/StepIndicatorItem.js +1 -0
- package/cjs/components/step-indicator/StepIndicatorSidebar.d.ts +3 -3
- package/cjs/components/step-indicator/StepIndicatorTriggerButton.d.ts +1 -1
- package/cjs/components/switch/Switch.d.ts +5 -5
- package/cjs/components/tabs/Tabs.d.ts +4 -4
- package/cjs/components/tabs/TabsContentWrapper.d.ts +1 -1
- package/cjs/components/tag/Tag.js +97 -0
- package/cjs/components/tag/index.d.ts +8 -0
- package/cjs/components/tag/index.js +52 -0
- package/cjs/components/tag/style/_tag.scss +26 -0
- package/cjs/components/tag/style/dnb-tag.css +109 -0
- package/cjs/components/tag/style/dnb-tag.min.css +1 -0
- package/cjs/components/tag/style/dnb-tag.scss +12 -0
- package/cjs/components/tag/style/index.d.ts +6 -0
- package/cjs/components/tag/style/index.js +3 -0
- package/cjs/components/tag/style.js +3 -0
- package/cjs/components/textarea/Textarea.d.ts +4 -4
- package/cjs/components/toggle-button/ToggleButton.d.ts +6 -6
- package/cjs/components/toggle-button/ToggleButtonGroup.d.ts +3 -3
- package/cjs/components/tooltip/Tooltip.d.ts +5 -5
- package/cjs/components/tooltip/TooltipContainer.d.ts +3 -3
- package/cjs/components/tooltip/TooltipPortal.d.ts +1 -1
- package/cjs/components/tooltip/TooltipWithEvents.d.ts +1 -1
- package/cjs/fragments/scroll-view/ScrollView.js +7 -16
- package/cjs/index.d.ts +2 -0
- package/cjs/index.js +8 -0
- package/cjs/shared/Context.js +2 -1
- package/cjs/style/core/helper-classes/skip-link.scss +1 -1
- package/cjs/style/dnb-ui-components.css +40 -0
- package/cjs/style/dnb-ui-components.min.css +1 -1
- package/cjs/style/dnb-ui-components.scss +1 -0
- package/components/Tag.d.ts +14 -0
- package/components/Tag.js +3 -0
- package/components/accordion/Accordion.d.ts +7 -7
- package/components/autocomplete/Autocomplete.d.ts +13 -13
- package/components/button/Button.d.ts +7 -7
- package/components/button/Button.js +6 -4
- package/components/checkbox/Checkbox.d.ts +3 -3
- package/components/date-picker/DatePicker.d.ts +14 -14
- package/components/date-picker/DatePickerAddon.d.ts +1 -1
- package/components/date-picker/DatePickerCalendar.d.ts +1 -1
- package/components/date-picker/DatePickerInput.d.ts +1 -1
- package/components/dropdown/Dropdown.d.ts +9 -9
- package/components/form-row/FormRow.d.ts +4 -4
- package/components/form-set/FormSet.d.ts +5 -5
- package/components/global-error/GlobalError.d.ts +1 -1
- package/components/global-status/GlobalStatus.d.ts +5 -5
- package/components/heading/Heading.d.ts +2 -2
- package/components/heading/HeadingProvider.d.ts +2 -2
- package/components/icon/Icon.d.ts +1 -1
- package/components/index.d.ts +2 -0
- package/components/index.js +2 -1
- package/components/input/Input.d.ts +9 -9
- package/components/input-masked/InputMasked.d.ts +11 -11
- package/components/input-masked/InputMasked.js +6 -4
- package/components/input-masked/InputMaskedHooks.js +24 -28
- package/components/input-masked/InputMaskedUtils.js +9 -20
- package/components/lib.js +3 -1
- package/components/modal/Modal.js +112 -250
- package/components/modal/Modal.tsx +524 -0
- package/components/modal/ModalContent.js +137 -224
- package/components/modal/ModalContent.tsx +515 -0
- package/components/modal/ModalContext.tsx +10 -0
- package/components/modal/ModalRoot.js +145 -0
- package/components/modal/ModalRoot.tsx +131 -0
- package/components/modal/components/CloseButton.js +72 -0
- package/components/modal/components/CloseButton.tsx +56 -0
- package/components/modal/components/ModalHeader.js +70 -0
- package/components/modal/components/ModalHeader.tsx +79 -0
- package/components/modal/components/ModalHeaderBar.js +122 -0
- package/components/modal/components/ModalHeaderBar.tsx +118 -0
- package/components/modal/{ModalInner.js → components/ModalInner.js} +11 -17
- package/components/modal/components/ModalInner.tsx +45 -0
- package/components/modal/helpers.js +64 -0
- package/components/modal/helpers.ts +63 -0
- package/components/modal/types.js +1 -0
- package/{cjs/components/modal/Modal.d.ts → components/modal/types.ts} +124 -182
- package/components/number-format/NumberFormat.d.ts +8 -8
- package/components/pagination/Pagination.d.ts +30 -30
- package/components/pagination/PaginationProvider.d.ts +2 -2
- package/components/radio/Radio.d.ts +4 -4
- package/components/radio/RadioGroup.d.ts +3 -3
- package/components/section/Section.d.ts +3 -1
- package/components/skeleton/Skeleton.d.ts +2 -2
- package/components/slider/Slider.d.ts +4 -4
- package/components/step-indicator/StepIndicator.d.ts +5 -5
- package/components/step-indicator/StepIndicatorContext.d.ts +1 -1
- package/components/step-indicator/StepIndicatorItem.d.ts +2 -2
- package/components/step-indicator/StepIndicatorItem.js +1 -0
- package/components/step-indicator/StepIndicatorSidebar.d.ts +3 -3
- package/components/step-indicator/StepIndicatorTriggerButton.d.ts +1 -1
- package/components/switch/Switch.d.ts +5 -5
- package/components/tabs/Tabs.d.ts +4 -4
- package/components/tabs/TabsContentWrapper.d.ts +1 -1
- package/components/tag/Tag.js +63 -0
- package/components/tag/Tag.tsx +95 -0
- package/components/tag/index.d.ts +8 -0
- package/components/tag/index.js +3 -0
- package/components/tag/style/_tag.scss +26 -0
- package/components/tag/style/dnb-tag.css +109 -0
- package/components/tag/style/dnb-tag.min.css +1 -0
- package/components/tag/style/dnb-tag.scss +12 -0
- package/components/tag/style/index.d.ts +6 -0
- package/components/tag/style/index.js +1 -0
- package/components/tag/style.js +1 -0
- package/components/textarea/Textarea.d.ts +4 -4
- package/components/toggle-button/ToggleButton.d.ts +6 -6
- package/components/toggle-button/ToggleButtonGroup.d.ts +3 -3
- package/components/tooltip/Tooltip.d.ts +5 -5
- package/components/tooltip/TooltipContainer.d.ts +3 -3
- package/components/tooltip/TooltipPortal.d.ts +1 -1
- package/components/tooltip/TooltipWithEvents.d.ts +1 -1
- package/es/components/Tag.d.ts +14 -0
- package/es/components/Tag.js +3 -0
- package/es/components/accordion/Accordion.d.ts +7 -7
- package/es/components/autocomplete/Autocomplete.d.ts +13 -13
- package/es/components/button/Button.d.ts +7 -7
- package/es/components/button/Button.js +6 -4
- package/es/components/checkbox/Checkbox.d.ts +3 -3
- package/es/components/date-picker/DatePicker.d.ts +14 -14
- package/es/components/date-picker/DatePickerAddon.d.ts +1 -1
- package/es/components/date-picker/DatePickerCalendar.d.ts +1 -1
- package/es/components/date-picker/DatePickerInput.d.ts +1 -1
- package/es/components/dropdown/Dropdown.d.ts +9 -9
- package/es/components/form-row/FormRow.d.ts +4 -4
- package/es/components/form-set/FormSet.d.ts +5 -5
- package/es/components/global-error/GlobalError.d.ts +1 -1
- package/es/components/global-status/GlobalStatus.d.ts +5 -5
- package/es/components/heading/Heading.d.ts +2 -2
- package/es/components/heading/HeadingProvider.d.ts +2 -2
- package/es/components/icon/Icon.d.ts +1 -1
- package/es/components/icon-primary/IconPrimary.d.ts +1 -1
- package/es/components/index.d.ts +2 -0
- package/es/components/index.js +2 -1
- package/es/components/input/Input.d.ts +9 -9
- package/es/components/input-masked/InputMasked.d.ts +11 -11
- package/es/components/input-masked/InputMasked.js +6 -4
- package/es/components/input-masked/InputMaskedHooks.js +14 -18
- package/es/components/input-masked/InputMaskedUtils.js +7 -18
- package/es/components/lib.js +3 -1
- package/es/components/modal/Modal.js +97 -227
- package/es/components/modal/Modal.tsx +524 -0
- package/es/components/modal/ModalContent.js +95 -186
- package/es/components/modal/ModalContent.tsx +515 -0
- package/es/components/modal/ModalContext.tsx +10 -0
- package/es/components/modal/ModalRoot.js +108 -0
- package/es/components/modal/ModalRoot.tsx +131 -0
- package/es/components/modal/components/CloseButton.js +41 -0
- package/es/components/modal/components/CloseButton.tsx +56 -0
- package/es/components/modal/components/ModalHeader.js +40 -0
- package/es/components/modal/components/ModalHeader.tsx +79 -0
- package/es/components/modal/components/ModalHeaderBar.js +88 -0
- package/es/components/modal/components/ModalHeaderBar.tsx +118 -0
- package/es/components/modal/{ModalInner.js → components/ModalInner.js} +8 -18
- package/es/components/modal/components/ModalInner.tsx +45 -0
- package/es/components/modal/helpers.js +60 -0
- package/es/components/modal/helpers.ts +63 -0
- package/es/components/modal/types.js +1 -0
- package/es/components/modal/{Modal.d.ts → types.ts} +124 -182
- package/es/components/number-format/NumberFormat.d.ts +8 -8
- package/es/components/pagination/Pagination.d.ts +30 -30
- package/es/components/pagination/PaginationProvider.d.ts +2 -2
- package/es/components/radio/Radio.d.ts +4 -4
- package/es/components/radio/RadioGroup.d.ts +3 -3
- package/es/components/section/Section.d.ts +3 -2
- package/es/components/skeleton/Skeleton.d.ts +2 -2
- package/es/components/slider/Slider.d.ts +4 -4
- package/es/components/step-indicator/StepIndicator.d.ts +5 -5
- package/es/components/step-indicator/StepIndicatorContext.d.ts +1 -1
- package/es/components/step-indicator/StepIndicatorItem.d.ts +2 -2
- package/es/components/step-indicator/StepIndicatorItem.js +1 -0
- package/es/components/step-indicator/StepIndicatorSidebar.d.ts +3 -3
- package/es/components/step-indicator/StepIndicatorTriggerButton.d.ts +1 -1
- package/es/components/switch/Switch.d.ts +5 -5
- package/es/components/tabs/Tabs.d.ts +4 -4
- package/es/components/tabs/TabsContentWrapper.d.ts +1 -1
- package/es/components/tag/Tag.js +58 -0
- package/es/components/tag/Tag.tsx +95 -0
- package/es/components/tag/index.d.ts +8 -0
- package/es/components/tag/index.js +3 -0
- package/es/components/tag/style/_tag.scss +26 -0
- package/es/components/tag/style/dnb-tag.css +109 -0
- package/es/components/tag/style/dnb-tag.min.css +1 -0
- package/es/components/tag/style/dnb-tag.scss +12 -0
- package/es/components/tag/style/index.d.ts +6 -0
- package/es/components/tag/style/index.js +1 -0
- package/es/components/tag/style.js +1 -0
- package/es/components/textarea/Textarea.d.ts +4 -4
- package/es/components/toggle-button/ToggleButton.d.ts +6 -6
- package/es/components/toggle-button/ToggleButtonGroup.d.ts +3 -3
- package/es/components/tooltip/Tooltip.d.ts +5 -5
- package/es/components/tooltip/TooltipContainer.d.ts +3 -3
- package/es/components/tooltip/TooltipPortal.d.ts +1 -1
- package/es/components/tooltip/TooltipWithEvents.d.ts +1 -1
- package/es/fragments/scroll-view/ScrollView.js +7 -15
- package/es/fragments/scroll-view/ScrollView.tsx +92 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +2 -1
- package/es/shared/Context.js +2 -1
- package/es/style/core/helper-classes/skip-link.scss +1 -1
- package/es/style/dnb-ui-components.css +40 -0
- package/es/style/dnb-ui-components.min.css +1 -1
- package/es/style/dnb-ui-components.scss +1 -0
- package/esm/components/Tag.d.ts +14 -0
- package/esm/components/Tag.js +3 -0
- package/esm/components/accordion/Accordion.d.ts +7 -7
- package/esm/components/autocomplete/Autocomplete.d.ts +13 -13
- package/esm/components/button/Button.d.ts +7 -7
- package/esm/components/button/Button.js +6 -4
- package/esm/components/checkbox/Checkbox.d.ts +3 -3
- package/esm/components/date-picker/DatePicker.d.ts +14 -14
- package/esm/components/date-picker/DatePickerAddon.d.ts +1 -1
- package/esm/components/date-picker/DatePickerCalendar.d.ts +1 -1
- package/esm/components/date-picker/DatePickerInput.d.ts +1 -1
- package/esm/components/dropdown/Dropdown.d.ts +9 -9
- package/esm/components/form-row/FormRow.d.ts +4 -4
- package/esm/components/form-set/FormSet.d.ts +5 -5
- package/esm/components/global-error/GlobalError.d.ts +1 -1
- package/esm/components/global-status/GlobalStatus.d.ts +5 -5
- package/esm/components/heading/Heading.d.ts +2 -2
- package/esm/components/heading/HeadingProvider.d.ts +2 -2
- package/esm/components/icon/Icon.d.ts +1 -1
- package/esm/components/index.d.ts +2 -0
- package/esm/components/index.js +2 -1
- package/esm/components/input/Input.d.ts +9 -9
- package/esm/components/input-masked/InputMasked.d.ts +11 -11
- package/esm/components/input-masked/InputMasked.js +6 -4
- package/esm/components/input-masked/InputMaskedHooks.js +24 -28
- package/esm/components/input-masked/InputMaskedUtils.js +9 -20
- package/esm/components/lib.js +3 -1
- package/esm/components/modal/Modal.js +112 -250
- package/esm/components/modal/Modal.tsx +524 -0
- package/esm/components/modal/ModalContent.js +137 -224
- package/esm/components/modal/ModalContent.tsx +515 -0
- package/esm/components/modal/ModalContext.tsx +10 -0
- package/esm/components/modal/ModalRoot.js +145 -0
- package/esm/components/modal/ModalRoot.tsx +131 -0
- package/esm/components/modal/components/CloseButton.js +72 -0
- package/esm/components/modal/components/CloseButton.tsx +56 -0
- package/esm/components/modal/components/ModalHeader.js +70 -0
- package/esm/components/modal/components/ModalHeader.tsx +79 -0
- package/esm/components/modal/components/ModalHeaderBar.js +122 -0
- package/esm/components/modal/components/ModalHeaderBar.tsx +118 -0
- package/esm/components/modal/{ModalInner.js → components/ModalInner.js} +11 -17
- package/esm/components/modal/components/ModalInner.tsx +45 -0
- package/esm/components/modal/helpers.js +64 -0
- package/esm/components/modal/helpers.ts +63 -0
- package/esm/components/modal/types.js +1 -0
- package/esm/components/modal/{Modal.d.ts → types.ts} +124 -182
- package/esm/components/number-format/NumberFormat.d.ts +8 -8
- package/esm/components/pagination/Pagination.d.ts +30 -30
- package/esm/components/pagination/PaginationProvider.d.ts +2 -2
- package/esm/components/radio/Radio.d.ts +4 -4
- package/esm/components/radio/RadioGroup.d.ts +3 -3
- package/esm/components/section/Section.d.ts +3 -1
- package/esm/components/skeleton/Skeleton.d.ts +2 -2
- package/esm/components/slider/Slider.d.ts +4 -4
- package/esm/components/step-indicator/StepIndicator.d.ts +5 -5
- package/esm/components/step-indicator/StepIndicatorContext.d.ts +1 -1
- package/esm/components/step-indicator/StepIndicatorItem.d.ts +2 -2
- package/esm/components/step-indicator/StepIndicatorItem.js +1 -0
- package/esm/components/step-indicator/StepIndicatorSidebar.d.ts +3 -3
- package/esm/components/step-indicator/StepIndicatorTriggerButton.d.ts +1 -1
- package/esm/components/switch/Switch.d.ts +5 -5
- package/esm/components/tabs/Tabs.d.ts +4 -4
- package/esm/components/tabs/TabsContentWrapper.d.ts +1 -1
- package/esm/components/tag/Tag.js +63 -0
- package/esm/components/tag/Tag.tsx +95 -0
- package/esm/components/tag/index.d.ts +8 -0
- package/esm/components/tag/index.js +3 -0
- package/esm/components/tag/style/_tag.scss +26 -0
- package/esm/components/tag/style/dnb-tag.css +109 -0
- package/esm/components/tag/style/dnb-tag.min.css +1 -0
- package/esm/components/tag/style/dnb-tag.scss +12 -0
- package/esm/components/tag/style/index.d.ts +6 -0
- package/esm/components/tag/style/index.js +1 -0
- package/esm/components/tag/style.js +1 -0
- package/esm/components/textarea/Textarea.d.ts +4 -4
- package/esm/components/toggle-button/ToggleButton.d.ts +6 -6
- package/esm/components/toggle-button/ToggleButtonGroup.d.ts +3 -3
- package/esm/components/tooltip/Tooltip.d.ts +5 -5
- package/esm/components/tooltip/TooltipContainer.d.ts +3 -3
- package/esm/components/tooltip/TooltipPortal.d.ts +1 -1
- package/esm/components/tooltip/TooltipWithEvents.d.ts +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 +2 -2
- package/esm/dnb-ui-web-components.min.mjs +2 -2
- package/esm/fragments/scroll-view/ScrollView.js +10 -16
- package/esm/fragments/scroll-view/ScrollView.tsx +92 -0
- package/esm/index.d.ts +2 -0
- package/esm/index.js +2 -1
- package/esm/shared/Context.js +2 -1
- package/esm/style/core/helper-classes/skip-link.scss +1 -1
- package/esm/style/dnb-ui-components.css +40 -0
- package/esm/style/dnb-ui-components.min.css +1 -1
- package/esm/style/dnb-ui-components.scss +1 -0
- package/fragments/scroll-view/ScrollView.js +10 -16
- package/fragments/scroll-view/ScrollView.tsx +92 -0
- package/index.d.ts +2 -0
- package/index.js +2 -1
- package/package.json +1 -1
- package/shared/Context.js +2 -1
- package/style/core/helper-classes/skip-link.scss +1 -1
- package/style/dnb-ui-components.css +40 -0
- package/style/dnb-ui-components.min.css +1 -1
- package/style/dnb-ui-components.scss +1 -0
- package/umd/dnb-ui-components.min.js +5 -5
- 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 +4 -4
- package/umd/dnb-ui-web-components.min.js +2 -2
- package/cjs/components/modal/ModalContent.d.ts +0 -168
- package/cjs/components/modal/ModalHeader.d.ts +0 -73
- package/cjs/components/modal/ModalInner.d.ts +0 -20
- package/cjs/fragments/scroll-view/ScrollView.d.ts +0 -1
- package/components/modal/Modal.d.ts +0 -329
- package/components/modal/ModalContent.d.ts +0 -168
- package/components/modal/ModalHeader.d.ts +0 -73
- package/components/modal/ModalHeader.js +0 -224
- package/components/modal/ModalInner.d.ts +0 -20
- package/es/components/modal/ModalContent.d.ts +0 -168
- package/es/components/modal/ModalHeader.d.ts +0 -73
- package/es/components/modal/ModalHeader.js +0 -166
- package/es/components/modal/ModalInner.d.ts +0 -20
- package/es/fragments/scroll-view/ScrollView.d.ts +0 -1
- package/esm/components/modal/ModalContent.d.ts +0 -168
- package/esm/components/modal/ModalHeader.d.ts +0 -73
- package/esm/components/modal/ModalHeader.js +0 -224
- package/esm/components/modal/ModalInner.d.ts +0 -20
- package/esm/fragments/scroll-view/ScrollView.d.ts +0 -1
- package/fragments/scroll-view/ScrollView.d.ts +0 -1
|
@@ -2,31 +2,47 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
4
|
const _excluded = ["triggeredBy"],
|
|
5
|
-
_excluded2 = ["mode", "hide", "title", "labelled_by", "header_content", "modal_content", "bar_content", "id", "close_title", "dialog_title", "hide_close_button", "close_button_attributes", "spacing", "
|
|
5
|
+
_excluded2 = ["mode", "hide", "title", "labelled_by", "header_content", "modal_content", "bar_content", "id", "close_title", "dialog_title", "hide_close_button", "close_button_attributes", "spacing", "prevent_core_style", "animation_duration", "no_animation", "no_animation_on_mobile", "min_width", "max_width", "fullscreen", "align_content", "container_placement", "closeModal", "className", "class", "content_class", "overlay_class", "content_id", "children"];
|
|
6
6
|
|
|
7
7
|
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; }
|
|
8
8
|
|
|
9
9
|
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; }
|
|
10
10
|
|
|
11
11
|
import React from 'react';
|
|
12
|
-
import PropTypes from 'prop-types';
|
|
13
12
|
import classnames from 'classnames';
|
|
14
13
|
import keycode from 'keycode';
|
|
15
14
|
import { disableBodyScroll, enableBodyScroll, clearAllBodyScrollLocks } from './bodyScrollLock';
|
|
16
15
|
import { warn, isTrue, makeUniqueId, InteractionInvalidation, findElementInChildren, combineLabelledBy, combineDescribedBy, validateDOMAttributes, dispatchCustomElementEvent } from '../../shared/component-helper';
|
|
17
16
|
import ScrollView from '../../fragments/scroll-view/ScrollView';
|
|
18
17
|
import ModalContext from './ModalContext';
|
|
19
|
-
import ModalHeader
|
|
20
|
-
import
|
|
18
|
+
import ModalHeader from './components/ModalHeader';
|
|
19
|
+
import ModalHeaderBar from './components/ModalHeaderBar';
|
|
20
|
+
import { IS_IOS, IS_SAFARI, IS_MAC, isAndroid } from '../../shared/helpers';
|
|
21
|
+
import { getListOfModalRoots, getModalRoot, addToIndex, removeFromIndex } from './helpers';
|
|
21
22
|
export default class ModalContent extends React.PureComponent {
|
|
22
23
|
constructor(props) {
|
|
23
24
|
super(props);
|
|
24
25
|
|
|
25
26
|
_defineProperty(this, "state", {
|
|
26
27
|
triggeredBy: null,
|
|
27
|
-
triggeredByEvent: null
|
|
28
|
+
triggeredByEvent: null,
|
|
29
|
+
color: null
|
|
28
30
|
});
|
|
29
31
|
|
|
32
|
+
_defineProperty(this, "_contentRef", void 0);
|
|
33
|
+
|
|
34
|
+
_defineProperty(this, "_id", void 0);
|
|
35
|
+
|
|
36
|
+
_defineProperty(this, "_lockTimeout", void 0);
|
|
37
|
+
|
|
38
|
+
_defineProperty(this, "_focusTimeout", void 0);
|
|
39
|
+
|
|
40
|
+
_defineProperty(this, "_androidFocusTimeout", void 0);
|
|
41
|
+
|
|
42
|
+
_defineProperty(this, "_ii", void 0);
|
|
43
|
+
|
|
44
|
+
_defineProperty(this, "_iiLocal", void 0);
|
|
45
|
+
|
|
30
46
|
_defineProperty(this, "lockBody", () => {
|
|
31
47
|
const modalRoots = getListOfModalRoots();
|
|
32
48
|
const firstLevel = modalRoots[0];
|
|
@@ -53,6 +69,10 @@ export default class ModalContent extends React.PureComponent {
|
|
|
53
69
|
});
|
|
54
70
|
|
|
55
71
|
_defineProperty(this, "_androidFocusHelper", () => {
|
|
72
|
+
const {
|
|
73
|
+
animation_duration = null
|
|
74
|
+
} = this.props;
|
|
75
|
+
const timeoutDuration = typeof animation_duration === 'string' ? parseFloat(animation_duration) : animation_duration;
|
|
56
76
|
clearTimeout(this._androidFocusTimeout);
|
|
57
77
|
this._androidFocusTimeout = setTimeout(() => {
|
|
58
78
|
try {
|
|
@@ -62,37 +82,37 @@ export default class ModalContent extends React.PureComponent {
|
|
|
62
82
|
document.activeElement.scrollIntoView();
|
|
63
83
|
}
|
|
64
84
|
} catch (e) {}
|
|
65
|
-
},
|
|
85
|
+
}, timeoutDuration / 2);
|
|
66
86
|
});
|
|
67
87
|
|
|
68
|
-
_defineProperty(this, "preventClick",
|
|
69
|
-
if (
|
|
70
|
-
|
|
88
|
+
_defineProperty(this, "preventClick", event => {
|
|
89
|
+
if (event) {
|
|
90
|
+
event.stopPropagation();
|
|
71
91
|
}
|
|
72
92
|
});
|
|
73
93
|
|
|
74
|
-
_defineProperty(this, "onCloseClickHandler",
|
|
75
|
-
this.
|
|
94
|
+
_defineProperty(this, "onCloseClickHandler", event => {
|
|
95
|
+
this.closeModalContent(event, {
|
|
76
96
|
triggeredBy: 'button'
|
|
77
97
|
});
|
|
78
98
|
});
|
|
79
99
|
|
|
80
|
-
_defineProperty(this, "onContentClickHandler",
|
|
81
|
-
this.
|
|
100
|
+
_defineProperty(this, "onContentClickHandler", event => {
|
|
101
|
+
this.closeModalContent(event, {
|
|
82
102
|
triggeredBy: 'overlay',
|
|
83
103
|
ifIsLatest: false
|
|
84
104
|
});
|
|
85
105
|
});
|
|
86
106
|
|
|
87
|
-
_defineProperty(this, "onKeyDownHandler",
|
|
88
|
-
switch (keycode(
|
|
107
|
+
_defineProperty(this, "onKeyDownHandler", event => {
|
|
108
|
+
switch (keycode(event)) {
|
|
89
109
|
case 'esc':
|
|
90
110
|
{
|
|
91
|
-
const mostCurrent =
|
|
111
|
+
const mostCurrent = getModalRoot(-1);
|
|
92
112
|
|
|
93
113
|
if (mostCurrent === this) {
|
|
94
|
-
|
|
95
|
-
this.
|
|
114
|
+
event.preventDefault();
|
|
115
|
+
this.closeModalContent(event, {
|
|
96
116
|
triggeredBy: 'keyboard'
|
|
97
117
|
});
|
|
98
118
|
}
|
|
@@ -103,6 +123,7 @@ export default class ModalContent extends React.PureComponent {
|
|
|
103
123
|
});
|
|
104
124
|
|
|
105
125
|
_defineProperty(this, "setBackgroundColor", color => {
|
|
126
|
+
document.documentElement.style.setProperty('--modal-background-color', color);
|
|
106
127
|
this.setState({
|
|
107
128
|
color
|
|
108
129
|
});
|
|
@@ -113,19 +134,24 @@ export default class ModalContent extends React.PureComponent {
|
|
|
113
134
|
}
|
|
114
135
|
|
|
115
136
|
componentDidMount() {
|
|
116
|
-
|
|
137
|
+
const {
|
|
138
|
+
id = null,
|
|
139
|
+
no_animation = false,
|
|
140
|
+
animation_duration = null
|
|
141
|
+
} = this.props;
|
|
142
|
+
const timeoutDuration = typeof animation_duration === 'string' ? parseFloat(animation_duration) : animation_duration;
|
|
143
|
+
addToIndex(this);
|
|
117
144
|
this.removeScrollPossibility();
|
|
118
145
|
this.setFocus();
|
|
119
146
|
this.setAndroidFocusHelper();
|
|
120
|
-
const id = this.props.id;
|
|
121
147
|
dispatchCustomElementEvent(this, 'on_open', {
|
|
122
148
|
id
|
|
123
149
|
});
|
|
124
150
|
|
|
125
|
-
if (isTrue(
|
|
151
|
+
if (isTrue(no_animation) || process.env.NODE_ENV === 'test') {
|
|
126
152
|
this.lockBody();
|
|
127
153
|
} else {
|
|
128
|
-
this._lockTimeout = setTimeout(this.lockBody,
|
|
154
|
+
this._lockTimeout = setTimeout(this.lockBody, timeoutDuration * 1.2);
|
|
129
155
|
}
|
|
130
156
|
}
|
|
131
157
|
|
|
@@ -138,7 +164,7 @@ export default class ModalContent extends React.PureComponent {
|
|
|
138
164
|
removeLocks() {
|
|
139
165
|
const modalRoots = getListOfModalRoots();
|
|
140
166
|
const firstLevel = modalRoots[0];
|
|
141
|
-
|
|
167
|
+
removeFromIndex(this);
|
|
142
168
|
|
|
143
169
|
if (firstLevel === this) {
|
|
144
170
|
var _this$_ii;
|
|
@@ -177,7 +203,7 @@ export default class ModalContent extends React.PureComponent {
|
|
|
177
203
|
}
|
|
178
204
|
|
|
179
205
|
setAndroidFocusHelper() {
|
|
180
|
-
if (typeof window !== 'undefined' &&
|
|
206
|
+
if (typeof window !== 'undefined' && isAndroid()) {
|
|
181
207
|
window.addEventListener('resize', this._androidFocusHelper);
|
|
182
208
|
}
|
|
183
209
|
}
|
|
@@ -187,41 +213,14 @@ export default class ModalContent extends React.PureComponent {
|
|
|
187
213
|
clearTimeout(this._androidFocusTimeout);
|
|
188
214
|
}
|
|
189
215
|
|
|
190
|
-
addToIndex() {
|
|
191
|
-
if (typeof window !== 'undefined') {
|
|
192
|
-
try {
|
|
193
|
-
if (!Array.isArray(window.__modalStack)) {
|
|
194
|
-
window.__modalStack = [];
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
window.__modalStack.push(this);
|
|
198
|
-
} catch (e) {
|
|
199
|
-
warn(e);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
removeFromIndex() {
|
|
205
|
-
if (typeof window !== 'undefined') {
|
|
206
|
-
try {
|
|
207
|
-
if (!Array.isArray(window.__modalStack)) {
|
|
208
|
-
window.__modalStack = [];
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
window.__modalStack = window.__modalStack.filter(cur => cur !== this);
|
|
212
|
-
} catch (e) {
|
|
213
|
-
warn(e);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
216
|
setFocus() {
|
|
219
217
|
const {
|
|
220
|
-
focus_selector,
|
|
221
|
-
no_animation,
|
|
222
|
-
animation_duration
|
|
218
|
+
focus_selector = null,
|
|
219
|
+
no_animation = null,
|
|
220
|
+
animation_duration = null
|
|
223
221
|
} = this.props;
|
|
224
222
|
const elem = this._contentRef.current;
|
|
223
|
+
const timeoutDuration = typeof animation_duration === 'string' ? parseFloat(animation_duration) : animation_duration;
|
|
225
224
|
|
|
226
225
|
if (elem) {
|
|
227
226
|
clearTimeout(this._focusTimeout);
|
|
@@ -242,7 +241,7 @@ export default class ModalContent extends React.PureComponent {
|
|
|
242
241
|
} catch (e) {
|
|
243
242
|
warn(e);
|
|
244
243
|
}
|
|
245
|
-
}, isTrue(no_animation) ? 0 :
|
|
244
|
+
}, isTrue(no_animation) ? 0 : timeoutDuration || 0);
|
|
246
245
|
}
|
|
247
246
|
}
|
|
248
247
|
|
|
@@ -257,7 +256,7 @@ export default class ModalContent extends React.PureComponent {
|
|
|
257
256
|
clearAllBodyScrollLocks();
|
|
258
257
|
}
|
|
259
258
|
|
|
260
|
-
|
|
259
|
+
closeModalContent(event, _ref) {
|
|
261
260
|
var _event$persist;
|
|
262
261
|
|
|
263
262
|
let {
|
|
@@ -279,7 +278,7 @@ export default class ModalContent extends React.PureComponent {
|
|
|
279
278
|
render() {
|
|
280
279
|
const _this$props = this.props,
|
|
281
280
|
{
|
|
282
|
-
mode,
|
|
281
|
+
mode = 'modal',
|
|
283
282
|
hide,
|
|
284
283
|
title,
|
|
285
284
|
labelled_by,
|
|
@@ -287,20 +286,18 @@ export default class ModalContent extends React.PureComponent {
|
|
|
287
286
|
modal_content,
|
|
288
287
|
bar_content,
|
|
289
288
|
id: _id,
|
|
290
|
-
close_title,
|
|
291
|
-
dialog_title,
|
|
292
|
-
hide_close_button,
|
|
289
|
+
close_title = 'Lukk',
|
|
290
|
+
dialog_title = 'Vindu',
|
|
291
|
+
hide_close_button = false,
|
|
293
292
|
close_button_attributes,
|
|
294
|
-
spacing,
|
|
295
|
-
|
|
296
|
-
open_delay,
|
|
297
|
-
prevent_core_style,
|
|
293
|
+
spacing = true,
|
|
294
|
+
prevent_core_style = false,
|
|
298
295
|
animation_duration,
|
|
299
|
-
no_animation,
|
|
300
|
-
no_animation_on_mobile,
|
|
296
|
+
no_animation = false,
|
|
297
|
+
no_animation_on_mobile = false,
|
|
301
298
|
min_width,
|
|
302
299
|
max_width,
|
|
303
|
-
fullscreen,
|
|
300
|
+
fullscreen = 'auto',
|
|
304
301
|
align_content,
|
|
305
302
|
container_placement,
|
|
306
303
|
closeModal,
|
|
@@ -309,31 +306,30 @@ export default class ModalContent extends React.PureComponent {
|
|
|
309
306
|
content_class,
|
|
310
307
|
overlay_class,
|
|
311
308
|
content_id,
|
|
312
|
-
toggleOpenClose,
|
|
313
309
|
children
|
|
314
310
|
} = _this$props,
|
|
315
311
|
rest = _objectWithoutProperties(_this$props, _excluded2);
|
|
316
312
|
|
|
313
|
+
const {
|
|
314
|
+
color
|
|
315
|
+
} = this.state;
|
|
317
316
|
const contentId = content_id || makeUniqueId('modal-');
|
|
318
|
-
const style = this.state.color ? {
|
|
319
|
-
'--modal-background-color': `var(--color-${this.state.color})`
|
|
320
|
-
} : null;
|
|
321
317
|
let minWidth = min_width;
|
|
322
318
|
let maxWidth = max_width;
|
|
323
319
|
|
|
324
|
-
if (minWidth && !maxWidth && parseFloat(minWidth) > 0) {
|
|
320
|
+
if (minWidth && !maxWidth && parseFloat(String(minWidth)) > 0) {
|
|
325
321
|
maxWidth = 0;
|
|
326
|
-
} else if (maxWidth && !minWidth && parseFloat(maxWidth) > 0) {
|
|
322
|
+
} else if (maxWidth && !minWidth && parseFloat(String(maxWidth)) > 0) {
|
|
327
323
|
minWidth = 0;
|
|
328
324
|
}
|
|
329
325
|
|
|
330
326
|
const useDialogRole = !(IS_MAC || IS_SAFARI || IS_IOS);
|
|
331
327
|
const contentParams = {
|
|
332
328
|
role: useDialogRole ? 'dialog' : 'region',
|
|
333
|
-
'aria-modal': useDialogRole ?
|
|
329
|
+
'aria-modal': useDialogRole ? true : undefined,
|
|
334
330
|
'aria-labelledby': combineLabelledBy(this.props, title ? contentId + '-title' : null, labelled_by),
|
|
335
331
|
'aria-describedby': combineDescribedBy(this.props, contentId + '-content'),
|
|
336
|
-
'aria-label': !title && !labelled_by ?
|
|
332
|
+
'aria-label': !title && !labelled_by ? dialog_title : undefined,
|
|
337
333
|
className: classnames('dnb-modal__content', (container_placement || mode === 'drawer') && `dnb-modal__content--${container_placement || 'right'}`, isTrue(fullscreen) ? 'dnb-modal__content--fullscreen' : fullscreen === 'auto' && 'dnb-modal__content--auto-fullscreen', content_class, mode && `dnb-modal__content--${mode}`, hide && 'dnb-modal__content--hide', isTrue(spacing) && 'dnb-modal__content--spacing', align_content && `dnb-modal__content__align--${align_content}`, isTrue(no_animation) && 'dnb-modal__content--no-animation', isTrue(no_animation_on_mobile) && 'dnb-modal__content--no-animation-on-mobile'),
|
|
338
334
|
onClick: this.onContentClickHandler
|
|
339
335
|
};
|
|
@@ -349,125 +345,38 @@ export default class ModalContent extends React.PureComponent {
|
|
|
349
345
|
onKeyDown: this.onKeyDownHandler
|
|
350
346
|
}, rest);
|
|
351
347
|
|
|
352
|
-
const overlayParams = {
|
|
353
|
-
className: classnames('dnb-modal__overlay', overlay_class, hide && 'dnb-modal__overlay--hide', mode && `dnb-modal__overlay--${mode}`, isTrue(no_animation) && 'dnb-modal__overlay--no-animation', isTrue(no_animation_on_mobile) && 'dnb-modal__overlay--no-animation-on-mobile')
|
|
354
|
-
};
|
|
355
348
|
validateDOMAttributes(this.props, innerParams);
|
|
356
|
-
const
|
|
357
|
-
const
|
|
358
|
-
title: title
|
|
359
|
-
}, header_content);
|
|
360
|
-
const content = React.createElement("div", {
|
|
361
|
-
id: contentId + '-content',
|
|
362
|
-
className: "dnb-modal__content__wrapper"
|
|
363
|
-
}, modal_content);
|
|
349
|
+
const barExists = findElementInChildren(modal_content, cur => cur.type === ModalHeaderBar);
|
|
350
|
+
const headerExists = findElementInChildren(modal_content, cur => cur.type === ModalHeader);
|
|
364
351
|
return React.createElement(ModalContext.Provider, {
|
|
365
|
-
value:
|
|
366
|
-
id:
|
|
367
|
-
|
|
368
|
-
|
|
352
|
+
value: {
|
|
353
|
+
id: this.props.id,
|
|
354
|
+
title,
|
|
355
|
+
hide_close_button,
|
|
356
|
+
close_button_attributes,
|
|
357
|
+
close_title,
|
|
358
|
+
mode,
|
|
359
|
+
setBackgroundColor: this.setBackgroundColor,
|
|
369
360
|
onCloseClickHandler: this.onCloseClickHandler
|
|
370
|
-
}
|
|
361
|
+
}
|
|
371
362
|
}, React.createElement("div", _extends({
|
|
372
363
|
id: contentId
|
|
373
364
|
}, contentParams), React.createElement(ScrollView, innerParams, React.createElement("div", {
|
|
374
|
-
tabIndex:
|
|
365
|
+
tabIndex: -1,
|
|
375
366
|
className: "dnb-modal__content__spacing dnb-no-focus",
|
|
376
|
-
style:
|
|
367
|
+
style: color ? {
|
|
368
|
+
'--modal-background-color': `var(--color-${color})`
|
|
369
|
+
} : null,
|
|
377
370
|
ref: this._contentRef
|
|
378
|
-
},
|
|
371
|
+
}, !barExists && React.createElement(ModalHeaderBar, null, bar_content), !headerExists && React.createElement(ModalHeader, {
|
|
372
|
+
title: title
|
|
373
|
+
}, header_content), React.createElement("div", {
|
|
374
|
+
id: contentId + '-content',
|
|
375
|
+
className: "dnb-modal__content__wrapper"
|
|
376
|
+
}, modal_content)))), React.createElement("span", {
|
|
377
|
+
className: classnames('dnb-modal__overlay', overlay_class, hide && 'dnb-modal__overlay--hide', mode && `dnb-modal__overlay--${mode}`, isTrue(no_animation) && 'dnb-modal__overlay--no-animation', isTrue(no_animation_on_mobile) && 'dnb-modal__overlay--no-animation-on-mobile'),
|
|
379
378
|
"aria-hidden": "true"
|
|
380
|
-
}))
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
_defineProperty(ModalContent, "defaultProps", {
|
|
386
|
-
mode: null,
|
|
387
|
-
bar_content: null,
|
|
388
|
-
header_content: null,
|
|
389
|
-
hide: null,
|
|
390
|
-
id: null,
|
|
391
|
-
root_id: null,
|
|
392
|
-
labelled_by: null,
|
|
393
|
-
focus_selector: null,
|
|
394
|
-
content_id: null,
|
|
395
|
-
title: null,
|
|
396
|
-
close_title: null,
|
|
397
|
-
dialog_title: null,
|
|
398
|
-
hide_close_button: null,
|
|
399
|
-
close_button_attributes: null,
|
|
400
|
-
spacing: null,
|
|
401
|
-
prevent_close: null,
|
|
402
|
-
prevent_core_style: null,
|
|
403
|
-
animation_duration: null,
|
|
404
|
-
no_animation: null,
|
|
405
|
-
no_animation_on_mobile: null,
|
|
406
|
-
min_width: null,
|
|
407
|
-
max_width: null,
|
|
408
|
-
fullscreen: null,
|
|
409
|
-
align_content: null,
|
|
410
|
-
container_placement: null,
|
|
411
|
-
class: null,
|
|
412
|
-
overlay_class: null,
|
|
413
|
-
content_class: null,
|
|
414
|
-
closeModal: null,
|
|
415
|
-
className: null,
|
|
416
|
-
children: null
|
|
417
|
-
});
|
|
418
|
-
|
|
419
|
-
process.env.NODE_ENV !== "production" ? ModalContent.propTypes = {
|
|
420
|
-
modal_content: PropTypes.node.isRequired,
|
|
421
|
-
mode: PropTypes.oneOf(['modal', 'drawer']),
|
|
422
|
-
bar_content: PropTypes.node,
|
|
423
|
-
header_content: PropTypes.node,
|
|
424
|
-
hide: PropTypes.bool,
|
|
425
|
-
id: PropTypes.string,
|
|
426
|
-
root_id: PropTypes.string,
|
|
427
|
-
labelled_by: PropTypes.string,
|
|
428
|
-
focus_selector: PropTypes.string,
|
|
429
|
-
content_id: PropTypes.string,
|
|
430
|
-
title: PropTypes.node,
|
|
431
|
-
close_title: PropTypes.string,
|
|
432
|
-
dialog_title: PropTypes.string,
|
|
433
|
-
hide_close_button: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
434
|
-
close_button_attributes: PropTypes.object,
|
|
435
|
-
spacing: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
436
|
-
prevent_close: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
437
|
-
prevent_core_style: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
438
|
-
animation_duration: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
439
|
-
no_animation: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
440
|
-
no_animation_on_mobile: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
441
|
-
min_width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
442
|
-
max_width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
443
|
-
fullscreen: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
444
|
-
align_content: PropTypes.string,
|
|
445
|
-
container_placement: PropTypes.string,
|
|
446
|
-
class: PropTypes.string,
|
|
447
|
-
content_class: PropTypes.string,
|
|
448
|
-
overlay_class: PropTypes.string,
|
|
449
|
-
closeModal: PropTypes.func.isRequired,
|
|
450
|
-
className: PropTypes.string,
|
|
451
|
-
children: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.func])
|
|
452
|
-
} : void 0;
|
|
453
|
-
export function getListOfModalRoots(index = null) {
|
|
454
|
-
if (typeof window !== 'undefined') {
|
|
455
|
-
try {
|
|
456
|
-
const stack = window.__modalStack || [];
|
|
457
|
-
|
|
458
|
-
if (index !== null) {
|
|
459
|
-
if (index === -1 && stack.length) {
|
|
460
|
-
return stack[stack.length - 1];
|
|
461
|
-
} else if (index > -1) {
|
|
462
|
-
return stack[index];
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
return stack;
|
|
467
|
-
} catch (e) {
|
|
468
|
-
warn(e);
|
|
469
|
-
}
|
|
379
|
+
}));
|
|
470
380
|
}
|
|
471
381
|
|
|
472
|
-
return [];
|
|
473
382
|
}
|