@elliemae/ds-form 3.0.0-next.4 → 3.0.0-next.40
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/dist/cjs/CheckboxGroup/DSCheckboxGroup.js.map +1 -1
- package/dist/cjs/CheckboxGroup/defaultProps.js.map +1 -1
- package/dist/cjs/CheckboxGroup/props.js +3 -7
- package/dist/cjs/CheckboxGroup/props.js.map +2 -2
- package/dist/cjs/ComboBoxFreeSolo/ComboBoxFreeSolo.js.map +1 -1
- package/dist/cjs/ComboBoxFreeSolo/components/MultiValueLabel.js.map +1 -1
- package/dist/cjs/ComboBoxFreeSolo/components/MultiValueRemove.js.map +1 -1
- package/dist/cjs/ComboBoxFreeSolo/components/SingleValue.js.map +1 -1
- package/dist/cjs/ComboBoxFreeSolo/components/SingleValueRemove.js.map +1 -1
- package/dist/cjs/DateInput/DSDateInput.js.map +1 -1
- package/dist/cjs/DateInput/components/DateInputImpl.js.map +1 -1
- package/dist/cjs/DateInput/components/DateInputs.js.map +1 -1
- package/dist/cjs/DateInput/components/utils.js.map +1 -1
- package/dist/cjs/DateInput/defaultProps.js.map +1 -1
- package/dist/cjs/DateInput/props.js.map +1 -1
- package/dist/cjs/DateInputV2/components/DSDateInput.js.map +1 -1
- package/dist/cjs/DateInputV2/components/DateInputs.js.map +1 -1
- package/dist/cjs/DateInputV2/components/helpers.js.map +1 -1
- package/dist/cjs/DateInputV2/components/props.js.map +1 -1
- package/dist/cjs/DateInputV2/components/propsTypes.js.map +1 -1
- package/dist/cjs/DateInputV2/components/styled.js.map +1 -1
- package/dist/cjs/DateInputV2/components/utils.js.map +1 -1
- package/dist/cjs/ExpandableInput/DSExpandableInput.js.map +1 -1
- package/dist/cjs/ExpandableInput/ExpandableInputImpl.js +3 -13
- package/dist/cjs/ExpandableInput/ExpandableInputImpl.js.map +2 -2
- package/dist/cjs/FloatingLabelInput/DSFloatingLabelInput.js.map +1 -1
- package/dist/cjs/FloatingLabelInput/FloatingLabelInputImpl.js.map +1 -1
- package/dist/cjs/FloatingLabelInput/getSvgPath.js.map +1 -1
- package/dist/cjs/FormItem/DSFormItemLayout.js.map +1 -1
- package/dist/cjs/FormItem/Error/DSError.js.map +1 -1
- package/dist/cjs/FormItem/Feedback.js.map +1 -1
- package/dist/cjs/FormItem/Label/DSLabel.js.map +1 -1
- package/dist/cjs/FormItem/Suffix/Suffix.js.map +1 -1
- package/dist/cjs/FormItem/ValidationFieldWrapper.js +26 -26
- package/dist/cjs/FormItem/ValidationFieldWrapper.js.map +2 -2
- package/dist/cjs/FormItem/defaultProps.js.map +1 -1
- package/dist/cjs/FormItem/props.js.map +1 -1
- package/dist/cjs/FormItem/variants.js.map +1 -1
- package/dist/cjs/InputGroup/AddonWrapper.js.map +1 -1
- package/dist/cjs/InputGroup/DSInputGroup.js.map +1 -1
- package/dist/cjs/InputGroup/defaultProps.js.map +1 -1
- package/dist/cjs/InputGroup/props.js.map +1 -1
- package/dist/cjs/InputMask/DSInputMask.js.map +1 -1
- package/dist/cjs/InputMask/DSInputMaskDeprecated.js.map +1 -1
- package/dist/cjs/InputMask/InputMaskContext.js.map +1 -1
- package/dist/cjs/InputMask/MaskPipes.js.map +1 -1
- package/dist/cjs/InputMask/MaskTypes.js.map +1 -1
- package/dist/cjs/InputMask/addons/AutoCorrectedDatePipe.js.map +1 -1
- package/dist/cjs/InputMask/defaultProps.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/DateInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/DateTimeInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/DictionaryInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/NumberInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/PhoneInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/PhoneInternationalInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/SsnInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/UsZipCodeInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/ZipCodeSearchInputMask.js.map +1 -1
- package/dist/cjs/InputMask/mask_types/index.js.map +1 -1
- package/dist/cjs/InputMask/props.js.map +1 -1
- package/dist/cjs/InputMask/utils/setCaretPosition.js.map +1 -1
- package/dist/cjs/InputProtected/DSInputProtected.js.map +1 -1
- package/dist/cjs/InputProtected/defaultProps.js.map +1 -1
- package/dist/cjs/InputProtected/options.js.map +1 -1
- package/dist/cjs/InputProtected/props.js.map +1 -1
- package/dist/cjs/LargeInputText/DSLargeInputText.js.map +1 -1
- package/dist/cjs/LargeInputText/defaultProps.js.map +1 -1
- package/dist/cjs/LargeInputText/props.js.map +1 -1
- package/dist/cjs/Radio/Circle.js.map +1 -1
- package/dist/cjs/Radio/DSRadio.js.map +1 -1
- package/dist/cjs/RadioGroup/DSRadioGroup.js.map +1 -1
- package/dist/cjs/RadioGroup/defaultProps.js.map +1 -1
- package/dist/cjs/RadioGroup/props.js +3 -6
- package/dist/cjs/RadioGroup/props.js.map +2 -2
- package/dist/cjs/RequiredMark/RequiredMark.js.map +1 -1
- package/dist/cjs/TimeInput/DSTimeInput.js.map +1 -1
- package/dist/cjs/TimeInput/TimeInputImpl.js.map +1 -1
- package/dist/cjs/TimeInput/TimeInputs.js +30 -34
- package/dist/cjs/TimeInput/TimeInputs.js.map +2 -2
- package/dist/cjs/TimeInput/utils.js +8 -8
- package/dist/cjs/TimeInput/utils.js.map +2 -2
- package/dist/cjs/Toggle/DSToggle.js +2 -2
- package/dist/cjs/Toggle/DSToggle.js.map +2 -2
- package/dist/cjs/Toggle/DSToggleImpl.js.map +1 -1
- package/dist/cjs/Toggle/DSToggleRender.js.map +1 -1
- package/dist/cjs/Toggle/props.js +2 -2
- package/dist/cjs/Toggle/props.js.map +2 -2
- package/dist/cjs/Toggle/toggleHelper.js.map +1 -1
- package/dist/esm/CheckboxGroup/DSCheckboxGroup.js.map +1 -1
- package/dist/esm/CheckboxGroup/defaultProps.js.map +1 -1
- package/dist/esm/CheckboxGroup/props.js +2 -6
- package/dist/esm/CheckboxGroup/props.js.map +2 -2
- package/dist/esm/ComboBoxFreeSolo/ComboBoxFreeSolo.js.map +1 -1
- package/dist/esm/ComboBoxFreeSolo/components/MultiValueLabel.js.map +1 -1
- package/dist/esm/ComboBoxFreeSolo/components/MultiValueRemove.js.map +1 -1
- package/dist/esm/ComboBoxFreeSolo/components/SingleValue.js.map +1 -1
- package/dist/esm/ComboBoxFreeSolo/components/SingleValueRemove.js.map +1 -1
- package/dist/esm/DateInput/DSDateInput.js.map +1 -1
- package/dist/esm/DateInput/components/DateInputImpl.js.map +1 -1
- package/dist/esm/DateInput/components/DateInputs.js.map +1 -1
- package/dist/esm/DateInput/components/utils.js.map +1 -1
- package/dist/esm/DateInput/defaultProps.js.map +1 -1
- package/dist/esm/DateInput/props.js.map +1 -1
- package/dist/esm/DateInputV2/components/DSDateInput.js.map +1 -1
- package/dist/esm/DateInputV2/components/DateInputs.js.map +1 -1
- package/dist/esm/DateInputV2/components/helpers.js.map +1 -1
- package/dist/esm/DateInputV2/components/props.js.map +1 -1
- package/dist/esm/DateInputV2/components/propsTypes.js.map +1 -1
- package/dist/esm/DateInputV2/components/styled.js.map +1 -1
- package/dist/esm/DateInputV2/components/utils.js.map +1 -1
- package/dist/esm/ExpandableInput/DSExpandableInput.js.map +1 -1
- package/dist/esm/ExpandableInput/ExpandableInputImpl.js +2 -12
- package/dist/esm/ExpandableInput/ExpandableInputImpl.js.map +2 -2
- package/dist/esm/FloatingLabelInput/DSFloatingLabelInput.js.map +1 -1
- package/dist/esm/FloatingLabelInput/FloatingLabelInputImpl.js.map +1 -1
- package/dist/esm/FloatingLabelInput/getSvgPath.js.map +1 -1
- package/dist/esm/FormItem/DSFormItemLayout.js.map +1 -1
- package/dist/esm/FormItem/Error/DSError.js.map +1 -1
- package/dist/esm/FormItem/Feedback.js.map +1 -1
- package/dist/esm/FormItem/Label/DSLabel.js.map +1 -1
- package/dist/esm/FormItem/Suffix/Suffix.js.map +1 -1
- package/dist/esm/FormItem/ValidationFieldWrapper.js +26 -26
- package/dist/esm/FormItem/ValidationFieldWrapper.js.map +2 -2
- package/dist/esm/FormItem/defaultProps.js.map +1 -1
- package/dist/esm/FormItem/props.js.map +1 -1
- package/dist/esm/FormItem/variants.js.map +1 -1
- package/dist/esm/InputGroup/AddonWrapper.js.map +1 -1
- package/dist/esm/InputGroup/DSInputGroup.js.map +1 -1
- package/dist/esm/InputGroup/defaultProps.js.map +1 -1
- package/dist/esm/InputGroup/props.js.map +1 -1
- package/dist/esm/InputMask/DSInputMask.js.map +1 -1
- package/dist/esm/InputMask/DSInputMaskDeprecated.js.map +1 -1
- package/dist/esm/InputMask/InputMaskContext.js.map +1 -1
- package/dist/esm/InputMask/MaskPipes.js.map +1 -1
- package/dist/esm/InputMask/MaskTypes.js.map +1 -1
- package/dist/esm/InputMask/addons/AutoCorrectedDatePipe.js.map +1 -1
- package/dist/esm/InputMask/defaultProps.js.map +1 -1
- package/dist/esm/InputMask/mask_types/DateInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/DateTimeInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/DictionaryInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/NumberInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/PhoneInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/PhoneInternationalInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/SsnInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/UsZipCodeInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/ZipCodeSearchInputMask.js.map +1 -1
- package/dist/esm/InputMask/mask_types/index.js.map +1 -1
- package/dist/esm/InputMask/props.js.map +1 -1
- package/dist/esm/InputMask/utils/setCaretPosition.js.map +1 -1
- package/dist/esm/InputProtected/DSInputProtected.js.map +1 -1
- package/dist/esm/InputProtected/defaultProps.js.map +1 -1
- package/dist/esm/InputProtected/options.js.map +1 -1
- package/dist/esm/InputProtected/props.js.map +1 -1
- package/dist/esm/LargeInputText/DSLargeInputText.js.map +1 -1
- package/dist/esm/LargeInputText/defaultProps.js.map +1 -1
- package/dist/esm/LargeInputText/props.js.map +1 -1
- package/dist/esm/Radio/Circle.js.map +1 -1
- package/dist/esm/Radio/DSRadio.js.map +1 -1
- package/dist/esm/RadioGroup/DSRadioGroup.js.map +1 -1
- package/dist/esm/RadioGroup/defaultProps.js.map +1 -1
- package/dist/esm/RadioGroup/props.js +2 -5
- package/dist/esm/RadioGroup/props.js.map +2 -2
- package/dist/esm/RequiredMark/RequiredMark.js.map +1 -1
- package/dist/esm/TimeInput/DSTimeInput.js.map +1 -1
- package/dist/esm/TimeInput/TimeInputImpl.js.map +1 -1
- package/dist/esm/TimeInput/TimeInputs.js +2 -6
- package/dist/esm/TimeInput/TimeInputs.js.map +2 -2
- package/dist/esm/TimeInput/utils.js +1 -8
- package/dist/esm/TimeInput/utils.js.map +2 -2
- package/dist/esm/Toggle/DSToggle.js +1 -1
- package/dist/esm/Toggle/DSToggle.js.map +2 -2
- package/dist/esm/Toggle/DSToggleImpl.js.map +1 -1
- package/dist/esm/Toggle/DSToggleRender.js.map +1 -1
- package/dist/esm/Toggle/props.js +1 -1
- package/dist/esm/Toggle/props.js.map +2 -2
- package/dist/esm/Toggle/toggleHelper.js.map +1 -1
- package/package.json +14 -14
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/LargeInputText/defaultProps.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export const defaultProps = {\n containerProps: {},\n autoFocus: false,\n className: '',\n disabled: false,\n name: '',\n id: null,\n maxLength: null,\n minLength: 0,\n placeholder: '',\n onClick: () => null,\n onChange: () => null,\n onFocus: () => null,\n onBlur: () => null,\n onKeyUp: () => null,\n onKeyDown: () => null,\n onPaste: () => null,\n value: '',\n hasError: false,\n required: false,\n readOnly: false,\n resize: 'vertical',\n innerRef: null,\n ariaLabel: 'Enter text',\n ariaAutocomplete: 'none',\n role: 'textbox',\n characterLimitCounter: 0,\n rows: 3,\n errorLimit: 'Please limit your entry to',\n tabIndex: '',\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,eAAe;AAAA,EAC1B,gBAAgB;AAAA,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,eAAe;AAAA,EAC1B,gBAAgB,CAAC;AAAA,EACjB,WAAW;AAAA,EACX,WAAW;AAAA,EACX,UAAU;AAAA,EACV,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,WAAW;AAAA,EACX,WAAW;AAAA,EACX,aAAa;AAAA,EACb,SAAS,MAAM;AAAA,EACf,UAAU,MAAM;AAAA,EAChB,SAAS,MAAM;AAAA,EACf,QAAQ,MAAM;AAAA,EACd,SAAS,MAAM;AAAA,EACf,WAAW,MAAM;AAAA,EACjB,SAAS,MAAM;AAAA,EACf,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,WAAW;AAAA,EACX,kBAAkB;AAAA,EAClB,MAAM;AAAA,EACN,uBAAuB;AAAA,EACvB,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,UAAU;AACZ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/LargeInputText/props.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { PropTypes } from 'react-desc';\n\nexport const props = {\n /** Injected props to wrapper element of component */\n containerProps: PropTypes.object.description(\n 'Injected props to wrapper element of component',\n ),\n /**\n * Whether uses auto focus or not\n */\n autoFocus: PropTypes.bool.description('Whether uses auto focus or not'),\n /** CSS class */\n className: PropTypes.string.description('CSS class'),\n /**\n * Whether is disabled or not\n */\n disabled: PropTypes.bool.description('Whether is disabled or not'),\n /** HTML form name property */\n name: PropTypes.string.description('HTML form name property'),\n /** HTML id */\n id: PropTypes.number.description('HTML id'),\n /**\n * Max length for text to be entered\n */\n maxLength: PropTypes.number.description('Max length for text to be entered'),\n /**\n * Min length for text to be entered\n */\n minLength: PropTypes.number.description('Min length for text to be entered'),\n /**\n * Placeholder for the text\n */\n placeholder: PropTypes.string.description('Placeholder for the text'),\n /**\n * Allows a function that is triggered once the input text is clicked\n */\n onClick: PropTypes.func.description(\n 'Allows a function that is triggered once the input text is clicked',\n ),\n /**\n * Allows a function that is triggered once the input text changes\n */\n onChange: PropTypes.func.description(\n 'Allows a function that is triggered once the input text changes',\n ),\n /**\n * Allows a function that is triggered once the input text is focused\n */\n onFocus: PropTypes.func.description(\n 'Allows a function that is triggered once the input text is focused',\n ),\n /**\n * Allows a function that is triggered once the input text loses focus\n */\n onBlur: PropTypes.func.description(\n 'Allows a function that is triggered once the input text loses focus',\n ),\n /**\n * Allows a function that is triggered once in the input a keyboard key is released\n */\n onKeyUp: PropTypes.func.description(\n 'Allows a function that is triggered once in the input a keyboard key is released',\n ),\n /**\n * Allows a function that is triggered once a key is being pressed\n */\n onKeyDown: PropTypes.func.description(\n 'Allows a function that is triggered once a key is being pressed',\n ),\n /**\n * Allows a function that is triggered once the input text is pasted\n */\n onPaste: PropTypes.func.description(\n 'Allows a function that is triggered once the input text is pasted',\n ),\n /**\n * Default value once the component is initialized\n */\n value: PropTypes.string.description(\n 'Default value once the component is initialized',\n ),\n /**\n * Whether the input text has error or not\n */\n hasError: PropTypes.bool.description(\n 'Whether the input text has error or not',\n ),\n /**\n * Whether the input text is required or not\n */\n required: PropTypes.bool.description(\n 'Whether the input text is required or not',\n ),\n /**\n * Whether the input text is read only or not\n */\n readOnly: PropTypes.bool.description(\n 'Whether the input text is read only or not',\n ),\n /**\n * Whether the input text style is vertical or not\n */\n resize: PropTypes.string.description(\n 'Whether the input text style is vertical or not',\n ),\n /** ref forwarded to component */\n innerRef: PropTypes.func.description('ref forwarded to component'),\n /** a11y aria label */\n ariaLabel: PropTypes.string.description('a11y aria label'),\n ariaAutocomplete: PropTypes.string.description(''),\n /**\n * Type of input. Ex: textbox\n */\n role: PropTypes.string.description('Type of input. Ex: textbox'),\n /**\n * it will show a counter/limit if the value is greater than 0\n */\n characterLimitCounter: PropTypes.number.description(\n 'it will show a counter/limit if the value is greater than 0',\n ),\n /**\n * Tab index html property.\n */\n tabIndex: PropTypes.string.description('Tab index html property.'),\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAA0B;AAEnB,MAAM,QAAQ;AAAA,EAEnB,gBAAgB,4BAAU,OAAO,YAC/B;AAAA,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAA0B;AAEnB,MAAM,QAAQ;AAAA,EAEnB,gBAAgB,4BAAU,OAAO,YAC/B,gDACF;AAAA,EAIA,WAAW,4BAAU,KAAK,YAAY,gCAAgC;AAAA,EAEtE,WAAW,4BAAU,OAAO,YAAY,WAAW;AAAA,EAInD,UAAU,4BAAU,KAAK,YAAY,4BAA4B;AAAA,EAEjE,MAAM,4BAAU,OAAO,YAAY,yBAAyB;AAAA,EAE5D,IAAI,4BAAU,OAAO,YAAY,SAAS;AAAA,EAI1C,WAAW,4BAAU,OAAO,YAAY,mCAAmC;AAAA,EAI3E,WAAW,4BAAU,OAAO,YAAY,mCAAmC;AAAA,EAI3E,aAAa,4BAAU,OAAO,YAAY,0BAA0B;AAAA,EAIpE,SAAS,4BAAU,KAAK,YACtB,oEACF;AAAA,EAIA,UAAU,4BAAU,KAAK,YACvB,iEACF;AAAA,EAIA,SAAS,4BAAU,KAAK,YACtB,oEACF;AAAA,EAIA,QAAQ,4BAAU,KAAK,YACrB,qEACF;AAAA,EAIA,SAAS,4BAAU,KAAK,YACtB,kFACF;AAAA,EAIA,WAAW,4BAAU,KAAK,YACxB,iEACF;AAAA,EAIA,SAAS,4BAAU,KAAK,YACtB,mEACF;AAAA,EAIA,OAAO,4BAAU,OAAO,YACtB,iDACF;AAAA,EAIA,UAAU,4BAAU,KAAK,YACvB,yCACF;AAAA,EAIA,UAAU,4BAAU,KAAK,YACvB,2CACF;AAAA,EAIA,UAAU,4BAAU,KAAK,YACvB,4CACF;AAAA,EAIA,QAAQ,4BAAU,OAAO,YACvB,iDACF;AAAA,EAEA,UAAU,4BAAU,KAAK,YAAY,4BAA4B;AAAA,EAEjE,WAAW,4BAAU,OAAO,YAAY,iBAAiB;AAAA,EACzD,kBAAkB,4BAAU,OAAO,YAAY,EAAE;AAAA,EAIjD,MAAM,4BAAU,OAAO,YAAY,4BAA4B;AAAA,EAI/D,uBAAuB,4BAAU,OAAO,YACtC,6DACF;AAAA,EAIA,UAAU,4BAAU,OAAO,YAAY,0BAA0B;AACnE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/Radio/Circle.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport { withTheme } from '@elliemae/ds-system';\n\nconst Circle = ({ checked, theme }) => {\n const r =\n theme.breakpoints.medium.split('px')[0] - window.innerWidth >= 0 ? 6 : 4;\n return (\n <svg width=\"100%\" height=\"100%\">\n <circle\n className={checked ? 'checked' : 'unchecked'}\n r={r}\n cx=\"50%\"\n cy=\"50%\"\n />\n </svg>\n );\n};\n\nconst ThemedCircle = withTheme(Circle);\nexport { ThemedCircle as Circle };\nexport default ThemedCircle;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,uBAA0B;AAE1B,MAAM,SAAS,CAAC,EAAE,SAAS,YAAY;AACrC,QAAM,IACJ,MAAM,YAAY,OAAO,MAAM,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,uBAA0B;AAE1B,MAAM,SAAS,CAAC,EAAE,SAAS,YAAY;AACrC,QAAM,IACJ,MAAM,YAAY,OAAO,MAAM,IAAI,EAAE,KAAK,OAAO,cAAc,IAAI,IAAI;AACzE,SACE,mDAAC;AAAA,IAAI,OAAM;AAAA,IAAO,QAAO;AAAA,KACvB,mDAAC;AAAA,IACC,WAAW,UAAU,YAAY;AAAA,IACjC;AAAA,IACA,IAAG;AAAA,IACH,IAAG;AAAA,GACL,CACF;AAEJ;AAEA,MAAM,eAAe,gCAAU,MAAM;AAErC,IAAO,iBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/Radio/DSRadio.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable react/no-unknown-property */\nimport React, { useRef } from 'react';\nimport * as CSS from 'csstype';\nimport { PropTypes, describe } from 'react-desc';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { Circle } from './Circle';\n\ninterface DSRadioT {\n [x: string]: unknown;\n innerRef?: React.MutableRefObject<HTMLInputElement>;\n containerProps?: { [x: string]: unknown };\n className?: string;\n style?: CSS.Properties;\n labelText?: string;\n htmlFor?: string;\n hasError?: boolean;\n readOnly?: boolean;\n disabled?: boolean;\n checked?: boolean;\n value?: string;\n name?: string;\n onKeyDown?: React.KeyboardEventHandler<HTMLSpanElement>;\n onChange?: React.ChangeEventHandler<HTMLInputElement>;\n children?: React.ReactNode | React.ReactNode[];\n tabIndex?: number;\n}\n\nconst DSRadio = ({\n containerProps,\n className,\n style,\n labelText,\n htmlFor,\n hasError,\n readOnly,\n disabled,\n checked,\n value,\n name,\n onChange,\n children,\n tabIndex,\n ...otherProps\n}: DSRadioT) => {\n // this will be solved when we move to styled components...\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const { cssClassName, classNameElement } = convertPropToCssClassName('form-element-radio', className, {\n hasError,\n readOnly,\n disabled,\n });\n const checkRef = useRef<HTMLInputElement | null>(null);\n return (\n <div {...containerProps} className={cssClassName}>\n <label className={classNameElement('label')} htmlFor={htmlFor}>\n <input\n {...otherProps}\n ref={checkRef}\n aria-disabled={disabled}\n checked={disabled ? false : checked}\n className={classNameElement('input')}\n disabled={disabled}\n name={name}\n onChange={(e) => {\n if (!readOnly && !disabled) {\n onChange(e);\n }\n }}\n readOnly={readOnly}\n tabIndex={-1}\n type=\"radio\"\n value={value}\n />\n <span\n ref={otherProps.innerRef}\n aria-checked={checked}\n aria-disabled={disabled}\n className={classNameElement('input-button')}\n onKeyDown={(e) => {\n // really really bad pattern...\n // overwriting the target to point to the hidden input because the focus is on the span and not on the input...\n // we will solve this with a v2 of this when we move to controlled + styled components...\n e.target = checkRef.current;\n if (disabled) return;\n if (e.key === 'Enter' || e.keyCode === 32) {\n onChange(e);\n } else if (otherProps.onKeyDown) {\n otherProps.onKeyDown(e);\n }\n }}\n role=\"radio\"\n style={style}\n tabIndex={disabled ? -1 : tabIndex}\n // value={value} // should be unused?\n >\n <Circle checked={checked} />\n </span>\n <span className={classNameElement('label-text')}>{labelText}</span>\n </label>\n {children && <div className={classNameElement('radio-children')}>{children}</div>}\n </div>\n );\n};\n\nDSRadio.defaultProps = {\n containerProps: {},\n className: '',\n hasError: false,\n readOnly: false,\n disabled: false,\n checked: false,\n name: '',\n onChange: () => null,\n children: null,\n tabIndex: 0,\n};\n\nconst radioProps = {\n /** Injected props to wrapper element of component */\n containerProps: PropTypes.object.description('Injected props to wrapper element of component'),\n /** css class prop */\n className: PropTypes.string.description('css class prop'),\n /** name property to manage form */\n name: PropTypes.string.description('name property to manage form'),\n /**\n * Displayable label for the radio\n */\n labelText: PropTypes.string.description('Displayable label for the radio'),\n /** HTMLFOR property to manage form */\n htmlFor: PropTypes.element.description('HTMLFOR property to manage form'),\n /**\n * Whether the radio has error or not\n */\n hasError: PropTypes.bool.description('Whether the radio has error or not'),\n /**\n * Whether the radio is read only or not\n */\n readOnly: PropTypes.bool.description('Whether the radio is read only or not'),\n /**\n * Whether the radio is disabled or not\n */\n disabled: PropTypes.bool.description('Whether the radio is disabled or not'),\n /**\n * Whether the radio is checked or not\n */\n checked: PropTypes.bool.description('Whether the radio is checked or not'),\n /**\n * Value that takes the checkbox if it is checked\n */\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]).description(\n 'Value that takes the checkbox if it is checked',\n ).isRequired,\n /**\n * Allows a function that is triggered once the radio changes\n */\n onChange: PropTypes.func.description('Allows a function that is triggered once the radio changes'),\n /**\n * Optional, if you want a checkbox customized\n */\n children: PropTypes.node.description('Optional, if you want a checkbox customized'),\n /** HTML tabindex to manage focus */\n tabIndex: PropTypes.number.description('HTML tabindex to manage focus'),\n /** style override object */\n style: PropTypes.number.description('style override object'),\n};\n\nDSRadio.propTypes = radioProps;\n\nconst DSRadioWithSchema = describe(DSRadio);\nDSRadioWithSchema.propTypes = radioProps;\n\nexport { DSRadio, DSRadioWithSchema };\n\nexport default DSRadio;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YA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AAM;AAAA,EAChB,UAAU;AAAA,EACV,UAAU;AACZ;AAEA,MAAM,aAAa;AAAA,EAEjB,gBAAgB,4BAAU,OAAO,YAAY,gDAAgD;AAAA,EAE7F,WAAW,4BAAU,OAAO,YAAY,gBAAgB;AAAA,EAExD,MAAM,4BAAU,OAAO,YAAY,8BAA8B;AAAA,EAIjE,WAAW,4BAAU,OAAO,YAAY,iCAAiC;AAAA,EAEzE,SAAS,4BAAU,QAAQ,YAAY,iCAAiC;AAAA,EAIxE,UAAU,4BAAU,KAAK,YAAY,oCAAoC;AAAA,EAIzE,UAAU,4BAAU,KAAK,YAAY,uCAAuC;AAAA,EAI5E,UAAU,4BAAU,KAAK,YAAY,sCAAsC;AAAA,EAI3E,SAAS,4BAAU,KAAK,YAAY,qCAAqC;AAAA,EAIzE,OAAO,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU,QAAQ,4BAAU,MAAM,CAAC,EAAE,YACjF,gDACF,EAAE;AAAA,EAIF,UAAU,4BAAU,KAAK,YAAY,4DAA4D;AAAA,EAIjG,UAAU,4BAAU,KAAK,YAAY,6CAA6C;AAAA,EAElF,UAAU,4BAAU,OAAO,YAAY,+BAA+B;AAAA,EAEtE,OAAO,4BAAU,OAAO,YAAY,uBAAuB;AAC7D;AAEA,QAAQ,YAAY;AAEpB,MAAM,oBAAoB,gCAAS,OAAO;AAC1C,kBAAkB,YAAY;AAI9B,IAAO,kBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/RadioGroup/DSRadioGroup.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport { describe } from 'react-desc';\nimport { GroupItem, Group } from '@elliemae/ds-shared';\nimport { DSFormItemLayout } from '../FormItem';\nimport { DSRadio } from '../Radio';\nimport { props as rprops } from './props';\nimport { defaultProps } from './defaultProps';\n\nconst emClassPrefix = 'em-ds';\nconst baseClass = `${emClassPrefix}-radio-group`;\n\nconst RadioItem = (props) => (\n <GroupItem\n render={(context) => (\n <DSRadio\n {...props}\n checked={context.activeValue === props.value}\n disabled={context.disabled || props.disabled}\n onChange={context.onChange}\n />\n )}\n />\n);\n\nconst DSRadioGroup = ({\n containerProps,\n onChange,\n activeValue,\n children,\n orientation,\n disabled,\n truncateText,\n labelProps,\n}) => {\n const checkRefs = [];\n const count = React.Children.count(children);\n const onKeyDown = (e, index) => {\n if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {\n if (index === 0) checkRefs[count - 1].focus();\n else checkRefs[index - 1].focus();\n }\n if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {\n if (index === count - 1) checkRefs[0].focus();\n else checkRefs[index + 1].focus();\n }\n };\n const group = (\n <Group activeValue={activeValue} disabled={disabled} onChange={onChange}>\n <div\n data-testid=\"ds-radiogroup\"\n {...(labelProps && labelProps.labelText ? {} : containerProps)}\n className={`${baseClass} ${baseClass}--${orientation}`}\n role=\"group\"\n >\n {React.Children.map(\n children,\n (child, index) => (\n <RadioItem\n {...child.props}\n innerRef={(t) => {\n checkRefs.push(t);\n }}\n onKeyDown={(e) => onKeyDown(e, index)}\n />\n ),\n null,\n )}\n </div>\n </Group>\n );\n\n if (labelProps && labelProps.labelText) {\n return (\n <div\n className={`${baseClass}-form-item-layout-wrapper`}\n {...containerProps}\n role=\"group\"\n >\n <DSFormItemLayout\n {...labelProps}\n inputComponent={group}\n onChange={onChange}\n truncateText={truncateText}\n />\n </div>\n );\n }\n return group;\n};\n\nDSRadioGroup.propTypes = rprops;\nDSRadioGroup.defaultProps = defaultProps;\n\nconst DSRadioGroupWithSchema = describe(DSRadioGroup);\nDSRadioGroupWithSchema.propTypes = rprops;\n\nexport { DSRadioGroup, DSRadioGroupWithSchema };\n\nexport default DSRadioGroup;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;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AAA;AACvC,kBAAU,QAAQ,GAAG,MAAM;AAAA,IAClC;AAAA,EACF;AACA,QAAM,QACJ,mDAAC;AAAA,IAAM;AAAA,IAA0B;AAAA,IAAoB;AAAA,KACnD,mDAAC;AAAA,IACC,eAAY;AAAA,KACP,cAAc,WAAW,YAAY,CAAC,IAAI,iBAFhD;AAAA,IAGC,WAAW,GAAG,aAAa,cAAc;AAAA,IACzC,MAAK;AAAA,MAEJ,qBAAM,SAAS,IACd,UACA,CAAC,OAAO,UACN,mDAAC,4CACK,MAAM,QADX;AAAA,IAEC,UAAU,CAAC,MAAM;AACf,gBAAU,KAAK,CAAC;AAAA,IAClB;AAAA,IACA,WAAW,CAAC,MAAM,UAAU,GAAG,KAAK;AAAA,IACtC,GAEF,IACF,CACF,CACF;AAGF,MAAI,cAAc,WAAW,WAAW;AACtC,WACE,mDAAC;AAAA,MACC,WAAW,GAAG;AAAA,OACV,iBAFL;AAAA,MAGC,MAAK;AAAA,QAEL,mDAAC,mEACK,aADL;AAAA,MAEC,gBAAgB;AAAA,MAChB;AAAA,MACA;AAAA,MACF,CACF;AAAA,EAEJ;AACA,SAAO;AACT;AAEA,aAAa,YAAY;AACzB,aAAa,eAAe;AAE5B,MAAM,yBAAyB,gCAAS,YAAY;AACpD,uBAAuB,YAAY;AAInC,IAAO,uBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/RadioGroup/defaultProps.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export const defaultProps = {\n containerProps: {},\n onChange: () => null,\n orientation: 'vertical',\n disabled: false,\n truncateText: false,\n labelProps: {\n feedbackMessage: '',\n labelText: '',\n required: false,\n },\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,eAAe;AAAA,EAC1B,gBAAgB;AAAA,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,eAAe;AAAA,EAC1B,gBAAgB,CAAC;AAAA,EACjB,UAAU,MAAM;AAAA,EAChB,aAAa;AAAA,EACb,UAAU;AAAA,EACV,cAAc;AAAA,EACd,YAAY;AAAA,IACV,iBAAiB;AAAA,IACjB,WAAW;AAAA,IACX,UAAU;AAAA,EACZ;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -31,16 +31,13 @@ __export(props_exports, {
|
|
|
31
31
|
});
|
|
32
32
|
var React = __toESM(require("react"));
|
|
33
33
|
var import_react_desc = require("react-desc");
|
|
34
|
-
var
|
|
34
|
+
var import_ds_shared = require("@elliemae/ds-shared");
|
|
35
35
|
const props = {
|
|
36
36
|
containerProps: import_react_desc.PropTypes.object.description("Inject props to component wrapper"),
|
|
37
37
|
onChange: import_react_desc.PropTypes.func.description("Allows a function that is triggered once the radio group changes"),
|
|
38
|
-
activeValue: import_react_desc.PropTypes.oneOfType([
|
|
39
|
-
import_react_desc.PropTypes.string,
|
|
40
|
-
import_react_desc.PropTypes.number
|
|
41
|
-
]).description("Selected default active value"),
|
|
38
|
+
activeValue: import_react_desc.PropTypes.oneOfType([import_react_desc.PropTypes.string, import_react_desc.PropTypes.number]).description("Selected default active value"),
|
|
42
39
|
children: import_react_desc.PropTypes.arrayOf(import_react_desc.PropTypes.element).isRequired.description("Radio group items to show of type DSRadio"),
|
|
43
|
-
orientation: import_react_desc.PropTypes.oneOf(
|
|
40
|
+
orientation: import_react_desc.PropTypes.oneOf(import_ds_shared.orientation).description("['horizontal', 'vertical']"),
|
|
44
41
|
disabled: import_react_desc.PropTypes.bool.description(""),
|
|
45
42
|
labelProps: import_react_desc.PropTypes.shape({
|
|
46
43
|
feedbackMessage: import_react_desc.PropTypes.string,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/RadioGroup/props.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { PropTypes } from 'react-desc';\nimport { orientation as radioGroupOrientation } from '@elliemae/ds-shared
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAA0B;AAC1B,
|
|
4
|
+
"sourcesContent": ["import { PropTypes } from 'react-desc';\nimport { orientation as radioGroupOrientation } from '@elliemae/ds-shared';\n\nexport const props = {\n /** Inject props to component wrapper */\n containerProps: PropTypes.object.description('Inject props to component wrapper'),\n /**\n * Allows a function that is triggered once the radio group changes\n */\n onChange: PropTypes.func.description('Allows a function that is triggered once the radio group changes'),\n /**\n * Selected default active value\n */\n activeValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('Selected default active value'),\n /**\n * Radio group items to show of type DSRadio\n */\n children: PropTypes.arrayOf(PropTypes.element).isRequired.description('Radio group items to show of type DSRadio'),\n /**\n * ['horizontal', 'vertical']\n */\n orientation: PropTypes.oneOf(radioGroupOrientation).description(\"['horizontal', 'vertical']\"),\n /**\n * Whether the radio group is disabled or not\n */\n disabled: PropTypes.bool.description(''),\n labelProps: PropTypes.shape({\n feedbackMessage: PropTypes.string,\n labelText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n required: PropTypes.bool,\n }).description('Whether the radio group is disabled or not'),\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAA0B;AAC1B,uBAAqD;AAE9C,MAAM,QAAQ;AAAA,EAEnB,gBAAgB,4BAAU,OAAO,YAAY,mCAAmC;AAAA,EAIhF,UAAU,4BAAU,KAAK,YAAY,kEAAkE;AAAA,EAIvG,aAAa,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU,MAAM,CAAC,EAAE,YAAY,+BAA+B;AAAA,EAIlH,UAAU,4BAAU,QAAQ,4BAAU,OAAO,EAAE,WAAW,YAAY,2CAA2C;AAAA,EAIjH,aAAa,4BAAU,MAAM,4BAAqB,EAAE,YAAY,4BAA4B;AAAA,EAI5F,UAAU,4BAAU,KAAK,YAAY,EAAE;AAAA,EACvC,YAAY,4BAAU,MAAM;AAAA,IAC1B,iBAAiB,4BAAU;AAAA,IAC3B,WAAW,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU,OAAO,CAAC;AAAA,IACpE,UAAU,4BAAU;AAAA,EACtB,CAAC,EAAE,YAAY,4CAA4C;AAC7D;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/RequiredMark/RequiredMark.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\n\nconst { cssClassName } = convertPropToCssClassName('form-required-mark');\nconst RequiredMark = ({ required = false, optional = false }) => {\n if (!required && !optional) return null;\n if (required) {\n return <span className={`${cssClassName}`}>●</span>;\n }\n return <span className={`${cssClassName} optional-mark`}>⚬</span>;\n};\n\nexport { RequiredMark, RequiredMark as DSRequiredMark };\nexport default RequiredMark;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,2BAA0C;AAE1C,MAAM,EAAE,iBAAiB,oDAA0B;
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,2BAA0C;AAE1C,MAAM,EAAE,iBAAiB,oDAA0B,oBAAoB;AACvE,MAAM,eAAe,CAAC,EAAE,WAAW,OAAO,WAAW,YAAY;AAC/D,MAAI,CAAC,YAAY,CAAC;AAAU,WAAO;AACnC,MAAI,UAAU;AACZ,WAAO,mDAAC;AAAA,MAAK,WAAW,GAAG;AAAA,OAAgB,QAAO;AAAA,EACpD;AACA,SAAO,mDAAC;AAAA,IAAK,WAAW,GAAG;AAAA,KAA8B,QAAO;AAClE;AAGA,IAAO,uBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/TimeInput/DSTimeInput.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport { DSInput } from '../Input';\nimport { TimeInputImpl } from './TimeInputImpl';\n\nconst DSTimeInput = ({\n containerProps = {},\n innerRef,\n className = '',\n style = {},\n onChange = () => null,\n format,\n value = '',\n clearable = false,\n disabled = false,\n ariaLabel = 'Time input',\n}) => (\n <DSInput\n className={className}\n clearable={clearable}\n containerProps={containerProps}\n customInputType={({ onChange: inputOnChange, ...restInputProps }) => (\n <TimeInputImpl\n aria-label={ariaLabel}\n disabled={disabled}\n format={format}\n onChange={(time) => inputOnChange(time)}\n {...restInputProps}\n style={style}\n />\n )}\n disabled={disabled}\n innerRef={innerRef}\n isShowElipsisActive={false}\n onChange={onChange}\n onClear={() => onChange(null)}\n value={value}\n />\n);\n\nDSTimeInput.defaultProps = {\n format: 'hh:mm:ss',\n disabled: false,\n clearable: true,\n};\n\nconst props = {\n /** Injected props to wrapper element of component */\n containerProps: PropTypes.object.description(\n 'Injected props to wrapper element of component',\n ),\n /**\n * Allows a function that is triggered once the time input changes\n */\n onChange: PropTypes.func.description(\n 'Allows a function that is triggered once the time input changes',\n ),\n /** a11y aria label */\n 'aria-label': PropTypes.string.description('a11y aria label'),\n /** style object for time input wrapper */\n style: PropTypes.object.description('style object for time input wrapper'),\n /** inner ref for time inpot wrapper */\n innerRef: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({ current: PropTypes.any }),\n ]).description('inner ref for time input wrapper'),\n /** class for time input */\n className: PropTypes.string.description('class for time input'),\n /**\n * Valid time format\n */\n format: PropTypes.string.description('Valid time format'),\n /**\n * Default value once the component is initialized\n */\n value: PropTypes.string.description(\n 'Default value once the component is initialized',\n ),\n /**\n * Whether the time input is clearable or not\n */\n clearable: PropTypes.bool.description(\n 'Whether the time input is clearable or not',\n ),\n /**\n * Whether the time input is disabled or not\n */\n disabled: PropTypes.bool.description(\n 'Whether the time input is disabled or not',\n ),\n /**\n * Aria label\n */\n ariaLabel: PropTypes.string.description('Aria label'),\n};\n\nDSTimeInput.propTypes = props;\n\nconst DSTimeInputWithSchema = describe(DSTimeInput);\nDSTimeInputWithSchema.propTypes = props;\n\nexport { TimeInputImpl, DSTimeInputWithSchema, DSTimeInput };\n\nexport default DSTimeInput;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,wBAAoC;AACpC,mBAAwB;AACxB,2BAA8B;AAE9B,MAAM,cAAc,CAAC;AAAA,EACnB,iBAAiB;AAAA,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,wBAAoC;AACpC,mBAAwB;AACxB,2BAA8B;AAE9B,MAAM,cAAc,CAAC;AAAA,EACnB,iBAAiB,CAAC;AAAA,EAClB;AA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,YAAY;AACtD;AAEA,YAAY,YAAY;AAExB,MAAM,wBAAwB,gCAAS,WAAW;AAClD,sBAAsB,YAAY;AAIlC,IAAO,sBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/TimeInput/TimeInputImpl.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React, { useRef, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport { getVisibleTimeByFormat } from '@elliemae/ds-utilities';\nimport memoizeOne from 'memoize-one';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { TimeInputs } from './TimeInputs';\n\nconst blockName = 'input-time';\n\nconst InputTimeContainer = aggregatedClasses('div')(blockName);\n\nconst TimeInputImpl = ({\n format,\n innerRef,\n onChange,\n className,\n value,\n disabled,\n clearable,\n 'arial-label': ariaLabel,\n}) => {\n const getVisibleTimeInputs = memoizeOne((formatValue) =>\n getVisibleTimeByFormat(formatValue),\n );\n let inputsContainer = useRef();\n\n const handleFocus = (e) => {\n if (!e.target.type) {\n inputsContainer.querySelector('input').focus();\n }\n };\n\n const visibleInputs = useMemo(() => getVisibleTimeInputs(format));\n\n return (\n <InputTimeContainer\n className={className}\n disabled={disabled}\n innerRef={innerRef}\n onClick={handleFocus}\n >\n <TimeInputs\n aria-label={ariaLabel}\n clearable={clearable}\n disabled={disabled}\n format={format}\n innerRef={(node) => {\n inputsContainer = node;\n }}\n onChange={onChange}\n time={value}\n {...visibleInputs}\n />\n </InputTimeContainer>\n );\n};\n\nTimeInputImpl.propTypes = {\n containerProps: PropTypes.shape({}),\n /**\n * Inner reference to the input\n */\n innerRef: PropTypes.any,\n /**\n * Classes to add to the container\n */\n className: PropTypes.string,\n /**\n * Styles to add to the container\n */\n style: PropTypes.shape({}),\n /**\n * Allows a function that is triggered once the time input changes\n */\n onChange: PropTypes.func,\n /**\n * Valid time format\n */\n format: PropTypes.string,\n /**\n * Default value once the component is initialized\n */\n value: PropTypes.string,\n /**\n * Whether the time input is clearable or not\n */\n clearable: PropTypes.bool,\n /**\n * Whether the time input is disabled or not\n */\n disabled: PropTypes.bool,\n /**\n * Aria label to add to the container\n */\n 'aria-label': PropTypes.bool,\n 'arial-label': PropTypes.bool,\n};\n\nexport { TimeInputImpl };\nexport default TimeInputImpl;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAuC;AACvC,wBAAsB;AACtB,0BAAuC;AACvC,yBAAuB;AACvB,2BAAkC;AAClC,wBAA2B;AAE3B,MAAM,YAAY;AAElB,MAAM,qBAAqB,4CAAkB,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAuC;AACvC,wBAAsB;AACtB,0BAAuC;AACvC,yBAAuB;AACvB,2BAAkC;AAClC,wBAA2B;AAE3B,MAAM,YAAY;AAElB,MAAM,qBAAqB,4CAAkB,KAAK,EAAE,SAAS;AAE7D,MAAM,gBAAgB,CAAC;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,MACX;AACJ,QAAM,uBAAuB,gCAAW,CAAC,gBACvC,gDAAuB,WAAW,CACpC;AACA,MAAI,kBAAkB,yBAAO;AAE7B,QAAM,cAAc,CAAC,MAAM;AACzB,QAAI,CAAC,EAAE,OAAO,MAAM;AAClB,sBAAgB,cAAc,OAAO,EAAE,MAAM;AAAA,IAC/C;AAAA,EACF;AAEA,QAAM,gBAAgB,0BAAQ,MAAM,qBAAqB,MAAM,CAAC;AAEhE,SACE,mDAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,KAET,mDAAC;AAAA,IACC,cAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,CAAC,SAAS;AAClB,wBAAkB;AAAA,IACpB;AAAA,IACA;AAAA,IACA,MAAM;AAAA,KACF,cACN,CACF;AAEJ;AAEA,cAAc,YAAY;AAAA,EACxB,gBAAgB,0BAAU,MAAM,CAAC,CAAC;AAAA,EAIlC,UAAU,0BAAU;AAAA,EAIpB,WAAW,0BAAU;AAAA,EAIrB,OAAO,0BAAU,MAAM,CAAC,CAAC;AAAA,EAIzB,UAAU,0BAAU;AAAA,EAIpB,QAAQ,0BAAU;AAAA,EAIlB,OAAO,0BAAU;AAAA,EAIjB,WAAW,0BAAU;AAAA,EAIrB,UAAU,0BAAU;AAAA,EAIpB,cAAc,0BAAU;AAAA,EACxB,eAAe,0BAAU;AAC3B;AAGA,IAAO,wBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -52,7 +52,7 @@ var import_react = __toESM(require("react"));
|
|
|
52
52
|
var import_ds_classnames = require("@elliemae/ds-classnames");
|
|
53
53
|
var import_moment = __toESM(require("moment"));
|
|
54
54
|
var import_utils = require("./utils");
|
|
55
|
-
var
|
|
55
|
+
var import_ds_shared = require("@elliemae/ds-shared");
|
|
56
56
|
const blockName = "input-times-group";
|
|
57
57
|
const InputTimesGroup = (0, import_ds_classnames.aggregatedClasses)("div")(blockName);
|
|
58
58
|
const TimeInput = (0, import_ds_classnames.aggregatedClasses)("input")(blockName, "input");
|
|
@@ -115,7 +115,7 @@ const TimeInputs = ({
|
|
|
115
115
|
if (showSeconds && seconds)
|
|
116
116
|
selectedTime.seconds(seconds);
|
|
117
117
|
if (use12Hours && meridiem) {
|
|
118
|
-
const nextHours = meridiem.toLowerCase() ===
|
|
118
|
+
const nextHours = meridiem.toLowerCase() === import_ds_shared.AM ? hours % 12 : hours % 12 + 12;
|
|
119
119
|
selectedTime.hour(nextHours);
|
|
120
120
|
}
|
|
121
121
|
onChange(selectedTime);
|
|
@@ -146,21 +146,21 @@ const TimeInputs = ({
|
|
|
146
146
|
const { value } = target;
|
|
147
147
|
setLastTypedNumber(event.key);
|
|
148
148
|
switch (event.key) {
|
|
149
|
-
case
|
|
149
|
+
case import_ds_shared.ARROW_UP: {
|
|
150
150
|
event.preventDefault();
|
|
151
151
|
setCurrentKey(event.key);
|
|
152
152
|
const incrementedValue = getNextTimeValue(value);
|
|
153
153
|
(0, import_utils.setNativeValue)(event.target, incrementedValue);
|
|
154
154
|
break;
|
|
155
155
|
}
|
|
156
|
-
case
|
|
156
|
+
case import_ds_shared.ARROW_DOWN: {
|
|
157
157
|
event.preventDefault();
|
|
158
158
|
setCurrentKey(event.key);
|
|
159
159
|
const decrementedValue = getNextTimeValue(value, false);
|
|
160
160
|
(0, import_utils.setNativeValue)(event.target, decrementedValue);
|
|
161
161
|
break;
|
|
162
162
|
}
|
|
163
|
-
case
|
|
163
|
+
case import_ds_shared.BACKSPACE: {
|
|
164
164
|
event.preventDefault();
|
|
165
165
|
if (!value) {
|
|
166
166
|
(0, import_utils.focusPreviousInput)(event.target);
|
|
@@ -169,24 +169,24 @@ const TimeInputs = ({
|
|
|
169
169
|
}
|
|
170
170
|
break;
|
|
171
171
|
}
|
|
172
|
-
case
|
|
172
|
+
case import_ds_shared.ESCAPE: {
|
|
173
173
|
event.preventDefault();
|
|
174
174
|
event.target.blur();
|
|
175
175
|
break;
|
|
176
176
|
}
|
|
177
|
-
case
|
|
177
|
+
case import_ds_shared.HOME: {
|
|
178
178
|
event.preventDefault();
|
|
179
179
|
(0, import_utils.setNativeValue)(event.target, String(max));
|
|
180
180
|
(0, import_utils.focusNextInput)(event.target);
|
|
181
181
|
break;
|
|
182
182
|
}
|
|
183
|
-
case
|
|
183
|
+
case import_ds_shared.END: {
|
|
184
184
|
event.preventDefault();
|
|
185
185
|
(0, import_utils.setNativeValue)(event.target, "00");
|
|
186
186
|
(0, import_utils.focusNextInput)(event.target);
|
|
187
187
|
break;
|
|
188
188
|
}
|
|
189
|
-
case
|
|
189
|
+
case import_ds_shared.SHIFT:
|
|
190
190
|
event.preventDefault();
|
|
191
191
|
setCurrentKey(event.key);
|
|
192
192
|
break;
|
|
@@ -209,43 +209,43 @@ const TimeInputs = ({
|
|
|
209
209
|
const handleSecondsChange = (e) => {
|
|
210
210
|
const { value } = e.target;
|
|
211
211
|
const secondsHandled = (0, import_utils.parseTimeNumberFromText)(value);
|
|
212
|
-
const nextSeconds = (0, import_utils.getValidTimeNumber)(
|
|
212
|
+
const nextSeconds = (0, import_utils.getValidTimeNumber)(import_ds_shared.GENERAL_TIME_RANGE, secondsHandled, lastTypedNumber);
|
|
213
213
|
setSeconds((0, import_utils.formatSeconds)(format, nextSeconds));
|
|
214
214
|
setHasInputBeenTriggered(true);
|
|
215
|
-
focusNextInputIfNeeded(e.target,
|
|
215
|
+
focusNextInputIfNeeded(e.target, import_ds_shared.GENERAL_TIME_RANGE.max, value);
|
|
216
216
|
};
|
|
217
217
|
const handleMinutesChange = (e) => {
|
|
218
218
|
const { value } = e.target;
|
|
219
219
|
const minutesHandled = (0, import_utils.parseTimeNumberFromText)(value);
|
|
220
|
-
const nextMinutes = (0, import_utils.getValidTimeNumber)(
|
|
220
|
+
const nextMinutes = (0, import_utils.getValidTimeNumber)(import_ds_shared.GENERAL_TIME_RANGE, minutesHandled, lastTypedNumber);
|
|
221
221
|
setMinutes((0, import_utils.formatMinutes)(format, nextMinutes));
|
|
222
222
|
setHasInputBeenTriggered(true);
|
|
223
|
-
focusNextInputIfNeeded(e.target,
|
|
223
|
+
focusNextInputIfNeeded(e.target, import_ds_shared.GENERAL_TIME_RANGE.max, value);
|
|
224
224
|
};
|
|
225
225
|
const handleHoursChange = (e) => {
|
|
226
226
|
const { value } = e.target;
|
|
227
227
|
const hour = (0, import_utils.parseTimeNumberFromText)(value);
|
|
228
|
-
const hoursRange = use12Hours ?
|
|
228
|
+
const hoursRange = use12Hours ? import_ds_shared.HOUR_RANGE_12 : import_ds_shared.HOUR_RANGE_24;
|
|
229
229
|
const nextHour = (0, import_utils.getValidTimeNumber)(hoursRange, hour, lastTypedNumber);
|
|
230
230
|
setHours((0, import_utils.formatHour)(format, nextHour));
|
|
231
231
|
setHasInputBeenTriggered(true);
|
|
232
232
|
focusNextInputIfNeeded(e.target, hoursRange.max, value);
|
|
233
233
|
};
|
|
234
234
|
const handleMeridiemKeyDown = (e) => {
|
|
235
|
-
if (e.key ===
|
|
236
|
-
setMeridiem((0, import_utils.formatMeridiem)(format,
|
|
237
|
-
} else if (e.key ===
|
|
238
|
-
setMeridiem((0, import_utils.formatMeridiem)(format,
|
|
239
|
-
} else if (e.key ===
|
|
235
|
+
if (e.key === import_ds_shared.ARROW_UP || e.key === "a") {
|
|
236
|
+
setMeridiem((0, import_utils.formatMeridiem)(format, import_ds_shared.AM));
|
|
237
|
+
} else if (e.key === import_ds_shared.ARROW_DOWN || e.key === "p") {
|
|
238
|
+
setMeridiem((0, import_utils.formatMeridiem)(format, import_ds_shared.PM));
|
|
239
|
+
} else if (e.key === import_ds_shared.SHIFT) {
|
|
240
240
|
setCurrentKey(e.key);
|
|
241
|
-
} else if (e.key ===
|
|
241
|
+
} else if (e.key === import_ds_shared.BACKSPACE) {
|
|
242
242
|
setMeridiem("");
|
|
243
243
|
}
|
|
244
244
|
setHasInputBeenTriggered(true);
|
|
245
245
|
};
|
|
246
246
|
const handleMeridiemBlur = (e) => {
|
|
247
247
|
const { value } = e.target;
|
|
248
|
-
if (value !==
|
|
248
|
+
if (value !== import_ds_shared.AM && value !== import_ds_shared.PM) {
|
|
249
249
|
setMeridiem("");
|
|
250
250
|
}
|
|
251
251
|
};
|
|
@@ -259,7 +259,7 @@ const TimeInputs = ({
|
|
|
259
259
|
if (showSeconds && seconds)
|
|
260
260
|
selectedTime.seconds(seconds);
|
|
261
261
|
if (use12Hours && meridiem) {
|
|
262
|
-
const nextHours = meridiem.toLowerCase() ===
|
|
262
|
+
const nextHours = meridiem.toLowerCase() === import_ds_shared.AM ? hours % 12 : hours % 12 + 12;
|
|
263
263
|
selectedTime.hour(nextHours);
|
|
264
264
|
}
|
|
265
265
|
onChange(selectedTime);
|
|
@@ -268,35 +268,35 @@ const TimeInputs = ({
|
|
|
268
268
|
const renderSecondsInput = () => {
|
|
269
269
|
if (!showSeconds)
|
|
270
270
|
return null;
|
|
271
|
-
return /* @__PURE__ */ import_react.default.createElement(TimeInput, __spreadProps(__spreadValues({}, (0, import_utils.commonInputProps)((e) => onKeyDown(e,
|
|
271
|
+
return /* @__PURE__ */ import_react.default.createElement(TimeInput, __spreadProps(__spreadValues({}, (0, import_utils.commonInputProps)((e) => onKeyDown(e, import_ds_shared.GENERAL_TIME_RANGE.max), onInputFocus, onClick)), {
|
|
272
272
|
key: "seconds-input",
|
|
273
273
|
"data-testid": "ds-time-input__seconds",
|
|
274
274
|
"aria-label": ariaLabel || ariaLabel2 || "Seconds Input",
|
|
275
275
|
disabled,
|
|
276
276
|
innerRef: (node) => inputRefs.seconds = node,
|
|
277
277
|
onChange: handleSecondsChange,
|
|
278
|
-
placeholder: (0, import_utils.placeholderFormat)(
|
|
278
|
+
placeholder: (0, import_utils.placeholderFormat)(import_ds_shared.PLACEHOLDER_TIME.seconds, format),
|
|
279
279
|
value: seconds
|
|
280
280
|
}));
|
|
281
281
|
};
|
|
282
282
|
const renderMinutesInput = () => {
|
|
283
283
|
if (!showMinutes)
|
|
284
284
|
return null;
|
|
285
|
-
return /* @__PURE__ */ import_react.default.createElement(TimeInput, __spreadProps(__spreadValues({}, (0, import_utils.commonInputProps)((e) => onKeyDown(e,
|
|
285
|
+
return /* @__PURE__ */ import_react.default.createElement(TimeInput, __spreadProps(__spreadValues({}, (0, import_utils.commonInputProps)((e) => onKeyDown(e, import_ds_shared.GENERAL_TIME_RANGE.max), onInputFocus, onClick)), {
|
|
286
286
|
key: "minutes-input",
|
|
287
287
|
"data-testid": "ds-time-input__minutes",
|
|
288
288
|
"aria-label": ariaLabel || ariaLabel2 || "Minutes Input",
|
|
289
289
|
disabled,
|
|
290
290
|
innerRef: (node) => inputRefs.minutes = node,
|
|
291
291
|
onChange: handleMinutesChange,
|
|
292
|
-
placeholder: (0, import_utils.placeholderFormat)(
|
|
292
|
+
placeholder: (0, import_utils.placeholderFormat)(import_ds_shared.PLACEHOLDER_TIME.minutes, format),
|
|
293
293
|
value: minutes
|
|
294
294
|
}));
|
|
295
295
|
};
|
|
296
296
|
const renderHoursInput = () => {
|
|
297
297
|
if (!showHours)
|
|
298
298
|
return null;
|
|
299
|
-
const hourFormatRange = use12Hours ?
|
|
299
|
+
const hourFormatRange = use12Hours ? import_ds_shared.HOUR_RANGE_12 : import_ds_shared.HOUR_RANGE_24;
|
|
300
300
|
return /* @__PURE__ */ import_react.default.createElement(TimeInput, __spreadProps(__spreadValues({}, (0, import_utils.commonInputProps)((e) => onKeyDown(e, hourFormatRange.max), onInputFocus, onClick)), {
|
|
301
301
|
key: "hour-input",
|
|
302
302
|
"data-testid": "ds-time-input__hours",
|
|
@@ -304,7 +304,7 @@ const TimeInputs = ({
|
|
|
304
304
|
disabled,
|
|
305
305
|
innerRef: (node) => inputRefs.hours = node,
|
|
306
306
|
onChange: handleHoursChange,
|
|
307
|
-
placeholder: (0, import_utils.placeholderFormat)(
|
|
307
|
+
placeholder: (0, import_utils.placeholderFormat)(import_ds_shared.PLACEHOLDER_TIME.hour, format, use12Hours),
|
|
308
308
|
value: hours
|
|
309
309
|
}));
|
|
310
310
|
};
|
|
@@ -318,16 +318,12 @@ const TimeInputs = ({
|
|
|
318
318
|
disabled,
|
|
319
319
|
onBlur: handleMeridiemBlur,
|
|
320
320
|
onKeyDown: handleMeridiemKeyDown,
|
|
321
|
-
placeholder: (0, import_utils.placeholderFormat)(
|
|
321
|
+
placeholder: (0, import_utils.placeholderFormat)(import_ds_shared.PLACEHOLDER_TIME.meridiem, format),
|
|
322
322
|
value: meridiem
|
|
323
323
|
}));
|
|
324
324
|
};
|
|
325
325
|
const renderTimeInputs = () => {
|
|
326
|
-
const inputs = [
|
|
327
|
-
renderHoursInput(),
|
|
328
|
-
renderMinutesInput(),
|
|
329
|
-
renderSecondsInput()
|
|
330
|
-
];
|
|
326
|
+
const inputs = [renderHoursInput(), renderMinutesInput(), renderSecondsInput()];
|
|
331
327
|
const inputsWithDividers = inputs.reduce((acc, input, index) => input ? acc.concat([
|
|
332
328
|
index ? /* @__PURE__ */ import_react.default.createElement(TimeDivider, {
|
|
333
329
|
key: index,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/TimeInput/TimeInputs.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable react/prop-types */\n/* eslint-disable max-lines */\n/* eslint-disable max-statements */\nimport React, { useEffect, useState } from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport moment from 'moment';\nimport {\n commonInputProps,\n formatHour,\n formatMinutes,\n formatSeconds,\n formatMeridiem,\n getValidTimeNumber,\n setNativeValue,\n parseTimeNumberFromText,\n focusNextInput,\n focusPreviousInput,\n getTimeValuesFromTime,\n isArrowIncrementDecrement,\n shouldFocusNextInput,\n placeholderFormat,\n} from './utils';\nimport {\n AM,\n PM,\n ARROW_UP,\n ARROW_DOWN,\n BACKSPACE,\n ESCAPE,\n HOME,\n HOUR_RANGE_12,\n HOUR_RANGE_24,\n GENERAL_TIME_RANGE,\n END,\n PLACEHOLDER_TIME,\n SHIFT,\n} from '@elliemae/ds-shared/constants';\n\nconst blockName = 'input-times-group';\n\nconst InputTimesGroup = aggregatedClasses('div')(blockName);\nconst TimeInput = aggregatedClasses('input')(blockName, 'input');\nconst Divider = aggregatedClasses('span')(\n blockName,\n 'divider',\n ({ value }) => ({\n value,\n }),\n);\n\n// eslint-disable-next-line react/prop-types\nconst TimeDivider = ({ content = ':', value = '' }) => (\n <Divider value={!!value}>{content}</Divider>\n);\n\nconst TimeInputs = ({\n time,\n format,\n use12Hours,\n step = 1,\n showHours,\n showMinutes,\n showSeconds,\n onChange,\n disabled,\n innerRef,\n clearable,\n 'arial-label': ariaLabel,\n 'aria-label': ariaLabel2,\n}) => {\n const [meridiem, setMeridiem] = useState('');\n const [hours, setHours] = useState('');\n const [minutes, setMinutes] = useState('');\n const [hasInputValue, setHasInputValue] = useState(false);\n const [seconds, setSeconds] = useState('');\n const [currentKey, setCurrentKey] = useState('');\n const [hasInputBeenTriggered, setHasInputBeenTriggered] = useState(false);\n\n const [lastTypedNumber, setLastTypedNumber] = useState(null);\n const inputRefs = {\n hours: null,\n minutes: null,\n seconds: null,\n meridiem: null,\n };\n\n useEffect(() => {\n if (time && moment(time).isValid()) {\n const timeValues = getTimeValuesFromTime(time, format, use12Hours);\n\n setMeridiem(timeValues.meridiem);\n setHours(timeValues.hours);\n setMinutes(timeValues.minutes);\n setSeconds(timeValues.seconds);\n } else {\n setMeridiem('');\n setHours('');\n setMinutes('');\n setSeconds('');\n }\n }, [time, format, use12Hours]);\n\n useEffect(() => {\n const selectedTime = time || moment();\n if (isTimeCompletelySet() && selectedTime.hours && hasInputBeenTriggered) {\n if (showHours && hours) selectedTime.hours(hours);\n if (showMinutes && minutes) selectedTime.minutes(minutes);\n if (showSeconds && seconds) selectedTime.seconds(seconds);\n if (use12Hours && meridiem) {\n const nextHours =\n meridiem.toLowerCase() === AM ? hours % 12 : (hours % 12) + 12;\n selectedTime.hour(nextHours);\n }\n onChange(selectedTime);\n setHasInputBeenTriggered(false);\n }\n }, [hours, minutes, seconds, meridiem]);\n\n const focusNextInputIfNeeded = (currentEl, max, number) => {\n if (\n shouldFocusNextInput(max, number, currentEl.value) &&\n !isArrowIncrementDecrement(currentKey) &&\n !hasInputValue\n ) {\n focusNextInput(currentEl);\n }\n };\n\n const getNextTimeValue = (value, incrementing = true) => {\n const parsedValue = parseTimeNumberFromText(value);\n return incrementing ? parsedValue + step : parsedValue - step;\n };\n\n const onInputFocus = (e) => {\n e.preventDefault();\n e.stopPropagation();\n e.target.select();\n };\n\n const onClick = (e) => {\n if (e.target.value) {\n setHasInputValue(true);\n }\n };\n\n // eslint-disable-next-line max-statements\n const onKeyDown = (event, max) => {\n const { target } = event;\n const { value } = target;\n setLastTypedNumber(event.key);\n switch (event.key) {\n case ARROW_UP: {\n event.preventDefault();\n setCurrentKey(event.key);\n const incrementedValue = getNextTimeValue(value);\n setNativeValue(event.target, incrementedValue);\n break;\n }\n case ARROW_DOWN: {\n event.preventDefault();\n setCurrentKey(event.key);\n const decrementedValue = getNextTimeValue(value, false);\n setNativeValue(event.target, decrementedValue);\n break;\n }\n case BACKSPACE: {\n event.preventDefault();\n if (!value) {\n focusPreviousInput(event.target);\n } else {\n setNativeValue(event.target, '');\n }\n break;\n }\n case ESCAPE: {\n event.preventDefault();\n event.target.blur();\n break;\n }\n case HOME: {\n event.preventDefault();\n setNativeValue(event.target, String(max));\n focusNextInput(event.target);\n break;\n }\n case END: {\n event.preventDefault();\n setNativeValue(event.target, '00');\n focusNextInput(event.target);\n break;\n }\n case SHIFT:\n event.preventDefault();\n setCurrentKey(event.key);\n break;\n default:\n break;\n }\n };\n\n const isTimeCompletelySet = () => {\n let neededValues = [];\n\n if (showHours) neededValues = [...neededValues, hours || null];\n if (showMinutes) neededValues = [...neededValues, minutes || null];\n if (showSeconds) neededValues = [...neededValues, seconds || null];\n if (use12Hours) neededValues = [...neededValues, meridiem || null];\n\n return !neededValues.some((value) => !value);\n };\n\n const handleSecondsChange = (e) => {\n const { value } = e.target;\n const secondsHandled = parseTimeNumberFromText(value);\n\n const nextSeconds = getValidTimeNumber(\n GENERAL_TIME_RANGE,\n secondsHandled,\n lastTypedNumber,\n );\n\n setSeconds(formatSeconds(format, nextSeconds));\n setHasInputBeenTriggered(true);\n focusNextInputIfNeeded(e.target, GENERAL_TIME_RANGE.max, value);\n };\n\n const handleMinutesChange = (e) => {\n const { value } = e.target;\n const minutesHandled = parseTimeNumberFromText(value);\n const nextMinutes = getValidTimeNumber(\n GENERAL_TIME_RANGE,\n minutesHandled,\n lastTypedNumber,\n );\n\n setMinutes(formatMinutes(format, nextMinutes));\n setHasInputBeenTriggered(true);\n focusNextInputIfNeeded(e.target, GENERAL_TIME_RANGE.max, value);\n };\n\n const handleHoursChange = (e) => {\n const { value } = e.target;\n const hour = parseTimeNumberFromText(value);\n const hoursRange = use12Hours ? HOUR_RANGE_12 : HOUR_RANGE_24;\n\n const nextHour = getValidTimeNumber(hoursRange, hour, lastTypedNumber);\n setHours(formatHour(format, nextHour));\n setHasInputBeenTriggered(true);\n focusNextInputIfNeeded(e.target, hoursRange.max, value);\n };\n\n const handleMeridiemKeyDown = (e) => {\n if (e.key === ARROW_UP || e.key === 'a') {\n setMeridiem(formatMeridiem(format, AM));\n } else if (e.key === ARROW_DOWN || e.key === 'p') {\n setMeridiem(formatMeridiem(format, PM));\n } else if (e.key === SHIFT) {\n setCurrentKey(e.key);\n } else if (e.key === BACKSPACE) {\n setMeridiem('');\n }\n setHasInputBeenTriggered(true);\n };\n\n const handleMeridiemBlur = (e) => {\n const { value } = e.target;\n if (value !== AM && value !== PM) {\n setMeridiem('');\n }\n };\n\n const handleOnBlur = (event) => {\n const selectedTime = moment();\n if (clearable && !event.currentTarget.contains(event.relatedTarget)) {\n if (showHours && hours) selectedTime.hours(hours);\n if (showMinutes && minutes) selectedTime.minutes(minutes);\n if (showSeconds && seconds) selectedTime.seconds(seconds);\n if (use12Hours && meridiem) {\n const nextHours =\n meridiem.toLowerCase() === AM ? hours % 12 : (hours % 12) + 12;\n selectedTime.hour(nextHours);\n }\n onChange(selectedTime);\n }\n };\n\n const renderSecondsInput = () => {\n if (!showSeconds) return null;\n\n return (\n <TimeInput\n {...commonInputProps(\n (e) => onKeyDown(e, GENERAL_TIME_RANGE.max),\n onInputFocus,\n onClick,\n )}\n key=\"seconds-input\"\n data-testid=\"ds-time-input__seconds\"\n aria-label={ariaLabel || ariaLabel2 || 'Seconds Input'}\n disabled={disabled}\n // eslint-disable-next-line no-return-assign\n innerRef={(node) => (inputRefs.seconds = node)}\n onChange={handleSecondsChange}\n placeholder={placeholderFormat(PLACEHOLDER_TIME.seconds, format)}\n value={seconds}\n />\n );\n };\n\n const renderMinutesInput = () => {\n if (!showMinutes) return null;\n\n return (\n <TimeInput\n {...commonInputProps(\n (e) => onKeyDown(e, GENERAL_TIME_RANGE.max),\n onInputFocus,\n onClick,\n )}\n key=\"minutes-input\"\n data-testid=\"ds-time-input__minutes\"\n aria-label={ariaLabel || ariaLabel2 || 'Minutes Input'}\n disabled={disabled}\n // eslint-disable-next-line no-return-assign\n innerRef={(node) => (inputRefs.minutes = node)}\n onChange={handleMinutesChange}\n placeholder={placeholderFormat(PLACEHOLDER_TIME.minutes, format)}\n value={minutes}\n />\n );\n };\n\n const renderHoursInput = () => {\n if (!showHours) return null;\n const hourFormatRange = use12Hours ? HOUR_RANGE_12 : HOUR_RANGE_24;\n\n return (\n <TimeInput\n {...commonInputProps(\n (e) => onKeyDown(e, hourFormatRange.max),\n onInputFocus,\n onClick,\n )}\n key=\"hour-input\"\n data-testid=\"ds-time-input__hours\"\n aria-label={ariaLabel || ariaLabel2 || 'Hours Input'}\n disabled={disabled}\n // eslint-disable-next-line no-return-assign\n innerRef={(node) => (inputRefs.hours = node)}\n onChange={handleHoursChange}\n placeholder={placeholderFormat(\n PLACEHOLDER_TIME.hour,\n format,\n use12Hours,\n )}\n value={hours}\n />\n );\n };\n\n const renderMeridiemInput = () => {\n if (!use12Hours) return null;\n\n return (\n <TimeInput\n {...commonInputProps}\n key=\"meridiem-input\"\n data-testid=\"ds-time-input__ampm\"\n aria-label={ariaLabel || ariaLabel2 || 'Meridiem Input'}\n disabled={disabled}\n onBlur={handleMeridiemBlur}\n onKeyDown={handleMeridiemKeyDown}\n placeholder={placeholderFormat(PLACEHOLDER_TIME.meridiem, format)}\n value={meridiem}\n />\n );\n };\n\n const renderTimeInputs = () => {\n const inputs = [\n renderHoursInput(),\n renderMinutesInput(),\n renderSecondsInput(),\n ];\n /* eslint-disable indent */\n const inputsWithDividers = inputs.reduce(\n (acc, input, index) =>\n input\n ? acc.concat([\n index ? (\n <TimeDivider\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n content=\":\"\n value={input.props.value}\n />\n ) : null,\n input,\n ])\n : acc,\n [],\n );\n /* eslint-enable indent */\n\n return [\n inputsWithDividers,\n React.createElement('span', { key: 'span' }), // hack for next/prev focus\n renderMeridiemInput(),\n ];\n };\n\n return (\n <InputTimesGroup onBlur={handleOnBlur} innerRef={innerRef}>\n {renderTimeInputs()}\n </InputTimesGroup>\n );\n};\n\nexport { TimeInputs };\nexport default TimeInputs;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIvB,mBAA2C;AAC3C,2BAAkC;AAClC,oBAAmB;AACnB,mBAeO;AACP,uBAcO;AAEP,MAAM,YAAY;AAElB,MAAM,kBAAkB,4CAAkB,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable react/prop-types */\n/* eslint-disable max-lines */\n/* eslint-disable max-statements */\nimport React, { useEffect, useState } from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport moment from 'moment';\nimport {\n commonInputProps,\n formatHour,\n formatMinutes,\n formatSeconds,\n formatMeridiem,\n getValidTimeNumber,\n setNativeValue,\n parseTimeNumberFromText,\n focusNextInput,\n focusPreviousInput,\n getTimeValuesFromTime,\n isArrowIncrementDecrement,\n shouldFocusNextInput,\n placeholderFormat,\n} from './utils';\nimport {\n AM,\n PM,\n ARROW_UP,\n ARROW_DOWN,\n BACKSPACE,\n ESCAPE,\n HOME,\n HOUR_RANGE_12,\n HOUR_RANGE_24,\n GENERAL_TIME_RANGE,\n END,\n PLACEHOLDER_TIME,\n SHIFT,\n} from '@elliemae/ds-shared';\n\nconst blockName = 'input-times-group';\n\nconst InputTimesGroup = aggregatedClasses('div')(blockName);\nconst TimeInput = aggregatedClasses('input')(blockName, 'input');\nconst Divider = aggregatedClasses('span')(blockName, 'divider', ({ value }) => ({\n value,\n}));\n\n// eslint-disable-next-line react/prop-types\nconst TimeDivider = ({ content = ':', value = '' }) => <Divider value={!!value}>{content}</Divider>;\n\nconst TimeInputs = ({\n time,\n format,\n use12Hours,\n step = 1,\n showHours,\n showMinutes,\n showSeconds,\n onChange,\n disabled,\n innerRef,\n clearable,\n 'arial-label': ariaLabel,\n 'aria-label': ariaLabel2,\n}) => {\n const [meridiem, setMeridiem] = useState('');\n const [hours, setHours] = useState('');\n const [minutes, setMinutes] = useState('');\n const [hasInputValue, setHasInputValue] = useState(false);\n const [seconds, setSeconds] = useState('');\n const [currentKey, setCurrentKey] = useState('');\n const [hasInputBeenTriggered, setHasInputBeenTriggered] = useState(false);\n\n const [lastTypedNumber, setLastTypedNumber] = useState(null);\n const inputRefs = {\n hours: null,\n minutes: null,\n seconds: null,\n meridiem: null,\n };\n\n useEffect(() => {\n if (time && moment(time).isValid()) {\n const timeValues = getTimeValuesFromTime(time, format, use12Hours);\n\n setMeridiem(timeValues.meridiem);\n setHours(timeValues.hours);\n setMinutes(timeValues.minutes);\n setSeconds(timeValues.seconds);\n } else {\n setMeridiem('');\n setHours('');\n setMinutes('');\n setSeconds('');\n }\n }, [time, format, use12Hours]);\n\n useEffect(() => {\n const selectedTime = time || moment();\n if (isTimeCompletelySet() && selectedTime.hours && hasInputBeenTriggered) {\n if (showHours && hours) selectedTime.hours(hours);\n if (showMinutes && minutes) selectedTime.minutes(minutes);\n if (showSeconds && seconds) selectedTime.seconds(seconds);\n if (use12Hours && meridiem) {\n const nextHours = meridiem.toLowerCase() === AM ? hours % 12 : (hours % 12) + 12;\n selectedTime.hour(nextHours);\n }\n onChange(selectedTime);\n setHasInputBeenTriggered(false);\n }\n }, [hours, minutes, seconds, meridiem]);\n\n const focusNextInputIfNeeded = (currentEl, max, number) => {\n if (\n shouldFocusNextInput(max, number, currentEl.value) &&\n !isArrowIncrementDecrement(currentKey) &&\n !hasInputValue\n ) {\n focusNextInput(currentEl);\n }\n };\n\n const getNextTimeValue = (value, incrementing = true) => {\n const parsedValue = parseTimeNumberFromText(value);\n return incrementing ? parsedValue + step : parsedValue - step;\n };\n\n const onInputFocus = (e) => {\n e.preventDefault();\n e.stopPropagation();\n e.target.select();\n };\n\n const onClick = (e) => {\n if (e.target.value) {\n setHasInputValue(true);\n }\n };\n\n // eslint-disable-next-line max-statements\n const onKeyDown = (event, max) => {\n const { target } = event;\n const { value } = target;\n setLastTypedNumber(event.key);\n switch (event.key) {\n case ARROW_UP: {\n event.preventDefault();\n setCurrentKey(event.key);\n const incrementedValue = getNextTimeValue(value);\n setNativeValue(event.target, incrementedValue);\n break;\n }\n case ARROW_DOWN: {\n event.preventDefault();\n setCurrentKey(event.key);\n const decrementedValue = getNextTimeValue(value, false);\n setNativeValue(event.target, decrementedValue);\n break;\n }\n case BACKSPACE: {\n event.preventDefault();\n if (!value) {\n focusPreviousInput(event.target);\n } else {\n setNativeValue(event.target, '');\n }\n break;\n }\n case ESCAPE: {\n event.preventDefault();\n event.target.blur();\n break;\n }\n case HOME: {\n event.preventDefault();\n setNativeValue(event.target, String(max));\n focusNextInput(event.target);\n break;\n }\n case END: {\n event.preventDefault();\n setNativeValue(event.target, '00');\n focusNextInput(event.target);\n break;\n }\n case SHIFT:\n event.preventDefault();\n setCurrentKey(event.key);\n break;\n default:\n break;\n }\n };\n\n const isTimeCompletelySet = () => {\n let neededValues = [];\n\n if (showHours) neededValues = [...neededValues, hours || null];\n if (showMinutes) neededValues = [...neededValues, minutes || null];\n if (showSeconds) neededValues = [...neededValues, seconds || null];\n if (use12Hours) neededValues = [...neededValues, meridiem || null];\n\n return !neededValues.some((value) => !value);\n };\n\n const handleSecondsChange = (e) => {\n const { value } = e.target;\n const secondsHandled = parseTimeNumberFromText(value);\n\n const nextSeconds = getValidTimeNumber(GENERAL_TIME_RANGE, secondsHandled, lastTypedNumber);\n\n setSeconds(formatSeconds(format, nextSeconds));\n setHasInputBeenTriggered(true);\n focusNextInputIfNeeded(e.target, GENERAL_TIME_RANGE.max, value);\n };\n\n const handleMinutesChange = (e) => {\n const { value } = e.target;\n const minutesHandled = parseTimeNumberFromText(value);\n const nextMinutes = getValidTimeNumber(GENERAL_TIME_RANGE, minutesHandled, lastTypedNumber);\n\n setMinutes(formatMinutes(format, nextMinutes));\n setHasInputBeenTriggered(true);\n focusNextInputIfNeeded(e.target, GENERAL_TIME_RANGE.max, value);\n };\n\n const handleHoursChange = (e) => {\n const { value } = e.target;\n const hour = parseTimeNumberFromText(value);\n const hoursRange = use12Hours ? HOUR_RANGE_12 : HOUR_RANGE_24;\n\n const nextHour = getValidTimeNumber(hoursRange, hour, lastTypedNumber);\n setHours(formatHour(format, nextHour));\n setHasInputBeenTriggered(true);\n focusNextInputIfNeeded(e.target, hoursRange.max, value);\n };\n\n const handleMeridiemKeyDown = (e) => {\n if (e.key === ARROW_UP || e.key === 'a') {\n setMeridiem(formatMeridiem(format, AM));\n } else if (e.key === ARROW_DOWN || e.key === 'p') {\n setMeridiem(formatMeridiem(format, PM));\n } else if (e.key === SHIFT) {\n setCurrentKey(e.key);\n } else if (e.key === BACKSPACE) {\n setMeridiem('');\n }\n setHasInputBeenTriggered(true);\n };\n\n const handleMeridiemBlur = (e) => {\n const { value } = e.target;\n if (value !== AM && value !== PM) {\n setMeridiem('');\n }\n };\n\n const handleOnBlur = (event) => {\n const selectedTime = moment();\n if (clearable && !event.currentTarget.contains(event.relatedTarget)) {\n if (showHours && hours) selectedTime.hours(hours);\n if (showMinutes && minutes) selectedTime.minutes(minutes);\n if (showSeconds && seconds) selectedTime.seconds(seconds);\n if (use12Hours && meridiem) {\n const nextHours = meridiem.toLowerCase() === AM ? hours % 12 : (hours % 12) + 12;\n selectedTime.hour(nextHours);\n }\n onChange(selectedTime);\n }\n };\n\n const renderSecondsInput = () => {\n if (!showSeconds) return null;\n\n return (\n <TimeInput\n {...commonInputProps((e) => onKeyDown(e, GENERAL_TIME_RANGE.max), onInputFocus, onClick)}\n key=\"seconds-input\"\n data-testid=\"ds-time-input__seconds\"\n aria-label={ariaLabel || ariaLabel2 || 'Seconds Input'}\n disabled={disabled}\n // eslint-disable-next-line no-return-assign\n innerRef={(node) => (inputRefs.seconds = node)}\n onChange={handleSecondsChange}\n placeholder={placeholderFormat(PLACEHOLDER_TIME.seconds, format)}\n value={seconds}\n />\n );\n };\n\n const renderMinutesInput = () => {\n if (!showMinutes) return null;\n\n return (\n <TimeInput\n {...commonInputProps((e) => onKeyDown(e, GENERAL_TIME_RANGE.max), onInputFocus, onClick)}\n key=\"minutes-input\"\n data-testid=\"ds-time-input__minutes\"\n aria-label={ariaLabel || ariaLabel2 || 'Minutes Input'}\n disabled={disabled}\n // eslint-disable-next-line no-return-assign\n innerRef={(node) => (inputRefs.minutes = node)}\n onChange={handleMinutesChange}\n placeholder={placeholderFormat(PLACEHOLDER_TIME.minutes, format)}\n value={minutes}\n />\n );\n };\n\n const renderHoursInput = () => {\n if (!showHours) return null;\n const hourFormatRange = use12Hours ? HOUR_RANGE_12 : HOUR_RANGE_24;\n\n return (\n <TimeInput\n {...commonInputProps((e) => onKeyDown(e, hourFormatRange.max), onInputFocus, onClick)}\n key=\"hour-input\"\n data-testid=\"ds-time-input__hours\"\n aria-label={ariaLabel || ariaLabel2 || 'Hours Input'}\n disabled={disabled}\n // eslint-disable-next-line no-return-assign\n innerRef={(node) => (inputRefs.hours = node)}\n onChange={handleHoursChange}\n placeholder={placeholderFormat(PLACEHOLDER_TIME.hour, format, use12Hours)}\n value={hours}\n />\n );\n };\n\n const renderMeridiemInput = () => {\n if (!use12Hours) return null;\n\n return (\n <TimeInput\n {...commonInputProps}\n key=\"meridiem-input\"\n data-testid=\"ds-time-input__ampm\"\n aria-label={ariaLabel || ariaLabel2 || 'Meridiem Input'}\n disabled={disabled}\n onBlur={handleMeridiemBlur}\n onKeyDown={handleMeridiemKeyDown}\n placeholder={placeholderFormat(PLACEHOLDER_TIME.meridiem, format)}\n value={meridiem}\n />\n );\n };\n\n const renderTimeInputs = () => {\n const inputs = [renderHoursInput(), renderMinutesInput(), renderSecondsInput()];\n /* eslint-disable indent */\n const inputsWithDividers = inputs.reduce(\n (acc, input, index) =>\n input\n ? acc.concat([\n index ? (\n <TimeDivider\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n content=\":\"\n value={input.props.value}\n />\n ) : null,\n input,\n ])\n : acc,\n [],\n );\n /* eslint-enable indent */\n\n return [\n inputsWithDividers,\n React.createElement('span', { key: 'span' }), // hack for next/prev focus\n renderMeridiemInput(),\n ];\n };\n\n return (\n <InputTimesGroup onBlur={handleOnBlur} innerRef={innerRef}>\n {renderTimeInputs()}\n </InputTimesGroup>\n );\n};\n\nexport { TimeInputs };\nexport default TimeInputs;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIvB,mBAA2C;AAC3C,2BAAkC;AAClC,oBAAmB;AACnB,mBAeO;AACP,uBAcO;AAEP,MAAM,YAAY;AAElB,MAAM,kBAAkB,4CAAkB,KAAK,EAAE,SAAS;AAC1D,MAAM,YAAY,4CAAkB,OAAO,EAAE,WAAW,OAAO;AAC/D,MAAM,UAAU,4CAAkB,MAAM,EAAE,WAAW,WAAW,CAAC,EAAE,YAAa;AAAA,EAC9E;AACF,EAAE;AAGF,MAAM,cAAc,CAAC,EAAE,UAAU,KAAK,QAAQ,SAAS,mDAAC;AAAA,EAAQ,OAAO,CAAC,CAAC;AAAA,GAAQ,OAAQ;AAEzF,MAAM,aAAa,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA;AAA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AAiB,MAAM,QAAQ,UAAU;AAAA,MACxE,OAAO;AAAA,MACT;AAAA,EAEJ;AAEA,QAAM,sBAAsB,MAAM;AAChC,QAAI,CAAC;AAAY,aAAO;AAExB,WACE,mDAAC,4CACK,gCADL;AAAA,MAEC,KAAI;AAAA,MACJ,eAAY;AAAA,MACZ,cAAY,aAAa,cAAc;AAAA,MACvC;AAAA,MACA,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa,oCAAkB,kCAAiB,UAAU,MAAM;AAAA,MAChE,OAAO;AAAA,MACT;AAAA,EAEJ;AAEA,QAAM,mBAAmB,MAAM;AAC7B,UAAM,SAAS,CAAC,iBAAiB,GAAG,mBAAmB,GAAG,mBAAmB,CAAC;AAE9E,UAAM,qBAAqB,OAAO,OAChC,CAAC,KAAK,OAAO,UACX,QACI,IAAI,OAAO;AAAA,MACT,QACE,mDAAC;AAAA,QAEC,KAAK;AAAA,QACL,SAAQ;AAAA,QACR,OAAO,MAAM,MAAM;AAAA,OACrB,IACE;AAAA,MACJ;AAAA,IACF,CAAC,IACD,KACN,CAAC,CACH;AAGA,WAAO;AAAA,MACL;AAAA,MACA,qBAAM,cAAc,QAAQ,EAAE,KAAK,OAAO,CAAC;AAAA,MAC3C,oBAAoB;AAAA,IACtB;AAAA,EACF;AAEA,SACE,mDAAC;AAAA,IAAgB,QAAQ;AAAA,IAAc;AAAA,KACpC,iBAAiB,CACpB;AAEJ;AAGA,IAAO,qBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -46,9 +46,9 @@ __export(utils_exports, {
|
|
|
46
46
|
var React = __toESM(require("react"));
|
|
47
47
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
48
48
|
var import_ds_utilities2 = require("@elliemae/ds-utilities");
|
|
49
|
-
var
|
|
49
|
+
var import_ds_shared = require("@elliemae/ds-shared");
|
|
50
50
|
const isAM = (time) => time && time.hour() < 12;
|
|
51
|
-
const isArrowIncrementDecrement = (key) => key ===
|
|
51
|
+
const isArrowIncrementDecrement = (key) => key === import_ds_shared.ARROW_DOWN || key === import_ds_shared.ARROW_UP || key === import_ds_shared.SHIFT;
|
|
52
52
|
const setNativeValue = (element, value) => {
|
|
53
53
|
if (!Object.getOwnPropertyDescriptor(element, "value"))
|
|
54
54
|
return;
|
|
@@ -63,16 +63,16 @@ const setNativeValue = (element, value) => {
|
|
|
63
63
|
element.dispatchEvent(new Event("input", { bubbles: true }));
|
|
64
64
|
};
|
|
65
65
|
const placeholderFormat = (position, format, use12Hours) => {
|
|
66
|
-
if (position ===
|
|
66
|
+
if (position === import_ds_shared.PLACEHOLDER_TIME.hour) {
|
|
67
67
|
return _placeholderHour(format, use12Hours);
|
|
68
68
|
}
|
|
69
|
-
if (position ===
|
|
69
|
+
if (position === import_ds_shared.PLACEHOLDER_TIME.minutes) {
|
|
70
70
|
return format.indexOf("mm") > -1 ? "mm" : "m";
|
|
71
71
|
}
|
|
72
|
-
if (position ===
|
|
72
|
+
if (position === import_ds_shared.PLACEHOLDER_TIME.seconds) {
|
|
73
73
|
return format.indexOf("ss") > -1 ? "ss" : "s";
|
|
74
74
|
}
|
|
75
|
-
if (position ===
|
|
75
|
+
if (position === import_ds_shared.PLACEHOLDER_TIME.meridiem) {
|
|
76
76
|
return format.indexOf("A") > -1 ? "A" : "a";
|
|
77
77
|
}
|
|
78
78
|
};
|
|
@@ -141,7 +141,7 @@ const getTimeValuesFromTime = (time, format, use12Hours) => {
|
|
|
141
141
|
const hours = use12Hours ? time.hour() % 12 || 12 : time.hour();
|
|
142
142
|
const minutes = time.minutes();
|
|
143
143
|
const seconds = time.seconds();
|
|
144
|
-
const meridiem = !isAM(time) ?
|
|
144
|
+
const meridiem = !isAM(time) ? import_ds_shared.PM : import_ds_shared.AM;
|
|
145
145
|
return {
|
|
146
146
|
hours: formatHour(format, hours),
|
|
147
147
|
minutes: formatMinutes(format, minutes),
|
|
@@ -153,7 +153,7 @@ const resetTimeValues = () => ({
|
|
|
153
153
|
hours: "",
|
|
154
154
|
minutes: "",
|
|
155
155
|
seconds: "",
|
|
156
|
-
meridiem:
|
|
156
|
+
meridiem: import_ds_shared.AM
|
|
157
157
|
});
|
|
158
158
|
const commonInputProps = (onKeyDown, onInputFocus, onClick) => ({
|
|
159
159
|
pattern: "[0-9]*",
|