@rolster/react-components 18.20.7 → 18.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/assets/{index-Cp7p-Y-D.css → index-eohCf4O9.css} +10 -10
- package/dist/cjs/index.js +532 -286
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/assets/{index-Cp7p-Y-D.css → index-eohCf4O9.css} +10 -10
- package/dist/es/index.js +533 -288
- 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/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 +3 -3
- package/dist/esm/components/molecules/PickerDay/PickerDay.js.map +1 -1
- package/dist/esm/components/molecules/PickerMonth/PickerMonth.d.ts +1 -1
- package/dist/esm/components/molecules/PickerMonth/PickerMonth.js +3 -3
- package/dist/esm/components/molecules/PickerMonth/PickerMonth.js.map +1 -1
- package/dist/esm/components/molecules/PickerYear/PickerYear.d.ts +1 -1
- package/dist/esm/components/molecules/PickerYear/PickerYear.js +4 -4
- package/dist/esm/components/molecules/PickerYear/PickerYear.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 +25 -13
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js.map +1 -1
- package/dist/esm/components/organisms/FieldDate/FieldDate.d.ts +5 -4
- package/dist/esm/components/organisms/FieldDate/FieldDate.js +12 -9
- 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 +8 -8
- package/dist/esm/components/organisms/FieldDateRange/FieldDateRange.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.js +15 -9
- package/dist/esm/components/organisms/PickerDate/PickerDate.js.map +1 -1
- package/dist/esm/components/organisms/PickerDateRange/PickerDateRange.js +20 -12
- 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 +7 -4
- 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/helpers/css.js +1 -1
- 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 +4 -4
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,138 +1363,6 @@ 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
1367
|
const resultClass = [base];
|
|
1500
1368
|
Object.entries(status).forEach(([key, state]) => {
|
|
@@ -1507,7 +1375,7 @@ function renderClassStatus(base, status = {}, additionals) {
|
|
|
1507
1375
|
if (additionals) {
|
|
1508
1376
|
resultClass.push(additionals);
|
|
1509
1377
|
}
|
|
1510
|
-
return resultClass.join(' ');
|
|
1378
|
+
return resultClass.join(' ').trim();
|
|
1511
1379
|
}
|
|
1512
1380
|
|
|
1513
1381
|
const DATE_RANGE_FORMAT = '{dd}/{mx}/{aa}';
|
|
@@ -1518,34 +1386,142 @@ function rangeFormatTemplate({ maxDate, minDate }) {
|
|
|
1518
1386
|
return `${minFormat} - ${maxFormat}`;
|
|
1519
1387
|
}
|
|
1520
1388
|
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1389
|
+
const errorsDictionary = {
|
|
1390
|
+
es: {
|
|
1391
|
+
alphabetic: 'Campo solo permite caracteres',
|
|
1392
|
+
alphanumber: 'Campo solo permite caracteres y número',
|
|
1393
|
+
decimal: 'Campo debe ser número decimal',
|
|
1394
|
+
defined: 'Campo debe estar definido',
|
|
1395
|
+
email: 'Campo debe ser correo electrónico',
|
|
1396
|
+
greaterThanValue: 'Campo debe tener un valor mayor a {thanValue}',
|
|
1397
|
+
greaterOrEqualsThanValue: 'Campo debe tener un valor mayor o igual a {thanValue}',
|
|
1398
|
+
lessThanValue: 'Campo debe tener un valor menor a {thanValue}',
|
|
1399
|
+
lessOrEqualsThanValue: 'Campo debe tener un valor menor o igual a {thanValue}',
|
|
1400
|
+
maxValue: 'Campo debe tener un valor máximo de {thanValue}',
|
|
1401
|
+
minValue: 'Campo debe tener un valor mínimo de {thanValue}',
|
|
1402
|
+
nickname: 'Campo inválido para nombre de usuario',
|
|
1403
|
+
onlynumber: 'Campo debe ser númerico',
|
|
1404
|
+
password: 'Campo no permitido para password',
|
|
1405
|
+
reqlength: 'Campo debe tener {length} caracter(es)',
|
|
1406
|
+
required: 'Campo es requerido',
|
|
1407
|
+
strMinlength: 'Campo debe tener mínimo {length} caracter(es)',
|
|
1408
|
+
strMaxlength: 'Campo debe tener máximo {length} caracter(es)',
|
|
1409
|
+
textonly: 'Campo solo permite caracteres (sin espacio)',
|
|
1410
|
+
_unknown: 'Campo inválido {error}'
|
|
1411
|
+
},
|
|
1412
|
+
en: {
|
|
1413
|
+
alphabetic: 'Field only allows characters',
|
|
1414
|
+
alphanumber: 'Field only allows characters and number',
|
|
1415
|
+
decimal: 'Field must be decimal number',
|
|
1416
|
+
defined: 'Field must be defined',
|
|
1417
|
+
email: 'Field must be email',
|
|
1418
|
+
greaterThanValue: 'Field must have a value greater than {thanValue}',
|
|
1419
|
+
greaterOrEqualsThanValue: 'Field must have a value greater than or equal to {thanValue}',
|
|
1420
|
+
lessThanValue: 'Field must have a value less than {thanValue}',
|
|
1421
|
+
lessOrEqualsThanValue: 'Field must have a value less than or equal to {thanValue}',
|
|
1422
|
+
minValue: 'Field must have a minimum value of {thanValue}',
|
|
1423
|
+
maxValue: 'Field must have a maximum value of {thanValue}',
|
|
1424
|
+
nickname: 'Invalid field for username',
|
|
1425
|
+
onlynumber: 'Field must be numeric',
|
|
1426
|
+
password: 'Field not allowed for password',
|
|
1427
|
+
reqlength: 'Field must be {length} characters',
|
|
1428
|
+
required: 'Field is required',
|
|
1429
|
+
strMinlength: 'Field must have minimum {length} characters',
|
|
1430
|
+
strMaxlength: 'Field must have maximum {length} characters',
|
|
1431
|
+
textonly: 'Field only allows characters (no space)',
|
|
1432
|
+
_unknown: 'Invalid field {error}'
|
|
1433
|
+
},
|
|
1434
|
+
fr: {
|
|
1435
|
+
alphabetic: 'Field only allows characters',
|
|
1436
|
+
alphanumber: 'Field only allows characters and number',
|
|
1437
|
+
decimal: 'Field must be decimal number',
|
|
1438
|
+
defined: 'Field must be defined',
|
|
1439
|
+
email: 'Field must be email',
|
|
1440
|
+
greaterThanValue: 'Field must have a value greater than {thanValue}',
|
|
1441
|
+
greaterOrEqualsThanValue: 'Field must have a value greater than or equal to {thanValue}',
|
|
1442
|
+
lessThanValue: 'Field must have a value less than {thanValue}',
|
|
1443
|
+
lessOrEqualsThanValue: 'Field must have a value less than or equal to {thanValue}',
|
|
1444
|
+
minValue: 'Field must have a minimum value of {thanValue}',
|
|
1445
|
+
maxValue: 'Field must have a maximum value of {thanValue}',
|
|
1446
|
+
nickname: 'Invalid field for username',
|
|
1447
|
+
onlynumber: 'Field must be numeric',
|
|
1448
|
+
password: 'Field not allowed for password',
|
|
1449
|
+
reqlength: 'Field must be {length} characters',
|
|
1450
|
+
required: 'Field is required',
|
|
1451
|
+
strMinlength: 'Field must have minimum {length} characters',
|
|
1452
|
+
strMaxlength: 'Field must have maximum {length} characters',
|
|
1453
|
+
textonly: 'Field only allows characters (no space)',
|
|
1454
|
+
_unknown: 'Invalid field {error}'
|
|
1455
|
+
},
|
|
1456
|
+
pt: {
|
|
1457
|
+
alphabetic: 'Field only allows characters',
|
|
1458
|
+
alphanumber: 'Field only allows characters and number',
|
|
1459
|
+
decimal: 'Field must be decimal number',
|
|
1460
|
+
defined: 'Field must be defined',
|
|
1461
|
+
email: 'Field must be email',
|
|
1462
|
+
greaterThanValue: 'Field must have a value greater than {thanValue}',
|
|
1463
|
+
greaterOrEqualsThanValue: 'Field must have a value greater than or equal to {thanValue}',
|
|
1464
|
+
lessThanValue: 'Field must have a value less than {thanValue}',
|
|
1465
|
+
lessOrEqualsThanValue: 'Field must have a value less than or equal to {thanValue}',
|
|
1466
|
+
minValue: 'Field must have a minimum value of {thanValue}',
|
|
1467
|
+
maxValue: 'Field must have a maximum value of {thanValue}',
|
|
1468
|
+
nickname: 'Invalid field for username',
|
|
1469
|
+
onlynumber: 'Field must be numeric',
|
|
1470
|
+
password: 'Field not allowed for password',
|
|
1471
|
+
reqlength: 'Field must be {thanValue} characters',
|
|
1472
|
+
required: 'Field is required',
|
|
1473
|
+
strMinlength: 'Field must have minimum {thanValue} characters',
|
|
1474
|
+
strMaxlength: 'Field must have maximum {thanValue} characters',
|
|
1475
|
+
textonly: 'Field only allows characters (no space)',
|
|
1476
|
+
_unknown: 'Invalid field {error}'
|
|
1477
|
+
}
|
|
1478
|
+
};
|
|
1479
|
+
let _msgErrorsI18n = i18n.i18n(errorsDictionary);
|
|
1480
|
+
function setErrorsI18n(dictionary) {
|
|
1481
|
+
_msgErrorsI18n = i18n.i18n(Object.entries(errorsDictionary).reduce((_dictionary, [key, value]) => {
|
|
1482
|
+
_dictionary[key] = { ...value, ...dictionary[key] };
|
|
1483
|
+
return _dictionary;
|
|
1484
|
+
}, {}));
|
|
1485
|
+
}
|
|
1486
|
+
function msgErrorsI18n(key, language, interpolators) {
|
|
1487
|
+
return _msgErrorsI18n(key, { language, interpolators });
|
|
1527
1488
|
}
|
|
1528
1489
|
|
|
1529
1490
|
function RlsAvatar({ children, rounded, skeleton, rlsTheme }) {
|
|
1530
|
-
|
|
1491
|
+
const className = require$$0.useMemo(() => {
|
|
1492
|
+
return renderClassStatus('rls-avatar', { rounded, skeleton });
|
|
1493
|
+
}, [rounded, skeleton]);
|
|
1494
|
+
return (jsxRuntimeExports.jsx("div", { className: className, "rls-theme": rlsTheme, children: children }));
|
|
1531
1495
|
}
|
|
1532
1496
|
|
|
1533
1497
|
function RlsBadge({ children, rlsTheme }) {
|
|
1534
1498
|
return (jsxRuntimeExports.jsx("div", { className: "rls-badge", "rls-theme": rlsTheme, children: children }));
|
|
1535
1499
|
}
|
|
1536
1500
|
|
|
1501
|
+
function RlsBreadcrumbLabel({ label }) {
|
|
1502
|
+
const className = require$$0.useMemo(() => {
|
|
1503
|
+
return renderClassStatus('rls-breadcrumb__label__a', {
|
|
1504
|
+
actionable: !!label.onClick
|
|
1505
|
+
});
|
|
1506
|
+
}, [label.onClick]);
|
|
1507
|
+
return (jsxRuntimeExports.jsx("label", { className: "rls-breadcrumb__label", onClick: label.onClick, children: jsxRuntimeExports.jsx("a", { className: className, children: label.label }) }));
|
|
1508
|
+
}
|
|
1537
1509
|
function RlsBreadcrumb({ labels }) {
|
|
1538
|
-
return (jsxRuntimeExports.jsx("div", { className: "rls-breadcrumb", children: labels.map((
|
|
1539
|
-
actionable: !!onClick
|
|
1540
|
-
}), children: label }) }, index))) }));
|
|
1510
|
+
return (jsxRuntimeExports.jsx("div", { className: "rls-breadcrumb", children: labels.map((label, index) => (jsxRuntimeExports.jsx(RlsBreadcrumbLabel, { label: label }, index))) }));
|
|
1541
1511
|
}
|
|
1542
1512
|
|
|
1543
1513
|
function RlsIcon({ value, skeleton }) {
|
|
1544
|
-
|
|
1514
|
+
const className = require$$0.useMemo(() => {
|
|
1515
|
+
return renderClassStatus('rls-icon', { skeleton });
|
|
1516
|
+
}, [skeleton]);
|
|
1517
|
+
return (jsxRuntimeExports.jsx("div", { className: className, children: jsxRuntimeExports.jsx("i", { className: `rls-icon-${value}` }) }));
|
|
1545
1518
|
}
|
|
1546
1519
|
|
|
1547
1520
|
function RlsButton({ type, children, disabled, identifier, prefixIcon, suffixIcon, rlsTheme, onClick }) {
|
|
1548
|
-
|
|
1521
|
+
const className = require$$0.useMemo(() => {
|
|
1522
|
+
return renderClassStatus('rls-button__content', { type });
|
|
1523
|
+
}, [type]);
|
|
1524
|
+
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
1525
|
}
|
|
1550
1526
|
|
|
1551
1527
|
function RlsButtonAction({ icon, disabled, identifier, onClick, tooltip }) {
|
|
@@ -1553,12 +1529,16 @@ function RlsButtonAction({ icon, disabled, identifier, onClick, tooltip }) {
|
|
|
1553
1529
|
}
|
|
1554
1530
|
|
|
1555
1531
|
function RlsCheckBox({ checked, disabled, identifier, onClick, rlsTheme }) {
|
|
1556
|
-
|
|
1532
|
+
const className = require$$0.useMemo(() => {
|
|
1533
|
+
return renderClassStatus('rls-checkbox', { checked, disabled });
|
|
1534
|
+
}, [checked, disabled]);
|
|
1535
|
+
return (jsxRuntimeExports.jsx("div", { id: identifier, className: className, onClick: onClick, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-checkbox__component" }) }));
|
|
1557
1536
|
}
|
|
1558
1537
|
function RlsCheckBoxControl({ formControl, disabled, identifier, rlsTheme }) {
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1538
|
+
const onClick = require$$0.useCallback(() => {
|
|
1539
|
+
formControl.setValue(!formControl.value);
|
|
1540
|
+
}, [formControl.value]);
|
|
1541
|
+
return (jsxRuntimeExports.jsx(RlsCheckBox, { identifier: identifier, checked: !!formControl.value, disabled: disabled, onClick: onClick, rlsTheme: rlsTheme }));
|
|
1562
1542
|
}
|
|
1563
1543
|
|
|
1564
1544
|
function RlsInput({ children, disabled, formControl, identifier, onValue, placeholder, type, value }) {
|
|
@@ -1576,10 +1556,13 @@ function RlsInput({ children, disabled, formControl, identifier, onValue, placeh
|
|
|
1576
1556
|
formControl?.blur();
|
|
1577
1557
|
setFocused(() => false);
|
|
1578
1558
|
}, [formControl]);
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
disabled: formControl?.disabled || disabled
|
|
1582
|
-
|
|
1559
|
+
const className = require$$0.useMemo(() => {
|
|
1560
|
+
return renderClassStatus('rls-input', {
|
|
1561
|
+
disabled: formControl?.disabled || disabled,
|
|
1562
|
+
focused: formControl?.focused ?? focused
|
|
1563
|
+
});
|
|
1564
|
+
}, [formControl?.focused, formControl?.disabled, focused, disabled]);
|
|
1565
|
+
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
1566
|
}
|
|
1584
1567
|
|
|
1585
1568
|
function RlsInputMoney({ decimals, disabled, formControl, identifier, onValue, placeholder, symbol, value }) {
|
|
@@ -1614,10 +1597,13 @@ function RlsInputPassword({ disabled, formControl, identifier, onValue, placehol
|
|
|
1614
1597
|
formControl?.blur();
|
|
1615
1598
|
setFocused(() => false);
|
|
1616
1599
|
}, [formControl]);
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
disabled: formControl?.disabled || disabled
|
|
1620
|
-
|
|
1600
|
+
const className = require$$0.useMemo(() => {
|
|
1601
|
+
return renderClassStatus('rls-input-password', {
|
|
1602
|
+
disabled: formControl?.disabled || disabled,
|
|
1603
|
+
focused: formControl?.focused ?? focused
|
|
1604
|
+
});
|
|
1605
|
+
}, [formControl?.focused, formControl?.disabled, focused, disabled]);
|
|
1606
|
+
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
1607
|
}
|
|
1622
1608
|
|
|
1623
1609
|
function RlsInputSearch({ formControl, identifier, onSearch, placeholder }) {
|
|
@@ -1646,11 +1632,17 @@ function RlsMessageIcon({ icon, children, rlsTheme }) {
|
|
|
1646
1632
|
}
|
|
1647
1633
|
|
|
1648
1634
|
function RlsPoster({ children, contrast, outline, rlsTheme }) {
|
|
1649
|
-
|
|
1635
|
+
const className = require$$0.useMemo(() => {
|
|
1636
|
+
return renderClassStatus('rls-poster', { contrast, outline });
|
|
1637
|
+
}, [contrast, outline]);
|
|
1638
|
+
return (jsxRuntimeExports.jsx("div", { className: className, "rls-theme": rlsTheme, children: children }));
|
|
1650
1639
|
}
|
|
1651
1640
|
|
|
1652
1641
|
function RlsProgressBar({ indeterminate, percentage, rlsTheme }) {
|
|
1653
|
-
|
|
1642
|
+
const className = require$$0.useMemo(() => {
|
|
1643
|
+
return renderClassStatus('rls-progress-bar', { indeterminate });
|
|
1644
|
+
}, [indeterminate]);
|
|
1645
|
+
return (jsxRuntimeExports.jsx("div", { className: className, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-progress-bar__component", style: { width: `${percentage || 0}%` } }) }));
|
|
1654
1646
|
}
|
|
1655
1647
|
|
|
1656
1648
|
function RlsProgressCircular({ rlsTheme }) {
|
|
@@ -1658,7 +1650,10 @@ function RlsProgressCircular({ rlsTheme }) {
|
|
|
1658
1650
|
}
|
|
1659
1651
|
|
|
1660
1652
|
function RlsRadioButton({ checked, disabled, identifier, rlsTheme, onClick }) {
|
|
1661
|
-
|
|
1653
|
+
const className = require$$0.useMemo(() => {
|
|
1654
|
+
return renderClassStatus('rls-radiobutton', { checked, disabled });
|
|
1655
|
+
}, [checked, disabled]);
|
|
1656
|
+
return (jsxRuntimeExports.jsx("div", { id: identifier, className: className, onClick: onClick, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-radiobutton__component" }) }));
|
|
1662
1657
|
}
|
|
1663
1658
|
|
|
1664
1659
|
function RlsSkeleton({ rlsTheme }) {
|
|
@@ -1670,30 +1665,42 @@ function RlsSkeletonText({ active, children, rlsTheme }) {
|
|
|
1670
1665
|
}
|
|
1671
1666
|
|
|
1672
1667
|
function RlsSwitch({ checked, disabled, identifier, onClick, rlsTheme }) {
|
|
1673
|
-
|
|
1668
|
+
const className = require$$0.useMemo(() => {
|
|
1669
|
+
return renderClassStatus('rls-switch', { checked, disabled });
|
|
1670
|
+
}, [checked, disabled]);
|
|
1671
|
+
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
1672
|
}
|
|
1675
1673
|
function RlsSwitchControl({ formControl, disabled, identifier, rlsTheme }) {
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1674
|
+
const onClick = require$$0.useCallback(() => {
|
|
1675
|
+
formControl.setValue(!formControl.value);
|
|
1676
|
+
}, [formControl.value]);
|
|
1677
|
+
return (jsxRuntimeExports.jsx(RlsSwitch, { identifier: identifier, checked: formControl.value || false, disabled: disabled, onClick: onClick, rlsTheme: rlsTheme }));
|
|
1679
1678
|
}
|
|
1680
1679
|
|
|
1681
1680
|
function RlsAlert({ bordered, children, icon, identifier, rlsTheme }) {
|
|
1682
|
-
|
|
1681
|
+
const className = require$$0.useMemo(() => {
|
|
1682
|
+
return renderClassStatus('rls-alert', { bordered });
|
|
1683
|
+
}, [bordered]);
|
|
1684
|
+
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
1685
|
}
|
|
1684
1686
|
|
|
1685
1687
|
function RlsBallot({ bordered, children, img, initials, skeleton, subtitle, rlsTheme }) {
|
|
1686
|
-
|
|
1688
|
+
const className = require$$0.useMemo(() => {
|
|
1689
|
+
return renderClassStatus('rls-ballot', { bordered, skeleton });
|
|
1690
|
+
}, [bordered, skeleton]);
|
|
1691
|
+
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
1692
|
}
|
|
1688
1693
|
|
|
1689
1694
|
function RlsButtonProgress({ icon, disabled, onClick, progressing, rlsTheme }) {
|
|
1690
|
-
|
|
1695
|
+
const className = require$$0.useMemo(() => {
|
|
1696
|
+
return renderClassStatus('rls-button-progress', { progressing });
|
|
1697
|
+
}, [progressing]);
|
|
1698
|
+
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
1699
|
}
|
|
1692
1700
|
|
|
1693
1701
|
function RlsButtonToggle({ onAction, options, type, automatic, disabled, rlsTheme }) {
|
|
1694
1702
|
const componentRef = require$$0.useRef(null);
|
|
1695
|
-
const [
|
|
1696
|
-
const [action, setAction] = require$$0.useState(firstAction);
|
|
1703
|
+
const [action, setAction] = require$$0.useState(options[0]);
|
|
1697
1704
|
const [visible, setVisible] = require$$0.useState(false);
|
|
1698
1705
|
require$$0.useEffect(() => {
|
|
1699
1706
|
function onCloseMenu({ target }) {
|
|
@@ -1704,6 +1711,12 @@ function RlsButtonToggle({ onAction, options, type, automatic, disabled, rlsThem
|
|
|
1704
1711
|
document.removeEventListener('click', onCloseMenu);
|
|
1705
1712
|
};
|
|
1706
1713
|
}, []);
|
|
1714
|
+
const classNameList = require$$0.useMemo(() => {
|
|
1715
|
+
return renderClassStatus('rls-button-toggle__list', {
|
|
1716
|
+
hide: !visible,
|
|
1717
|
+
visible
|
|
1718
|
+
});
|
|
1719
|
+
}, [visible]);
|
|
1707
1720
|
const onClickMenu = require$$0.useCallback(() => {
|
|
1708
1721
|
setVisible((visible) => !visible);
|
|
1709
1722
|
}, []);
|
|
@@ -1714,34 +1727,58 @@ function RlsButtonToggle({ onAction, options, type, automatic, disabled, rlsThem
|
|
|
1714
1727
|
}, [onAction, automatic]);
|
|
1715
1728
|
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
1729
|
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: () => {
|
|
1730
|
+
}, 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
1731
|
onSelectAction(action);
|
|
1722
1732
|
}, children: action.label }, index))) }) })] }));
|
|
1723
1733
|
}
|
|
1724
1734
|
|
|
1725
1735
|
function RlsMessageFormError({ className, formControl }) {
|
|
1726
|
-
|
|
1736
|
+
const [language, setLanguage] = require$$0.useState('es');
|
|
1737
|
+
require$$0.useEffect(() => {
|
|
1738
|
+
return i18n.i18nSubscribe((language) => {
|
|
1739
|
+
setLanguage(language);
|
|
1740
|
+
});
|
|
1741
|
+
}, []);
|
|
1742
|
+
const msgError = require$$0.useMemo(() => {
|
|
1743
|
+
return (formControl?.error &&
|
|
1744
|
+
(msgErrorsI18n(formControl.error.id, language, formControl.error.data) ??
|
|
1745
|
+
msgErrorsI18n('_unknown', language, { error: formControl.error.id })));
|
|
1746
|
+
}, [formControl?.error, language]);
|
|
1747
|
+
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
1748
|
}
|
|
1728
1749
|
|
|
1729
1750
|
function RlsFieldMoney({ children, decimals, disabled, formControl, identifier, msgErrorDisabled, onValue, placeholder, symbol, rlsTheme, value }) {
|
|
1730
|
-
const
|
|
1731
|
-
|
|
1751
|
+
const className = require$$0.useMemo(() => {
|
|
1752
|
+
const _disabled = formControl?.disabled || disabled;
|
|
1753
|
+
return renderClassStatus('rls-field-box', {
|
|
1732
1754
|
focused: formControl?.focused && !_disabled,
|
|
1733
1755
|
error: formControl?.wrong,
|
|
1734
1756
|
disabled: _disabled
|
|
1735
|
-
}, 'rls-field-money')
|
|
1757
|
+
}, 'rls-field-money');
|
|
1758
|
+
}, [
|
|
1759
|
+
formControl?.focused,
|
|
1760
|
+
formControl?.wrong,
|
|
1761
|
+
formControl?.disabled,
|
|
1762
|
+
disabled
|
|
1763
|
+
]);
|
|
1764
|
+
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
1765
|
}
|
|
1737
1766
|
|
|
1738
1767
|
function RlsFieldNumber({ children, disabled, formControl, identifier, msgErrorDisabled, onValue, placeholder, rlsTheme, value }) {
|
|
1739
|
-
const
|
|
1740
|
-
|
|
1768
|
+
const className = require$$0.useMemo(() => {
|
|
1769
|
+
const _disabled = formControl?.disabled || disabled;
|
|
1770
|
+
return renderClassStatus('rls-field-box', {
|
|
1741
1771
|
focused: formControl?.focused && !_disabled,
|
|
1742
1772
|
error: formControl?.wrong,
|
|
1743
1773
|
disabled: _disabled
|
|
1744
|
-
}, 'rls-field-number')
|
|
1774
|
+
}, 'rls-field-number');
|
|
1775
|
+
}, [
|
|
1776
|
+
formControl?.focused,
|
|
1777
|
+
formControl?.wrong,
|
|
1778
|
+
formControl?.disabled,
|
|
1779
|
+
disabled
|
|
1780
|
+
]);
|
|
1781
|
+
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
1782
|
}
|
|
1746
1783
|
|
|
1747
1784
|
function RlsFieldPassword({ children, disabled, formControl, identifier, msgErrorDisabled, placeholder, rlsTheme }) {
|
|
@@ -1749,21 +1786,37 @@ function RlsFieldPassword({ children, disabled, formControl, identifier, msgErro
|
|
|
1749
1786
|
const onToggleInput = require$$0.useCallback(() => {
|
|
1750
1787
|
setPassword((password) => !password);
|
|
1751
1788
|
}, []);
|
|
1752
|
-
const
|
|
1753
|
-
|
|
1789
|
+
const className = require$$0.useMemo(() => {
|
|
1790
|
+
const _disabled = formControl?.disabled || disabled;
|
|
1791
|
+
return renderClassStatus('rls-field-box', {
|
|
1754
1792
|
focused: formControl?.focused && !_disabled,
|
|
1755
1793
|
error: formControl?.wrong,
|
|
1756
1794
|
disabled: _disabled
|
|
1757
|
-
}, 'rls-field-password')
|
|
1795
|
+
}, 'rls-field-password');
|
|
1796
|
+
}, [
|
|
1797
|
+
formControl?.focused,
|
|
1798
|
+
formControl?.wrong,
|
|
1799
|
+
formControl?.disabled,
|
|
1800
|
+
disabled
|
|
1801
|
+
]);
|
|
1802
|
+
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
1803
|
}
|
|
1759
1804
|
|
|
1760
1805
|
function RlsFieldText({ children, disabled, formControl, identifier, msgErrorDisabled, onValue, placeholder, rlsTheme, value }) {
|
|
1761
|
-
const
|
|
1762
|
-
|
|
1806
|
+
const className = require$$0.useMemo(() => {
|
|
1807
|
+
const _disabled = formControl?.disabled || disabled;
|
|
1808
|
+
return renderClassStatus('rls-field-box', {
|
|
1763
1809
|
focused: formControl?.focused && !_disabled,
|
|
1764
1810
|
error: formControl?.wrong,
|
|
1765
1811
|
disabled: _disabled
|
|
1766
|
-
}, 'rls-field-text')
|
|
1812
|
+
}, 'rls-field-text');
|
|
1813
|
+
}, [
|
|
1814
|
+
formControl?.focused,
|
|
1815
|
+
formControl?.wrong,
|
|
1816
|
+
formControl?.disabled,
|
|
1817
|
+
disabled
|
|
1818
|
+
]);
|
|
1819
|
+
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
1820
|
}
|
|
1768
1821
|
|
|
1769
1822
|
function RlsLabelCheckBox({ children, disabled, extended, identifier, formControl, rlsTheme }) {
|
|
@@ -1776,10 +1829,10 @@ function RlsLabelCheckBox({ children, disabled, extended, identifier, formContro
|
|
|
1776
1829
|
? formControl?.setValue(!formControl.value)
|
|
1777
1830
|
: setChecked((checked) => !checked);
|
|
1778
1831
|
}, [formControl]);
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1832
|
+
const className = require$$0.useMemo(() => {
|
|
1833
|
+
return renderClassStatus('rls-label-checkbox', { disabled, extended });
|
|
1834
|
+
}, [disabled, extended]);
|
|
1835
|
+
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
1836
|
}
|
|
1784
1837
|
|
|
1785
1838
|
function RlsLabelRadioButton({ children, disabled, extended, identifier, formControl, rlsTheme, value }) {
|
|
@@ -1790,10 +1843,10 @@ function RlsLabelRadioButton({ children, disabled, extended, identifier, formCon
|
|
|
1790
1843
|
const onSelect = require$$0.useCallback(() => {
|
|
1791
1844
|
formControl && formControl?.setValue(value);
|
|
1792
1845
|
}, [formControl, value]);
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1846
|
+
const className = require$$0.useMemo(() => {
|
|
1847
|
+
return renderClassStatus('rls-label-radiobutton', { disabled, extended });
|
|
1848
|
+
}, [disabled, extended]);
|
|
1849
|
+
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
1850
|
}
|
|
1798
1851
|
|
|
1799
1852
|
function RlsLabelSwitch({ children, disabled, extended, identifier, formControl, rlsTheme }) {
|
|
@@ -1806,62 +1859,53 @@ function RlsLabelSwitch({ children, disabled, extended, identifier, formControl,
|
|
|
1806
1859
|
? formControl?.setValue(!formControl.value)
|
|
1807
1860
|
: setChecked((checked) => !checked);
|
|
1808
1861
|
}, [formControl]);
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1862
|
+
const className = require$$0.useMemo(() => {
|
|
1863
|
+
return renderClassStatus('rls-label-switch', { disabled, extended });
|
|
1864
|
+
}, [disabled, extended]);
|
|
1865
|
+
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
1866
|
}
|
|
1814
1867
|
|
|
1815
1868
|
function RlsPagination({ suggestions, count, filter, onPagination }) {
|
|
1816
1869
|
const controller = require$$0.useRef(new components.PaginationController({ suggestions, count }));
|
|
1817
1870
|
const [template, setTemplate] = require$$0.useState(controller.current.template);
|
|
1871
|
+
const refreshTemplate = require$$0.useCallback((template, suggestions) => {
|
|
1872
|
+
const { firstPage, lastPage } = template;
|
|
1873
|
+
onPagination && onPagination({ firstPage, lastPage, suggestions });
|
|
1874
|
+
setTemplate(template);
|
|
1875
|
+
}, [onPagination]);
|
|
1818
1876
|
require$$0.useEffect(() => {
|
|
1819
1877
|
controller.current = new components.PaginationController({
|
|
1820
1878
|
suggestions,
|
|
1821
1879
|
count,
|
|
1822
1880
|
position: template.currentPage.value
|
|
1823
1881
|
});
|
|
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);
|
|
1882
|
+
refreshTemplate(controller.current.template, controller.current.page.collection);
|
|
1831
1883
|
}, [suggestions, count]);
|
|
1832
1884
|
require$$0.useEffect(() => {
|
|
1833
1885
|
refreshPagination(controller.current.filtrable(filter));
|
|
1834
1886
|
}, [filter]);
|
|
1835
|
-
|
|
1887
|
+
const refreshPagination = require$$0.useCallback((pagination) => {
|
|
1836
1888
|
if (pagination) {
|
|
1837
|
-
|
|
1838
|
-
const { firstPage, lastPage } = template;
|
|
1839
|
-
onPagination &&
|
|
1840
|
-
onPagination({
|
|
1841
|
-
firstPage,
|
|
1842
|
-
lastPage,
|
|
1843
|
-
suggestions: page.collection
|
|
1844
|
-
});
|
|
1845
|
-
setTemplate(template);
|
|
1889
|
+
refreshTemplate(pagination.template, pagination.page.collection);
|
|
1846
1890
|
}
|
|
1847
|
-
}
|
|
1848
|
-
|
|
1891
|
+
}, []);
|
|
1892
|
+
const goToPagination = require$$0.useCallback((page) => {
|
|
1849
1893
|
refreshPagination(controller.current.goToPage(page));
|
|
1850
|
-
}
|
|
1851
|
-
|
|
1894
|
+
}, []);
|
|
1895
|
+
const goFirstPagination = require$$0.useCallback(() => {
|
|
1852
1896
|
refreshPagination(controller.current.goFirstPage());
|
|
1853
|
-
}
|
|
1854
|
-
|
|
1897
|
+
}, []);
|
|
1898
|
+
const goPreviousPagination = require$$0.useCallback(() => {
|
|
1855
1899
|
refreshPagination(controller.current.goPreviousPage());
|
|
1856
|
-
}
|
|
1857
|
-
|
|
1900
|
+
}, []);
|
|
1901
|
+
const goNextPagination = require$$0.useCallback(() => {
|
|
1858
1902
|
refreshPagination(controller.current.goNextPage());
|
|
1859
|
-
}
|
|
1860
|
-
|
|
1903
|
+
}, []);
|
|
1904
|
+
const goLastPagination = require$$0.useCallback(() => {
|
|
1861
1905
|
refreshPagination(controller.current.goLastPage());
|
|
1862
|
-
}
|
|
1906
|
+
}, []);
|
|
1863
1907
|
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:
|
|
1908
|
+
return (jsxRuntimeExports.jsx("div", { className: renderClassStatus('rls-pagination__page', {
|
|
1865
1909
|
active: page.active
|
|
1866
1910
|
}), onClick: () => {
|
|
1867
1911
|
goToPagination(page);
|
|
@@ -1869,7 +1913,7 @@ function RlsPagination({ suggestions, count, filter, onPagination }) {
|
|
|
1869
1913
|
}) }), 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
1914
|
}
|
|
1871
1915
|
|
|
1872
|
-
function RlsPickerDay({ date, disabled:
|
|
1916
|
+
function RlsPickerDay({ date, disabled: _disabled, formControl, maxDate, month, minDate, onValue, rlsTheme, year }) {
|
|
1873
1917
|
const currentDate = date || new Date(); // Initial date
|
|
1874
1918
|
const [weeks, setWeeks] = require$$0.useState([]);
|
|
1875
1919
|
const [value, setValue] = require$$0.useState(formControl?.value || currentDate.getDate());
|
|
@@ -1902,12 +1946,12 @@ function RlsPickerDay({ date, disabled: disabledPicker, formControl, maxDate, mo
|
|
|
1902
1946
|
onValue && onValue(value);
|
|
1903
1947
|
}
|
|
1904
1948
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-day", "rls-theme": rlsTheme, children: [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))) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-day__component", children: weeks.map(({ days }, index) => (jsxRuntimeExports.jsx("div", { className: "rls-picker-day__week", children: days.map(({ value, disabled, focused, forbidden, selected, today }, index) => (jsxRuntimeExports.jsx("div", { className: renderClassStatus('rls-picker-day__element', {
|
|
1905
|
-
disabled: disabled ||
|
|
1949
|
+
disabled: disabled || _disabled,
|
|
1906
1950
|
focused,
|
|
1907
1951
|
forbidden,
|
|
1908
1952
|
selected,
|
|
1909
1953
|
today
|
|
1910
|
-
}), onClick: value && !
|
|
1954
|
+
}), onClick: value && !_disabled ? () => onChange(value) : undefined, children: jsxRuntimeExports.jsx("span", { className: "rls-picker-day__element__span", children: value || '??' }) }, index))) }, index))) })] }));
|
|
1911
1955
|
}
|
|
1912
1956
|
|
|
1913
1957
|
const FORMAT_RANGE = '{dd}/{mx}/{aa}';
|
|
@@ -1948,7 +1992,7 @@ function RlsPickerDayRange({ date, disabled: _disabled, formControl, maxDate, mi
|
|
|
1948
1992
|
: undefined, children: jsxRuntimeExports.jsx("span", { className: "rls-picker-day-range__element__span", children: value || '??' }) }, index))) }, index))) })] }));
|
|
1949
1993
|
}
|
|
1950
1994
|
|
|
1951
|
-
function RlsPickerMonth({ date, disabled:
|
|
1995
|
+
function RlsPickerMonth({ date, disabled: _disabled, formControl, maxDate, minDate, onValue, rlsTheme, year }) {
|
|
1952
1996
|
const currentDate = date || new Date();
|
|
1953
1997
|
const [months, setMonths] = require$$0.useState([]);
|
|
1954
1998
|
const [value, setValue] = require$$0.useState(formControl?.value || currentDate.getMonth());
|
|
@@ -1982,10 +2026,10 @@ function RlsPickerMonth({ date, disabled: disabledPicker, formControl, maxDate,
|
|
|
1982
2026
|
}
|
|
1983
2027
|
}
|
|
1984
2028
|
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 ||
|
|
2029
|
+
disabled: disabled || _disabled,
|
|
1986
2030
|
focused,
|
|
1987
2031
|
selected
|
|
1988
|
-
}), onClick: !(disabled ||
|
|
2032
|
+
}), onClick: !(disabled || _disabled)
|
|
1989
2033
|
? () => {
|
|
1990
2034
|
onChange(value);
|
|
1991
2035
|
}
|
|
@@ -2039,7 +2083,7 @@ function RlsPickerMonthTitle({ monthControl, type, yearControl, date, disabled,
|
|
|
2039
2083
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-month-title", children: [jsxRuntimeExports.jsx(RlsButtonAction, { icon: "arrow-ios-left", onClick: onPrevious, disabled: limitPrevious || disabled }), jsxRuntimeExports.jsx("span", { onClick: onClick, children: monthName }), jsxRuntimeExports.jsx(RlsButtonAction, { icon: "arrow-ios-right", onClick: onNext, disabled: limitNext || disabled })] }));
|
|
2040
2084
|
}
|
|
2041
2085
|
|
|
2042
|
-
function RlsPickerYear({ date, disabled:
|
|
2086
|
+
function RlsPickerYear({ date, disabled: _disabled, formControl, maxDate, minDate, onValue, rlsTheme }) {
|
|
2043
2087
|
const currentDate = date || new Date();
|
|
2044
2088
|
const [value, setValue] = require$$0.useState(formControl?.value || currentDate.getFullYear());
|
|
2045
2089
|
const [year, setYear] = require$$0.useState(formControl?.value || currentDate.getFullYear());
|
|
@@ -2079,11 +2123,11 @@ function RlsPickerYear({ date, disabled: disabledPicker, formControl, maxDate, m
|
|
|
2079
2123
|
setYearValue(value);
|
|
2080
2124
|
onValue && onValue(value);
|
|
2081
2125
|
}
|
|
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 ||
|
|
2126
|
+
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: template.years.map(({ value, disabled, focused, selected }, index) => (jsxRuntimeExports.jsx("div", { className: renderClassStatus('rls-picker-year__year', {
|
|
2127
|
+
disabled: disabled || _disabled,
|
|
2084
2128
|
focused,
|
|
2085
2129
|
selected
|
|
2086
|
-
}), onClick: value && !
|
|
2130
|
+
}), onClick: value && !_disabled
|
|
2087
2131
|
? () => {
|
|
2088
2132
|
onChange(value);
|
|
2089
2133
|
}
|
|
@@ -2095,7 +2139,10 @@ function RlsToolbar({ actions, children, subtitle }) {
|
|
|
2095
2139
|
}
|
|
2096
2140
|
|
|
2097
2141
|
function RlsCard({ children, outline, rlsTheme }) {
|
|
2098
|
-
|
|
2142
|
+
const className = require$$0.useMemo(() => {
|
|
2143
|
+
return renderClassStatus('rls-card', { outline });
|
|
2144
|
+
}, [outline]);
|
|
2145
|
+
return (jsxRuntimeExports.jsx("div", { className: className, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-card__content", children: children }) }));
|
|
2099
2146
|
}
|
|
2100
2147
|
|
|
2101
2148
|
const reactI18n = i18n.i18n({
|
|
@@ -2128,7 +2175,10 @@ class ConfirmationResult extends commons.PartialSealed {
|
|
|
2128
2175
|
}
|
|
2129
2176
|
}
|
|
2130
2177
|
function RlsConfirmation({ approved, content, reject, rlsTheme, subtitle, title, visible }) {
|
|
2131
|
-
|
|
2178
|
+
const className = require$$0.useMemo(() => {
|
|
2179
|
+
return renderClassStatus('rls-confirmation', { visible });
|
|
2180
|
+
}, [visible]);
|
|
2181
|
+
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
2182
|
}
|
|
2133
2183
|
function useConfirmation() {
|
|
2134
2184
|
const [config, setConfig] = require$$0.useState({});
|
|
@@ -2174,27 +2224,188 @@ function RlsDatatableHeader({ children, identifier }) {
|
|
|
2174
2224
|
return (jsxRuntimeExports.jsx("tr", { id: identifier, className: "rls-datatable__header", children: children }));
|
|
2175
2225
|
}
|
|
2176
2226
|
function RlsDatatableTitle({ children, className, control, identifier }) {
|
|
2177
|
-
|
|
2227
|
+
const classDatatableName = require$$0.useMemo(() => {
|
|
2228
|
+
return renderClassStatus('rls-datatable__title', { control }, className);
|
|
2229
|
+
}, [control, className]);
|
|
2230
|
+
return (jsxRuntimeExports.jsx("th", { id: identifier, className: classDatatableName, children: children }));
|
|
2178
2231
|
}
|
|
2179
2232
|
function RlsDatatableSubheader({ children, className, identifier }) {
|
|
2180
|
-
|
|
2233
|
+
const classDatatableName = require$$0.useMemo(() => {
|
|
2234
|
+
return renderClassStatus('rls-datatable__subheader', {}, className);
|
|
2235
|
+
}, [className]);
|
|
2236
|
+
return (jsxRuntimeExports.jsx("tr", { id: identifier, className: classDatatableName, children: children }));
|
|
2181
2237
|
}
|
|
2182
2238
|
function RlsDatatableRecord({ children, className, error, identifier, info, successs, warning }) {
|
|
2183
|
-
|
|
2239
|
+
const classDatatableName = require$$0.useMemo(() => {
|
|
2240
|
+
return renderClassStatus('rls-datatable__record', { error, info, successs, warning }, className);
|
|
2241
|
+
}, [error, info, successs, warning, className]);
|
|
2242
|
+
return (jsxRuntimeExports.jsx("tr", { id: identifier, className: classDatatableName, children: children }));
|
|
2184
2243
|
}
|
|
2185
2244
|
function RlsDatatableTotals({ children, className, error, identifier, info, successs, warning }) {
|
|
2186
|
-
|
|
2245
|
+
const classDatatableName = require$$0.useMemo(() => {
|
|
2246
|
+
return renderClassStatus('rls-datatable__totals', { error, info, successs, warning }, className);
|
|
2247
|
+
}, [error, info, successs, warning, className]);
|
|
2248
|
+
return (jsxRuntimeExports.jsx("div", { id: identifier, className: classDatatableName, children: children }));
|
|
2187
2249
|
}
|
|
2188
2250
|
function RlsDatatableCell({ children, className, control, identifier, overflow }) {
|
|
2189
|
-
|
|
2251
|
+
const classDatatableName = require$$0.useMemo(() => {
|
|
2252
|
+
return renderClassStatus('rls-datatable__cell', { control, overflow }, className);
|
|
2253
|
+
}, [control, overflow, className]);
|
|
2254
|
+
return (jsxRuntimeExports.jsx("th", { id: identifier, className: classDatatableName, children: children }));
|
|
2190
2255
|
}
|
|
2191
2256
|
function RlsDatatableData({ children, className, control, identifier, overflow }) {
|
|
2192
|
-
|
|
2257
|
+
const classDatatableName = require$$0.useMemo(() => {
|
|
2258
|
+
return renderClassStatus('rls-datatable__data', { control, overflow }, className);
|
|
2259
|
+
}, [control, overflow, className]);
|
|
2260
|
+
return (jsxRuntimeExports.jsx("div", { id: identifier, className: classDatatableName, children: children }));
|
|
2193
2261
|
}
|
|
2194
2262
|
function RlsDatatable({ children, datatable, footer, header, identifier, rlsTheme, summary, toolbar }) {
|
|
2195
|
-
|
|
2263
|
+
const className = require$$0.useMemo(() => {
|
|
2264
|
+
return renderClassStatus('rls-datatable', {
|
|
2196
2265
|
scrolleable: datatable?.scrolleable
|
|
2197
|
-
})
|
|
2266
|
+
});
|
|
2267
|
+
}, [datatable]);
|
|
2268
|
+
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 })] }));
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
function createObserver(options) {
|
|
2272
|
+
const { setScrolleable, table } = options;
|
|
2273
|
+
const observer = new ResizeObserver(() => {
|
|
2274
|
+
const scrollHeight = table.scrollHeight || 0;
|
|
2275
|
+
const clientHeight = table.clientHeight || 0;
|
|
2276
|
+
setScrolleable(scrollHeight > clientHeight);
|
|
2277
|
+
});
|
|
2278
|
+
observer.observe(table);
|
|
2279
|
+
return observer;
|
|
2280
|
+
}
|
|
2281
|
+
function useDatatable() {
|
|
2282
|
+
const [scrolleable, setScrolleable] = require$$0.useState(false);
|
|
2283
|
+
const tableRef = require$$0.useRef(null);
|
|
2284
|
+
require$$0.useEffect(() => {
|
|
2285
|
+
const observer = tableRef?.current &&
|
|
2286
|
+
createObserver({ setScrolleable, table: tableRef?.current });
|
|
2287
|
+
return () => {
|
|
2288
|
+
observer?.disconnect();
|
|
2289
|
+
};
|
|
2290
|
+
}, []);
|
|
2291
|
+
return { scrolleable, tableRef };
|
|
2292
|
+
}
|
|
2293
|
+
|
|
2294
|
+
function useListController(props) {
|
|
2295
|
+
const { suggestions, automatic, formControl, reference } = props;
|
|
2296
|
+
const listIsOpen = require$$0.useRef(false);
|
|
2297
|
+
const contentRef = require$$0.useRef(null);
|
|
2298
|
+
const listRef = require$$0.useRef(null);
|
|
2299
|
+
const inputRef = require$$0.useRef(null);
|
|
2300
|
+
const [collection, setCollection] = require$$0.useState(new components.ListCollection(suggestions));
|
|
2301
|
+
const [state, refreshState] = require$$0.useState({
|
|
2302
|
+
focused: false,
|
|
2303
|
+
higher: false,
|
|
2304
|
+
value: '',
|
|
2305
|
+
modalIsVisible: false
|
|
2306
|
+
});
|
|
2307
|
+
const position = require$$0.useRef(0);
|
|
2308
|
+
const valueProtected = require$$0.useRef();
|
|
2309
|
+
const changeValueInternal = require$$0.useRef(false);
|
|
2310
|
+
require$$0.useEffect(() => {
|
|
2311
|
+
function onCloseSuggestions({ target }) {
|
|
2312
|
+
!contentRef?.current?.contains(target) &&
|
|
2313
|
+
refreshState((state) => ({ ...state, modalIsVisible: false }));
|
|
2314
|
+
}
|
|
2315
|
+
document.addEventListener('click', onCloseSuggestions);
|
|
2316
|
+
return () => {
|
|
2317
|
+
document.removeEventListener('click', onCloseSuggestions);
|
|
2318
|
+
};
|
|
2319
|
+
}, []);
|
|
2320
|
+
require$$0.useEffect(() => {
|
|
2321
|
+
if (!listIsOpen.current && state.modalIsVisible) {
|
|
2322
|
+
listIsOpen.current = true;
|
|
2323
|
+
}
|
|
2324
|
+
if (listIsOpen.current && !state.modalIsVisible) {
|
|
2325
|
+
formControl?.touch();
|
|
2326
|
+
}
|
|
2327
|
+
refreshState((state) => ({
|
|
2328
|
+
...state,
|
|
2329
|
+
higher: components.locationListCanTop(contentRef.current, listRef.current)
|
|
2330
|
+
}));
|
|
2331
|
+
}, [state.modalIsVisible]);
|
|
2332
|
+
require$$0.useEffect(() => {
|
|
2333
|
+
setCollection(new components.ListCollection(suggestions, reference));
|
|
2334
|
+
}, [suggestions]);
|
|
2335
|
+
require$$0.useEffect(() => {
|
|
2336
|
+
if (!changeValueInternal.current) {
|
|
2337
|
+
if (formControl?.value) {
|
|
2338
|
+
const element = collection.find(formControl.value);
|
|
2339
|
+
if (!element) {
|
|
2340
|
+
valueProtected.current = formControl.value;
|
|
2341
|
+
automatic
|
|
2342
|
+
? setFormValue(collection.value[0], true)
|
|
2343
|
+
: setFormValue(undefined);
|
|
2344
|
+
}
|
|
2345
|
+
else {
|
|
2346
|
+
refreshState((state) => ({ ...state, value: element.description }));
|
|
2347
|
+
}
|
|
2348
|
+
}
|
|
2349
|
+
else if (valueProtected.current) {
|
|
2350
|
+
const element = collection.find(valueProtected.current);
|
|
2351
|
+
element && setFormValue(element);
|
|
2352
|
+
}
|
|
2353
|
+
else {
|
|
2354
|
+
automatic && setFormValue(collection.value[0], true);
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
changeValueInternal.current = false;
|
|
2358
|
+
}, [collection, formControl?.value]);
|
|
2359
|
+
const setState = require$$0.useCallback((state) => {
|
|
2360
|
+
refreshState((_state) => ({ ..._state, ...state }));
|
|
2361
|
+
}, []);
|
|
2362
|
+
const setFormValue = require$$0.useCallback((element, initialValue = false) => {
|
|
2363
|
+
refreshState((state) => ({
|
|
2364
|
+
...state,
|
|
2365
|
+
value: element?.description || ''
|
|
2366
|
+
}));
|
|
2367
|
+
changeValueInternal.current = true;
|
|
2368
|
+
initialValue
|
|
2369
|
+
? formControl?.setInitialValue(element?.value)
|
|
2370
|
+
: formControl?.setValue(element?.value);
|
|
2371
|
+
}, [formControl]);
|
|
2372
|
+
const navigationInput = require$$0.useCallback((event) => {
|
|
2373
|
+
if (state.modalIsVisible) {
|
|
2374
|
+
const _position = components.navigationListFromInput({
|
|
2375
|
+
content: contentRef.current,
|
|
2376
|
+
event: event,
|
|
2377
|
+
list: listRef.current
|
|
2378
|
+
});
|
|
2379
|
+
position.current = _position ?? 0;
|
|
2380
|
+
}
|
|
2381
|
+
}, [state.modalIsVisible]);
|
|
2382
|
+
const navigationElement = require$$0.useCallback((event) => {
|
|
2383
|
+
position.current = components.navigationListFromElement({
|
|
2384
|
+
content: contentRef.current,
|
|
2385
|
+
event: event,
|
|
2386
|
+
input: inputRef.current,
|
|
2387
|
+
list: listRef.current,
|
|
2388
|
+
position: position.current
|
|
2389
|
+
});
|
|
2390
|
+
}, [state.modalIsVisible]);
|
|
2391
|
+
return {
|
|
2392
|
+
...state,
|
|
2393
|
+
contentRef,
|
|
2394
|
+
inputRef,
|
|
2395
|
+
listRef,
|
|
2396
|
+
navigationElement,
|
|
2397
|
+
navigationInput,
|
|
2398
|
+
setFormValue,
|
|
2399
|
+
setState
|
|
2400
|
+
};
|
|
2401
|
+
}
|
|
2402
|
+
|
|
2403
|
+
function useRenderClassStatus(base, status = {}, additionals) {
|
|
2404
|
+
const [className, setClassName] = require$$0.useState('');
|
|
2405
|
+
require$$0.useEffect(() => {
|
|
2406
|
+
setClassName(renderClassStatus(base, status, additionals));
|
|
2407
|
+
}, [base, Object.values(status), additionals]);
|
|
2408
|
+
return className;
|
|
2198
2409
|
}
|
|
2199
2410
|
|
|
2200
2411
|
const DURATION_ANIMATION$1 = 240;
|
|
@@ -2304,16 +2515,27 @@ function RlsFieldAutocompleteTemplate(props) {
|
|
|
2304
2515
|
const autocomplete = useFieldAutocomplete(props);
|
|
2305
2516
|
const { render, children, formControl, msgErrorDisabled, onSearch, placeholder, rlsTheme, searching } = props;
|
|
2306
2517
|
const _disabled = formControl?.disabled || props.disabled;
|
|
2307
|
-
const className =
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2518
|
+
const className = require$$0.useMemo(() => {
|
|
2519
|
+
return renderClassStatus('rls-field-box', {
|
|
2520
|
+
focused: autocomplete.focused && !_disabled,
|
|
2521
|
+
error: formControl?.wrong,
|
|
2522
|
+
disabled: _disabled,
|
|
2523
|
+
selected: !!autocomplete.value
|
|
2524
|
+
}, 'rls-field-list rls-field-autocomplete');
|
|
2525
|
+
}, [
|
|
2526
|
+
formControl?.wrong,
|
|
2527
|
+
formControl?.disabled,
|
|
2528
|
+
autocomplete.value,
|
|
2529
|
+
autocomplete.focused,
|
|
2530
|
+
props.disabled
|
|
2531
|
+
]);
|
|
2532
|
+
const classNameList = require$$0.useMemo(() => {
|
|
2533
|
+
return renderClassStatus('rls-field-list__suggestions', {
|
|
2534
|
+
higher: autocomplete.higher,
|
|
2535
|
+
visible: autocomplete.modalIsVisible
|
|
2536
|
+
});
|
|
2537
|
+
}, [autocomplete.higher, autocomplete.modalIsVisible]);
|
|
2538
|
+
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: reactI18n('listInputPlaceholder'), value: autocomplete.pattern, onChange: (event) => {
|
|
2317
2539
|
autocomplete.setPattern(event.target.value);
|
|
2318
2540
|
}, disabled: _disabled || searching, onFocus: autocomplete.onFocusInput, onBlur: autocomplete.onBlurInput, onKeyDown: autocomplete.onKeydownInput }), onSearch && (jsxRuntimeExports.jsx("button", { disabled: _disabled || searching, onClick: () => {
|
|
2319
2541
|
onSearch(autocomplete.pattern);
|
|
@@ -2324,7 +2546,10 @@ function RlsFieldAutocomplete(props) {
|
|
|
2324
2546
|
}
|
|
2325
2547
|
|
|
2326
2548
|
function RlsModal({ children, overflow, visible, rlsTheme }) {
|
|
2327
|
-
|
|
2549
|
+
const className = require$$0.useMemo(() => {
|
|
2550
|
+
return renderClassStatus('rls-modal', { overflow, visible });
|
|
2551
|
+
}, [overflow, visible]);
|
|
2552
|
+
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
2553
|
}
|
|
2329
2554
|
|
|
2330
2555
|
const FORMAT_TITLE = '{dw}, {mx} {dd} de {aa}';
|
|
@@ -2380,17 +2605,20 @@ function RlsPickerDate({ automatic, date, disabled, formControl, maxDate, minDat
|
|
|
2380
2605
|
formControl?.setValue(value);
|
|
2381
2606
|
onListener && onListener({ event: components.PickerListenerEvent.Select, value });
|
|
2382
2607
|
}
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2608
|
+
const classNameComponent = require$$0.useMemo(() => {
|
|
2609
|
+
return renderClassStatus('rls-picker-date__component', {
|
|
2610
|
+
day: visibility === 'DAY',
|
|
2611
|
+
month: visibility === 'MONTH',
|
|
2612
|
+
year: visibility === 'YEAR'
|
|
2613
|
+
});
|
|
2614
|
+
}, [visibility]);
|
|
2615
|
+
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: dates.dateFormatTemplate(dateInitial, FORMAT_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(RlsPickerMonthTitle, { 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: dateInitial, month: monthControl.value, year: yearControl.value, maxDate: maxDate, minDate: minDate, disabled: disabled }), jsxRuntimeExports.jsx(RlsPickerMonth, { formControl: monthControl, date: dateInitial, year: yearControl.value, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay }), jsxRuntimeExports.jsx(RlsPickerYear, { formControl: yearControl, date: dateInitial, 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: reactI18n('dateActionCancel') }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date__actions--today", children: jsxRuntimeExports.jsx(RlsButton, { type: "ghost", onClick: onToday, disabled: components.dateOutRange({ date: today, maxDate, minDate }), children: reactI18n('dateActionToday') }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date__actions--ok", children: jsxRuntimeExports.jsx(RlsButton, { type: "raised", onClick: onSelect, children: reactI18n('dateActionSelect') }) })] }) }))] }));
|
|
2388
2616
|
}
|
|
2389
2617
|
|
|
2390
2618
|
const FORMAT_DATE = '{dd}/{mx}/{aa}';
|
|
2391
|
-
function RlsFieldDate({ children, date, disabled, formControl, format, identifier, maxDate, minDate, msgErrorDisabled, onValue, placeholder, rlsTheme, value:
|
|
2619
|
+
function RlsFieldDate({ children, date, disabled, formControl, format, identifier, maxDate, minDate, msgErrorDisabled, onValue, placeholder, rlsTheme, value: _value }) {
|
|
2392
2620
|
const today = new Date(); // Initial current date in component
|
|
2393
|
-
const [value, setValue] = require$$0.useState(formControl?.value ||
|
|
2621
|
+
const [value, setValue] = require$$0.useState(formControl?.value || _value);
|
|
2394
2622
|
const [modalIsVisible, setModalIsVisible] = require$$0.useState(false);
|
|
2395
2623
|
require$$0.useEffect(() => {
|
|
2396
2624
|
const dateRange = components.verifyDateRange({
|
|
@@ -2410,9 +2638,9 @@ function RlsFieldDate({ children, date, disabled, formControl, format, identifie
|
|
|
2410
2638
|
}
|
|
2411
2639
|
function onClickAction() {
|
|
2412
2640
|
if (value) {
|
|
2413
|
-
formControl?.setValue(
|
|
2641
|
+
formControl?.setValue(_value);
|
|
2414
2642
|
formControl?.touch();
|
|
2415
|
-
onChange(
|
|
2643
|
+
onChange(_value);
|
|
2416
2644
|
}
|
|
2417
2645
|
else {
|
|
2418
2646
|
setModalIsVisible(true);
|
|
@@ -2422,7 +2650,10 @@ function RlsFieldDate({ children, date, disabled, formControl, format, identifie
|
|
|
2422
2650
|
? dates.dateFormatTemplate(value, format || FORMAT_DATE)
|
|
2423
2651
|
: '';
|
|
2424
2652
|
const _disabled = formControl?.disabled || disabled;
|
|
2425
|
-
|
|
2653
|
+
const className = require$$0.useMemo(() => {
|
|
2654
|
+
return renderClassStatus('rls-field-box', { disabled: _disabled });
|
|
2655
|
+
}, [formControl?.disabled, disabled]);
|
|
2656
|
+
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: 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(RlsPickerDate, { formControl: formControl, date: date, disabled: _disabled, maxDate: maxDate, minDate: minDate, onListener: ({ event, value }) => {
|
|
2426
2657
|
event !== components.PickerListenerEvent.Cancel && onChange(value);
|
|
2427
2658
|
formControl?.touch();
|
|
2428
2659
|
setModalIsVisible(false);
|
|
@@ -2472,13 +2703,19 @@ function RlsPickerDateRange({ automatic, date: datePicker, disabled, formControl
|
|
|
2472
2703
|
formControl?.setValue(value);
|
|
2473
2704
|
onListener && onListener({ event: components.PickerListenerEvent.Select, value });
|
|
2474
2705
|
}
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2706
|
+
const classNameComponent = require$$0.useMemo(() => {
|
|
2707
|
+
return renderClassStatus('rls-picker-date-range__component', {
|
|
2708
|
+
day: visibility === 'DAY',
|
|
2709
|
+
month: visibility === 'MONTH',
|
|
2710
|
+
year: visibility === 'YEAR'
|
|
2711
|
+
});
|
|
2712
|
+
}, [visibility]);
|
|
2713
|
+
const classNameFooter = require$$0.useMemo(() => {
|
|
2714
|
+
return renderClassStatus('rls-picker-date-range__footer', {
|
|
2715
|
+
automatic
|
|
2716
|
+
});
|
|
2717
|
+
}, [automatic]);
|
|
2718
|
+
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: rangeFormatTemplate(value) }) }), 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(RlsPickerMonthTitle, { 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: 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: 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: reactI18n('dateActionCancel') }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date-range__actions--ok", children: jsxRuntimeExports.jsx(RlsButton, { type: "raised", onClick: onSelect, children: reactI18n('dateActionSelect') }) })] }) })] }));
|
|
2482
2719
|
}
|
|
2483
2720
|
|
|
2484
2721
|
function RlsFieldDateRange({ children, date: datePicker, disabled, formControl, identifier, maxDate, minDate, msgErrorDisabled, onValue, placeholder, rlsTheme, value: defaultValue }) {
|
|
@@ -2503,9 +2740,10 @@ function RlsFieldDateRange({ children, date: datePicker, disabled, formControl,
|
|
|
2503
2740
|
onValue && onValue(value);
|
|
2504
2741
|
}
|
|
2505
2742
|
const _disabled = formControl?.disabled || disabled;
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2743
|
+
const className = require$$0.useMemo(() => {
|
|
2744
|
+
return renderClassStatus('rls-field-box', { disabled: _disabled });
|
|
2745
|
+
}, [formControl?.disabled, disabled]);
|
|
2746
|
+
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: 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
2747
|
event !== components.PickerListenerEvent.Cancel && onChange(value);
|
|
2510
2748
|
formControl?.touch();
|
|
2511
2749
|
setModalIsVisible(false);
|
|
@@ -2611,7 +2849,10 @@ function RlsFieldSelect(props) {
|
|
|
2611
2849
|
}
|
|
2612
2850
|
|
|
2613
2851
|
function RlsFormNavigation({ children, visible, rlsTheme }) {
|
|
2614
|
-
|
|
2852
|
+
const className = require$$0.useMemo(() => {
|
|
2853
|
+
return renderClassStatus('rls-form-navigation', { visible });
|
|
2854
|
+
}, [visible]);
|
|
2855
|
+
return (jsxRuntimeExports.jsx("div", { className: className, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-form-navigation__body", children: children }) }));
|
|
2615
2856
|
}
|
|
2616
2857
|
|
|
2617
2858
|
const DURATION_ANIMATION = 240;
|
|
@@ -2630,7 +2871,10 @@ function calculateDuration({ length }) {
|
|
|
2630
2871
|
return duration + DURATION_RESET;
|
|
2631
2872
|
}
|
|
2632
2873
|
function RlsSnackbar({ content, icon, title, visible, rlsTheme }) {
|
|
2633
|
-
|
|
2874
|
+
const className = require$$0.useMemo(() => {
|
|
2875
|
+
return renderClassStatus('rls-snackbar', { visible });
|
|
2876
|
+
}, [visible]);
|
|
2877
|
+
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
2878
|
}
|
|
2635
2879
|
function useSnackbar() {
|
|
2636
2880
|
const [config, setConfig] = require$$0.useState({});
|
|
@@ -2673,10 +2917,11 @@ const RlsContext = require$$0.createContext({
|
|
|
2673
2917
|
function RlsApplication({ children }) {
|
|
2674
2918
|
const { RlsConfirmation, confirmation } = useConfirmation();
|
|
2675
2919
|
const { RlsSnackbar, snackbar } = useSnackbar();
|
|
2676
|
-
const [
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2920
|
+
const [_withNavbar, withNavbar] = require$$0.useState(false);
|
|
2921
|
+
const className = require$$0.useMemo(() => {
|
|
2922
|
+
return renderClassStatus('rls-app__body', { snackbar: _withNavbar });
|
|
2923
|
+
}, [_withNavbar]);
|
|
2924
|
+
return (jsxRuntimeExports.jsxs(RlsContext.Provider, { value: { confirmation, snackbar, withNavbar }, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children, RlsSnackbar] }), RlsConfirmation] }));
|
|
2680
2925
|
}
|
|
2681
2926
|
|
|
2682
2927
|
exports.ConfirmationResult = ConfirmationResult;
|
|
@@ -2750,6 +2995,7 @@ exports.RlsTabularText = RlsTabularText;
|
|
|
2750
2995
|
exports.RlsToolbar = RlsToolbar;
|
|
2751
2996
|
exports.rangeFormatTemplate = rangeFormatTemplate;
|
|
2752
2997
|
exports.renderClassStatus = renderClassStatus;
|
|
2998
|
+
exports.setErrorsI18n = setErrorsI18n;
|
|
2753
2999
|
exports.useConfirmation = useConfirmation;
|
|
2754
3000
|
exports.useDatatable = useDatatable;
|
|
2755
3001
|
exports.useListController = useListController;
|