@rolster/react-components 18.20.7 → 18.21.5
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/assets/{index-Cp7p-Y-D.css → index-B4R0Qgg4.css} +21 -21
- package/dist/cjs/index.js +1080 -651
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/assets/{index-Cp7p-Y-D.css → index-B4R0Qgg4.css} +21 -21
- package/dist/es/index.js +1078 -649
- package/dist/es/index.js.map +1 -1
- package/dist/esm/components/atoms/Avatar/Avatar.js +6 -2
- package/dist/esm/components/atoms/Avatar/Avatar.js.map +1 -1
- package/dist/esm/components/atoms/Breadcrumb/Breadcrumb.js +10 -3
- package/dist/esm/components/atoms/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/esm/components/atoms/Button/Button.js +6 -2
- package/dist/esm/components/atoms/Button/Button.js.map +1 -1
- package/dist/esm/components/atoms/CheckBox/CheckBox.css +1 -1
- package/dist/esm/components/atoms/CheckBox/CheckBox.js +10 -5
- package/dist/esm/components/atoms/CheckBox/CheckBox.js.map +1 -1
- package/dist/esm/components/atoms/Icon/Icon.js +6 -2
- package/dist/esm/components/atoms/Icon/Icon.js.map +1 -1
- package/dist/esm/components/atoms/Input/Input.js +9 -6
- package/dist/esm/components/atoms/Input/Input.js.map +1 -1
- package/dist/esm/components/atoms/InputPassword/InputPassword.js +8 -5
- package/dist/esm/components/atoms/InputPassword/InputPassword.js.map +1 -1
- package/dist/esm/components/atoms/Poster/Poster.js +6 -2
- package/dist/esm/components/atoms/Poster/Poster.js.map +1 -1
- package/dist/esm/components/atoms/ProgressBar/ProgressBar.js +6 -2
- package/dist/esm/components/atoms/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/esm/components/atoms/RadioButton/RadioButton.css +1 -1
- package/dist/esm/components/atoms/RadioButton/RadioButton.js +6 -2
- package/dist/esm/components/atoms/RadioButton/RadioButton.js.map +1 -1
- package/dist/esm/components/atoms/Switch/Switch.css +1 -1
- package/dist/esm/components/atoms/Switch/Switch.js +10 -5
- package/dist/esm/components/atoms/Switch/Switch.js.map +1 -1
- package/dist/esm/components/definitions.d.ts +1 -1
- package/dist/esm/components/molecules/Alert/Alert.js +7 -3
- package/dist/esm/components/molecules/Alert/Alert.js.map +1 -1
- package/dist/esm/components/molecules/Ballot/Ballot.js +8 -3
- package/dist/esm/components/molecules/Ballot/Ballot.js.map +1 -1
- package/dist/esm/components/molecules/ButtonProgress/ButtonProgress.js +8 -3
- package/dist/esm/components/molecules/ButtonProgress/ButtonProgress.js.map +1 -1
- package/dist/esm/components/molecules/ButtonToggle/ButtonToggle.css +2 -2
- package/dist/esm/components/molecules/ButtonToggle/ButtonToggle.d.ts +1 -1
- package/dist/esm/components/molecules/ButtonToggle/ButtonToggle.js +11 -9
- package/dist/esm/components/molecules/ButtonToggle/ButtonToggle.js.map +1 -1
- package/dist/esm/components/molecules/FieldMoney/FieldMoney.js +14 -5
- package/dist/esm/components/molecules/FieldMoney/FieldMoney.js.map +1 -1
- package/dist/esm/components/molecules/FieldNumber/FieldNumber.js +14 -5
- package/dist/esm/components/molecules/FieldNumber/FieldNumber.js.map +1 -1
- package/dist/esm/components/molecules/FieldPassword/FieldPassword.js +15 -6
- package/dist/esm/components/molecules/FieldPassword/FieldPassword.js.map +1 -1
- package/dist/esm/components/molecules/FieldText/FieldText.js +14 -5
- package/dist/esm/components/molecules/FieldText/FieldText.js.map +1 -1
- package/dist/esm/components/molecules/LabelCheckBox/LabelCheckBox.js +7 -7
- package/dist/esm/components/molecules/LabelCheckBox/LabelCheckBox.js.map +1 -1
- package/dist/esm/components/molecules/LabelRadioButton/LabelRadioButton.js +7 -7
- package/dist/esm/components/molecules/LabelRadioButton/LabelRadioButton.js.map +1 -1
- package/dist/esm/components/molecules/LabelSwitch/LabelSwitch.js +7 -7
- package/dist/esm/components/molecules/LabelSwitch/LabelSwitch.js.map +1 -1
- package/dist/esm/components/molecules/MessageFormError/MessageFormError.js +16 -2
- package/dist/esm/components/molecules/MessageFormError/MessageFormError.js.map +1 -1
- package/dist/esm/components/molecules/Pagination/Pagination.js +23 -32
- package/dist/esm/components/molecules/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/molecules/PickerDay/PickerDay.d.ts +1 -1
- package/dist/esm/components/molecules/PickerDay/PickerDay.js +53 -24
- package/dist/esm/components/molecules/PickerDay/PickerDay.js.map +1 -1
- package/dist/esm/components/molecules/PickerDayRange/PickerDayRange.d.ts +1 -1
- package/dist/esm/components/molecules/PickerDayRange/PickerDayRange.js +55 -29
- package/dist/esm/components/molecules/PickerDayRange/PickerDayRange.js.map +1 -1
- package/dist/esm/components/molecules/PickerMonth/PickerMonth.d.ts +1 -1
- package/dist/esm/components/molecules/PickerMonth/PickerMonth.js +57 -34
- package/dist/esm/components/molecules/PickerMonth/PickerMonth.js.map +1 -1
- package/dist/esm/components/molecules/{PickerMonthTitle/PickerMonthTitle.css → PickerSelectorTitle/PickerSelectorTitle.css} +3 -3
- package/dist/esm/components/molecules/PickerSelectorTitle/PickerSelectorTitle.d.ts +15 -0
- package/dist/esm/components/molecules/PickerSelectorTitle/PickerSelectorTitle.js +65 -0
- package/dist/esm/components/molecules/PickerSelectorTitle/PickerSelectorTitle.js.map +1 -0
- package/dist/esm/components/molecules/PickerYear/PickerYear.css +7 -7
- package/dist/esm/components/molecules/PickerYear/PickerYear.d.ts +1 -1
- package/dist/esm/components/molecules/PickerYear/PickerYear.js +45 -38
- package/dist/esm/components/molecules/PickerYear/PickerYear.js.map +1 -1
- package/dist/esm/components/molecules/index.d.ts +1 -1
- package/dist/esm/components/molecules/index.js +1 -1
- package/dist/esm/components/molecules/index.js.map +1 -1
- package/dist/esm/components/organisms/Card/Card.js +6 -2
- package/dist/esm/components/organisms/Card/Card.js.map +1 -1
- package/dist/esm/components/organisms/Confirmation/Confirmation.css +5 -5
- package/dist/esm/components/organisms/Confirmation/Confirmation.d.ts +1 -1
- package/dist/esm/components/organisms/Confirmation/Confirmation.js +7 -4
- package/dist/esm/components/organisms/Confirmation/Confirmation.js.map +1 -1
- package/dist/esm/components/organisms/Datatable/Datatable.js +31 -9
- package/dist/esm/components/organisms/Datatable/Datatable.js.map +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.d.ts +5 -5
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js +43 -18
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js.map +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocompleteController.js +50 -41
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocompleteController.js.map +1 -1
- package/dist/esm/components/organisms/FieldDate/FieldDate.d.ts +5 -4
- package/dist/esm/components/organisms/FieldDate/FieldDate.js +39 -30
- package/dist/esm/components/organisms/FieldDate/FieldDate.js.map +1 -1
- package/dist/esm/components/organisms/FieldDateRange/FieldDateRange.d.ts +5 -4
- package/dist/esm/components/organisms/FieldDateRange/FieldDateRange.js +35 -26
- package/dist/esm/components/organisms/FieldDateRange/FieldDateRange.js.map +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js +35 -13
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js.map +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelectController.js +41 -29
- package/dist/esm/components/organisms/FieldSelect/FieldSelectController.js.map +1 -1
- package/dist/esm/components/organisms/FormNavigation/FormNavigation.js +6 -2
- package/dist/esm/components/organisms/FormNavigation/FormNavigation.js.map +1 -1
- package/dist/esm/components/organisms/Modal/Modal.js +6 -2
- package/dist/esm/components/organisms/Modal/Modal.js.map +1 -1
- package/dist/esm/components/organisms/PickerDate/PickerDate.css +1 -1
- package/dist/esm/components/organisms/PickerDate/PickerDate.js +76 -53
- package/dist/esm/components/organisms/PickerDate/PickerDate.js.map +1 -1
- package/dist/esm/components/organisms/PickerDateRange/PickerDateRange.d.ts +1 -1
- package/dist/esm/components/organisms/PickerDateRange/PickerDateRange.js +61 -40
- package/dist/esm/components/organisms/PickerDateRange/PickerDateRange.js.map +1 -1
- package/dist/esm/components/organisms/Snackbar/Snackbar.d.ts +1 -1
- package/dist/esm/components/organisms/Snackbar/Snackbar.js +32 -22
- package/dist/esm/components/organisms/Snackbar/Snackbar.js.map +1 -1
- package/dist/esm/context.js +6 -5
- package/dist/esm/context.js.map +1 -1
- package/dist/esm/controllers/ListController.js +7 -5
- package/dist/esm/controllers/ListController.js.map +1 -1
- package/dist/esm/controllers/index.d.ts +0 -1
- package/dist/esm/controllers/index.js +0 -1
- package/dist/esm/controllers/index.js.map +1 -1
- package/dist/esm/helpers/css.js +7 -10
- package/dist/esm/helpers/css.js.map +1 -1
- package/dist/esm/helpers/index.d.ts +1 -0
- package/dist/esm/helpers/index.js +1 -0
- package/dist/esm/helpers/index.js.map +1 -1
- package/dist/esm/helpers/language.d.ts +4 -0
- package/dist/esm/helpers/language.js +102 -0
- package/dist/esm/helpers/language.js.map +1 -0
- package/package.json +6 -6
- package/dist/esm/components/molecules/PickerMonthTitle/PickerMonthTitle.d.ts +0 -15
- package/dist/esm/components/molecules/PickerMonthTitle/PickerMonthTitle.js +0 -53
- package/dist/esm/components/molecules/PickerMonthTitle/PickerMonthTitle.js.map +0 -1
- package/dist/esm/controllers/RenderClassStatusController.d.ts +0 -2
- package/dist/esm/controllers/RenderClassStatusController.js +0 -10
- package/dist/esm/controllers/RenderClassStatusController.js.map +0 -1
package/dist/cjs/index.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
var require$$0 = require('react');
|
|
4
4
|
var commons = require('@rolster/commons');
|
|
5
|
-
var components = require('@rolster/components');
|
|
6
5
|
var dates = require('@rolster/dates');
|
|
7
|
-
var ReactDOM = require('react-dom');
|
|
8
6
|
var i18n = require('@rolster/i18n');
|
|
7
|
+
var components = require('@rolster/components');
|
|
8
|
+
var ReactDOM = require('react-dom');
|
|
9
9
|
var reactForms = require('@rolster/react-forms');
|
|
10
10
|
|
|
11
11
|
var jsxRuntime = {exports: {}};
|
|
@@ -1363,151 +1363,16 @@ function RlsAmount({ value, decimals, rlsTheme, symbol }) {
|
|
|
1363
1363
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-amount", "rls-theme": rlsTheme, children: [symbol && jsxRuntimeExports.jsx("span", { children: symbol }), jsxRuntimeExports.jsx(RlsTabularText, { value: commons.currencyFormat({ value, decimals }) })] }));
|
|
1364
1364
|
}
|
|
1365
1365
|
|
|
1366
|
-
function createObserver(options) {
|
|
1367
|
-
const { setScrolleable, table } = options;
|
|
1368
|
-
const observer = new ResizeObserver(() => {
|
|
1369
|
-
const scrollHeight = table.scrollHeight || 0;
|
|
1370
|
-
const clientHeight = table.clientHeight || 0;
|
|
1371
|
-
setScrolleable(scrollHeight > clientHeight);
|
|
1372
|
-
});
|
|
1373
|
-
observer.observe(table);
|
|
1374
|
-
return observer;
|
|
1375
|
-
}
|
|
1376
|
-
function useDatatable() {
|
|
1377
|
-
const [scrolleable, setScrolleable] = require$$0.useState(false);
|
|
1378
|
-
const tableRef = require$$0.useRef(null);
|
|
1379
|
-
require$$0.useEffect(() => {
|
|
1380
|
-
const observer = tableRef?.current &&
|
|
1381
|
-
createObserver({ setScrolleable, table: tableRef?.current });
|
|
1382
|
-
return () => {
|
|
1383
|
-
observer?.disconnect();
|
|
1384
|
-
};
|
|
1385
|
-
}, []);
|
|
1386
|
-
return { scrolleable, tableRef };
|
|
1387
|
-
}
|
|
1388
|
-
|
|
1389
|
-
function useListController(props) {
|
|
1390
|
-
const { suggestions, automatic, formControl, reference } = props;
|
|
1391
|
-
const listIsOpen = require$$0.useRef(false);
|
|
1392
|
-
const contentRef = require$$0.useRef(null);
|
|
1393
|
-
const listRef = require$$0.useRef(null);
|
|
1394
|
-
const inputRef = require$$0.useRef(null);
|
|
1395
|
-
const [collection, setCollection] = require$$0.useState(new components.ListCollection(suggestions));
|
|
1396
|
-
const [state, refreshState] = require$$0.useState({
|
|
1397
|
-
focused: false,
|
|
1398
|
-
higher: false,
|
|
1399
|
-
value: '',
|
|
1400
|
-
modalIsVisible: false
|
|
1401
|
-
});
|
|
1402
|
-
const position = require$$0.useRef(0);
|
|
1403
|
-
const valueProtected = require$$0.useRef();
|
|
1404
|
-
const changeValueInternal = require$$0.useRef(false);
|
|
1405
|
-
require$$0.useEffect(() => {
|
|
1406
|
-
function onCloseSuggestions({ target }) {
|
|
1407
|
-
!contentRef?.current?.contains(target) &&
|
|
1408
|
-
refreshState((state) => ({ ...state, modalIsVisible: false }));
|
|
1409
|
-
}
|
|
1410
|
-
document.addEventListener('click', onCloseSuggestions);
|
|
1411
|
-
return () => {
|
|
1412
|
-
document.removeEventListener('click', onCloseSuggestions);
|
|
1413
|
-
};
|
|
1414
|
-
}, []);
|
|
1415
|
-
require$$0.useEffect(() => {
|
|
1416
|
-
if (!listIsOpen.current && state.modalIsVisible) {
|
|
1417
|
-
listIsOpen.current = true;
|
|
1418
|
-
}
|
|
1419
|
-
if (listIsOpen.current && !state.modalIsVisible) {
|
|
1420
|
-
formControl?.touch();
|
|
1421
|
-
}
|
|
1422
|
-
refreshState((state) => ({
|
|
1423
|
-
...state,
|
|
1424
|
-
higher: components.locationListCanTop(contentRef.current, listRef.current)
|
|
1425
|
-
}));
|
|
1426
|
-
}, [state.modalIsVisible]);
|
|
1427
|
-
require$$0.useEffect(() => {
|
|
1428
|
-
setCollection(new components.ListCollection(suggestions, reference));
|
|
1429
|
-
}, [suggestions]);
|
|
1430
|
-
require$$0.useEffect(() => {
|
|
1431
|
-
if (!changeValueInternal.current) {
|
|
1432
|
-
if (formControl?.value) {
|
|
1433
|
-
const element = collection.find(formControl.value);
|
|
1434
|
-
if (!element) {
|
|
1435
|
-
valueProtected.current = formControl.value;
|
|
1436
|
-
automatic
|
|
1437
|
-
? setFormValue(collection.value[0], true)
|
|
1438
|
-
: setFormValue(undefined);
|
|
1439
|
-
}
|
|
1440
|
-
else {
|
|
1441
|
-
refreshState((state) => ({ ...state, value: element.description }));
|
|
1442
|
-
}
|
|
1443
|
-
}
|
|
1444
|
-
else if (valueProtected.current) {
|
|
1445
|
-
const element = collection.find(valueProtected.current);
|
|
1446
|
-
element && setFormValue(element);
|
|
1447
|
-
}
|
|
1448
|
-
else {
|
|
1449
|
-
automatic && setFormValue(collection.value[0], true);
|
|
1450
|
-
}
|
|
1451
|
-
}
|
|
1452
|
-
changeValueInternal.current = false;
|
|
1453
|
-
}, [collection, formControl?.value]);
|
|
1454
|
-
const setState = require$$0.useCallback((state) => {
|
|
1455
|
-
refreshState((_state) => ({ ..._state, ...state }));
|
|
1456
|
-
}, []);
|
|
1457
|
-
const setFormValue = require$$0.useCallback((element, initialValue = false) => {
|
|
1458
|
-
refreshState((state) => ({
|
|
1459
|
-
...state,
|
|
1460
|
-
value: element?.description || ''
|
|
1461
|
-
}));
|
|
1462
|
-
changeValueInternal.current = true;
|
|
1463
|
-
initialValue
|
|
1464
|
-
? formControl?.setInitialValue(element?.value)
|
|
1465
|
-
: formControl?.setValue(element?.value);
|
|
1466
|
-
}, [formControl]);
|
|
1467
|
-
const navigationInput = require$$0.useCallback((event) => {
|
|
1468
|
-
if (state.modalIsVisible) {
|
|
1469
|
-
const _position = components.navigationListFromInput({
|
|
1470
|
-
content: contentRef.current,
|
|
1471
|
-
event: event,
|
|
1472
|
-
list: listRef.current
|
|
1473
|
-
});
|
|
1474
|
-
position.current = _position ?? 0;
|
|
1475
|
-
}
|
|
1476
|
-
}, [state.modalIsVisible]);
|
|
1477
|
-
const navigationElement = require$$0.useCallback((event) => {
|
|
1478
|
-
position.current = components.navigationListFromElement({
|
|
1479
|
-
content: contentRef.current,
|
|
1480
|
-
event: event,
|
|
1481
|
-
input: inputRef.current,
|
|
1482
|
-
list: listRef.current,
|
|
1483
|
-
position: position.current
|
|
1484
|
-
});
|
|
1485
|
-
}, [state.modalIsVisible]);
|
|
1486
|
-
return {
|
|
1487
|
-
...state,
|
|
1488
|
-
contentRef,
|
|
1489
|
-
inputRef,
|
|
1490
|
-
listRef,
|
|
1491
|
-
navigationElement,
|
|
1492
|
-
navigationInput,
|
|
1493
|
-
setFormValue,
|
|
1494
|
-
setState
|
|
1495
|
-
};
|
|
1496
|
-
}
|
|
1497
|
-
|
|
1498
1366
|
function renderClassStatus(base, status = {}, additionals) {
|
|
1499
|
-
const
|
|
1367
|
+
const _classElement = [base];
|
|
1500
1368
|
Object.entries(status).forEach(([key, state]) => {
|
|
1501
|
-
|
|
1502
|
-
typeof state === 'string'
|
|
1503
|
-
?
|
|
1504
|
-
:
|
|
1505
|
-
}
|
|
1369
|
+
state &&
|
|
1370
|
+
(typeof state === 'string'
|
|
1371
|
+
? _classElement.push(`${base}--${state}`)
|
|
1372
|
+
: _classElement.push(`${base}--${key}`));
|
|
1506
1373
|
});
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
}
|
|
1510
|
-
return resultClass.join(' ');
|
|
1374
|
+
additionals && _classElement.push(additionals);
|
|
1375
|
+
return _classElement.join(' ').trim();
|
|
1511
1376
|
}
|
|
1512
1377
|
|
|
1513
1378
|
const DATE_RANGE_FORMAT = '{dd}/{mx}/{aa}';
|
|
@@ -1518,34 +1383,142 @@ function rangeFormatTemplate({ maxDate, minDate }) {
|
|
|
1518
1383
|
return `${minFormat} - ${maxFormat}`;
|
|
1519
1384
|
}
|
|
1520
1385
|
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1386
|
+
const errorsDictionary = {
|
|
1387
|
+
es: {
|
|
1388
|
+
alphabetic: 'Campo solo permite caracteres',
|
|
1389
|
+
alphanumber: 'Campo solo permite caracteres y número',
|
|
1390
|
+
decimal: 'Campo debe ser número decimal',
|
|
1391
|
+
defined: 'Campo debe estar definido',
|
|
1392
|
+
email: 'Campo debe ser correo electrónico',
|
|
1393
|
+
greaterThanValue: 'Campo debe tener un valor mayor a {thanValue}',
|
|
1394
|
+
greaterOrEqualsThanValue: 'Campo debe tener un valor mayor o igual a {thanValue}',
|
|
1395
|
+
lessThanValue: 'Campo debe tener un valor menor a {thanValue}',
|
|
1396
|
+
lessOrEqualsThanValue: 'Campo debe tener un valor menor o igual a {thanValue}',
|
|
1397
|
+
maxValue: 'Campo debe tener un valor máximo de {thanValue}',
|
|
1398
|
+
minValue: 'Campo debe tener un valor mínimo de {thanValue}',
|
|
1399
|
+
nickname: 'Campo inválido para nombre de usuario',
|
|
1400
|
+
onlynumber: 'Campo debe ser númerico',
|
|
1401
|
+
password: 'Campo no permitido para password',
|
|
1402
|
+
reqlength: 'Campo debe tener {length} caracter(es)',
|
|
1403
|
+
required: 'Campo es requerido',
|
|
1404
|
+
strMinlength: 'Campo debe tener mínimo {length} caracter(es)',
|
|
1405
|
+
strMaxlength: 'Campo debe tener máximo {length} caracter(es)',
|
|
1406
|
+
textonly: 'Campo solo permite caracteres (sin espacio)',
|
|
1407
|
+
_unknown: 'Campo inválido {error}'
|
|
1408
|
+
},
|
|
1409
|
+
en: {
|
|
1410
|
+
alphabetic: 'Field only allows characters',
|
|
1411
|
+
alphanumber: 'Field only allows characters and number',
|
|
1412
|
+
decimal: 'Field must be decimal number',
|
|
1413
|
+
defined: 'Field must be defined',
|
|
1414
|
+
email: 'Field must be email',
|
|
1415
|
+
greaterThanValue: 'Field must have a value greater than {thanValue}',
|
|
1416
|
+
greaterOrEqualsThanValue: 'Field must have a value greater than or equal to {thanValue}',
|
|
1417
|
+
lessThanValue: 'Field must have a value less than {thanValue}',
|
|
1418
|
+
lessOrEqualsThanValue: 'Field must have a value less than or equal to {thanValue}',
|
|
1419
|
+
minValue: 'Field must have a minimum value of {thanValue}',
|
|
1420
|
+
maxValue: 'Field must have a maximum value of {thanValue}',
|
|
1421
|
+
nickname: 'Invalid field for username',
|
|
1422
|
+
onlynumber: 'Field must be numeric',
|
|
1423
|
+
password: 'Field not allowed for password',
|
|
1424
|
+
reqlength: 'Field must be {length} characters',
|
|
1425
|
+
required: 'Field is required',
|
|
1426
|
+
strMinlength: 'Field must have minimum {length} characters',
|
|
1427
|
+
strMaxlength: 'Field must have maximum {length} characters',
|
|
1428
|
+
textonly: 'Field only allows characters (no space)',
|
|
1429
|
+
_unknown: 'Invalid field {error}'
|
|
1430
|
+
},
|
|
1431
|
+
fr: {
|
|
1432
|
+
alphabetic: 'Field only allows characters',
|
|
1433
|
+
alphanumber: 'Field only allows characters and number',
|
|
1434
|
+
decimal: 'Field must be decimal number',
|
|
1435
|
+
defined: 'Field must be defined',
|
|
1436
|
+
email: 'Field must be email',
|
|
1437
|
+
greaterThanValue: 'Field must have a value greater than {thanValue}',
|
|
1438
|
+
greaterOrEqualsThanValue: 'Field must have a value greater than or equal to {thanValue}',
|
|
1439
|
+
lessThanValue: 'Field must have a value less than {thanValue}',
|
|
1440
|
+
lessOrEqualsThanValue: 'Field must have a value less than or equal to {thanValue}',
|
|
1441
|
+
minValue: 'Field must have a minimum value of {thanValue}',
|
|
1442
|
+
maxValue: 'Field must have a maximum value of {thanValue}',
|
|
1443
|
+
nickname: 'Invalid field for username',
|
|
1444
|
+
onlynumber: 'Field must be numeric',
|
|
1445
|
+
password: 'Field not allowed for password',
|
|
1446
|
+
reqlength: 'Field must be {length} characters',
|
|
1447
|
+
required: 'Field is required',
|
|
1448
|
+
strMinlength: 'Field must have minimum {length} characters',
|
|
1449
|
+
strMaxlength: 'Field must have maximum {length} characters',
|
|
1450
|
+
textonly: 'Field only allows characters (no space)',
|
|
1451
|
+
_unknown: 'Invalid field {error}'
|
|
1452
|
+
},
|
|
1453
|
+
pt: {
|
|
1454
|
+
alphabetic: 'Field only allows characters',
|
|
1455
|
+
alphanumber: 'Field only allows characters and number',
|
|
1456
|
+
decimal: 'Field must be decimal number',
|
|
1457
|
+
defined: 'Field must be defined',
|
|
1458
|
+
email: 'Field must be email',
|
|
1459
|
+
greaterThanValue: 'Field must have a value greater than {thanValue}',
|
|
1460
|
+
greaterOrEqualsThanValue: 'Field must have a value greater than or equal to {thanValue}',
|
|
1461
|
+
lessThanValue: 'Field must have a value less than {thanValue}',
|
|
1462
|
+
lessOrEqualsThanValue: 'Field must have a value less than or equal to {thanValue}',
|
|
1463
|
+
minValue: 'Field must have a minimum value of {thanValue}',
|
|
1464
|
+
maxValue: 'Field must have a maximum value of {thanValue}',
|
|
1465
|
+
nickname: 'Invalid field for username',
|
|
1466
|
+
onlynumber: 'Field must be numeric',
|
|
1467
|
+
password: 'Field not allowed for password',
|
|
1468
|
+
reqlength: 'Field must be {thanValue} characters',
|
|
1469
|
+
required: 'Field is required',
|
|
1470
|
+
strMinlength: 'Field must have minimum {thanValue} characters',
|
|
1471
|
+
strMaxlength: 'Field must have maximum {thanValue} characters',
|
|
1472
|
+
textonly: 'Field only allows characters (no space)',
|
|
1473
|
+
_unknown: 'Invalid field {error}'
|
|
1474
|
+
}
|
|
1475
|
+
};
|
|
1476
|
+
let _msgErrorsI18n = i18n.i18n(errorsDictionary);
|
|
1477
|
+
function setErrorsI18n(dictionary) {
|
|
1478
|
+
_msgErrorsI18n = i18n.i18n(Object.entries(errorsDictionary).reduce((_dictionary, [key, value]) => {
|
|
1479
|
+
_dictionary[key] = { ...value, ...dictionary[key] };
|
|
1480
|
+
return _dictionary;
|
|
1481
|
+
}, {}));
|
|
1482
|
+
}
|
|
1483
|
+
function msgErrorsI18n(key, language, interpolators) {
|
|
1484
|
+
return _msgErrorsI18n(key, { language, interpolators });
|
|
1527
1485
|
}
|
|
1528
1486
|
|
|
1529
1487
|
function RlsAvatar({ children, rounded, skeleton, rlsTheme }) {
|
|
1530
|
-
|
|
1488
|
+
const className = require$$0.useMemo(() => {
|
|
1489
|
+
return renderClassStatus('rls-avatar', { rounded, skeleton });
|
|
1490
|
+
}, [rounded, skeleton]);
|
|
1491
|
+
return (jsxRuntimeExports.jsx("div", { className: className, "rls-theme": rlsTheme, children: children }));
|
|
1531
1492
|
}
|
|
1532
1493
|
|
|
1533
1494
|
function RlsBadge({ children, rlsTheme }) {
|
|
1534
1495
|
return (jsxRuntimeExports.jsx("div", { className: "rls-badge", "rls-theme": rlsTheme, children: children }));
|
|
1535
1496
|
}
|
|
1536
1497
|
|
|
1498
|
+
function RlsBreadcrumbLabel({ label }) {
|
|
1499
|
+
const className = require$$0.useMemo(() => {
|
|
1500
|
+
return renderClassStatus('rls-breadcrumb__label__a', {
|
|
1501
|
+
actionable: !!label.onClick
|
|
1502
|
+
});
|
|
1503
|
+
}, [label.onClick]);
|
|
1504
|
+
return (jsxRuntimeExports.jsx("label", { className: "rls-breadcrumb__label", onClick: label.onClick, children: jsxRuntimeExports.jsx("a", { className: className, children: label.label }) }));
|
|
1505
|
+
}
|
|
1537
1506
|
function RlsBreadcrumb({ labels }) {
|
|
1538
|
-
return (jsxRuntimeExports.jsx("div", { className: "rls-breadcrumb", children: labels.map((
|
|
1539
|
-
actionable: !!onClick
|
|
1540
|
-
}), children: label }) }, index))) }));
|
|
1507
|
+
return (jsxRuntimeExports.jsx("div", { className: "rls-breadcrumb", children: labels.map((label, index) => (jsxRuntimeExports.jsx(RlsBreadcrumbLabel, { label: label }, index))) }));
|
|
1541
1508
|
}
|
|
1542
1509
|
|
|
1543
1510
|
function RlsIcon({ value, skeleton }) {
|
|
1544
|
-
|
|
1511
|
+
const className = require$$0.useMemo(() => {
|
|
1512
|
+
return renderClassStatus('rls-icon', { skeleton });
|
|
1513
|
+
}, [skeleton]);
|
|
1514
|
+
return (jsxRuntimeExports.jsx("div", { className: className, children: jsxRuntimeExports.jsx("i", { className: `rls-icon-${value}` }) }));
|
|
1545
1515
|
}
|
|
1546
1516
|
|
|
1547
1517
|
function RlsButton({ type, children, disabled, identifier, prefixIcon, suffixIcon, rlsTheme, onClick }) {
|
|
1548
|
-
|
|
1518
|
+
const className = require$$0.useMemo(() => {
|
|
1519
|
+
return renderClassStatus('rls-button__content', { type });
|
|
1520
|
+
}, [type]);
|
|
1521
|
+
return (jsxRuntimeExports.jsx("button", { id: identifier, className: "rls-button", onClick: onClick, "rls-theme": rlsTheme, disabled: disabled, children: jsxRuntimeExports.jsxs("div", { className: className, children: [prefixIcon && jsxRuntimeExports.jsx(RlsIcon, { value: prefixIcon }), children && jsxRuntimeExports.jsx("div", { className: "rls-button__label", children: children }), suffixIcon && jsxRuntimeExports.jsx(RlsIcon, { value: suffixIcon })] }) }));
|
|
1549
1522
|
}
|
|
1550
1523
|
|
|
1551
1524
|
function RlsButtonAction({ icon, disabled, identifier, onClick, tooltip }) {
|
|
@@ -1553,12 +1526,16 @@ function RlsButtonAction({ icon, disabled, identifier, onClick, tooltip }) {
|
|
|
1553
1526
|
}
|
|
1554
1527
|
|
|
1555
1528
|
function RlsCheckBox({ checked, disabled, identifier, onClick, rlsTheme }) {
|
|
1556
|
-
|
|
1529
|
+
const className = require$$0.useMemo(() => {
|
|
1530
|
+
return renderClassStatus('rls-checkbox', { checked, disabled });
|
|
1531
|
+
}, [checked, disabled]);
|
|
1532
|
+
return (jsxRuntimeExports.jsx("div", { id: identifier, className: className, onClick: onClick, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-checkbox__component" }) }));
|
|
1557
1533
|
}
|
|
1558
1534
|
function RlsCheckBoxControl({ formControl, disabled, identifier, rlsTheme }) {
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1535
|
+
const onClick = require$$0.useCallback(() => {
|
|
1536
|
+
formControl.setValue(!formControl.value);
|
|
1537
|
+
}, [formControl.value]);
|
|
1538
|
+
return (jsxRuntimeExports.jsx(RlsCheckBox, { identifier: identifier, checked: !!formControl.value, disabled: disabled, onClick: onClick, rlsTheme: rlsTheme }));
|
|
1562
1539
|
}
|
|
1563
1540
|
|
|
1564
1541
|
function RlsInput({ children, disabled, formControl, identifier, onValue, placeholder, type, value }) {
|
|
@@ -1576,10 +1553,13 @@ function RlsInput({ children, disabled, formControl, identifier, onValue, placeh
|
|
|
1576
1553
|
formControl?.blur();
|
|
1577
1554
|
setFocused(() => false);
|
|
1578
1555
|
}, [formControl]);
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
disabled: formControl?.disabled || disabled
|
|
1582
|
-
|
|
1556
|
+
const className = require$$0.useMemo(() => {
|
|
1557
|
+
return renderClassStatus('rls-input', {
|
|
1558
|
+
disabled: formControl?.disabled || disabled,
|
|
1559
|
+
focused: formControl?.focused ?? focused
|
|
1560
|
+
});
|
|
1561
|
+
}, [formControl?.focused, formControl?.disabled, focused, disabled]);
|
|
1562
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, children: [jsxRuntimeExports.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?.value || value || '' }), jsxRuntimeExports.jsx("span", { className: "rls-input__value", children: children })] }));
|
|
1583
1563
|
}
|
|
1584
1564
|
|
|
1585
1565
|
function RlsInputMoney({ decimals, disabled, formControl, identifier, onValue, placeholder, symbol, value }) {
|
|
@@ -1614,10 +1594,13 @@ function RlsInputPassword({ disabled, formControl, identifier, onValue, placehol
|
|
|
1614
1594
|
formControl?.blur();
|
|
1615
1595
|
setFocused(() => false);
|
|
1616
1596
|
}, [formControl]);
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
disabled: formControl?.disabled || disabled
|
|
1620
|
-
|
|
1597
|
+
const className = require$$0.useMemo(() => {
|
|
1598
|
+
return renderClassStatus('rls-input-password', {
|
|
1599
|
+
disabled: formControl?.disabled || disabled,
|
|
1600
|
+
focused: formControl?.focused ?? focused
|
|
1601
|
+
});
|
|
1602
|
+
}, [formControl?.focused, formControl?.disabled, focused, disabled]);
|
|
1603
|
+
return (jsxRuntimeExports.jsx("div", { id: identifier, className: className, children: jsxRuntimeExports.jsx("input", { className: "rls-input-password__component", autoComplete: "off", type: type ?? 'password', placeholder: placeholder, disabled: disabled, onFocus: onFocus, onBlur: onBlur, onChange: onChange }) }));
|
|
1621
1604
|
}
|
|
1622
1605
|
|
|
1623
1606
|
function RlsInputSearch({ formControl, identifier, onSearch, placeholder }) {
|
|
@@ -1646,11 +1629,17 @@ function RlsMessageIcon({ icon, children, rlsTheme }) {
|
|
|
1646
1629
|
}
|
|
1647
1630
|
|
|
1648
1631
|
function RlsPoster({ children, contrast, outline, rlsTheme }) {
|
|
1649
|
-
|
|
1632
|
+
const className = require$$0.useMemo(() => {
|
|
1633
|
+
return renderClassStatus('rls-poster', { contrast, outline });
|
|
1634
|
+
}, [contrast, outline]);
|
|
1635
|
+
return (jsxRuntimeExports.jsx("div", { className: className, "rls-theme": rlsTheme, children: children }));
|
|
1650
1636
|
}
|
|
1651
1637
|
|
|
1652
1638
|
function RlsProgressBar({ indeterminate, percentage, rlsTheme }) {
|
|
1653
|
-
|
|
1639
|
+
const className = require$$0.useMemo(() => {
|
|
1640
|
+
return renderClassStatus('rls-progress-bar', { indeterminate });
|
|
1641
|
+
}, [indeterminate]);
|
|
1642
|
+
return (jsxRuntimeExports.jsx("div", { className: className, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-progress-bar__component", style: { width: `${percentage || 0}%` } }) }));
|
|
1654
1643
|
}
|
|
1655
1644
|
|
|
1656
1645
|
function RlsProgressCircular({ rlsTheme }) {
|
|
@@ -1658,7 +1647,10 @@ function RlsProgressCircular({ rlsTheme }) {
|
|
|
1658
1647
|
}
|
|
1659
1648
|
|
|
1660
1649
|
function RlsRadioButton({ checked, disabled, identifier, rlsTheme, onClick }) {
|
|
1661
|
-
|
|
1650
|
+
const className = require$$0.useMemo(() => {
|
|
1651
|
+
return renderClassStatus('rls-radiobutton', { checked, disabled });
|
|
1652
|
+
}, [checked, disabled]);
|
|
1653
|
+
return (jsxRuntimeExports.jsx("div", { id: identifier, className: className, onClick: onClick, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-radiobutton__component" }) }));
|
|
1662
1654
|
}
|
|
1663
1655
|
|
|
1664
1656
|
function RlsSkeleton({ rlsTheme }) {
|
|
@@ -1670,30 +1662,42 @@ function RlsSkeletonText({ active, children, rlsTheme }) {
|
|
|
1670
1662
|
}
|
|
1671
1663
|
|
|
1672
1664
|
function RlsSwitch({ checked, disabled, identifier, onClick, rlsTheme }) {
|
|
1673
|
-
|
|
1665
|
+
const className = require$$0.useMemo(() => {
|
|
1666
|
+
return renderClassStatus('rls-switch', { checked, disabled });
|
|
1667
|
+
}, [checked, disabled]);
|
|
1668
|
+
return (jsxRuntimeExports.jsx("div", { id: identifier, className: className, onClick: onClick, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsxs("div", { className: "rls-switch__component", children: [jsxRuntimeExports.jsx("div", { className: "rls-switch__component__element" }), jsxRuntimeExports.jsx("div", { className: "rls-switch__component__bar" })] }) }));
|
|
1674
1669
|
}
|
|
1675
1670
|
function RlsSwitchControl({ formControl, disabled, identifier, rlsTheme }) {
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1671
|
+
const onClick = require$$0.useCallback(() => {
|
|
1672
|
+
formControl.setValue(!formControl.value);
|
|
1673
|
+
}, [formControl.value]);
|
|
1674
|
+
return (jsxRuntimeExports.jsx(RlsSwitch, { identifier: identifier, checked: formControl.value || false, disabled: disabled, onClick: onClick, rlsTheme: rlsTheme }));
|
|
1679
1675
|
}
|
|
1680
1676
|
|
|
1681
1677
|
function RlsAlert({ bordered, children, icon, identifier, rlsTheme }) {
|
|
1682
|
-
|
|
1678
|
+
const className = require$$0.useMemo(() => {
|
|
1679
|
+
return renderClassStatus('rls-alert', { bordered });
|
|
1680
|
+
}, [bordered]);
|
|
1681
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [icon && (jsxRuntimeExports.jsx("div", { className: "rls-alert__icon", children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) })), jsxRuntimeExports.jsx("div", { className: "rls-alert__content", children: children })] }));
|
|
1683
1682
|
}
|
|
1684
1683
|
|
|
1685
1684
|
function RlsBallot({ bordered, children, img, initials, skeleton, subtitle, rlsTheme }) {
|
|
1686
|
-
|
|
1685
|
+
const className = require$$0.useMemo(() => {
|
|
1686
|
+
return renderClassStatus('rls-ballot', { bordered, skeleton });
|
|
1687
|
+
}, [bordered, skeleton]);
|
|
1688
|
+
return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [(img || initials) && (jsxRuntimeExports.jsxs(RlsAvatar, { skeleton: skeleton, children: [img && jsxRuntimeExports.jsx("img", { src: img }), initials && jsxRuntimeExports.jsx("span", { children: initials })] })), jsxRuntimeExports.jsxs("div", { className: "rls-ballot__component", children: [jsxRuntimeExports.jsx("label", { className: "rls-ballot__title", children: jsxRuntimeExports.jsx(RlsSkeletonText, { active: skeleton, children: children }) }), subtitle && (jsxRuntimeExports.jsx("label", { className: "rls-ballot__subtitle", children: jsxRuntimeExports.jsx(RlsSkeletonText, { active: skeleton, children: jsxRuntimeExports.jsx("span", { children: subtitle }) }) }))] })] }));
|
|
1687
1689
|
}
|
|
1688
1690
|
|
|
1689
1691
|
function RlsButtonProgress({ icon, disabled, onClick, progressing, rlsTheme }) {
|
|
1690
|
-
|
|
1692
|
+
const className = require$$0.useMemo(() => {
|
|
1693
|
+
return renderClassStatus('rls-button-progress', { progressing });
|
|
1694
|
+
}, [progressing]);
|
|
1695
|
+
return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [!progressing && (jsxRuntimeExports.jsx(RlsButtonAction, { icon: icon, onClick: onClick, disabled: disabled })), progressing && jsxRuntimeExports.jsx(RlsProgressCircular, {})] }));
|
|
1691
1696
|
}
|
|
1692
1697
|
|
|
1693
1698
|
function RlsButtonToggle({ onAction, options, type, automatic, disabled, rlsTheme }) {
|
|
1694
1699
|
const componentRef = require$$0.useRef(null);
|
|
1695
|
-
const [
|
|
1696
|
-
const [action, setAction] = require$$0.useState(firstAction);
|
|
1700
|
+
const [action, setAction] = require$$0.useState(options[0]);
|
|
1697
1701
|
const [visible, setVisible] = require$$0.useState(false);
|
|
1698
1702
|
require$$0.useEffect(() => {
|
|
1699
1703
|
function onCloseMenu({ target }) {
|
|
@@ -1704,6 +1708,12 @@ function RlsButtonToggle({ onAction, options, type, automatic, disabled, rlsThem
|
|
|
1704
1708
|
document.removeEventListener('click', onCloseMenu);
|
|
1705
1709
|
};
|
|
1706
1710
|
}, []);
|
|
1711
|
+
const classNameList = require$$0.useMemo(() => {
|
|
1712
|
+
return renderClassStatus('rls-button-toggle__list', {
|
|
1713
|
+
hide: !visible,
|
|
1714
|
+
visible
|
|
1715
|
+
});
|
|
1716
|
+
}, [visible]);
|
|
1707
1717
|
const onClickMenu = require$$0.useCallback(() => {
|
|
1708
1718
|
setVisible((visible) => !visible);
|
|
1709
1719
|
}, []);
|
|
@@ -1714,34 +1724,58 @@ function RlsButtonToggle({ onAction, options, type, automatic, disabled, rlsThem
|
|
|
1714
1724
|
}, [onAction, automatic]);
|
|
1715
1725
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-button-toggle", ref: componentRef, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-button-toggle__content", children: [action && (jsxRuntimeExports.jsx("div", { className: "rls-button-toggle__action", children: jsxRuntimeExports.jsx(RlsButton, { disabled: disabled, type: type, onClick: () => {
|
|
1716
1726
|
onAction(action.value);
|
|
1717
|
-
}, children: action.label }) })), jsxRuntimeExports.jsx("div", { className: "rls-button-toggle__icon", children: jsxRuntimeExports.jsx(RlsButton, { type: type, prefixIcon: "arrow-ios-down", disabled: disabled, onClick: onClickMenu }) })] }), jsxRuntimeExports.jsx("div", { className:
|
|
1718
|
-
visible,
|
|
1719
|
-
hide: !visible
|
|
1720
|
-
}), children: jsxRuntimeExports.jsx("ul", { children: options.map((action, index) => (jsxRuntimeExports.jsx("li", { className: "truncate", onClick: () => {
|
|
1727
|
+
}, children: action.label }) })), jsxRuntimeExports.jsx("div", { className: "rls-button-toggle__icon", children: jsxRuntimeExports.jsx(RlsButton, { type: type, prefixIcon: "arrow-ios-down", disabled: disabled, onClick: onClickMenu }) })] }), jsxRuntimeExports.jsx("div", { className: classNameList, children: jsxRuntimeExports.jsx("ul", { children: options.map((action, index) => (jsxRuntimeExports.jsx("li", { className: "truncate", onClick: () => {
|
|
1721
1728
|
onSelectAction(action);
|
|
1722
1729
|
}, children: action.label }, index))) }) })] }));
|
|
1723
1730
|
}
|
|
1724
1731
|
|
|
1725
1732
|
function RlsMessageFormError({ className, formControl }) {
|
|
1726
|
-
|
|
1733
|
+
const [language, setLanguage] = require$$0.useState('es');
|
|
1734
|
+
require$$0.useEffect(() => {
|
|
1735
|
+
return i18n.i18nSubscribe((language) => {
|
|
1736
|
+
setLanguage(language);
|
|
1737
|
+
});
|
|
1738
|
+
}, []);
|
|
1739
|
+
const msgError = require$$0.useMemo(() => {
|
|
1740
|
+
return (formControl?.error &&
|
|
1741
|
+
(msgErrorsI18n(formControl.error.id, language, formControl.error.data) ??
|
|
1742
|
+
msgErrorsI18n('_unknown', language, { error: formControl.error.id })));
|
|
1743
|
+
}, [formControl?.error, language]);
|
|
1744
|
+
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: formControl?.wrong && (jsxRuntimeExports.jsx("div", { className: className, children: jsxRuntimeExports.jsx(RlsMessageIcon, { icon: "alert-triangle", rlsTheme: "danger", children: msgError }) })) }));
|
|
1727
1745
|
}
|
|
1728
1746
|
|
|
1729
1747
|
function RlsFieldMoney({ children, decimals, disabled, formControl, identifier, msgErrorDisabled, onValue, placeholder, symbol, rlsTheme, value }) {
|
|
1730
|
-
const
|
|
1731
|
-
|
|
1748
|
+
const className = require$$0.useMemo(() => {
|
|
1749
|
+
const _disabled = formControl?.disabled || disabled;
|
|
1750
|
+
return renderClassStatus('rls-field-box', {
|
|
1732
1751
|
focused: formControl?.focused && !_disabled,
|
|
1733
1752
|
error: formControl?.wrong,
|
|
1734
1753
|
disabled: _disabled
|
|
1735
|
-
}, 'rls-field-money')
|
|
1754
|
+
}, 'rls-field-money');
|
|
1755
|
+
}, [
|
|
1756
|
+
formControl?.focused,
|
|
1757
|
+
formControl?.wrong,
|
|
1758
|
+
formControl?.disabled,
|
|
1759
|
+
disabled
|
|
1760
|
+
]);
|
|
1761
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsx("div", { className: "rls-field-box__body", children: jsxRuntimeExports.jsx(RlsInputMoney, { formControl: formControl, value: value, disabled: disabled, placeholder: placeholder, symbol: symbol, decimals: decimals, onValue: onValue }) }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1736
1762
|
}
|
|
1737
1763
|
|
|
1738
1764
|
function RlsFieldNumber({ children, disabled, formControl, identifier, msgErrorDisabled, onValue, placeholder, rlsTheme, value }) {
|
|
1739
|
-
const
|
|
1740
|
-
|
|
1765
|
+
const className = require$$0.useMemo(() => {
|
|
1766
|
+
const _disabled = formControl?.disabled || disabled;
|
|
1767
|
+
return renderClassStatus('rls-field-box', {
|
|
1741
1768
|
focused: formControl?.focused && !_disabled,
|
|
1742
1769
|
error: formControl?.wrong,
|
|
1743
1770
|
disabled: _disabled
|
|
1744
|
-
}, 'rls-field-number')
|
|
1771
|
+
}, 'rls-field-number');
|
|
1772
|
+
}, [
|
|
1773
|
+
formControl?.focused,
|
|
1774
|
+
formControl?.wrong,
|
|
1775
|
+
formControl?.disabled,
|
|
1776
|
+
disabled
|
|
1777
|
+
]);
|
|
1778
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsx("div", { className: "rls-field-box__body", children: jsxRuntimeExports.jsx(RlsInputNumber, { formControl: formControl, value: value, disabled: disabled, placeholder: placeholder, onValue: onValue }) }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1745
1779
|
}
|
|
1746
1780
|
|
|
1747
1781
|
function RlsFieldPassword({ children, disabled, formControl, identifier, msgErrorDisabled, placeholder, rlsTheme }) {
|
|
@@ -1749,21 +1783,37 @@ function RlsFieldPassword({ children, disabled, formControl, identifier, msgErro
|
|
|
1749
1783
|
const onToggleInput = require$$0.useCallback(() => {
|
|
1750
1784
|
setPassword((password) => !password);
|
|
1751
1785
|
}, []);
|
|
1752
|
-
const
|
|
1753
|
-
|
|
1786
|
+
const className = require$$0.useMemo(() => {
|
|
1787
|
+
const _disabled = formControl?.disabled || disabled;
|
|
1788
|
+
return renderClassStatus('rls-field-box', {
|
|
1754
1789
|
focused: formControl?.focused && !_disabled,
|
|
1755
1790
|
error: formControl?.wrong,
|
|
1756
1791
|
disabled: _disabled
|
|
1757
|
-
}, 'rls-field-password')
|
|
1792
|
+
}, 'rls-field-password');
|
|
1793
|
+
}, [
|
|
1794
|
+
formControl?.focused,
|
|
1795
|
+
formControl?.wrong,
|
|
1796
|
+
formControl?.disabled,
|
|
1797
|
+
disabled
|
|
1798
|
+
]);
|
|
1799
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx(RlsInputPassword, { formControl: formControl, disabled: disabled, placeholder: placeholder, type: password ? 'password' : 'text' }), jsxRuntimeExports.jsx(RlsButtonAction, { icon: password ? 'eye' : 'eye-off', onClick: onToggleInput })] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1758
1800
|
}
|
|
1759
1801
|
|
|
1760
1802
|
function RlsFieldText({ children, disabled, formControl, identifier, msgErrorDisabled, onValue, placeholder, rlsTheme, value }) {
|
|
1761
|
-
const
|
|
1762
|
-
|
|
1803
|
+
const className = require$$0.useMemo(() => {
|
|
1804
|
+
const _disabled = formControl?.disabled || disabled;
|
|
1805
|
+
return renderClassStatus('rls-field-box', {
|
|
1763
1806
|
focused: formControl?.focused && !_disabled,
|
|
1764
1807
|
error: formControl?.wrong,
|
|
1765
1808
|
disabled: _disabled
|
|
1766
|
-
}, 'rls-field-text')
|
|
1809
|
+
}, 'rls-field-text');
|
|
1810
|
+
}, [
|
|
1811
|
+
formControl?.focused,
|
|
1812
|
+
formControl?.wrong,
|
|
1813
|
+
formControl?.disabled,
|
|
1814
|
+
disabled
|
|
1815
|
+
]);
|
|
1816
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsx("div", { className: "rls-field-box__body", children: jsxRuntimeExports.jsx(RlsInputText, { formControl: formControl, value: value, disabled: disabled, placeholder: placeholder, onValue: onValue }) }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1767
1817
|
}
|
|
1768
1818
|
|
|
1769
1819
|
function RlsLabelCheckBox({ children, disabled, extended, identifier, formControl, rlsTheme }) {
|
|
@@ -1776,10 +1826,10 @@ function RlsLabelCheckBox({ children, disabled, extended, identifier, formContro
|
|
|
1776
1826
|
? formControl?.setValue(!formControl.value)
|
|
1777
1827
|
: setChecked((checked) => !checked);
|
|
1778
1828
|
}, [formControl]);
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1829
|
+
const className = require$$0.useMemo(() => {
|
|
1830
|
+
return renderClassStatus('rls-label-checkbox', { disabled, extended });
|
|
1831
|
+
}, [disabled, extended]);
|
|
1832
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-label-checkbox__component", onClick: onToggle, children: jsxRuntimeExports.jsx(RlsCheckBox, { checked: checked, disabled: disabled }) }), jsxRuntimeExports.jsx("label", { className: "rls-label-checkbox__text", children: children })] }));
|
|
1783
1833
|
}
|
|
1784
1834
|
|
|
1785
1835
|
function RlsLabelRadioButton({ children, disabled, extended, identifier, formControl, rlsTheme, value }) {
|
|
@@ -1790,10 +1840,10 @@ function RlsLabelRadioButton({ children, disabled, extended, identifier, formCon
|
|
|
1790
1840
|
const onSelect = require$$0.useCallback(() => {
|
|
1791
1841
|
formControl && formControl?.setValue(value);
|
|
1792
1842
|
}, [formControl, value]);
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1843
|
+
const className = require$$0.useMemo(() => {
|
|
1844
|
+
return renderClassStatus('rls-label-radiobutton', { disabled, extended });
|
|
1845
|
+
}, [disabled, extended]);
|
|
1846
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-label-radiobutton__component", onClick: onSelect, children: jsxRuntimeExports.jsx(RlsRadioButton, { checked: checked, disabled: disabled }) }), jsxRuntimeExports.jsx("label", { className: "rls-label-radiobutton__text", children: children })] }));
|
|
1797
1847
|
}
|
|
1798
1848
|
|
|
1799
1849
|
function RlsLabelSwitch({ children, disabled, extended, identifier, formControl, rlsTheme }) {
|
|
@@ -1806,62 +1856,53 @@ function RlsLabelSwitch({ children, disabled, extended, identifier, formControl,
|
|
|
1806
1856
|
? formControl?.setValue(!formControl.value)
|
|
1807
1857
|
: setChecked((checked) => !checked);
|
|
1808
1858
|
}, [formControl]);
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1859
|
+
const className = require$$0.useMemo(() => {
|
|
1860
|
+
return renderClassStatus('rls-label-switch', { disabled, extended });
|
|
1861
|
+
}, [disabled, extended]);
|
|
1862
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-label-switch__component", onClick: onToggle, children: jsxRuntimeExports.jsx(RlsSwitch, { checked: checked, disabled: disabled }) }), jsxRuntimeExports.jsx("label", { className: "rls-label-switch__text", children: children })] }));
|
|
1813
1863
|
}
|
|
1814
1864
|
|
|
1815
1865
|
function RlsPagination({ suggestions, count, filter, onPagination }) {
|
|
1816
1866
|
const controller = require$$0.useRef(new components.PaginationController({ suggestions, count }));
|
|
1817
1867
|
const [template, setTemplate] = require$$0.useState(controller.current.template);
|
|
1868
|
+
const refreshTemplate = require$$0.useCallback((template, suggestions) => {
|
|
1869
|
+
const { firstPage, lastPage } = template;
|
|
1870
|
+
onPagination && onPagination({ firstPage, lastPage, suggestions });
|
|
1871
|
+
setTemplate(template);
|
|
1872
|
+
}, [onPagination]);
|
|
1818
1873
|
require$$0.useEffect(() => {
|
|
1819
1874
|
controller.current = new components.PaginationController({
|
|
1820
1875
|
suggestions,
|
|
1821
1876
|
count,
|
|
1822
1877
|
position: template.currentPage.value
|
|
1823
1878
|
});
|
|
1824
|
-
|
|
1825
|
-
onPagination({
|
|
1826
|
-
firstPage: controller.current.template.firstPage,
|
|
1827
|
-
lastPage: controller.current.template.lastPage,
|
|
1828
|
-
suggestions: controller.current.page.collection
|
|
1829
|
-
});
|
|
1830
|
-
setTemplate(controller.current.template);
|
|
1879
|
+
refreshTemplate(controller.current.template, controller.current.page.collection);
|
|
1831
1880
|
}, [suggestions, count]);
|
|
1832
1881
|
require$$0.useEffect(() => {
|
|
1833
1882
|
refreshPagination(controller.current.filtrable(filter));
|
|
1834
1883
|
}, [filter]);
|
|
1835
|
-
|
|
1884
|
+
const refreshPagination = require$$0.useCallback((pagination) => {
|
|
1836
1885
|
if (pagination) {
|
|
1837
|
-
|
|
1838
|
-
const { firstPage, lastPage } = template;
|
|
1839
|
-
onPagination &&
|
|
1840
|
-
onPagination({
|
|
1841
|
-
firstPage,
|
|
1842
|
-
lastPage,
|
|
1843
|
-
suggestions: page.collection
|
|
1844
|
-
});
|
|
1845
|
-
setTemplate(template);
|
|
1886
|
+
refreshTemplate(pagination.template, pagination.page.collection);
|
|
1846
1887
|
}
|
|
1847
|
-
}
|
|
1848
|
-
|
|
1888
|
+
}, []);
|
|
1889
|
+
const goToPagination = require$$0.useCallback((page) => {
|
|
1849
1890
|
refreshPagination(controller.current.goToPage(page));
|
|
1850
|
-
}
|
|
1851
|
-
|
|
1891
|
+
}, []);
|
|
1892
|
+
const goFirstPagination = require$$0.useCallback(() => {
|
|
1852
1893
|
refreshPagination(controller.current.goFirstPage());
|
|
1853
|
-
}
|
|
1854
|
-
|
|
1894
|
+
}, []);
|
|
1895
|
+
const goPreviousPagination = require$$0.useCallback(() => {
|
|
1855
1896
|
refreshPagination(controller.current.goPreviousPage());
|
|
1856
|
-
}
|
|
1857
|
-
|
|
1897
|
+
}, []);
|
|
1898
|
+
const goNextPagination = require$$0.useCallback(() => {
|
|
1858
1899
|
refreshPagination(controller.current.goNextPage());
|
|
1859
|
-
}
|
|
1860
|
-
|
|
1900
|
+
}, []);
|
|
1901
|
+
const goLastPagination = require$$0.useCallback(() => {
|
|
1861
1902
|
refreshPagination(controller.current.goLastPage());
|
|
1862
|
-
}
|
|
1903
|
+
}, []);
|
|
1863
1904
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-pagination", children: [jsxRuntimeExports.jsxs("div", { className: "rls-pagination__actions", children: [jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goFirstPagination, disabled: template.firstPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrowhead-left" }) }), jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goPreviousPagination, disabled: template.firstPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrow-ios-left" }) })] }), jsxRuntimeExports.jsx("div", { className: "rls-pagination__pages", children: template.pages.map((page, index) => {
|
|
1864
|
-
return (jsxRuntimeExports.jsx("div", { className:
|
|
1905
|
+
return (jsxRuntimeExports.jsx("div", { className: renderClassStatus('rls-pagination__page', {
|
|
1865
1906
|
active: page.active
|
|
1866
1907
|
}), onClick: () => {
|
|
1867
1908
|
goToPagination(page);
|
|
@@ -1869,10 +1910,45 @@ function RlsPagination({ suggestions, count, filter, onPagination }) {
|
|
|
1869
1910
|
}) }), jsxRuntimeExports.jsx("div", { className: "rls-pagination__description", children: template.description }), jsxRuntimeExports.jsxs("div", { className: "rls-pagination__actions", children: [jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goNextPagination, disabled: template.lastPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrow-ios-right" }) }), jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goLastPagination, disabled: template.lastPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrowhead-right" }) })] })] }));
|
|
1870
1911
|
}
|
|
1871
1912
|
|
|
1872
|
-
function
|
|
1873
|
-
const
|
|
1913
|
+
function RlsPickerDayItem({ day, onSelect, disabled }) {
|
|
1914
|
+
const className = require$$0.useMemo(() => {
|
|
1915
|
+
return renderClassStatus('rls-picker-day__element', {
|
|
1916
|
+
disabled: day.disabled || disabled,
|
|
1917
|
+
focused: day.focused,
|
|
1918
|
+
forbidden: day.forbidden,
|
|
1919
|
+
selected: day.selected,
|
|
1920
|
+
today: day.today
|
|
1921
|
+
});
|
|
1922
|
+
}, [
|
|
1923
|
+
day.disabled,
|
|
1924
|
+
day.focused,
|
|
1925
|
+
day.forbidden,
|
|
1926
|
+
day.selected,
|
|
1927
|
+
day.today,
|
|
1928
|
+
disabled
|
|
1929
|
+
]);
|
|
1930
|
+
const onClick = require$$0.useCallback(() => {
|
|
1931
|
+
day.value && !day.disabled && !disabled && onSelect(day.value);
|
|
1932
|
+
}, [day.value, day.disabled, disabled, onSelect]);
|
|
1933
|
+
return (jsxRuntimeExports.jsx("div", { className: className, onClick: onClick, children: jsxRuntimeExports.jsx("span", { className: "rls-picker-day__element__span", children: day.value || '??' }) }));
|
|
1934
|
+
}
|
|
1935
|
+
function RlsPickerDayHeaders() {
|
|
1936
|
+
return (jsxRuntimeExports.jsx("div", { className: "rls-picker-day__header", children: dates.DAY_LABELS().map((title, index) => (jsxRuntimeExports.jsx("label", { className: "rls-picker-day__label", children: title }, index))) }));
|
|
1937
|
+
}
|
|
1938
|
+
function RlsPickerDay({ date: _date, disabled, formControl, maxDate, month, minDate, onValue, rlsTheme, year }) {
|
|
1939
|
+
const date = require$$0.useMemo(() => _date ?? new Date(), [_date]);
|
|
1874
1940
|
const [weeks, setWeeks] = require$$0.useState([]);
|
|
1875
|
-
const [value, setValue] = require$$0.useState(formControl?.value ||
|
|
1941
|
+
const [value, setValue] = require$$0.useState(formControl?.value || date.getDate());
|
|
1942
|
+
const [headers, setHeaders] = require$$0.useState(jsxRuntimeExports.jsx(RlsPickerDayHeaders, {}));
|
|
1943
|
+
const [component, setComponent] = require$$0.useState(jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}));
|
|
1944
|
+
require$$0.useEffect(() => {
|
|
1945
|
+
return i18n.i18nSubscribe(() => {
|
|
1946
|
+
setHeaders(jsxRuntimeExports.jsx(RlsPickerDayHeaders, {}));
|
|
1947
|
+
});
|
|
1948
|
+
}, []);
|
|
1949
|
+
require$$0.useEffect(() => {
|
|
1950
|
+
setComponent(jsxRuntimeExports.jsx("div", { className: "rls-picker-day__component", children: weeks.map(({ days }, index) => (jsxRuntimeExports.jsx("div", { className: "rls-picker-day__week", children: days.map((day, index) => (jsxRuntimeExports.jsx(RlsPickerDayItem, { day: day, onSelect: onSelect, disabled: disabled }, index))) }, index))) }));
|
|
1951
|
+
}, [weeks]);
|
|
1876
1952
|
require$$0.useEffect(() => {
|
|
1877
1953
|
const options = createPickerOptions();
|
|
1878
1954
|
const day = components.verifyDayPicker(options);
|
|
@@ -1882,125 +1958,175 @@ function RlsPickerDay({ date, disabled: disabledPicker, formControl, maxDate, mo
|
|
|
1882
1958
|
const day = components.verifyDayPicker(createPickerOptions());
|
|
1883
1959
|
day
|
|
1884
1960
|
? formControl?.setValue(day)
|
|
1885
|
-
: setValue(formControl?.value ||
|
|
1961
|
+
: setValue(formControl?.value || date.getDate());
|
|
1886
1962
|
}, [formControl?.value]);
|
|
1887
|
-
|
|
1963
|
+
const createPickerOptions = require$$0.useCallback(() => {
|
|
1888
1964
|
return {
|
|
1889
|
-
date
|
|
1890
|
-
day: formControl?.value
|
|
1891
|
-
month:
|
|
1892
|
-
year: year
|
|
1965
|
+
date,
|
|
1966
|
+
day: formControl?.value ?? value,
|
|
1967
|
+
month: month ?? date.getMonth(),
|
|
1968
|
+
year: year ?? date.getFullYear(),
|
|
1893
1969
|
minDate,
|
|
1894
1970
|
maxDate
|
|
1895
1971
|
};
|
|
1896
|
-
}
|
|
1897
|
-
|
|
1972
|
+
}, [date, formControl?.value, value, month, year, minDate, maxDate]);
|
|
1973
|
+
const setDayValue = require$$0.useCallback((value) => {
|
|
1898
1974
|
formControl ? formControl.setValue(value) : setValue(value);
|
|
1899
|
-
}
|
|
1900
|
-
|
|
1975
|
+
}, [formControl]);
|
|
1976
|
+
const onSelect = require$$0.useCallback((value) => {
|
|
1901
1977
|
setDayValue(value);
|
|
1902
1978
|
onValue && onValue(value);
|
|
1903
|
-
}
|
|
1904
|
-
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-day", "rls-theme": rlsTheme, children: [
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
}
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1979
|
+
}, [setDayValue, onValue]);
|
|
1980
|
+
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-day", "rls-theme": rlsTheme, children: [headers, component] }));
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1983
|
+
const formatRange = '{dd}/{mx}/{aa}';
|
|
1984
|
+
function RlsPickerDayRangeHeaders() {
|
|
1985
|
+
return (jsxRuntimeExports.jsx("div", { className: "rls-picker-day__header", children: dates.DAY_LABELS().map((title, index) => (jsxRuntimeExports.jsx("label", { className: "rls-picker-day__label", children: title }, index))) }));
|
|
1986
|
+
}
|
|
1987
|
+
function RlsPickerDayRangeItem({ day, onSelect, disabled }) {
|
|
1988
|
+
const className = require$$0.useMemo(() => {
|
|
1989
|
+
return renderClassStatus('rls-picker-day-range__element', {
|
|
1990
|
+
disabled: day.disabled || disabled,
|
|
1991
|
+
end: day.end,
|
|
1992
|
+
forbidden: day.forbidden,
|
|
1993
|
+
ranged: day.ranged,
|
|
1994
|
+
source: day.source
|
|
1995
|
+
});
|
|
1996
|
+
}, [day.disabled, day.end, day.forbidden, day.ranged, day.source, disabled]);
|
|
1997
|
+
const onClick = require$$0.useCallback(() => {
|
|
1998
|
+
day.value && !day.disabled && !disabled && onSelect(day.value);
|
|
1999
|
+
}, [day.value, day.disabled, disabled, onSelect]);
|
|
2000
|
+
return (jsxRuntimeExports.jsx("div", { className: className, onClick: onClick, children: jsxRuntimeExports.jsx("span", { className: "rls-picker-day-range__element__span", children: day.value || '??' }) }));
|
|
2001
|
+
}
|
|
2002
|
+
function RlsPickerDayRange({ date: _date, disabled, formControl, maxDate, minDate, rlsTheme }) {
|
|
2003
|
+
const _range = require$$0.useMemo(() => {
|
|
2004
|
+
return formControl?.value ?? dates.DateRange.now();
|
|
2005
|
+
}, [formControl?.value]);
|
|
2006
|
+
const date = require$$0.useMemo(() => {
|
|
2007
|
+
return dates.normalizeMinTime(_date ?? _range.minDate);
|
|
2008
|
+
}, [_date]);
|
|
2009
|
+
const sourceDate = require$$0.useRef(_range.minDate);
|
|
1918
2010
|
const [weeks, setWeeks] = require$$0.useState([]);
|
|
1919
|
-
const [range, setRange] = require$$0.useState(
|
|
2011
|
+
const [range, setRange] = require$$0.useState(_range);
|
|
2012
|
+
const [headers, setHeaders] = require$$0.useState(jsxRuntimeExports.jsx(RlsPickerDayRangeHeaders, {}));
|
|
2013
|
+
const [component, setComponent] = require$$0.useState(jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}));
|
|
2014
|
+
require$$0.useEffect(() => {
|
|
2015
|
+
return i18n.i18nSubscribe(() => {
|
|
2016
|
+
setHeaders(jsxRuntimeExports.jsx(RlsPickerDayRangeHeaders, {}));
|
|
2017
|
+
});
|
|
2018
|
+
}, []);
|
|
2019
|
+
require$$0.useEffect(() => {
|
|
2020
|
+
setComponent(jsxRuntimeExports.jsx("div", { className: "rls-picker-day-range__component", children: weeks.map(({ days }, index) => (jsxRuntimeExports.jsx("div", { className: "rls-picker-day-range__week", children: days.map((day, index) => (jsxRuntimeExports.jsx(RlsPickerDayRangeItem, { day: day, onSelect: onSelect, disabled: disabled }, index))) }, index))) }));
|
|
2021
|
+
}, [weeks]);
|
|
1920
2022
|
require$$0.useEffect(() => {
|
|
1921
2023
|
setWeeks(components.createDayRangePicker({
|
|
1922
|
-
date
|
|
2024
|
+
date,
|
|
1923
2025
|
range,
|
|
1924
2026
|
sourceDate: sourceDate.current,
|
|
1925
2027
|
minDate,
|
|
1926
2028
|
maxDate
|
|
1927
2029
|
}));
|
|
1928
|
-
}, [
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
sourceDate.current
|
|
2030
|
+
}, [date, range, minDate, maxDate]);
|
|
2031
|
+
const title = require$$0.useMemo(() => {
|
|
2032
|
+
return (jsxRuntimeExports.jsx("div", { className: "rls-picker-day-range__title", children: dates.dateFormatTemplate(sourceDate.current, formatRange) }));
|
|
2033
|
+
}, [sourceDate.current]);
|
|
2034
|
+
const onSelect = require$$0.useCallback((value) => {
|
|
2035
|
+
const _date = dates.assignDayInDate(date, value);
|
|
2036
|
+
const range = dates.dateIsBefore(_date, sourceDate.current)
|
|
2037
|
+
? new dates.DateRange(sourceDate.current, _date)
|
|
2038
|
+
: new dates.DateRange(_date, sourceDate.current);
|
|
2039
|
+
sourceDate.current = _date;
|
|
1935
2040
|
setRange(range);
|
|
1936
2041
|
formControl?.setValue(range);
|
|
1937
|
-
}
|
|
1938
|
-
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-day-range", "rls-theme": rlsTheme, children: [
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
2042
|
+
}, [date, sourceDate.current, formControl]);
|
|
2043
|
+
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-day-range", "rls-theme": rlsTheme, children: [title, headers, component] }));
|
|
2044
|
+
}
|
|
2045
|
+
|
|
2046
|
+
function RlsPickerMonthItem({ month, onSelect, disabled }) {
|
|
2047
|
+
const [label, setLabel] = require$$0.useState(dates.MONTH_NAMES(month.value));
|
|
2048
|
+
require$$0.useEffect(() => {
|
|
2049
|
+
return i18n.i18nSubscribe(() => {
|
|
2050
|
+
setLabel(dates.MONTH_NAMES(month.value));
|
|
2051
|
+
});
|
|
2052
|
+
}, []);
|
|
2053
|
+
const className = require$$0.useMemo(() => {
|
|
2054
|
+
return renderClassStatus('rls-picker-month__component', {
|
|
2055
|
+
disabled: month.disabled || disabled,
|
|
2056
|
+
focused: month.focused,
|
|
2057
|
+
selected: month.selected
|
|
2058
|
+
});
|
|
2059
|
+
}, [month.disabled, month.focused, month.selected, disabled]);
|
|
2060
|
+
const onClick = require$$0.useCallback(() => {
|
|
2061
|
+
commons.itIsDefined(month.value) &&
|
|
2062
|
+
!month.disabled &&
|
|
2063
|
+
!disabled &&
|
|
2064
|
+
onSelect(month.value);
|
|
2065
|
+
}, [month.value, month.disabled, disabled, onSelect]);
|
|
2066
|
+
return (jsxRuntimeExports.jsx("div", { className: className, onClick: onClick, children: jsxRuntimeExports.jsx("span", { className: "rls-picker-month__span", children: label }) }));
|
|
2067
|
+
}
|
|
2068
|
+
function RlsPickerMonth({ date: _date, disabled, formControl, maxDate, minDate, onValue, rlsTheme, year }) {
|
|
2069
|
+
const date = require$$0.useMemo(() => _date || new Date(), [_date]);
|
|
1953
2070
|
const [months, setMonths] = require$$0.useState([]);
|
|
1954
|
-
const [value, setValue] = require$$0.useState(formControl?.value
|
|
2071
|
+
const [value, setValue] = require$$0.useState(formControl?.value ?? date.getMonth());
|
|
2072
|
+
const [component, setComponent] = require$$0.useState(jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}));
|
|
1955
2073
|
require$$0.useEffect(() => {
|
|
1956
|
-
|
|
2074
|
+
setComponent(jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: months.map((month, index) => (jsxRuntimeExports.jsx(RlsPickerMonthItem, { month: month, onSelect: onSelect, disabled: disabled }, index))) }));
|
|
2075
|
+
}, [months]);
|
|
2076
|
+
require$$0.useEffect(() => {
|
|
2077
|
+
const options = {
|
|
2078
|
+
date,
|
|
2079
|
+
month: formControl?.value ?? value,
|
|
2080
|
+
year: year ?? date.getFullYear(),
|
|
2081
|
+
minDate,
|
|
2082
|
+
maxDate
|
|
2083
|
+
};
|
|
1957
2084
|
const month = components.verifyMonthPicker(options);
|
|
1958
|
-
|
|
2085
|
+
commons.itIsDefined(month)
|
|
2086
|
+
? setMonthValue(month)
|
|
2087
|
+
: setMonths(components.createMonthPicker(options));
|
|
1959
2088
|
}, [date, year, value, minDate, maxDate]);
|
|
1960
2089
|
require$$0.useEffect(() => {
|
|
1961
|
-
const month = components.verifyMonthPicker(
|
|
2090
|
+
const month = components.verifyMonthPicker({
|
|
2091
|
+
date,
|
|
2092
|
+
month: formControl?.value ?? value,
|
|
2093
|
+
year: year ?? date.getFullYear(),
|
|
2094
|
+
minDate,
|
|
2095
|
+
maxDate
|
|
2096
|
+
});
|
|
1962
2097
|
commons.itIsDefined(month)
|
|
1963
2098
|
? formControl?.setValue(month)
|
|
1964
|
-
: setValue(formControl?.value
|
|
2099
|
+
: setValue(formControl?.value ?? date.getMonth());
|
|
1965
2100
|
}, [formControl?.value]);
|
|
1966
|
-
|
|
1967
|
-
return {
|
|
1968
|
-
date: currentDate,
|
|
1969
|
-
month: commons.itIsDefined(formControl?.value) ? formControl?.value : value,
|
|
1970
|
-
year: year || currentDate.getFullYear(),
|
|
1971
|
-
minDate,
|
|
1972
|
-
maxDate
|
|
1973
|
-
};
|
|
1974
|
-
}
|
|
1975
|
-
function setMonthValue(value) {
|
|
2101
|
+
const setMonthValue = require$$0.useCallback((value) => {
|
|
1976
2102
|
formControl ? formControl.setValue(value) : setValue(value);
|
|
1977
|
-
}
|
|
1978
|
-
|
|
2103
|
+
}, [formControl]);
|
|
2104
|
+
const onSelect = require$$0.useCallback((value) => {
|
|
1979
2105
|
setMonthValue(value);
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
}
|
|
1984
|
-
return (jsxRuntimeExports.jsx("div", { className: "rls-picker-month", "rls-theme": rlsTheme, children: months.map(({ label, value, disabled, focused, selected }, index) => (jsxRuntimeExports.jsx("div", { className: renderClassStatus('rls-picker-month__component', {
|
|
1985
|
-
disabled: disabled || disabledPicker,
|
|
1986
|
-
focused,
|
|
1987
|
-
selected
|
|
1988
|
-
}), onClick: !(disabled || disabledPicker)
|
|
1989
|
-
? () => {
|
|
1990
|
-
onChange(value);
|
|
1991
|
-
}
|
|
1992
|
-
: undefined, children: jsxRuntimeExports.jsx("span", { className: "rls-picker-month__span", children: label }) }, index))) }));
|
|
2106
|
+
onValue && onValue(value);
|
|
2107
|
+
}, [setMonthValue, onValue]);
|
|
2108
|
+
return (jsxRuntimeExports.jsx("div", { className: "rls-picker-month", "rls-theme": rlsTheme, children: component }));
|
|
1993
2109
|
}
|
|
1994
2110
|
|
|
1995
|
-
function
|
|
1996
|
-
const { limitNext, limitPrevious } =
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2111
|
+
function RlsPickerSelectorTitle({ monthControl, type, yearControl, date, disabled, maxDate, minDate, onClick }) {
|
|
2112
|
+
const { limitNext, limitPrevious } = require$$0.useMemo(() => {
|
|
2113
|
+
return components.monthLimitTemplate({
|
|
2114
|
+
date,
|
|
2115
|
+
maxDate,
|
|
2116
|
+
minDate,
|
|
2117
|
+
month: monthControl.value
|
|
2118
|
+
});
|
|
2119
|
+
}, [date, maxDate, minDate, monthControl.value]);
|
|
2120
|
+
const [label, setLabel] = require$$0.useState(dates.MONTH_NAMES(monthControl.value ?? dates.Month.January));
|
|
2121
|
+
require$$0.useEffect(() => {
|
|
2122
|
+
return i18n.i18nSubscribe(() => {
|
|
2123
|
+
setLabel(dates.MONTH_NAMES(monthControl.value ?? dates.Month.January));
|
|
2124
|
+
});
|
|
2125
|
+
}, []);
|
|
2126
|
+
require$$0.useEffect(() => {
|
|
2127
|
+
setLabel(dates.MONTH_NAMES(monthControl.value ?? dates.Month.January));
|
|
2128
|
+
}, [monthControl.value]);
|
|
2129
|
+
const onPreviousMonth = require$$0.useCallback(() => {
|
|
2004
2130
|
if (commons.itIsDefined(monthControl.value) && commons.itIsDefined(yearControl.value)) {
|
|
2005
2131
|
if (monthControl.value > dates.Month.January) {
|
|
2006
2132
|
monthControl.setValue(monthControl.value - 1);
|
|
@@ -2010,15 +2136,15 @@ function RlsPickerMonthTitle({ monthControl, type, yearControl, date, disabled,
|
|
|
2010
2136
|
yearControl.setValue(yearControl.value - 1);
|
|
2011
2137
|
}
|
|
2012
2138
|
}
|
|
2013
|
-
}
|
|
2014
|
-
|
|
2139
|
+
}, [monthControl.value, yearControl.value]);
|
|
2140
|
+
const onPreviousYear = require$$0.useCallback(() => {
|
|
2015
2141
|
commons.itIsDefined(yearControl.value) &&
|
|
2016
2142
|
yearControl.setValue(yearControl.value - 1);
|
|
2017
|
-
}
|
|
2018
|
-
|
|
2143
|
+
}, [yearControl.value]);
|
|
2144
|
+
const onPrevious = require$$0.useCallback(() => {
|
|
2019
2145
|
type === 'month' ? onPreviousMonth() : onPreviousYear();
|
|
2020
|
-
}
|
|
2021
|
-
|
|
2146
|
+
}, [type, onPreviousMonth, onPreviousYear]);
|
|
2147
|
+
const onNextMonth = require$$0.useCallback(() => {
|
|
2022
2148
|
if (commons.itIsDefined(monthControl.value) && commons.itIsDefined(yearControl.value)) {
|
|
2023
2149
|
if (monthControl.value < dates.Month.December) {
|
|
2024
2150
|
monthControl.setValue(monthControl.value + 1);
|
|
@@ -2028,66 +2154,73 @@ function RlsPickerMonthTitle({ monthControl, type, yearControl, date, disabled,
|
|
|
2028
2154
|
yearControl.setValue(yearControl.value + 1);
|
|
2029
2155
|
}
|
|
2030
2156
|
}
|
|
2031
|
-
}
|
|
2032
|
-
|
|
2157
|
+
}, [monthControl.value, yearControl.value]);
|
|
2158
|
+
const onNextYear = require$$0.useCallback(() => {
|
|
2033
2159
|
commons.itIsDefined(yearControl.value) &&
|
|
2034
2160
|
yearControl.setValue(yearControl.value + 1);
|
|
2035
|
-
}
|
|
2036
|
-
|
|
2161
|
+
}, [yearControl.value]);
|
|
2162
|
+
const onNext = require$$0.useCallback(() => {
|
|
2037
2163
|
type === 'month' ? onNextMonth() : onNextYear();
|
|
2038
|
-
}
|
|
2039
|
-
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-
|
|
2164
|
+
}, [type, onNextMonth, onNextYear]);
|
|
2165
|
+
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-selector-title", children: [jsxRuntimeExports.jsx(RlsButtonAction, { icon: "arrow-ios-left", onClick: onPrevious, disabled: limitPrevious || disabled }), jsxRuntimeExports.jsx("span", { onClick: onClick, children: label }), jsxRuntimeExports.jsx(RlsButtonAction, { icon: "arrow-ios-right", onClick: onNext, disabled: limitNext || disabled })] }));
|
|
2040
2166
|
}
|
|
2041
2167
|
|
|
2042
|
-
function
|
|
2043
|
-
const
|
|
2044
|
-
|
|
2045
|
-
|
|
2168
|
+
function RlsPickerYearItem({ onSelect, year, disabled }) {
|
|
2169
|
+
const className = require$$0.useMemo(() => {
|
|
2170
|
+
return renderClassStatus('rls-picker-year__element', {
|
|
2171
|
+
disabled: year.disabled || disabled,
|
|
2172
|
+
focused: year.focused,
|
|
2173
|
+
selected: year.selected
|
|
2174
|
+
});
|
|
2175
|
+
}, [year.disabled, year.focused, year.selected, disabled]);
|
|
2176
|
+
const onClick = require$$0.useCallback(() => {
|
|
2177
|
+
year.value && !year.disabled && !disabled && onSelect(year.value);
|
|
2178
|
+
}, [year.value, year.disabled, disabled, onSelect]);
|
|
2179
|
+
return (jsxRuntimeExports.jsx("div", { className: className, onClick: onClick, children: jsxRuntimeExports.jsx("span", { className: "rls-picker-year__span rls-body1-medium", children: year.value || '????' }) }));
|
|
2180
|
+
}
|
|
2181
|
+
function RlsPickerYear({ date: _date, disabled, formControl, maxDate, minDate, onValue, rlsTheme }) {
|
|
2182
|
+
const date = require$$0.useMemo(() => _date || new Date(), [_date]);
|
|
2183
|
+
const [value, setValue] = require$$0.useState(formControl?.value ?? date.getFullYear());
|
|
2184
|
+
const [year, setYear] = require$$0.useState(formControl?.value ?? date.getFullYear());
|
|
2185
|
+
const [component, setComponent] = require$$0.useState(jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}));
|
|
2186
|
+
const createPickerOptions = require$$0.useCallback(() => {
|
|
2187
|
+
return {
|
|
2188
|
+
date,
|
|
2189
|
+
year,
|
|
2190
|
+
minDate,
|
|
2191
|
+
maxDate
|
|
2192
|
+
};
|
|
2193
|
+
}, [date, year, minDate, maxDate]);
|
|
2046
2194
|
const [template, setTemplate] = require$$0.useState(components.createYearPicker(createPickerOptions()));
|
|
2047
2195
|
require$$0.useEffect(() => {
|
|
2048
2196
|
const options = createPickerOptions(); // YearPickerProps
|
|
2049
2197
|
const year = components.verifyYearPicker(options);
|
|
2050
|
-
year
|
|
2051
|
-
? setYearValue(year)
|
|
2052
|
-
: setTemplate(components.createYearPicker(createPickerOptions()));
|
|
2198
|
+
year ? setYearValue(year) : setTemplate(components.createYearPicker(options));
|
|
2053
2199
|
}, [date, year, value, minDate, maxDate]);
|
|
2200
|
+
require$$0.useEffect(() => {
|
|
2201
|
+
setComponent(jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: template.years.map((year, index) => (jsxRuntimeExports.jsx(RlsPickerYearItem, { year: year, onSelect: onSelect, disabled: disabled }, index))) }));
|
|
2202
|
+
}, [template.years]);
|
|
2054
2203
|
require$$0.useEffect(() => {
|
|
2055
2204
|
const year = components.verifyYearPicker(createPickerOptions());
|
|
2056
2205
|
commons.itIsDefined(year)
|
|
2057
2206
|
? formControl?.setValue(year)
|
|
2058
|
-
: setValue(formControl?.value
|
|
2207
|
+
: setValue(formControl?.value ?? date.getFullYear());
|
|
2059
2208
|
}, [formControl?.value]);
|
|
2060
|
-
|
|
2061
|
-
return {
|
|
2062
|
-
date: currentDate,
|
|
2063
|
-
year,
|
|
2064
|
-
minDate,
|
|
2065
|
-
maxDate
|
|
2066
|
-
};
|
|
2067
|
-
}
|
|
2068
|
-
function setYearValue(value) {
|
|
2209
|
+
const setYearValue = require$$0.useCallback((value) => {
|
|
2069
2210
|
formControl ? formControl.setValue(value) : setValue(value);
|
|
2070
2211
|
setYear(value);
|
|
2071
|
-
}
|
|
2072
|
-
|
|
2073
|
-
setYear(year - 8);
|
|
2074
|
-
}
|
|
2075
|
-
|
|
2076
|
-
setYear(year + 8);
|
|
2077
|
-
}
|
|
2078
|
-
|
|
2212
|
+
}, [formControl]);
|
|
2213
|
+
const onClickPrev = require$$0.useCallback(() => {
|
|
2214
|
+
setYear((year) => year - 8);
|
|
2215
|
+
}, []);
|
|
2216
|
+
const onClickNext = require$$0.useCallback(() => {
|
|
2217
|
+
setYear((year) => year + 8);
|
|
2218
|
+
}, []);
|
|
2219
|
+
const onSelect = require$$0.useCallback((value) => {
|
|
2079
2220
|
setYearValue(value);
|
|
2080
2221
|
onValue && onValue(value);
|
|
2081
|
-
}
|
|
2082
|
-
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-year", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-picker-year__header", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-year__action rls-picker-year__action--prev", children: jsxRuntimeExports.jsx(RlsButtonAction, { icon: "arrow-ios-left", onClick: onClickPrev, disabled: !template.canPrevious ||
|
|
2083
|
-
disabled: disabled || disabledPicker,
|
|
2084
|
-
focused,
|
|
2085
|
-
selected
|
|
2086
|
-
}), onClick: value && !disabledPicker
|
|
2087
|
-
? () => {
|
|
2088
|
-
onChange(value);
|
|
2089
|
-
}
|
|
2090
|
-
: undefined, children: jsxRuntimeExports.jsx("span", { className: "rls-picker-year__year__span rls-body1-medium", children: value || '????' }) }, index))) })] }));
|
|
2222
|
+
}, [setYearValue, onValue]);
|
|
2223
|
+
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-year", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-picker-year__header", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-year__action rls-picker-year__action--prev", children: jsxRuntimeExports.jsx(RlsButtonAction, { icon: "arrow-ios-left", onClick: onClickPrev, disabled: !template.canPrevious || disabled }) }), jsxRuntimeExports.jsxs("label", { className: "rls-title-bold", children: [template.minRange, " - ", template.maxRange] }), jsxRuntimeExports.jsx("div", { className: "rls-picker-year__action rls-picker-year__action--next", children: jsxRuntimeExports.jsx(RlsButtonAction, { icon: "arrow-ios-right", onClick: onClickNext, disabled: !template.canNext || disabled }) })] }), jsxRuntimeExports.jsx("div", { className: "rls-picker-year__component", children: component })] }));
|
|
2091
2224
|
}
|
|
2092
2225
|
|
|
2093
2226
|
function RlsToolbar({ actions, children, subtitle }) {
|
|
@@ -2095,7 +2228,10 @@ function RlsToolbar({ actions, children, subtitle }) {
|
|
|
2095
2228
|
}
|
|
2096
2229
|
|
|
2097
2230
|
function RlsCard({ children, outline, rlsTheme }) {
|
|
2098
|
-
|
|
2231
|
+
const className = require$$0.useMemo(() => {
|
|
2232
|
+
return renderClassStatus('rls-card', { outline });
|
|
2233
|
+
}, [outline]);
|
|
2234
|
+
return (jsxRuntimeExports.jsx("div", { className: className, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-card__content", children: children }) }));
|
|
2099
2235
|
}
|
|
2100
2236
|
|
|
2101
2237
|
const reactI18n = i18n.i18n({
|
|
@@ -2128,7 +2264,10 @@ class ConfirmationResult extends commons.PartialSealed {
|
|
|
2128
2264
|
}
|
|
2129
2265
|
}
|
|
2130
2266
|
function RlsConfirmation({ approved, content, reject, rlsTheme, subtitle, title, visible }) {
|
|
2131
|
-
|
|
2267
|
+
const className = require$$0.useMemo(() => {
|
|
2268
|
+
return renderClassStatus('rls-confirmation', { visible });
|
|
2269
|
+
}, [visible]);
|
|
2270
|
+
return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-confirmation__component", children: [jsxRuntimeExports.jsxs("div", { className: "rls-confirmation__header", children: [title && jsxRuntimeExports.jsx("div", { className: "rls-confirmation__title", children: title }), subtitle && (jsxRuntimeExports.jsx("div", { className: "rls-confirmation__subtitle", children: subtitle }))] }), jsxRuntimeExports.jsx("div", { className: "rls-confirmation__body", children: content && (jsxRuntimeExports.jsx("div", { className: "rls-confirmation__message", children: content })) }), (approved || reject) && (jsxRuntimeExports.jsx("div", { className: "rls-confirmation__footer", children: jsxRuntimeExports.jsxs("div", { className: "rls-confirmation__actions", children: [approved && (jsxRuntimeExports.jsx(RlsButton, { identifier: approved.identifier, type: "raised", onClick: approved.onClick, children: approved.label })), reject && (jsxRuntimeExports.jsx(RlsButton, { identifier: reject.identifier, type: "outline", onClick: reject.onClick, children: reject.label }))] }) }))] }), jsxRuntimeExports.jsx("div", { className: "rls-confirmation__backdrop" })] }));
|
|
2132
2271
|
}
|
|
2133
2272
|
function useConfirmation() {
|
|
2134
2273
|
const [config, setConfig] = require$$0.useState({});
|
|
@@ -2174,53 +2313,218 @@ function RlsDatatableHeader({ children, identifier }) {
|
|
|
2174
2313
|
return (jsxRuntimeExports.jsx("tr", { id: identifier, className: "rls-datatable__header", children: children }));
|
|
2175
2314
|
}
|
|
2176
2315
|
function RlsDatatableTitle({ children, className, control, identifier }) {
|
|
2177
|
-
|
|
2316
|
+
const classDatatableName = require$$0.useMemo(() => {
|
|
2317
|
+
return renderClassStatus('rls-datatable__title', { control }, className);
|
|
2318
|
+
}, [control, className]);
|
|
2319
|
+
return (jsxRuntimeExports.jsx("th", { id: identifier, className: classDatatableName, children: children }));
|
|
2178
2320
|
}
|
|
2179
2321
|
function RlsDatatableSubheader({ children, className, identifier }) {
|
|
2180
|
-
|
|
2322
|
+
const classDatatableName = require$$0.useMemo(() => {
|
|
2323
|
+
return renderClassStatus('rls-datatable__subheader', {}, className);
|
|
2324
|
+
}, [className]);
|
|
2325
|
+
return (jsxRuntimeExports.jsx("tr", { id: identifier, className: classDatatableName, children: children }));
|
|
2181
2326
|
}
|
|
2182
2327
|
function RlsDatatableRecord({ children, className, error, identifier, info, successs, warning }) {
|
|
2183
|
-
|
|
2328
|
+
const classDatatableName = require$$0.useMemo(() => {
|
|
2329
|
+
return renderClassStatus('rls-datatable__record', { error, info, successs, warning }, className);
|
|
2330
|
+
}, [error, info, successs, warning, className]);
|
|
2331
|
+
return (jsxRuntimeExports.jsx("tr", { id: identifier, className: classDatatableName, children: children }));
|
|
2184
2332
|
}
|
|
2185
2333
|
function RlsDatatableTotals({ children, className, error, identifier, info, successs, warning }) {
|
|
2186
|
-
|
|
2334
|
+
const classDatatableName = require$$0.useMemo(() => {
|
|
2335
|
+
return renderClassStatus('rls-datatable__totals', { error, info, successs, warning }, className);
|
|
2336
|
+
}, [error, info, successs, warning, className]);
|
|
2337
|
+
return (jsxRuntimeExports.jsx("div", { id: identifier, className: classDatatableName, children: children }));
|
|
2187
2338
|
}
|
|
2188
2339
|
function RlsDatatableCell({ children, className, control, identifier, overflow }) {
|
|
2189
|
-
|
|
2340
|
+
const classDatatableName = require$$0.useMemo(() => {
|
|
2341
|
+
return renderClassStatus('rls-datatable__cell', { control, overflow }, className);
|
|
2342
|
+
}, [control, overflow, className]);
|
|
2343
|
+
return (jsxRuntimeExports.jsx("th", { id: identifier, className: classDatatableName, children: children }));
|
|
2190
2344
|
}
|
|
2191
2345
|
function RlsDatatableData({ children, className, control, identifier, overflow }) {
|
|
2192
|
-
|
|
2346
|
+
const classDatatableName = require$$0.useMemo(() => {
|
|
2347
|
+
return renderClassStatus('rls-datatable__data', { control, overflow }, className);
|
|
2348
|
+
}, [control, overflow, className]);
|
|
2349
|
+
return (jsxRuntimeExports.jsx("div", { id: identifier, className: classDatatableName, children: children }));
|
|
2193
2350
|
}
|
|
2194
2351
|
function RlsDatatable({ children, datatable, footer, header, identifier, rlsTheme, summary, toolbar }) {
|
|
2195
|
-
|
|
2352
|
+
const className = require$$0.useMemo(() => {
|
|
2353
|
+
return renderClassStatus('rls-datatable', {
|
|
2196
2354
|
scrolleable: datatable?.scrolleable
|
|
2197
|
-
})
|
|
2355
|
+
});
|
|
2356
|
+
}, [datatable]);
|
|
2357
|
+
return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [toolbar && jsxRuntimeExports.jsx("div", { className: "rls-datatable__toolbar", children: toolbar }), jsxRuntimeExports.jsxs("table", { id: identifier, children: [header && jsxRuntimeExports.jsx("thead", { className: "rls-datatable__head", children: header }), jsxRuntimeExports.jsx("tbody", { ref: datatable?.tableRef, className: "rls-datatable__body", children: children })] }), summary && jsxRuntimeExports.jsx("div", { className: "rls-datatable__summary", children: summary }), footer && jsxRuntimeExports.jsx("div", { className: "rls-datatable__footer", children: footer })] }));
|
|
2198
2358
|
}
|
|
2199
2359
|
|
|
2200
|
-
|
|
2201
|
-
const
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
require$$0.
|
|
2212
|
-
|
|
2360
|
+
function createObserver(options) {
|
|
2361
|
+
const { setScrolleable, table } = options;
|
|
2362
|
+
const observer = new ResizeObserver(() => {
|
|
2363
|
+
const scrollHeight = table.scrollHeight || 0;
|
|
2364
|
+
const clientHeight = table.clientHeight || 0;
|
|
2365
|
+
setScrolleable(scrollHeight > clientHeight);
|
|
2366
|
+
});
|
|
2367
|
+
observer.observe(table);
|
|
2368
|
+
return observer;
|
|
2369
|
+
}
|
|
2370
|
+
function useDatatable() {
|
|
2371
|
+
const [scrolleable, setScrolleable] = require$$0.useState(false);
|
|
2372
|
+
const tableRef = require$$0.useRef(null);
|
|
2373
|
+
require$$0.useEffect(() => {
|
|
2374
|
+
const observer = tableRef?.current &&
|
|
2375
|
+
createObserver({ setScrolleable, table: tableRef?.current });
|
|
2376
|
+
return () => {
|
|
2377
|
+
observer?.disconnect();
|
|
2378
|
+
};
|
|
2379
|
+
}, []);
|
|
2380
|
+
return { scrolleable, tableRef };
|
|
2381
|
+
}
|
|
2382
|
+
|
|
2383
|
+
function useListController(props) {
|
|
2384
|
+
const { suggestions, automatic, formControl, reference } = props;
|
|
2385
|
+
const listIsOpen = require$$0.useRef(false);
|
|
2386
|
+
const contentRef = require$$0.useRef(null);
|
|
2387
|
+
const listRef = require$$0.useRef(null);
|
|
2388
|
+
const inputRef = require$$0.useRef(null);
|
|
2389
|
+
const [collection, setCollection] = require$$0.useState(new components.ListCollection(suggestions));
|
|
2390
|
+
const [state, refreshState] = require$$0.useState({
|
|
2391
|
+
focused: false,
|
|
2392
|
+
higher: false,
|
|
2393
|
+
value: '',
|
|
2394
|
+
modalIsVisible: false
|
|
2395
|
+
});
|
|
2396
|
+
const position = require$$0.useRef(0);
|
|
2397
|
+
const valueProtected = require$$0.useRef();
|
|
2398
|
+
const changeValueInternal = require$$0.useRef(false);
|
|
2399
|
+
require$$0.useEffect(() => {
|
|
2400
|
+
function onCloseSuggestions({ target }) {
|
|
2401
|
+
!contentRef?.current?.contains(target) &&
|
|
2402
|
+
refreshState((state) => ({ ...state, modalIsVisible: false }));
|
|
2403
|
+
}
|
|
2404
|
+
document.addEventListener('click', onCloseSuggestions);
|
|
2405
|
+
return () => {
|
|
2406
|
+
document.removeEventListener('click', onCloseSuggestions);
|
|
2407
|
+
};
|
|
2408
|
+
}, []);
|
|
2409
|
+
require$$0.useEffect(() => {
|
|
2410
|
+
if (!listIsOpen.current && state.modalIsVisible) {
|
|
2411
|
+
listIsOpen.current = true;
|
|
2412
|
+
}
|
|
2413
|
+
if (listIsOpen.current && !state.modalIsVisible) {
|
|
2414
|
+
formControl?.touch();
|
|
2415
|
+
}
|
|
2416
|
+
}, [state.modalIsVisible]);
|
|
2417
|
+
require$$0.useEffect(() => {
|
|
2418
|
+
setCollection(new components.ListCollection(suggestions, reference));
|
|
2419
|
+
}, [suggestions]);
|
|
2420
|
+
require$$0.useEffect(() => {
|
|
2421
|
+
if (!changeValueInternal.current) {
|
|
2422
|
+
if (formControl?.value) {
|
|
2423
|
+
const element = collection.find(formControl.value);
|
|
2424
|
+
if (!element) {
|
|
2425
|
+
valueProtected.current = formControl.value;
|
|
2426
|
+
automatic
|
|
2427
|
+
? setFormValue(collection.value[0], true)
|
|
2428
|
+
: setFormValue(undefined);
|
|
2429
|
+
}
|
|
2430
|
+
else {
|
|
2431
|
+
refreshState((state) => ({ ...state, value: element.description }));
|
|
2432
|
+
}
|
|
2433
|
+
}
|
|
2434
|
+
else if (valueProtected.current) {
|
|
2435
|
+
const element = collection.find(valueProtected.current);
|
|
2436
|
+
element && setFormValue(element);
|
|
2437
|
+
}
|
|
2438
|
+
else {
|
|
2439
|
+
automatic && setFormValue(collection.value[0], true);
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2442
|
+
changeValueInternal.current = false;
|
|
2443
|
+
}, [collection, formControl?.value]);
|
|
2444
|
+
const setState = require$$0.useCallback((state) => {
|
|
2445
|
+
const _state = state.modalIsVisible
|
|
2446
|
+
? {
|
|
2447
|
+
...state,
|
|
2448
|
+
higher: components.locationListCanTop(contentRef.current, listRef.current)
|
|
2449
|
+
}
|
|
2450
|
+
: state;
|
|
2451
|
+
refreshState((state) => ({ ...state, ..._state }));
|
|
2452
|
+
}, []);
|
|
2453
|
+
const setFormValue = require$$0.useCallback((element, initialValue = false) => {
|
|
2454
|
+
refreshState((state) => ({
|
|
2455
|
+
...state,
|
|
2456
|
+
value: element?.description || ''
|
|
2457
|
+
}));
|
|
2458
|
+
changeValueInternal.current = true;
|
|
2459
|
+
initialValue
|
|
2460
|
+
? formControl?.setInitialValue(element?.value)
|
|
2461
|
+
: formControl?.setValue(element?.value);
|
|
2462
|
+
}, [formControl]);
|
|
2463
|
+
const navigationInput = require$$0.useCallback((event) => {
|
|
2464
|
+
if (state.modalIsVisible) {
|
|
2465
|
+
const _position = components.navigationListFromInput({
|
|
2466
|
+
content: contentRef.current,
|
|
2467
|
+
event: event,
|
|
2468
|
+
list: listRef.current
|
|
2469
|
+
});
|
|
2470
|
+
position.current = _position ?? 0;
|
|
2471
|
+
}
|
|
2472
|
+
}, [state.modalIsVisible]);
|
|
2473
|
+
const navigationElement = require$$0.useCallback((event) => {
|
|
2474
|
+
position.current = components.navigationListFromElement({
|
|
2475
|
+
content: contentRef.current,
|
|
2476
|
+
event: event,
|
|
2477
|
+
input: inputRef.current,
|
|
2478
|
+
list: listRef.current,
|
|
2479
|
+
position: position.current
|
|
2480
|
+
});
|
|
2481
|
+
}, [state.modalIsVisible]);
|
|
2482
|
+
return {
|
|
2483
|
+
...state,
|
|
2484
|
+
contentRef,
|
|
2485
|
+
inputRef,
|
|
2486
|
+
listRef,
|
|
2487
|
+
navigationElement,
|
|
2488
|
+
navigationInput,
|
|
2489
|
+
setFormValue,
|
|
2490
|
+
setState
|
|
2491
|
+
};
|
|
2492
|
+
}
|
|
2493
|
+
|
|
2494
|
+
const DURATION_ANIMATION$1 = 240;
|
|
2495
|
+
const MAX_ELEMENTS = 6;
|
|
2496
|
+
function useFieldAutocomplete(props) {
|
|
2497
|
+
const controller = useListController(props);
|
|
2498
|
+
const [coincidences, setCoincidences] = require$$0.useState([]);
|
|
2499
|
+
const [pattern, setPattern] = require$$0.useState('');
|
|
2500
|
+
const currentStore = require$$0.useRef({
|
|
2501
|
+
coincidences: [],
|
|
2502
|
+
pattern: '',
|
|
2503
|
+
previous: null
|
|
2504
|
+
});
|
|
2505
|
+
const refreshCoincidences = require$$0.useCallback((suggestions, pattern, reboot = false) => {
|
|
2506
|
+
const { collection, store } = components.createAutocompleteStore({
|
|
2507
|
+
pattern,
|
|
2508
|
+
suggestions,
|
|
2509
|
+
reboot,
|
|
2510
|
+
store: currentStore.current
|
|
2511
|
+
});
|
|
2512
|
+
currentStore.current = store;
|
|
2513
|
+
setCoincidences(collection.slice(0, MAX_ELEMENTS));
|
|
2514
|
+
}, []);
|
|
2515
|
+
require$$0.useEffect(() => {
|
|
2516
|
+
refreshCoincidences(props.suggestions, pattern, true);
|
|
2213
2517
|
}, [props.suggestions]);
|
|
2214
2518
|
require$$0.useEffect(() => {
|
|
2215
|
-
refreshCoincidences(pattern);
|
|
2519
|
+
refreshCoincidences(props.suggestions, pattern);
|
|
2216
2520
|
}, [pattern]);
|
|
2217
|
-
|
|
2521
|
+
const onFocusInput = require$$0.useCallback(() => {
|
|
2218
2522
|
controller.setState({ focused: true });
|
|
2219
|
-
}
|
|
2220
|
-
|
|
2523
|
+
}, [controller.setState]);
|
|
2524
|
+
const onBlurInput = require$$0.useCallback(() => {
|
|
2221
2525
|
controller.setState({ focused: false });
|
|
2222
|
-
}
|
|
2223
|
-
|
|
2526
|
+
}, [controller.setState]);
|
|
2527
|
+
const onKeydownInput = require$$0.useCallback((event) => {
|
|
2224
2528
|
switch (event.code) {
|
|
2225
2529
|
case 'Escape':
|
|
2226
2530
|
case 'Tab':
|
|
@@ -2230,14 +2534,14 @@ function useFieldAutocomplete(props) {
|
|
|
2230
2534
|
controller.navigationInput(event);
|
|
2231
2535
|
break;
|
|
2232
2536
|
}
|
|
2233
|
-
}
|
|
2234
|
-
|
|
2537
|
+
}, [controller.setState, controller.navigationInput]);
|
|
2538
|
+
const onClickControl = require$$0.useCallback(() => {
|
|
2235
2539
|
controller.setState({ modalIsVisible: true });
|
|
2236
2540
|
setTimeout(() => {
|
|
2237
2541
|
controller.inputRef?.current?.focus();
|
|
2238
2542
|
}, DURATION_ANIMATION$1);
|
|
2239
|
-
}
|
|
2240
|
-
|
|
2543
|
+
}, [controller.setState]);
|
|
2544
|
+
const onClickAction = require$$0.useCallback(() => {
|
|
2241
2545
|
if (controller.value) {
|
|
2242
2546
|
controller.setState({ modalIsVisible: false });
|
|
2243
2547
|
controller.setFormValue(undefined);
|
|
@@ -2246,44 +2550,43 @@ function useFieldAutocomplete(props) {
|
|
|
2246
2550
|
else {
|
|
2247
2551
|
onClickControl();
|
|
2248
2552
|
}
|
|
2249
|
-
}
|
|
2250
|
-
|
|
2553
|
+
}, [
|
|
2554
|
+
controller.value,
|
|
2555
|
+
controller.setState,
|
|
2556
|
+
controller.setFormValue,
|
|
2557
|
+
props.onValue
|
|
2558
|
+
]);
|
|
2559
|
+
const onClickBackdrop = require$$0.useCallback(() => {
|
|
2251
2560
|
controller.setState({ modalIsVisible: false });
|
|
2252
|
-
}
|
|
2253
|
-
|
|
2561
|
+
}, [controller.setState]);
|
|
2562
|
+
const onChange = require$$0.useCallback((element) => {
|
|
2563
|
+
if (props.onSelect) {
|
|
2564
|
+
controller.setState({ modalIsVisible: false });
|
|
2565
|
+
element.value && props.onSelect(element.value);
|
|
2566
|
+
}
|
|
2567
|
+
else {
|
|
2568
|
+
controller.setState({ modalIsVisible: false });
|
|
2569
|
+
controller.setFormValue(element);
|
|
2570
|
+
}
|
|
2571
|
+
props.onValue && props.onValue(element.value);
|
|
2572
|
+
}, [
|
|
2573
|
+
controller.setState,
|
|
2574
|
+
controller.setFormValue,
|
|
2575
|
+
props.onSelect,
|
|
2576
|
+
props.onValue
|
|
2577
|
+
]);
|
|
2578
|
+
const onClickElement = require$$0.useCallback((element) => {
|
|
2254
2579
|
return () => {
|
|
2255
2580
|
onChange(element);
|
|
2256
2581
|
};
|
|
2257
|
-
}
|
|
2258
|
-
|
|
2582
|
+
}, []);
|
|
2583
|
+
const onKeydownElement = require$$0.useCallback((element) => {
|
|
2259
2584
|
return (event) => {
|
|
2260
2585
|
event.code === 'Enter'
|
|
2261
2586
|
? onChange(element)
|
|
2262
2587
|
: controller.navigationElement(event);
|
|
2263
2588
|
};
|
|
2264
|
-
}
|
|
2265
|
-
function onChange(element) {
|
|
2266
|
-
const { onSelect, onValue } = props;
|
|
2267
|
-
if (onSelect) {
|
|
2268
|
-
controller.setState({ modalIsVisible: false });
|
|
2269
|
-
element.value && onSelect(element.value);
|
|
2270
|
-
}
|
|
2271
|
-
else {
|
|
2272
|
-
controller.setState({ modalIsVisible: false });
|
|
2273
|
-
controller.setFormValue(element);
|
|
2274
|
-
}
|
|
2275
|
-
onValue && onValue(element.value);
|
|
2276
|
-
}
|
|
2277
|
-
function refreshCoincidences(pattern, reboot = false) {
|
|
2278
|
-
const { collection, store } = components.createAutocompleteStore({
|
|
2279
|
-
pattern,
|
|
2280
|
-
suggestions: props.suggestions,
|
|
2281
|
-
reboot,
|
|
2282
|
-
store: currentStore.current
|
|
2283
|
-
});
|
|
2284
|
-
currentStore.current = store;
|
|
2285
|
-
setCoincidences(collection.slice(0, MAX_ELEMENTS));
|
|
2286
|
-
}
|
|
2589
|
+
}, [controller.navigationElement]);
|
|
2287
2590
|
return {
|
|
2288
2591
|
...controller,
|
|
2289
2592
|
coincidences,
|
|
@@ -2303,227 +2606,309 @@ function useFieldAutocomplete(props) {
|
|
|
2303
2606
|
function RlsFieldAutocompleteTemplate(props) {
|
|
2304
2607
|
const autocomplete = useFieldAutocomplete(props);
|
|
2305
2608
|
const { render, children, formControl, msgErrorDisabled, onSearch, placeholder, rlsTheme, searching } = props;
|
|
2306
|
-
const
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2609
|
+
const [labels, setLabels] = require$$0.useState({
|
|
2610
|
+
listEmptyDescription: reactI18n('listEmptyDescription'),
|
|
2611
|
+
listEmptyTitle: reactI18n('listEmptyTitle'),
|
|
2612
|
+
listInputPlaceholder: reactI18n('listInputPlaceholder')
|
|
2613
|
+
});
|
|
2614
|
+
require$$0.useEffect(() => {
|
|
2615
|
+
return i18n.i18nSubscribe(() => {
|
|
2616
|
+
setLabels({
|
|
2617
|
+
listEmptyDescription: reactI18n('listEmptyDescription'),
|
|
2618
|
+
listEmptyTitle: reactI18n('listEmptyTitle'),
|
|
2619
|
+
listInputPlaceholder: reactI18n('listInputPlaceholder')
|
|
2620
|
+
});
|
|
2621
|
+
});
|
|
2622
|
+
}, []);
|
|
2623
|
+
const _disabled = require$$0.useMemo(() => {
|
|
2624
|
+
return formControl?.disabled || props.disabled;
|
|
2625
|
+
}, [formControl?.disabled, props.disabled]);
|
|
2626
|
+
const className = require$$0.useMemo(() => {
|
|
2627
|
+
return renderClassStatus('rls-field-box', {
|
|
2628
|
+
focused: autocomplete.focused && !_disabled,
|
|
2629
|
+
error: formControl?.wrong,
|
|
2630
|
+
disabled: _disabled,
|
|
2631
|
+
selected: !!autocomplete.value
|
|
2632
|
+
}, 'rls-field-list rls-field-autocomplete');
|
|
2633
|
+
}, [formControl?.wrong, autocomplete.value, autocomplete.focused, _disabled]);
|
|
2634
|
+
const classNameList = require$$0.useMemo(() => {
|
|
2635
|
+
return renderClassStatus('rls-field-list__suggestions', {
|
|
2636
|
+
higher: autocomplete.higher,
|
|
2637
|
+
visible: autocomplete.modalIsVisible
|
|
2638
|
+
});
|
|
2639
|
+
}, [autocomplete.higher, autocomplete.modalIsVisible]);
|
|
2640
|
+
const onInputSearch = require$$0.useCallback((event) => {
|
|
2641
|
+
autocomplete.setPattern(event.target.value);
|
|
2642
|
+
}, []);
|
|
2643
|
+
const onClickSearch = require$$0.useCallback(() => {
|
|
2644
|
+
onSearch && onSearch(autocomplete.pattern);
|
|
2645
|
+
}, [onSearch, autocomplete.pattern]);
|
|
2646
|
+
return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref: autocomplete.contentRef, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-list__control", readOnly: true, disabled: _disabled, placeholder: placeholder, value: autocomplete.value, onClick: autocomplete.onClickControl }), jsxRuntimeExports.jsx("button", { className: "rls-field-list__action", disabled: _disabled, onClick: autocomplete.onClickAction, children: jsxRuntimeExports.jsx(RlsIcon, { value: autocomplete.value ? 'trash-2' : 'arrow-ios-down' }) })] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })), jsxRuntimeExports.jsx("div", { className: classNameList, children: autocomplete.modalIsVisible && (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx("div", { className: "rls-field-list__suggestions__body", children: jsxRuntimeExports.jsxs("ul", { ref: autocomplete.listRef, className: "rls-field-list__ul", children: [jsxRuntimeExports.jsxs("div", { className: "rls-field-list__ul__search", children: [jsxRuntimeExports.jsx("input", { ref: autocomplete.inputRef, className: "rls-field-list__ul__control", type: "text", placeholder: labels.listInputPlaceholder, value: autocomplete.pattern, onChange: onInputSearch, disabled: _disabled || searching, onFocus: autocomplete.onFocusInput, onBlur: autocomplete.onBlurInput, onKeyDown: autocomplete.onKeydownInput }), onSearch && (jsxRuntimeExports.jsx("button", { disabled: _disabled || searching, onClick: onClickSearch, children: jsxRuntimeExports.jsx(RlsIcon, { value: "search" }) }))] }), searching && jsxRuntimeExports.jsx(RlsProgressBar, { indeterminate: true }), autocomplete.coincidences.map((element, index) => (jsxRuntimeExports.jsx("li", { className: "rls-field-list__element", tabIndex: -1, onClick: autocomplete.onClickElement(element), onKeyDown: autocomplete.onKeydownElement(element), children: render(element) }, index))), !autocomplete.coincidences.length && (jsxRuntimeExports.jsx("li", { className: "rls-field-list__empty", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-list__empty__description", children: [jsxRuntimeExports.jsx("label", { className: "rls-label-bold truncate", children: labels.listEmptyTitle }), jsxRuntimeExports.jsx("p", { className: "rls-caption-regular", children: labels.listEmptyDescription })] }) }))] }) }), jsxRuntimeExports.jsx("div", { className: "rls-field-list__backdrop", onClick: autocomplete.onClickBackdrop })] })) })] }));
|
|
2321
2647
|
}
|
|
2322
2648
|
function RlsFieldAutocomplete(props) {
|
|
2323
2649
|
return (jsxRuntimeExports.jsx(RlsFieldAutocompleteTemplate, { ...props, render: (element) => (jsxRuntimeExports.jsx(RlsBallot, { subtitle: element.subtitle, img: element.img, initials: element.initials, children: jsxRuntimeExports.jsx("span", { children: element.title }) })) }));
|
|
2324
2650
|
}
|
|
2325
2651
|
|
|
2326
2652
|
function RlsModal({ children, overflow, visible, rlsTheme }) {
|
|
2327
|
-
|
|
2653
|
+
const className = require$$0.useMemo(() => {
|
|
2654
|
+
return renderClassStatus('rls-modal', { overflow, visible });
|
|
2655
|
+
}, [overflow, visible]);
|
|
2656
|
+
return ReactDOM.createPortal(jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-modal__component", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-modal__backdrop" })] }), document.body);
|
|
2328
2657
|
}
|
|
2329
2658
|
|
|
2330
|
-
const
|
|
2659
|
+
const formatTitle = '{dw}, {mx} {dd} de {aa}';
|
|
2331
2660
|
function RlsPickerDate({ automatic, date, disabled, formControl, maxDate, minDate, onListener, rlsTheme }) {
|
|
2332
|
-
const today = new Date(); // Initial current date in component
|
|
2333
|
-
const
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
const
|
|
2337
|
-
const
|
|
2661
|
+
const today = require$$0.useRef(new Date()); // Initial current date in component
|
|
2662
|
+
const _date = require$$0.useMemo(() => {
|
|
2663
|
+
return formControl?.value ?? date ?? today.current;
|
|
2664
|
+
}, [formControl?.value, date]);
|
|
2665
|
+
const yearControl = reactForms.useReactControl(_date.getFullYear());
|
|
2666
|
+
const dayControl = reactForms.useReactControl(_date.getDate());
|
|
2667
|
+
const monthControl = reactForms.useReactControl(_date.getMonth());
|
|
2668
|
+
const [value, setValue] = require$$0.useState(_date);
|
|
2338
2669
|
const [visibility, setVisibility] = require$$0.useState('DAY');
|
|
2670
|
+
const [labels, setLabels] = require$$0.useState({
|
|
2671
|
+
dateActionCancel: reactI18n('dateActionCancel'),
|
|
2672
|
+
dateActionSelect: reactI18n('dateActionSelect'),
|
|
2673
|
+
dateActionToday: reactI18n('dateActionToday')
|
|
2674
|
+
});
|
|
2675
|
+
const classNameComponent = require$$0.useMemo(() => {
|
|
2676
|
+
return renderClassStatus('rls-picker-date__component', {
|
|
2677
|
+
day: visibility === 'DAY',
|
|
2678
|
+
month: visibility === 'MONTH',
|
|
2679
|
+
year: visibility === 'YEAR'
|
|
2680
|
+
});
|
|
2681
|
+
}, [visibility]);
|
|
2682
|
+
const title = require$$0.useMemo(() => {
|
|
2683
|
+
return dates.dateFormatTemplate(_date, formatTitle);
|
|
2684
|
+
}, [_date]);
|
|
2685
|
+
const itIsDisabledToday = require$$0.useMemo(() => components.dateOutRange({
|
|
2686
|
+
date: today.current,
|
|
2687
|
+
maxDate,
|
|
2688
|
+
minDate
|
|
2689
|
+
}), [today.current, maxDate, minDate]);
|
|
2339
2690
|
require$$0.useEffect(() => {
|
|
2340
|
-
const
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2691
|
+
const date = components.verifyDateRange({ date: _date, minDate, maxDate });
|
|
2692
|
+
setValue(date);
|
|
2693
|
+
formControl?.setValue(date);
|
|
2694
|
+
return i18n.i18nSubscribe(() => {
|
|
2695
|
+
setLabels({
|
|
2696
|
+
dateActionCancel: reactI18n('dateActionCancel'),
|
|
2697
|
+
dateActionSelect: reactI18n('dateActionSelect'),
|
|
2698
|
+
dateActionToday: reactI18n('dateActionToday')
|
|
2699
|
+
});
|
|
2344
2700
|
});
|
|
2345
|
-
setValue(dateRange);
|
|
2346
|
-
formControl?.setValue(dateRange);
|
|
2347
2701
|
}, []);
|
|
2348
2702
|
require$$0.useEffect(() => {
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
require$$0.useEffect(() => {
|
|
2353
|
-
commons.itIsDefined(monthControl.value) &&
|
|
2354
|
-
setValue(dates.assignMonthInDate(value, monthControl.value));
|
|
2355
|
-
}, [monthControl.value]);
|
|
2356
|
-
require$$0.useEffect(() => {
|
|
2357
|
-
commons.itIsDefined(dayControl.value) &&
|
|
2358
|
-
setValue(dates.assignDayInDate(value, dayControl.value));
|
|
2359
|
-
}, [dayControl.value]);
|
|
2360
|
-
function onVisibilityDay() {
|
|
2703
|
+
setValue(new Date(yearControl.value, monthControl.value, dayControl.value));
|
|
2704
|
+
}, [yearControl.value, monthControl.value, dayControl.value]);
|
|
2705
|
+
const onVisibilityDay = require$$0.useCallback(() => {
|
|
2361
2706
|
setVisibility('DAY');
|
|
2362
|
-
}
|
|
2363
|
-
|
|
2707
|
+
}, []);
|
|
2708
|
+
const onVisibilityMonth = require$$0.useCallback(() => {
|
|
2364
2709
|
setVisibility('MONTH');
|
|
2365
|
-
}
|
|
2366
|
-
|
|
2710
|
+
}, []);
|
|
2711
|
+
const onVisibilityYear = require$$0.useCallback(() => {
|
|
2367
2712
|
setVisibility('YEAR');
|
|
2368
|
-
}
|
|
2369
|
-
|
|
2713
|
+
}, []);
|
|
2714
|
+
const onCancel = require$$0.useCallback(() => {
|
|
2370
2715
|
onListener && onListener({ event: components.PickerListenerEvent.Cancel });
|
|
2371
|
-
}
|
|
2372
|
-
|
|
2373
|
-
yearControl.setValue(today.getFullYear());
|
|
2374
|
-
dayControl.setValue(today.getDate());
|
|
2375
|
-
monthControl.setValue(today.getMonth());
|
|
2376
|
-
formControl?.setValue(today);
|
|
2377
|
-
onListener &&
|
|
2378
|
-
|
|
2379
|
-
|
|
2716
|
+
}, [onListener]);
|
|
2717
|
+
const onToday = require$$0.useCallback(() => {
|
|
2718
|
+
yearControl.setValue(today.current.getFullYear());
|
|
2719
|
+
dayControl.setValue(today.current.getDate());
|
|
2720
|
+
monthControl.setValue(today.current.getMonth());
|
|
2721
|
+
formControl?.setValue(today.current);
|
|
2722
|
+
onListener &&
|
|
2723
|
+
onListener({
|
|
2724
|
+
event: components.PickerListenerEvent.Now,
|
|
2725
|
+
value: today.current
|
|
2726
|
+
});
|
|
2727
|
+
}, [today.current, formControl, onListener]);
|
|
2728
|
+
const onSelect = require$$0.useCallback(() => {
|
|
2380
2729
|
formControl?.setValue(value);
|
|
2381
|
-
onListener &&
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2730
|
+
onListener &&
|
|
2731
|
+
onListener({
|
|
2732
|
+
event: components.PickerListenerEvent.Select,
|
|
2733
|
+
value
|
|
2734
|
+
});
|
|
2735
|
+
}, [formControl, value, onListener]);
|
|
2736
|
+
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-date", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-picker-date__header", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-date__title rls-picker-date__title--description", children: jsxRuntimeExports.jsx("span", { onClick: onVisibilityDay, children: title }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date__title rls-picker-date__title--year", children: jsxRuntimeExports.jsx("span", { onClick: onVisibilityYear, children: yearControl.value }) }), jsxRuntimeExports.jsx(RlsPickerSelectorTitle, { monthControl: monthControl, yearControl: yearControl, date: value, maxDate: maxDate, minDate: minDate, disabled: visibility === 'YEAR', type: 'month', onClick: onVisibilityMonth })] }), jsxRuntimeExports.jsxs("div", { className: classNameComponent, children: [jsxRuntimeExports.jsx(RlsPickerDay, { formControl: dayControl, date: _date, month: monthControl.value, year: yearControl.value, maxDate: maxDate, minDate: minDate, disabled: disabled }), jsxRuntimeExports.jsx(RlsPickerMonth, { formControl: monthControl, date: _date, year: yearControl.value, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay }), jsxRuntimeExports.jsx(RlsPickerYear, { formControl: yearControl, date: _date, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay })] }), !automatic && (jsxRuntimeExports.jsx("div", { className: "rls-picker-date__footer", children: jsxRuntimeExports.jsxs("div", { className: "rls-picker-date__actions", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-date__actions--cancel", children: jsxRuntimeExports.jsx(RlsButton, { type: "ghost", onClick: onCancel, children: labels.dateActionCancel }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date__actions--today", children: jsxRuntimeExports.jsx(RlsButton, { type: "ghost", onClick: onToday, disabled: itIsDisabledToday, children: labels.dateActionToday }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date__actions--ok", children: jsxRuntimeExports.jsx(RlsButton, { type: "raised", onClick: onSelect, children: labels.dateActionSelect }) })] }) }))] }));
|
|
2388
2737
|
}
|
|
2389
2738
|
|
|
2390
|
-
const
|
|
2391
|
-
function RlsFieldDate({ children, date, disabled, formControl, format, identifier, maxDate, minDate, msgErrorDisabled, onValue, placeholder, rlsTheme, value:
|
|
2392
|
-
const today = new Date(); // Initial current date in component
|
|
2393
|
-
const [value, setValue] = require$$0.useState(formControl?.value
|
|
2739
|
+
const formatDate = '{dd}/{mx}/{aa}';
|
|
2740
|
+
function RlsFieldDate({ children, date, disabled, formControl, format, identifier, maxDate, minDate, msgErrorDisabled, onValue, placeholder, rlsTheme, value: _value }) {
|
|
2741
|
+
const today = require$$0.useRef(new Date()); // Initial current date in component
|
|
2742
|
+
const [value, setValue] = require$$0.useState(formControl?.value ?? _value);
|
|
2394
2743
|
const [modalIsVisible, setModalIsVisible] = require$$0.useState(false);
|
|
2744
|
+
const _disabled = require$$0.useMemo(() => {
|
|
2745
|
+
return formControl?.disabled || disabled;
|
|
2746
|
+
}, [formControl?.disabled, disabled]);
|
|
2747
|
+
const className = require$$0.useMemo(() => {
|
|
2748
|
+
return renderClassStatus('rls-field-box', { disabled: _disabled });
|
|
2749
|
+
}, [_disabled]);
|
|
2750
|
+
const { icon, valueInput } = require$$0.useMemo(() => {
|
|
2751
|
+
return {
|
|
2752
|
+
icon: value ? 'trash-2' : 'calendar',
|
|
2753
|
+
valueInput: value ? dates.dateFormatTemplate(value, format || formatDate) : ''
|
|
2754
|
+
};
|
|
2755
|
+
}, [value]);
|
|
2395
2756
|
require$$0.useEffect(() => {
|
|
2396
|
-
const
|
|
2397
|
-
date: formControl?.value
|
|
2757
|
+
const _date = components.verifyDateRange({
|
|
2758
|
+
date: formControl?.value ?? date ?? today.current,
|
|
2398
2759
|
minDate,
|
|
2399
2760
|
maxDate
|
|
2400
2761
|
});
|
|
2401
|
-
setValue(
|
|
2402
|
-
formControl?.setValue(
|
|
2762
|
+
setValue(_date);
|
|
2763
|
+
formControl?.setValue(_date);
|
|
2764
|
+
}, []);
|
|
2765
|
+
const onClickInput = require$$0.useCallback(() => {
|
|
2766
|
+
setModalIsVisible(true);
|
|
2403
2767
|
}, []);
|
|
2404
|
-
|
|
2768
|
+
const onChange = require$$0.useCallback((value) => {
|
|
2405
2769
|
setValue(value);
|
|
2406
2770
|
onValue && onValue(value);
|
|
2407
|
-
}
|
|
2408
|
-
|
|
2409
|
-
setModalIsVisible(true);
|
|
2410
|
-
}
|
|
2411
|
-
function onClickAction() {
|
|
2771
|
+
}, [onValue]);
|
|
2772
|
+
const onClickAction = require$$0.useCallback(() => {
|
|
2412
2773
|
if (value) {
|
|
2413
|
-
formControl?.setValue(
|
|
2774
|
+
formControl?.setValue(_value);
|
|
2414
2775
|
formControl?.touch();
|
|
2415
|
-
onChange(
|
|
2776
|
+
onChange(_value);
|
|
2416
2777
|
}
|
|
2417
2778
|
else {
|
|
2418
2779
|
setModalIsVisible(true);
|
|
2419
2780
|
}
|
|
2420
|
-
}
|
|
2421
|
-
const
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
const
|
|
2434
|
-
const
|
|
2435
|
-
const
|
|
2436
|
-
const
|
|
2437
|
-
const dayControl = reactForms.useReactControl(rangeInitial);
|
|
2438
|
-
const [value, setValue] = require$$0.useState(rangeInitial);
|
|
2439
|
-
const [date, setDate] = require$$0.useState(dateInitial);
|
|
2781
|
+
}, [value, formControl, _value, onChange]);
|
|
2782
|
+
const onListener = require$$0.useCallback(({ event, value }) => {
|
|
2783
|
+
event !== components.PickerListenerEvent.Cancel && onChange(value);
|
|
2784
|
+
formControl?.touch();
|
|
2785
|
+
setModalIsVisible(false);
|
|
2786
|
+
}, [formControl, onChange]);
|
|
2787
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-date", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children && jsxRuntimeExports.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-date__control", type: "text", value: valueInput, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: _disabled }), jsxRuntimeExports.jsx("button", { className: "rls-field-date__action", onClick: onClickAction, disabled: _disabled, children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) })] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }), jsxRuntimeExports.jsx(RlsModal, { visible: modalIsVisible, rlsTheme: rlsTheme, children: jsxRuntimeExports.jsx(RlsPickerDate, { formControl: formControl, date: date, disabled: _disabled, maxDate: maxDate, minDate: minDate, onListener: onListener }) })] }));
|
|
2788
|
+
}
|
|
2789
|
+
|
|
2790
|
+
function RlsPickerDateRange({ automatic, date: _picker, disabled, formControl, maxDate, minDate, onListener, rlsTheme }) {
|
|
2791
|
+
const _date = require$$0.useMemo(() => dates.normalizeMinTime(_picker ?? new Date()), [_picker]);
|
|
2792
|
+
const _range = require$$0.useMemo(() => formControl?.value ?? dates.DateRange.now(), [formControl?.value]);
|
|
2793
|
+
const yearControl = reactForms.useReactControl(_date.getFullYear());
|
|
2794
|
+
const monthControl = reactForms.useReactControl(_date.getMonth());
|
|
2795
|
+
const rangeControl = reactForms.useReactControl(_range);
|
|
2796
|
+
const [value, setValue] = require$$0.useState(_range);
|
|
2797
|
+
const [date, setDate] = require$$0.useState(_date);
|
|
2440
2798
|
const [visibility, setVisibility] = require$$0.useState('DAY');
|
|
2799
|
+
const [labels, setLabels] = require$$0.useState({
|
|
2800
|
+
dateActionCancel: reactI18n('dateActionCancel'),
|
|
2801
|
+
dateActionSelect: reactI18n('dateActionSelect')
|
|
2802
|
+
});
|
|
2803
|
+
const classNameComponent = require$$0.useMemo(() => {
|
|
2804
|
+
return renderClassStatus('rls-picker-date-range__component', {
|
|
2805
|
+
day: visibility === 'DAY',
|
|
2806
|
+
month: visibility === 'MONTH',
|
|
2807
|
+
year: visibility === 'YEAR'
|
|
2808
|
+
});
|
|
2809
|
+
}, [visibility]);
|
|
2810
|
+
const classNameFooter = require$$0.useMemo(() => {
|
|
2811
|
+
return renderClassStatus('rls-picker-date-range__footer', { automatic });
|
|
2812
|
+
}, [automatic]);
|
|
2813
|
+
const title = require$$0.useMemo(() => rangeFormatTemplate(value), [value]);
|
|
2814
|
+
require$$0.useEffect(() => {
|
|
2815
|
+
return i18n.i18nSubscribe(() => {
|
|
2816
|
+
setLabels({
|
|
2817
|
+
dateActionCancel: reactI18n('dateActionCancel'),
|
|
2818
|
+
dateActionSelect: reactI18n('dateActionSelect')
|
|
2819
|
+
});
|
|
2820
|
+
});
|
|
2821
|
+
}, []);
|
|
2441
2822
|
require$$0.useEffect(() => {
|
|
2442
|
-
setDate((
|
|
2443
|
-
return
|
|
2444
|
-
? dates.assignYearInDate(
|
|
2445
|
-
:
|
|
2823
|
+
setDate((date) => {
|
|
2824
|
+
return commons.itIsDefined(yearControl.value)
|
|
2825
|
+
? dates.assignYearInDate(date, yearControl.value)
|
|
2826
|
+
: date;
|
|
2446
2827
|
});
|
|
2447
2828
|
}, [yearControl.value]);
|
|
2448
2829
|
require$$0.useEffect(() => {
|
|
2449
|
-
setDate((
|
|
2450
|
-
return
|
|
2451
|
-
? dates.assignMonthInDate(
|
|
2452
|
-
:
|
|
2830
|
+
setDate((date) => {
|
|
2831
|
+
return commons.itIsDefined(monthControl.value)
|
|
2832
|
+
? dates.assignMonthInDate(date, monthControl.value)
|
|
2833
|
+
: date;
|
|
2453
2834
|
});
|
|
2454
2835
|
}, [monthControl.value]);
|
|
2455
2836
|
require$$0.useEffect(() => {
|
|
2456
|
-
|
|
2837
|
+
rangeControl.value && setValue(rangeControl.value);
|
|
2457
2838
|
setVisibility('DAY');
|
|
2458
|
-
}, [
|
|
2459
|
-
|
|
2839
|
+
}, [rangeControl.value]);
|
|
2840
|
+
const onVisibilityDay = require$$0.useCallback(() => {
|
|
2460
2841
|
setVisibility('DAY');
|
|
2461
|
-
}
|
|
2462
|
-
|
|
2842
|
+
}, []);
|
|
2843
|
+
const onVisibilityMonth = require$$0.useCallback(() => {
|
|
2463
2844
|
setVisibility('MONTH');
|
|
2464
|
-
}
|
|
2465
|
-
|
|
2845
|
+
}, []);
|
|
2846
|
+
const onVisibilityYear = require$$0.useCallback(() => {
|
|
2466
2847
|
setVisibility('YEAR');
|
|
2467
|
-
}
|
|
2468
|
-
|
|
2848
|
+
}, []);
|
|
2849
|
+
const onCancel = require$$0.useCallback(() => {
|
|
2469
2850
|
onListener && onListener({ event: components.PickerListenerEvent.Cancel });
|
|
2470
|
-
}
|
|
2471
|
-
|
|
2851
|
+
}, [onListener]);
|
|
2852
|
+
const onSelect = require$$0.useCallback(() => {
|
|
2472
2853
|
formControl?.setValue(value);
|
|
2473
2854
|
onListener && onListener({ event: components.PickerListenerEvent.Select, value });
|
|
2474
|
-
}
|
|
2475
|
-
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-date-range", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-picker-date-range__header", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-date-range__title rls-picker-date-range__title--description", children: jsxRuntimeExports.jsx("span", { onClick: onVisibilityDay, children:
|
|
2476
|
-
day: visibility === 'DAY',
|
|
2477
|
-
month: visibility === 'MONTH',
|
|
2478
|
-
year: visibility === 'YEAR'
|
|
2479
|
-
}), children: [jsxRuntimeExports.jsx(RlsPickerDayRange, { formControl: dayControl, date: date, maxDate: maxDate, minDate: minDate, disabled: disabled }), jsxRuntimeExports.jsx(RlsPickerMonth, { formControl: monthControl, year: yearControl.value, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay }), jsxRuntimeExports.jsx(RlsPickerYear, { formControl: yearControl, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay })] }), jsxRuntimeExports.jsx("div", { className: useRenderClassStatus('rls-picker-date-range__footer', {
|
|
2480
|
-
automatic
|
|
2481
|
-
}), children: jsxRuntimeExports.jsxs("div", { className: "rls-picker-date-range__actions", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-date-range__actions--cancel", children: jsxRuntimeExports.jsx(RlsButton, { type: "ghost", onClick: onCancel, children: reactI18n('dateActionCancel') }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date-range__actions--ok", children: jsxRuntimeExports.jsx(RlsButton, { type: "raised", onClick: onSelect, children: reactI18n('dateActionSelect') }) })] }) })] }));
|
|
2855
|
+
}, [formControl, value, onListener]);
|
|
2856
|
+
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-date-range", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-picker-date-range__header", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-date-range__title rls-picker-date-range__title--description", children: jsxRuntimeExports.jsx("span", { onClick: onVisibilityDay, children: title }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date-range__title rls-picker-date-range__title--year", children: jsxRuntimeExports.jsx("span", { onClick: onVisibilityYear, children: yearControl.value }) }), jsxRuntimeExports.jsx(RlsPickerSelectorTitle, { monthControl: monthControl, yearControl: yearControl, date: date, maxDate: maxDate, minDate: minDate, disabled: visibility === 'YEAR', type: visibility === 'MONTH' ? 'year' : 'month', onClick: onVisibilityMonth })] }), jsxRuntimeExports.jsxs("div", { className: classNameComponent, children: [jsxRuntimeExports.jsx(RlsPickerDayRange, { formControl: rangeControl, date: date, maxDate: maxDate, minDate: minDate, disabled: disabled }), jsxRuntimeExports.jsx(RlsPickerMonth, { formControl: monthControl, year: yearControl.value, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay }), jsxRuntimeExports.jsx(RlsPickerYear, { formControl: yearControl, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay })] }), jsxRuntimeExports.jsx("div", { className: classNameFooter, children: jsxRuntimeExports.jsxs("div", { className: "rls-picker-date-range__actions", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-date-range__actions--cancel", children: jsxRuntimeExports.jsx(RlsButton, { type: "ghost", onClick: onCancel, children: labels.dateActionCancel }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date-range__actions--ok", children: jsxRuntimeExports.jsx(RlsButton, { type: "raised", onClick: onSelect, children: labels.dateActionSelect }) })] }) })] }));
|
|
2482
2857
|
}
|
|
2483
2858
|
|
|
2484
|
-
function RlsFieldDateRange({ children, date:
|
|
2485
|
-
const currentDate =
|
|
2486
|
-
const [value, setValue] = require$$0.useState(formControl?.value ||
|
|
2859
|
+
function RlsFieldDateRange({ children, date: _date, disabled, formControl, identifier, maxDate, minDate, msgErrorDisabled, onValue, placeholder, rlsTheme, value: _value }) {
|
|
2860
|
+
const currentDate = require$$0.useMemo(() => _date ?? new Date(), [_date]);
|
|
2861
|
+
const [value, setValue] = require$$0.useState(formControl?.value || _value);
|
|
2487
2862
|
const [modalIsVisible, setModalIsVisible] = require$$0.useState(false);
|
|
2488
|
-
|
|
2863
|
+
const _disabled = require$$0.useMemo(() => {
|
|
2864
|
+
return formControl?.disabled || disabled;
|
|
2865
|
+
}, [formControl?.disabled, disabled]);
|
|
2866
|
+
const className = require$$0.useMemo(() => {
|
|
2867
|
+
return renderClassStatus('rls-field-box', { disabled: _disabled });
|
|
2868
|
+
}, [_disabled]);
|
|
2869
|
+
const { icon, valueInput } = require$$0.useMemo(() => {
|
|
2870
|
+
return {
|
|
2871
|
+
icon: value ? 'trash-2' : 'calendar',
|
|
2872
|
+
valueInput: value ? rangeFormatTemplate(value) : ''
|
|
2873
|
+
};
|
|
2874
|
+
}, [value]);
|
|
2875
|
+
const onClickInput = require$$0.useCallback(() => {
|
|
2489
2876
|
setModalIsVisible(true);
|
|
2490
|
-
}
|
|
2491
|
-
|
|
2877
|
+
}, []);
|
|
2878
|
+
const onChange = require$$0.useCallback((value) => {
|
|
2879
|
+
setValue(value);
|
|
2880
|
+
onValue && onValue(value);
|
|
2881
|
+
}, [onValue]);
|
|
2882
|
+
const onClickAction = require$$0.useCallback(() => {
|
|
2492
2883
|
if (value) {
|
|
2493
|
-
formControl?.setValue(
|
|
2884
|
+
formControl?.setValue(_value);
|
|
2494
2885
|
formControl?.touch();
|
|
2495
|
-
onChange(
|
|
2886
|
+
onChange(_value);
|
|
2496
2887
|
}
|
|
2497
2888
|
else {
|
|
2498
2889
|
setModalIsVisible(true);
|
|
2499
2890
|
}
|
|
2500
|
-
}
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-date-range", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className:
|
|
2507
|
-
disabled: _disabled
|
|
2508
|
-
}), children: [children && jsxRuntimeExports.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-date-range__control", type: "text", value: value ? rangeFormatTemplate(value) : '', readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: _disabled }), jsxRuntimeExports.jsx("button", { className: "rls-field-date-range__action", onClick: onClickAction, disabled: _disabled, children: jsxRuntimeExports.jsx(RlsIcon, { value: value ? 'trash-2' : 'calendar' }) })] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }), jsxRuntimeExports.jsx(RlsModal, { visible: modalIsVisible, rlsTheme: rlsTheme, children: jsxRuntimeExports.jsx(RlsPickerDateRange, { formControl: formControl, date: currentDate, disabled: _disabled, maxDate: maxDate, minDate: minDate, onListener: ({ event, value }) => {
|
|
2509
|
-
event !== components.PickerListenerEvent.Cancel && onChange(value);
|
|
2510
|
-
formControl?.touch();
|
|
2511
|
-
setModalIsVisible(false);
|
|
2512
|
-
} }) })] }));
|
|
2891
|
+
}, [value, formControl, _value, onChange]);
|
|
2892
|
+
const onListener = require$$0.useCallback(({ event, value }) => {
|
|
2893
|
+
event !== components.PickerListenerEvent.Cancel && onChange(value);
|
|
2894
|
+
formControl?.touch();
|
|
2895
|
+
setModalIsVisible(false);
|
|
2896
|
+
}, [formControl, onChange]);
|
|
2897
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-date-range", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children && jsxRuntimeExports.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-date-range__control", type: "text", value: valueInput, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: _disabled }), jsxRuntimeExports.jsx("button", { className: "rls-field-date-range__action", onClick: onClickAction, disabled: _disabled, children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) })] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }), jsxRuntimeExports.jsx(RlsModal, { visible: modalIsVisible, rlsTheme: rlsTheme, children: jsxRuntimeExports.jsx(RlsPickerDateRange, { formControl: formControl, date: currentDate, disabled: _disabled, maxDate: maxDate, minDate: minDate, onListener: onListener }) })] }));
|
|
2513
2898
|
}
|
|
2514
2899
|
|
|
2515
2900
|
function useFieldSelect(props) {
|
|
2516
2901
|
const controller = useListController(props);
|
|
2517
|
-
|
|
2902
|
+
const onFocusInput = require$$0.useCallback(() => {
|
|
2518
2903
|
controller.setState({ focused: true });
|
|
2519
|
-
}
|
|
2520
|
-
|
|
2904
|
+
}, [controller.setState]);
|
|
2905
|
+
const onBlurInput = require$$0.useCallback(() => {
|
|
2521
2906
|
controller.setState({ focused: false });
|
|
2522
|
-
}
|
|
2523
|
-
|
|
2907
|
+
}, [controller.setState]);
|
|
2908
|
+
const onClickInput = require$$0.useCallback(() => {
|
|
2524
2909
|
controller.setState({ modalIsVisible: true });
|
|
2525
|
-
}
|
|
2526
|
-
|
|
2910
|
+
}, [controller.setState]);
|
|
2911
|
+
const onKeydownInput = require$$0.useCallback((event) => {
|
|
2527
2912
|
switch (event.code) {
|
|
2528
2913
|
case 'Space':
|
|
2529
2914
|
case 'Enter':
|
|
@@ -2537,8 +2922,8 @@ function useFieldSelect(props) {
|
|
|
2537
2922
|
controller.navigationInput(event);
|
|
2538
2923
|
break;
|
|
2539
2924
|
}
|
|
2540
|
-
}
|
|
2541
|
-
|
|
2925
|
+
}, [controller.setState, controller.navigationInput]);
|
|
2926
|
+
const onClickAction = require$$0.useCallback(() => {
|
|
2542
2927
|
const removable = !props.unremovable && !!controller.value;
|
|
2543
2928
|
if (removable) {
|
|
2544
2929
|
controller.setState({ modalIsVisible: false });
|
|
@@ -2550,35 +2935,46 @@ function useFieldSelect(props) {
|
|
|
2550
2935
|
controller.setState({ modalIsVisible });
|
|
2551
2936
|
modalIsVisible && controller.inputRef?.current?.focus();
|
|
2552
2937
|
}
|
|
2553
|
-
}
|
|
2554
|
-
|
|
2938
|
+
}, [
|
|
2939
|
+
controller.modalIsVisible,
|
|
2940
|
+
controller.value,
|
|
2941
|
+
controller.setState,
|
|
2942
|
+
controller.setFormValue,
|
|
2943
|
+
props.unremovable,
|
|
2944
|
+
props.onValue
|
|
2945
|
+
]);
|
|
2946
|
+
const onClickBackdrop = require$$0.useCallback(() => {
|
|
2555
2947
|
controller.setState({ modalIsVisible: false });
|
|
2556
|
-
}
|
|
2557
|
-
|
|
2948
|
+
}, [controller.setState]);
|
|
2949
|
+
const onChange = require$$0.useCallback((element) => {
|
|
2950
|
+
controller.inputRef?.current?.focus();
|
|
2951
|
+
if (props.onSelect) {
|
|
2952
|
+
controller.setState({ modalIsVisible: false });
|
|
2953
|
+
element.value && props.onSelect(element.value);
|
|
2954
|
+
}
|
|
2955
|
+
else {
|
|
2956
|
+
controller.setFormValue(element);
|
|
2957
|
+
controller.setState({ modalIsVisible: false });
|
|
2958
|
+
}
|
|
2959
|
+
props.onValue && props.onValue(element.value);
|
|
2960
|
+
}, [
|
|
2961
|
+
controller.setState,
|
|
2962
|
+
controller.setFormValue,
|
|
2963
|
+
props.onSelect,
|
|
2964
|
+
props.onValue
|
|
2965
|
+
]);
|
|
2966
|
+
const onClickElement = require$$0.useCallback((element) => {
|
|
2558
2967
|
return () => {
|
|
2559
2968
|
onChange(element);
|
|
2560
2969
|
};
|
|
2561
|
-
}
|
|
2562
|
-
|
|
2970
|
+
}, []);
|
|
2971
|
+
const onKeydownElement = require$$0.useCallback((element) => {
|
|
2563
2972
|
return (event) => {
|
|
2564
2973
|
event.code === 'Enter'
|
|
2565
2974
|
? onChange(element)
|
|
2566
2975
|
: controller.navigationElement(event);
|
|
2567
2976
|
};
|
|
2568
|
-
}
|
|
2569
|
-
function onChange(element) {
|
|
2570
|
-
const { onSelect, onValue } = props;
|
|
2571
|
-
controller.inputRef?.current?.focus();
|
|
2572
|
-
if (onSelect) {
|
|
2573
|
-
controller.setState({ modalIsVisible: false });
|
|
2574
|
-
element.value && onSelect(element.value);
|
|
2575
|
-
}
|
|
2576
|
-
else {
|
|
2577
|
-
controller.setFormValue(element);
|
|
2578
|
-
controller.setState({ modalIsVisible: false });
|
|
2579
|
-
}
|
|
2580
|
-
onValue && onValue(element.value);
|
|
2581
|
-
}
|
|
2977
|
+
}, [controller.navigationElement]);
|
|
2582
2978
|
return {
|
|
2583
2979
|
...controller,
|
|
2584
2980
|
onBlurInput,
|
|
@@ -2595,23 +2991,45 @@ function useFieldSelect(props) {
|
|
|
2595
2991
|
function RlsFieldSelectTemplate(props) {
|
|
2596
2992
|
const select = useFieldSelect(props);
|
|
2597
2993
|
const { render, suggestions, children, formControl, msgErrorDisabled, placeholder, rlsTheme, unremovable } = props;
|
|
2598
|
-
const
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2994
|
+
const [labels, setLabels] = require$$0.useState({
|
|
2995
|
+
listEmptyDescription: reactI18n('listEmptyDescription'),
|
|
2996
|
+
listEmptyTitle: reactI18n('listEmptyTitle')
|
|
2997
|
+
});
|
|
2998
|
+
require$$0.useEffect(() => {
|
|
2999
|
+
return i18n.i18nSubscribe(() => {
|
|
3000
|
+
setLabels({
|
|
3001
|
+
listEmptyDescription: reactI18n('listEmptyDescription'),
|
|
3002
|
+
listEmptyTitle: reactI18n('listEmptyTitle')
|
|
3003
|
+
});
|
|
3004
|
+
});
|
|
3005
|
+
}, []);
|
|
3006
|
+
const _disabled = require$$0.useMemo(() => {
|
|
3007
|
+
return formControl?.disabled || props.disabled;
|
|
3008
|
+
}, [formControl?.disabled, props.disabled]);
|
|
3009
|
+
const className = require$$0.useMemo(() => {
|
|
3010
|
+
return renderClassStatus('rls-field-box', {
|
|
3011
|
+
disabled: _disabled,
|
|
3012
|
+
error: formControl?.wrong,
|
|
3013
|
+
focused: select.focused && !_disabled
|
|
3014
|
+
}, 'rls-field-list rls-field-select');
|
|
3015
|
+
}, [formControl?.wrong, select.focused, _disabled]);
|
|
3016
|
+
const classNameList = require$$0.useMemo(() => {
|
|
3017
|
+
return renderClassStatus('rls-field-list__suggestions', {
|
|
3018
|
+
higher: select.higher,
|
|
3019
|
+
visible: select.modalIsVisible
|
|
3020
|
+
});
|
|
3021
|
+
}, [select.modalIsVisible, select.higher]);
|
|
3022
|
+
return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref: select.contentRef, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("label", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { ref: select.inputRef, className: "rls-field-list__control", readOnly: true, disabled: _disabled, placeholder: placeholder, value: select.value, onFocus: select.onFocusInput, onBlur: select.onBlurInput, onClick: select.onClickInput, onKeyDown: select.onKeydownInput }), jsxRuntimeExports.jsx("button", { className: 'rls-field-list__action', disabled: _disabled, onClick: select.onClickAction, children: jsxRuntimeExports.jsx(RlsIcon, { value: !unremovable && !!select.value ? 'close' : 'arrow-ios-down' }) })] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })), jsxRuntimeExports.jsx("div", { className: classNameList, children: select.modalIsVisible && (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx("div", { className: "rls-field-list__suggestions__body", children: jsxRuntimeExports.jsxs("ul", { ref: select.listRef, className: "rls-field-list__ul", children: [suggestions.map((element, index) => (jsxRuntimeExports.jsx("li", { className: "rls-field-list__element", tabIndex: -1, onClick: select.onClickElement(element), onKeyDown: select.onKeydownElement(element), children: render(element) }, index))), !suggestions.length && (jsxRuntimeExports.jsx("li", { className: "rls-field-list__empty", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-list__empty__description", children: [jsxRuntimeExports.jsx("label", { className: "rls-label-bold truncate", children: labels.listEmptyTitle }), jsxRuntimeExports.jsx("p", { className: "rls-caption-regular", children: labels.listEmptyDescription })] }) }))] }) }), jsxRuntimeExports.jsx("div", { className: "rls-field-list__backdrop", onClick: select.onClickBackdrop })] })) })] }));
|
|
2608
3023
|
}
|
|
2609
3024
|
function RlsFieldSelect(props) {
|
|
2610
3025
|
return (jsxRuntimeExports.jsx(RlsFieldSelectTemplate, { ...props, render: (element) => (jsxRuntimeExports.jsx(RlsBallot, { subtitle: element.subtitle, img: element.img, initials: element.initials, children: jsxRuntimeExports.jsx("span", { children: element.title }) })) }));
|
|
2611
3026
|
}
|
|
2612
3027
|
|
|
2613
3028
|
function RlsFormNavigation({ children, visible, rlsTheme }) {
|
|
2614
|
-
|
|
3029
|
+
const className = require$$0.useMemo(() => {
|
|
3030
|
+
return renderClassStatus('rls-form-navigation', { visible });
|
|
3031
|
+
}, [visible]);
|
|
3032
|
+
return (jsxRuntimeExports.jsx("div", { className: className, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-form-navigation__body", children: children }) }));
|
|
2615
3033
|
}
|
|
2616
3034
|
|
|
2617
3035
|
const DURATION_ANIMATION = 240;
|
|
@@ -2630,32 +3048,42 @@ function calculateDuration({ length }) {
|
|
|
2630
3048
|
return duration + DURATION_RESET;
|
|
2631
3049
|
}
|
|
2632
3050
|
function RlsSnackbar({ content, icon, title, visible, rlsTheme }) {
|
|
2633
|
-
|
|
3051
|
+
const className = require$$0.useMemo(() => {
|
|
3052
|
+
return renderClassStatus('rls-snackbar', { visible });
|
|
3053
|
+
}, [visible]);
|
|
3054
|
+
return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [icon && (jsxRuntimeExports.jsx("div", { className: "rls-snackbar__avatar", children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) })), jsxRuntimeExports.jsxs("div", { className: "rls-snackbar__component", children: [title && jsxRuntimeExports.jsx("div", { className: "rls-snackbar__title", children: title }), jsxRuntimeExports.jsx("div", { className: "rls-snackbar__content", children: content })] })] }));
|
|
2634
3055
|
}
|
|
2635
3056
|
function useSnackbar() {
|
|
2636
|
-
const [
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
3057
|
+
const [state, setState] = require$$0.useState({
|
|
3058
|
+
config: {},
|
|
3059
|
+
duration: 4000,
|
|
3060
|
+
timeoutId: undefined,
|
|
3061
|
+
visible: false
|
|
3062
|
+
});
|
|
3063
|
+
const rlsSnackbar = jsxRuntimeExports.jsx(RlsSnackbar, { ...state.config, visible: state.visible });
|
|
2641
3064
|
require$$0.useEffect(() => {
|
|
2642
|
-
if (visible) {
|
|
3065
|
+
if (state.visible) {
|
|
2643
3066
|
const timeoutId = setTimeout(() => {
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
3067
|
+
setState((state) => ({
|
|
3068
|
+
...state,
|
|
3069
|
+
visible: false,
|
|
3070
|
+
timeoutId: undefined
|
|
3071
|
+
}));
|
|
3072
|
+
}, state.duration);
|
|
3073
|
+
setState((state) => ({ ...state, timeoutId }));
|
|
2648
3074
|
}
|
|
2649
|
-
else if (timeoutId) {
|
|
2650
|
-
clearTimeout(timeoutId);
|
|
2651
|
-
setTimeout(() => snackbar(config), DURATION_ANIMATION);
|
|
3075
|
+
else if (state.timeoutId) {
|
|
3076
|
+
clearTimeout(state.timeoutId);
|
|
3077
|
+
setTimeout(() => snackbar(state.config), DURATION_ANIMATION);
|
|
2652
3078
|
}
|
|
2653
|
-
}, [visible]);
|
|
3079
|
+
}, [state.visible]);
|
|
2654
3080
|
const snackbar = require$$0.useCallback((config) => {
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
3081
|
+
setState((state) => ({
|
|
3082
|
+
...state,
|
|
3083
|
+
config,
|
|
3084
|
+
duration: calculateDuration(String(config.content)),
|
|
3085
|
+
visible: !state.visible
|
|
3086
|
+
}));
|
|
2659
3087
|
}, []);
|
|
2660
3088
|
return {
|
|
2661
3089
|
RlsSnackbar: rlsSnackbar,
|
|
@@ -2673,10 +3101,11 @@ const RlsContext = require$$0.createContext({
|
|
|
2673
3101
|
function RlsApplication({ children }) {
|
|
2674
3102
|
const { RlsConfirmation, confirmation } = useConfirmation();
|
|
2675
3103
|
const { RlsSnackbar, snackbar } = useSnackbar();
|
|
2676
|
-
const [
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
3104
|
+
const [_withNavbar, withNavbar] = require$$0.useState(false);
|
|
3105
|
+
const className = require$$0.useMemo(() => {
|
|
3106
|
+
return renderClassStatus('rls-app__body', { snackbar: _withNavbar });
|
|
3107
|
+
}, [_withNavbar]);
|
|
3108
|
+
return (jsxRuntimeExports.jsxs(RlsContext.Provider, { value: { confirmation, snackbar, withNavbar }, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children, RlsSnackbar] }), RlsConfirmation] }));
|
|
2680
3109
|
}
|
|
2681
3110
|
|
|
2682
3111
|
exports.ConfirmationResult = ConfirmationResult;
|
|
@@ -2735,7 +3164,7 @@ exports.RlsPickerDateRange = RlsPickerDateRange;
|
|
|
2735
3164
|
exports.RlsPickerDay = RlsPickerDay;
|
|
2736
3165
|
exports.RlsPickerDayRange = RlsPickerDayRange;
|
|
2737
3166
|
exports.RlsPickerMonth = RlsPickerMonth;
|
|
2738
|
-
exports.
|
|
3167
|
+
exports.RlsPickerSelectorTitle = RlsPickerSelectorTitle;
|
|
2739
3168
|
exports.RlsPickerYear = RlsPickerYear;
|
|
2740
3169
|
exports.RlsPoster = RlsPoster;
|
|
2741
3170
|
exports.RlsProgressBar = RlsProgressBar;
|
|
@@ -2750,9 +3179,9 @@ exports.RlsTabularText = RlsTabularText;
|
|
|
2750
3179
|
exports.RlsToolbar = RlsToolbar;
|
|
2751
3180
|
exports.rangeFormatTemplate = rangeFormatTemplate;
|
|
2752
3181
|
exports.renderClassStatus = renderClassStatus;
|
|
3182
|
+
exports.setErrorsI18n = setErrorsI18n;
|
|
2753
3183
|
exports.useConfirmation = useConfirmation;
|
|
2754
3184
|
exports.useDatatable = useDatatable;
|
|
2755
3185
|
exports.useListController = useListController;
|
|
2756
|
-
exports.useRenderClassStatus = useRenderClassStatus;
|
|
2757
3186
|
exports.useSnackbar = useSnackbar;
|
|
2758
3187
|
//# sourceMappingURL=index.js.map
|