@elliemae/ds-controlled-form 2.4.2-rc.12 → 2.4.2-rc.13
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/autocomplete/config/useAutocomplete.js +0 -1
- package/cjs/autocomplete/parts/A11yFocusedOption.js +9 -6
- package/cjs/autocomplete/parts/container/Container.js +1 -1
- package/cjs/autocomplete/parts/container/useKeyboardNavigation.js +2 -2
- package/cjs/autocomplete/parts/menu-list/MenuList.js +3 -5
- package/cjs/autocomplete/parts/menu-list/styled.js +2 -2
- package/cjs/autocomplete/parts/menu-list/useItemRenderer.js +1 -1
- package/cjs/checkbox/config/useValidateProps.js +6 -3
- package/cjs/checkbox/styles.js +72 -28
- package/cjs/checkbox/utils/styleHelpers.js +20 -2
- package/cjs/combobox/config/useComboBox.js +1 -2
- package/cjs/combobox/config/useCorrectOptions.js +1 -2
- package/cjs/combobox/parts/A11yFocusedOption.js +4 -4
- package/cjs/combobox/parts/A11ySelectedValues.js +2 -2
- package/cjs/combobox/parts/DropdownIndicator.js +13 -5
- package/cjs/combobox/parts/container/Container.js +1 -1
- package/cjs/combobox/parts/container/styled.js +11 -10
- package/cjs/combobox/parts/controls/Controls.js +3 -9
- package/cjs/combobox/parts/controls/styled.js +54 -22
- package/cjs/combobox/parts/controls/useOnPillsNavigation.js +4 -12
- package/cjs/combobox/parts/controls-input/styled.js +41 -11
- package/cjs/combobox/parts/controls-input/useControlsInput.js +1 -5
- package/cjs/combobox/parts/controls-input/useKeyboardNavigation.js +4 -6
- package/cjs/combobox/parts/controls-input/useMaskedOnChange.js +1 -1
- package/cjs/combobox/parts/header-list/HeaderList.js +1 -1
- package/cjs/combobox/parts/header-list/styled.js +39 -10
- package/cjs/combobox/parts/header-list/useHeaderListHandlers.js +4 -11
- package/cjs/combobox/parts/menu-list/MenuList.js +2 -2
- package/cjs/combobox/parts/menu-list/styled.js +37 -21
- package/cjs/combobox/parts/menu-list/useItemRenderer.js +3 -3
- package/cjs/combobox/parts/multi-selected-values-container/MultiSelectedValuesContainer.js +1 -1
- package/cjs/combobox/parts/multi-selected-values-container/RemovableSelectedValuePill.js +1 -3
- package/cjs/combobox/parts/multi-selected-values-container/useGroupPills.js +1 -2
- package/cjs/combobox/parts/styled.js +6 -7
- package/cjs/combobox/sharedTypes.js +2 -2
- package/cjs/combobox/utils/listHelper.js +4 -9
- package/cjs/date-range-picker/config/useRangePickerLogic.js +4 -8
- package/cjs/date-range-picker/parts/ControlledDateRangeCalendar.js +0 -2
- package/cjs/date-range-picker/parts/ControlledDateRangeFromDate.js +0 -2
- package/cjs/date-range-picker/parts/ControlledDateRangeToDate.js +0 -2
- package/cjs/date-time-picker/config/useChangeHandlers.js +3 -3
- package/cjs/date-time-picker/config/useControlledDateTimePicker.js +1 -1
- package/cjs/date-time-picker/config/useFocusTracker.js +1 -1
- package/cjs/date-time-picker/config/useGetDestructuredValues.js +6 -6
- package/cjs/date-time-picker/config/useGetPropsBasedOnType.js +1 -1
- package/cjs/date-time-picker/config/useGetReferences.js +1 -1
- package/cjs/date-time-picker/config/useRelevantValueFromProps.js +1 -1
- package/cjs/date-time-picker/config/useValidateProps.js +42 -11
- package/cjs/date-time-picker/parts/ClearButton/ClearButton.js +1 -3
- package/cjs/date-time-picker/parts/DateInputs/DDInput.js +3 -7
- package/cjs/date-time-picker/parts/DateInputs/MMInput.js +3 -7
- package/cjs/date-time-picker/parts/DateInputs/YYYYInput.js +3 -7
- package/cjs/date-time-picker/parts/DateInputs/useDateInputs.js +13 -23
- package/cjs/date-time-picker/parts/Pickers/Calendar/CalendarDaysList.js +4 -4
- package/cjs/date-time-picker/parts/Pickers/Calendar/CalendarHead.js +6 -14
- package/cjs/date-time-picker/parts/Pickers/Calendar/CalendarIconTrigger.js +1 -1
- package/cjs/date-time-picker/parts/Pickers/Calendar/Day.js +8 -10
- package/cjs/date-time-picker/parts/Pickers/Calendar/Styleds.js +44 -15
- package/cjs/date-time-picker/parts/Pickers/Calendar/useConfigCalendarCTX.js +1 -2
- package/cjs/date-time-picker/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js +2 -1
- package/cjs/date-time-picker/parts/Pickers/Calendar/useFocusLogic.js +0 -1
- package/cjs/date-time-picker/parts/Pickers/Calendar/usePopperTriggerLogic.js +3 -5
- package/cjs/date-time-picker/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +1 -1
- package/cjs/date-time-picker/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js +3 -5
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/HoursList.js +5 -7
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/MeridiemList.js +6 -8
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/MinutesList.js +5 -7
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/SecondsList.js +2 -2
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/Styleds.js +47 -15
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/TimeWheelContent.js +1 -1
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +1 -1
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js +3 -3
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +2 -5
- package/cjs/date-time-picker/parts/Styleds.js +12 -6
- package/cjs/date-time-picker/parts/TimeInputs/HHInput.js +2 -4
- package/cjs/date-time-picker/parts/TimeInputs/MeridiemInput.js +3 -8
- package/cjs/date-time-picker/parts/TimeInputs/MinutesInput.js +3 -7
- package/cjs/date-time-picker/parts/TimeInputs/useTimeInputs.js +14 -26
- package/cjs/date-time-picker/utils/dateHelpers.js +17 -34
- package/cjs/date-time-picker/utils/hooks/useOnClickOutside.js +1 -3
- package/cjs/date-time-picker/utils/stringHelpers.js +5 -11
- package/cjs/input-group/styled.js +79 -13
- package/cjs/large-text-input/DSControlledLargeTextInput.js +1 -1
- package/cjs/large-text-input/styles.js +27 -13
- package/cjs/mask-hook/hooks/useNumberMask.js +1 -5
- package/cjs/mask-hook/hooks/usePhoneMask.js +1 -4
- package/cjs/mask-hook/hooks/useRegExpMask.js +4 -7
- package/cjs/mask-hook/hooks/useSSNMask.js +1 -4
- package/cjs/mask-hook/hooks/useZipCodeMask.js +1 -4
- package/cjs/mask-hook/utils/addSpecialCharacters.js +0 -1
- package/cjs/mask-hook/utils/flatStringArray.js +0 -1
- package/cjs/text-input/config/useInputText.js +0 -1
- package/cjs/text-input/styled/borders.js +18 -11
- package/cjs/text-input/styled/components.js +49 -10
- package/cjs/toggle/ControlledToggle.js +2 -3
- package/cjs/toggle/styles.js +7 -5
- package/esm/autocomplete/config/useAutocomplete.js +0 -1
- package/esm/autocomplete/parts/A11yFocusedOption.js +9 -5
- package/esm/autocomplete/parts/container/Container.js +1 -1
- package/esm/autocomplete/parts/container/useKeyboardNavigation.js +2 -2
- package/esm/autocomplete/parts/menu-list/MenuList.js +3 -5
- package/esm/autocomplete/parts/menu-list/styled.js +2 -2
- package/esm/autocomplete/parts/menu-list/useItemRenderer.js +1 -1
- package/esm/checkbox/config/useValidateProps.js +6 -3
- package/esm/checkbox/styles.js +72 -24
- package/esm/checkbox/utils/styleHelpers.js +20 -2
- package/esm/combobox/config/useComboBox.js +0 -1
- package/esm/combobox/config/useCorrectOptions.js +1 -2
- package/esm/combobox/parts/A11yFocusedOption.js +4 -4
- package/esm/combobox/parts/A11ySelectedValues.js +2 -2
- package/esm/combobox/parts/DropdownIndicator.js +13 -4
- package/esm/combobox/parts/container/Container.js +1 -1
- package/esm/combobox/parts/container/styled.js +11 -6
- package/esm/combobox/parts/controls/Controls.js +3 -9
- package/esm/combobox/parts/controls/styled.js +54 -18
- package/esm/combobox/parts/controls/useOnPillsNavigation.js +4 -12
- package/esm/combobox/parts/controls-input/styled.js +41 -7
- package/esm/combobox/parts/controls-input/useControlsInput.js +1 -5
- package/esm/combobox/parts/controls-input/useKeyboardNavigation.js +4 -6
- package/esm/combobox/parts/controls-input/useMaskedOnChange.js +1 -1
- package/esm/combobox/parts/header-list/HeaderList.js +1 -1
- package/esm/combobox/parts/header-list/styled.js +40 -7
- package/esm/combobox/parts/header-list/useHeaderListHandlers.js +4 -11
- package/esm/combobox/parts/menu-list/MenuList.js +2 -2
- package/esm/combobox/parts/menu-list/styled.js +37 -17
- package/esm/combobox/parts/menu-list/useItemRenderer.js +3 -3
- package/esm/combobox/parts/multi-selected-values-container/MultiSelectedValuesContainer.js +1 -1
- package/esm/combobox/parts/multi-selected-values-container/RemovableSelectedValuePill.js +1 -3
- package/esm/combobox/parts/multi-selected-values-container/useGroupPills.js +1 -2
- package/esm/combobox/parts/styled.js +6 -3
- package/esm/combobox/sharedTypes.js +2 -2
- package/esm/combobox/utils/listHelper.js +4 -9
- package/esm/date-range-picker/config/useRangePickerLogic.js +3 -7
- package/esm/date-range-picker/parts/ControlledDateRangeCalendar.js +0 -2
- package/esm/date-range-picker/parts/ControlledDateRangeFromDate.js +0 -2
- package/esm/date-range-picker/parts/ControlledDateRangeToDate.js +0 -2
- package/esm/date-time-picker/config/useChangeHandlers.js +3 -3
- package/esm/date-time-picker/config/useControlledDateTimePicker.js +1 -1
- package/esm/date-time-picker/config/useFocusTracker.js +1 -1
- package/esm/date-time-picker/config/useGetDestructuredValues.js +6 -6
- package/esm/date-time-picker/config/useGetPropsBasedOnType.js +1 -1
- package/esm/date-time-picker/config/useGetReferences.js +1 -1
- package/esm/date-time-picker/config/useRelevantValueFromProps.js +1 -1
- package/esm/date-time-picker/config/useValidateProps.js +42 -11
- package/esm/date-time-picker/parts/ClearButton/ClearButton.js +1 -3
- package/esm/date-time-picker/parts/DateInputs/DDInput.js +3 -7
- package/esm/date-time-picker/parts/DateInputs/MMInput.js +3 -7
- package/esm/date-time-picker/parts/DateInputs/YYYYInput.js +3 -7
- package/esm/date-time-picker/parts/DateInputs/useDateInputs.js +13 -23
- package/esm/date-time-picker/parts/Pickers/Calendar/CalendarDaysList.js +4 -4
- package/esm/date-time-picker/parts/Pickers/Calendar/CalendarHead.js +6 -14
- package/esm/date-time-picker/parts/Pickers/Calendar/CalendarIconTrigger.js +1 -1
- package/esm/date-time-picker/parts/Pickers/Calendar/Day.js +8 -10
- package/esm/date-time-picker/parts/Pickers/Calendar/Styleds.js +44 -14
- package/esm/date-time-picker/parts/Pickers/Calendar/useConfigCalendarCTX.js +0 -1
- package/esm/date-time-picker/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js +2 -1
- package/esm/date-time-picker/parts/Pickers/Calendar/useFocusLogic.js +0 -1
- package/esm/date-time-picker/parts/Pickers/Calendar/usePopperTriggerLogic.js +3 -5
- package/esm/date-time-picker/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +1 -1
- package/esm/date-time-picker/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js +3 -5
- package/esm/date-time-picker/parts/Pickers/TimeWheel/HoursList.js +5 -7
- package/esm/date-time-picker/parts/Pickers/TimeWheel/MeridiemList.js +6 -8
- package/esm/date-time-picker/parts/Pickers/TimeWheel/MinutesList.js +5 -7
- package/esm/date-time-picker/parts/Pickers/TimeWheel/SecondsList.js +2 -2
- package/esm/date-time-picker/parts/Pickers/TimeWheel/Styleds.js +47 -14
- package/esm/date-time-picker/parts/Pickers/TimeWheel/TimeWheelContent.js +1 -1
- package/esm/date-time-picker/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +1 -1
- package/esm/date-time-picker/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js +3 -3
- package/esm/date-time-picker/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +2 -5
- package/esm/date-time-picker/parts/Styleds.js +12 -6
- package/esm/date-time-picker/parts/TimeInputs/HHInput.js +2 -4
- package/esm/date-time-picker/parts/TimeInputs/MeridiemInput.js +3 -8
- package/esm/date-time-picker/parts/TimeInputs/MinutesInput.js +3 -7
- package/esm/date-time-picker/parts/TimeInputs/useTimeInputs.js +14 -26
- package/esm/date-time-picker/utils/dateHelpers.js +17 -34
- package/esm/date-time-picker/utils/hooks/useOnClickOutside.js +1 -3
- package/esm/date-time-picker/utils/stringHelpers.js +5 -11
- package/esm/input-group/styled.js +79 -9
- package/esm/large-text-input/DSControlledLargeTextInput.js +1 -1
- package/esm/large-text-input/styles.js +27 -9
- package/esm/mask-hook/hooks/useNumberMask.js +1 -5
- package/esm/mask-hook/hooks/usePhoneMask.js +1 -4
- package/esm/mask-hook/hooks/useRegExpMask.js +4 -7
- package/esm/mask-hook/hooks/useSSNMask.js +1 -4
- package/esm/mask-hook/hooks/useZipCodeMask.js +1 -4
- package/esm/mask-hook/utils/addSpecialCharacters.js +0 -1
- package/esm/mask-hook/utils/flatStringArray.js +0 -1
- package/esm/text-input/config/useInputText.js +0 -1
- package/esm/text-input/styled/borders.js +18 -7
- package/esm/text-input/styled/components.js +49 -6
- package/esm/toggle/ControlledToggle.js +0 -1
- package/esm/toggle/styles.js +7 -5
- package/package.json +15 -15
- package/types/text-input/config/useInputText.d.ts +3 -3
|
@@ -1,42 +1,33 @@
|
|
|
1
1
|
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
2
2
|
import 'core-js/modules/esnext.iterator.map.js';
|
|
3
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
4
3
|
import { createRef } from 'react';
|
|
5
4
|
import { monthNames } from './constants.js';
|
|
6
5
|
import { prependStringWithPlaceHolders, deconstructValuesFromDateString, isIncompleteString } from './stringHelpers.js';
|
|
7
6
|
import { convertToPositiveNumberIfPossible } from './numberHelpers.js';
|
|
8
7
|
|
|
9
|
-
const getDateValuesFromDate = day => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
day: day === null || day === void 0 ? void 0 : (_day$getDate = day.getDate) === null || _day$getDate === void 0 ? void 0 : _day$getDate.call(day),
|
|
15
|
-
year: day === null || day === void 0 ? void 0 : (_day$getFullYear = day.getFullYear) === null || _day$getFullYear === void 0 ? void 0 : _day$getFullYear.call(day)
|
|
16
|
-
};
|
|
17
|
-
};
|
|
8
|
+
const getDateValuesFromDate = day => ({
|
|
9
|
+
month: day?.getMonth?.(),
|
|
10
|
+
day: day?.getDate?.(),
|
|
11
|
+
year: day?.getFullYear?.()
|
|
12
|
+
});
|
|
18
13
|
const getDateStringFromDay = day => {
|
|
19
|
-
const monthFromDay = prependStringWithPlaceHolders(
|
|
14
|
+
const monthFromDay = prependStringWithPlaceHolders(`${day.getMonth() + 1}`, 2); // months from 1-12
|
|
20
15
|
|
|
21
|
-
const dayFromDay = prependStringWithPlaceHolders(
|
|
22
|
-
const yearFromDay = prependStringWithPlaceHolders(
|
|
23
|
-
return
|
|
16
|
+
const dayFromDay = prependStringWithPlaceHolders(`${day.getDate()}`, 2);
|
|
17
|
+
const yearFromDay = prependStringWithPlaceHolders(`${day.getFullYear()}`, 4);
|
|
18
|
+
return `${monthFromDay}/${dayFromDay}/${yearFromDay}`;
|
|
24
19
|
};
|
|
25
20
|
const getTimeStringFromDay = day => {
|
|
26
21
|
const hoursNum = day.getHours();
|
|
27
22
|
const meridiem = hoursNum > 12 ? 'PM' : 'AM';
|
|
28
23
|
const twelveHourFormat = hoursNum > 12 ? hoursNum - 12 : hoursNum;
|
|
29
24
|
const minutesNum = day.getMinutes();
|
|
30
|
-
const hoursFromDay = prependStringWithPlaceHolders(
|
|
31
|
-
const minutesFromDay = prependStringWithPlaceHolders(
|
|
32
|
-
return
|
|
25
|
+
const hoursFromDay = prependStringWithPlaceHolders(`${twelveHourFormat}`, 2);
|
|
26
|
+
const minutesFromDay = prependStringWithPlaceHolders(`${minutesNum}`, 2);
|
|
27
|
+
return `${hoursFromDay}:${minutesFromDay} ${meridiem}`;
|
|
33
28
|
};
|
|
34
29
|
const getMonthNameByMonthNumber = monthNumber => monthNames[monthNumber];
|
|
35
|
-
const isSameDateMoment = (dateA, dateB) =>
|
|
36
|
-
var _dateA$getTime, _dateB$getTime;
|
|
37
|
-
|
|
38
|
-
return (dateA === null || dateA === void 0 ? void 0 : (_dateA$getTime = dateA.getTime) === null || _dateA$getTime === void 0 ? void 0 : _dateA$getTime.call(dateA)) === (dateB === null || dateB === void 0 ? void 0 : (_dateB$getTime = dateB.getTime) === null || _dateB$getTime === void 0 ? void 0 : _dateB$getTime.call(dateB));
|
|
39
|
-
};
|
|
30
|
+
const isSameDateMoment = (dateA, dateB) => dateA?.getTime?.() === dateB?.getTime?.();
|
|
40
31
|
const compareTwoDatesDayEquality = (dayA, dayB) => {
|
|
41
32
|
const {
|
|
42
33
|
day: currD,
|
|
@@ -51,11 +42,7 @@ const compareTwoDatesDayEquality = (dayA, dayB) => {
|
|
|
51
42
|
return currD === focusD && currM === focusM && currY === focusY;
|
|
52
43
|
};
|
|
53
44
|
const getLastDayOfMonth = (month, year) => new Date(year, month + 1, 0);
|
|
54
|
-
const isValidDayForTheMonth = (month, year, day) =>
|
|
55
|
-
var _Date, _Date$getMonth;
|
|
56
|
-
|
|
57
|
-
return ((_Date = new Date(year, month, day)) === null || _Date === void 0 ? void 0 : (_Date$getMonth = _Date.getMonth) === null || _Date$getMonth === void 0 ? void 0 : _Date$getMonth.call(_Date)) === month;
|
|
58
|
-
};
|
|
45
|
+
const isValidDayForTheMonth = (month, year, day) => new Date(year, month, day)?.getMonth?.() === month;
|
|
59
46
|
const getDayFromDateString = dateString => {
|
|
60
47
|
const {
|
|
61
48
|
month,
|
|
@@ -69,8 +56,6 @@ const getDayFromDateString = dateString => {
|
|
|
69
56
|
return null;
|
|
70
57
|
};
|
|
71
58
|
const isValidDayForTheMonthDateString = dateString => {
|
|
72
|
-
var _getDayFromDateString, _getDayFromDateString2;
|
|
73
|
-
|
|
74
59
|
if (isIncompleteString(dateString)) return true;
|
|
75
60
|
const {
|
|
76
61
|
month
|
|
@@ -78,7 +63,7 @@ const isValidDayForTheMonthDateString = dateString => {
|
|
|
78
63
|
const monthInt = convertToPositiveNumberIfPossible(month);
|
|
79
64
|
if (monthInt === -1) return false;
|
|
80
65
|
const monthDateMonth = monthInt - 1;
|
|
81
|
-
return
|
|
66
|
+
return getDayFromDateString(dateString)?.getMonth?.() === monthDateMonth;
|
|
82
67
|
};
|
|
83
68
|
const getValidationDateStringMetaInfo = function (dateString) {
|
|
84
69
|
let getIsOutOfRangeDay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : day => false;
|
|
@@ -205,8 +190,6 @@ const getFirstXDaysFromNextMonth = (month, year, howMany) => {
|
|
|
205
190
|
return days;
|
|
206
191
|
};
|
|
207
192
|
const getFiveBySevenCurrentMonthDaysMatrix = (month, year) => {
|
|
208
|
-
var _currentMonthDays$, _currentMonthDays$$da, _currentMonthDays, _currentMonthDays$day;
|
|
209
|
-
|
|
210
193
|
const currentMonthDays = getDaysInMonth(month, year).map(day => ({
|
|
211
194
|
day,
|
|
212
195
|
dayAsString: getDateStringFromDay(day),
|
|
@@ -216,7 +199,7 @@ const getFiveBySevenCurrentMonthDaysMatrix = (month, year) => {
|
|
|
216
199
|
isHidden: false,
|
|
217
200
|
dayBtnRef: /*#__PURE__*/createRef()
|
|
218
201
|
}));
|
|
219
|
-
const firstDayOfTheMonthWeekDay = currentMonthDays
|
|
202
|
+
const firstDayOfTheMonthWeekDay = currentMonthDays?.[0]?.day?.getDay();
|
|
220
203
|
const previousMonthDaysToPrepend = getLastXDaysFromPreviousMonth(month, year, firstDayOfTheMonthWeekDay).map(day => ({
|
|
221
204
|
day,
|
|
222
205
|
dayAsString: getDateStringFromDay(day),
|
|
@@ -226,7 +209,7 @@ const getFiveBySevenCurrentMonthDaysMatrix = (month, year) => {
|
|
|
226
209
|
isHidden: false,
|
|
227
210
|
dayBtnRef: /*#__PURE__*/createRef()
|
|
228
211
|
}));
|
|
229
|
-
const lastDayOfTheMonthWeekDay = currentMonthDays
|
|
212
|
+
const lastDayOfTheMonthWeekDay = currentMonthDays?.[currentMonthDays.length - 1]?.day?.getDay();
|
|
230
213
|
const nextMonthDaysToAppend = getFirstXDaysFromNextMonth(month, year, 6 - lastDayOfTheMonthWeekDay).map(day => ({
|
|
231
214
|
day,
|
|
232
215
|
dayAsString: getDateStringFromDay(day),
|
|
@@ -3,10 +3,8 @@ import { useEffect } from 'react';
|
|
|
3
3
|
const useOnClickOutside = (ref, handler) => {
|
|
4
4
|
useEffect(() => {
|
|
5
5
|
const listener = event => {
|
|
6
|
-
var _ref$contains;
|
|
7
|
-
|
|
8
6
|
// Do nothing if clicking ref's element or descendent elements
|
|
9
|
-
if (event.target instanceof Element) if (!ref || ref
|
|
7
|
+
if (event.target instanceof Element) if (!ref || ref?.contains?.(event.target)) {
|
|
10
8
|
return;
|
|
11
9
|
}
|
|
12
10
|
handler(event);
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
2
2
|
import 'core-js/modules/esnext.iterator.map.js';
|
|
3
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
4
|
-
import 'core-js/modules/es.string.replace.js';
|
|
5
3
|
import { monthNames, announcableCardinalDays } from './constants.js';
|
|
6
4
|
import { convertToPositiveNumberIfPossible } from './numberHelpers.js';
|
|
7
5
|
|
|
@@ -27,13 +25,9 @@ const getFormattedDateString = _ref => {
|
|
|
27
25
|
const finalMonth = fillStringWithPlaceHolders(month, 2);
|
|
28
26
|
const finalDay = fillStringWithPlaceHolders(day, 2);
|
|
29
27
|
const finalYear = fillStringWithPlaceHolders(year, 4);
|
|
30
|
-
return
|
|
31
|
-
};
|
|
32
|
-
const dateTimeToDate = dateTime => {
|
|
33
|
-
var _dateTime$split, _dateTime$split$call;
|
|
34
|
-
|
|
35
|
-
return dateTime === null || dateTime === void 0 ? void 0 : (_dateTime$split = dateTime.split) === null || _dateTime$split === void 0 ? void 0 : (_dateTime$split$call = _dateTime$split.call(dateTime, ' ')) === null || _dateTime$split$call === void 0 ? void 0 : _dateTime$split$call[0];
|
|
28
|
+
return `${finalMonth}/${finalDay}/${finalYear}`;
|
|
36
29
|
};
|
|
30
|
+
const dateTimeToDate = dateTime => dateTime?.split?.(' ')?.[0];
|
|
37
31
|
const deconstructValuesFromDateString = dateString => {
|
|
38
32
|
const [dirtyMonth = '', dirtyDay = '', dirtyYear = ''] = dateString.split('/');
|
|
39
33
|
const replaceAllRegexp = /_/g;
|
|
@@ -79,13 +73,13 @@ const getFormattedTimeString = _ref2 => {
|
|
|
79
73
|
|
|
80
74
|
const finalMeridiem = fillStringWithPlaceHolders(meridiem, 2); // return `${finalHour}:${finalMinutes}:${finalSeconds} ${finalMeridiem}`;// <-- seconds format
|
|
81
75
|
|
|
82
|
-
return
|
|
76
|
+
return `${finalHour}:${finalMinutes} ${finalMeridiem}`;
|
|
83
77
|
};
|
|
84
78
|
const dateTimeToTime = dateTime => {
|
|
85
79
|
const [// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
86
80
|
date, // timeNumbers = '__:__:__', // <-- seconds format
|
|
87
81
|
timeNumbers = '__:__', timeMeridiem = '__'] = dateTime.split(' ');
|
|
88
|
-
return
|
|
82
|
+
return `${timeNumbers} ${timeMeridiem}`;
|
|
89
83
|
};
|
|
90
84
|
const deconstructTimeValues = timeString => {
|
|
91
85
|
const [dirtyTimes = '', dirtyMeridiem] = timeString.split(' '); // <--['__:__','__']
|
|
@@ -131,7 +125,7 @@ const getAriaDayFromDateString = dateString => {
|
|
|
131
125
|
const dayNum = convertToPositiveNumberIfPossible(dayString);
|
|
132
126
|
const yearNum = convertToPositiveNumberIfPossible(yearString);
|
|
133
127
|
if (monthNum === -1 || dayNum === -1 || yearNum === -1) return '';
|
|
134
|
-
return
|
|
128
|
+
return `${monthNames[monthNum - 1]} ${announcableCardinalDays[dayNum]} ${yearNum}`;
|
|
135
129
|
};
|
|
136
130
|
|
|
137
131
|
export { dateTimeToDate, dateTimeToTime, deconstructTimeValues, deconstructValuesFromDateString, deconstructValuesFromTimeString, fillStringWithPlaceHolders, getAriaDayFromDateString, getFormattedDateString, getFormattedTimeString, isEmptyDateStringMask, isEmptyDateTimeStringMask, isEmptyTimeStringMask, isIncompleteString, isValidDateString, isValidTimeString, prependStringWithPlaceHolders };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from '@babel/runtime/helpers/esm/taggedTemplateLiteral';
|
|
2
1
|
import { styled } from '@elliemae/ds-system';
|
|
3
2
|
import { Grid } from '@elliemae/ds-grid';
|
|
4
3
|
import '../text-input/DSInputText.js';
|
|
@@ -7,30 +6,101 @@ import '../combobox/ComboBox.js';
|
|
|
7
6
|
import { DSComboBoxName, DSComboboxSlots } from '../combobox/theming.js';
|
|
8
7
|
import { DSInputGroupName, DSInputGroupSlots } from './exported-related/theming.js';
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
11
10
|
const StyledContainer = styled(Grid, {
|
|
12
11
|
name: DSInputGroupName,
|
|
13
12
|
slot: DSInputGroupSlots.CONTAINER
|
|
14
|
-
})
|
|
15
|
-
|
|
13
|
+
})`
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 28px;
|
|
16
|
+
|
|
17
|
+
// input in left position with right addon
|
|
18
|
+
& > div:nth-child(1) {
|
|
19
|
+
.${DSInputTextName}-${DSInputTextSlots.INPUT_WRAPPER},
|
|
20
|
+
.${DSInputTextName}-${DSInputTextSlots.INPUT},
|
|
21
|
+
.${DSComboBoxName}-${DSComboboxSlots.INPUT_WRAPPER} {
|
|
22
|
+
border-top-right-radius: 0;
|
|
23
|
+
border-bottom-right-radius: 0;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// input in center position with left and right addon
|
|
28
|
+
& > div:nth-child(2):nth-last-child(2) {
|
|
29
|
+
.${DSInputTextName}-${DSInputTextSlots.INPUT_WRAPPER},
|
|
30
|
+
.${DSInputTextName}-${DSInputTextSlots.INPUT},
|
|
31
|
+
.${DSComboBoxName}-${DSComboboxSlots.INPUT_WRAPPER} {
|
|
32
|
+
border-radius: 0;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// input in right position with left addon
|
|
37
|
+
& > div:nth-child(2):nth-last-child(1) {
|
|
38
|
+
.${DSInputTextName}-${DSInputTextSlots.INPUT_WRAPPER},
|
|
39
|
+
.${DSInputTextName}-${DSInputTextSlots.INPUT},
|
|
40
|
+
.${DSComboBoxName}-${DSComboboxSlots.INPUT_WRAPPER} {
|
|
41
|
+
border-top-left-radius: 0;
|
|
42
|
+
border-bottom-left-radius: 0;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
const StyledAddon = styled.div`
|
|
47
|
+
outline: 1px solid ${_ref => {
|
|
16
48
|
let {
|
|
17
49
|
theme
|
|
18
50
|
} = _ref;
|
|
19
51
|
return theme.colors.neutral['400'];
|
|
20
|
-
}
|
|
52
|
+
}};
|
|
53
|
+
outline-offset: -1px;
|
|
54
|
+
height: inherit;
|
|
55
|
+
display: flex;
|
|
56
|
+
button {
|
|
57
|
+
border-width: 1px;
|
|
58
|
+
}
|
|
59
|
+
&:hover {
|
|
60
|
+
z-index: 2;
|
|
61
|
+
button:not(:disabled) {
|
|
62
|
+
border: 1px solid ${_ref2 => {
|
|
21
63
|
let {
|
|
22
64
|
theme
|
|
23
65
|
} = _ref2;
|
|
24
66
|
return theme.colors.brand['700'];
|
|
25
|
-
}
|
|
67
|
+
}};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
&:focus-within {
|
|
71
|
+
z-index: 2;
|
|
72
|
+
}
|
|
73
|
+
`;
|
|
26
74
|
const StyledLeftAddon = styled(StyledAddon, {
|
|
27
75
|
name: DSInputGroupName,
|
|
28
76
|
slot: DSInputGroupSlots.LEFT_ADDON
|
|
29
|
-
})
|
|
77
|
+
})`
|
|
78
|
+
border-top-left-radius: 2px;
|
|
79
|
+
border-bottom-left-radius: 2px;
|
|
80
|
+
margin-right: -1px;
|
|
81
|
+
&:hover {
|
|
82
|
+
button:not(:disabled) {
|
|
83
|
+
border-top-right-radius: 0px;
|
|
84
|
+
border-bottom-right-radius: 0px;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
`;
|
|
30
88
|
const StyledRightAddon = styled(StyledAddon, {
|
|
31
89
|
name: DSInputGroupName,
|
|
32
90
|
slot: DSInputGroupSlots.RIGHT_ADDON
|
|
33
|
-
})
|
|
34
|
-
|
|
91
|
+
})`
|
|
92
|
+
border-top-right-radius: 2px;
|
|
93
|
+
border-bottom-right-radius: 2px;
|
|
94
|
+
margin-left: -1px;
|
|
95
|
+
&:hover {
|
|
96
|
+
button:not(:disabled) {
|
|
97
|
+
border-top-left-radius: 0px;
|
|
98
|
+
border-bottom-left-radius: 0px;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
`;
|
|
102
|
+
const StyledInput = styled.div`
|
|
103
|
+
z-index: 1;
|
|
104
|
+
`;
|
|
35
105
|
|
|
36
106
|
export { StyledContainer, StyledInput, StyledLeftAddon, StyledRightAddon };
|
|
@@ -62,7 +62,7 @@ const DSControlledLargeTextInput = props => {
|
|
|
62
62
|
hasError: hasError
|
|
63
63
|
}, globalAttributes)), maxLength && !withoutCharacterCounter && /*#__PURE__*/_jsx(StyledCharCounter, {
|
|
64
64
|
"data-testid": DSControlledLargetTextInputDatatestids.CHAR_COUNTER
|
|
65
|
-
}, void 0,
|
|
65
|
+
}, void 0, `${value.length}/${maxLength}`)]
|
|
66
66
|
}));
|
|
67
67
|
};
|
|
68
68
|
|
|
@@ -1,30 +1,48 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from '@babel/runtime/helpers/esm/taggedTemplateLiteral';
|
|
2
1
|
import { styled } from '@elliemae/ds-system';
|
|
3
2
|
import { layout, space, sizing } from '@xstyled/styled-components';
|
|
4
3
|
import { DSControlledLargeTextInputName, DSControlledLargeTextInputSlots } from './exported-related/theming.js';
|
|
5
4
|
|
|
6
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
7
5
|
const StyledContainer = styled('div', {
|
|
8
6
|
name: DSControlledLargeTextInputName,
|
|
9
7
|
slot: DSControlledLargeTextInputSlots.CONTAINER
|
|
10
|
-
})
|
|
8
|
+
})`
|
|
9
|
+
display: grid;
|
|
10
|
+
grid-gap: 4px;
|
|
11
|
+
grid-template-rows: auto auto;
|
|
12
|
+
grid-template-columns: fit-content;
|
|
13
|
+
${layout}
|
|
14
|
+
${space}
|
|
15
|
+
${sizing}
|
|
16
|
+
`;
|
|
11
17
|
const StyledCharCounter = styled('span', {
|
|
12
18
|
name: DSControlledLargeTextInputName,
|
|
13
19
|
slot: DSControlledLargeTextInputSlots.CHAR_COUNTER
|
|
14
|
-
})
|
|
20
|
+
})`
|
|
21
|
+
justify-self: flex-end;
|
|
22
|
+
`;
|
|
15
23
|
const StyledTextArea = styled('textarea', {
|
|
16
24
|
name: DSControlledLargeTextInputName,
|
|
17
25
|
slot: DSControlledLargeTextInputSlots.INPUT
|
|
18
|
-
})
|
|
26
|
+
})`
|
|
27
|
+
width: 100%;
|
|
28
|
+
${_ref => {
|
|
19
29
|
let {
|
|
20
30
|
resizable
|
|
21
31
|
} = _ref;
|
|
22
|
-
return resizable ?
|
|
23
|
-
}
|
|
32
|
+
return resizable ? `` : `resize: none;`;
|
|
33
|
+
}}
|
|
34
|
+
&:disabled {
|
|
35
|
+
&:hover {
|
|
36
|
+
cursor: not-allowed;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
${_ref2 => {
|
|
24
41
|
let {
|
|
25
42
|
hasError
|
|
26
43
|
} = _ref2;
|
|
27
|
-
return hasError ?
|
|
28
|
-
}
|
|
44
|
+
return hasError ? `border: 1px solid red;` : ``;
|
|
45
|
+
}}
|
|
46
|
+
`;
|
|
29
47
|
|
|
30
48
|
export { StyledCharCounter, StyledContainer, StyledTextArea };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
2
|
-
import 'core-js/modules/es.string.replace.js';
|
|
3
2
|
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
4
3
|
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
5
4
|
import 'core-js/modules/esnext.iterator.filter.js';
|
|
6
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
7
5
|
import { useRef, useState, useCallback } from 'react';
|
|
8
6
|
import { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';
|
|
9
7
|
import { useCallbackAfterRender } from '@elliemae/ds-utilities';
|
|
@@ -141,9 +139,7 @@ const useNumberMask = props => {
|
|
|
141
139
|
if (userOnKeyDown) userOnKeyDown(e);
|
|
142
140
|
}, [userOnKeyDown]);
|
|
143
141
|
const onChange = useCallback(e => {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
const [mask, cursorPos] = conformValue(e.target.value, (_e$target$selectionEn = e.target.selectionEnd) !== null && _e$target$selectionEn !== void 0 ? _e$target$selectionEn : 0, lastKeyCode.current, opts);
|
|
142
|
+
const [mask, cursorPos] = conformValue(e.target.value, e.target.selectionEnd ?? 0, lastKeyCode.current, opts);
|
|
147
143
|
valueSetter(prevMask => {
|
|
148
144
|
// Here we need to update the key
|
|
149
145
|
if (mask === prevMask) setKey(key => key + 1);
|
|
@@ -2,7 +2,6 @@ import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
2
2
|
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
3
3
|
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
4
4
|
import 'core-js/modules/esnext.iterator.filter.js';
|
|
5
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
6
5
|
import { useRef, useState, useCallback } from 'react';
|
|
7
6
|
import { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';
|
|
8
7
|
import { useCallbackAfterRender } from '@elliemae/ds-utilities';
|
|
@@ -64,9 +63,7 @@ const usePhoneMask = props => {
|
|
|
64
63
|
if (userOnKeyDown) userOnKeyDown(e);
|
|
65
64
|
}, [userOnKeyDown]);
|
|
66
65
|
const onChange = useCallback(e => {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const [mask, cursorPos] = conformValue(e.target.value, (_e$target$selectionEn = e.target.selectionEnd) !== null && _e$target$selectionEn !== void 0 ? _e$target$selectionEn : 0, lastKeyCode.current, opts);
|
|
66
|
+
const [mask, cursorPos] = conformValue(e.target.value, e.target.selectionEnd ?? 0, lastKeyCode.current, opts);
|
|
70
67
|
valueSetter(prevMask => {
|
|
71
68
|
// Here we need to update the key
|
|
72
69
|
if (mask === prevMask) setKey(key => key + 1);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
1
|
import { useRef, useState, useCallback } from 'react';
|
|
3
2
|
import { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';
|
|
4
3
|
import { useCallbackAfterRender } from '@elliemae/ds-utilities';
|
|
@@ -11,6 +10,8 @@ import 'core-js/modules/esnext.iterator.filter.js';
|
|
|
11
10
|
import { flatStringArray } from '../utils/flatStringArray.js';
|
|
12
11
|
import { DSMaskRegExpHookPropsTypes, DSMaskRegExpHookDefaultProps } from '../react-desc-prop-types.js';
|
|
13
12
|
|
|
13
|
+
/* eslint-disable max-depth */
|
|
14
|
+
|
|
14
15
|
const isRegExp = item => typeof item === 'object';
|
|
15
16
|
|
|
16
17
|
const conformValue = (rawValue, cursorPos, lastKeyCode, regExp, filledMask) => {
|
|
@@ -29,9 +30,7 @@ const conformValue = (rawValue, cursorPos, lastKeyCode, regExp, filledMask) => {
|
|
|
29
30
|
fullRegExpMatched = false;
|
|
30
31
|
|
|
31
32
|
for (let j = charsFound + offSet; j < rawValueArray.length; j += 1) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const match = (_rawValueArray$j = rawValueArray[j]) === null || _rawValueArray$j === void 0 ? void 0 : _rawValueArray$j.match(flatRegExp[i]);
|
|
33
|
+
const match = rawValueArray[j]?.match(flatRegExp[i]);
|
|
35
34
|
|
|
36
35
|
if (match) {
|
|
37
36
|
maskedValue.push(match[0]);
|
|
@@ -83,9 +82,7 @@ const useRegExpMask = props => {
|
|
|
83
82
|
if (userOnKeyDown) userOnKeyDown(e);
|
|
84
83
|
}, [userOnKeyDown]);
|
|
85
84
|
const onChange = useCallback(e => {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
const [mask, cursorPos] = conformValue(e.target.value, (_e$target$selectionEn = e.target.selectionEnd) !== null && _e$target$selectionEn !== void 0 ? _e$target$selectionEn : 0, lastKeyCode.current, regExp, filledMask);
|
|
85
|
+
const [mask, cursorPos] = conformValue(e.target.value, e.target.selectionEnd ?? 0, lastKeyCode.current, regExp, filledMask);
|
|
89
86
|
valueSetter(prevMask => {
|
|
90
87
|
// Here we need to update the key
|
|
91
88
|
if (mask === prevMask) setKey(key => key + 1);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
2
|
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
3
|
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
5
4
|
import { useRef, useState, useCallback } from 'react';
|
|
6
5
|
import { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';
|
|
7
6
|
import { useCallbackAfterRender } from '@elliemae/ds-utilities';
|
|
@@ -47,9 +46,7 @@ const useSSNMask = props => {
|
|
|
47
46
|
if (userOnKeyDown) userOnKeyDown(e);
|
|
48
47
|
}, [userOnKeyDown]);
|
|
49
48
|
const onChange = useCallback(e => {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const [mask, cursorPos] = conformValue(e.target.value, (_e$target$selectionEn = e.target.selectionEnd) !== null && _e$target$selectionEn !== void 0 ? _e$target$selectionEn : 0, lastKeyCode.current);
|
|
49
|
+
const [mask, cursorPos] = conformValue(e.target.value, e.target.selectionEnd ?? 0, lastKeyCode.current);
|
|
53
50
|
valueSetter(prevMask => {
|
|
54
51
|
// Here we need to update the key
|
|
55
52
|
if (mask === prevMask) setKey(key => key + 1);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
2
|
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
3
|
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
5
4
|
import { useRef, useState, useCallback } from 'react';
|
|
6
5
|
import { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';
|
|
7
6
|
import { useCallbackAfterRender } from '@elliemae/ds-utilities';
|
|
@@ -44,9 +43,7 @@ const useZipCodeMask = props => {
|
|
|
44
43
|
if (userOnKeyDown) userOnKeyDown(e);
|
|
45
44
|
}, [userOnKeyDown]);
|
|
46
45
|
const onChange = useCallback(e => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const [mask, cursorPos] = conformValue(e.target.value, (_e$target$selectionEn = e.target.selectionEnd) !== null && _e$target$selectionEn !== void 0 ? _e$target$selectionEn : 0, lastKeyCode.current);
|
|
46
|
+
const [mask, cursorPos] = conformValue(e.target.value, e.target.selectionEnd ?? 0, lastKeyCode.current);
|
|
50
47
|
valueSetter(prevMask => {
|
|
51
48
|
// Here we need to update the key
|
|
52
49
|
if (mask === prevMask) setKey(key => key + 1);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
2
2
|
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
3
|
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
4
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
5
4
|
|
|
6
5
|
/* eslint-disable max-params */
|
|
7
6
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
2
2
|
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
3
|
import 'core-js/modules/esnext.iterator.reduce.js';
|
|
4
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
5
4
|
|
|
6
5
|
const flatStringArray = stringArray => stringArray.reduce((acc, curr) => {
|
|
7
6
|
if (typeof curr === 'string') {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
1
|
import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes, useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';
|
|
3
2
|
import { useState, useCallback, useMemo } from 'react';
|
|
4
3
|
import { defaultProps, DSInputTextPropTypes } from '../react-desc-prop-types.js';
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from '@babel/runtime/helpers/esm/taggedTemplateLiteral';
|
|
2
1
|
import { css, th } from '@elliemae/ds-system';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
const commonBorderCss = css`
|
|
4
|
+
border: 1px solid ${th.color('neutral-400')};
|
|
5
|
+
`;
|
|
6
|
+
const readOnlyBorderCss = css`
|
|
7
|
+
border: 1px solid transparent;
|
|
8
|
+
border-top-color: ${th.color('neutral-400')};
|
|
9
|
+
`;
|
|
7
10
|
const disabledBorderCss = commonBorderCss;
|
|
8
|
-
const hasErrorBorderCss = css
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
const hasErrorBorderCss = css`
|
|
12
|
+
border: 1px solid ${th.color('danger-900')};
|
|
13
|
+
`;
|
|
14
|
+
const hoverBorderCss = css`
|
|
15
|
+
border: 1px solid ${th.color('brand-700')};
|
|
16
|
+
`;
|
|
17
|
+
const focusBorderCss = css`
|
|
18
|
+
border: 1px solid transparent;
|
|
19
|
+
outline: 2px solid ${th.color('brand-700')};
|
|
20
|
+
outline-offset: -2px;
|
|
21
|
+
`;
|
|
11
22
|
const getBorderCss = props => {
|
|
12
23
|
if (props.isDisabled) return disabledBorderCss;
|
|
13
24
|
if (props.hasFocus) return focusBorderCss;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from '@babel/runtime/helpers/esm/taggedTemplateLiteral';
|
|
2
1
|
import { DSButtonV2 } from '@elliemae/ds-button';
|
|
3
2
|
import { Grid } from '@elliemae/ds-grid';
|
|
4
3
|
import { styled, th } from '@elliemae/ds-system';
|
|
@@ -6,23 +5,67 @@ import { layout, space, sizing } from '@xstyled/styled-components';
|
|
|
6
5
|
import { DSInputTextName, DSInputTextSlots } from '../exported-related/theming.js';
|
|
7
6
|
import { getBorderCss, getHoverBorderCss } from './borders.js';
|
|
8
7
|
|
|
9
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
10
8
|
const StyledInputWrapper = styled(Grid, {
|
|
11
9
|
name: DSInputTextName,
|
|
12
10
|
slot: DSInputTextSlots.INPUT_WRAPPER
|
|
13
|
-
})
|
|
11
|
+
})`
|
|
12
|
+
height: ${_ref => {
|
|
14
13
|
let {
|
|
15
14
|
inputSize
|
|
16
15
|
} = _ref;
|
|
17
16
|
return inputSize === 'm' ? '28px' : '24px';
|
|
18
|
-
}
|
|
17
|
+
}};
|
|
18
|
+
|
|
19
|
+
${getBorderCss}
|
|
20
|
+
border-radius: 2px;
|
|
21
|
+
|
|
22
|
+
:hover {
|
|
23
|
+
${getHoverBorderCss}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
${layout}
|
|
27
|
+
${space}
|
|
28
|
+
${sizing}
|
|
29
|
+
`;
|
|
19
30
|
const StyledInput = styled('input', {
|
|
20
31
|
name: DSInputTextName,
|
|
21
32
|
slot: DSInputTextSlots.INPUT
|
|
22
|
-
})
|
|
33
|
+
})`
|
|
34
|
+
padding: 0 ${th.space('xxs')};
|
|
35
|
+
border: none;
|
|
36
|
+
outline: none;
|
|
37
|
+
border-radius: 2px;
|
|
38
|
+
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 100%;
|
|
41
|
+
font-size: 13px;
|
|
42
|
+
|
|
43
|
+
::placeholder {
|
|
44
|
+
font-weight: ${th.fontWeight('regular')};
|
|
45
|
+
font-style: italic;
|
|
46
|
+
color: ${th.color('neutral-500')};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:disabled {
|
|
50
|
+
background-color: ${th.color('neutral-080')};
|
|
51
|
+
color: #616b7f;
|
|
52
|
+
cursor: not-allowed;
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
23
55
|
const StyledClearButton = styled(DSButtonV2, {
|
|
24
56
|
name: DSInputTextName,
|
|
25
57
|
slot: DSInputTextSlots.CLEAR_BUTTON
|
|
26
|
-
})
|
|
58
|
+
})`
|
|
59
|
+
height: 100%;
|
|
60
|
+
min-width: 20px;
|
|
61
|
+
width: 20px;
|
|
62
|
+
&:after {
|
|
63
|
+
border-top-left-radius: 0px !important;
|
|
64
|
+
border-bottom-left-radius: 0px !important;
|
|
65
|
+
}
|
|
66
|
+
:focus {
|
|
67
|
+
border-width: 0px;
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
27
70
|
|
|
28
71
|
export { StyledClearButton, StyledInput, StyledInputWrapper };
|
|
@@ -5,7 +5,6 @@ import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
|
5
5
|
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
6
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
7
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
8
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
9
8
|
import { useState, useRef, useMemo, useEffect, useCallback } from 'react';
|
|
10
9
|
import { uid } from 'uid';
|
|
11
10
|
import { describe } from 'react-desc';
|