@dnb/eufemia 10.70.0 → 10.70.1
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 +8 -0
- package/cjs/components/autocomplete/AutocompleteDocs.js +3 -3
- package/cjs/components/autocomplete/AutocompleteDocs.js.map +1 -1
- package/cjs/components/avatar/Avatar.js +3 -8
- package/cjs/components/avatar/Avatar.js.map +1 -1
- package/cjs/components/checkbox/CheckboxDocs.js +2 -2
- package/cjs/components/checkbox/CheckboxDocs.js.map +1 -1
- package/cjs/components/date-picker/DatePickerDocs.js +1 -1
- package/cjs/components/date-picker/DatePickerDocs.js.map +1 -1
- package/cjs/components/date-picker/DatePickerInput.js +120 -94
- package/cjs/components/date-picker/DatePickerInput.js.map +1 -1
- package/cjs/components/date-picker/style/dnb-date-picker.css +4 -0
- package/cjs/components/date-picker/style/dnb-date-picker.min.css +1 -1
- package/cjs/components/date-picker/style/dnb-date-picker.scss +3 -0
- package/cjs/components/dialog/DialogDocs.js +7 -2
- package/cjs/components/dialog/DialogDocs.js.map +1 -1
- package/cjs/components/dropdown/Dropdown.d.ts +20 -20
- package/cjs/components/dropdown/DropdownDocs.d.ts +1 -0
- package/cjs/components/dropdown/DropdownDocs.js +158 -1
- package/cjs/components/dropdown/DropdownDocs.js.map +1 -1
- package/cjs/components/flex/ContainerDocs.js +1 -1
- package/cjs/components/flex/ContainerDocs.js.map +1 -1
- package/cjs/components/flex/ItemDocs.d.ts +2 -0
- package/cjs/components/flex/ItemDocs.js +39 -0
- package/cjs/components/flex/ItemDocs.js.map +1 -0
- package/cjs/components/grid/ItemDocs.d.ts +2 -0
- package/cjs/components/grid/ItemDocs.js +19 -0
- package/cjs/components/grid/ItemDocs.js.map +1 -0
- package/cjs/components/input/InputDocs.js +3 -3
- package/cjs/components/input/InputDocs.js.map +1 -1
- package/cjs/components/input-masked/InputMasked.d.ts +0 -3
- package/cjs/components/input-masked/InputMaskedDocs.d.ts +1 -0
- package/cjs/components/input-masked/InputMaskedDocs.js +58 -1
- package/cjs/components/input-masked/InputMaskedDocs.js.map +1 -1
- package/cjs/components/input-masked/MultiInputMaskedDocs.d.ts +2 -0
- package/cjs/components/input-masked/MultiInputMaskedDocs.js +70 -1
- package/cjs/components/input-masked/MultiInputMaskedDocs.js.map +1 -1
- package/cjs/components/input-masked/style/dnb-input-masked.css +9 -0
- package/cjs/components/input-masked/style/dnb-input-masked.min.css +1 -1
- package/cjs/components/input-masked/style/dnb-input-masked.scss +12 -0
- package/cjs/components/input-masked/text-mask/InputModeNumber.d.ts +8 -0
- package/cjs/components/input-masked/text-mask/InputModeNumber.js +32 -9
- package/cjs/components/input-masked/text-mask/InputModeNumber.js.map +1 -1
- package/cjs/components/input-masked/text-mask/adjustCaretPosition.d.ts +2 -1
- package/cjs/components/input-masked/text-mask/adjustCaretPosition.js +3 -2
- package/cjs/components/input-masked/text-mask/adjustCaretPosition.js.map +1 -1
- package/cjs/components/input-masked/text-mask/createTextMaskInputElement.js +9 -3
- package/cjs/components/input-masked/text-mask/createTextMaskInputElement.js.map +1 -1
- package/cjs/components/modal/ModalDocs.d.ts +3 -0
- package/cjs/components/modal/ModalDocs.js +191 -0
- package/cjs/components/modal/ModalDocs.js.map +1 -0
- package/cjs/components/radio/RadioDocs.js +2 -2
- package/cjs/components/radio/RadioDocs.js.map +1 -1
- package/cjs/components/section/Section.js +2 -7
- package/cjs/components/section/Section.js.map +1 -1
- package/cjs/components/section/SectionDocs.js +1 -1
- package/cjs/components/section/SectionDocs.js.map +1 -1
- package/cjs/components/slider/SliderDocs.js +2 -2
- package/cjs/components/slider/SliderDocs.js.map +1 -1
- package/cjs/components/space/SpaceDocs.d.ts +3 -0
- package/cjs/components/space/SpaceDocs.js +61 -0
- package/cjs/components/space/SpaceDocs.js.map +1 -0
- package/cjs/components/switch/SwitchDocs.js +2 -2
- package/cjs/components/switch/SwitchDocs.js.map +1 -1
- package/cjs/components/textarea/TextareaDocs.js +3 -3
- package/cjs/components/textarea/TextareaDocs.js.map +1 -1
- package/cjs/components/toggle-button/ToggleButtonGroupDocs.js +1 -1
- package/cjs/components/toggle-button/ToggleButtonGroupDocs.js.map +1 -1
- package/cjs/components/tooltip/TooltipDocs.js +1 -1
- package/cjs/components/tooltip/TooltipDocs.js.map +1 -1
- package/cjs/extensions/forms/DataContext/At/AtDocs.d.ts +2 -0
- package/cjs/extensions/forms/DataContext/At/AtDocs.js +24 -0
- package/cjs/extensions/forms/DataContext/At/AtDocs.js.map +1 -0
- package/cjs/extensions/forms/Field/Password/PasswordDocs.d.ts +1 -0
- package/cjs/extensions/forms/Field/Password/PasswordDocs.js +14 -2
- package/cjs/extensions/forms/Field/Password/PasswordDocs.js.map +1 -1
- package/cjs/extensions/forms/Field/String/StringDocs.js +1 -1
- package/cjs/extensions/forms/Field/String/StringDocs.js.map +1 -1
- package/cjs/extensions/forms/Form/ButtonRow/ButtonRowDocs.d.ts +2 -0
- package/cjs/extensions/forms/Form/ButtonRow/ButtonRowDocs.js +19 -0
- package/cjs/extensions/forms/Form/ButtonRow/ButtonRowDocs.js.map +1 -0
- package/cjs/extensions/forms/Form/Isolation/IsolationDocs.js +1 -1
- package/cjs/extensions/forms/Form/Isolation/IsolationDocs.js.map +1 -1
- package/cjs/extensions/forms/Wizard/Buttons/ButtonsDocs.d.ts +2 -0
- package/cjs/extensions/forms/Wizard/Buttons/ButtonsDocs.js +14 -0
- package/cjs/extensions/forms/Wizard/Buttons/ButtonsDocs.js.map +1 -0
- package/cjs/extensions/forms/hooks/useFieldProps.js +5 -1
- package/cjs/extensions/forms/hooks/useFieldProps.js.map +1 -1
- package/cjs/shared/Eufemia.d.ts +1 -1
- package/cjs/shared/Eufemia.js +2 -2
- package/cjs/shared/Eufemia.js.map +1 -1
- package/cjs/shared/helpers.d.ts +1 -0
- package/cjs/shared/helpers.js +7 -0
- package/cjs/shared/helpers.js.map +1 -1
- package/cjs/shared/locales/sv-SE.js +2 -2
- package/cjs/shared/locales/sv-SE.js.map +1 -1
- package/cjs/style/core/scopes.scss +1 -1
- package/cjs/style/dnb-ui-basis.css +1 -1
- package/cjs/style/dnb-ui-basis.min.css +1 -1
- package/cjs/style/dnb-ui-body.css +1 -1
- package/cjs/style/dnb-ui-body.min.css +1 -1
- package/cjs/style/dnb-ui-components.css +13 -0
- package/cjs/style/dnb-ui-components.min.css +1 -1
- package/cjs/style/dnb-ui-core.css +1 -1
- package/cjs/style/dnb-ui-core.min.css +1 -1
- package/cjs/style/themes/theme-eiendom/eiendom-theme-components.css +13 -0
- package/cjs/style/themes/theme-eiendom/eiendom-theme-components.min.css +1 -1
- package/cjs/style/themes/theme-sbanken/sbanken-theme-components.css +13 -0
- package/cjs/style/themes/theme-sbanken/sbanken-theme-components.min.css +1 -1
- package/cjs/style/themes/theme-ui/ui-theme-components.css +13 -0
- package/cjs/style/themes/theme-ui/ui-theme-components.min.css +1 -1
- package/components/autocomplete/AutocompleteDocs.js +3 -3
- package/components/autocomplete/AutocompleteDocs.js.map +1 -1
- package/components/avatar/Avatar.js +1 -6
- package/components/avatar/Avatar.js.map +1 -1
- package/components/checkbox/CheckboxDocs.js +2 -2
- package/components/checkbox/CheckboxDocs.js.map +1 -1
- package/components/date-picker/DatePickerDocs.js +1 -1
- package/components/date-picker/DatePickerDocs.js.map +1 -1
- package/components/date-picker/DatePickerInput.js +121 -95
- package/components/date-picker/DatePickerInput.js.map +1 -1
- package/components/date-picker/style/dnb-date-picker.css +4 -0
- package/components/date-picker/style/dnb-date-picker.min.css +1 -1
- package/components/date-picker/style/dnb-date-picker.scss +3 -0
- package/components/dialog/DialogDocs.js +7 -2
- package/components/dialog/DialogDocs.js.map +1 -1
- package/components/dropdown/Dropdown.d.ts +20 -20
- package/components/dropdown/DropdownDocs.d.ts +1 -0
- package/components/dropdown/DropdownDocs.js +157 -0
- package/components/dropdown/DropdownDocs.js.map +1 -1
- package/components/flex/ContainerDocs.js +1 -1
- package/components/flex/ContainerDocs.js.map +1 -1
- package/components/flex/ItemDocs.d.ts +2 -0
- package/components/flex/ItemDocs.js +33 -0
- package/components/flex/ItemDocs.js.map +1 -0
- package/components/grid/ItemDocs.d.ts +2 -0
- package/components/grid/ItemDocs.js +13 -0
- package/components/grid/ItemDocs.js.map +1 -0
- package/components/input/InputDocs.js +3 -3
- package/components/input/InputDocs.js.map +1 -1
- package/components/input-masked/InputMasked.d.ts +0 -3
- package/components/input-masked/InputMaskedDocs.d.ts +1 -0
- package/components/input-masked/InputMaskedDocs.js +57 -0
- package/components/input-masked/InputMaskedDocs.js.map +1 -1
- package/components/input-masked/MultiInputMaskedDocs.d.ts +2 -0
- package/components/input-masked/MultiInputMaskedDocs.js +69 -0
- package/components/input-masked/MultiInputMaskedDocs.js.map +1 -1
- package/components/input-masked/style/dnb-input-masked.css +9 -0
- package/components/input-masked/style/dnb-input-masked.min.css +1 -1
- package/components/input-masked/style/dnb-input-masked.scss +12 -0
- package/components/input-masked/text-mask/InputModeNumber.d.ts +8 -0
- package/components/input-masked/text-mask/InputModeNumber.js +32 -9
- package/components/input-masked/text-mask/InputModeNumber.js.map +1 -1
- package/components/input-masked/text-mask/adjustCaretPosition.d.ts +2 -1
- package/components/input-masked/text-mask/adjustCaretPosition.js +3 -2
- package/components/input-masked/text-mask/adjustCaretPosition.js.map +1 -1
- package/components/input-masked/text-mask/createTextMaskInputElement.js +9 -3
- package/components/input-masked/text-mask/createTextMaskInputElement.js.map +1 -1
- package/components/modal/ModalDocs.d.ts +3 -0
- package/components/modal/ModalDocs.js +185 -0
- package/components/modal/ModalDocs.js.map +1 -0
- package/components/radio/RadioDocs.js +2 -2
- package/components/radio/RadioDocs.js.map +1 -1
- package/components/section/Section.js +1 -6
- package/components/section/Section.js.map +1 -1
- package/components/section/SectionDocs.js +1 -1
- package/components/section/SectionDocs.js.map +1 -1
- package/components/slider/SliderDocs.js +2 -2
- package/components/slider/SliderDocs.js.map +1 -1
- package/components/space/SpaceDocs.d.ts +3 -0
- package/components/space/SpaceDocs.js +55 -0
- package/components/space/SpaceDocs.js.map +1 -0
- package/components/switch/SwitchDocs.js +2 -2
- package/components/switch/SwitchDocs.js.map +1 -1
- package/components/textarea/TextareaDocs.js +3 -3
- package/components/textarea/TextareaDocs.js.map +1 -1
- package/components/toggle-button/ToggleButtonGroupDocs.js +1 -1
- package/components/toggle-button/ToggleButtonGroupDocs.js.map +1 -1
- package/components/tooltip/TooltipDocs.js +1 -1
- package/components/tooltip/TooltipDocs.js.map +1 -1
- package/es/components/autocomplete/AutocompleteDocs.js +3 -3
- package/es/components/autocomplete/AutocompleteDocs.js.map +1 -1
- package/es/components/avatar/Avatar.js +1 -6
- package/es/components/avatar/Avatar.js.map +1 -1
- package/es/components/checkbox/CheckboxDocs.js +2 -2
- package/es/components/checkbox/CheckboxDocs.js.map +1 -1
- package/es/components/date-picker/DatePickerDocs.js +1 -1
- package/es/components/date-picker/DatePickerDocs.js.map +1 -1
- package/es/components/date-picker/DatePickerInput.js +116 -92
- package/es/components/date-picker/DatePickerInput.js.map +1 -1
- package/es/components/date-picker/style/dnb-date-picker.css +4 -0
- package/es/components/date-picker/style/dnb-date-picker.min.css +1 -1
- package/es/components/date-picker/style/dnb-date-picker.scss +3 -0
- package/es/components/dialog/DialogDocs.js +7 -2
- package/es/components/dialog/DialogDocs.js.map +1 -1
- package/es/components/dropdown/Dropdown.d.ts +20 -20
- package/es/components/dropdown/DropdownDocs.d.ts +1 -0
- package/es/components/dropdown/DropdownDocs.js +157 -0
- package/es/components/dropdown/DropdownDocs.js.map +1 -1
- package/es/components/flex/ContainerDocs.js +1 -1
- package/es/components/flex/ContainerDocs.js.map +1 -1
- package/es/components/flex/ItemDocs.d.ts +2 -0
- package/es/components/flex/ItemDocs.js +33 -0
- package/es/components/flex/ItemDocs.js.map +1 -0
- package/es/components/grid/ItemDocs.d.ts +2 -0
- package/es/components/grid/ItemDocs.js +13 -0
- package/es/components/grid/ItemDocs.js.map +1 -0
- package/es/components/input/InputDocs.js +3 -3
- package/es/components/input/InputDocs.js.map +1 -1
- package/es/components/input-masked/InputMasked.d.ts +0 -3
- package/es/components/input-masked/InputMaskedDocs.d.ts +1 -0
- package/es/components/input-masked/InputMaskedDocs.js +57 -0
- package/es/components/input-masked/InputMaskedDocs.js.map +1 -1
- package/es/components/input-masked/MultiInputMaskedDocs.d.ts +2 -0
- package/es/components/input-masked/MultiInputMaskedDocs.js +69 -0
- package/es/components/input-masked/MultiInputMaskedDocs.js.map +1 -1
- package/es/components/input-masked/style/dnb-input-masked.css +9 -0
- package/es/components/input-masked/style/dnb-input-masked.min.css +1 -1
- package/es/components/input-masked/style/dnb-input-masked.scss +12 -0
- package/es/components/input-masked/text-mask/InputModeNumber.d.ts +8 -0
- package/es/components/input-masked/text-mask/InputModeNumber.js +39 -9
- package/es/components/input-masked/text-mask/InputModeNumber.js.map +1 -1
- package/es/components/input-masked/text-mask/adjustCaretPosition.d.ts +2 -1
- package/es/components/input-masked/text-mask/adjustCaretPosition.js +3 -2
- package/es/components/input-masked/text-mask/adjustCaretPosition.js.map +1 -1
- package/es/components/input-masked/text-mask/createTextMaskInputElement.js +9 -3
- package/es/components/input-masked/text-mask/createTextMaskInputElement.js.map +1 -1
- package/es/components/modal/ModalDocs.d.ts +3 -0
- package/es/components/modal/ModalDocs.js +185 -0
- package/es/components/modal/ModalDocs.js.map +1 -0
- package/es/components/radio/RadioDocs.js +2 -2
- package/es/components/radio/RadioDocs.js.map +1 -1
- package/es/components/section/Section.js +1 -6
- package/es/components/section/Section.js.map +1 -1
- package/es/components/section/SectionDocs.js +1 -1
- package/es/components/section/SectionDocs.js.map +1 -1
- package/es/components/slider/SliderDocs.js +2 -2
- package/es/components/slider/SliderDocs.js.map +1 -1
- package/es/components/space/SpaceDocs.d.ts +3 -0
- package/es/components/space/SpaceDocs.js +55 -0
- package/es/components/space/SpaceDocs.js.map +1 -0
- package/es/components/switch/SwitchDocs.js +2 -2
- package/es/components/switch/SwitchDocs.js.map +1 -1
- package/es/components/textarea/TextareaDocs.js +3 -3
- package/es/components/textarea/TextareaDocs.js.map +1 -1
- package/es/components/toggle-button/ToggleButtonGroupDocs.js +1 -1
- package/es/components/toggle-button/ToggleButtonGroupDocs.js.map +1 -1
- package/es/components/tooltip/TooltipDocs.js +1 -1
- package/es/components/tooltip/TooltipDocs.js.map +1 -1
- package/es/extensions/forms/DataContext/At/AtDocs.d.ts +2 -0
- package/es/extensions/forms/DataContext/At/AtDocs.js +18 -0
- package/es/extensions/forms/DataContext/At/AtDocs.js.map +1 -0
- package/es/extensions/forms/Field/Password/PasswordDocs.d.ts +1 -0
- package/es/extensions/forms/Field/Password/PasswordDocs.js +13 -1
- package/es/extensions/forms/Field/Password/PasswordDocs.js.map +1 -1
- package/es/extensions/forms/Field/String/StringDocs.js +1 -1
- package/es/extensions/forms/Field/String/StringDocs.js.map +1 -1
- package/es/extensions/forms/Form/ButtonRow/ButtonRowDocs.d.ts +2 -0
- package/es/extensions/forms/Form/ButtonRow/ButtonRowDocs.js +13 -0
- package/es/extensions/forms/Form/ButtonRow/ButtonRowDocs.js.map +1 -0
- package/es/extensions/forms/Form/Isolation/IsolationDocs.js +1 -1
- package/es/extensions/forms/Form/Isolation/IsolationDocs.js.map +1 -1
- package/es/extensions/forms/Wizard/Buttons/ButtonsDocs.d.ts +2 -0
- package/es/extensions/forms/Wizard/Buttons/ButtonsDocs.js +8 -0
- package/es/extensions/forms/Wizard/Buttons/ButtonsDocs.js.map +1 -0
- package/es/extensions/forms/hooks/useFieldProps.js +5 -1
- package/es/extensions/forms/hooks/useFieldProps.js.map +1 -1
- package/es/shared/Eufemia.d.ts +1 -1
- package/es/shared/Eufemia.js +2 -2
- package/es/shared/Eufemia.js.map +1 -1
- package/es/shared/helpers.d.ts +1 -0
- package/es/shared/helpers.js +6 -0
- package/es/shared/helpers.js.map +1 -1
- package/es/shared/locales/sv-SE.js +2 -2
- package/es/shared/locales/sv-SE.js.map +1 -1
- package/es/style/core/scopes.scss +1 -1
- package/es/style/dnb-ui-basis.css +1 -1
- package/es/style/dnb-ui-basis.min.css +1 -1
- package/es/style/dnb-ui-body.css +1 -1
- package/es/style/dnb-ui-body.min.css +1 -1
- package/es/style/dnb-ui-components.css +13 -0
- package/es/style/dnb-ui-components.min.css +1 -1
- package/es/style/dnb-ui-core.css +1 -1
- package/es/style/dnb-ui-core.min.css +1 -1
- package/es/style/themes/theme-eiendom/eiendom-theme-components.css +13 -0
- package/es/style/themes/theme-eiendom/eiendom-theme-components.min.css +1 -1
- package/es/style/themes/theme-sbanken/sbanken-theme-components.css +13 -0
- package/es/style/themes/theme-sbanken/sbanken-theme-components.min.css +1 -1
- package/es/style/themes/theme-ui/ui-theme-components.css +13 -0
- package/es/style/themes/theme-ui/ui-theme-components.min.css +1 -1
- package/esm/dnb-ui-basis.min.mjs +1 -1
- package/esm/dnb-ui-components.min.mjs +1 -1
- package/esm/dnb-ui-elements.min.mjs +1 -1
- package/esm/dnb-ui-extensions.min.mjs +1 -1
- package/esm/dnb-ui-lib.min.mjs +1 -1
- package/extensions/forms/DataContext/At/AtDocs.d.ts +2 -0
- package/extensions/forms/DataContext/At/AtDocs.js +18 -0
- package/extensions/forms/DataContext/At/AtDocs.js.map +1 -0
- package/extensions/forms/Field/Password/PasswordDocs.d.ts +1 -0
- package/extensions/forms/Field/Password/PasswordDocs.js +13 -1
- package/extensions/forms/Field/Password/PasswordDocs.js.map +1 -1
- package/extensions/forms/Field/String/StringDocs.js +1 -1
- package/extensions/forms/Field/String/StringDocs.js.map +1 -1
- package/extensions/forms/Form/ButtonRow/ButtonRowDocs.d.ts +2 -0
- package/extensions/forms/Form/ButtonRow/ButtonRowDocs.js +13 -0
- package/extensions/forms/Form/ButtonRow/ButtonRowDocs.js.map +1 -0
- package/extensions/forms/Form/Isolation/IsolationDocs.js +1 -1
- package/extensions/forms/Form/Isolation/IsolationDocs.js.map +1 -1
- package/extensions/forms/Wizard/Buttons/ButtonsDocs.d.ts +2 -0
- package/extensions/forms/Wizard/Buttons/ButtonsDocs.js +8 -0
- package/extensions/forms/Wizard/Buttons/ButtonsDocs.js.map +1 -0
- package/extensions/forms/hooks/useFieldProps.js +5 -1
- package/extensions/forms/hooks/useFieldProps.js.map +1 -1
- package/package.json +1 -1
- package/shared/Eufemia.d.ts +1 -1
- package/shared/Eufemia.js +2 -2
- package/shared/Eufemia.js.map +1 -1
- package/shared/helpers.d.ts +1 -0
- package/shared/helpers.js +6 -0
- package/shared/helpers.js.map +1 -1
- package/shared/locales/sv-SE.js +2 -2
- package/shared/locales/sv-SE.js.map +1 -1
- package/style/core/scopes.scss +1 -1
- package/style/dnb-ui-basis.css +1 -1
- package/style/dnb-ui-basis.min.css +1 -1
- package/style/dnb-ui-body.css +1 -1
- package/style/dnb-ui-body.min.css +1 -1
- package/style/dnb-ui-components.css +13 -0
- package/style/dnb-ui-components.min.css +1 -1
- package/style/dnb-ui-core.css +1 -1
- package/style/dnb-ui-core.min.css +1 -1
- package/style/themes/theme-eiendom/eiendom-theme-components.css +13 -0
- package/style/themes/theme-eiendom/eiendom-theme-components.min.css +1 -1
- package/style/themes/theme-sbanken/sbanken-theme-components.css +13 -0
- package/style/themes/theme-sbanken/sbanken-theme-components.min.css +1 -1
- package/style/themes/theme-ui/ui-theme-components.css +13 -0
- package/style/themes/theme-ui/ui-theme-components.min.css +1 -1
- package/umd/dnb-ui-basis.min.js +1 -1
- package/umd/dnb-ui-components.min.js +1 -1
- package/umd/dnb-ui-elements.min.js +1 -1
- package/umd/dnb-ui-extensions.min.js +1 -1
- package/umd/dnb-ui-lib.min.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputDocs.js","names":["inputProperties","exports","value","doc","type","status","align","label","label_sr_only","label_direction","status_state","status_props","globalStatus","placeholder","icon","icon_position","icon_size","keep_placeholder","input_class","autocomplete","submit_button_title","suffix","size","selectall","clear","stretch","skeleton","input_attributes","input_state","submit_element","inner_ref","input_element","inner_element","inputEvents","on_change","on_focus","on_key_down","on_blur","on_submit","on_clear"],"sources":["../../../../src/components/input/InputDocs.ts"],"sourcesContent":["import { PropertiesTableProps } from '../../shared/types'\n\nexport const inputProperties: PropertiesTableProps = {\n value: {\n doc: 'The content value of the input.',\n type: 'string',\n status: 'optional',\n },\n align: {\n doc: 'Defines the text alignment of the input. Can be `left`, `right` or `center`. Defaults to `left`.',\n type: 'string',\n status: 'optional',\n },\n label: {\n doc: 'Prepends the Form Label component. If no ID is provided, a random ID is created.',\n type: 'React.Node',\n status: 'optional',\n },\n label_sr_only: {\n doc: 'Use `true` to make the label only readable by screen readers.',\n type: 'boolean',\n status: 'optional',\n },\n label_direction: {\n doc: 'Use `label_direction=\"vertical\"` to change the label layout direction. Defaults to `horizontal`.',\n type: 'string',\n status: 'optional',\n },\n status: {\n doc: 'Text with a status message. The style defaults to an error message. You can use `true` to only get the status color, without a message.',\n type: 'string',\n status: 'optional',\n },\n status_state: {\n doc: 'Defines the state of the status. Currently, there are two statuses `[error, info]`. Defaults to `error`.',\n type: 'string',\n status: 'optional',\n },\n status_props: {\n doc: 'Use an object to define additional FormStatus properties.',\n type: 'object',\n status: 'optional',\n },\n globalStatus: {\n doc: 'The [configuration](/uilib/components/global-status/properties/#configuration-object) used for the target [GlobalStatus](/uilib/components/global-status).',\n type: 'object',\n status: 'optional',\n },\n placeholder: {\n doc: 'The placeholder which shows up once the input value is empty.',\n type: 'string',\n status: 'optional',\n },\n icon: {\n doc: '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.',\n type: ['string', 'React.Node'],\n status: 'optional',\n },\n icon_position: {\n doc: 'Defines the position of icon inside the input. Set to `left` or `right`. Defaults to `left` if not set.',\n type: 'string',\n status: 'optional',\n },\n icon_size: {\n doc: 'The icon size of the icon shows. Defaults to `medium`.',\n type: 'string',\n status: 'optional',\n },\n keep_placeholder: {\n doc: 'Set to `true` in case the `placeholder` has to be kept during focus. By default, the placeholder disappears on focus.',\n type: 'boolean',\n status: 'optional',\n },\n input_class: {\n doc: 'In case we have to set a custom input class.',\n type: 'string',\n status: 'optional',\n },\n type: {\n doc: 'Choose between `text`, `number`, `email`, `password`, `url`, `tel` and `search`.',\n type: 'string',\n status: 'optional',\n },\n autocomplete: {\n doc: 'Defaults to `off`. Set to `on` or any of [allowed `attributes`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-autocomplete). 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.',\n type: 'string',\n status: 'optional',\n },\n submit_button_title: {\n doc: 'Title attribute for the search icon. Only relevant if search input.',\n type: 'string',\n status: 'optional',\n },\n suffix: {\n doc: 'Text describing the content of the input more than the label. you can also send in a React component, so it gets wrapped inside the Input component.',\n type: ['string', 'React.Node'],\n status: 'optional',\n },\n size: {\n doc: 'The sizes you can choose is `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.',\n type: ['string', 'number'],\n status: 'optional',\n },\n selectall: {\n doc: 'If set to `true`, then the whole input value gets selected on the entry focus. A second click will place the cursor on the wanted position.',\n type: 'boolean',\n status: 'optional',\n },\n clear: {\n doc: 'If set to `true`, then a clear button will be shown which lets the user clear any given input value.',\n type: 'boolean',\n status: 'optional',\n },\n stretch: {\n doc: 'If set to `true`, then the input field will be 100% in `width`.',\n type: 'boolean',\n status: 'optional',\n },\n skeleton: {\n doc: 'If set to `true`, an overlaying skeleton with animation will be shown.',\n type: 'boolean',\n status: 'optional',\n },\n input_attributes: {\n doc: '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.',\n type: 'object',\n status: 'optional',\n },\n input_state: {\n doc: 'Defines a custom visual state of the input. Use it only if you have to simulate a custom state. Currently are three statuses `virgin` , `focus` and `dirty`. Defaults to `null`.',\n type: 'string',\n status: 'optional',\n },\n submit_element: {\n doc: 'Accepts a React element which will show up like the \"submit button\" would do on `type=\"search\"`.',\n type: ['string', 'React.Element'],\n status: 'optional',\n },\n inner_ref: {\n doc: '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()`.',\n type: 'React.Ref',\n status: 'optional',\n },\n input_element: {\n doc: 'By providing a new component we can change the internally used element. Also supports a string only, like `input_element=\"input\"`.',\n type: ['string', 'React.Element'],\n status: 'internal',\n },\n inner_element: {\n doc: 'By providing a new component to be rendered inside the \"shell\" – we can add a freely customizable internal element. Used by the Autocomplete component.',\n type: ['string', 'React.Element'],\n status: 'internal',\n },\n '[Space](/uilib/layout/space/properties)': {\n doc: 'Spacing properties like `top` or `bottom` are supported.',\n type: ['string', 'object'],\n status: 'optional',\n },\n}\n\nexport const inputEvents: PropertiesTableProps = {\n on_change: {\n doc: '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 }`.',\n type: 'function',\n status: 'optional',\n },\n on_focus: {\n doc: 'will be called on focus set by the user. Returns `{ value, event }`.',\n type: 'function',\n status: 'optional',\n },\n on_key_down: {\n doc: 'will be called on key down by the user. Returns `{ value, event }`.',\n type: 'function',\n status: 'optional',\n },\n on_blur: {\n doc: 'will be called on blur set by the user. Returns `{ value, event }`.',\n type: 'function',\n status: 'optional',\n },\n on_submit: {\n doc: 'will be called on submit button click. Returns `{ value, event }`.',\n type: 'function',\n status: 'optional',\n },\n on_clear: {\n doc: 'will be called on a clear button click. Returns `{ value, previousValue, event }`.',\n type: 'function',\n status: 'optional',\n },\n}\n"],"mappings":";;;;;;AAEO,MAAMA,eAAqC,GAAAC,OAAA,CAAAD,eAAA,GAAG;EACnDE,KAAK,EAAE;IACLC,GAAG,EAAE,iCAAiC;IACtCC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDC,KAAK,EAAE;IACLH,GAAG,EAAE,kGAAkG;IACvGC,IAAI,EAAE,QAAQ;IACdC,MAAM,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,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACDkC,QAAQ,EAAE;IACRpC,GAAG,EAAE,oFAAoF;IACzFC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV;AACF,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"InputDocs.js","names":["inputProperties","exports","value","doc","type","status","align","label","label_sr_only","label_direction","status_state","status_props","globalStatus","placeholder","icon","icon_position","icon_size","keep_placeholder","input_class","autocomplete","submit_button_title","suffix","size","selectall","clear","stretch","skeleton","input_attributes","input_state","submit_element","inner_ref","input_element","inner_element","inputEvents","on_change","on_focus","on_key_down","on_blur","on_submit","on_clear"],"sources":["../../../../src/components/input/InputDocs.ts"],"sourcesContent":["import { PropertiesTableProps } from '../../shared/types'\n\nexport const inputProperties: PropertiesTableProps = {\n value: {\n doc: 'The content value of the input.',\n type: 'string',\n status: 'optional',\n },\n align: {\n doc: 'Defines the text alignment of the input. Can be `left`, `right` or `center`. Defaults to `left`.',\n type: 'string',\n status: 'optional',\n },\n label: {\n doc: 'Prepends the Form Label component. If no ID is provided, a random ID is created.',\n type: 'React.Node',\n status: 'optional',\n },\n label_sr_only: {\n doc: 'Use `true` to make the label only readable by screen readers.',\n type: 'boolean',\n status: 'optional',\n },\n label_direction: {\n doc: 'Use `label_direction=\"vertical\"` to change the label layout direction. Defaults to `horizontal`.',\n type: 'string',\n status: 'optional',\n },\n status: {\n doc: 'Text with a status message. The style defaults to an error message. You can use `true` to only get the status color, without a message.',\n type: ['error', 'info', 'boolean'],\n status: 'optional',\n },\n status_state: {\n doc: 'Defines the state of the status. Currently, there are two statuses `[error, info]`. Defaults to `error`.',\n type: ['error', 'info'],\n status: 'optional',\n },\n status_props: {\n doc: 'Use an object to define additional FormStatus properties.',\n type: 'object',\n status: 'optional',\n },\n globalStatus: {\n doc: 'The [configuration](/uilib/components/global-status/properties/#configuration-object) used for the target [GlobalStatus](/uilib/components/global-status).',\n type: 'object',\n status: 'optional',\n },\n placeholder: {\n doc: 'The placeholder which shows up once the input value is empty.',\n type: 'string',\n status: 'optional',\n },\n icon: {\n doc: '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.',\n type: ['string', 'React.Node'],\n status: 'optional',\n },\n icon_position: {\n doc: 'Defines the position of icon inside the input. Set to `left` or `right`. Defaults to `left` if not set.',\n type: 'string',\n status: 'optional',\n },\n icon_size: {\n doc: 'The icon size of the icon shows. Defaults to `medium`.',\n type: 'string',\n status: 'optional',\n },\n keep_placeholder: {\n doc: 'Set to `true` in case the `placeholder` has to be kept during focus. By default, the placeholder disappears on focus.',\n type: 'boolean',\n status: 'optional',\n },\n input_class: {\n doc: 'In case we have to set a custom input class.',\n type: 'string',\n status: 'optional',\n },\n type: {\n doc: 'Choose between `text`, `number`, `email`, `password`, `url`, `tel` and `search`.',\n type: 'string',\n status: 'optional',\n },\n autocomplete: {\n doc: 'Defaults to `off`. Set to `on` or any of [allowed `attributes`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-autocomplete). 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.',\n type: 'string',\n status: 'optional',\n },\n submit_button_title: {\n doc: 'Title attribute for the search icon. Only relevant if search input.',\n type: 'string',\n status: 'optional',\n },\n suffix: {\n doc: 'Text describing the content of the input more than the label. you can also send in a React component, so it gets wrapped inside the Input component.',\n type: ['string', 'React.Node'],\n status: 'optional',\n },\n size: {\n doc: 'The sizes you can choose is `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.',\n type: ['string', 'number'],\n status: 'optional',\n },\n selectall: {\n doc: 'If set to `true`, then the whole input value gets selected on the entry focus. A second click will place the cursor on the wanted position.',\n type: 'boolean',\n status: 'optional',\n },\n clear: {\n doc: 'If set to `true`, then a clear button will be shown which lets the user clear any given input value.',\n type: 'boolean',\n status: 'optional',\n },\n stretch: {\n doc: 'If set to `true`, then the input field will be 100% in `width`.',\n type: 'boolean',\n status: 'optional',\n },\n skeleton: {\n doc: 'If set to `true`, an overlaying skeleton with animation will be shown.',\n type: 'boolean',\n status: 'optional',\n },\n input_attributes: {\n doc: '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.',\n type: 'object',\n status: 'optional',\n },\n input_state: {\n doc: 'Defines a custom visual state of the input. Use it only if you have to simulate a custom state. Currently are three statuses `virgin` , `focus` and `dirty`. Defaults to `null`.',\n type: 'string',\n status: 'optional',\n },\n submit_element: {\n doc: 'Accepts a React element which will show up like the \"submit button\" would do on `type=\"search\"`.',\n type: ['string', 'React.Element'],\n status: 'optional',\n },\n inner_ref: {\n doc: '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()`.',\n type: 'React.RefObject',\n status: 'optional',\n },\n input_element: {\n doc: 'By providing a new component we can change the internally used element. Also supports a string only, like `input_element=\"input\"`.',\n type: ['string', 'React.Element'],\n status: 'internal',\n },\n inner_element: {\n doc: 'By providing a new component to be rendered inside the \"shell\" – we can add a freely customizable internal element. Used by the Autocomplete component.',\n type: ['string', 'React.Element'],\n status: 'internal',\n },\n '[Space](/uilib/layout/space/properties)': {\n doc: 'Spacing properties like `top` or `bottom` are supported.',\n type: ['string', 'object'],\n status: 'optional',\n },\n}\n\nexport const inputEvents: PropertiesTableProps = {\n on_change: {\n doc: '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 }`.',\n type: 'function',\n status: 'optional',\n },\n on_focus: {\n doc: 'will be called on focus set by the user. Returns `{ value, event }`.',\n type: 'function',\n status: 'optional',\n },\n on_key_down: {\n doc: 'will be called on key down by the user. Returns `{ value, event }`.',\n type: 'function',\n status: 'optional',\n },\n on_blur: {\n doc: 'will be called on blur set by the user. Returns `{ value, event }`.',\n type: 'function',\n status: 'optional',\n },\n on_submit: {\n doc: 'will be called on submit button click. Returns `{ value, event }`.',\n type: 'function',\n status: 'optional',\n },\n on_clear: {\n doc: 'will be called on a clear button click. Returns `{ value, previousValue, event }`.',\n type: 'function',\n status: 'optional',\n },\n}\n"],"mappings":";;;;;;AAEO,MAAMA,eAAqC,GAAAC,OAAA,CAAAD,eAAA,GAAG;EACnDE,KAAK,EAAE;IACLC,GAAG,EAAE,iCAAiC;IACtCC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDC,KAAK,EAAE;IACLH,GAAG,EAAE,kGAAkG;IACvGC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDE,KAAK,EAAE;IACLJ,GAAG,EAAE,kFAAkF;IACvFC,IAAI,EAAE,YAAY;IAClBC,MAAM,EAAE;EACV,CAAC;EACDG,aAAa,EAAE;IACbL,GAAG,EAAE,+DAA+D;IACpEC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDI,eAAe,EAAE;IACfN,GAAG,EAAE,kGAAkG;IACvGC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDA,MAAM,EAAE;IACNF,GAAG,EAAE,yIAAyI;IAC9IC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC;IAClCC,MAAM,EAAE;EACV,CAAC;EACDK,YAAY,EAAE;IACZP,GAAG,EAAE,0GAA0G;IAC/GC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;IACvBC,MAAM,EAAE;EACV,CAAC;EACDM,YAAY,EAAE;IACZR,GAAG,EAAE,2DAA2D;IAChEC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDO,YAAY,EAAE;IACZT,GAAG,EAAE,4JAA4J;IACjKC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;E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AiC,GAAAhC,OAAA,CAAAgC,WAAA,GAAG;EAC/CC,SAAS,EAAE;IACT/B,GAAG,EAAE,0IAA0I;IAC/IC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACD8B,QAAQ,EAAE;IACRhC,GAAG,EAAE,sEAAsE;IAC3EC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACD+B,WAAW,EAAE;IACXjC,GAAG,EAAE,qEAAqE;IAC1EC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACDgC,OAAO,EAAE;IACPlC,GAAG,EAAE,qEAAqE;IAC1EC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACDiC,SAAS,EAAE;IACTnC,GAAG,EAAE,oEAAoE;IACzEC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACDkC,QAAQ,EAAE;IACRpC,GAAG,EAAE,oFAAoF;IACzFC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV;AACF,CAAC","ignoreList":[]}
|
|
@@ -129,9 +129,6 @@ export interface InputMaskedProps
|
|
|
129
129
|
placeholder?: string;
|
|
130
130
|
clear?: boolean;
|
|
131
131
|
keep_placeholder?: boolean;
|
|
132
|
-
/**
|
|
133
|
-
* (string): What to display after the amount. Defaults to an empty string.
|
|
134
|
-
*/
|
|
135
132
|
suffix?: InputMaskedSuffix;
|
|
136
133
|
align?: InputMaskedAlign;
|
|
137
134
|
selectall?: boolean;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.inputMaskedProperties = exports.inputMaskedEvents = void 0;
|
|
6
|
+
exports.inputMaskedProperties = exports.inputMaskedMaskOptionsProperties = exports.inputMaskedEvents = void 0;
|
|
7
7
|
const inputMaskedProperties = exports.inputMaskedProperties = {
|
|
8
8
|
as_number: {
|
|
9
9
|
doc: 'Set to `true` to automatically set a number mask based on the given or inherited locale.',
|
|
@@ -93,4 +93,61 @@ const inputMaskedEvents = exports.inputMaskedEvents = {
|
|
|
93
93
|
status: 'optional'
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
|
+
const inputMaskedMaskOptionsProperties = exports.inputMaskedMaskOptionsProperties = {
|
|
97
|
+
prefix: {
|
|
98
|
+
doc: 'What to display before the amount. Defaults to an empty string.',
|
|
99
|
+
type: 'string',
|
|
100
|
+
status: 'optional'
|
|
101
|
+
},
|
|
102
|
+
suffix: {
|
|
103
|
+
doc: 'What to display after the amount. Defaults to an empty string.',
|
|
104
|
+
type: 'string',
|
|
105
|
+
status: 'optional'
|
|
106
|
+
},
|
|
107
|
+
includeThousandsSeparator: {
|
|
108
|
+
doc: 'Whether or not to separate thousands. Defaults to `true`.',
|
|
109
|
+
type: 'boolean',
|
|
110
|
+
status: 'optional'
|
|
111
|
+
},
|
|
112
|
+
thousandsSeparatorSymbol: {
|
|
113
|
+
doc: "Character with which to separate thousands. Defaults to `' '`.",
|
|
114
|
+
type: 'string',
|
|
115
|
+
status: 'optional'
|
|
116
|
+
},
|
|
117
|
+
allowDecimal: {
|
|
118
|
+
doc: 'Whether or not to allow the user to enter a fraction with the amount. Defaults to `false`.',
|
|
119
|
+
type: 'boolean',
|
|
120
|
+
status: 'optional'
|
|
121
|
+
},
|
|
122
|
+
decimalSymbol: {
|
|
123
|
+
doc: "Character that will act as a decimal point. Defaults to `','`.",
|
|
124
|
+
type: 'string',
|
|
125
|
+
status: 'optional'
|
|
126
|
+
},
|
|
127
|
+
decimalLimit: {
|
|
128
|
+
doc: 'How many digits to allow after the decimal. Defaults to `2`.',
|
|
129
|
+
type: 'number',
|
|
130
|
+
status: 'optional'
|
|
131
|
+
},
|
|
132
|
+
integerLimit: {
|
|
133
|
+
doc: 'Limit the length of the integer number. Defaults to `null` for unlimited.',
|
|
134
|
+
type: 'number',
|
|
135
|
+
status: 'optional'
|
|
136
|
+
},
|
|
137
|
+
requireDecimal: {
|
|
138
|
+
doc: 'Whether or not to always include a decimal point and placeholder for decimal digits after the integer. Defaults to `false`.',
|
|
139
|
+
type: 'boolean',
|
|
140
|
+
status: 'optional'
|
|
141
|
+
},
|
|
142
|
+
allowNegative: {
|
|
143
|
+
doc: 'Whether or not to allow negative numbers. Defaults to `true`.',
|
|
144
|
+
type: 'boolean',
|
|
145
|
+
status: 'optional'
|
|
146
|
+
},
|
|
147
|
+
disallowLeadingZeroes: {
|
|
148
|
+
doc: 'Whether or not to allow leading zeroes. Defaults to `false`.',
|
|
149
|
+
type: 'boolean',
|
|
150
|
+
status: 'optional'
|
|
151
|
+
}
|
|
152
|
+
};
|
|
96
153
|
//# sourceMappingURL=InputMaskedDocs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputMaskedDocs.js","names":["inputMaskedProperties","exports","as_number","doc","type","status","as_percent","as_currency","mask_options","number_mask","currency_mask","number_format","locale","mask","show_mask","show_guide","placeholder_char","keep_char_positions","inputMaskedEvents","on_change"],"sources":["../../../../src/components/input-masked/InputMaskedDocs.ts"],"sourcesContent":["import { PropertiesTableProps } from '../../shared/types'\n\nexport const inputMaskedProperties: PropertiesTableProps = {\n as_number: {\n doc: 'Set to `true` to automatically set a number mask based on the given or inherited locale.',\n type: 'boolean',\n status: 'optional',\n },\n as_percent: {\n doc: 'Set to `true` to automatically set a number mask with a percentage sign based on the given or inherited locale.',\n type: 'boolean',\n status: 'optional',\n },\n as_currency: {\n doc: 'Set to `true` to use `NOK` or give it a currency code e.g. `USD` to automatically set a currency mask based on the given or inherited locale.',\n type: 'boolean',\n status: 'optional',\n },\n mask_options: {\n doc: 'Use it to manipulate internal masks. You can use it instead of e.g. `number_mask` or `currency_mask`. All options are listed below.',\n type: 'object',\n status: 'optional',\n },\n number_mask: {\n doc: 'Set to `true` to enable the default numbers formatting – 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.',\n type: ['boolean', 'object'],\n status: 'optional',\n },\n currency_mask: {\n doc: 'Set to `true` or set the _valuta_ (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`.',\n type: ['boolean', 'object'],\n status: 'optional',\n },\n number_format: {\n doc: 'Use an object with [NumberFormat](/uilib/components/number-format/properties).',\n type: 'object',\n status: 'optional',\n },\n locale: {\n doc: 'Define the locale to be used in the `as_number` or `as_currency` masked. It will be inherited from the [Eufemia Provider](/uilib/usage/customisation/provider) if not given. Defaults to `nb-NO`.',\n type: 'string',\n status: 'optional',\n },\n mask: {\n doc: 'A mask can be defined both as a [RegExp style of characters](https://github.com/text-mask/text-mask/blob/master/componentDocumentation.md#readme) or a callback function. Example below. Defaults to number mask.',\n type: ['RegExp', 'function'],\n status: 'optional',\n },\n show_mask: {\n doc: 'Show mask when input is empty and has no focus. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n show_guide: {\n doc: \"When `false` is given, it doesn't print out placeholder characters and only adds mask characters when the user reaches them as they're typing. Defaults to `true`.\",\n type: 'boolean',\n status: 'optional',\n },\n placeholder_char: {\n doc: 'The placeholder character represents the fillable spot in the mask (e.g. `_`). Defaults to invisible space.',\n type: 'string',\n status: 'optional',\n },\n keep_char_positions: {\n doc: 'When `true`, adding or deleting characters will not affect the positions of existing characters. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n '[Space](/uilib/layout/space/properties)': {\n doc: 'Spacing properties like `top` or `bottom` are supported.',\n type: ['string', 'object'],\n status: 'optional',\n },\n '[Input](/uilib/components/input/properties)': {\n doc: 'All `Input` properties are supported.',\n type: 'Various',\n status: 'optional',\n },\n}\n\nexport const inputMaskedEvents: PropertiesTableProps = {\n on_change: {\n doc: 'will be called on value changes made by the user. Returns an object with the value as a string and the native event: `{ value, numberValue, cleanedValue, event }`.',\n type: 'function',\n status: 'optional',\n },\n '[Input](/uilib/components/input/events)':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,GAAG,EAAE,oKAAoK;IACzKC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDW,gBAAgB,EAAE;IAChBb,GAAG,EAAE,6GAA6G;IAClHC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDY,mBAAmB,EAAE;IACnBd,GAAG,EAAE,uHAAuH;IAC5HC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACD,yCAAyC,EAAE;IACzCF,GAAG,EAAE,0DAA0D;IAC/DC,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC1BC,MAAM,EAAE;EACV,CAAC;EACD,6CAA6C,EAAE;IAC7CF,GAAG,EAAE,uCAAuC;IAC5CC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV;AACF,CAAC;AAEM,MAAMa,iBAAuC,GAAAjB,OAAA,CAAAiB,iBAAA,GAAG;EACrDC,SAAS,EAAE;IACThB,GAAG,EAAE,qKAAqK;IAC1KC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACD,yCAAyC,EAAE;IACzCF,GAAG,EAAE,mCAAmC;IACxCC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV;AACF,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"InputMaskedDocs.js","names":["inputMaskedProperties","exports","as_number","doc","type","status","as_percent","as_currency","mask_options","number_mask","currency_mask","number_format","locale","mask","show_mask","show_guide","placeholder_char","keep_char_positions","inputMaskedEvents","on_change","inputMaskedMaskOptionsProperties","prefix","suffix","includeThousandsSeparator","thousandsSeparatorSymbol","allowDecimal","decimalSymbol","decimalLimit","integerLimit","requireDecimal","allowNegative","disallowLeadingZeroes"],"sources":["../../../../src/components/input-masked/InputMaskedDocs.ts"],"sourcesContent":["import { PropertiesTableProps } from '../../shared/types'\n\nexport const inputMaskedProperties: PropertiesTableProps = {\n as_number: {\n doc: 'Set to `true` to automatically set a number mask based on the given or inherited locale.',\n type: 'boolean',\n status: 'optional',\n },\n as_percent: {\n doc: 'Set to `true` to automatically set a number mask with a percentage sign based on the given or inherited locale.',\n type: 'boolean',\n status: 'optional',\n },\n as_currency: {\n doc: 'Set to `true` to use `NOK` or give it a currency code e.g. `USD` to automatically set a currency mask based on the given or inherited locale.',\n type: 'boolean',\n status: 'optional',\n },\n mask_options: {\n doc: 'Use it to manipulate internal masks. You can use it instead of e.g. `number_mask` or `currency_mask`. All options are listed below.',\n type: 'object',\n status: 'optional',\n },\n number_mask: {\n doc: 'Set to `true` to enable the default numbers formatting – 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.',\n type: ['boolean', 'object'],\n status: 'optional',\n },\n currency_mask: {\n doc: 'Set to `true` or set the _valuta_ (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`.',\n type: ['boolean', 'object'],\n status: 'optional',\n },\n number_format: {\n doc: 'Use an object with [NumberFormat](/uilib/components/number-format/properties).',\n type: 'object',\n status: 'optional',\n },\n locale: {\n doc: 'Define the locale to be used in the `as_number` or `as_currency` masked. It will be inherited from the [Eufemia Provider](/uilib/usage/customisation/provider) if not given. Defaults to `nb-NO`.',\n type: 'string',\n status: 'optional',\n },\n mask: {\n doc: 'A mask can be defined both as a [RegExp style of characters](https://github.com/text-mask/text-mask/blob/master/componentDocumentation.md#readme) or a callback function. Example below. Defaults to number mask.',\n type: ['RegExp', 'function'],\n status: 'optional',\n },\n show_mask: {\n doc: 'Show mask when input is empty and has no focus. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n show_guide: {\n doc: \"When `false` is given, it doesn't print out placeholder characters and only adds mask characters when the user reaches them as they're typing. Defaults to `true`.\",\n type: 'boolean',\n status: 'optional',\n },\n placeholder_char: {\n doc: 'The placeholder character represents the fillable spot in the mask (e.g. `_`). Defaults to invisible space.',\n type: 'string',\n status: 'optional',\n },\n keep_char_positions: {\n doc: 'When `true`, adding or deleting characters will not affect the positions of existing characters. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n '[Space](/uilib/layout/space/properties)': {\n doc: 'Spacing properties like `top` or `bottom` are supported.',\n type: ['string', 'object'],\n status: 'optional',\n },\n '[Input](/uilib/components/input/properties)': {\n doc: 'All `Input` properties are supported.',\n type: 'Various',\n status: 'optional',\n },\n}\n\nexport const inputMaskedEvents: PropertiesTableProps = {\n on_change: {\n doc: 'will be called on value changes made by the user. Returns an object with the value as a string and the native event: `{ value, numberValue, cleanedValue, event }`.',\n type: 'function',\n status: 'optional',\n },\n '[Input](/uilib/components/input/events)': {\n doc: 'All `Input` events are supported.',\n type: 'Various',\n status: 'optional',\n },\n}\n\nexport const inputMaskedMaskOptionsProperties: PropertiesTableProps = {\n prefix: {\n doc: 'What to display before the amount. Defaults to an empty string.',\n type: 'string',\n status: 'optional',\n },\n suffix: {\n doc: 'What to display after the amount. Defaults to an empty string.',\n type: 'string',\n status: 'optional',\n },\n includeThousandsSeparator: {\n doc: 'Whether or not to separate thousands. Defaults to `true`.',\n type: 'boolean',\n status: 'optional',\n },\n thousandsSeparatorSymbol: {\n doc: \"Character with which to separate thousands. Defaults to `' '`.\",\n type: 'string',\n status: 'optional',\n },\n allowDecimal: {\n doc: 'Whether or not to allow the user to enter a fraction with the amount. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n decimalSymbol: {\n doc: \"Character that will act as a decimal point. Defaults to `','`.\",\n type: 'string',\n status: 'optional',\n },\n decimalLimit: {\n doc: 'How many digits to allow after the decimal. Defaults to `2`.',\n type: 'number',\n status: 'optional',\n },\n integerLimit: {\n doc: 'Limit the length of the integer number. Defaults to `null` for unlimited.',\n type: 'number',\n status: 'optional',\n },\n requireDecimal: {\n doc: 'Whether or not to always include a decimal point and placeholder for decimal digits after the integer. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n allowNegative: {\n doc: 'Whether or not to allow negative numbers. Defaults to `true`.',\n type: 'boolean',\n status: 'optional',\n },\n disallowLeadingZeroes: {\n doc: 'Whether or not to allow leading zeroes. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n}\n"],"mappings":";;;;;;AAEO,MAAMA,qBAA2C,GAAAC,OAAA,CAAAD,qBAAA,GAAG;EACzDE,SAAS,EAAE;IACTC,GAAG,EAAE,0FAA0F;IAC/FC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDC,UAAU,EAAE;IACVH,GAAG,EAAE,iHAAiH;IACtHC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDE,WAAW,EAAE;IACXJ,GAAG,EAAE,+IAA+I;IACpJC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDG,YAAY,EAAE;IACZL,GAAG,EAAE,qIAAqI;IAC1IC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDI,WAAW,EAAE;IACXN,GAAG,EAAE,sOAAsO;IAC3OC,IAAI,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;IAC3BC,MAAM,EAAE;EACV,CAAC;EACDK,aAAa,EAAE;IACbP,GAAG,EAAE,yRAAyR;IAC9RC,IAAI,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;IAC3BC,MAAM,EAAE;EACV,CAAC;EACDM,aAAa,EAAE;IACbR,GAAG,EAAE,gFAAgF;IACrFC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDO,MAAM,EAAE;IACNT,GAAG,EAAE,mMAAmM;IACxMC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDQ,IAAI,EAAE;IACJV,GAAG,EAAE,mNAAmN;IACxNC,IAAI,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC;IAC5BC,MAAM,EAAE;EACV,CAAC;EACDS,SAAS,EAAE;IACTX,GAAG,EAAE,sEAA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CAAC;EACDmB,wBAAwB,EAAE;IACxBrB,GAAG,EAAE,gEAAgE;IACrEC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDoB,YAAY,EAAE;IACZtB,GAAG,EAAE,4FAA4F;IACjGC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDqB,aAAa,EAAE;IACbvB,GAAG,EAAE,gEAAgE;IACrEC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDsB,YAAY,EAAE;IACZxB,GAAG,EAAE,8DAA8D;IACnEC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDuB,YAAY,EAAE;IACZzB,GAAG,EAAE,2EAA2E;IAChFC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDwB,cAAc,EAAE;IACd1B,GAAG,EAAE,6HAA6H;IAClIC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDyB,aAAa,EAAE;IACb3B,GAAG,EAAE,+DAA+D;IACpEC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACD0B,qBAAqB,EAAE;IACrB5B,GAAG,EAAE,8DAA8D;IACnEC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { PropertiesTableProps } from '../../shared/types';
|
|
2
2
|
export declare const multiInputMaskedEvents: PropertiesTableProps;
|
|
3
|
+
export declare const multiInputMaskedProperties: PropertiesTableProps;
|
|
4
|
+
export declare const multiInputMaskedInputsProperties: PropertiesTableProps;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.multiInputMaskedEvents = void 0;
|
|
6
|
+
exports.multiInputMaskedProperties = exports.multiInputMaskedInputsProperties = exports.multiInputMaskedEvents = void 0;
|
|
7
7
|
const multiInputMaskedEvents = exports.multiInputMaskedEvents = {
|
|
8
8
|
onChange: {
|
|
9
9
|
doc: "runs when an input value changes. Has an object parameter with keys matching the id's defined in `inputs`, and values of string. E.g: `{month: string, year: string}`.",
|
|
@@ -21,4 +21,73 @@ const multiInputMaskedEvents = exports.multiInputMaskedEvents = {
|
|
|
21
21
|
status: 'optional'
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
+
const multiInputMaskedProperties = exports.multiInputMaskedProperties = {
|
|
25
|
+
label: {
|
|
26
|
+
doc: '`legend` element describing the group of inputs inside the components.',
|
|
27
|
+
type: 'React.ReactNode',
|
|
28
|
+
status: 'optional'
|
|
29
|
+
},
|
|
30
|
+
labelDirection: {
|
|
31
|
+
doc: 'Use to change the label layout direction. Defaults to `horizontal`.',
|
|
32
|
+
type: ['horizontal', 'vertical'],
|
|
33
|
+
status: 'optional'
|
|
34
|
+
},
|
|
35
|
+
inputs: {
|
|
36
|
+
doc: "array of [MultiInputMaskInput](/uilib/components/input-masked/properties/#multiinputmask-inputs-properties) that defines the inputs in the component. The id's defined here is used to map input value to correct property in `values` parameters used in `onChange`.",
|
|
37
|
+
type: 'array',
|
|
38
|
+
status: 'optional'
|
|
39
|
+
},
|
|
40
|
+
values: {
|
|
41
|
+
doc: "values used for the inputs in the component. Expects an object with keys matching the id's defined in `inputs`.",
|
|
42
|
+
type: 'object',
|
|
43
|
+
status: 'optional'
|
|
44
|
+
},
|
|
45
|
+
delimiter: {
|
|
46
|
+
doc: 'character that separates the input inputs.',
|
|
47
|
+
type: 'string',
|
|
48
|
+
status: 'optional'
|
|
49
|
+
},
|
|
50
|
+
stretch: {
|
|
51
|
+
doc: 'use `true` in order to stretch the input to the available space. Defaults to `false`.',
|
|
52
|
+
type: 'boolean',
|
|
53
|
+
status: 'optional'
|
|
54
|
+
},
|
|
55
|
+
status: {
|
|
56
|
+
doc: 'text with a status message. The style defaults to an error message. You can use true to only get the status color, without a message.`.',
|
|
57
|
+
type: ['React.ReactNode'],
|
|
58
|
+
status: 'optional'
|
|
59
|
+
},
|
|
60
|
+
statusState: {
|
|
61
|
+
doc: "defines the state of the status. It's two statuses [error, info]. Defaults to error.",
|
|
62
|
+
type: ['error', 'info'],
|
|
63
|
+
status: 'optional'
|
|
64
|
+
},
|
|
65
|
+
suffix: {
|
|
66
|
+
doc: 'Text describing the content of the input more than the label. you can also send in a React component, so it gets wrapped inside the Input component.',
|
|
67
|
+
type: 'React.ReactNode',
|
|
68
|
+
status: 'optional'
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
const multiInputMaskedInputsProperties = exports.multiInputMaskedInputsProperties = {
|
|
72
|
+
id: {
|
|
73
|
+
doc: '(string) Defines input id. This id is also used to map the input value to the correct property on the objects used for `values` and `onChange` parameters.',
|
|
74
|
+
type: 'string',
|
|
75
|
+
status: 'optional'
|
|
76
|
+
},
|
|
77
|
+
label: {
|
|
78
|
+
doc: 'Label used by the input. The label itself is hidden, but required to uphold accessibility standards for screen readers.',
|
|
79
|
+
type: 'string',
|
|
80
|
+
status: 'optional'
|
|
81
|
+
},
|
|
82
|
+
mask: {
|
|
83
|
+
doc: 'Each RegExp item in the array defines what the mask should be for each subsequent character in the input. The array length sets the inputs size/character limit.',
|
|
84
|
+
type: 'array',
|
|
85
|
+
status: 'optional'
|
|
86
|
+
},
|
|
87
|
+
placeholderCharacter: {
|
|
88
|
+
doc: 'Sets the placeholder character used for the input.',
|
|
89
|
+
type: 'string',
|
|
90
|
+
status: 'optional'
|
|
91
|
+
}
|
|
92
|
+
};
|
|
24
93
|
//# sourceMappingURL=MultiInputMaskedDocs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiInputMaskedDocs.js","names":["multiInputMaskedEvents","exports","onChange","doc","type","status","onFocus","onBlur"],"sources":["../../../../src/components/input-masked/MultiInputMaskedDocs.ts"],"sourcesContent":["import { PropertiesTableProps } from '../../shared/types'\n\nexport const multiInputMaskedEvents: PropertiesTableProps = {\n onChange: {\n doc: \"runs when an input value changes. Has an object parameter with keys matching the id's defined in `inputs`, and values of string. E.g: `{month: string, year: string}`.\",\n type: 'function',\n status: 'optional',\n },\n onFocus: {\n doc: \"runs when an input gains focus. Has an object parameter with keys matching the id's defined in `inputs`, and values of string. E.g: `{month: string, year: string}`.\",\n type: 'function',\n status: 'optional',\n },\n onBlur: {\n doc: \"runs when an input lose focus. Has an object parameter with keys matching the id's defined in `inputs`, and values of string. E.g: `{month: string, year: string}`.\",\n type: 'function',\n status: 'optional',\n },\n}\n"],"mappings":";;;;;;AAEO,MAAMA,sBAA4C,GAAAC,OAAA,CAAAD,sBAAA,GAAG;EAC1DE,QAAQ,EAAE;IACRC,GAAG,EAAE,wKAAwK;IAC7KC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACDC,OAAO,EAAE;IACPH,GAAG,EAAE,sKAAsK;IAC3KC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACDE,MAAM,EAAE;IACNJ,GAAG,EAAE,qKAAqK;IAC1KC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV;AACF,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"MultiInputMaskedDocs.js","names":["multiInputMaskedEvents","exports","onChange","doc","type","status","onFocus","onBlur","multiInputMaskedProperties","label","labelDirection","inputs","values","delimiter","stretch","statusState","suffix","multiInputMaskedInputsProperties","id","mask","placeholderCharacter"],"sources":["../../../../src/components/input-masked/MultiInputMaskedDocs.ts"],"sourcesContent":["import { PropertiesTableProps } from '../../shared/types'\n\nexport const multiInputMaskedEvents: PropertiesTableProps = {\n onChange: {\n doc: \"runs when an input value changes. Has an object parameter with keys matching the id's defined in `inputs`, and values of string. E.g: `{month: string, year: string}`.\",\n type: 'function',\n status: 'optional',\n },\n onFocus: {\n doc: \"runs when an input gains focus. Has an object parameter with keys matching the id's defined in `inputs`, and values of string. E.g: `{month: string, year: string}`.\",\n type: 'function',\n status: 'optional',\n },\n onBlur: {\n doc: \"runs when an input lose focus. Has an object parameter with keys matching the id's defined in `inputs`, and values of string. E.g: `{month: string, year: string}`.\",\n type: 'function',\n status: 'optional',\n },\n}\n\nexport const multiInputMaskedProperties: PropertiesTableProps = {\n label: {\n doc: '`legend` element describing the group of inputs inside the components.',\n type: 'React.ReactNode',\n status: 'optional',\n },\n labelDirection: {\n doc: 'Use to change the label layout direction. Defaults to `horizontal`.',\n type: ['horizontal', 'vertical'],\n status: 'optional',\n },\n inputs: {\n doc: \"array of [MultiInputMaskInput](/uilib/components/input-masked/properties/#multiinputmask-inputs-properties) that defines the inputs in the component. The id's defined here is used to map input value to correct property in `values` parameters used in `onChange`.\",\n type: 'array',\n status: 'optional',\n },\n values: {\n doc: \"values used for the inputs in the component. Expects an object with keys matching the id's defined in `inputs`.\",\n type: 'object',\n status: 'optional',\n },\n delimiter: {\n doc: 'character that separates the input inputs.',\n type: 'string',\n status: 'optional',\n },\n stretch: {\n doc: 'use `true` in order to stretch the input to the available space. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n status: {\n doc: 'text with a status message. The style defaults to an error message. You can use true to only get the status color, without a message.`.',\n type: ['React.ReactNode'],\n status: 'optional',\n },\n statusState: {\n doc: \"defines the state of the status. It's two statuses [error, info]. Defaults to error.\",\n type: ['error', 'info'],\n status: 'optional',\n },\n suffix: {\n doc: 'Text describing the content of the input more than the label. you can also send in a React component, so it gets wrapped inside the Input component.',\n type: 'React.ReactNode',\n status: 'optional',\n },\n}\n\nexport const multiInputMaskedInputsProperties: PropertiesTableProps = {\n id: {\n doc: '(string) Defines input id. This id is also used to map the input value to the correct property on the objects used for `values` and `onChange` parameters.',\n type: 'string',\n status: 'optional',\n },\n label: {\n doc: 'Label used by the input. The label itself is hidden, but required to uphold accessibility standards for screen readers.',\n type: 'string',\n status: 'optional',\n },\n mask: {\n doc: 'Each RegExp item in the array defines what the mask should be for each subsequent character in the input. The array length sets the inputs size/character limit.',\n type: 'array',\n status: 'optional',\n },\n placeholderCharacter: {\n doc: 'Sets the placeholder character used for the input.',\n type: 'string',\n status: 'optional',\n },\n}\n"],"mappings":";;;;;;AAEO,MAAMA,sBAA4C,GAAAC,OAAA,CAAAD,sBAAA,GAAG;EAC1DE,QAAQ,EAAE;IACRC,GAAG,EAAE,wKAAwK;IAC7KC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACDC,OAAO,EAAE;IACPH,GAAG,EAAE,sKAAsK;IAC3KC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACDE,MAAM,EAAE;IACNJ,GAAG,EAAE,qKAAqK;IAC1KC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV;AACF,CAAC;AAEM,MAAMG,0BAAgD,GAAAP,OAAA,CAAAO,0BAAA,GAAG;EAC9DC,KAAK,EAAE;IACLN,GAAG,EAAE,wEAAwE;IAC7EC,IAAI,EAAE,iBAAiB;IACvBC,MAAM,EAAE;EACV,CAAC;EACDK,cAAc,EAAE;IACdP,GAAG,EAAE,qEAAqE;IAC1EC,IAAI,EAAE,CAAC,YAAY,EAAE,UAAU,CAAC;IAChCC,MAAM,EAAE;EACV,CAAC;EACDM,MAAM,EAAE;IACNR,GAAG,EAAE,uQAAuQ;IAC5QC,IAAI,EAAE,OAAO;IACbC,MAAM,EAAE;EACV,CAAC;EACDO,MAAM,EAAE;IACNT,GAAG,EAAE,iHAAiH;IACtHC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDQ,SAAS,EAAE;IACTV,GAAG,EAAE,4CAA4C;IACjDC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDS,OAAO,EAAE;IACPX,GAAG,EAAE,uFAAuF;IAC5FC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDA,MAAM,EAAE;IACNF,GAAG,EAAE,yIAAyI;IAC9IC,IAAI,EAAE,CAAC,iBAAiB,CAAC;IACzBC,MAAM,EAAE;EACV,CAAC;EACDU,WAAW,EAAE;IACXZ,GAAG,EAAE,sFAAsF;IAC3FC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;IACvBC,MAAM,EAAE;EACV,CAAC;EACDW,MAAM,EAAE;IACNb,GAAG,EAAE,sJAAsJ;IAC3JC,IAAI,EAAE,iBAAiB;IACvBC,MAAM,EAAE;EACV;AACF,CAAC;AAEM,MAAMY,gCAAsD,GAAAhB,OAAA,CAAAgB,gCAAA,GAAG;EACpEC,EAAE,EAAE;IACFf,GAAG,EAAE,4JAA4J;IACjKC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDI,KAAK,EAAE;IACLN,GAAG,EAAE,yHAAyH;IAC9HC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDc,IAAI,EAAE;IACJhB,GAAG,EAAE,kKAAkK;IACvKC,IAAI,EAAE,OAAO;IACbC,MAAM,EAAE;EACV,CAAC;EACDe,oBAAoB,EAAE;IACpBjB,GAAG,EAAE,oDAAoD;IACzDC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV;AACF,CAAC","ignoreList":[]}
|
|
@@ -11,6 +11,15 @@
|
|
|
11
11
|
.dnb-input-masked input::placeholder {
|
|
12
12
|
color: inherit;
|
|
13
13
|
}
|
|
14
|
+
.dnb-input-masked--hide-controls[type=number]::-webkit-outer-spin-button, .dnb-input-masked--hide-controls[type=number]::-webkit-inner-spin-button {
|
|
15
|
+
-webkit-appearance: none;
|
|
16
|
+
appearance: none;
|
|
17
|
+
margin: 0;
|
|
18
|
+
}
|
|
19
|
+
.dnb-input-masked--hide-controls[type=number] {
|
|
20
|
+
-webkit-appearance: textfield;
|
|
21
|
+
appearance: textfield;
|
|
22
|
+
}
|
|
14
23
|
|
|
15
24
|
.dnb-multi-input-mask__fieldset {
|
|
16
25
|
padding: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.dnb-input-masked--guide{font-family:var(--font-family-monospace)}.dnb-input-masked input::placeholder{color:inherit}.dnb-multi-input-mask__fieldset{border:none;padding:0}.dnb-multi-input-mask__fieldset:not([class*=space__top]){margin-top:0}.dnb-multi-input-mask__fieldset:not([class*=space__bottom]){margin-bottom:0}.dnb-multi-input-mask__fieldset:not([class*=space__left]){margin-left:0}.dnb-multi-input-mask__fieldset:not([class*=space__right]){margin-right:0}.dnb-multi-input-mask__fieldset--horizontal{align-items:baseline;display:inline-flex;flex-flow:row wrap;gap:1rem}.dnb-multi-input-mask__input.dnb-input__input{background:transparent;border:none;display:inline-block;font-family:var(--font-family-monospace);margin:0;outline:none;overflow:visible;padding:0 .125rem;text-align:center;transform:translateY(0);white-space:nowrap;width:auto}.dnb-multi-input-mask__input.dnb-input__input:first-of-type{padding-left:.5rem}.dnb-multi-input-mask__input.dnb-input__input:last-of-type{padding-right:.5rem}.dnb-input--large .dnb-multi-input-mask__input.dnb-input__input,.dnb-input--medium .dnb-multi-input-mask__input.dnb-input__input{padding:0 .25rem}.dnb-multi-input-mask{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.dnb-multi-input-mask:not(.dnb-input__status--error) .dnb-multi-input-mask__delimiter,.dnb-multi-input-mask:not(.dnb-input__status--error) .dnb-multi-input-mask__input{color:var(--color-black-55)}.dnb-multi-input-mask:not(.dnb-input__status--error) .dnb-multi-input-mask__delimiter--highlight,.dnb-multi-input-mask:not(.dnb-input__status--error) .dnb-multi-input-mask__input--highlight{color:var(--color-black)}
|
|
1
|
+
.dnb-input-masked--guide{font-family:var(--font-family-monospace)}.dnb-input-masked input::placeholder{color:inherit}.dnb-input-masked--hide-controls[type=number]::-webkit-inner-spin-button,.dnb-input-masked--hide-controls[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}.dnb-input-masked--hide-controls[type=number]{-webkit-appearance:textfield;appearance:textfield}.dnb-multi-input-mask__fieldset{border:none;padding:0}.dnb-multi-input-mask__fieldset:not([class*=space__top]){margin-top:0}.dnb-multi-input-mask__fieldset:not([class*=space__bottom]){margin-bottom:0}.dnb-multi-input-mask__fieldset:not([class*=space__left]){margin-left:0}.dnb-multi-input-mask__fieldset:not([class*=space__right]){margin-right:0}.dnb-multi-input-mask__fieldset--horizontal{align-items:baseline;display:inline-flex;flex-flow:row wrap;gap:1rem}.dnb-multi-input-mask__input.dnb-input__input{background:transparent;border:none;display:inline-block;font-family:var(--font-family-monospace);margin:0;outline:none;overflow:visible;padding:0 .125rem;text-align:center;transform:translateY(0);white-space:nowrap;width:auto}.dnb-multi-input-mask__input.dnb-input__input:first-of-type{padding-left:.5rem}.dnb-multi-input-mask__input.dnb-input__input:last-of-type{padding-right:.5rem}.dnb-input--large .dnb-multi-input-mask__input.dnb-input__input,.dnb-input--medium .dnb-multi-input-mask__input.dnb-input__input{padding:0 .25rem}.dnb-multi-input-mask{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.dnb-multi-input-mask:not(.dnb-input__status--error) .dnb-multi-input-mask__delimiter,.dnb-multi-input-mask:not(.dnb-input__status--error) .dnb-multi-input-mask__input{color:var(--color-black-55)}.dnb-multi-input-mask:not(.dnb-input__status--error) .dnb-multi-input-mask__delimiter--highlight,.dnb-multi-input-mask:not(.dnb-input__status--error) .dnb-multi-input-mask__input--highlight{color:var(--color-black)}
|
|
@@ -14,6 +14,18 @@
|
|
|
14
14
|
input::placeholder {
|
|
15
15
|
color: inherit;
|
|
16
16
|
}
|
|
17
|
+
|
|
18
|
+
&--hide-controls {
|
|
19
|
+
&[type='number']::-webkit-outer-spin-button,
|
|
20
|
+
&[type='number']::-webkit-inner-spin-button {
|
|
21
|
+
appearance: none;
|
|
22
|
+
margin: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&[type='number'] {
|
|
26
|
+
appearance: textfield;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
17
29
|
}
|
|
18
30
|
|
|
19
31
|
// MultiInputMask
|
|
@@ -10,6 +10,13 @@ export default class InputModeNumber {
|
|
|
10
10
|
hasFocus: boolean;
|
|
11
11
|
focusEventName: string;
|
|
12
12
|
blurEventName: string;
|
|
13
|
+
_type: string;
|
|
14
|
+
_value: string;
|
|
15
|
+
_width: number;
|
|
16
|
+
_cssText: string;
|
|
17
|
+
_placeholder: string;
|
|
18
|
+
_selectionStart: number;
|
|
19
|
+
_selectionEnd: number;
|
|
13
20
|
setElement(element: HTMLInputElement): void;
|
|
14
21
|
handleLabel(): void;
|
|
15
22
|
add(): void;
|
|
@@ -17,4 +24,5 @@ export default class InputModeNumber {
|
|
|
17
24
|
remove(): void;
|
|
18
25
|
onBlur: () => void;
|
|
19
26
|
onFocus: () => void;
|
|
27
|
+
reset: () => void;
|
|
20
28
|
}
|
|
@@ -18,22 +18,44 @@ class InputModeNumber {
|
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
20
|
this.hasFocus = true;
|
|
21
|
-
|
|
22
|
-
if (
|
|
21
|
+
this._type = this.inputElement.type;
|
|
22
|
+
if (this._type === 'number') {
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
this.
|
|
25
|
+
this._value = this.inputElement.value;
|
|
26
|
+
this._width = this.inputElement.offsetWidth;
|
|
27
|
+
this._cssText = this.inputElement.style.cssText;
|
|
28
|
+
this._placeholder = this.inputElement.placeholder;
|
|
29
|
+
this._selectionStart = this.inputElement.selectionStart;
|
|
30
|
+
this._selectionEnd = this.inputElement.selectionEnd;
|
|
31
|
+
this.inputElement.placeholder = this._value;
|
|
28
32
|
this.inputElement.type = 'number';
|
|
33
|
+
this.inputElement.classList.add('dnb-input-masked--hide-controls');
|
|
34
|
+
this.inputElement.style.width = `${this._width}px`;
|
|
29
35
|
clearTimeout(this.timeout);
|
|
30
36
|
this.timeout = setTimeout(() => {
|
|
37
|
+
this.reset();
|
|
38
|
+
}, 10);
|
|
39
|
+
});
|
|
40
|
+
_defineProperty(this, "reset", () => {
|
|
41
|
+
if (!this.inputElement) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
try {
|
|
31
45
|
var _this$inputElement$ru, _this$inputElement;
|
|
32
|
-
this.inputElement.type =
|
|
33
|
-
this.inputElement.
|
|
34
|
-
this.inputElement.
|
|
46
|
+
this.inputElement.type = this._type;
|
|
47
|
+
this.inputElement.style.cssText = this._cssText;
|
|
48
|
+
this.inputElement.classList.remove('dnb-input-masked--hide-controls');
|
|
49
|
+
this.inputElement.value = this._value;
|
|
50
|
+
this.inputElement.placeholder = this._placeholder;
|
|
51
|
+
if (this._selectionStart > 0) {
|
|
52
|
+
this.inputElement.selectionStart = this._selectionStart;
|
|
53
|
+
this.inputElement.selectionEnd = this._selectionEnd;
|
|
54
|
+
}
|
|
35
55
|
(_this$inputElement$ru = (_this$inputElement = this.inputElement)['runCorrectCaretPosition']) === null || _this$inputElement$ru === void 0 ? void 0 : _this$inputElement$ru.call(_this$inputElement);
|
|
36
|
-
}
|
|
56
|
+
} catch (error) {
|
|
57
|
+
console.error(error);
|
|
58
|
+
}
|
|
37
59
|
});
|
|
38
60
|
}
|
|
39
61
|
setElement(element) {
|
|
@@ -76,6 +98,7 @@ class InputModeNumber {
|
|
|
76
98
|
}
|
|
77
99
|
}
|
|
78
100
|
remove() {
|
|
101
|
+
this.reset();
|
|
79
102
|
clearTimeout(this.timeout);
|
|
80
103
|
this.removeEvent(this.inputElement);
|
|
81
104
|
this.removeEvent(this.labelElement);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputModeNumber.js","names":["_helpers","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","InputModeNumber","constructor","hasFocus","inputElement","type","placeholder","clearTimeout","timeout","setTimeout","_this$inputElement$ru","_this$inputElement","setElement","element","IS_IOS","focusEventName","blurEventName","
|
|
1
|
+
{"version":3,"file":"InputModeNumber.js","names":["_helpers","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","InputModeNumber","constructor","hasFocus","inputElement","_type","type","_value","_width","offsetWidth","_cssText","style","cssText","_placeholder","placeholder","_selectionStart","selectionStart","_selectionEnd","selectionEnd","classList","add","width","clearTimeout","timeout","setTimeout","reset","_this$inputElement$ru","_this$inputElement","remove","error","console","setElement","element","IS_IOS","focusEventName","blurEventName","handleLabel","_this$inputElement2","id","labelElement","document","querySelector","addEventListener","onFocus","_this$inputElement3","fnId","onBlur","removeEvent","removeEventListener","exports","default"],"sources":["../../../../../src/components/input-masked/text-mask/InputModeNumber.ts"],"sourcesContent":["import { IS_IOS } from '../../../shared/helpers'\n\n/**\n * This is a helper function (hack),\n * that will evoke a good numeric keyboard (on iOS) that supports decimals and minus keys.\n */\nexport default class InputModeNumber {\n inputElement: HTMLInputElement\n labelElement: HTMLLabelElement\n timeout: NodeJS.Timer\n hasFocus: boolean\n focusEventName: string\n blurEventName: string\n _type: string\n _value: string\n _width: number\n _cssText: string\n _placeholder: string\n _selectionStart: number\n _selectionEnd: number\n\n setElement(element: HTMLInputElement) {\n if (!IS_IOS) {\n return // stop here\n }\n\n /**\n * Why use \"mouseenter\" and not \"focus\", \"mousedown\" or \"touchstart\"?\n * - Because \"touchstart\" has unexpected behavior when holding the finger down before releasing.\n * - And because \"focus\" and \"mousedown\" is too late, we then can't change the type anymore.\n */\n this.focusEventName = 'mouseenter'\n this.blurEventName = 'blur'\n\n if (!this.inputElement) {\n this.inputElement = element\n this.add()\n this.handleLabel()\n }\n }\n handleLabel() {\n const id = this.inputElement?.id\n if (!id) {\n return\n }\n\n this.labelElement = document.querySelector(\n `[for=\"${id}\"]`\n ) as HTMLLabelElement\n\n if (this.labelElement) {\n this.labelElement.addEventListener('mousedown', this.onFocus)\n }\n }\n add() {\n const fnId = '__getCorrectCaretPosition'\n if (this.inputElement && !this.inputElement?.[fnId]) {\n this.inputElement[fnId] = true\n\n this.inputElement.addEventListener(this.focusEventName, this.onFocus)\n this.inputElement.addEventListener(this.blurEventName, this.onBlur)\n }\n }\n removeEvent(element: HTMLInputElement | HTMLLabelElement) {\n if (element) {\n element.removeEventListener(this.focusEventName, this.onFocus)\n element.removeEventListener(this.blurEventName, this.onBlur)\n element.removeEventListener('mousedown', this.onFocus)\n }\n }\n remove() {\n this.reset()\n\n clearTimeout(this.timeout)\n\n this.removeEvent(this.inputElement)\n this.removeEvent(this.labelElement)\n\n delete this.inputElement\n delete this.labelElement\n }\n onBlur = () => {\n this.hasFocus = false\n }\n onFocus = () => {\n if (this.hasFocus || !this.inputElement) {\n return // stop here\n }\n\n this.hasFocus = true\n\n this._type = this.inputElement.type\n\n if (this._type === 'number') {\n return // stop here\n }\n\n this._value = this.inputElement.value\n this._width = this.inputElement.offsetWidth\n this._cssText = this.inputElement.style.cssText\n this._placeholder = this.inputElement.placeholder\n this._selectionStart = this.inputElement.selectionStart\n this._selectionEnd = this.inputElement.selectionEnd\n\n // To prevent flickering, show the placeholder, while the input value is \"empty\".\n this.inputElement.placeholder = this._value\n\n // Changing the type, will remove the current input value to show as \"empty\".\n this.inputElement.type = 'number'\n\n // Hide steppers with pseudo-elements using CSS injection\n this.inputElement.classList.add('dnb-input-masked--hide-controls')\n\n // Keep the width the same as the input element\n this.inputElement.style.width = `${this._width}px`\n\n // Reset the input again\n clearTimeout(this.timeout)\n this.timeout = setTimeout(() => {\n this.reset()\n }, 10) // Delay before changing the type back again.\n }\n reset = () => {\n if (!this.inputElement) {\n return // stop here\n }\n try {\n this.inputElement.type = this._type\n this.inputElement.style.cssText = this._cssText // Because we did set a width, we need to reset the cssText\n this.inputElement.classList.remove('dnb-input-masked--hide-controls')\n this.inputElement.value = this._value // set the input value, else it will be empty\n this.inputElement.placeholder = this._placeholder\n if (this._selectionStart > 0) {\n this.inputElement.selectionStart = this._selectionStart\n this.inputElement.selectionEnd = this._selectionEnd\n }\n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I,IAAI,CAACzC,YAAY,IAAI,GAAAwC,mBAAA,GAAC,IAAI,CAACxC,YAAY,cAAAwC,mBAAA,eAAjBA,mBAAA,CAAoBC,IAAI,CAAC,GAAE;MACnD,IAAI,CAACzC,YAAY,CAACyC,IAAI,CAAC,GAAG,IAAI;MAE9B,IAAI,CAACzC,YAAY,CAACsC,gBAAgB,CAAC,IAAI,CAACR,cAAc,EAAE,IAAI,CAACS,OAAO,CAAC;MACrE,IAAI,CAACvC,YAAY,CAACsC,gBAAgB,CAAC,IAAI,CAACP,aAAa,EAAE,IAAI,CAACW,MAAM,CAAC;IACrE;EACF;EACAC,WAAWA,CAACf,OAA4C,EAAE;IACxD,IAAIA,OAAO,EAAE;MACXA,OAAO,CAACgB,mBAAmB,CAAC,IAAI,CAACd,cAAc,EAAE,IAAI,CAACS,OAAO,CAAC;MAC9DX,OAAO,CAACgB,mBAAmB,CAAC,IAAI,CAACb,aAAa,EAAE,IAAI,CAACW,MAAM,CAAC;MAC5Dd,OAAO,CAACgB,mBAAmB,CAAC,WAAW,EAAE,IAAI,CAACL,OAAO,CAAC;IACxD;EACF;EACAf,MAAMA,CAAA,EAAG;IACP,IAAI,CAACH,KAAK,CAAC,CAAC;IAEZH,YAAY,CAAC,IAAI,CAACC,OAAO,CAAC;IAE1B,IAAI,CAACwB,WAAW,CAAC,IAAI,CAAC3C,YAAY,CAAC;IACnC,IAAI,CAAC2C,WAAW,CAAC,IAAI,CAACR,YAAY,CAAC;IAEnC,OAAO,IAAI,CAACnC,YAAY;IACxB,OAAO,IAAI,CAACmC,YAAY;EAC1B;AA6DF;AAACU,OAAA,CAAAC,OAAA,GAAAjD,eAAA","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export default function adjustCaretPosition({ previousConformedValue, previousPlaceholder, currentCaretPosition, conformedValue, rawValue, placeholderChar, placeholder, indexesOfPipedChars, caretTrapIndexes, }: {
|
|
1
|
+
export default function adjustCaretPosition({ previousConformedValue, previousPlaceholder, currentCaretPosition, conformedValue, rawValue, placeholderChar, placeholder, indexesOfPipedChars, caretTrapIndexes, keepCharPositions, }: {
|
|
2
2
|
previousConformedValue?: string;
|
|
3
3
|
previousPlaceholder?: string;
|
|
4
4
|
currentCaretPosition?: number;
|
|
@@ -8,4 +8,5 @@ export default function adjustCaretPosition({ previousConformedValue, previousPl
|
|
|
8
8
|
placeholder: any;
|
|
9
9
|
indexesOfPipedChars?: any[];
|
|
10
10
|
caretTrapIndexes?: any[];
|
|
11
|
+
keepCharPositions?: boolean;
|
|
11
12
|
}): number;
|
|
@@ -16,7 +16,8 @@ function adjustCaretPosition(_ref) {
|
|
|
16
16
|
placeholderChar,
|
|
17
17
|
placeholder,
|
|
18
18
|
indexesOfPipedChars = defaultArray,
|
|
19
|
-
caretTrapIndexes = defaultArray
|
|
19
|
+
caretTrapIndexes = defaultArray,
|
|
20
|
+
keepCharPositions = false
|
|
20
21
|
} = _ref;
|
|
21
22
|
if (currentCaretPosition === 0 || !rawValue.length) {
|
|
22
23
|
return 0;
|
|
@@ -32,7 +33,7 @@ function adjustCaretPosition(_ref) {
|
|
|
32
33
|
if (isPartialMultiCharEdit) {
|
|
33
34
|
return currentCaretPosition;
|
|
34
35
|
}
|
|
35
|
-
const possiblyHasRejectedChar = isAddition && (previousConformedValue === conformedValue || conformedValue === placeholder);
|
|
36
|
+
const possiblyHasRejectedChar = isAddition && (keepCharPositions !== false && previousConformedValue === conformedValue || conformedValue === placeholder);
|
|
36
37
|
let startingSearchIndex = 0;
|
|
37
38
|
let trackRightCharacter;
|
|
38
39
|
let targetChar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adjustCaretPosition.js","names":["defaultArray","emptyString","adjustCaretPosition","_ref","previousConformedValue","previousPlaceholder","currentCaretPosition","conformedValue","rawValue","placeholderChar","placeholder","indexesOfPipedChars","caretTrapIndexes","length","rawValueLength","previousConformedValueLength","placeholderLength","conformedValueLength","editLength","isAddition","isFirstRawValue","isPartialMultiCharEdit","possiblyHasRejectedChar","startingSearchIndex","trackRightCharacter","targetChar","normalizedConformedValue","toLowerCase","normalizedRawValue","leftHalfChars","substr","split","intersection","filter","char","indexOf","previousLeftMaskChars","leftMaskChars","masklengthChanged","targetIsMaskMovingLeft","undefined","pipedChars","map","index","countTargetCharInPipedChars","countTargetCharInIntersection","countTargetCharInPlaceholder","requiredNumberOfMatches","numberOfEncounteredMatches","i","conformedValueChar","lastPlaceholderChar"],"sources":["../../../../../src/components/input-masked/text-mask/adjustCaretPosition.js"],"sourcesContent":["const defaultArray = []\nconst emptyString = ''\n\nexport default function adjustCaretPosition({\n previousConformedValue = emptyString,\n previousPlaceholder = emptyString,\n currentCaretPosition = 0,\n conformedValue,\n rawValue,\n placeholderChar,\n placeholder,\n indexesOfPipedChars = defaultArray,\n caretTrapIndexes = defaultArray,\n}) {\n if (currentCaretPosition === 0 || !rawValue.length) {\n return 0\n }\n\n // Store lengths for faster performance?\n const rawValueLength = rawValue.length\n const previousConformedValueLength = previousConformedValue.length\n const placeholderLength = placeholder.length\n const conformedValueLength = conformedValue.length\n\n // This tells us how long the edit is. If user modified input from `(2__)` to `(243__)`,\n // we know the user in this instance pasted two characters\n const editLength = rawValueLength - previousConformedValueLength\n\n // If the edit length is positive, that means the user is adding characters, not deleting.\n const isAddition = editLength > 0\n\n // This is the first raw value the user entered that needs to be conformed to mask\n const isFirstRawValue = previousConformedValueLength === 0\n\n // A partial multi-character edit happens when the user makes a partial selection in their\n // input and edits that selection. That is going from `(123) 432-4348` to `() 432-4348` by\n // selecting the first 3 digits and pressing backspace.\n //\n // Such cases can also happen when the user presses the backspace while holding down the ALT\n // key.\n const isPartialMultiCharEdit =\n editLength > 1 && !isAddition && !isFirstRawValue\n\n // This algorithm doesn't support all cases of multi-character edits, so we just return\n // the current caret position.\n //\n // This works fine for most cases.\n if (isPartialMultiCharEdit) {\n return currentCaretPosition\n }\n\n // For a mask like (111), if the `previousConformedValue` is (1__) and user attempts to enter\n // `f` so the `rawValue` becomes (1f__), the new `conformedValue` would be (1__), which is the\n // same as the original `previousConformedValue`. We handle this case differently for caret\n // positioning.\n const possiblyHasRejectedChar =\n isAddition &&\n (previousConformedValue === conformedValue ||\n conformedValue === placeholder)\n\n let startingSearchIndex = 0\n let trackRightCharacter\n let targetChar\n\n if (possiblyHasRejectedChar) {\n startingSearchIndex = currentCaretPosition - editLength\n } else {\n // At this point in the algorithm, we want to know where the caret is right before the raw input\n // has been conformed, and then see if we can find that same spot in the conformed input.\n //\n // We do that by seeing what character lies immediately before the caret, and then look for that\n // same character in the conformed input and place the caret there.\n\n // First, we need to normalize the inputs so that letter capitalization between raw input and\n // conformed input wouldn't matter.\n const normalizedConformedValue = conformedValue.toLowerCase()\n const normalizedRawValue = rawValue.toLowerCase()\n\n // Then we take all characters that come before where the caret currently is.\n const leftHalfChars = normalizedRawValue\n .substr(0, currentCaretPosition)\n .split(emptyString)\n\n // Now we find all the characters in the left half that exist in the conformed input\n // This step ensures that we don't look for a character that was filtered out or rejected by `conformToMask`.\n const intersection = leftHalfChars.filter(\n (char) => normalizedConformedValue.indexOf(char) !== -1\n )\n\n // The last character in the intersection is the character we want to look for in the conformed\n // value and the one we want to adjust the caret close to\n targetChar = intersection[intersection.length - 1]\n\n // Calculate the number of mask characters in the previous placeholder\n // from the start of the string up to the place where the caret is\n const previousLeftMaskChars = previousPlaceholder\n .substr(0, intersection.length)\n .split(emptyString)\n .filter((char) => char !== placeholderChar).length\n\n // Calculate the number of mask characters in the current placeholder\n // from the start of the string up to the place where the caret is\n const leftMaskChars = placeholder\n .substr(0, intersection.length)\n .split(emptyString)\n .filter((char) => char !== placeholderChar).length\n\n // Has the number of mask characters up to the caret changed?\n const masklengthChanged = leftMaskChars !== previousLeftMaskChars\n\n // Detect if `targetChar` is a mask character and has moved to the left\n const targetIsMaskMovingLeft =\n previousPlaceholder[intersection.length - 1] !== undefined &&\n placeholder[intersection.length - 2] !== undefined &&\n previousPlaceholder[intersection.length - 1] !== placeholderChar &&\n previousPlaceholder[intersection.length - 1] !==\n placeholder[intersection.length - 1] &&\n previousPlaceholder[intersection.length - 1] ===\n placeholder[intersection.length - 2]\n\n // If deleting and the `targetChar` `is a mask character and `masklengthChanged` is true\n // or the mask is moving to the left, we can't use the selected `targetChar` any longer\n // if we are not at the end of the string.\n // In this case, change tracking strategy and track the character to the right of the caret.\n if (\n !isAddition &&\n (masklengthChanged || targetIsMaskMovingLeft) &&\n previousLeftMaskChars > 0 &&\n placeholder.indexOf(targetChar) > -1 &&\n rawValue[currentCaretPosition] !== undefined\n ) {\n trackRightCharacter = true\n targetChar = rawValue[currentCaretPosition]\n }\n\n // It is possible that `targetChar` will appear multiple times in the conformed value.\n // We need to know not to select a character that looks like our target character from the placeholder or\n // the piped characters, so we inspect the piped characters and the placeholder to see if they contain\n // characters that match our target character.\n\n // If the `conformedValue` got piped, we need to know which characters were piped in so that when we look for\n // our `targetChar`, we don't select a piped char by mistake\n const pipedChars = indexesOfPipedChars.map(\n (index) => normalizedConformedValue[index]\n )\n\n // We need to know how many times the `targetChar` occurs in the piped characters.\n const countTargetCharInPipedChars = pipedChars.filter(\n (char) => char === targetChar\n ).length\n\n // We need to know how many times it occurs in the intersection\n const countTargetCharInIntersection = intersection.filter(\n (char) => char === targetChar\n ).length\n\n // We need to know if the placeholder contains characters that look like\n // our `targetChar`, so we don't select one of those by mistake.\n const countTargetCharInPlaceholder = placeholder\n .substr(0, placeholder.indexOf(placeholderChar))\n .split(emptyString)\n .filter(\n (char, index) =>\n // Check if `char` is the same as our `targetChar`, so we account for it\n char === targetChar &&\n // but also make sure that both the `rawValue` and placeholder don't have the same character at the same\n // index because if they are equal, that means we are already counting those characters in\n // `countTargetCharInIntersection`\n rawValue[index] !== char\n ).length\n\n // The number of times we need to see occurrences of the `targetChar` before we know it is the one we're looking\n // for is:\n const requiredNumberOfMatches =\n countTargetCharInPlaceholder +\n countTargetCharInIntersection +\n countTargetCharInPipedChars +\n // The character to the right of the caret isn't included in `intersection`\n // so add one if we are tracking the character to the right\n (trackRightCharacter ? 1 : 0)\n\n // Now we start looking for the location of the `targetChar`.\n // We keep looping forward and store the index in every iteration. Once we have encountered\n // enough occurrences of the target character, we break out of the loop\n // If are searching for the second `1` in `1214`, `startingSearchIndex` will point at `4`.\n let numberOfEncounteredMatches = 0\n for (let i = 0; i < conformedValueLength; i++) {\n const conformedValueChar = normalizedConformedValue[i]\n\n startingSearchIndex = i + 1\n\n if (conformedValueChar === targetChar) {\n numberOfEncounteredMatches++\n }\n\n if (numberOfEncounteredMatches >= requiredNumberOfMatches) {\n break\n }\n }\n }\n\n // At this point, if we simply return `startingSearchIndex` as the adjusted caret position,\n // most cases would be handled. However, we want to fast forward or rewind the caret to the\n // closest placeholder character if it happens to be in a non-editable spot. That's what the next\n // logic is for.\n\n // In case of addition, we fast forward.\n if (isAddition) {\n // We want to remember the last placeholder character encountered so that if the mask\n // contains more characters after the last placeholder character, we don't forward the caret\n // that far to the right. Instead, we stop it at the last encountered placeholder character.\n let lastPlaceholderChar = startingSearchIndex\n\n for (let i = startingSearchIndex; i <= placeholderLength; i++) {\n if (placeholder[i] === placeholderChar) {\n lastPlaceholderChar = i\n }\n\n if (\n // If we're adding, we can position the caret at the next placeholder character.\n placeholder[i] === placeholderChar ||\n // If a caret trap was set by a mask function, we need to stop at the trap.\n caretTrapIndexes.indexOf(i) !== -1 ||\n // This is the end of the placeholder. We cannot move any further. Let's put the caret there.\n i === placeholderLength\n ) {\n return lastPlaceholderChar\n }\n }\n } else {\n // In case of deletion, we rewind.\n if (trackRightCharacter) {\n // Searching for the character that was to the right of the caret\n // We start at `startingSearchIndex` - 1 because it includes one character extra to the right\n for (let i = startingSearchIndex - 1; i >= 0; i--) {\n // If tracking the character to the right of the cursor, we move to the left until\n // we found the character and then place the caret right before it\n\n if (\n // `targetChar` should be in `conformedValue`, since it was in `rawValue`, just\n // to the right of the caret\n conformedValue[i] === targetChar ||\n // If a caret trap was set by a mask function, we need to stop at the trap.\n caretTrapIndexes.indexOf(i) !== -1 ||\n // This is the beginning of the placeholder. We cannot move any further.\n // Let's put the caret there.\n i === 0\n ) {\n return i\n }\n }\n } else {\n // Searching for the first placeholder or caret trap to the left\n\n for (let i = startingSearchIndex; i >= 0; i--) {\n // If we're deleting, we stop the caret right before the placeholder character.\n // For example, for mask `(111) 11`, current conformed input `(456) 86`. If user\n // modifies input to `(456 86`. That is, they deleted the `)`, we place the caret\n // right after the first `6`\n\n if (\n // If we're deleting, we can position the caret right before the placeholder character\n placeholder[i - 1] === placeholderChar ||\n // If a caret trap was set by a mask function, we need to stop at the trap.\n caretTrapIndexes.indexOf(i) !== -1 ||\n // This is the beginning of the placeholder. We cannot move any further.\n // Let's put the caret there.\n i === 0\n ) {\n return i\n }\n }\n }\n }\n}\n"],"mappings":";;;;;;AAAA,MAAMA,YAAY,GAAG,EAAE;AACvB,MAAMC,WAAW,GAAG,EAAE;AAEP,SAASC,mBAAmBA,CAAAC,IAAA,EAUxC;EAAA,IAVyC;IAC1CC,sBAAsB,GAAGH,WAAW;IACpCI,mBAAmB,GAAGJ,WAAW;IACjCK,oBAAoB,GAAG,CAAC;IACxBC,cAAc;IACdC,QAAQ;IACRC,eAAe;IACfC,WAAW;IACXC,mBAAmB,GAAGX,YAAY;IAClCY,gBAAgB,GAAGZ;EACrB,CAAC,GAAAG,IAAA;EACC,IAAIG,oBAAoB,KAAK,CAAC,IAAI,CAACE,QAAQ,CAACK,MAAM,EAAE;IAClD,OAAO,CAAC;EACV;EAGA,MAAMC,cAAc,GAAGN,QAAQ,CAACK,MAAM;EACtC,MAAME,4BAA4B,GAAGX,sBAAsB,CAACS,MAAM;EAClE,MAAMG,iBAAiB,GAAGN,WAAW,CAACG,MAAM;EAC5C,MAAMI,oBAAoB,GAAGV,cAAc,CAACM,MAAM;EAIlD,MAAMK,UAAU,GAAGJ,cAAc,GAAGC,4BAA4B;EAGhE,MAAMI,UAAU,GAAGD,UAAU,GAAG,CAAC;EAGjC,MAAME,eAAe,GAAGL,4B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CAAC,MAAM;IAEL,IAAI3B,mBAAmB,EAAE;MAGvB,KAAK,IAAIyB,CAAC,GAAG1B,mBAAmB,GAAG,CAAC,EAAE0B,CAAC,IAAI,CAAC,EAAEA,CAAC,EAAE,EAAE;QAIjD,IAGE1C,cAAc,CAAC0C,CAAC,CAAC,KAAKxB,UAAU,IAEhCb,gBAAgB,CAACuB,OAAO,CAACc,CAAC,CAAC,KAAK,CAAC,CAAC,IAGlCA,CAAC,KAAK,CAAC,EACP;UACA,OAAOA,CAAC;QACV;MACF;IACF,CAAC,MAAM;MAGL,KAAK,IAAIA,CAAC,GAAG1B,mBAAmB,EAAE0B,CAAC,IAAI,CAAC,EAAEA,CAAC,EAAE,EAAE;QAM7C,IAEEvC,WAAW,CAACuC,CAAC,GAAG,CAAC,CAAC,KAAKxC,eAAe,IAEtCG,gBAAgB,CAACuB,OAAO,CAACc,CAAC,CAAC,KAAK,CAAC,CAAC,IAGlCA,CAAC,KAAK,CAAC,EACP;UACA,OAAOA,CAAC;QACV;MACF;IACF;EACF;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"adjustCaretPosition.js","names":["defaultArray","emptyString","adjustCaretPosition","_ref","previousConformedValue","previousPlaceholder","currentCaretPosition","conformedValue","rawValue","placeholderChar","placeholder","indexesOfPipedChars","caretTrapIndexes","keepCharPositions","length","rawValueLength","previousConformedValueLength","placeholderLength","conformedValueLength","editLength","isAddition","isFirstRawValue","isPartialMultiCharEdit","possiblyHasRejectedChar","startingSearchIndex","trackRightCharacter","targetChar","normalizedConformedValue","toLowerCase","normalizedRawValue","leftHalfChars","substr","split","intersection","filter","char","indexOf","previousLeftMaskChars","leftMaskChars","masklengthChanged","targetIsMaskMovingLeft","undefined","pipedChars","map","index","countTargetCharInPipedChars","countTargetCharInIntersection","countTargetCharInPlaceholder","requiredNumberOfMatches","numberOfEncounteredMatches","i","conformedValueChar","lastPlaceholderChar"],"sources":["../../../../../src/components/input-masked/text-mask/adjustCaretPosition.js"],"sourcesContent":["const defaultArray = []\nconst emptyString = ''\n\nexport default function adjustCaretPosition({\n previousConformedValue = emptyString,\n previousPlaceholder = emptyString,\n currentCaretPosition = 0,\n conformedValue,\n rawValue,\n placeholderChar,\n placeholder,\n indexesOfPipedChars = defaultArray,\n caretTrapIndexes = defaultArray,\n keepCharPositions = false,\n}) {\n if (currentCaretPosition === 0 || !rawValue.length) {\n return 0\n }\n\n // Store lengths for faster performance?\n const rawValueLength = rawValue.length\n const previousConformedValueLength = previousConformedValue.length\n const placeholderLength = placeholder.length\n const conformedValueLength = conformedValue.length\n\n // This tells us how long the edit is. If user modified input from `(2__)` to `(243__)`,\n // we know the user in this instance pasted two characters\n const editLength = rawValueLength - previousConformedValueLength\n\n // If the edit length is positive, that means the user is adding characters, not deleting.\n const isAddition = editLength > 0\n\n // This is the first raw value the user entered that needs to be conformed to mask\n const isFirstRawValue = previousConformedValueLength === 0\n\n // A partial multi-character edit happens when the user makes a partial selection in their\n // input and edits that selection. That is going from `(123) 432-4348` to `() 432-4348` by\n // selecting the first 3 digits and pressing backspace.\n //\n // Such cases can also happen when the user presses the backspace while holding down the ALT\n // key.\n const isPartialMultiCharEdit =\n editLength > 1 && !isAddition && !isFirstRawValue\n\n // This algorithm doesn't support all cases of multi-character edits, so we just return\n // the current caret position.\n //\n // This works fine for most cases.\n if (isPartialMultiCharEdit) {\n return currentCaretPosition\n }\n\n // For a mask like (111), if the `previousConformedValue` is (1__) and user attempts to enter\n // `f` so the `rawValue` becomes (1f__), the new `conformedValue` would be (1__), which is the\n // same as the original `previousConformedValue`. We handle this case differently for caret\n // positioning.\n const possiblyHasRejectedChar =\n isAddition &&\n ((keepCharPositions !== false &&\n previousConformedValue === conformedValue) ||\n conformedValue === placeholder)\n\n let startingSearchIndex = 0\n let trackRightCharacter\n let targetChar\n\n if (possiblyHasRejectedChar) {\n startingSearchIndex = currentCaretPosition - editLength\n } else {\n // At this point in the algorithm, we want to know where the caret is right before the raw input\n // has been conformed, and then see if we can find that same spot in the conformed input.\n //\n // We do that by seeing what character lies immediately before the caret, and then look for that\n // same character in the conformed input and place the caret there.\n\n // First, we need to normalize the inputs so that letter capitalization between raw input and\n // conformed input wouldn't matter.\n const normalizedConformedValue = conformedValue.toLowerCase()\n const normalizedRawValue = rawValue.toLowerCase()\n\n // Then we take all characters that come before where the caret currently is.\n const leftHalfChars = normalizedRawValue\n .substr(0, currentCaretPosition)\n .split(emptyString)\n\n // Now we find all the characters in the left half that exist in the conformed input\n // This step ensures that we don't look for a character that was filtered out or rejected by `conformToMask`.\n const intersection = leftHalfChars.filter(\n (char) => normalizedConformedValue.indexOf(char) !== -1\n )\n\n // The last character in the intersection is the character we want to look for in the conformed\n // value and the one we want to adjust the caret close to\n targetChar = intersection[intersection.length - 1]\n\n // Calculate the number of mask characters in the previous placeholder\n // from the start of the string up to the place where the caret is\n const previousLeftMaskChars = previousPlaceholder\n .substr(0, intersection.length)\n .split(emptyString)\n .filter((char) => char !== placeholderChar).length\n\n // Calculate the number of mask characters in the current placeholder\n // from the start of the string up to the place where the caret is\n const leftMaskChars = placeholder\n .substr(0, intersection.length)\n .split(emptyString)\n .filter((char) => char !== placeholderChar).length\n\n // Has the number of mask characters up to the caret changed?\n const masklengthChanged = leftMaskChars !== previousLeftMaskChars\n\n // Detect if `targetChar` is a mask character and has moved to the left\n const targetIsMaskMovingLeft =\n previousPlaceholder[intersection.length - 1] !== undefined &&\n placeholder[intersection.length - 2] !== undefined &&\n previousPlaceholder[intersection.length - 1] !== placeholderChar &&\n previousPlaceholder[intersection.length - 1] !==\n placeholder[intersection.length - 1] &&\n previousPlaceholder[intersection.length - 1] ===\n placeholder[intersection.length - 2]\n\n // If deleting and the `targetChar` `is a mask character and `masklengthChanged` is true\n // or the mask is moving to the left, we can't use the selected `targetChar` any longer\n // if we are not at the end of the string.\n // In this case, change tracking strategy and track the character to the right of the caret.\n if (\n !isAddition &&\n (masklengthChanged || targetIsMaskMovingLeft) &&\n previousLeftMaskChars > 0 &&\n placeholder.indexOf(targetChar) > -1 &&\n rawValue[currentCaretPosition] !== undefined\n ) {\n trackRightCharacter = true\n targetChar = rawValue[currentCaretPosition]\n }\n\n // It is possible that `targetChar` will appear multiple times in the conformed value.\n // We need to know not to select a character that looks like our target character from the placeholder or\n // the piped characters, so we inspect the piped characters and the placeholder to see if they contain\n // characters that match our target character.\n\n // If the `conformedValue` got piped, we need to know which characters were piped in so that when we look for\n // our `targetChar`, we don't select a piped char by mistake\n const pipedChars = indexesOfPipedChars.map(\n (index) => normalizedConformedValue[index]\n )\n\n // We need to know how many times the `targetChar` occurs in the piped characters.\n const countTargetCharInPipedChars = pipedChars.filter(\n (char) => char === targetChar\n ).length\n\n // We need to know how many times it occurs in the intersection\n const countTargetCharInIntersection = intersection.filter(\n (char) => char === targetChar\n ).length\n\n // We need to know if the placeholder contains characters that look like\n // our `targetChar`, so we don't select one of those by mistake.\n const countTargetCharInPlaceholder = placeholder\n .substr(0, placeholder.indexOf(placeholderChar))\n .split(emptyString)\n .filter(\n (char, index) =>\n // Check if `char` is the same as our `targetChar`, so we account for it\n char === targetChar &&\n // but also make sure that both the `rawValue` and placeholder don't have the same character at the same\n // index because if they are equal, that means we are already counting those characters in\n // `countTargetCharInIntersection`\n rawValue[index] !== char\n ).length\n\n // The number of times we need to see occurrences of the `targetChar` before we know it is the one we're looking\n // for is:\n const requiredNumberOfMatches =\n countTargetCharInPlaceholder +\n countTargetCharInIntersection +\n countTargetCharInPipedChars +\n // The character to the right of the caret isn't included in `intersection`\n // so add one if we are tracking the character to the right\n (trackRightCharacter ? 1 : 0)\n\n // Now we start looking for the location of the `targetChar`.\n // We keep looping forward and store the index in every iteration. Once we have encountered\n // enough occurrences of the target character, we break out of the loop\n // If are searching for the second `1` in `1214`, `startingSearchIndex` will point at `4`.\n let numberOfEncounteredMatches = 0\n for (let i = 0; i < conformedValueLength; i++) {\n const conformedValueChar = normalizedConformedValue[i]\n\n startingSearchIndex = i + 1\n\n if (conformedValueChar === targetChar) {\n numberOfEncounteredMatches++\n }\n\n if (numberOfEncounteredMatches >= requiredNumberOfMatches) {\n break\n }\n }\n }\n\n // At this point, if we simply return `startingSearchIndex` as the adjusted caret position,\n // most cases would be handled. However, we want to fast forward or rewind the caret to the\n // closest placeholder character if it happens to be in a non-editable spot. That's what the next\n // logic is for.\n\n // In case of addition, we fast forward.\n if (isAddition) {\n // We want to remember the last placeholder character encountered so that if the mask\n // contains more characters after the last placeholder character, we don't forward the caret\n // that far to the right. Instead, we stop it at the last encountered placeholder character.\n let lastPlaceholderChar = startingSearchIndex\n\n for (let i = startingSearchIndex; i <= placeholderLength; i++) {\n if (placeholder[i] === placeholderChar) {\n lastPlaceholderChar = i\n }\n\n if (\n // If we're adding, we can position the caret at the next placeholder character.\n placeholder[i] === placeholderChar ||\n // If a caret trap was set by a mask function, we need to stop at the trap.\n caretTrapIndexes.indexOf(i) !== -1 ||\n // This is the end of the placeholder. We cannot move any further. Let's put the caret there.\n i === placeholderLength\n ) {\n return lastPlaceholderChar\n }\n }\n } else {\n // In case of deletion, we rewind.\n if (trackRightCharacter) {\n // Searching for the character that was to the right of the caret\n // We start at `startingSearchIndex` - 1 because it includes one character extra to the right\n for (let i = startingSearchIndex - 1; i >= 0; i--) {\n // If tracking the character to the right of the cursor, we move to the left until\n // we found the character and then place the caret right before it\n\n if (\n // `targetChar` should be in `conformedValue`, since it was in `rawValue`, just\n // to the right of the caret\n conformedValue[i] === targetChar ||\n // If a caret trap was set by a mask function, we need to stop at the trap.\n caretTrapIndexes.indexOf(i) !== -1 ||\n // This is the beginning of the placeholder. We cannot move any further.\n // Let's put the caret there.\n i === 0\n ) {\n return i\n }\n }\n } else {\n // Searching for the first placeholder or caret trap to the left\n\n for (let i = startingSearchIndex; i >= 0; i--) {\n // If we're deleting, we stop the caret right before the placeholder character.\n // For example, for mask `(111) 11`, current conformed input `(456) 86`. If user\n // modifies input to `(456 86`. That is, they deleted the `)`, we place the caret\n // right after the first `6`\n\n if (\n // If we're deleting, we can position the caret right before the placeholder character\n placeholder[i - 1] === placeholderChar ||\n // If a caret trap was set by a mask function, we need to stop at the trap.\n caretTrapIndexes.indexOf(i) !== -1 ||\n // This is the beginning of the placeholder. We cannot move any further.\n // Let's put the caret there.\n i === 0\n ) {\n return i\n }\n }\n }\n }\n}\n"],"mappings":";;;;;;AAAA,MAAMA,YAAY,GAAG,EAAE;AACvB,MAAMC,WAAW,GAAG,EAAE;AAEP,SAASC,mBAAmBA,CAAAC,IAAA,EAWxC;EAAA,IAXyC;IAC1CC,sBAAsB,GAAGH,WAAW;IACpCI,mBAAmB,GAAGJ,WAAW;IACjCK,oBAAoB,GAAG,CAAC;IACxBC,cAAc;IACdC,QAAQ;IACRC,eAAe;IACfC,WAAW;IACXC,mBAAmB,GAAGX,YAAY;IAClCY,gBAAgB,GAAGZ,YAAY;IAC/Ba,iBAAiB,GAAG;EACtB,CAAC,GAAAV,IAAA;EACC,IAAIG,oBAAoB,KAAK,CAAC,IAAI,CAACE,QAAQ,CAACM,MAAM,EAAE;IAClD,OAAO,CAAC;EACV;EAGA,MAAMC,cAAc,GAAGP,QAAQ,CAACM,MAAM;EACtC,MAAME,4BAA4B,GAAGZ,sBAAsB,CAACU,MAAM;EAClE,MAAMG,iBAAiB,GAAGP,WAAW,CAACI,MAAM;EAC5C,MAAMI,oBAAoB,GAAGX,cAAc,CAACO,MAAM;EAIlD,MAAMK,UAAU,GAAGJ,cAAc,GAAGC,4BAA4B;EAGhE,MAAMI,UAAU,GAAGD,UAAU,GAAG,CAAC;EAGjC,MAAME,eAAe,GAAGL,4BAA4B,KAAK,CAAC;EAQ1D,MAAMM,sBAAsB,GAC1BH,UAAU,GAAG,CAAC,IAAI,CAACC,UAAU,IAAI,CAACC,eAAe;EAMnD,IAAIC,sBAAsB,EAAE;IAC1B,OAAOhB,oBAAoB;EAC7B;EAMA,MAAMiB,uBAAuB,GAC3BH,UAAU,KACRP,iBAAiB,KAAK,KAAK,IAC3BT,sBAAsB,KAAKG,cAAc,IACzCA,cAAc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