@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
|
@@ -83,7 +83,7 @@ export interface FormSetProps extends React.HTMLProps<HTMLElement> {
|
|
|
83
83
|
id?: string;
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
|
-
* Use either the `label` property or provide custom one.
|
|
86
|
+
* Use either the `label` property or provide a custom one.
|
|
87
87
|
*/
|
|
88
88
|
label?: FormSetLabel;
|
|
89
89
|
|
|
@@ -99,7 +99,7 @@ export interface FormSetProps extends React.HTMLProps<HTMLElement> {
|
|
|
99
99
|
label_id?: string;
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
|
-
* If
|
|
102
|
+
* If you need to style the "legend", then you can either send in a custom Component, like `label={ <H2> }`, or define Your styling class with the `label_class` property.
|
|
103
103
|
*/
|
|
104
104
|
label_class?: string;
|
|
105
105
|
no_label?: FormSetNoLabel;
|
|
@@ -120,7 +120,7 @@ export interface FormSetProps extends React.HTMLProps<HTMLElement> {
|
|
|
120
120
|
indent?: FormSetIndent;
|
|
121
121
|
|
|
122
122
|
/**
|
|
123
|
-
* Forces the content of a FormRow to wrap. Make sure
|
|
123
|
+
* Forces the content of a FormRow to wrap. Make sure you always define spacing as `right="..."` and not `left`, this way components will align left once they wrap. Defaults to `false`.
|
|
124
124
|
*/
|
|
125
125
|
wrap?: FormSetWrap;
|
|
126
126
|
|
|
@@ -135,7 +135,7 @@ export interface FormSetProps extends React.HTMLProps<HTMLElement> {
|
|
|
135
135
|
vertical?: FormSetVertical;
|
|
136
136
|
|
|
137
137
|
/**
|
|
138
|
-
* Will center all children vertically as long as the screen not
|
|
138
|
+
* Will center all children vertically as long as the screen does not hit a mobile width.
|
|
139
139
|
*/
|
|
140
140
|
centered?: FormSetCentered;
|
|
141
141
|
|
|
@@ -190,7 +190,7 @@ export interface FormSetProps extends React.HTMLProps<HTMLElement> {
|
|
|
190
190
|
children?: FormSetChildren;
|
|
191
191
|
|
|
192
192
|
/**
|
|
193
|
-
* Will be called on submit. Returns an object with
|
|
193
|
+
* Will be called on submit. Returns an object with a native event: `{ event }`
|
|
194
194
|
*/
|
|
195
195
|
on_submit?: (...args: any[]) => any;
|
|
196
196
|
custom_element?: Object;
|
|
@@ -70,17 +70,17 @@ export interface GlobalStatusProps extends React.HTMLProps<HTMLElement> {
|
|
|
70
70
|
default_title?: string;
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
|
-
* The text appears as the status content.
|
|
73
|
+
* The text appears as the status content. Besides plain text, you can send in a React component as well. Defaults to `null`.
|
|
74
74
|
*/
|
|
75
75
|
text?: GlobalStatusText;
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
|
-
* The items (list items)
|
|
78
|
+
* The items (list items) appear as a part of the status content. you can both use an JSON array, or a vanilla array with a string or an object content. Se "Item Object" example below.
|
|
79
79
|
*/
|
|
80
80
|
items?: GlobalStatusItems;
|
|
81
81
|
|
|
82
82
|
/**
|
|
83
|
-
* The icon
|
|
83
|
+
* The icon shown before the status title. Defaults to `exclamation`.
|
|
84
84
|
*/
|
|
85
85
|
icon?: GlobalStatusIcon;
|
|
86
86
|
|
|
@@ -115,7 +115,7 @@ export interface GlobalStatusProps extends React.HTMLProps<HTMLElement> {
|
|
|
115
115
|
no_animation?: GlobalStatusNoAnimation;
|
|
116
116
|
|
|
117
117
|
/**
|
|
118
|
-
* Defines the delay on how long the automated visibility should wait
|
|
118
|
+
* Defines the delay on how long the automated visibility should wait before it appears to the user. Defaults to `200ms`.
|
|
119
119
|
*/
|
|
120
120
|
delay?: GlobalStatusDelay;
|
|
121
121
|
|
|
@@ -169,7 +169,7 @@ export interface GlobalStatusProps extends React.HTMLProps<HTMLElement> {
|
|
|
169
169
|
className?: string;
|
|
170
170
|
|
|
171
171
|
/**
|
|
172
|
-
* The text appears as the status content.
|
|
172
|
+
* The text appears as the status content. Besides plain text, you can send in a React component as well. Defaults to `null`.
|
|
173
173
|
*/
|
|
174
174
|
children?: GlobalStatusChildren;
|
|
175
175
|
|
|
@@ -58,7 +58,7 @@ export interface HeadingProps extends React.HTMLProps<HTMLElement> {
|
|
|
58
58
|
group?: string;
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
|
-
* A heading, can be text or
|
|
61
|
+
* A heading, can be text or React.Node.
|
|
62
62
|
*/
|
|
63
63
|
text?: HeadingText;
|
|
64
64
|
|
|
@@ -144,7 +144,7 @@ export interface HeadingProps extends React.HTMLProps<HTMLElement> {
|
|
|
144
144
|
className?: string;
|
|
145
145
|
|
|
146
146
|
/**
|
|
147
|
-
* A heading, can be text or
|
|
147
|
+
* A heading, can be text or React.Node.
|
|
148
148
|
*/
|
|
149
149
|
children?: HeadingChildren;
|
|
150
150
|
}
|
|
@@ -40,12 +40,12 @@ export interface HeadingProviderProps
|
|
|
40
40
|
reset?: HeadingProviderReset;
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
|
-
* A heading, can be text or
|
|
43
|
+
* A heading, can be text or React.Node.
|
|
44
44
|
*/
|
|
45
45
|
text?: any;
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
|
-
* A heading, can be text or
|
|
48
|
+
* A heading, can be text or React.Node.
|
|
49
49
|
*/
|
|
50
50
|
children?: any;
|
|
51
51
|
}
|
|
@@ -56,7 +56,7 @@ export interface IconProps extends React.HTMLProps<HTMLElement> {
|
|
|
56
56
|
modifier?: string;
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
|
-
* The dimension of the icon. This will be the `viewBox` and represent `width` and `height`. Defaults to `16`. You can use `small`,`medium`, `large` or `auto`. Auto will enable that the icon size gets inherited by the
|
|
59
|
+
* The dimension of the icon. This will be the `viewBox` and represent `width` and `height`. Defaults to `16`. You can use `small`,`medium`, `large` or `auto`. Auto will enable that the icon size gets inherited by the parent HTML element if it provides a `font-size`.
|
|
60
60
|
*/
|
|
61
61
|
size?: IconSize;
|
|
62
62
|
|
|
@@ -65,7 +65,7 @@ export interface IconPrimaryProps extends React.HTMLProps<HTMLElement> {
|
|
|
65
65
|
modifier?: string;
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
|
-
* The dimension of the icon. This will be the `viewBox` and represent `width` and `height`. Defaults to `16`. You can use `small`,`medium`, `large` or `auto`. Auto will enable that the icon size gets inherited by the
|
|
68
|
+
* The dimension of the icon. This will be the `viewBox` and represent `width` and `height`. Defaults to `16`. You can use `small`,`medium`, `large` or `auto`. Auto will enable that the icon size gets inherited by the parent HTML element if it provides a `font-size`.
|
|
69
69
|
*/
|
|
70
70
|
size?: IconPrimarySize;
|
|
71
71
|
|
|
@@ -42,6 +42,7 @@ import Space from './space/Space'
|
|
|
42
42
|
import StepIndicator from './step-indicator/StepIndicator'
|
|
43
43
|
import Switch from './switch/Switch'
|
|
44
44
|
import Tabs from './tabs/Tabs'
|
|
45
|
+
import Tag from './tag/Tag'
|
|
45
46
|
import Textarea from './textarea/Textarea'
|
|
46
47
|
import ToggleButton from './toggle-button/ToggleButton'
|
|
47
48
|
import Tooltip from './tooltip/Tooltip'
|
|
@@ -80,6 +81,7 @@ export {
|
|
|
80
81
|
StepIndicator,
|
|
81
82
|
Switch,
|
|
82
83
|
Tabs,
|
|
84
|
+
Tag,
|
|
83
85
|
Textarea,
|
|
84
86
|
ToggleButton,
|
|
85
87
|
Tooltip,
|
package/cjs/components/index.js
CHANGED
|
@@ -195,6 +195,12 @@ Object.defineProperty(exports, "Tabs", {
|
|
|
195
195
|
return _Tabs.default;
|
|
196
196
|
}
|
|
197
197
|
});
|
|
198
|
+
Object.defineProperty(exports, "Tag", {
|
|
199
|
+
enumerable: true,
|
|
200
|
+
get: function get() {
|
|
201
|
+
return _Tag.default;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
198
204
|
Object.defineProperty(exports, "Textarea", {
|
|
199
205
|
enumerable: true,
|
|
200
206
|
get: function get() {
|
|
@@ -278,6 +284,8 @@ var _Switch = _interopRequireDefault(require("./switch/Switch"));
|
|
|
278
284
|
|
|
279
285
|
var _Tabs = _interopRequireDefault(require("./tabs/Tabs"));
|
|
280
286
|
|
|
287
|
+
var _Tag = _interopRequireDefault(require("./tag/Tag"));
|
|
288
|
+
|
|
281
289
|
var _Textarea = _interopRequireDefault(require("./textarea/Textarea"));
|
|
282
290
|
|
|
283
291
|
var _ToggleButton = _interopRequireDefault(require("./toggle-button/ToggleButton"));
|
|
@@ -89,7 +89,7 @@ export interface InputProps extends React.HTMLProps<HTMLElement> {
|
|
|
89
89
|
type?: string;
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
|
-
* The sizes you can sue is `small` (1.5rem), `default` (2rem), `medium` (2.5rem) and `large` (3rem) are supported component sizes. Defaults to `default` / `null`. Also, if You define a number like `size="2"` then
|
|
92
|
+
* The sizes you can sue is `small` (1.5rem), `default` (2rem), `medium` (2.5rem) and `large` (3rem) are supported component sizes. Defaults to `default` / `null`. Also, if You define a number like `size="2"` then it will be forwarded as the input element attribute.
|
|
93
93
|
*/
|
|
94
94
|
size?: InputSize;
|
|
95
95
|
|
|
@@ -120,7 +120,7 @@ export interface InputProps extends React.HTMLProps<HTMLElement> {
|
|
|
120
120
|
status?: InputStatus;
|
|
121
121
|
|
|
122
122
|
/**
|
|
123
|
-
* Defines the state of the status. Currently there are two statuses `[error, info]`. Defaults to `error`.
|
|
123
|
+
* Defines the state of the status. Currently, there are two statuses `[error, info]`. Defaults to `error`.
|
|
124
124
|
*/
|
|
125
125
|
status_state?: string;
|
|
126
126
|
|
|
@@ -141,7 +141,7 @@ export interface InputProps extends React.HTMLProps<HTMLElement> {
|
|
|
141
141
|
global_status_id?: string;
|
|
142
142
|
|
|
143
143
|
/**
|
|
144
|
-
* Defaults to `off`. Set to `on` or any of <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-autocomplete">allowed `attributes`</a>. Keep in mind, 1. you may have to define a `name`, 2. have the input as a
|
|
144
|
+
* Defaults to `off`. Set to `on` or any of <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-autocomplete">allowed `attributes`</a>. Keep in mind, 1. you may have to define a `name`, 2. have the input as a descendant of a `<form>` element, 3. and have a submit button inside the form.
|
|
145
145
|
*/
|
|
146
146
|
autocomplete?: string;
|
|
147
147
|
|
|
@@ -162,7 +162,7 @@ export interface InputProps extends React.HTMLProps<HTMLElement> {
|
|
|
162
162
|
clear?: InputClear;
|
|
163
163
|
|
|
164
164
|
/**
|
|
165
|
-
* Set to `true` in case the `placeholder` has to be kept during focus. By default the placeholder disappears on focus.
|
|
165
|
+
* Set to `true` in case the `placeholder` has to be kept during focus. By default, the placeholder disappears on focus.
|
|
166
166
|
*/
|
|
167
167
|
keep_placeholder?: InputKeepPlaceholder;
|
|
168
168
|
|
|
@@ -199,17 +199,17 @@ export interface InputProps extends React.HTMLProps<HTMLElement> {
|
|
|
199
199
|
input_class?: string;
|
|
200
200
|
|
|
201
201
|
/**
|
|
202
|
-
* Provide the Input element with any attributes by using an Object `input_attributes={{size:'2'}}` or a JSON Object `input_attributes='{"size":"2"}'`. "NB:" Keep in mind, that also every not listed component property will be
|
|
202
|
+
* Provide the Input element with any attributes by using an Object `input_attributes={{size:'2'}}` or a JSON Object `input_attributes='{"size":"2"}'`. "NB:" Keep in mind, that also every not listed component property will be sent along and set as an Input element attribute.
|
|
203
203
|
*/
|
|
204
204
|
input_attributes?: InputInputAttributes;
|
|
205
205
|
|
|
206
206
|
/**
|
|
207
|
-
* <em>(internal)</em> by providing a new component we can change the
|
|
207
|
+
* <em>(internal)</em> by providing a new component we can change the internally used element. Also supports a string only, like `input_element="input"`.
|
|
208
208
|
*/
|
|
209
209
|
input_element?: InputInputElement;
|
|
210
210
|
|
|
211
211
|
/**
|
|
212
|
-
* Icon to show before or after the input / placeholder. Can be either a string defining a primary icon
|
|
212
|
+
* Icon to show before or after the input / placeholder. Can be either a string defining a primary icon or a Component using an SVG icon of either 16px or 24px.
|
|
213
213
|
*/
|
|
214
214
|
icon?: InputIcon;
|
|
215
215
|
|
|
@@ -224,7 +224,7 @@ export interface InputProps extends React.HTMLProps<HTMLElement> {
|
|
|
224
224
|
icon_position?: InputIconPosition;
|
|
225
225
|
|
|
226
226
|
/**
|
|
227
|
-
* By providing a React.ref we can get the
|
|
227
|
+
* By providing a React.ref we can get the internally used input element (DOM). E.g. `inner_ref={myRef}` by using `React.createRef()` or `React.useRef()`.
|
|
228
228
|
*/
|
|
229
229
|
inner_ref?: InputInnerRef;
|
|
230
230
|
readOnly?: InputReadOnly;
|
|
@@ -267,7 +267,7 @@ export interface InputProps extends React.HTMLProps<HTMLElement> {
|
|
|
267
267
|
custom_method?: (...args: any[]) => any;
|
|
268
268
|
|
|
269
269
|
/**
|
|
270
|
-
* Will be called on value changes made by the user. Returns an object with the value as a string and the
|
|
270
|
+
* Will be called on value changes made by the user. Returns an object with the value as a string and the native event: `{ value, event }`.
|
|
271
271
|
*/
|
|
272
272
|
on_change?: (...args: any[]) => any;
|
|
273
273
|
|
|
@@ -96,7 +96,7 @@ export type InputMaskedChildren =
|
|
|
96
96
|
*/
|
|
97
97
|
export interface InputMaskedProps extends React.HTMLProps<HTMLElement> {
|
|
98
98
|
/**
|
|
99
|
-
* A mask can be
|
|
99
|
+
* A mask can be defined both as a <a href="https://github.com/text-mask/text-mask/blob/master/componentDocumentation.md#readme">RegExp style of characters</a> or a callback function. Example below.
|
|
100
100
|
*/
|
|
101
101
|
mask?: InputMaskedMask;
|
|
102
102
|
|
|
@@ -106,7 +106,7 @@ export interface InputMaskedProps extends React.HTMLProps<HTMLElement> {
|
|
|
106
106
|
number_mask?: InputMaskedNumberMask;
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
|
-
* Set to `true` or set the <em>valuta</em> (currency_mask="kr") to enable
|
|
109
|
+
* Set to `true` or set the <em>valuta</em> (currency_mask="kr") to enable a custom currency mask – or give an `object` containing the number mask properties. More details below. Can be a JSON string as well, containing the number mask properties. Is disabled by default. Defaults to `kr`.
|
|
110
110
|
*/
|
|
111
111
|
currency_mask?: InputMaskedCurrencyMask;
|
|
112
112
|
|
|
@@ -162,12 +162,12 @@ export interface InputMaskedProps extends React.HTMLProps<HTMLElement> {
|
|
|
162
162
|
placeholder_char?: string;
|
|
163
163
|
|
|
164
164
|
/**
|
|
165
|
-
* By providing a React.ref we can get the
|
|
165
|
+
* By providing a React.ref we can get the internally used input element (DOM). E.g. `inner_ref={myRef}` by using `React.createRef()` or `React.useRef()`.
|
|
166
166
|
*/
|
|
167
167
|
inner_ref?: Object;
|
|
168
168
|
|
|
169
169
|
/**
|
|
170
|
-
* Will be called on value changes made by the user. Returns an object with the value as a string and the
|
|
170
|
+
* Will be called on value changes made by the user. Returns an object with the value as a string and the native event: `{ value, event }`.
|
|
171
171
|
*/
|
|
172
172
|
on_change?: (...args: any[]) => any;
|
|
173
173
|
|
|
@@ -194,7 +194,7 @@ export interface InputMaskedProps extends React.HTMLProps<HTMLElement> {
|
|
|
194
194
|
type?: string;
|
|
195
195
|
|
|
196
196
|
/**
|
|
197
|
-
* The sizes you can sue is `small` (1.5rem), `default` (2rem), `medium` (2.5rem) and `large` (3rem) are supported component sizes. Defaults to `default` / `null`. Also, if You define a number like `size="2"` then
|
|
197
|
+
* The sizes you can sue is `small` (1.5rem), `default` (2rem), `medium` (2.5rem) and `large` (3rem) are supported component sizes. Defaults to `default` / `null`. Also, if You define a number like `size="2"` then it will be forwarded as the input element attribute.
|
|
198
198
|
*/
|
|
199
199
|
size?: InputMaskedSize;
|
|
200
200
|
|
|
@@ -225,7 +225,7 @@ export interface InputMaskedProps extends React.HTMLProps<HTMLElement> {
|
|
|
225
225
|
status?: InputMaskedStatus;
|
|
226
226
|
|
|
227
227
|
/**
|
|
228
|
-
* Defines the state of the status. Currently there are two statuses `[error, info]`. Defaults to `error`.
|
|
228
|
+
* Defines the state of the status. Currently, there are two statuses `[error, info]`. Defaults to `error`.
|
|
229
229
|
*/
|
|
230
230
|
status_state?: string;
|
|
231
231
|
|
|
@@ -246,7 +246,7 @@ export interface InputMaskedProps extends React.HTMLProps<HTMLElement> {
|
|
|
246
246
|
global_status_id?: string;
|
|
247
247
|
|
|
248
248
|
/**
|
|
249
|
-
* Defaults to `off`. Set to `on` or any of <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-autocomplete">allowed `attributes`</a>. Keep in mind, 1. you may have to define a `name`, 2. have the input as a
|
|
249
|
+
* Defaults to `off`. Set to `on` or any of <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-autocomplete">allowed `attributes`</a>. Keep in mind, 1. you may have to define a `name`, 2. have the input as a descendant of a `<form>` element, 3. and have a submit button inside the form.
|
|
250
250
|
*/
|
|
251
251
|
autocomplete?: string;
|
|
252
252
|
|
|
@@ -267,7 +267,7 @@ export interface InputMaskedProps extends React.HTMLProps<HTMLElement> {
|
|
|
267
267
|
clear?: InputMaskedClear;
|
|
268
268
|
|
|
269
269
|
/**
|
|
270
|
-
* Set to `true` in case the `placeholder` has to be kept during focus. By default the placeholder disappears on focus.
|
|
270
|
+
* Set to `true` in case the `placeholder` has to be kept during focus. By default, the placeholder disappears on focus.
|
|
271
271
|
*/
|
|
272
272
|
keep_placeholder?: InputMaskedKeepPlaceholder;
|
|
273
273
|
|
|
@@ -304,17 +304,17 @@ export interface InputMaskedProps extends React.HTMLProps<HTMLElement> {
|
|
|
304
304
|
input_class?: string;
|
|
305
305
|
|
|
306
306
|
/**
|
|
307
|
-
* Provide the Input element with any attributes by using an Object `input_attributes={{size:'2'}}` or a JSON Object `input_attributes='{"size":"2"}'`. "NB:" Keep in mind, that also every not listed component property will be
|
|
307
|
+
* Provide the Input element with any attributes by using an Object `input_attributes={{size:'2'}}` or a JSON Object `input_attributes='{"size":"2"}'`. "NB:" Keep in mind, that also every not listed component property will be sent along and set as an Input element attribute.
|
|
308
308
|
*/
|
|
309
309
|
input_attributes?: InputMaskedInputAttributes;
|
|
310
310
|
|
|
311
311
|
/**
|
|
312
|
-
* <em>(internal)</em> by providing a new component we can change the
|
|
312
|
+
* <em>(internal)</em> by providing a new component we can change the internally used element. Also supports a string only, like `input_element="input"`.
|
|
313
313
|
*/
|
|
314
314
|
input_element?: InputMaskedInputElement;
|
|
315
315
|
|
|
316
316
|
/**
|
|
317
|
-
* Icon to show before or after the input / placeholder. Can be either a string defining a primary icon
|
|
317
|
+
* Icon to show before or after the input / placeholder. Can be either a string defining a primary icon or a Component using an SVG icon of either 16px or 24px.
|
|
318
318
|
*/
|
|
319
319
|
icon?: InputMaskedIcon;
|
|
320
320
|
|
|
@@ -64,11 +64,14 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
64
64
|
var InputMasked = _react.default.forwardRef(function (props, ref) {
|
|
65
65
|
var context = _react.default.useContext(_Context.default);
|
|
66
66
|
|
|
67
|
+
var contextAndProps = _react.default.useCallback((0, _componentHelper.extendPropsWithContext)(props, InputMasked.defaultProps, context === null || context === void 0 ? void 0 : context.InputMasked), [props, InputMasked.defaultProps, context === null || context === void 0 ? void 0 : context.InputMasked]);
|
|
68
|
+
|
|
67
69
|
return _react.default.createElement(_InputMaskedContext.default.Provider, {
|
|
68
|
-
value:
|
|
70
|
+
value: {
|
|
69
71
|
inner_ref: ref,
|
|
70
|
-
props:
|
|
71
|
-
|
|
72
|
+
props: contextAndProps,
|
|
73
|
+
context: context
|
|
74
|
+
}
|
|
72
75
|
}, _InputMaskedElement || (_InputMaskedElement = _react.default.createElement(_InputMaskedElement2.default, null)));
|
|
73
76
|
});
|
|
74
77
|
|
|
@@ -33,7 +33,7 @@ require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
|
33
33
|
Object.defineProperty(exports, "__esModule", {
|
|
34
34
|
value: true
|
|
35
35
|
});
|
|
36
|
-
exports.useNumberMask = exports.useMaskParams = exports.
|
|
36
|
+
exports.useNumberMask = exports.useMaskParams = exports.useMask = exports.useLocale = exports.useLocalValue = exports.useInputElementRef = exports.useInputElement = exports.useFilteredProps = exports.useEventMapping = void 0;
|
|
37
37
|
|
|
38
38
|
require("core-js/modules/es.object.freeze.js");
|
|
39
39
|
|
|
@@ -59,8 +59,6 @@ var _NumberUtils = require("../number-format/NumberUtils");
|
|
|
59
59
|
|
|
60
60
|
var _componentHelper = require("../../shared/component-helper");
|
|
61
61
|
|
|
62
|
-
var _Context = _interopRequireDefault(require("../../shared/Context"));
|
|
63
|
-
|
|
64
62
|
var _TextMask = _interopRequireDefault(require("./TextMask"));
|
|
65
63
|
|
|
66
64
|
var _createNumberMask = _interopRequireDefault(require("./addons/createNumberMask"));
|
|
@@ -140,9 +138,8 @@ exports.useInputElementRef = useInputElementRef;
|
|
|
140
138
|
|
|
141
139
|
var useLocale = function useLocale() {
|
|
142
140
|
var _React$useContext3 = _react.default.useContext(_InputMaskedContext.default),
|
|
143
|
-
props = _React$useContext3.props
|
|
144
|
-
|
|
145
|
-
var context = _react.default.useContext(_Context.default);
|
|
141
|
+
props = _React$useContext3.props,
|
|
142
|
+
context = _React$useContext3.context;
|
|
146
143
|
|
|
147
144
|
var locale = props.locale;
|
|
148
145
|
|
|
@@ -157,18 +154,16 @@ exports.useLocale = useLocale;
|
|
|
157
154
|
|
|
158
155
|
var useLocalValue = function useLocalValue() {
|
|
159
156
|
var _React$useContext4 = _react.default.useContext(_InputMaskedContext.default),
|
|
160
|
-
props = _React$useContext4.props
|
|
161
|
-
|
|
162
|
-
var context = _react.default.useContext(_Context.default);
|
|
157
|
+
props = _React$useContext4.props,
|
|
158
|
+
context = _React$useContext4.context;
|
|
163
159
|
|
|
164
160
|
var maskParams = useNumberMaskParams() || {};
|
|
165
161
|
var locale = useLocale();
|
|
166
162
|
|
|
167
163
|
var _React$useState = _react.default.useState(function () {
|
|
168
164
|
return (0, _InputMaskedUtils.correctNumberValue)({
|
|
169
|
-
props: props,
|
|
170
|
-
context: context,
|
|
171
165
|
locale: locale,
|
|
166
|
+
props: props,
|
|
172
167
|
maskParams: maskParams
|
|
173
168
|
});
|
|
174
169
|
}),
|
|
@@ -179,9 +174,8 @@ var useLocalValue = function useLocalValue() {
|
|
|
179
174
|
_react.default.useEffect(function () {
|
|
180
175
|
var value = (0, _InputMaskedUtils.correctNumberValue)({
|
|
181
176
|
localValue: localValue,
|
|
182
|
-
props: props,
|
|
183
|
-
context: context,
|
|
184
177
|
locale: locale,
|
|
178
|
+
props: props,
|
|
185
179
|
maskParams: maskParams
|
|
186
180
|
});
|
|
187
181
|
setLocalValue(value);
|
|
@@ -198,7 +192,10 @@ exports.useLocalValue = useLocalValue;
|
|
|
198
192
|
var useNumberMask = function useNumberMask() {
|
|
199
193
|
var maskParams = useNumberMaskParams();
|
|
200
194
|
|
|
201
|
-
|
|
195
|
+
var _React$useContext5 = _react.default.useContext(_InputMaskedContext.default),
|
|
196
|
+
props = _React$useContext5.props;
|
|
197
|
+
|
|
198
|
+
if (!maskParams || !(0, _InputMaskedUtils.isRequestingNumberMask)(props)) {
|
|
202
199
|
return null;
|
|
203
200
|
}
|
|
204
201
|
|
|
@@ -209,9 +206,9 @@ var useNumberMask = function useNumberMask() {
|
|
|
209
206
|
|
|
210
207
|
exports.useNumberMask = useNumberMask;
|
|
211
208
|
|
|
212
|
-
var
|
|
213
|
-
var _React$
|
|
214
|
-
props = _React$
|
|
209
|
+
var useMask = function useMask() {
|
|
210
|
+
var _React$useContext6 = _react.default.useContext(_InputMaskedContext.default),
|
|
211
|
+
props = _React$useContext6.props;
|
|
215
212
|
|
|
216
213
|
var numberMask = useNumberMask();
|
|
217
214
|
|
|
@@ -222,18 +219,18 @@ var useInternalMask = function useInternalMask() {
|
|
|
222
219
|
return props.mask;
|
|
223
220
|
};
|
|
224
221
|
|
|
225
|
-
exports.
|
|
222
|
+
exports.useMask = useMask;
|
|
226
223
|
|
|
227
224
|
var useMaskParams = function useMaskParams() {
|
|
228
|
-
var _React$
|
|
229
|
-
props = _React$
|
|
225
|
+
var _React$useContext7 = _react.default.useContext(_InputMaskedContext.default),
|
|
226
|
+
props = _React$useContext7.props;
|
|
230
227
|
|
|
231
228
|
var keep_char_positions = props.keep_char_positions,
|
|
232
229
|
show_guide = props.show_guide,
|
|
233
230
|
show_mask = props.show_mask,
|
|
234
231
|
placeholder_char = props.placeholder_char,
|
|
235
232
|
placeholder = props.placeholder;
|
|
236
|
-
var mask =
|
|
233
|
+
var mask = useMask();
|
|
237
234
|
var maskParams = useNumberMaskParams() || {};
|
|
238
235
|
maskParams.showMask = !placeholder && (0, _componentHelper.isTrue)(show_mask);
|
|
239
236
|
maskParams.placeholderChar = placeholder_char;
|
|
@@ -260,11 +257,11 @@ exports.useMaskParams = useMaskParams;
|
|
|
260
257
|
var useInputElement = function useInputElement() {
|
|
261
258
|
var ref = useInputElementRef();
|
|
262
259
|
|
|
263
|
-
var _React$
|
|
264
|
-
props = _React$
|
|
260
|
+
var _React$useContext8 = _react.default.useContext(_InputMaskedContext.default),
|
|
261
|
+
props = _React$useContext8.props;
|
|
265
262
|
|
|
266
263
|
var pipe = props.pipe;
|
|
267
|
-
var mask =
|
|
264
|
+
var mask = useMask();
|
|
268
265
|
|
|
269
266
|
var _useMaskParams = useMaskParams(),
|
|
270
267
|
showMask = _useMaskParams.showMask,
|
|
@@ -346,8 +343,8 @@ exports.useEventMapping = useEventMapping;
|
|
|
346
343
|
var useCallEvent = function useCallEvent(_ref2) {
|
|
347
344
|
var setLocalValue = _ref2.setLocalValue;
|
|
348
345
|
|
|
349
|
-
var _React$
|
|
350
|
-
props = _React$
|
|
346
|
+
var _React$useContext9 = _react.default.useContext(_InputMaskedContext.default),
|
|
347
|
+
props = _React$useContext9.props;
|
|
351
348
|
|
|
352
349
|
var maskParams = useMaskParams();
|
|
353
350
|
var isNumberMask = useNumberMask();
|
|
@@ -376,7 +373,6 @@ var useCallEvent = function useCallEvent(_ref2) {
|
|
|
376
373
|
|
|
377
374
|
if (/^0/.test(testValue)) {
|
|
378
375
|
event.preventDefault();
|
|
379
|
-
return;
|
|
380
376
|
}
|
|
381
377
|
}
|
|
382
378
|
|
|
@@ -454,15 +450,13 @@ var useCallEvent = function useCallEvent(_ref2) {
|
|
|
454
450
|
var useNumberMaskParams = function useNumberMaskParams() {
|
|
455
451
|
var _currency_mask;
|
|
456
452
|
|
|
457
|
-
var _React$
|
|
458
|
-
props = _React$
|
|
459
|
-
|
|
460
|
-
var context = _react.default.useContext(_Context.default);
|
|
453
|
+
var _React$useContext10 = _react.default.useContext(_InputMaskedContext.default),
|
|
454
|
+
props = _React$useContext10.props;
|
|
461
455
|
|
|
462
456
|
var locale = useLocale();
|
|
463
457
|
|
|
464
458
|
if (!(0, _InputMaskedUtils.isRequestingNumberMask)(props)) {
|
|
465
|
-
return
|
|
459
|
+
return _objectSpread({}, (0, _InputMaskedUtils.fromJSON)(props.mask_options));
|
|
466
460
|
}
|
|
467
461
|
|
|
468
462
|
var number_mask = props.number_mask,
|
|
@@ -503,7 +497,6 @@ var useNumberMaskParams = function useNumberMaskParams() {
|
|
|
503
497
|
|
|
504
498
|
if (number_mask) {
|
|
505
499
|
maskParams = (0, _InputMaskedUtils.handleNumberMask)({
|
|
506
|
-
context: context,
|
|
507
500
|
mask_options: mask_options,
|
|
508
501
|
number_mask: number_mask
|
|
509
502
|
});
|
|
@@ -517,7 +510,6 @@ var useNumberMaskParams = function useNumberMaskParams() {
|
|
|
517
510
|
}
|
|
518
511
|
} else if (currency_mask) {
|
|
519
512
|
maskParams = (0, _InputMaskedUtils.handleCurrencyMask)({
|
|
520
|
-
context: context,
|
|
521
513
|
mask_options: mask_options,
|
|
522
514
|
currency_mask: currency_mask
|
|
523
515
|
});
|
|
@@ -116,12 +116,9 @@ var isRequestingNumberMask = function isRequestingNumberMask(props) {
|
|
|
116
116
|
exports.isRequestingNumberMask = isRequestingNumberMask;
|
|
117
117
|
|
|
118
118
|
var correctNumberValue = function correctNumberValue(_ref5) {
|
|
119
|
-
var _context$InputMasked;
|
|
120
|
-
|
|
121
119
|
var _ref5$localValue = _ref5.localValue,
|
|
122
120
|
localValue = _ref5$localValue === void 0 ? null : _ref5$localValue,
|
|
123
121
|
props = _ref5.props,
|
|
124
|
-
context = _ref5.context,
|
|
125
122
|
locale = _ref5.locale,
|
|
126
123
|
maskParams = _ref5.maskParams;
|
|
127
124
|
var value = String(props.value);
|
|
@@ -140,13 +137,11 @@ var correctNumberValue = function correctNumberValue(_ref5) {
|
|
|
140
137
|
}
|
|
141
138
|
}
|
|
142
139
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
if (props.number_format || numberFormatFromContext) {
|
|
146
|
-
var options = _objectSpread(_objectSpread({
|
|
140
|
+
if (props.number_format) {
|
|
141
|
+
var options = _objectSpread({
|
|
147
142
|
locale: locale,
|
|
148
143
|
decimals: 0
|
|
149
|
-
},
|
|
144
|
+
}, props.number_format);
|
|
150
145
|
|
|
151
146
|
if (shouldHaveDecimals) {
|
|
152
147
|
options.decimals = maskParams.decimalLimit;
|
|
@@ -258,19 +253,16 @@ var handlePercentMask = function handlePercentMask(_ref6) {
|
|
|
258
253
|
exports.handlePercentMask = handlePercentMask;
|
|
259
254
|
|
|
260
255
|
var handleCurrencyMask = function handleCurrencyMask(_ref7) {
|
|
261
|
-
var
|
|
262
|
-
|
|
263
|
-
var context = _ref7.context,
|
|
264
|
-
mask_options = _ref7.mask_options,
|
|
256
|
+
var mask_options = _ref7.mask_options,
|
|
265
257
|
currency_mask = _ref7.currency_mask;
|
|
266
258
|
|
|
267
|
-
var maskParams = _objectSpread(_objectSpread(
|
|
259
|
+
var maskParams = _objectSpread(_objectSpread({
|
|
268
260
|
showMask: true,
|
|
269
261
|
placeholderChar: null,
|
|
270
262
|
allowDecimal: true,
|
|
271
263
|
decimalLimit: 2,
|
|
272
264
|
decimalSymbol: ','
|
|
273
|
-
},
|
|
265
|
+
}, mask_options), currency_mask);
|
|
274
266
|
|
|
275
267
|
var fix = typeof currency_mask === 'string' ? currency_mask : typeof maskParams.currency === 'string' ? maskParams.currency : 'kr';
|
|
276
268
|
maskParams.suffix = " ".concat(fix);
|
|
@@ -280,15 +272,12 @@ var handleCurrencyMask = function handleCurrencyMask(_ref7) {
|
|
|
280
272
|
exports.handleCurrencyMask = handleCurrencyMask;
|
|
281
273
|
|
|
282
274
|
var handleNumberMask = function handleNumberMask(_ref8) {
|
|
283
|
-
var
|
|
284
|
-
|
|
285
|
-
var context = _ref8.context,
|
|
286
|
-
mask_options = _ref8.mask_options,
|
|
275
|
+
var mask_options = _ref8.mask_options,
|
|
287
276
|
number_mask = _ref8.number_mask;
|
|
288
277
|
|
|
289
|
-
var maskParams = _objectSpread(_objectSpread(
|
|
278
|
+
var maskParams = _objectSpread(_objectSpread({
|
|
290
279
|
decimalSymbol: ','
|
|
291
|
-
},
|
|
280
|
+
}, mask_options), number_mask);
|
|
292
281
|
|
|
293
282
|
if (typeof maskParams.allowDecimal === 'undefined') {
|
|
294
283
|
maskParams.allowDecimal = maskParams.decimalLimit > 0;
|
package/cjs/components/lib.js
CHANGED
|
@@ -195,6 +195,12 @@ Object.defineProperty(exports, "Tabs", {
|
|
|
195
195
|
return _Tabs.default;
|
|
196
196
|
}
|
|
197
197
|
});
|
|
198
|
+
Object.defineProperty(exports, "Tag", {
|
|
199
|
+
enumerable: true,
|
|
200
|
+
get: function get() {
|
|
201
|
+
return _Tag.default;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
198
204
|
Object.defineProperty(exports, "Textarea", {
|
|
199
205
|
enumerable: true,
|
|
200
206
|
get: function get() {
|
|
@@ -281,6 +287,8 @@ var _Switch = _interopRequireDefault(require("./switch/Switch"));
|
|
|
281
287
|
|
|
282
288
|
var _Tabs = _interopRequireDefault(require("./tabs/Tabs"));
|
|
283
289
|
|
|
290
|
+
var _Tag = _interopRequireDefault(require("./tag/Tag"));
|
|
291
|
+
|
|
284
292
|
var _Textarea = _interopRequireDefault(require("./textarea/Textarea"));
|
|
285
293
|
|
|
286
294
|
var _ToggleButton = _interopRequireDefault(require("./toggle-button/ToggleButton"));
|
|
@@ -323,6 +331,7 @@ var getComponents = function getComponents() {
|
|
|
323
331
|
StepIndicator: _StepIndicator.default,
|
|
324
332
|
Switch: _Switch.default,
|
|
325
333
|
Tabs: _Tabs.default,
|
|
334
|
+
Tag: _Tag.default,
|
|
326
335
|
Textarea: _Textarea.default,
|
|
327
336
|
ToggleButton: _ToggleButton.default,
|
|
328
337
|
Tooltip: _Tooltip.default
|