@rolster/react-components 18.10.0 → 18.10.4
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 +125 -103
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/index.js +125 -103
- package/dist/es/index.js.map +1 -1
- package/dist/esm/components/atoms/Amount/Amount.d.ts +2 -2
- package/dist/esm/components/atoms/Amount/Amount.js.map +1 -1
- package/dist/esm/components/atoms/Avatar/Avatar.d.ts +2 -2
- package/dist/esm/components/atoms/Avatar/Avatar.js.map +1 -1
- package/dist/esm/components/atoms/Breadcrumb/Breadcrumb.d.ts +2 -2
- package/dist/esm/components/atoms/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/esm/components/atoms/Button/Button.d.ts +2 -2
- package/dist/esm/components/atoms/Button/Button.js.map +1 -1
- package/dist/esm/components/atoms/ButtonAction/ButtonAction.d.ts +2 -2
- package/dist/esm/components/atoms/ButtonAction/ButtonAction.js.map +1 -1
- package/dist/esm/components/atoms/CheckBox/CheckBox.d.ts +4 -4
- package/dist/esm/components/atoms/CheckBox/CheckBox.js.map +1 -1
- package/dist/esm/components/atoms/Icon/Icon.d.ts +2 -2
- package/dist/esm/components/atoms/Icon/Icon.js.map +1 -1
- package/dist/esm/components/atoms/Input/Input.d.ts +3 -3
- package/dist/esm/components/atoms/Input/Input.js +1 -1
- package/dist/esm/components/atoms/Input/Input.js.map +1 -1
- package/dist/esm/components/atoms/InputMoney/InputMoney.d.ts +3 -3
- package/dist/esm/components/atoms/InputMoney/InputMoney.js +1 -1
- package/dist/esm/components/atoms/InputMoney/InputMoney.js.map +1 -1
- package/dist/esm/components/atoms/InputNumber/InputNumber.d.ts +3 -3
- package/dist/esm/components/atoms/InputNumber/InputNumber.js +1 -1
- package/dist/esm/components/atoms/InputNumber/InputNumber.js.map +1 -1
- package/dist/esm/components/atoms/InputPassword/InputPassword.d.ts +3 -3
- package/dist/esm/components/atoms/InputPassword/InputPassword.js +1 -1
- package/dist/esm/components/atoms/InputPassword/InputPassword.js.map +1 -1
- package/dist/esm/components/atoms/InputText/InputText.d.ts +3 -3
- package/dist/esm/components/atoms/InputText/InputText.js +1 -1
- package/dist/esm/components/atoms/InputText/InputText.js.map +1 -1
- package/dist/esm/components/atoms/MessageIcon/MessageIcon.d.ts +2 -2
- package/dist/esm/components/atoms/MessageIcon/MessageIcon.js.map +1 -1
- package/dist/esm/components/atoms/ProgressBar/ProgressBar.d.ts +2 -2
- package/dist/esm/components/atoms/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/esm/components/atoms/RadioButton/RadioButton.d.ts +2 -2
- package/dist/esm/components/atoms/RadioButton/RadioButton.js +1 -1
- package/dist/esm/components/atoms/RadioButton/RadioButton.js.map +1 -1
- package/dist/esm/components/atoms/SearchInput/SearchInput.d.ts +2 -2
- package/dist/esm/components/atoms/SearchInput/SearchInput.js.map +1 -1
- package/dist/esm/components/atoms/SkeletonText/SkeletonText.d.ts +2 -2
- package/dist/esm/components/atoms/SkeletonText/SkeletonText.js.map +1 -1
- package/dist/esm/components/atoms/Switch/Switch.d.ts +4 -4
- package/dist/esm/components/atoms/Switch/Switch.js +1 -1
- package/dist/esm/components/atoms/Switch/Switch.js.map +1 -1
- package/dist/esm/components/atoms/TabularText/TabularText.d.ts +2 -2
- package/dist/esm/components/atoms/TabularText/TabularText.js.map +1 -1
- package/dist/esm/components/molecules/ButtonToggle/ButtonToggle.d.ts +2 -2
- package/dist/esm/components/molecules/ButtonToggle/ButtonToggle.js.map +1 -1
- package/dist/esm/components/molecules/CheckBoxLabel/CheckBoxLabel.d.ts +2 -2
- package/dist/esm/components/molecules/CheckBoxLabel/CheckBoxLabel.js.map +1 -1
- package/dist/esm/components/molecules/DayPicker/DayPicker.d.ts +3 -2
- package/dist/esm/components/molecules/DayPicker/DayPicker.js +4 -1
- package/dist/esm/components/molecules/DayPicker/DayPicker.js.map +1 -1
- package/dist/esm/components/molecules/DayRangePicker/DayRangePicker.d.ts +2 -2
- package/dist/esm/components/molecules/DayRangePicker/DayRangePicker.js.map +1 -1
- package/dist/esm/components/molecules/MoneyField/MoneyField.d.ts +3 -3
- package/dist/esm/components/molecules/MoneyField/MoneyField.js +1 -1
- package/dist/esm/components/molecules/MoneyField/MoneyField.js.map +1 -1
- package/dist/esm/components/molecules/MonthPicker/MonthPicker.d.ts +3 -2
- package/dist/esm/components/molecules/MonthPicker/MonthPicker.js +12 -4
- package/dist/esm/components/molecules/MonthPicker/MonthPicker.js.map +1 -1
- package/dist/esm/components/molecules/MonthTitlePicker/MonthTitlePicker.d.ts +2 -2
- package/dist/esm/components/molecules/MonthTitlePicker/MonthTitlePicker.js.map +1 -1
- package/dist/esm/components/molecules/NumberField/NumberField.d.ts +3 -3
- package/dist/esm/components/molecules/NumberField/NumberField.js +1 -1
- package/dist/esm/components/molecules/NumberField/NumberField.js.map +1 -1
- package/dist/esm/components/molecules/Pagination/Pagination.d.ts +2 -2
- package/dist/esm/components/molecules/Pagination/Pagination.js +30 -30
- package/dist/esm/components/molecules/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/molecules/RadioButtonLabel/RadioButtonLabel.d.ts +2 -2
- package/dist/esm/components/molecules/RadioButtonLabel/RadioButtonLabel.js.map +1 -1
- package/dist/esm/components/molecules/TextField/TextField.d.ts +3 -3
- package/dist/esm/components/molecules/TextField/TextField.js +1 -1
- package/dist/esm/components/molecules/TextField/TextField.js.map +1 -1
- package/dist/esm/components/molecules/Toolbar/Toolbar.d.ts +2 -2
- package/dist/esm/components/molecules/Toolbar/Toolbar.js.map +1 -1
- package/dist/esm/components/molecules/YearPicker/YearPicker.d.ts +3 -2
- package/dist/esm/components/molecules/YearPicker/YearPicker.js +5 -2
- package/dist/esm/components/molecules/YearPicker/YearPicker.js.map +1 -1
- package/dist/esm/components/organisms/AutocompleteField/AutocompleteField.js +1 -1
- package/dist/esm/components/organisms/AutocompleteField/AutocompleteField.js.map +1 -1
- package/dist/esm/components/organisms/AutocompleteField/{autocomplete-field.hook.js → AutocompleteFieldHook.js} +14 -16
- package/dist/esm/components/organisms/AutocompleteField/AutocompleteFieldHook.js.map +1 -0
- package/dist/esm/components/organisms/Card/Card.d.ts +2 -2
- package/dist/esm/components/organisms/Card/Card.js.map +1 -1
- package/dist/esm/components/organisms/Confirmation/Confirmation.d.ts +5 -4
- package/dist/esm/components/organisms/Confirmation/Confirmation.js.map +1 -1
- package/dist/esm/components/organisms/Datatable/Datatable.d.ts +7 -7
- package/dist/esm/components/organisms/Datatable/Datatable.js.map +1 -1
- package/dist/esm/components/organisms/DateField/DateField.d.ts +3 -2
- package/dist/esm/components/organisms/DateField/DateField.js +15 -6
- package/dist/esm/components/organisms/DateField/DateField.js.map +1 -1
- package/dist/esm/components/organisms/DatePicker/DatePicker.d.ts +2 -2
- package/dist/esm/components/organisms/DatePicker/DatePicker.js +1 -1
- package/dist/esm/components/organisms/DatePicker/DatePicker.js.map +1 -1
- package/dist/esm/components/organisms/DateRangeField/DateRangeField.d.ts +2 -2
- package/dist/esm/components/organisms/DateRangeField/DateRangeField.js.map +1 -1
- package/dist/esm/components/organisms/DateRangePicker/DateRangePicker.d.ts +2 -2
- package/dist/esm/components/organisms/DateRangePicker/DateRangePicker.js.map +1 -1
- package/dist/esm/components/organisms/FormNavigation/FormNavigation.d.ts +2 -2
- package/dist/esm/components/organisms/FormNavigation/FormNavigation.js.map +1 -1
- package/dist/esm/components/organisms/Modal/Modal.d.ts +2 -2
- package/dist/esm/components/organisms/Modal/Modal.js.map +1 -1
- package/dist/esm/components/organisms/SelectField/SelectField.js +1 -1
- package/dist/esm/components/organisms/SelectField/SelectField.js.map +1 -1
- package/dist/esm/components/organisms/SelectField/{select-field.hook.js → SelectFieldHook.js} +12 -10
- package/dist/esm/components/organisms/SelectField/SelectFieldHook.js.map +1 -0
- package/dist/esm/components/organisms/Snackbar/Snackbar.d.ts +4 -4
- package/dist/esm/components/organisms/Snackbar/Snackbar.js.map +1 -1
- package/dist/esm/context.d.ts +3 -3
- package/dist/esm/hooks/{list-control.hook.js → ListControlHook.js} +1 -1
- package/dist/esm/hooks/ListControlHook.js.map +1 -0
- package/dist/esm/hooks/index.d.ts +1 -1
- package/dist/esm/hooks/index.js +1 -1
- package/dist/esm/hooks/index.js.map +1 -1
- package/dist/esm/utils/date-range-picker.d.ts +2 -2
- package/dist/esm/utils/date-range-picker.js +3 -3
- package/dist/esm/utils/date-range-picker.js.map +1 -1
- package/dist/esm/utils/day-picker.d.ts +2 -2
- package/dist/esm/utils/day-picker.js +3 -3
- package/dist/esm/utils/day-picker.js.map +1 -1
- package/dist/esm/utils/month-picker.d.ts +2 -2
- package/dist/esm/utils/month-picker.js +15 -15
- package/dist/esm/utils/month-picker.js.map +1 -1
- package/dist/esm/utils/year-picker.d.ts +2 -2
- package/dist/esm/utils/year-picker.js +3 -3
- package/dist/esm/utils/year-picker.js.map +1 -1
- package/package.json +1 -1
- package/dist/esm/components/organisms/AutocompleteField/autocomplete-field.hook.js.map +0 -1
- package/dist/esm/components/organisms/SelectField/select-field.hook.js.map +0 -1
- package/dist/esm/hooks/list-control.hook.js.map +0 -1
- /package/dist/esm/components/organisms/AutocompleteField/{autocomplete-field.hook.d.ts → AutocompleteFieldHook.d.ts} +0 -0
- /package/dist/esm/components/organisms/SelectField/{select-field.hook.d.ts → SelectFieldHook.d.ts} +0 -0
- /package/dist/esm/hooks/{list-control.hook.d.ts → ListControlHook.d.ts} +0 -0
package/dist/es/index.js
CHANGED
|
@@ -65,7 +65,7 @@ function RlsCheckBoxControl({ formControl, disabled, rlsTheme }) {
|
|
|
65
65
|
}, rlsTheme: rlsTheme }));
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
function RlsInput({ children, disabled, formControl,
|
|
68
|
+
function RlsInput({ children, disabled, formControl, placeholder, type, value, onValue }) {
|
|
69
69
|
const [focused, setFocused] = useState(false);
|
|
70
70
|
function onChange(event) {
|
|
71
71
|
switch (type) {
|
|
@@ -100,7 +100,7 @@ function RlsInput({ children, disabled, formControl, onValue, placeholder, type,
|
|
|
100
100
|
}), children: [jsx("input", { ref: formControl?.elementRef, className: "rls-input__component", autoComplete: "off", type: type || 'text', placeholder: placeholder, disabled: formControl?.disabled || disabled, onFocus: onFocus, onBlur: onBlur, onChange: onChange, value: formControl?.state || value || '' }), jsx("span", { className: "rls-input__value", children: children })] }));
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
function RlsInputMoney({ decimals, disabled, formControl,
|
|
103
|
+
function RlsInputMoney({ decimals, disabled, formControl, placeholder, symbol, value, onValue }) {
|
|
104
104
|
const [valueInput, setValueInput] = useState(value || 0);
|
|
105
105
|
function onMoney(value) {
|
|
106
106
|
if (!formControl) {
|
|
@@ -113,7 +113,7 @@ function RlsInputMoney({ decimals, disabled, formControl, onValue, placeholder,
|
|
|
113
113
|
return (jsx("div", { className: "rls-input-money", children: jsx(RlsInput, { formControl: formControl, type: "number", value: value, disabled: disabled, placeholder: placeholder, onValue: onMoney, children: jsx(RlsAmount, { value: formControl?.state || value || valueInput, symbol: symbol, decimals: decimals }) }) }));
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
function RlsInputNumber({ disabled, formControl,
|
|
116
|
+
function RlsInputNumber({ disabled, formControl, placeholder, value, onValue }) {
|
|
117
117
|
const [valueInput, setValueInput] = useState(value || 0);
|
|
118
118
|
function onNumber(value) {
|
|
119
119
|
if (!formControl) {
|
|
@@ -126,7 +126,7 @@ function RlsInputNumber({ disabled, formControl, onValue, placeholder, value })
|
|
|
126
126
|
return (jsx("div", { className: "rls-input-number", children: jsx(RlsInput, { formControl: formControl, type: "number", value: value, disabled: disabled, placeholder: placeholder, onValue: onNumber, children: formControl?.state || value || valueInput }) }));
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
function RlsInputPassword({ disabled, formControl,
|
|
129
|
+
function RlsInputPassword({ disabled, formControl, placeholder, type, onValue }) {
|
|
130
130
|
const [focused, setFocused] = useState(false);
|
|
131
131
|
function onChange(event) {
|
|
132
132
|
formControl?.setState(event.target.value);
|
|
@@ -151,7 +151,7 @@ function RlsInputPassword({ disabled, formControl, onValue, placeholder, type })
|
|
|
151
151
|
}), children: jsx("input", { className: "rls-input-password__component", autoComplete: "off", type: type || 'password', placeholder: placeholder, disabled: disabled, onFocus: onFocus, onBlur: onBlur, onChange: onChange }) }));
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
function RlsInputText({ disabled, formControl,
|
|
154
|
+
function RlsInputText({ disabled, formControl, placeholder, value, onValue }) {
|
|
155
155
|
const [valueInput, setValueInput] = useState(value || '');
|
|
156
156
|
function onText(value) {
|
|
157
157
|
if (!formControl) {
|
|
@@ -180,7 +180,7 @@ function RlsProgressBar({ indeterminate, percentage, rlsTheme }) {
|
|
|
180
180
|
return (jsx("div", { className: renderClassStatus('rls-progress-bar', { indeterminate }), "rls-theme": rlsTheme, children: jsx("div", { className: "rls-progress-bar__component", style: { width: `${percentage || 0}%` } }) }));
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
function RlsRadioButton({ checked, disabled,
|
|
183
|
+
function RlsRadioButton({ checked, disabled, rlsTheme, onClick }) {
|
|
184
184
|
return (jsx("div", { className: renderClassStatus('rls-radiobutton', { checked, disabled }), onClick: onClick, "rls-theme": rlsTheme, children: jsx("div", { className: "rls-radiobutton__component" }) }));
|
|
185
185
|
}
|
|
186
186
|
|
|
@@ -196,7 +196,7 @@ function RlsSkeletonText({ active, children, rlsTheme }) {
|
|
|
196
196
|
return (jsx("div", { className: renderClassStatus('rls-skeleton-text', { active }), "rls-theme": rlsTheme, children: jsx("span", { className: "rls-skeleton-text__value", children: children }) }));
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
function RlsSwitch({ checked, disabled,
|
|
199
|
+
function RlsSwitch({ checked, disabled, rlsTheme, onClick }) {
|
|
200
200
|
return (jsx("div", { className: renderClassStatus('rls-switch', { checked, disabled }), onClick: onClick, "rls-theme": rlsTheme, children: jsxs("div", { className: "rls-switch__component", children: [jsx("div", { className: "rls-switch__component__element" }), jsx("div", { className: "rls-switch__component__bar" })] }) }));
|
|
201
201
|
}
|
|
202
202
|
function RlsSwitchControl({ formControl, disabled, rlsTheme }) {
|
|
@@ -263,7 +263,7 @@ function RlsCheckBoxLabel({ children, disabled, extended, formControl, rlsTheme
|
|
|
263
263
|
}), "rls-theme": rlsTheme, children: [jsx("div", { className: "rls-checkbox-label__component", onClick: onToggle, children: jsx(RlsCheckBox, { checked: checked, disabled: disabled }) }), jsx("label", { className: "rls-checkbox-label__text", children: children })] }));
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
-
|
|
266
|
+
class DayPickerFactory {
|
|
267
267
|
constructor(props) {
|
|
268
268
|
const { date, value, maxDate, minDate } = props;
|
|
269
269
|
this.value = value;
|
|
@@ -273,7 +273,7 @@ let Factory$2 = class Factory {
|
|
|
273
273
|
this.date.setDate(1);
|
|
274
274
|
}
|
|
275
275
|
static execute(props) {
|
|
276
|
-
const factory = new
|
|
276
|
+
const factory = new DayPickerFactory(props);
|
|
277
277
|
const firstWeek = factory.createFirstWeek();
|
|
278
278
|
const rightWeeks = factory.createRightWeeks();
|
|
279
279
|
return [firstWeek, ...rightWeeks];
|
|
@@ -341,12 +341,12 @@ let Factory$2 = class Factory {
|
|
|
341
341
|
? weight(refactorDay(this.date, day)) > weight(this.maxDate)
|
|
342
342
|
: false;
|
|
343
343
|
}
|
|
344
|
-
}
|
|
344
|
+
}
|
|
345
345
|
function createDayPicker(props) {
|
|
346
|
-
return
|
|
346
|
+
return DayPickerFactory.execute(props);
|
|
347
347
|
}
|
|
348
348
|
|
|
349
|
-
function RlsDayPicker({ date, disabled: disabledPicker, formControl, maxDate, minDate, rlsTheme }) {
|
|
349
|
+
function RlsDayPicker({ date, disabled: disabledPicker, formControl, maxDate, minDate, rlsTheme, onValue }) {
|
|
350
350
|
const initialDate = date || new Date();
|
|
351
351
|
const initialDay = formControl?.state || initialDate.getDate();
|
|
352
352
|
const [weeks, setWeeks] = useState([]);
|
|
@@ -367,6 +367,9 @@ function RlsDayPicker({ date, disabled: disabledPicker, formControl, maxDate, mi
|
|
|
367
367
|
function onChange(value) {
|
|
368
368
|
setValue(value);
|
|
369
369
|
formControl?.setState(value);
|
|
370
|
+
if (onValue) {
|
|
371
|
+
onValue(value);
|
|
372
|
+
}
|
|
370
373
|
}
|
|
371
374
|
return (jsxs("div", { className: "rls-day-picker", "rls-theme": rlsTheme, children: [jsx("div", { className: "rls-day-picker__header", children: DAY_LABELS().map((title, index) => (jsx("label", { className: "rls-day-picker__label", children: title }, index))) }), jsx("div", { className: "rls-day-picker__component", children: weeks.map(({ days }, index) => (jsx("div", { className: "rls-day-picker__week", children: days.map(({ value, disabled, forbidden, selected }, index) => (jsx("div", { className: renderClassStatus('rls-day-picker__day', {
|
|
372
375
|
disabled: disabled || disabledPicker,
|
|
@@ -419,7 +422,7 @@ class DateRange {
|
|
|
419
422
|
}
|
|
420
423
|
}
|
|
421
424
|
|
|
422
|
-
|
|
425
|
+
class DateRangePickerFactory {
|
|
423
426
|
constructor(props) {
|
|
424
427
|
const { date, range, maxDate, minDate } = props;
|
|
425
428
|
this.date = new Date(date.getTime());
|
|
@@ -429,7 +432,7 @@ let Factory$1 = class Factory {
|
|
|
429
432
|
this.date.setDate(1);
|
|
430
433
|
}
|
|
431
434
|
static execute(props) {
|
|
432
|
-
const factory = new
|
|
435
|
+
const factory = new DateRangePickerFactory(props);
|
|
433
436
|
const firstWeek = factory.createFirstWeek();
|
|
434
437
|
const rightWeeks = factory.createRightWeeks();
|
|
435
438
|
return [firstWeek, ...rightWeeks];
|
|
@@ -510,9 +513,9 @@ let Factory$1 = class Factory {
|
|
|
510
513
|
? weight(refactorDay(this.date, day)) > weight(this.maxDate)
|
|
511
514
|
: false;
|
|
512
515
|
}
|
|
513
|
-
}
|
|
516
|
+
}
|
|
514
517
|
function createRangePicker(props) {
|
|
515
|
-
return
|
|
518
|
+
return DateRangePickerFactory.execute(props);
|
|
516
519
|
}
|
|
517
520
|
|
|
518
521
|
function RlsDayRangePicker({ date, disabled: disabledPicker, formControl, maxDate, minDate, rlsTheme }) {
|
|
@@ -545,7 +548,7 @@ function RlsDayRangePicker({ date, disabled: disabledPicker, formControl, maxDat
|
|
|
545
548
|
}, children: jsx("span", { className: "rls-day-range-picker__day__span", children: value || '??' }) }, index))) }, index))) })] }));
|
|
546
549
|
}
|
|
547
550
|
|
|
548
|
-
function RlsMoneyField({ children, decimals, disabled, formControl,
|
|
551
|
+
function RlsMoneyField({ children, decimals, disabled, formControl, placeholder, symbol, rlsTheme, value, onValue }) {
|
|
549
552
|
return (jsxs("div", { className: renderClassStatus('rls-box-field', {
|
|
550
553
|
focused: formControl?.focused,
|
|
551
554
|
error: formControl?.touched && !formControl?.valid,
|
|
@@ -555,7 +558,7 @@ function RlsMoneyField({ children, decimals, disabled, formControl, onValue, pla
|
|
|
555
558
|
|
|
556
559
|
const MONTH_MAX_VALUE = Month.January;
|
|
557
560
|
const MONTH_MIN_VALUE = Month.December;
|
|
558
|
-
class
|
|
561
|
+
class MonthPickerFactory {
|
|
559
562
|
constructor(props) {
|
|
560
563
|
const { date, value, maxDate, minDate } = props;
|
|
561
564
|
this.value = value;
|
|
@@ -564,20 +567,20 @@ class Factory {
|
|
|
564
567
|
this.minDate = minDate;
|
|
565
568
|
}
|
|
566
569
|
static execute(props) {
|
|
567
|
-
const factory = new
|
|
570
|
+
const factory = new MonthPickerFactory(props);
|
|
568
571
|
return [
|
|
569
|
-
factory.createMonth(
|
|
570
|
-
factory.createMonth(
|
|
571
|
-
factory.createMonth(
|
|
572
|
-
factory.createMonth(
|
|
573
|
-
factory.createMonth(
|
|
574
|
-
factory.createMonth(
|
|
575
|
-
factory.createMonth(
|
|
576
|
-
factory.createMonth(
|
|
577
|
-
factory.createMonth(
|
|
578
|
-
factory.createMonth(
|
|
579
|
-
factory.createMonth(
|
|
580
|
-
factory.createMonth(
|
|
572
|
+
factory.createMonth(Month.January),
|
|
573
|
+
factory.createMonth(Month.February),
|
|
574
|
+
factory.createMonth(Month.March),
|
|
575
|
+
factory.createMonth(Month.April),
|
|
576
|
+
factory.createMonth(Month.May),
|
|
577
|
+
factory.createMonth(Month.June),
|
|
578
|
+
factory.createMonth(Month.July),
|
|
579
|
+
factory.createMonth(Month.August),
|
|
580
|
+
factory.createMonth(Month.September),
|
|
581
|
+
factory.createMonth(Month.October),
|
|
582
|
+
factory.createMonth(Month.November),
|
|
583
|
+
factory.createMonth(Month.December)
|
|
581
584
|
];
|
|
582
585
|
}
|
|
583
586
|
createMonth(value) {
|
|
@@ -621,10 +624,10 @@ function isMaxLimitMonth(month, date, maxDate) {
|
|
|
621
624
|
return date.getFullYear() === maxYear && month >= maxMonth;
|
|
622
625
|
}
|
|
623
626
|
function createMonthPicker(props) {
|
|
624
|
-
return
|
|
627
|
+
return MonthPickerFactory.execute(props);
|
|
625
628
|
}
|
|
626
629
|
|
|
627
|
-
function RlsMonthPicker({ formControl, date, disabled: disabledPicker, maxDate, minDate, rlsTheme }) {
|
|
630
|
+
function RlsMonthPicker({ formControl, date, disabled: disabledPicker, maxDate, minDate, rlsTheme, onValue }) {
|
|
628
631
|
const initialDate = date || new Date();
|
|
629
632
|
const initialMonth = formControl?.state || initialDate.getMonth();
|
|
630
633
|
const [months, setMonths] = useState([]);
|
|
@@ -637,12 +640,20 @@ function RlsMonthPicker({ formControl, date, disabled: disabledPicker, maxDate,
|
|
|
637
640
|
maxDate
|
|
638
641
|
}));
|
|
639
642
|
}, [value, date, minDate, maxDate]);
|
|
643
|
+
function onChange(value) {
|
|
644
|
+
formControl?.setState(value);
|
|
645
|
+
setValue(value);
|
|
646
|
+
if (onValue) {
|
|
647
|
+
onValue(value);
|
|
648
|
+
}
|
|
649
|
+
}
|
|
640
650
|
return (jsx("div", { className: "rls-month-picker", "rls-theme": rlsTheme, children: months.map(({ label, value, disabled, selected }, index) => (jsx("div", { className: renderClassStatus('rls-month-picker__component', {
|
|
641
651
|
disabled: disabled || disabledPicker || false,
|
|
642
652
|
selected
|
|
643
653
|
}), onClick: () => {
|
|
644
|
-
|
|
645
|
-
|
|
654
|
+
if (!disabled) {
|
|
655
|
+
onChange(value);
|
|
656
|
+
}
|
|
646
657
|
}, children: jsx("span", { className: "rls-month-picker__span", children: label }) }, index))) }));
|
|
647
658
|
}
|
|
648
659
|
|
|
@@ -683,7 +694,7 @@ function RlsMonthTitlePicker({ monthControl, yearControl, date, maxDate, minDate
|
|
|
683
694
|
return (jsxs("div", { className: "rls-month-title-picker", children: [jsx(RlsButtonAction, { icon: "arrow-ios-left", onClick: onPreviousMonth, disabled: limitMinMonth }), jsx("span", { onClick: onClick, children: monthName }), jsx(RlsButtonAction, { icon: "arrow-ios-right", onClick: onNextMonth, disabled: limitMaxMonth })] }));
|
|
684
695
|
}
|
|
685
696
|
|
|
686
|
-
function RlsNumberField({ children, disabled, formControl,
|
|
697
|
+
function RlsNumberField({ children, disabled, formControl, placeholder, rlsTheme, value, onValue }) {
|
|
687
698
|
return (jsxs("div", { className: renderClassStatus('rls-box-field', {
|
|
688
699
|
focused: formControl?.focused,
|
|
689
700
|
error: formControl?.touched && !formControl?.valid,
|
|
@@ -733,7 +744,7 @@ function RlsPagination({ elements, count: defaultCount, filter, onElements, onPa
|
|
|
733
744
|
pagination.active = true;
|
|
734
745
|
setIndex(value);
|
|
735
746
|
setCurrentPagination(pagination);
|
|
736
|
-
refreshFromChanged(
|
|
747
|
+
refreshFromChanged(clonePage({ index: value }));
|
|
737
748
|
}
|
|
738
749
|
function goPagination(pagination) {
|
|
739
750
|
if (currentPagination) {
|
|
@@ -751,14 +762,14 @@ function RlsPagination({ elements, count: defaultCount, filter, onElements, onPa
|
|
|
751
762
|
else {
|
|
752
763
|
const prevIndex = value - MIN_NUMBER_PAGE;
|
|
753
764
|
if (prevIndex >= FIRST_PAGE) {
|
|
754
|
-
refreshFromChanged(
|
|
765
|
+
refreshFromChanged(clonePageFromIndex(prevIndex));
|
|
755
766
|
}
|
|
756
767
|
}
|
|
757
768
|
}
|
|
758
769
|
}
|
|
759
770
|
function goFirstPagination() {
|
|
760
771
|
if (collection.length) {
|
|
761
|
-
refreshFromChanged(
|
|
772
|
+
refreshFromChanged(clonePageFromIndex(FIRST_PAGE));
|
|
762
773
|
}
|
|
763
774
|
}
|
|
764
775
|
function goNextPagination() {
|
|
@@ -771,14 +782,14 @@ function RlsPagination({ elements, count: defaultCount, filter, onElements, onPa
|
|
|
771
782
|
else {
|
|
772
783
|
const nextIndex = value + 1;
|
|
773
784
|
if (nextIndex <= maxPage) {
|
|
774
|
-
refreshFromChanged(
|
|
785
|
+
refreshFromChanged(clonePageFromIndex(nextIndex));
|
|
775
786
|
}
|
|
776
787
|
}
|
|
777
788
|
}
|
|
778
789
|
}
|
|
779
790
|
function goLastPagination() {
|
|
780
791
|
if (collection.length) {
|
|
781
|
-
refreshFromChanged(
|
|
792
|
+
refreshFromChanged(clonePageFromIndex(maxPage - MIN_NUMBER_PAGE));
|
|
782
793
|
}
|
|
783
794
|
}
|
|
784
795
|
function createPageCollection(props) {
|
|
@@ -792,17 +803,11 @@ function RlsPagination({ elements, count: defaultCount, filter, onElements, onPa
|
|
|
792
803
|
}
|
|
793
804
|
function refreshFromElements(elements) {
|
|
794
805
|
elements.length
|
|
795
|
-
? refreshFromChanged(
|
|
806
|
+
? refreshFromChanged(refreshPage(elements, filter))
|
|
796
807
|
: rebootPagination();
|
|
797
808
|
}
|
|
798
809
|
function refreshFromFilter(filter) {
|
|
799
|
-
refreshFromChanged(
|
|
800
|
-
}
|
|
801
|
-
function createRefreshProps(elements, filter) {
|
|
802
|
-
const collection = refreshCollection(elements, filter);
|
|
803
|
-
const maxPage = refreshMaxPage(collection, count);
|
|
804
|
-
const index = refreshIndex(collection, maxPage);
|
|
805
|
-
return createPageProps({ collection, index, maxPage });
|
|
810
|
+
refreshFromChanged(refreshPage(elements, filter));
|
|
806
811
|
}
|
|
807
812
|
function refreshFromChanged(page) {
|
|
808
813
|
refreshPaginations(page);
|
|
@@ -830,13 +835,6 @@ function RlsPagination({ elements, count: defaultCount, filter, onElements, onPa
|
|
|
830
835
|
setIndex(newIndex);
|
|
831
836
|
return newIndex;
|
|
832
837
|
}
|
|
833
|
-
function rebootPagination() {
|
|
834
|
-
setCollection([]);
|
|
835
|
-
setMaxPage(0);
|
|
836
|
-
setIndex(0);
|
|
837
|
-
setPaginations([]);
|
|
838
|
-
onChangeElements([]);
|
|
839
|
-
}
|
|
840
838
|
function refreshDescription(page) {
|
|
841
839
|
const { collection, count, index } = page;
|
|
842
840
|
const totalCount = elements.length;
|
|
@@ -872,6 +870,23 @@ function RlsPagination({ elements, count: defaultCount, filter, onElements, onPa
|
|
|
872
870
|
}
|
|
873
871
|
setPaginations(paginations);
|
|
874
872
|
}
|
|
873
|
+
function clonePage(pagePartial) {
|
|
874
|
+
return {
|
|
875
|
+
collection: pagePartial.collection || collection,
|
|
876
|
+
index: typeof pagePartial.index === 'number' ? pagePartial.index : index,
|
|
877
|
+
count: pagePartial.count || count,
|
|
878
|
+
maxPage: typeof pagePartial.maxPage === 'number' ? pagePartial.maxPage : maxPage
|
|
879
|
+
};
|
|
880
|
+
}
|
|
881
|
+
function clonePageFromIndex(index) {
|
|
882
|
+
return clonePage({ index });
|
|
883
|
+
}
|
|
884
|
+
function refreshPage(elements, filter) {
|
|
885
|
+
const collection = refreshCollection(elements, filter);
|
|
886
|
+
const maxPage = refreshMaxPage(collection, count);
|
|
887
|
+
const index = refreshIndex(collection, maxPage);
|
|
888
|
+
return clonePage({ collection, index, maxPage });
|
|
889
|
+
}
|
|
875
890
|
function createPagination(value, index) {
|
|
876
891
|
const active = value === index;
|
|
877
892
|
const pagination = {
|
|
@@ -884,16 +899,12 @@ function RlsPagination({ elements, count: defaultCount, filter, onElements, onPa
|
|
|
884
899
|
}
|
|
885
900
|
return pagination;
|
|
886
901
|
}
|
|
887
|
-
function
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
index: typeof props.index === 'number' ? props.index : index,
|
|
894
|
-
count: props.count || count,
|
|
895
|
-
maxPage: typeof props.maxPage === 'number' ? props.maxPage : maxPage
|
|
896
|
-
};
|
|
902
|
+
function rebootPagination() {
|
|
903
|
+
setCollection([]);
|
|
904
|
+
setMaxPage(0);
|
|
905
|
+
setIndex(0);
|
|
906
|
+
setPaginations([]);
|
|
907
|
+
onChangeElements([]);
|
|
897
908
|
}
|
|
898
909
|
return (jsxs("div", { className: "rls-pagination", children: [jsxs("div", { className: "rls-pagination__actions", children: [jsx("button", { className: "rls-pagination__action", onClick: goFirstPagination, disabled: firstPage, children: jsx(RlsIcon, { value: "arrowhead-left" }) }), jsx("button", { className: "rls-pagination__action", onClick: goPreviousPagination, disabled: firstPage, children: jsx(RlsIcon, { value: "arrow-ios-left" }) })] }), jsx("div", { className: "rls-pagination__pages", children: paginations.map((page, index) => {
|
|
899
910
|
return (jsx("div", { className: renderClassStatus('rls-pagination__page', {
|
|
@@ -948,7 +959,7 @@ function RlsSwitchLabel({ children, disabled, extended, formControl, rlsTheme })
|
|
|
948
959
|
return (jsxs("div", { className: renderClassStatus('rls-switch-label', { disabled, extended }), "rls-theme": rlsTheme, children: [jsx("div", { className: "rls-switch-label__component", onClick: onToggle, children: jsx(RlsSwitch, { checked: checked, disabled: disabled }) }), jsx("label", { className: "rls-switch-label__text", children: children })] }));
|
|
949
960
|
}
|
|
950
961
|
|
|
951
|
-
function RlsTextField({ children, disabled, formControl,
|
|
962
|
+
function RlsTextField({ children, disabled, formControl, placeholder, rlsTheme, value, onValue }) {
|
|
952
963
|
return (jsxs("div", { className: renderClassStatus('rls-box-field', {
|
|
953
964
|
focused: formControl?.focused,
|
|
954
965
|
error: formControl?.touched && !formControl?.valid,
|
|
@@ -961,7 +972,7 @@ function RlsToolbar({ actions, children, subtitle }) {
|
|
|
961
972
|
}
|
|
962
973
|
|
|
963
974
|
const COUNT_YEAR_RANGE = 4;
|
|
964
|
-
class
|
|
975
|
+
class YearPickerFactory {
|
|
965
976
|
constructor(props) {
|
|
966
977
|
const { value, maxDate, minDate } = props;
|
|
967
978
|
this.value = value;
|
|
@@ -969,7 +980,7 @@ class FactoryYearPicker {
|
|
|
969
980
|
this.minDate = minDate;
|
|
970
981
|
}
|
|
971
982
|
static execute(props) {
|
|
972
|
-
const factory = new
|
|
983
|
+
const factory = new YearPickerFactory(props);
|
|
973
984
|
let year = props.year;
|
|
974
985
|
if (factory.minOverflowYear(year)) {
|
|
975
986
|
year = factory.minYear;
|
|
@@ -1040,10 +1051,10 @@ class FactoryYearPicker {
|
|
|
1040
1051
|
}
|
|
1041
1052
|
}
|
|
1042
1053
|
function createYearPicker(props) {
|
|
1043
|
-
return
|
|
1054
|
+
return YearPickerFactory.execute(props);
|
|
1044
1055
|
}
|
|
1045
1056
|
|
|
1046
|
-
function RlsYearPicker({ formControl, date: date, disabled: disabledPicker, maxDate, minDate, rlsTheme }) {
|
|
1057
|
+
function RlsYearPicker({ formControl, date: date, disabled: disabledPicker, maxDate, minDate, rlsTheme, onValue }) {
|
|
1047
1058
|
const initialDate = date || new Date();
|
|
1048
1059
|
const initialYear = formControl?.state || initialDate.getFullYear();
|
|
1049
1060
|
const [value, setValue] = useState(initialYear);
|
|
@@ -1072,12 +1083,15 @@ function RlsYearPicker({ formControl, date: date, disabled: disabledPicker, maxD
|
|
|
1072
1083
|
formControl?.setState(value);
|
|
1073
1084
|
setYear(value);
|
|
1074
1085
|
setValue(value);
|
|
1086
|
+
if (onValue) {
|
|
1087
|
+
onValue(value);
|
|
1088
|
+
}
|
|
1075
1089
|
}
|
|
1076
1090
|
return (jsxs("div", { className: "rls-year-picker", "rls-theme": rlsTheme, children: [jsxs("div", { className: "rls-year-picker__header", children: [jsx("div", { className: "rls-year-picker__action rls-year-picker__action--prev", children: jsx("button", { disabled: !template.hasPrevious || disabledPicker, onClick: onClickPrev, children: jsx(RlsIcon, { value: "arrow-ios-left" }) }) }), jsx("div", { className: "rls-year-picker__title", children: jsxs("label", { className: "title1-bold", children: [template.minRange, " - ", template.maxRange] }) }), jsx("div", { className: "rls-year-picker__action rls-year-picker__action--next", children: jsx("button", { disabled: !template.hasNext || disabledPicker, onClick: onClickNext, children: jsx(RlsIcon, { value: "arrow-ios-right" }) }) })] }), jsx("div", { className: "rls-year-picker__component", children: template.years.map(({ value, disabled, selected }, index) => (jsx("div", { className: renderClassStatus('rls-year-picker__year', {
|
|
1077
1091
|
disabled: disabled || disabledPicker,
|
|
1078
1092
|
selected
|
|
1079
1093
|
}), onClick: () => {
|
|
1080
|
-
if (value) {
|
|
1094
|
+
if (value && !disabled) {
|
|
1081
1095
|
onChange(value);
|
|
1082
1096
|
}
|
|
1083
1097
|
}, children: jsx("span", { className: "rls-year-picker__year__span body1-medium", children: value || '????' }) }, index))) })] }));
|
|
@@ -1265,24 +1279,22 @@ function useAutocompleteField({ suggestions, disabled, formControl, onSelect, on
|
|
|
1265
1279
|
});
|
|
1266
1280
|
const { collection, inputRef, setFocused, setValue, setVisible, navigationElement, navigationInput } = listControl;
|
|
1267
1281
|
const [changeInternal, setChangeInternal] = useState(false);
|
|
1282
|
+
useEffect(() => filterSuggestions(pattern, true), [suggestions]);
|
|
1283
|
+
useEffect(() => filterSuggestions(pattern), [pattern]);
|
|
1268
1284
|
useEffect(() => {
|
|
1269
|
-
|
|
1270
|
-
}, [suggestions]);
|
|
1271
|
-
useEffect(() => {
|
|
1272
|
-
filterSuggestions(pattern);
|
|
1273
|
-
}, [pattern]);
|
|
1274
|
-
useEffect(() => {
|
|
1275
|
-
if (!changeInternal) {
|
|
1276
|
-
redefineDescription();
|
|
1277
|
-
}
|
|
1278
|
-
setChangeInternal(false);
|
|
1285
|
+
changeInternal ? setChangeInternal(false) : resetComponent();
|
|
1279
1286
|
}, [formControl?.state]);
|
|
1280
|
-
useEffect(() =>
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1287
|
+
useEffect(() => setValue(requestCurrentElement()?.description || ''), [collection]);
|
|
1288
|
+
function requestCurrentElement() {
|
|
1289
|
+
return formControl?.state && collection.find(formControl.state);
|
|
1290
|
+
}
|
|
1291
|
+
function resetComponent() {
|
|
1292
|
+
const element = requestCurrentElement();
|
|
1285
1293
|
setValue(element?.description || '');
|
|
1294
|
+
if (!element) {
|
|
1295
|
+
setChangeInternal(true);
|
|
1296
|
+
formControl?.setState(undefined);
|
|
1297
|
+
}
|
|
1286
1298
|
}
|
|
1287
1299
|
function onClickControl() {
|
|
1288
1300
|
if (!disabled) {
|
|
@@ -1644,7 +1656,7 @@ const VISIBILITY$1 = {
|
|
|
1644
1656
|
year: true
|
|
1645
1657
|
}
|
|
1646
1658
|
};
|
|
1647
|
-
function RlsDatePicker({ automatic, date, formControl, disabled, maxDate, minDate,
|
|
1659
|
+
function RlsDatePicker({ automatic, date, formControl, disabled, maxDate, minDate, rlsTheme, onListener }) {
|
|
1648
1660
|
const dateInitial = formControl?.state || date || new Date();
|
|
1649
1661
|
const yearControl = useReactControl({ state: dateInitial.getFullYear() });
|
|
1650
1662
|
const dayControl = useReactControl({ state: dateInitial.getDate() });
|
|
@@ -1717,7 +1729,7 @@ function RlsModal({ children, visible, rlsTheme }) {
|
|
|
1717
1729
|
return ReactDOM.createPortal(jsxs("div", { className: renderClassStatus('rls-modal', { visible }), "rls-theme": rlsTheme, children: [jsx("div", { className: "rls-modal__component", children: children }), jsx("div", { className: "rls-modal__backdrop" })] }), document.body);
|
|
1718
1730
|
}
|
|
1719
1731
|
|
|
1720
|
-
function RlsDateField({ children, date, disabled, formControl, maxDate, minDate, placeholder, rlsTheme }) {
|
|
1732
|
+
function RlsDateField({ children, date, disabled, formControl, maxDate, minDate, placeholder, rlsTheme, onValue }) {
|
|
1721
1733
|
const dateInitial = formControl?.state || date || new Date();
|
|
1722
1734
|
const [value, setValue] = useState(dateInitial);
|
|
1723
1735
|
const [show, setShow] = useState(false);
|
|
@@ -1728,10 +1740,18 @@ function RlsDateField({ children, date, disabled, formControl, maxDate, minDate,
|
|
|
1728
1740
|
function onClickInput() {
|
|
1729
1741
|
setShow(true);
|
|
1730
1742
|
}
|
|
1743
|
+
function onChange(value, ignoreControl = false) {
|
|
1744
|
+
if (!ignoreControl) {
|
|
1745
|
+
formControl?.setState(undefined);
|
|
1746
|
+
}
|
|
1747
|
+
setValue(undefined);
|
|
1748
|
+
if (onValue) {
|
|
1749
|
+
onValue(value);
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1731
1752
|
function onClean() {
|
|
1732
1753
|
if (value) {
|
|
1733
|
-
|
|
1734
|
-
setValue(undefined);
|
|
1754
|
+
onChange(undefined);
|
|
1735
1755
|
if (formControl && !formControl.touched) {
|
|
1736
1756
|
formControl.touch();
|
|
1737
1757
|
}
|
|
@@ -1740,9 +1760,9 @@ function RlsDateField({ children, date, disabled, formControl, maxDate, minDate,
|
|
|
1740
1760
|
setShow(true);
|
|
1741
1761
|
}
|
|
1742
1762
|
}
|
|
1743
|
-
return (jsxs("div", { className: "rls-date-field", "rls-theme": rlsTheme, children: [jsxs("div", { className: renderClassStatus('rls-box-field', { disabled }), children: [children && jsx("label", { className: "rls-box-field__label", children: children }), jsx("div", { className: "rls-box-field__component", children: jsxs("div", { className: "rls-box-field__body", children: [jsx("input", { className: "rls-date-field__control", type: "text", value: description, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), jsx("button", { className: "rls-date-field__action", onClick: onClean, disabled: disabled, children: jsx(RlsIcon, { value: value ? 'trash-2' : 'calendar' }) })] }) }), formControl?.touched && formControl?.error && (jsx("div", { className: "rls-box-field__error", children: jsx(RlsMessageIcon, { icon: "alert-triangle", rlsTheme: "danger", children: formControl.error.message }) }))] }), jsx(RlsModal, { visible: show, children: jsx(RlsDatePicker, { formControl: formControl, date: date, disabled: disabled, maxDate: maxDate, minDate: minDate, onListener: ({ value }) => {
|
|
1744
|
-
if (
|
|
1745
|
-
|
|
1763
|
+
return (jsxs("div", { className: "rls-date-field", "rls-theme": rlsTheme, children: [jsxs("div", { className: renderClassStatus('rls-box-field', { disabled }), children: [children && jsx("label", { className: "rls-box-field__label", children: children }), jsx("div", { className: "rls-box-field__component", children: jsxs("div", { className: "rls-box-field__body", children: [jsx("input", { className: "rls-date-field__control", type: "text", value: description, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), jsx("button", { className: "rls-date-field__action", onClick: onClean, disabled: disabled, children: jsx(RlsIcon, { value: value ? 'trash-2' : 'calendar' }) })] }) }), formControl?.touched && formControl?.error && (jsx("div", { className: "rls-box-field__error", children: jsx(RlsMessageIcon, { icon: "alert-triangle", rlsTheme: "danger", children: formControl.error.message }) }))] }), jsx(RlsModal, { visible: show, children: jsx(RlsDatePicker, { formControl: formControl, date: date, disabled: disabled, maxDate: maxDate, minDate: minDate, onListener: ({ value, type }) => {
|
|
1764
|
+
if (type !== PickerListenerType.Cancel) {
|
|
1765
|
+
onChange(value, true);
|
|
1746
1766
|
}
|
|
1747
1767
|
setShow(false);
|
|
1748
1768
|
if (formControl && !formControl.touched) {
|
|
@@ -1869,17 +1889,19 @@ function useSelectField({ suggestions, formControl, onSelect, onValue }) {
|
|
|
1869
1889
|
const { collection, inputRef, visible, setFocused, setValue, setVisible, navigationElement, navigationInput } = listControl;
|
|
1870
1890
|
const [changeInternal, setChangeInternal] = useState(false);
|
|
1871
1891
|
useEffect(() => {
|
|
1872
|
-
|
|
1873
|
-
redefineDescription();
|
|
1874
|
-
}
|
|
1875
|
-
setChangeInternal(false);
|
|
1892
|
+
changeInternal ? setChangeInternal(false) : resetComponent();
|
|
1876
1893
|
}, [formControl?.state]);
|
|
1877
|
-
useEffect(() =>
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1894
|
+
useEffect(() => setValue(requestCurrentElement()?.description || ''), [collection]);
|
|
1895
|
+
function requestCurrentElement() {
|
|
1896
|
+
return formControl?.state && collection.find(formControl.state);
|
|
1897
|
+
}
|
|
1898
|
+
function resetComponent() {
|
|
1899
|
+
const element = requestCurrentElement();
|
|
1882
1900
|
setValue(element?.description || '');
|
|
1901
|
+
if (!element) {
|
|
1902
|
+
setChangeInternal(true);
|
|
1903
|
+
formControl?.setState(undefined);
|
|
1904
|
+
}
|
|
1883
1905
|
}
|
|
1884
1906
|
function onFocusInput() {
|
|
1885
1907
|
setFocused(true);
|