@rolster/react-components 18.24.11 → 18.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +12 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/index.js +13 -11
- package/dist/es/index.js.map +1 -1
- package/dist/esm/components/molecules/PickerMonth/PickerMonth.js +4 -4
- package/dist/esm/components/molecules/PickerMonth/PickerMonth.js.map +1 -1
- package/dist/esm/components/molecules/PickerSelectorTitle/PickerSelectorTitle.js +7 -5
- package/dist/esm/components/molecules/PickerSelectorTitle/PickerSelectorTitle.js.map +1 -1
- package/dist/esm/components/molecules/PickerYear/PickerYear.js +2 -2
- package/dist/esm/components/molecules/PickerYear/PickerYear.js.map +1 -1
- package/dist/esm/components/organisms/PickerDateRange/PickerDateRange.js +3 -3
- package/dist/esm/components/organisms/PickerDateRange/PickerDateRange.js.map +1 -1
- package/package.json +6 -6
package/dist/cjs/index.js
CHANGED
|
@@ -2181,7 +2181,7 @@ function RlsPickerMonthElement({ month, onSelect, disabled }) {
|
|
|
2181
2181
|
});
|
|
2182
2182
|
}, [month.disabled, month.focused, month.selected, disabled]);
|
|
2183
2183
|
const onClick = require$$0.useCallback(() => {
|
|
2184
|
-
commons.
|
|
2184
|
+
commons.valueIsDefined(month.value) &&
|
|
2185
2185
|
!month.disabled &&
|
|
2186
2186
|
!disabled &&
|
|
2187
2187
|
onSelect(month.value);
|
|
@@ -2212,7 +2212,7 @@ function RlsPickerMonth({ date: _date, disabled, formControl, maxDate, minDate,
|
|
|
2212
2212
|
maxDate
|
|
2213
2213
|
};
|
|
2214
2214
|
const month = components.verifyMonthPicker(options);
|
|
2215
|
-
commons.
|
|
2215
|
+
commons.valueIsDefined(month)
|
|
2216
2216
|
? setMonthValue(month)
|
|
2217
2217
|
: setMonths(components.createMonthPicker(options));
|
|
2218
2218
|
}, [date, year, value, minDate, maxDate]);
|
|
@@ -2224,7 +2224,7 @@ function RlsPickerMonth({ date: _date, disabled, formControl, maxDate, minDate,
|
|
|
2224
2224
|
minDate,
|
|
2225
2225
|
maxDate
|
|
2226
2226
|
});
|
|
2227
|
-
commons.
|
|
2227
|
+
commons.valueIsDefined(month)
|
|
2228
2228
|
? formControl?.setValue(month)
|
|
2229
2229
|
: setValue(formControl?.value ?? date.getMonth());
|
|
2230
2230
|
}, [formControl?.value]);
|
|
@@ -2250,7 +2250,8 @@ function RlsPickerSelectorTitle({ monthControl, type, yearControl, date, disable
|
|
|
2250
2250
|
setLabel(dates.MONTH_NAMES(monthControl.value ?? dates.Month.January));
|
|
2251
2251
|
}, [monthControl.value]);
|
|
2252
2252
|
const onPreviousMonth = require$$0.useCallback(() => {
|
|
2253
|
-
if (commons.
|
|
2253
|
+
if (commons.valueIsDefined(monthControl.value) &&
|
|
2254
|
+
commons.valueIsDefined(yearControl.value)) {
|
|
2254
2255
|
if (monthControl.value > dates.Month.January) {
|
|
2255
2256
|
monthControl.setValue(monthControl.value - 1);
|
|
2256
2257
|
}
|
|
@@ -2261,14 +2262,15 @@ function RlsPickerSelectorTitle({ monthControl, type, yearControl, date, disable
|
|
|
2261
2262
|
}
|
|
2262
2263
|
}, [monthControl.value, yearControl.value]);
|
|
2263
2264
|
const onPreviousYear = require$$0.useCallback(() => {
|
|
2264
|
-
commons.
|
|
2265
|
+
commons.valueIsDefined(yearControl.value) &&
|
|
2265
2266
|
yearControl.setValue(yearControl.value - 1);
|
|
2266
2267
|
}, [yearControl.value]);
|
|
2267
2268
|
const onPrevious = require$$0.useCallback(() => {
|
|
2268
2269
|
type === 'month' ? onPreviousMonth() : onPreviousYear();
|
|
2269
2270
|
}, [type, onPreviousMonth, onPreviousYear]);
|
|
2270
2271
|
const onNextMonth = require$$0.useCallback(() => {
|
|
2271
|
-
if (commons.
|
|
2272
|
+
if (commons.valueIsDefined(monthControl.value) &&
|
|
2273
|
+
commons.valueIsDefined(yearControl.value)) {
|
|
2272
2274
|
if (monthControl.value < dates.Month.December) {
|
|
2273
2275
|
monthControl.setValue(monthControl.value + 1);
|
|
2274
2276
|
}
|
|
@@ -2279,7 +2281,7 @@ function RlsPickerSelectorTitle({ monthControl, type, yearControl, date, disable
|
|
|
2279
2281
|
}
|
|
2280
2282
|
}, [monthControl.value, yearControl.value]);
|
|
2281
2283
|
const onNextYear = require$$0.useCallback(() => {
|
|
2282
|
-
commons.
|
|
2284
|
+
commons.valueIsDefined(yearControl.value) &&
|
|
2283
2285
|
yearControl.setValue(yearControl.value + 1);
|
|
2284
2286
|
}, [yearControl.value]);
|
|
2285
2287
|
const onNext = require$$0.useCallback(() => {
|
|
@@ -2333,7 +2335,7 @@ function RlsPickerYear({ date: _date, disabled, formControl, maxDate, minDate, o
|
|
|
2333
2335
|
}, [template.years, onSelect, disabled]);
|
|
2334
2336
|
require$$0.useEffect(() => {
|
|
2335
2337
|
const year = components.verifyYearPicker(createPickerOptions());
|
|
2336
|
-
commons.
|
|
2338
|
+
commons.valueIsDefined(year)
|
|
2337
2339
|
? formControl?.setValue(year)
|
|
2338
2340
|
: setValue(formControl?.value ?? date.getFullYear());
|
|
2339
2341
|
}, [formControl?.value]);
|
|
@@ -3040,14 +3042,14 @@ function RlsPickerDateRange({ automatic, date: _picker, disabled, formControl, m
|
|
|
3040
3042
|
}, []);
|
|
3041
3043
|
require$$0.useEffect(() => {
|
|
3042
3044
|
setDate((date) => {
|
|
3043
|
-
return commons.
|
|
3045
|
+
return commons.valueIsDefined(yearControl.value)
|
|
3044
3046
|
? dates.assignYearInDate(date, yearControl.value)
|
|
3045
3047
|
: date;
|
|
3046
3048
|
});
|
|
3047
3049
|
}, [yearControl.value]);
|
|
3048
3050
|
require$$0.useEffect(() => {
|
|
3049
3051
|
setDate((date) => {
|
|
3050
|
-
return commons.
|
|
3052
|
+
return commons.valueIsDefined(monthControl.value)
|
|
3051
3053
|
? dates.assignMonthInDate(date, monthControl.value)
|
|
3052
3054
|
: date;
|
|
3053
3055
|
});
|