@elliemae/ds-form 2.0.0-alpha.4 → 2.0.0-alpha.8
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/cjs/Checkbox/DSCheckbox.js +9 -11
- package/cjs/Checkbox/elements/CheckMark.js +1 -1
- package/cjs/Checkbox/index.js +2 -4
- package/cjs/CheckboxGroup/DSCheckboxGroup.js +7 -7
- package/cjs/CheckboxGroup/index.js +1 -1
- package/cjs/ComboBox/DSComboBox.js +3 -7
- package/cjs/ComboBox/index.js +3 -7
- package/cjs/ComboBox/v1/DSComboBox.js +23 -27
- package/cjs/ComboBox/v1/components/AllOption.js +3 -3
- package/cjs/ComboBox/v1/components/ClearIndicator.js +2 -2
- package/cjs/ComboBox/v1/components/Control.js +2 -2
- package/cjs/ComboBox/v1/components/CustomOption.js +4 -4
- package/cjs/ComboBox/v1/components/CustomOptionMulti.js +5 -5
- package/cjs/ComboBox/v1/components/DropdownIndicator.js +4 -4
- package/cjs/ComboBox/v1/components/MenuList.js +3 -3
- package/cjs/ComboBox/v1/components/MultiSelectHeader.js +1 -1
- package/cjs/ComboBox/v1/components/MultiValueLabel.js +1 -1
- package/cjs/ComboBox/v1/components/MultiValueRemove.js +1 -1
- package/cjs/ComboBox/v1/components/SelectMenu.js +5 -5
- package/cjs/ComboBox/v1/components/SingleValueLabel.js +1 -1
- package/cjs/ComboBox/v1/components/ValueContainer.js +4 -4
- package/cjs/ComboBox/v1/index.js +3 -7
- package/cjs/ComboBox/v1/withSelectStringValueConverter.js +3 -3
- package/cjs/ComboBox/v2/Combobox.js +9 -9
- package/cjs/ComboBox/v2/components/AllOption.js +3 -3
- package/cjs/ComboBox/v2/components/ClearIndicator.js +4 -4
- package/cjs/ComboBox/v2/components/Content.js +3 -3
- package/cjs/ComboBox/v2/components/Control.js +2 -2
- package/cjs/ComboBox/v2/components/CustomOption.js +6 -6
- package/cjs/ComboBox/v2/components/CustomOptionMulti.js +9 -9
- package/cjs/ComboBox/v2/components/DropdownIndicator.js +4 -4
- package/cjs/ComboBox/v2/components/GroupHeading.js +4 -4
- package/cjs/ComboBox/v2/components/IndicatorSeparator.js +2 -2
- package/cjs/ComboBox/v2/components/LoadingIndicator.js +3 -3
- package/cjs/ComboBox/v2/components/MenuList.js +4 -4
- package/cjs/ComboBox/v2/components/MultiSelectHeader.js +11 -11
- package/cjs/ComboBox/v2/components/MultiValueLabel.js +1 -1
- package/cjs/ComboBox/v2/components/MultiValueRemove.js +2 -2
- package/cjs/ComboBox/v2/components/SelectMenu.js +4 -4
- package/cjs/ComboBox/v2/components/SingleValueLabel.js +1 -1
- package/cjs/ComboBox/v2/components/ValueContainer.js +3 -3
- package/cjs/ComboBox/v2/context.js +1 -1
- package/cjs/ComboBox/v2/index.js +1 -1
- package/cjs/ComboBoxFreeSolo/ComboBoxFreeSolo.js +2 -2
- package/cjs/ComboBoxFreeSolo/components/MultiValueLabel.js +5 -5
- package/cjs/ComboBoxFreeSolo/components/MultiValueRemove.js +3 -3
- package/cjs/ComboBoxFreeSolo/components/SingleValue.js +2 -2
- package/cjs/ComboBoxFreeSolo/components/SingleValueRemove.js +3 -3
- package/cjs/DateInput/DSDateInput.js +4 -4
- package/cjs/DateInput/components/DateInputImpl.js +2 -2
- package/cjs/DateInput/components/DateInputs.js +7 -7
- package/cjs/DateInput/components/utils.js +1 -1
- package/cjs/DateInput/index.js +1 -1
- package/cjs/DateInputV2/components/DSDateInput.js +2 -2
- package/cjs/DateInputV2/components/DateInputs.js +13 -13
- package/cjs/DateInputV2/components/propsTypes.js +17 -17
- package/cjs/DateInputV2/components/styled.js +4 -4
- package/cjs/DateInputV2/components/utils.js +1 -1
- package/cjs/DateInputV2/index.js +1 -1
- package/cjs/ExpandableInput/DSExpandableInput.js +1 -1
- package/cjs/ExpandableInput/ExpandableInputImpl.js +3 -3
- package/cjs/FloatingLabelInput/DSFloatingLabelInput.js +2 -2
- package/cjs/FloatingLabelInput/FloatingLabelInputImpl.js +15 -15
- package/cjs/FormItem/DSFormItemLayout.js +13 -13
- package/cjs/FormItem/Error/DSError.js +2 -2
- package/cjs/FormItem/Feedback.js +1 -1
- package/cjs/FormItem/Label/DSLabel.js +3 -3
- package/cjs/FormItem/Suffix/Suffix.js +4 -4
- package/cjs/FormItem/ValidationFieldWrapper.js +2 -2
- package/cjs/FormItem/defaultProps.js +1 -1
- package/cjs/FormItem/index.js +2 -2
- package/cjs/Input/DSInput.js +4 -3
- package/cjs/Input/InputAddonWrapper.js +4 -4
- package/cjs/Input/InputImpl.js +56 -55
- package/cjs/Input/index.js +1 -1
- package/cjs/InputGroup/AddonWrapper.js +4 -4
- package/cjs/InputGroup/DSInputGroup.js +1 -1
- package/cjs/InputGroup/index.js +1 -1
- package/cjs/InputMask/DSInputMask.js +3 -3
- package/cjs/InputMask/DSInputMaskDeprecated.js +10 -10
- package/cjs/InputMask/InputMaskContext.js +1 -1
- package/cjs/InputMask/MaskTypes.js +1 -1
- package/cjs/InputMask/index.js +1 -1
- package/cjs/InputMask/mask_types/DateInputMask.js +3 -3
- package/cjs/InputMask/mask_types/DateTimeInputMask.js +3 -3
- package/cjs/InputMask/mask_types/DictionaryInputMask.js +3 -3
- package/cjs/InputMask/mask_types/NumberInputMask.js +3 -3
- package/cjs/InputMask/mask_types/PhoneInputMask.js +3 -3
- package/cjs/InputMask/mask_types/PhoneInternationalInputMask.js +3 -3
- package/cjs/InputMask/mask_types/SsnInputMask.js +3 -3
- package/cjs/InputMask/mask_types/UsZipCodeInputMask.js +3 -3
- package/cjs/InputMask/mask_types/ZipCodeSearchInputMask.js +3 -3
- package/cjs/InputMask/mask_types/index.js +4 -4
- package/cjs/InputProtected/DSInputProtected.js +10 -10
- package/cjs/InputProtected/index.js +1 -1
- package/cjs/LargeInputText/DSLargeInputText.js +4 -4
- package/cjs/LargeInputText/index.js +1 -1
- package/cjs/Radio/Circle.js +2 -2
- package/cjs/Radio/DSRadio.js +8 -8
- package/cjs/Radio/index.js +1 -1
- package/cjs/RadioGroup/DSRadioGroup.js +8 -8
- package/cjs/RadioGroup/index.js +1 -1
- package/cjs/RequiredMark/RequiredMark.js +2 -2
- package/cjs/SearchBox/DSSearchBox.js +11 -8
- package/cjs/SearchBox/NavSearchBox.js +19 -19
- package/cjs/SearchBox/SButton.js +2 -2
- package/cjs/SearchBox/SearchBoxToggle.js +7 -7
- package/cjs/SearchBox/index.js +1 -1
- package/cjs/SearchBox/styled.js +1 -1
- package/cjs/SearchBox/withSearchable.js +4 -4
- package/cjs/TextBox/DSTextBox.js +11 -8
- package/cjs/TextBox/index.js +1 -1
- package/cjs/TimeInput/DSTimeInput.js +4 -4
- package/cjs/TimeInput/TimeInputImpl.js +3 -3
- package/cjs/TimeInput/TimeInputs.js +8 -8
- package/cjs/TimeInput/index.js +1 -1
- package/cjs/Toggle/DSToggle.js +3 -3
- package/cjs/Toggle/DSToggleImpl.js +17 -17
- package/cjs/Toggle/DSToggleRender.js +7 -7
- package/cjs/Toggle/index.js +1 -1
- package/cjs/Toggle/props.js +11 -11
- package/cjs/index.js +14 -18
- package/esm/Input/DSInput.js +1 -0
- package/esm/Input/InputImpl.js +3 -2
- package/esm/Radio/DSRadio.js +1 -1
- package/esm/SearchBox/DSSearchBox.js +5 -2
- package/esm/TextBox/DSTextBox.js +7 -4
- package/package.json +17 -17
- package/types/FloatingLabelInput/DSFloatingLabelInput.d.ts +2 -1
- package/types/FormItem/DSFormItemLayout.d.ts +2 -1
- package/types/FormItem/defaultProps.d.ts +2 -1
- package/types/SearchBox/styled.d.ts +2 -1
- package/types/TextBox/DSTextBox.d.ts +2 -1
|
@@ -18,7 +18,7 @@ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_definePropert
|
|
|
18
18
|
|
|
19
19
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
20
20
|
|
|
21
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default[
|
|
21
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
22
22
|
const customStyles = {
|
|
23
23
|
multiValueRemove: MultiValueRemove.MultiValueRemove.style,
|
|
24
24
|
clearIndicator: SingleValueRemove.SingleValueRemove.style,
|
|
@@ -58,7 +58,7 @@ function ComboBoxFreeSolo({
|
|
|
58
58
|
formatCreateLabel = val => `Create ${val}`,
|
|
59
59
|
maxOptions = undefined
|
|
60
60
|
}) {
|
|
61
|
-
return /*#__PURE__*/_jsx__default[
|
|
61
|
+
return /*#__PURE__*/_jsx__default["default"](Combobox.DSComboBox2, {
|
|
62
62
|
isFreeSolo: true,
|
|
63
63
|
clearable: true,
|
|
64
64
|
isMulti: isMulti,
|
|
@@ -12,10 +12,10 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
12
12
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
13
13
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
14
14
|
|
|
15
|
-
const RemovablePillWrapper = /*#__PURE__*/styled__default[
|
|
15
|
+
const RemovablePillWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
16
16
|
componentId: "sc-1qoa267-0"
|
|
17
17
|
})(["display:flex;align-items:center;outline:none;height:", ";max-width:90%;margin:0;padding:0 4px;background-color:", ";border-top-left-radius:", ";border-bottom-left-radius:", ";& + div{border-top-right-radius:", ";border-bottom-right-radius:", ";}"], props => props.theme.space.xs, props => props.theme.colors.brand[200], props => props.theme.fontSizes.value[600], props => props.theme.fontSizes.value[600], props => props.theme.fontSizes.value[600], props => props.theme.fontSizes.value[600]);
|
|
18
|
-
const PillLabel = /*#__PURE__*/styled__default[
|
|
18
|
+
const PillLabel = /*#__PURE__*/styled__default["default"].span.withConfig({
|
|
19
19
|
componentId: "sc-1qoa267-1"
|
|
20
20
|
})(["margin:0 4px;color:", ";white-space:nowrap;text-overflow:ellipsis;overflow:hidden;"], props => props.theme.colors.neutral[800]);
|
|
21
21
|
|
|
@@ -23,15 +23,15 @@ const RemovablePill = ({
|
|
|
23
23
|
label,
|
|
24
24
|
clear
|
|
25
25
|
}) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
26
|
-
children: [/*#__PURE__*/_jsx__default[
|
|
26
|
+
children: [/*#__PURE__*/_jsx__default["default"](RemovablePillWrapper, {
|
|
27
27
|
"data-testid": "pill-wrapper"
|
|
28
|
-
}, void 0, /*#__PURE__*/_jsx__default[
|
|
28
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](PillLabel, {}, void 0, label)), clear]
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
const MultiValueLabel = ({
|
|
32
32
|
children,
|
|
33
33
|
clear
|
|
34
|
-
}) => /*#__PURE__*/_jsx__default[
|
|
34
|
+
}) => /*#__PURE__*/_jsx__default["default"](RemovablePill, {
|
|
35
35
|
label: children,
|
|
36
36
|
clear: clear
|
|
37
37
|
});
|
|
@@ -21,13 +21,13 @@ var _PillCloseAddon;
|
|
|
21
21
|
|
|
22
22
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
23
23
|
|
|
24
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default[
|
|
25
|
-
const PillCloseAddon = /*#__PURE__*/styled__default[
|
|
24
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
25
|
+
const PillCloseAddon = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
26
26
|
componentId: "sc-kbngzd-0"
|
|
27
27
|
})(["cursor:pointer;height:", ";& > span{height:auto;}"], props => props.theme.space.xs);
|
|
28
28
|
|
|
29
29
|
const MultiValueRemove = props => /*#__PURE__*/jsxRuntime.jsx(Select.components.MultiValueRemove, _objectSpread(_objectSpread({}, props), {}, {
|
|
30
|
-
children: _PillCloseAddon || (_PillCloseAddon = /*#__PURE__*/_jsx__default[
|
|
30
|
+
children: _PillCloseAddon || (_PillCloseAddon = /*#__PURE__*/_jsx__default["default"](PillCloseAddon, {}, void 0, /*#__PURE__*/_jsx__default["default"](CloseXsmall__default["default"], {})))
|
|
31
31
|
}));
|
|
32
32
|
|
|
33
33
|
MultiValueRemove.style = base => _objectSpread(_objectSpread({}, base), {}, {
|
|
@@ -16,14 +16,14 @@ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_definePropert
|
|
|
16
16
|
|
|
17
17
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
18
18
|
|
|
19
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default[
|
|
19
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
20
20
|
|
|
21
21
|
const SingleValue = props => {
|
|
22
22
|
// eslint-disable-next-line react/prop-types
|
|
23
23
|
const {
|
|
24
24
|
children
|
|
25
25
|
} = props;
|
|
26
|
-
return /*#__PURE__*/_jsx__default[
|
|
26
|
+
return /*#__PURE__*/_jsx__default["default"](MultiValueLabel.MultiValueLabel, {
|
|
27
27
|
clear: /*#__PURE__*/jsxRuntime.jsx(SingleValueRemove.SingleValueRemove, _objectSpread({}, props))
|
|
28
28
|
}, void 0, children);
|
|
29
29
|
};
|
|
@@ -23,8 +23,8 @@ var _CloseXsmall;
|
|
|
23
23
|
|
|
24
24
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
25
25
|
|
|
26
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default[
|
|
27
|
-
const StyledButton = /*#__PURE__*/styled__default[
|
|
26
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
27
|
+
const StyledButton = /*#__PURE__*/styled__default["default"](DSButton__default["default"]).withConfig({
|
|
28
28
|
componentId: "sc-cikqh1-0"
|
|
29
29
|
})(["padding-right:8px;width:1.16rem !important;height:auto;z-index:10;color:'#000';"]);
|
|
30
30
|
|
|
@@ -39,7 +39,7 @@ const SingleValueRemove = props => {
|
|
|
39
39
|
"aria-label": "clear-indicator",
|
|
40
40
|
buttonType: "text",
|
|
41
41
|
className: "clear-indicator",
|
|
42
|
-
icon: _CloseXsmall || (_CloseXsmall = /*#__PURE__*/_jsx__default[
|
|
42
|
+
icon: _CloseXsmall || (_CloseXsmall = /*#__PURE__*/_jsx__default["default"](CloseXsmall__default["default"], {
|
|
43
43
|
fill: "#000"
|
|
44
44
|
})),
|
|
45
45
|
onClick: () => clearValue()
|
|
@@ -24,7 +24,7 @@ const _excluded = ["onChange", "onKeyDown"];
|
|
|
24
24
|
|
|
25
25
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
26
26
|
|
|
27
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default[
|
|
27
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
28
28
|
|
|
29
29
|
const DSDateInput = ({
|
|
30
30
|
innerRef,
|
|
@@ -62,7 +62,7 @@ const DSDateInput = ({
|
|
|
62
62
|
setValueDate(date);
|
|
63
63
|
inputOnChange(date);
|
|
64
64
|
}, []);
|
|
65
|
-
return /*#__PURE__*/_jsx__default[
|
|
65
|
+
return /*#__PURE__*/_jsx__default["default"](DSInput["default"], {
|
|
66
66
|
className: `${className} input-date-input `,
|
|
67
67
|
clearable: clearable,
|
|
68
68
|
containerProps: containerProps,
|
|
@@ -71,7 +71,7 @@ const DSDateInput = ({
|
|
|
71
71
|
onChange: inputOnChange,
|
|
72
72
|
onKeyDown: inputOnKeyDown
|
|
73
73
|
} = _ref,
|
|
74
|
-
restInputProps = _objectWithoutProperties__default[
|
|
74
|
+
restInputProps = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
75
75
|
|
|
76
76
|
return /*#__PURE__*/jsxRuntime.jsx(DateInputImpl, _objectSpread(_objectSpread({
|
|
77
77
|
INTERNAL_V2_NO_MUTATION: INTERNAL_V2_NO_MUTATION,
|
|
@@ -105,4 +105,4 @@ DSDateInputWithSchema.propTypes = props.props;
|
|
|
105
105
|
|
|
106
106
|
exports.DateInputImpl = DateInputImpl;
|
|
107
107
|
exports.DSDateInputWithSchema = DSDateInputWithSchema;
|
|
108
|
-
exports[
|
|
108
|
+
exports["default"] = DSDateInput;
|
|
@@ -14,7 +14,7 @@ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_definePropert
|
|
|
14
14
|
|
|
15
15
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
16
16
|
|
|
17
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default[
|
|
17
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
18
18
|
const blockName = 'input-time';
|
|
19
19
|
const DateInputContainer = dsClassnames.aggregatedClasses('div')(blockName);
|
|
20
20
|
|
|
@@ -51,7 +51,7 @@ const DateInputImpl = ({
|
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
const visibleInputs = React.useMemo(() => getVisibleTimeByFormat(format));
|
|
54
|
-
return /*#__PURE__*/_jsx__default[
|
|
54
|
+
return /*#__PURE__*/_jsx__default["default"](DateInputContainer, {
|
|
55
55
|
className: className,
|
|
56
56
|
disabled: disabled,
|
|
57
57
|
innerRef: innerRef,
|
|
@@ -16,7 +16,7 @@ var usePrevious__default = /*#__PURE__*/_interopDefaultLegacy(usePrevious);
|
|
|
16
16
|
|
|
17
17
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
18
18
|
|
|
19
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default[
|
|
19
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
20
20
|
const blockName = 'input-date-group';
|
|
21
21
|
const InputTimesGroup = dsClassnames.aggregatedClasses('div')(blockName);
|
|
22
22
|
const MonthInput = dsClassnames.aggregatedClasses('input')(blockName, 'input input-month');
|
|
@@ -31,7 +31,7 @@ const Divider = dsClassnames.aggregatedClasses('span')(blockName, 'divider', ({
|
|
|
31
31
|
const DateDivider = ({
|
|
32
32
|
content = ':',
|
|
33
33
|
value = ''
|
|
34
|
-
}) => /*#__PURE__*/_jsx__default[
|
|
34
|
+
}) => /*#__PURE__*/_jsx__default["default"](Divider, {
|
|
35
35
|
value: !!value
|
|
36
36
|
}, void 0, content);
|
|
37
37
|
|
|
@@ -58,8 +58,8 @@ const DateInputs = ({
|
|
|
58
58
|
const [month, setMonth] = React.useState('');
|
|
59
59
|
const [day, setDay] = React.useState('');
|
|
60
60
|
const [year, setYear] = React.useState('');
|
|
61
|
-
const prevTime = usePrevious__default[
|
|
62
|
-
const prevFormat = usePrevious__default[
|
|
61
|
+
const prevTime = usePrevious__default["default"](time);
|
|
62
|
+
const prevFormat = usePrevious__default["default"](format);
|
|
63
63
|
let digits = 2;
|
|
64
64
|
let placeholder = '';
|
|
65
65
|
React.useEffect(() => {
|
|
@@ -374,17 +374,17 @@ const DateInputs = ({
|
|
|
374
374
|
|
|
375
375
|
const renderDateInputs = () => {
|
|
376
376
|
const inputs = [renderMonthInput(), renderDayInput(), renderYearInput()];
|
|
377
|
-
const inputsWithDividers = inputs.reduce((acc, input, index) => input ? acc.concat([index ? /*#__PURE__*/_jsx__default[
|
|
377
|
+
const inputsWithDividers = inputs.reduce((acc, input, index) => input ? acc.concat([index ? /*#__PURE__*/_jsx__default["default"](DateDivider, {
|
|
378
378
|
content: " / ",
|
|
379
379
|
value: input.props.value
|
|
380
380
|
}, index) : null, input]) : acc, []);
|
|
381
|
-
return [inputsWithDividers, /*#__PURE__*/React__default[
|
|
381
|
+
return [inputsWithDividers, /*#__PURE__*/React__default["default"].createElement('span', {
|
|
382
382
|
key: 'span'
|
|
383
383
|
}) // hack for next/prev focus
|
|
384
384
|
];
|
|
385
385
|
};
|
|
386
386
|
|
|
387
|
-
return /*#__PURE__*/_jsx__default[
|
|
387
|
+
return /*#__PURE__*/_jsx__default["default"](InputTimesGroup, {
|
|
388
388
|
innerRef: innerRef
|
|
389
389
|
}, void 0, renderDateInputs());
|
|
390
390
|
};
|
|
@@ -155,7 +155,7 @@ const commonInputProps = (digits = 2, onKeyDown, placeholder) => {
|
|
|
155
155
|
};
|
|
156
156
|
const handleCompletedDate = (time, date, show, INTERNAL_V2_NO_MUTATION) => {
|
|
157
157
|
// clone time to avoid mutation when INTERNAL_V2_NO_MUTATION is true
|
|
158
|
-
const newDate = INTERNAL_V2_NO_MUTATION ? time && moment__default[
|
|
158
|
+
const newDate = INTERNAL_V2_NO_MUTATION ? time && moment__default["default"](time) || moment__default["default"]() : time || moment__default["default"]();
|
|
159
159
|
const {
|
|
160
160
|
year,
|
|
161
161
|
month,
|
package/cjs/DateInput/index.js
CHANGED
|
@@ -8,5 +8,5 @@ var DateInputImpl = require('./components/DateInputImpl.js');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
exports.DSDateInputWithSchema = DSDateInput.DSDateInputWithSchema;
|
|
11
|
-
exports
|
|
11
|
+
exports["default"] = DSDateInput["default"];
|
|
12
12
|
exports.DateInputImpl = DateInputImpl;
|
|
@@ -25,12 +25,12 @@ const DSDateInputV2 = ({
|
|
|
25
25
|
containerProps,
|
|
26
26
|
tabIndex,
|
|
27
27
|
innerRef
|
|
28
|
-
}) => /*#__PURE__*/_jsx__default[
|
|
28
|
+
}) => /*#__PURE__*/_jsx__default["default"](DSInput["default"], {
|
|
29
29
|
innerRef: innerRef,
|
|
30
30
|
containerProps: containerProps,
|
|
31
31
|
customInputType: ({
|
|
32
32
|
innerRef: ir
|
|
33
|
-
}) => /*#__PURE__*/_jsx__default[
|
|
33
|
+
}) => /*#__PURE__*/_jsx__default["default"](DateInputs.DateInputs, {
|
|
34
34
|
disabled: disabled,
|
|
35
35
|
innerRef: ir,
|
|
36
36
|
onBlur: onBlur,
|
|
@@ -22,7 +22,7 @@ var _DateInputDivider;
|
|
|
22
22
|
|
|
23
23
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
24
24
|
|
|
25
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default[
|
|
25
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
26
26
|
const FORMAT = 'MMDDYYYY';
|
|
27
27
|
const DateInputs = ({
|
|
28
28
|
onBlur,
|
|
@@ -38,18 +38,18 @@ const DateInputs = ({
|
|
|
38
38
|
const [day, setDay] = React.useState('');
|
|
39
39
|
const [year, setYear] = React.useState('');
|
|
40
40
|
const [onChangeDateTrigger, setOnChangeDateTrigger] = React.useState({});
|
|
41
|
-
const dayRef = React__default[
|
|
41
|
+
const dayRef = React__default["default"].useRef();
|
|
42
42
|
const [haveInputsOnChangeTriggered, setHaveInputsOnChangeTriggered] = React.useState(false);
|
|
43
43
|
let digits = 2;
|
|
44
44
|
let placeholder = '';
|
|
45
|
-
const handleFluidClick = React__default[
|
|
45
|
+
const handleFluidClick = React__default["default"].useCallback(e => {
|
|
46
46
|
if (!e.target.type && dayRef.current) {
|
|
47
47
|
dayRef.current.focus();
|
|
48
48
|
}
|
|
49
49
|
}, [dayRef.current]);
|
|
50
|
-
const triggerOnDateChange = React__default[
|
|
50
|
+
const triggerOnDateChange = React__default["default"].useCallback(() => {
|
|
51
51
|
if (month && day && year && haveInputsOnChangeTriggered) {
|
|
52
|
-
const momentValue = moment__default[
|
|
52
|
+
const momentValue = moment__default["default"](`${month}${day}${year}`, 'MMDDYYYY', true);
|
|
53
53
|
|
|
54
54
|
if (momentValue.isValid()) {
|
|
55
55
|
onDateChange(momentValue);
|
|
@@ -59,7 +59,7 @@ const DateInputs = ({
|
|
|
59
59
|
}
|
|
60
60
|
}, [day, month, year, haveInputsOnChangeTriggered]); // isArrowChange is coming from the onKeyDown handler in helpers
|
|
61
61
|
|
|
62
|
-
const onMonthChange = React__default[
|
|
62
|
+
const onMonthChange = React__default["default"].useCallback((e, isArrowChange) => {
|
|
63
63
|
const value = utils.getFormattedMonth(e.target.value);
|
|
64
64
|
const shouldAdvance = utils.getShouldShortcircuitMonth(e.target.value);
|
|
65
65
|
setMonth(value);
|
|
@@ -71,7 +71,7 @@ const DateInputs = ({
|
|
|
71
71
|
}
|
|
72
72
|
}, []); // isArrowChange is coming from the onKeyDown handler in helpers
|
|
73
73
|
|
|
74
|
-
const onDayChange = React__default[
|
|
74
|
+
const onDayChange = React__default["default"].useCallback((e, isArrowChange) => {
|
|
75
75
|
const value = utils.getFormattedDay(e.target.value);
|
|
76
76
|
const shouldAdvance = utils.getShouldShortcircuitDay(e.target.value);
|
|
77
77
|
setDay(value);
|
|
@@ -82,7 +82,7 @@ const DateInputs = ({
|
|
|
82
82
|
setOnChangeDateTrigger({});
|
|
83
83
|
}
|
|
84
84
|
}, []);
|
|
85
|
-
const onYearChange = React__default[
|
|
85
|
+
const onYearChange = React__default["default"].useCallback(e => {
|
|
86
86
|
const value = utils.getFormattedYear(e.target.value);
|
|
87
87
|
setYear(value);
|
|
88
88
|
setHaveInputsOnChangeTriggered(true);
|
|
@@ -92,7 +92,7 @@ const DateInputs = ({
|
|
|
92
92
|
// When component mounts haveInputsOnChangeTriggered is set to false
|
|
93
93
|
// so this is not triggered on mount but is triggered with all other changes
|
|
94
94
|
if (haveInputsOnChangeTriggered) {
|
|
95
|
-
const momentValue = moment__default[
|
|
95
|
+
const momentValue = moment__default["default"](`${month}${day}${year}`, FORMAT, true);
|
|
96
96
|
onChange(`${month}${day}${year}`, momentValue.isValid() ? momentValue : null);
|
|
97
97
|
}
|
|
98
98
|
}, [day, month, year]);
|
|
@@ -100,7 +100,7 @@ const DateInputs = ({
|
|
|
100
100
|
triggerOnDateChange();
|
|
101
101
|
}, [onChangeDateTrigger]);
|
|
102
102
|
React.useEffect(() => {
|
|
103
|
-
if (time && time !== `${month}${day}${year}` && moment__default[
|
|
103
|
+
if (time && time !== `${month}${day}${year}` && moment__default["default"](time, 'MMDDYYYY').isValid()) {
|
|
104
104
|
const values = String(time || '');
|
|
105
105
|
if (values.slice(0, 2)) setMonth(values.slice(0, 2));
|
|
106
106
|
if (values.slice(2, 4)) setDay(values.slice(2, 4));
|
|
@@ -185,14 +185,14 @@ const DateInputs = ({
|
|
|
185
185
|
|
|
186
186
|
const renderDateInputs = () => {
|
|
187
187
|
const inputs = [renderMonthInput(), renderDayInput(), renderYearInput()];
|
|
188
|
-
const inputsWithDividers = inputs.reduce((acc, input, index) => input ? acc.concat([index ? _DateInputDivider || (_DateInputDivider = /*#__PURE__*/_jsx__default[
|
|
189
|
-
return [inputsWithDividers, /*#__PURE__*/React__default[
|
|
188
|
+
const inputsWithDividers = inputs.reduce((acc, input, index) => input ? acc.concat([index ? _DateInputDivider || (_DateInputDivider = /*#__PURE__*/_jsx__default["default"](styled.DateInputDivider, {}, void 0, "/")) : null, input]) : acc, []);
|
|
189
|
+
return [inputsWithDividers, /*#__PURE__*/React__default["default"].createElement('span', {
|
|
190
190
|
key: 'span'
|
|
191
191
|
}) // hack for next/prev focus
|
|
192
192
|
];
|
|
193
193
|
};
|
|
194
194
|
|
|
195
|
-
return /*#__PURE__*/_jsx__default[
|
|
195
|
+
return /*#__PURE__*/_jsx__default["default"](styled.DateInputFluidContainer, {
|
|
196
196
|
onClick: handleFluidClick,
|
|
197
197
|
"data-testid": "date-input-fluidContainer"
|
|
198
198
|
}, void 0, /*#__PURE__*/jsxRuntime.jsx(styled.DateInputWrapper, {
|
|
@@ -9,24 +9,24 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
9
9
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
10
10
|
|
|
11
11
|
const DateInputsPropTypes = {
|
|
12
|
-
innerRef: PropTypes__default[
|
|
13
|
-
current: PropTypes__default[
|
|
12
|
+
innerRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].shape({
|
|
13
|
+
current: PropTypes__default["default"].any
|
|
14
14
|
})]),
|
|
15
|
-
onBlur: PropTypes__default[
|
|
16
|
-
onChange: PropTypes__default[
|
|
17
|
-
onDateChange: PropTypes__default[
|
|
18
|
-
onCustomKeyDown: PropTypes__default[
|
|
19
|
-
onError: PropTypes__default[
|
|
20
|
-
format: PropTypes__default[
|
|
21
|
-
showMonth: PropTypes__default[
|
|
22
|
-
showDay: PropTypes__default[
|
|
23
|
-
showYear: PropTypes__default[
|
|
24
|
-
step: PropTypes__default[
|
|
25
|
-
yearMaxRange: PropTypes__default[
|
|
26
|
-
disabled: PropTypes__default[
|
|
27
|
-
yearMinRange: PropTypes__default[
|
|
28
|
-
time: PropTypes__default[
|
|
29
|
-
tabIndex: PropTypes__default[
|
|
15
|
+
onBlur: PropTypes__default["default"].func,
|
|
16
|
+
onChange: PropTypes__default["default"].func,
|
|
17
|
+
onDateChange: PropTypes__default["default"].func,
|
|
18
|
+
onCustomKeyDown: PropTypes__default["default"].func,
|
|
19
|
+
onError: PropTypes__default["default"].func,
|
|
20
|
+
format: PropTypes__default["default"].string,
|
|
21
|
+
showMonth: PropTypes__default["default"].bool,
|
|
22
|
+
showDay: PropTypes__default["default"].bool,
|
|
23
|
+
showYear: PropTypes__default["default"].bool,
|
|
24
|
+
step: PropTypes__default["default"].number,
|
|
25
|
+
yearMaxRange: PropTypes__default["default"].number,
|
|
26
|
+
disabled: PropTypes__default["default"].bool,
|
|
27
|
+
yearMinRange: PropTypes__default["default"].number,
|
|
28
|
+
time: PropTypes__default["default"].string,
|
|
29
|
+
tabIndex: PropTypes__default["default"].oneOfType([PropTypes__default["default"].number, PropTypes__default["default"].string])
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
exports.DateInputsPropTypes = DateInputsPropTypes;
|
|
@@ -9,10 +9,10 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
9
9
|
|
|
10
10
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
11
11
|
|
|
12
|
-
const DateInputFluidContainer = /*#__PURE__*/styled__default[
|
|
12
|
+
const DateInputFluidContainer = /*#__PURE__*/styled__default["default"](dsGrid.Grid).withConfig({
|
|
13
13
|
componentId: "sc-ads423-0"
|
|
14
14
|
})(["width:100%;height:100%;align-items:center;"]);
|
|
15
|
-
const DateInputWrapper = /*#__PURE__*/styled__default[
|
|
15
|
+
const DateInputWrapper = /*#__PURE__*/styled__default["default"](dsGrid.Grid).withConfig({
|
|
16
16
|
componentId: "sc-ads423-1"
|
|
17
17
|
})(["align-items:center;align-content:center;", " width:102px;&:focus{outline-style:none;box-shadow:none;border-color:transparent;}"], ({
|
|
18
18
|
disabled,
|
|
@@ -21,7 +21,7 @@ const DateInputWrapper = /*#__PURE__*/styled__default['default'](dsGrid.Grid).wi
|
|
|
21
21
|
background: ${theme.colors.neutral[100]};
|
|
22
22
|
color: ${theme.colors.neutral[500]};
|
|
23
23
|
` : '');
|
|
24
|
-
const DateInputInput = /*#__PURE__*/styled__default[
|
|
24
|
+
const DateInputInput = /*#__PURE__*/styled__default["default"].input.withConfig({
|
|
25
25
|
componentId: "sc-ads423-2"
|
|
26
26
|
})(["outline:none;border:none;border-radius:0;width:", ";height:", ";", " padding-left:4px;padding-right:0px;&::placeholder{font-size:95%;font-style:italic;}:-moz-placeholder{font-size:95%;font-style:italic;}::-moz-placeholder{font-size:95%;font-style:italic;}&:focus{background:", ";background-clip:content-box;}::-moz-selection{background:transparent;}::selection{background:transparent;}"], props => props.size === 'l' ? '38px' : '25px', props => props.theme.space.xs, ({
|
|
27
27
|
disabled,
|
|
@@ -32,7 +32,7 @@ const DateInputInput = /*#__PURE__*/styled__default['default'].input.withConfig(
|
|
|
32
32
|
` : '', ({
|
|
33
33
|
theme
|
|
34
34
|
}) => theme.colors.brand['300']);
|
|
35
|
-
const DateInputDivider = /*#__PURE__*/styled__default[
|
|
35
|
+
const DateInputDivider = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
36
36
|
componentId: "sc-ads423-3"
|
|
37
37
|
})(["padding:1px;text-align:center;"]);
|
|
38
38
|
|
|
@@ -204,7 +204,7 @@ const commonInputProps = (digits = 2, onKeyDown, placeholder) => {
|
|
|
204
204
|
};
|
|
205
205
|
const handleCompletedDate = (time, date, show, INTERNAL_V2_NO_MUTATION) => {
|
|
206
206
|
// clone time to avoid mutation when INTERNAL_V2_NO_MUTATION is true
|
|
207
|
-
const newDate = INTERNAL_V2_NO_MUTATION ? time && moment__default[
|
|
207
|
+
const newDate = INTERNAL_V2_NO_MUTATION ? time && moment__default["default"](time) || moment__default["default"]() : time || moment__default["default"]();
|
|
208
208
|
const {
|
|
209
209
|
year,
|
|
210
210
|
month,
|
package/cjs/DateInputV2/index.js
CHANGED
|
@@ -10,4 +10,4 @@ var DSDateInput = require('./components/DSDateInput.js');
|
|
|
10
10
|
exports.DateInputsV2Impl = DateInputs.DateInputs;
|
|
11
11
|
exports.DSDateInputV2 = DSDateInput.DSDateInputV2;
|
|
12
12
|
exports.DSDateInputV2WithSchema = DSDateInput.DSDateInputV2WithSchema;
|
|
13
|
-
exports
|
|
13
|
+
exports["default"] = DSDateInput.DSDateInputV2;
|
|
@@ -20,7 +20,7 @@ const DSExpandableInput = ({
|
|
|
20
20
|
onClose = () => null,
|
|
21
21
|
onBlur = () => null,
|
|
22
22
|
width = undefined
|
|
23
|
-
}) => /*#__PURE__*/_jsx__default[
|
|
23
|
+
}) => /*#__PURE__*/_jsx__default["default"](ExpandableInputImpl, {
|
|
24
24
|
className: className,
|
|
25
25
|
containerProps: containerProps,
|
|
26
26
|
innerRef: innerRef,
|
|
@@ -18,7 +18,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
18
18
|
|
|
19
19
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
20
20
|
|
|
21
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default[
|
|
21
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
22
22
|
const blockName = 'expandable-input';
|
|
23
23
|
const ExpandableInput = dsClassnames.aggregatedClasses('div')(blockName, null, ({
|
|
24
24
|
isOpen
|
|
@@ -54,7 +54,7 @@ class ExpandableInputImpl extends React.Component {
|
|
|
54
54
|
onBlur,
|
|
55
55
|
containerProps
|
|
56
56
|
} = this.props;
|
|
57
|
-
const InputComponent = React__default[
|
|
57
|
+
const InputComponent = React__default["default"].Children.only(children);
|
|
58
58
|
|
|
59
59
|
const handleTriggerClick = e => {
|
|
60
60
|
if (utils.isFunction(triggerComponent.onClick)) triggerComponent.onClick(e);
|
|
@@ -74,7 +74,7 @@ class ExpandableInputImpl extends React.Component {
|
|
|
74
74
|
style: {
|
|
75
75
|
width: isOpen && width
|
|
76
76
|
},
|
|
77
|
-
children: /*#__PURE__*/_jsx__default[
|
|
77
|
+
children: /*#__PURE__*/_jsx__default["default"](InputWrapper, {
|
|
78
78
|
rightComponents: [/*#__PURE__*/React.cloneElement(triggerComponent, {
|
|
79
79
|
key: 'handler',
|
|
80
80
|
onClick: handleTriggerClick
|
|
@@ -40,7 +40,7 @@ const DSFloatingLabelInput = ({
|
|
|
40
40
|
*
|
|
41
41
|
* @type {element}
|
|
42
42
|
*/
|
|
43
|
-
inputComponent = DSTextBox[
|
|
43
|
+
inputComponent = DSTextBox["default"],
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* Input value
|
|
@@ -109,7 +109,7 @@ const DSFloatingLabelInput = ({
|
|
|
109
109
|
optional = false,
|
|
110
110
|
mask = null,
|
|
111
111
|
useSubfix = ''
|
|
112
|
-
}) => /*#__PURE__*/_jsx__default[
|
|
112
|
+
}) => /*#__PURE__*/_jsx__default["default"](FloatingLabelInputImpl, {
|
|
113
113
|
arialLabel: arialLabel,
|
|
114
114
|
className: className,
|
|
115
115
|
disabled: disabled,
|
|
@@ -20,7 +20,7 @@ var DSTextWrapper__default = /*#__PURE__*/_interopDefaultLegacy(DSTextWrapper);
|
|
|
20
20
|
|
|
21
21
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
22
22
|
|
|
23
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default[
|
|
23
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
24
24
|
const blockName = 'labeled-outline';
|
|
25
25
|
const Wrapper = dsClassnames.aggregatedClasses('div')(blockName, null, ({
|
|
26
26
|
isOpen
|
|
@@ -46,14 +46,14 @@ class FloatingLabelInputImpl extends React.Component {
|
|
|
46
46
|
constructor(props) {
|
|
47
47
|
super(props);
|
|
48
48
|
|
|
49
|
-
_defineProperty__default[
|
|
49
|
+
_defineProperty__default["default"](this, "resizeObserver", new resizeObserver.ResizeObserver(() => this.updatePath()));
|
|
50
50
|
|
|
51
|
-
_defineProperty__default[
|
|
51
|
+
_defineProperty__default["default"](this, "prevSizes", {});
|
|
52
52
|
|
|
53
|
-
this.wrapperRef = /*#__PURE__*/React__default[
|
|
54
|
-
this.outlinePathRef = /*#__PURE__*/React__default[
|
|
55
|
-
this.outlineIdleRef = /*#__PURE__*/React__default[
|
|
56
|
-
this.labelRef = /*#__PURE__*/React__default[
|
|
53
|
+
this.wrapperRef = /*#__PURE__*/React__default["default"].createRef();
|
|
54
|
+
this.outlinePathRef = /*#__PURE__*/React__default["default"].createRef();
|
|
55
|
+
this.outlineIdleRef = /*#__PURE__*/React__default["default"].createRef();
|
|
56
|
+
this.labelRef = /*#__PURE__*/React__default["default"].createRef();
|
|
57
57
|
this.updatePath = this.updatePath.bind(this);
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -155,9 +155,9 @@ class FloatingLabelInputImpl extends React.Component {
|
|
|
155
155
|
useSubfix
|
|
156
156
|
}, extraInputProps);
|
|
157
157
|
|
|
158
|
-
const InputComponent = getComponentFromProps__default[
|
|
158
|
+
const InputComponent = getComponentFromProps__default["default"](inputComponent, inputProps);
|
|
159
159
|
const isOpen = this.isOpened;
|
|
160
|
-
return /*#__PURE__*/_jsx__default[
|
|
160
|
+
return /*#__PURE__*/_jsx__default["default"](Wrapper, {
|
|
161
161
|
classProps: {
|
|
162
162
|
hasError,
|
|
163
163
|
isOpen,
|
|
@@ -169,27 +169,27 @@ class FloatingLabelInputImpl extends React.Component {
|
|
|
169
169
|
onFocus: () => null,
|
|
170
170
|
onMouseOut: this.handleMouseOut,
|
|
171
171
|
onMouseOver: this.handleMouseOver
|
|
172
|
-
}, void 0, InputComponent, /*#__PURE__*/_jsx__default[
|
|
172
|
+
}, void 0, InputComponent, /*#__PURE__*/_jsx__default["default"](FloatingLabel, {
|
|
173
173
|
classProps: {
|
|
174
174
|
isOpen
|
|
175
175
|
},
|
|
176
176
|
innerRef: this.labelRef
|
|
177
|
-
}, void 0, /*#__PURE__*/_jsx__default[
|
|
177
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](DSTextWrapper__default["default"], {
|
|
178
178
|
maxWidth: "100%",
|
|
179
179
|
text: labelText
|
|
180
|
-
}), /*#__PURE__*/_jsx__default[
|
|
180
|
+
}), /*#__PURE__*/_jsx__default["default"](RequiredMark, {
|
|
181
181
|
optional: optional,
|
|
182
182
|
required: required
|
|
183
|
-
})), /*#__PURE__*/_jsx__default[
|
|
183
|
+
})), /*#__PURE__*/_jsx__default["default"](Outline, {}, void 0, /*#__PURE__*/_jsx__default["default"]("svg", {}, void 0, /*#__PURE__*/_jsx__default["default"](OutlinePath, {
|
|
184
184
|
innerRef: this.outlinePathRef
|
|
185
|
-
}))), /*#__PURE__*/_jsx__default[
|
|
185
|
+
}))), /*#__PURE__*/_jsx__default["default"](OutlineIdle, {
|
|
186
186
|
innerRef: this.outlineIdleRef
|
|
187
187
|
}));
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
_defineProperty__default[
|
|
192
|
+
_defineProperty__default["default"](FloatingLabelInputImpl, "defaultProps", {
|
|
193
193
|
onChange: () => null
|
|
194
194
|
});
|
|
195
195
|
|