@rolster/react-components 18.19.0 → 18.20.3
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-DLCk3aif.css → index-DYtIRACv.css} +15 -0
- package/dist/cjs/index.js +253 -255
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/assets/{index-DLCk3aif.css → index-DYtIRACv.css} +15 -0
- package/dist/es/index.js +254 -257
- package/dist/es/index.js.map +1 -1
- package/dist/esm/components/atoms/Avatar/Avatar.js +2 -2
- package/dist/esm/components/atoms/Avatar/Avatar.js.map +1 -1
- package/dist/esm/components/atoms/Button/Button.css +15 -0
- package/dist/esm/components/atoms/Button/Button.d.ts +1 -1
- package/dist/esm/components/atoms/Button/Button.js +2 -2
- package/dist/esm/components/atoms/Button/Button.js.map +1 -1
- package/dist/esm/components/atoms/CheckBox/CheckBox.js +2 -2
- package/dist/esm/components/atoms/CheckBox/CheckBox.js.map +1 -1
- package/dist/esm/components/atoms/Icon/Icon.js +2 -2
- package/dist/esm/components/atoms/Icon/Icon.js.map +1 -1
- package/dist/esm/components/atoms/Input/Input.js +13 -15
- package/dist/esm/components/atoms/Input/Input.js.map +1 -1
- package/dist/esm/components/atoms/InputMoney/InputMoney.js +3 -3
- package/dist/esm/components/atoms/InputMoney/InputMoney.js.map +1 -1
- package/dist/esm/components/atoms/InputNumber/InputNumber.js +3 -3
- package/dist/esm/components/atoms/InputNumber/InputNumber.js.map +1 -1
- package/dist/esm/components/atoms/InputPassword/InputPassword.js +9 -9
- package/dist/esm/components/atoms/InputPassword/InputPassword.js.map +1 -1
- package/dist/esm/components/atoms/InputSearch/InputSearch.js +5 -5
- package/dist/esm/components/atoms/InputSearch/InputSearch.js.map +1 -1
- package/dist/esm/components/atoms/InputText/InputText.js +3 -3
- package/dist/esm/components/atoms/InputText/InputText.js.map +1 -1
- package/dist/esm/components/atoms/Poster/Poster.js +2 -2
- package/dist/esm/components/atoms/Poster/Poster.js.map +1 -1
- package/dist/esm/components/atoms/ProgressBar/ProgressBar.js +2 -2
- package/dist/esm/components/atoms/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/esm/components/atoms/RadioButton/RadioButton.js +2 -2
- package/dist/esm/components/atoms/RadioButton/RadioButton.js.map +1 -1
- package/dist/esm/components/atoms/Switch/Switch.js +2 -2
- package/dist/esm/components/atoms/Switch/Switch.js.map +1 -1
- package/dist/esm/components/atoms/TabularText/TabularText.js +8 -3
- package/dist/esm/components/atoms/TabularText/TabularText.js.map +1 -1
- package/dist/esm/components/molecules/Ballot/Ballot.js +2 -2
- package/dist/esm/components/molecules/Ballot/Ballot.js.map +1 -1
- package/dist/esm/components/molecules/ButtonProgress/ButtonProgress.js +2 -2
- package/dist/esm/components/molecules/ButtonProgress/ButtonProgress.js.map +1 -1
- package/dist/esm/components/molecules/ButtonToggle/ButtonToggle.js +10 -10
- package/dist/esm/components/molecules/ButtonToggle/ButtonToggle.js.map +1 -1
- package/dist/esm/components/molecules/FieldMoney/FieldMoney.js +2 -2
- package/dist/esm/components/molecules/FieldMoney/FieldMoney.js.map +1 -1
- package/dist/esm/components/molecules/FieldNumber/FieldNumber.js +2 -2
- package/dist/esm/components/molecules/FieldNumber/FieldNumber.js.map +1 -1
- package/dist/esm/components/molecules/FieldPassword/FieldPassword.js +6 -6
- package/dist/esm/components/molecules/FieldPassword/FieldPassword.js.map +1 -1
- package/dist/esm/components/molecules/FieldText/FieldText.js +2 -2
- package/dist/esm/components/molecules/FieldText/FieldText.js.map +1 -1
- package/dist/esm/components/molecules/LabelCheckBox/LabelCheckBox.js +8 -11
- package/dist/esm/components/molecules/LabelCheckBox/LabelCheckBox.js.map +1 -1
- package/dist/esm/components/molecules/LabelRadioButton/LabelRadioButton.js +5 -5
- package/dist/esm/components/molecules/LabelRadioButton/LabelRadioButton.js.map +1 -1
- package/dist/esm/components/molecules/LabelSwitch/LabelSwitch.js +11 -11
- package/dist/esm/components/molecules/LabelSwitch/LabelSwitch.js.map +1 -1
- package/dist/esm/components/molecules/Pagination/Pagination.js +2 -2
- package/dist/esm/components/molecules/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/molecules/PickerDay/PickerDay.js +1 -1
- package/dist/esm/components/molecules/PickerDay/PickerDay.js.map +1 -1
- package/dist/esm/components/molecules/PickerDayRange/PickerDayRange.js +1 -1
- package/dist/esm/components/molecules/PickerDayRange/PickerDayRange.js.map +1 -1
- package/dist/esm/components/molecules/PickerMonth/PickerMonth.js +1 -1
- package/dist/esm/components/molecules/PickerMonth/PickerMonth.js.map +1 -1
- package/dist/esm/components/molecules/PickerYear/PickerYear.js +1 -1
- package/dist/esm/components/molecules/PickerYear/PickerYear.js.map +1 -1
- package/dist/esm/components/organisms/Card/Card.js +2 -2
- package/dist/esm/components/organisms/Card/Card.js.map +1 -1
- package/dist/esm/components/organisms/Confirmation/Confirmation.js +2 -2
- package/dist/esm/components/organisms/Confirmation/Confirmation.js.map +1 -1
- package/dist/esm/components/organisms/Datatable/Datatable.js +7 -7
- package/dist/esm/components/organisms/Datatable/Datatable.js.map +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js +3 -3
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js.map +1 -1
- package/dist/esm/components/organisms/FieldDate/FieldDate.js +2 -2
- package/dist/esm/components/organisms/FieldDate/FieldDate.js.map +1 -1
- package/dist/esm/components/organisms/FieldDateRange/FieldDateRange.js +5 -2
- package/dist/esm/components/organisms/FieldDateRange/FieldDateRange.js.map +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js +3 -3
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js.map +1 -1
- package/dist/esm/components/organisms/FormNavigation/FormNavigation.js +2 -2
- package/dist/esm/components/organisms/FormNavigation/FormNavigation.js.map +1 -1
- package/dist/esm/components/organisms/Modal/Modal.js +2 -2
- package/dist/esm/components/organisms/Modal/Modal.js.map +1 -1
- package/dist/esm/components/organisms/PickerDate/PickerDate.js +2 -2
- package/dist/esm/components/organisms/PickerDate/PickerDate.js.map +1 -1
- package/dist/esm/components/organisms/PickerDateRange/PickerDateRange.js +4 -3
- package/dist/esm/components/organisms/PickerDateRange/PickerDateRange.js.map +1 -1
- package/dist/esm/components/organisms/Snackbar/Snackbar.js +2 -2
- package/dist/esm/components/organisms/Snackbar/Snackbar.js.map +1 -1
- package/dist/esm/controllers/ListController.js +12 -24
- package/dist/esm/controllers/ListController.js.map +1 -1
- package/dist/esm/controllers/RenderClassStatusController.d.ts +2 -0
- package/dist/esm/controllers/RenderClassStatusController.js +10 -0
- package/dist/esm/controllers/RenderClassStatusController.js.map +1 -0
- package/dist/esm/controllers/index.d.ts +1 -0
- package/dist/esm/controllers/index.js +1 -0
- package/dist/esm/controllers/index.js.map +1 -1
- package/dist/esm/helpers/css.d.ts +2 -3
- package/dist/esm/helpers/css.js +3 -3
- package/dist/esm/helpers/css.js.map +1 -1
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var require$$0 = require('react');
|
|
4
4
|
var commons = require('@rolster/commons');
|
|
5
|
-
var dates = require('@rolster/dates');
|
|
6
5
|
var components = require('@rolster/components');
|
|
6
|
+
var dates = require('@rolster/dates');
|
|
7
7
|
var ReactDOM = require('react-dom');
|
|
8
8
|
var i18n = require('@rolster/i18n');
|
|
9
9
|
var reactForms = require('@rolster/react-forms');
|
|
@@ -1346,20 +1346,156 @@ var jsxRuntimeExports = jsxRuntime.exports;
|
|
|
1346
1346
|
|
|
1347
1347
|
const className = 'rls-tabular-text';
|
|
1348
1348
|
const pointers = ['.', ','];
|
|
1349
|
-
function
|
|
1349
|
+
function getCharClass(char) {
|
|
1350
1350
|
return pointers.includes(char)
|
|
1351
1351
|
? `${className}__pointer`
|
|
1352
1352
|
: `${className}__char`;
|
|
1353
1353
|
}
|
|
1354
1354
|
function RlsTabularText({ value }) {
|
|
1355
|
-
|
|
1355
|
+
const [codes, setCodes] = require$$0.useState(jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}));
|
|
1356
|
+
require$$0.useEffect(() => {
|
|
1357
|
+
setCodes(jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: value?.split('').map((char, index) => (jsxRuntimeExports.jsx("span", { className: getCharClass(char), children: char }, index))) }));
|
|
1358
|
+
}, [value]);
|
|
1359
|
+
return jsxRuntimeExports.jsx("div", { className: "rls-tabular-text", children: codes });
|
|
1356
1360
|
}
|
|
1357
1361
|
|
|
1358
1362
|
function RlsAmount({ value, decimals, rlsTheme, symbol }) {
|
|
1359
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 }) })] }));
|
|
1360
1364
|
}
|
|
1361
1365
|
|
|
1362
|
-
function
|
|
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
|
+
function renderClassStatus(base, status = {}, additionals) {
|
|
1363
1499
|
const resultClass = [base];
|
|
1364
1500
|
Object.entries(status).forEach(([name, value]) => {
|
|
1365
1501
|
if (value) {
|
|
@@ -1368,20 +1504,12 @@ function renderClassStatus(base, status = {}, aditionals) {
|
|
|
1368
1504
|
: resultClass.push(`${base}--${name}`);
|
|
1369
1505
|
}
|
|
1370
1506
|
});
|
|
1371
|
-
if (
|
|
1372
|
-
resultClass.push(
|
|
1507
|
+
if (additionals) {
|
|
1508
|
+
resultClass.push(additionals);
|
|
1373
1509
|
}
|
|
1374
1510
|
return resultClass.join(' ');
|
|
1375
1511
|
}
|
|
1376
1512
|
|
|
1377
|
-
function RlsAvatar({ children, rounded, skeleton, rlsTheme }) {
|
|
1378
|
-
return (jsxRuntimeExports.jsx("div", { className: renderClassStatus('rls-avatar', { rounded, skeleton }), "rls-theme": rlsTheme, children: children }));
|
|
1379
|
-
}
|
|
1380
|
-
|
|
1381
|
-
function RlsBadge({ children, rlsTheme }) {
|
|
1382
|
-
return (jsxRuntimeExports.jsx("div", { className: "rls-badge", "rls-theme": rlsTheme, children: children }));
|
|
1383
|
-
}
|
|
1384
|
-
|
|
1385
1513
|
const DATE_RANGE_FORMAT = '{dd}/{mx}/{aa}';
|
|
1386
1514
|
|
|
1387
1515
|
function rangeFormatTemplate({ maxDate, minDate }) {
|
|
@@ -1390,6 +1518,22 @@ function rangeFormatTemplate({ maxDate, minDate }) {
|
|
|
1390
1518
|
return `${minFormat} - ${maxFormat}`;
|
|
1391
1519
|
}
|
|
1392
1520
|
|
|
1521
|
+
function useRenderClassStatus(base, status = {}, additionals) {
|
|
1522
|
+
const [className, setClassName] = require$$0.useState('');
|
|
1523
|
+
require$$0.useEffect(() => {
|
|
1524
|
+
setClassName(renderClassStatus(base, status, additionals));
|
|
1525
|
+
}, [base, Object.values(status), additionals]);
|
|
1526
|
+
return className;
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
function RlsAvatar({ children, rounded, skeleton, rlsTheme }) {
|
|
1530
|
+
return (jsxRuntimeExports.jsx("div", { className: useRenderClassStatus('rls-avatar', { rounded, skeleton }), "rls-theme": rlsTheme, children: children }));
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
function RlsBadge({ children, rlsTheme }) {
|
|
1534
|
+
return (jsxRuntimeExports.jsx("div", { className: "rls-badge", "rls-theme": rlsTheme, children: children }));
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1393
1537
|
function RlsBreadcrumb({ labels }) {
|
|
1394
1538
|
return (jsxRuntimeExports.jsx("div", { className: "rls-breadcrumb", children: labels.map(({ label, onClick }, index) => (jsxRuntimeExports.jsx("label", { className: "rls-breadcrumb__label", onClick: onClick, children: jsxRuntimeExports.jsx("a", { className: renderClassStatus('rls-breadcrumb__label__a', {
|
|
1395
1539
|
actionable: !!onClick
|
|
@@ -1397,11 +1541,11 @@ function RlsBreadcrumb({ labels }) {
|
|
|
1397
1541
|
}
|
|
1398
1542
|
|
|
1399
1543
|
function RlsIcon({ value, skeleton }) {
|
|
1400
|
-
return (jsxRuntimeExports.jsx("div", { className:
|
|
1544
|
+
return (jsxRuntimeExports.jsx("div", { className: useRenderClassStatus('rls-icon', { skeleton }), children: jsxRuntimeExports.jsx("i", { className: `rls-icon-${value}` }) }));
|
|
1401
1545
|
}
|
|
1402
1546
|
|
|
1403
1547
|
function RlsButton({ type, children, disabled, identifier, prefixIcon, suffixIcon, rlsTheme, onClick }) {
|
|
1404
|
-
return (jsxRuntimeExports.jsx("button", { id: identifier, className: "rls-button", onClick: onClick, "rls-theme": rlsTheme, disabled: disabled, children: jsxRuntimeExports.jsxs("div", { className:
|
|
1548
|
+
return (jsxRuntimeExports.jsx("button", { id: identifier, className: "rls-button", onClick: onClick, "rls-theme": rlsTheme, disabled: disabled, children: jsxRuntimeExports.jsxs("div", { className: useRenderClassStatus('rls-button__content', { type }), children: [prefixIcon && jsxRuntimeExports.jsx(RlsIcon, { value: prefixIcon }), children && jsxRuntimeExports.jsx("div", { className: "rls-button__label", children: children }), suffixIcon && jsxRuntimeExports.jsx(RlsIcon, { value: suffixIcon })] }) }));
|
|
1405
1549
|
}
|
|
1406
1550
|
|
|
1407
1551
|
function RlsButtonAction({ icon, disabled, identifier, onClick, tooltip }) {
|
|
@@ -1409,7 +1553,7 @@ function RlsButtonAction({ icon, disabled, identifier, onClick, tooltip }) {
|
|
|
1409
1553
|
}
|
|
1410
1554
|
|
|
1411
1555
|
function RlsCheckBox({ checked, disabled, identifier, onClick, rlsTheme }) {
|
|
1412
|
-
return (jsxRuntimeExports.jsx("div", { id: identifier, className:
|
|
1556
|
+
return (jsxRuntimeExports.jsx("div", { id: identifier, className: useRenderClassStatus('rls-checkbox', { checked, disabled }), onClick: onClick, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-checkbox__component" }) }));
|
|
1413
1557
|
}
|
|
1414
1558
|
function RlsCheckBoxControl({ formControl, disabled, identifier, rlsTheme }) {
|
|
1415
1559
|
return (jsxRuntimeExports.jsx(RlsCheckBox, { identifier: identifier, checked: !!formControl.value, disabled: disabled, onClick: () => {
|
|
@@ -1419,22 +1563,20 @@ function RlsCheckBoxControl({ formControl, disabled, identifier, rlsTheme }) {
|
|
|
1419
1563
|
|
|
1420
1564
|
function RlsInput({ children, disabled, formControl, identifier, onValue, placeholder, type, value }) {
|
|
1421
1565
|
const [focused, setFocused] = require$$0.useState(false);
|
|
1422
|
-
|
|
1423
|
-
|
|
1566
|
+
const onChange = require$$0.useCallback((event) => {
|
|
1567
|
+
const value = type === 'number' ? +event.target.value : event.target.value;
|
|
1424
1568
|
onValue && onValue(value);
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
}
|
|
1429
|
-
function onFocus() {
|
|
1569
|
+
formControl?.setValue(value);
|
|
1570
|
+
}, [formControl, onValue]);
|
|
1571
|
+
const onFocus = require$$0.useCallback(() => {
|
|
1430
1572
|
formControl?.focus();
|
|
1431
|
-
setFocused(true);
|
|
1432
|
-
}
|
|
1433
|
-
|
|
1573
|
+
setFocused(() => true);
|
|
1574
|
+
}, [formControl]);
|
|
1575
|
+
const onBlur = require$$0.useCallback(() => {
|
|
1434
1576
|
formControl?.blur();
|
|
1435
|
-
setFocused(false);
|
|
1436
|
-
}
|
|
1437
|
-
return (jsxRuntimeExports.jsxs("div", { id: identifier, className:
|
|
1577
|
+
setFocused(() => false);
|
|
1578
|
+
}, [formControl]);
|
|
1579
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: useRenderClassStatus('rls-input', {
|
|
1438
1580
|
focused: formControl?.focused ?? focused,
|
|
1439
1581
|
disabled: formControl?.disabled || disabled
|
|
1440
1582
|
}), 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 })] }));
|
|
@@ -1442,36 +1584,36 @@ function RlsInput({ children, disabled, formControl, identifier, onValue, placeh
|
|
|
1442
1584
|
|
|
1443
1585
|
function RlsInputMoney({ decimals, disabled, formControl, identifier, onValue, placeholder, symbol, value }) {
|
|
1444
1586
|
const [valueInput, setValueInput] = require$$0.useState(value || 0);
|
|
1445
|
-
|
|
1587
|
+
const onValueInput = require$$0.useCallback((value) => {
|
|
1446
1588
|
!formControl && setValueInput(value);
|
|
1447
1589
|
onValue && onValue(value);
|
|
1448
|
-
}
|
|
1590
|
+
}, [formControl, onValue]);
|
|
1449
1591
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: "rls-input-money", children: jsxRuntimeExports.jsx(RlsInput, { formControl: formControl, type: "number", value: value, disabled: disabled, placeholder: placeholder, onValue: onValueInput, children: jsxRuntimeExports.jsx(RlsAmount, { value: formControl?.value ?? value ?? valueInput, symbol: symbol, decimals: decimals }) }) }));
|
|
1450
1592
|
}
|
|
1451
1593
|
|
|
1452
1594
|
function RlsInputNumber({ disabled, formControl, identifier, onValue, placeholder, value }) {
|
|
1453
1595
|
const [valueInput, setValueInput] = require$$0.useState(value ?? 0);
|
|
1454
|
-
|
|
1596
|
+
const onValueInput = require$$0.useCallback((value) => {
|
|
1455
1597
|
!formControl && setValueInput(value);
|
|
1456
1598
|
onValue && onValue(value);
|
|
1457
|
-
}
|
|
1599
|
+
}, [formControl, onValue]);
|
|
1458
1600
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: "rls-input-number", children: jsxRuntimeExports.jsx(RlsInput, { formControl: formControl, type: "number", value: value, disabled: disabled, placeholder: placeholder, onValue: onValueInput, children: formControl?.value ?? value ?? valueInput }) }));
|
|
1459
1601
|
}
|
|
1460
1602
|
|
|
1461
1603
|
function RlsInputPassword({ disabled, formControl, identifier, onValue, placeholder, type }) {
|
|
1462
1604
|
const [focused, setFocused] = require$$0.useState(false);
|
|
1463
|
-
|
|
1605
|
+
const onChange = require$$0.useCallback((event) => {
|
|
1464
1606
|
formControl?.setValue(event.target.value);
|
|
1465
1607
|
onValue && onValue(event.target.value);
|
|
1466
|
-
}
|
|
1467
|
-
|
|
1608
|
+
}, [formControl, onValue]);
|
|
1609
|
+
const onFocus = require$$0.useCallback(() => {
|
|
1468
1610
|
formControl?.focus();
|
|
1469
|
-
setFocused(true);
|
|
1470
|
-
}
|
|
1471
|
-
|
|
1611
|
+
setFocused(() => true);
|
|
1612
|
+
}, [formControl]);
|
|
1613
|
+
const onBlur = require$$0.useCallback(() => {
|
|
1472
1614
|
formControl?.blur();
|
|
1473
|
-
setFocused(false);
|
|
1474
|
-
}
|
|
1615
|
+
setFocused(() => false);
|
|
1616
|
+
}, [formControl]);
|
|
1475
1617
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: renderClassStatus('rls-input-password', {
|
|
1476
1618
|
focused: formControl?.focused ?? focused,
|
|
1477
1619
|
disabled: formControl?.disabled || disabled
|
|
@@ -1480,18 +1622,18 @@ function RlsInputPassword({ disabled, formControl, identifier, onValue, placehol
|
|
|
1480
1622
|
|
|
1481
1623
|
function RlsInputSearch({ formControl, identifier, onSearch, placeholder }) {
|
|
1482
1624
|
const [value, setValue] = require$$0.useState('');
|
|
1483
|
-
|
|
1484
|
-
!formControl && setValue(value);
|
|
1485
|
-
}
|
|
1486
|
-
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-input-search", children: [jsxRuntimeExports.jsx(RlsInput, { formControl: formControl, placeholder: placeholder, onValue:
|
|
1625
|
+
const onValue = require$$0.useCallback((value) => {
|
|
1626
|
+
!formControl && setValue(() => value);
|
|
1627
|
+
}, [formControl]);
|
|
1628
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-input-search", children: [jsxRuntimeExports.jsx(RlsInput, { formControl: formControl, placeholder: placeholder, onValue: onValue, children: formControl?.value ?? value }), onSearch && jsxRuntimeExports.jsx(RlsButtonAction, { icon: "search", onClick: onSearch })] }));
|
|
1487
1629
|
}
|
|
1488
1630
|
|
|
1489
1631
|
function RlsInputText({ disabled, formControl, identifier, onValue, placeholder, value }) {
|
|
1490
1632
|
const [valueInput, setValueInput] = require$$0.useState(value ?? '');
|
|
1491
|
-
|
|
1633
|
+
const onValueInput = require$$0.useCallback((value) => {
|
|
1492
1634
|
!formControl && setValueInput(value);
|
|
1493
1635
|
onValue && onValue(value);
|
|
1494
|
-
}
|
|
1636
|
+
}, [formControl, onValue]);
|
|
1495
1637
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: "rls-input-text", children: jsxRuntimeExports.jsx(RlsInput, { formControl: formControl, type: "text", value: value, disabled: disabled, placeholder: placeholder, onValue: onValueInput, children: formControl?.value ?? value ?? valueInput }) }));
|
|
1496
1638
|
}
|
|
1497
1639
|
|
|
@@ -1504,11 +1646,11 @@ function RlsMessageIcon({ icon, children, rlsTheme }) {
|
|
|
1504
1646
|
}
|
|
1505
1647
|
|
|
1506
1648
|
function RlsPoster({ children, contrast, outline, rlsTheme }) {
|
|
1507
|
-
return (jsxRuntimeExports.jsx("div", { className:
|
|
1649
|
+
return (jsxRuntimeExports.jsx("div", { className: useRenderClassStatus('rls-poster', { contrast, outline }), "rls-theme": rlsTheme, children: children }));
|
|
1508
1650
|
}
|
|
1509
1651
|
|
|
1510
1652
|
function RlsProgressBar({ indeterminate, percentage, rlsTheme }) {
|
|
1511
|
-
return (jsxRuntimeExports.jsx("div", { className:
|
|
1653
|
+
return (jsxRuntimeExports.jsx("div", { className: useRenderClassStatus('rls-progress-bar', { indeterminate }), "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-progress-bar__component", style: { width: `${percentage || 0}%` } }) }));
|
|
1512
1654
|
}
|
|
1513
1655
|
|
|
1514
1656
|
function RlsProgressCircular({ rlsTheme }) {
|
|
@@ -1516,7 +1658,7 @@ function RlsProgressCircular({ rlsTheme }) {
|
|
|
1516
1658
|
}
|
|
1517
1659
|
|
|
1518
1660
|
function RlsRadioButton({ checked, disabled, identifier, rlsTheme, onClick }) {
|
|
1519
|
-
return (jsxRuntimeExports.jsx("div", { id: identifier, className:
|
|
1661
|
+
return (jsxRuntimeExports.jsx("div", { id: identifier, className: useRenderClassStatus('rls-radiobutton', { checked, disabled }), onClick: onClick, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-radiobutton__component" }) }));
|
|
1520
1662
|
}
|
|
1521
1663
|
|
|
1522
1664
|
function RlsSkeleton({ rlsTheme }) {
|
|
@@ -1528,7 +1670,7 @@ function RlsSkeletonText({ active, children, rlsTheme }) {
|
|
|
1528
1670
|
}
|
|
1529
1671
|
|
|
1530
1672
|
function RlsSwitch({ checked, disabled, identifier, onClick, rlsTheme }) {
|
|
1531
|
-
return (jsxRuntimeExports.jsx("div", { id: identifier, className:
|
|
1673
|
+
return (jsxRuntimeExports.jsx("div", { id: identifier, className: useRenderClassStatus('rls-switch', { checked, disabled }), 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" })] }) }));
|
|
1532
1674
|
}
|
|
1533
1675
|
function RlsSwitchControl({ formControl, disabled, identifier, rlsTheme }) {
|
|
1534
1676
|
return (jsxRuntimeExports.jsx(RlsSwitch, { identifier: identifier, checked: formControl.value || false, disabled: disabled, onClick: () => {
|
|
@@ -1537,11 +1679,11 @@ function RlsSwitchControl({ formControl, disabled, identifier, rlsTheme }) {
|
|
|
1537
1679
|
}
|
|
1538
1680
|
|
|
1539
1681
|
function RlsBallot({ bordered, children, img, initials, skeleton, subtitle, rlsTheme }) {
|
|
1540
|
-
return (jsxRuntimeExports.jsxs("div", { className:
|
|
1682
|
+
return (jsxRuntimeExports.jsxs("div", { className: useRenderClassStatus('rls-ballot', { bordered, skeleton }), "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 }) }) }))] })] }));
|
|
1541
1683
|
}
|
|
1542
1684
|
|
|
1543
1685
|
function RlsButtonProgress({ icon, disabled, onClick, progressing, rlsTheme }) {
|
|
1544
|
-
return (jsxRuntimeExports.jsxs("div", { className:
|
|
1686
|
+
return (jsxRuntimeExports.jsxs("div", { className: useRenderClassStatus('rls-button-progress', { progressing }), "rls-theme": rlsTheme, children: [!progressing && (jsxRuntimeExports.jsx(RlsButtonAction, { icon: icon, onClick: onClick, disabled: disabled })), progressing && jsxRuntimeExports.jsx(RlsProgressCircular, {})] }));
|
|
1545
1687
|
}
|
|
1546
1688
|
|
|
1547
1689
|
function RlsButtonToggle({ onAction, options, type, automatic, disabled, rlsTheme }) {
|
|
@@ -1558,17 +1700,17 @@ function RlsButtonToggle({ onAction, options, type, automatic, disabled, rlsThem
|
|
|
1558
1700
|
document.removeEventListener('click', onCloseMenu);
|
|
1559
1701
|
};
|
|
1560
1702
|
}, []);
|
|
1561
|
-
|
|
1562
|
-
setVisible((
|
|
1563
|
-
}
|
|
1564
|
-
|
|
1565
|
-
setAction(action);
|
|
1566
|
-
setVisible(false);
|
|
1703
|
+
const onClickMenu = require$$0.useCallback(() => {
|
|
1704
|
+
setVisible((visible) => !visible);
|
|
1705
|
+
}, []);
|
|
1706
|
+
const onSelectAction = require$$0.useCallback((action) => {
|
|
1707
|
+
setAction(() => action);
|
|
1708
|
+
setVisible(() => false);
|
|
1567
1709
|
automatic && onAction(action.value);
|
|
1568
|
-
}
|
|
1710
|
+
}, [onAction, automatic]);
|
|
1569
1711
|
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: () => {
|
|
1570
1712
|
onAction(action.value);
|
|
1571
|
-
}, 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:
|
|
1713
|
+
}, 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: useRenderClassStatus('rls-button-toggle__list', {
|
|
1572
1714
|
visible,
|
|
1573
1715
|
hide: !visible
|
|
1574
1716
|
}), children: jsxRuntimeExports.jsx("ul", { children: options.map((action, index) => (jsxRuntimeExports.jsx("li", { className: "truncate", onClick: () => {
|
|
@@ -1582,7 +1724,7 @@ function RlsMessageFormError({ className, formControl }) {
|
|
|
1582
1724
|
|
|
1583
1725
|
function RlsFieldMoney({ children, decimals, disabled, formControl, identifier, msgErrorDisabled, onValue, placeholder, symbol, rlsTheme, value }) {
|
|
1584
1726
|
const _disabled = formControl?.disabled || disabled;
|
|
1585
|
-
return (jsxRuntimeExports.jsxs("div", { id: identifier, className:
|
|
1727
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: useRenderClassStatus('rls-field-box', {
|
|
1586
1728
|
focused: formControl?.focused && !_disabled,
|
|
1587
1729
|
error: formControl?.wrong,
|
|
1588
1730
|
disabled: _disabled
|
|
@@ -1591,7 +1733,7 @@ function RlsFieldMoney({ children, decimals, disabled, formControl, identifier,
|
|
|
1591
1733
|
|
|
1592
1734
|
function RlsFieldNumber({ children, disabled, formControl, identifier, msgErrorDisabled, onValue, placeholder, rlsTheme, value }) {
|
|
1593
1735
|
const _disabled = formControl?.disabled || disabled;
|
|
1594
|
-
return (jsxRuntimeExports.jsxs("div", { id: identifier, className:
|
|
1736
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: useRenderClassStatus('rls-field-box', {
|
|
1595
1737
|
focused: formControl?.focused && !_disabled,
|
|
1596
1738
|
error: formControl?.wrong,
|
|
1597
1739
|
disabled: _disabled
|
|
@@ -1600,11 +1742,11 @@ function RlsFieldNumber({ children, disabled, formControl, identifier, msgErrorD
|
|
|
1600
1742
|
|
|
1601
1743
|
function RlsFieldPassword({ children, disabled, formControl, identifier, msgErrorDisabled, placeholder, rlsTheme }) {
|
|
1602
1744
|
const [password, setPassword] = require$$0.useState(true);
|
|
1603
|
-
|
|
1604
|
-
setPassword(!password);
|
|
1605
|
-
}
|
|
1745
|
+
const onToggleInput = require$$0.useCallback(() => {
|
|
1746
|
+
setPassword((password) => !password);
|
|
1747
|
+
}, []);
|
|
1606
1748
|
const _disabled = formControl?.disabled || disabled;
|
|
1607
|
-
return (jsxRuntimeExports.jsxs("div", { id: identifier, className:
|
|
1749
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: useRenderClassStatus(' rls-field-box', {
|
|
1608
1750
|
focused: formControl?.focused && !_disabled,
|
|
1609
1751
|
error: formControl?.wrong,
|
|
1610
1752
|
disabled: _disabled
|
|
@@ -1613,7 +1755,7 @@ function RlsFieldPassword({ children, disabled, formControl, identifier, msgErro
|
|
|
1613
1755
|
|
|
1614
1756
|
function RlsFieldText({ children, disabled, formControl, identifier, msgErrorDisabled, onValue, placeholder, rlsTheme, value }) {
|
|
1615
1757
|
const _disabled = formControl?.disabled || disabled;
|
|
1616
|
-
return (jsxRuntimeExports.jsxs("div", { id: identifier, className:
|
|
1758
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: useRenderClassStatus('rls-field-box', {
|
|
1617
1759
|
focused: formControl?.focused && !_disabled,
|
|
1618
1760
|
error: formControl?.wrong,
|
|
1619
1761
|
disabled: _disabled
|
|
@@ -1625,15 +1767,12 @@ function RlsLabelCheckBox({ children, disabled, extended, identifier, formContro
|
|
|
1625
1767
|
require$$0.useEffect(() => {
|
|
1626
1768
|
setChecked(!!formControl?.value);
|
|
1627
1769
|
}, [formControl?.value]);
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
formControl?.setValue(!formControl.value)
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
}
|
|
1635
|
-
}
|
|
1636
|
-
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: renderClassStatus('rls-label-checkbox', {
|
|
1770
|
+
const onToggle = require$$0.useCallback(() => {
|
|
1771
|
+
formControl
|
|
1772
|
+
? formControl?.setValue(!formControl.value)
|
|
1773
|
+
: setChecked((checked) => !checked);
|
|
1774
|
+
}, [formControl]);
|
|
1775
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: useRenderClassStatus('rls-label-checkbox', {
|
|
1637
1776
|
disabled,
|
|
1638
1777
|
extended
|
|
1639
1778
|
}), "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 })] }));
|
|
@@ -1644,10 +1783,10 @@ function RlsLabelRadioButton({ children, disabled, extended, identifier, formCon
|
|
|
1644
1783
|
require$$0.useEffect(() => {
|
|
1645
1784
|
setChecked(formControl?.value === value);
|
|
1646
1785
|
}, [formControl?.value]);
|
|
1647
|
-
|
|
1786
|
+
const onSelect = require$$0.useCallback(() => {
|
|
1648
1787
|
formControl && formControl?.setValue(value);
|
|
1649
|
-
}
|
|
1650
|
-
return (jsxRuntimeExports.jsxs("div", { id: identifier, className:
|
|
1788
|
+
}, [formControl, value]);
|
|
1789
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: useRenderClassStatus('rls-label-radiobutton', {
|
|
1651
1790
|
disabled,
|
|
1652
1791
|
extended
|
|
1653
1792
|
}), "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 })] }));
|
|
@@ -1658,15 +1797,15 @@ function RlsLabelSwitch({ children, disabled, extended, identifier, formControl,
|
|
|
1658
1797
|
require$$0.useEffect(() => {
|
|
1659
1798
|
setChecked(!!formControl?.value);
|
|
1660
1799
|
}, [formControl?.value]);
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
formControl?.setValue(!formControl.value)
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1800
|
+
const onToggle = require$$0.useCallback(() => {
|
|
1801
|
+
formControl
|
|
1802
|
+
? formControl?.setValue(!formControl.value)
|
|
1803
|
+
: setChecked((checked) => !checked);
|
|
1804
|
+
}, [formControl]);
|
|
1805
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: useRenderClassStatus('rls-label-switch', {
|
|
1806
|
+
disabled,
|
|
1807
|
+
extended
|
|
1808
|
+
}), "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 })] }));
|
|
1670
1809
|
}
|
|
1671
1810
|
|
|
1672
1811
|
function RlsPagination({ suggestions, count, filter, onPagination }) {
|
|
@@ -1718,7 +1857,7 @@ function RlsPagination({ suggestions, count, filter, onPagination }) {
|
|
|
1718
1857
|
refreshPagination(controller.current.goLastPage());
|
|
1719
1858
|
}
|
|
1720
1859
|
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) => {
|
|
1721
|
-
return (jsxRuntimeExports.jsx("div", { className:
|
|
1860
|
+
return (jsxRuntimeExports.jsx("div", { className: useRenderClassStatus('rls-pagination__page', {
|
|
1722
1861
|
active: page.active
|
|
1723
1862
|
}), onClick: () => {
|
|
1724
1863
|
goToPagination(page);
|
|
@@ -1952,7 +2091,7 @@ function RlsToolbar({ actions, children, subtitle }) {
|
|
|
1952
2091
|
}
|
|
1953
2092
|
|
|
1954
2093
|
function RlsCard({ children, outline, rlsTheme }) {
|
|
1955
|
-
return (jsxRuntimeExports.jsx("div", { className:
|
|
2094
|
+
return (jsxRuntimeExports.jsx("div", { className: useRenderClassStatus('rls-card', { outline }), "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-card__content", children: children }) }));
|
|
1956
2095
|
}
|
|
1957
2096
|
|
|
1958
2097
|
const reactI18n = i18n.i18n({
|
|
@@ -1985,7 +2124,7 @@ class ConfirmationResult extends commons.PartialSealed {
|
|
|
1985
2124
|
}
|
|
1986
2125
|
}
|
|
1987
2126
|
function RlsConfirmation({ approved, content, reject, rlsTheme, subtitle, title, visible }) {
|
|
1988
|
-
return (jsxRuntimeExports.jsxs("div", { className:
|
|
2127
|
+
return (jsxRuntimeExports.jsxs("div", { className: useRenderClassStatus('rls-confirmation', { visible }), "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" })] }));
|
|
1989
2128
|
}
|
|
1990
2129
|
function useConfirmationService() {
|
|
1991
2130
|
const [config, setConfig] = require$$0.useState({});
|
|
@@ -2031,170 +2170,26 @@ function RlsDatatableHeader({ children, identifier }) {
|
|
|
2031
2170
|
return (jsxRuntimeExports.jsx("tr", { id: identifier, className: "rls-datatable__header", children: children }));
|
|
2032
2171
|
}
|
|
2033
2172
|
function RlsDatatableTitle({ children, className, control, identifier }) {
|
|
2034
|
-
return (jsxRuntimeExports.jsx("th", { id: identifier, className:
|
|
2173
|
+
return (jsxRuntimeExports.jsx("th", { id: identifier, className: useRenderClassStatus('rls-datatable__title', { control }, className).trim(), children: children }));
|
|
2035
2174
|
}
|
|
2036
2175
|
function RlsDatatableRecord({ children, className, error, identifier, info, successs, warning }) {
|
|
2037
|
-
return (jsxRuntimeExports.jsx("tr", { id: identifier, className:
|
|
2176
|
+
return (jsxRuntimeExports.jsx("tr", { id: identifier, className: useRenderClassStatus('rls-datatable__record', { error, info, successs, warning }, className).trim(), children: children }));
|
|
2038
2177
|
}
|
|
2039
2178
|
function RlsDatatableTotals({ children, className, error, identifier, info, successs, warning }) {
|
|
2040
|
-
return (jsxRuntimeExports.jsx("div", { id: identifier, className:
|
|
2179
|
+
return (jsxRuntimeExports.jsx("div", { id: identifier, className: useRenderClassStatus('rls-datatable__totals', { error, info, successs, warning }, className).trim(), children: children }));
|
|
2041
2180
|
}
|
|
2042
2181
|
function RlsDatatableCell({ children, className, control, identifier, overflow }) {
|
|
2043
|
-
return (jsxRuntimeExports.jsx("th", { id: identifier, className:
|
|
2182
|
+
return (jsxRuntimeExports.jsx("th", { id: identifier, className: useRenderClassStatus('rls-datatable__cell', { control, overflow }, className).trim(), children: children }));
|
|
2044
2183
|
}
|
|
2045
2184
|
function RlsDatatableData({ children, className, control, identifier, overflow }) {
|
|
2046
|
-
return (jsxRuntimeExports.jsx("div", { id: identifier, className:
|
|
2185
|
+
return (jsxRuntimeExports.jsx("div", { id: identifier, className: useRenderClassStatus('rls-datatable__data', { control, overflow }, className).trim(), children: children }));
|
|
2047
2186
|
}
|
|
2048
2187
|
function RlsDatatable({ children, datatable, footer, header, identifier, rlsTheme, summary }) {
|
|
2049
|
-
return (jsxRuntimeExports.jsxs("div", { className:
|
|
2188
|
+
return (jsxRuntimeExports.jsxs("div", { className: useRenderClassStatus('rls-datatable', {
|
|
2050
2189
|
scrolleable: datatable?.scrolleable
|
|
2051
2190
|
}), "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("table", { id: identifier, children: [header && jsxRuntimeExports.jsx("thead", { className: "rls-datatable__thead", children: header }), jsxRuntimeExports.jsx("tbody", { ref: datatable?.tableRef, className: "rls-datatable__tbody", children: children })] }), summary && jsxRuntimeExports.jsx("div", { className: "rls-datatable__tsummary", children: summary }), footer && jsxRuntimeExports.jsx("div", { className: "rls-datatable__tfooter", children: footer })] }));
|
|
2052
2191
|
}
|
|
2053
2192
|
|
|
2054
|
-
function createObserver(options) {
|
|
2055
|
-
const { setScrolleable, table } = options;
|
|
2056
|
-
const observer = new ResizeObserver(() => {
|
|
2057
|
-
const scrollHeight = table.scrollHeight || 0;
|
|
2058
|
-
const clientHeight = table.clientHeight || 0;
|
|
2059
|
-
setScrolleable(scrollHeight > clientHeight);
|
|
2060
|
-
});
|
|
2061
|
-
observer.observe(table);
|
|
2062
|
-
return observer;
|
|
2063
|
-
}
|
|
2064
|
-
function useDatatable() {
|
|
2065
|
-
const [scrolleable, setScrolleable] = require$$0.useState(false);
|
|
2066
|
-
const tableRef = require$$0.useRef(null);
|
|
2067
|
-
require$$0.useEffect(() => {
|
|
2068
|
-
const observer = tableRef?.current &&
|
|
2069
|
-
createObserver({ setScrolleable, table: tableRef?.current });
|
|
2070
|
-
return () => {
|
|
2071
|
-
observer?.disconnect();
|
|
2072
|
-
};
|
|
2073
|
-
}, []);
|
|
2074
|
-
return { scrolleable, tableRef };
|
|
2075
|
-
}
|
|
2076
|
-
|
|
2077
|
-
function useListController(props) {
|
|
2078
|
-
const { suggestions, automatic, formControl, reference } = props;
|
|
2079
|
-
const listIsOpen = require$$0.useRef(false);
|
|
2080
|
-
const contentRef = require$$0.useRef(null);
|
|
2081
|
-
const listRef = require$$0.useRef(null);
|
|
2082
|
-
const inputRef = require$$0.useRef(null);
|
|
2083
|
-
const [state, refreshState] = require$$0.useState({
|
|
2084
|
-
focused: false,
|
|
2085
|
-
higher: false,
|
|
2086
|
-
value: '',
|
|
2087
|
-
modalIsVisible: false
|
|
2088
|
-
});
|
|
2089
|
-
const collection = require$$0.useRef(new components.ListCollection([]));
|
|
2090
|
-
const position = require$$0.useRef(0);
|
|
2091
|
-
const valueProtected = require$$0.useRef();
|
|
2092
|
-
const changeValueInternal = require$$0.useRef(false);
|
|
2093
|
-
require$$0.useEffect(() => {
|
|
2094
|
-
function onCloseSuggestions({ target }) {
|
|
2095
|
-
!contentRef?.current?.contains(target) &&
|
|
2096
|
-
refreshState((state) => ({ ...state, modalIsVisible: false }));
|
|
2097
|
-
}
|
|
2098
|
-
document.addEventListener('click', onCloseSuggestions);
|
|
2099
|
-
return () => {
|
|
2100
|
-
document.removeEventListener('click', onCloseSuggestions);
|
|
2101
|
-
};
|
|
2102
|
-
}, []);
|
|
2103
|
-
require$$0.useEffect(() => {
|
|
2104
|
-
if (!listIsOpen.current && state.modalIsVisible) {
|
|
2105
|
-
listIsOpen.current = true;
|
|
2106
|
-
}
|
|
2107
|
-
if (listIsOpen.current && !state.modalIsVisible) {
|
|
2108
|
-
formControl?.touch();
|
|
2109
|
-
}
|
|
2110
|
-
refreshState((state) => ({
|
|
2111
|
-
...state,
|
|
2112
|
-
higher: components.locationListCanTop(contentRef.current, listRef.current)
|
|
2113
|
-
}));
|
|
2114
|
-
}, [state.modalIsVisible]);
|
|
2115
|
-
require$$0.useEffect(() => {
|
|
2116
|
-
collection.current = new components.ListCollection(suggestions, reference);
|
|
2117
|
-
if (formControl?.value) {
|
|
2118
|
-
const element = collection.current.find(formControl.value);
|
|
2119
|
-
if (!element) {
|
|
2120
|
-
valueProtected.current = formControl.value;
|
|
2121
|
-
automatic
|
|
2122
|
-
? setFormValue(collection.current.value[0], true)
|
|
2123
|
-
: setFormValue(undefined);
|
|
2124
|
-
}
|
|
2125
|
-
}
|
|
2126
|
-
else if (valueProtected.current) {
|
|
2127
|
-
const element = collection.current.find(valueProtected.current);
|
|
2128
|
-
element && setFormValue(element);
|
|
2129
|
-
}
|
|
2130
|
-
else {
|
|
2131
|
-
automatic && setFormValue(collection.current.value[0], true);
|
|
2132
|
-
}
|
|
2133
|
-
}, [suggestions]);
|
|
2134
|
-
require$$0.useEffect(() => {
|
|
2135
|
-
if (!changeValueInternal.current) {
|
|
2136
|
-
if (formControl?.value) {
|
|
2137
|
-
const element = collection.current.find(formControl.value);
|
|
2138
|
-
if (!element) {
|
|
2139
|
-
valueProtected.current = formControl.value;
|
|
2140
|
-
automatic
|
|
2141
|
-
? setFormValue(collection.current.value[0], true)
|
|
2142
|
-
: setFormValue(undefined);
|
|
2143
|
-
}
|
|
2144
|
-
else {
|
|
2145
|
-
setFormValue(element);
|
|
2146
|
-
}
|
|
2147
|
-
}
|
|
2148
|
-
else {
|
|
2149
|
-
automatic && setFormValue(collection.current.value[0], true);
|
|
2150
|
-
}
|
|
2151
|
-
}
|
|
2152
|
-
changeValueInternal.current = false;
|
|
2153
|
-
}, [formControl?.value]);
|
|
2154
|
-
const setState = require$$0.useCallback((state) => {
|
|
2155
|
-
refreshState((_state) => ({ ..._state, ...state }));
|
|
2156
|
-
}, []);
|
|
2157
|
-
const setFormValue = require$$0.useCallback((element, initialValue = false) => {
|
|
2158
|
-
refreshState((_state) => ({
|
|
2159
|
-
..._state,
|
|
2160
|
-
value: element?.description ?? ''
|
|
2161
|
-
}));
|
|
2162
|
-
changeValueInternal.current = true;
|
|
2163
|
-
initialValue
|
|
2164
|
-
? formControl?.setInitialValue(element?.value)
|
|
2165
|
-
: formControl?.setValue(element?.value);
|
|
2166
|
-
}, [formControl]);
|
|
2167
|
-
const navigationInput = require$$0.useCallback((event) => {
|
|
2168
|
-
if (state.modalIsVisible) {
|
|
2169
|
-
const _position = components.navigationListFromInput({
|
|
2170
|
-
content: contentRef.current,
|
|
2171
|
-
event: event,
|
|
2172
|
-
list: listRef.current
|
|
2173
|
-
});
|
|
2174
|
-
position.current = _position ?? 0;
|
|
2175
|
-
}
|
|
2176
|
-
}, [state.modalIsVisible]);
|
|
2177
|
-
const navigationElement = require$$0.useCallback((event) => {
|
|
2178
|
-
position.current = components.navigationListFromElement({
|
|
2179
|
-
content: contentRef.current,
|
|
2180
|
-
event: event,
|
|
2181
|
-
input: inputRef.current,
|
|
2182
|
-
list: listRef.current,
|
|
2183
|
-
position: position.current
|
|
2184
|
-
});
|
|
2185
|
-
}, [state.modalIsVisible]);
|
|
2186
|
-
return {
|
|
2187
|
-
...state,
|
|
2188
|
-
contentRef,
|
|
2189
|
-
inputRef,
|
|
2190
|
-
listRef,
|
|
2191
|
-
navigationElement,
|
|
2192
|
-
navigationInput,
|
|
2193
|
-
setFormValue,
|
|
2194
|
-
setState
|
|
2195
|
-
};
|
|
2196
|
-
}
|
|
2197
|
-
|
|
2198
2193
|
const DURATION_ANIMATION$1 = 240;
|
|
2199
2194
|
const MAX_ELEMENTS = 6;
|
|
2200
2195
|
function useFieldAutocomplete(props) {
|
|
@@ -2302,13 +2297,13 @@ function RlsFieldAutocompleteTemplate(props) {
|
|
|
2302
2297
|
const autocomplete = useFieldAutocomplete(props);
|
|
2303
2298
|
const { render, children, formControl, msgErrorDisabled, onSearch, placeholder, rlsTheme, searching } = props;
|
|
2304
2299
|
const _disabled = formControl?.disabled || props.disabled;
|
|
2305
|
-
const className =
|
|
2300
|
+
const className = useRenderClassStatus('rls-field-box', {
|
|
2306
2301
|
focused: autocomplete.focused && !_disabled,
|
|
2307
2302
|
error: formControl?.wrong,
|
|
2308
2303
|
disabled: _disabled,
|
|
2309
2304
|
selected: !!autocomplete.value
|
|
2310
2305
|
}, 'rls-field-list rls-field-autocomplete');
|
|
2311
|
-
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.jsxs("div", { className:
|
|
2306
|
+
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.jsxs("div", { className: useRenderClassStatus('rls-field-list__suggestions', {
|
|
2312
2307
|
visible: autocomplete.modalIsVisible,
|
|
2313
2308
|
higher: autocomplete.higher,
|
|
2314
2309
|
hide: !autocomplete.modalIsVisible
|
|
@@ -2323,7 +2318,7 @@ function RlsFieldAutocomplete(props) {
|
|
|
2323
2318
|
}
|
|
2324
2319
|
|
|
2325
2320
|
function RlsModal({ children, overflow, visible, rlsTheme }) {
|
|
2326
|
-
return ReactDOM.createPortal(jsxRuntimeExports.jsxs("div", { className:
|
|
2321
|
+
return ReactDOM.createPortal(jsxRuntimeExports.jsxs("div", { className: useRenderClassStatus('rls-modal', { overflow, visible }), "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-modal__component", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-modal__backdrop" })] }), document.body);
|
|
2327
2322
|
}
|
|
2328
2323
|
|
|
2329
2324
|
const FORMAT_TITLE = '{dw}, {mx} {dd} de {aa}';
|
|
@@ -2379,7 +2374,7 @@ function RlsPickerDate({ automatic, date, disabled, formControl, maxDate, minDat
|
|
|
2379
2374
|
formControl?.setValue(value);
|
|
2380
2375
|
onListener && onListener({ event: components.PickerListenerEvent.Select, value });
|
|
2381
2376
|
}
|
|
2382
|
-
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:
|
|
2377
|
+
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: useRenderClassStatus('rls-picker-date__component', {
|
|
2383
2378
|
day: visibility === 'DAY',
|
|
2384
2379
|
month: visibility === 'MONTH',
|
|
2385
2380
|
year: visibility === 'YEAR'
|
|
@@ -2421,7 +2416,7 @@ function RlsFieldDate({ children, date, disabled, formControl, format, identifie
|
|
|
2421
2416
|
? dates.dateFormatTemplate(value, format || FORMAT_DATE)
|
|
2422
2417
|
: '';
|
|
2423
2418
|
const _disabled = formControl?.disabled || disabled;
|
|
2424
|
-
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-date", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className:
|
|
2419
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-date", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: useRenderClassStatus('rls-field-box', { disabled: _disabled }), 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 }) => {
|
|
2425
2420
|
event !== components.PickerListenerEvent.Cancel && onChange(value);
|
|
2426
2421
|
formControl?.touch();
|
|
2427
2422
|
setModalIsVisible(false);
|
|
@@ -2471,11 +2466,11 @@ function RlsPickerDateRange({ automatic, date: datePicker, disabled, formControl
|
|
|
2471
2466
|
formControl?.setValue(value);
|
|
2472
2467
|
onListener && onListener({ event: components.PickerListenerEvent.Select, value });
|
|
2473
2468
|
}
|
|
2474
|
-
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:
|
|
2469
|
+
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: useRenderClassStatus('rls-picker-date-range__component', {
|
|
2475
2470
|
day: visibility === 'DAY',
|
|
2476
2471
|
month: visibility === 'MONTH',
|
|
2477
2472
|
year: visibility === 'YEAR'
|
|
2478
|
-
}), 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:
|
|
2473
|
+
}), 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', {
|
|
2479
2474
|
automatic
|
|
2480
2475
|
}), 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') }) })] }) })] }));
|
|
2481
2476
|
}
|
|
@@ -2502,7 +2497,9 @@ function RlsFieldDateRange({ children, date: datePicker, disabled, formControl,
|
|
|
2502
2497
|
onValue && onValue(value);
|
|
2503
2498
|
}
|
|
2504
2499
|
const _disabled = formControl?.disabled || disabled;
|
|
2505
|
-
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-date-range", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className:
|
|
2500
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-date-range", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: useRenderClassStatus('rls-field-box', {
|
|
2501
|
+
disabled: _disabled
|
|
2502
|
+
}), 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 }) => {
|
|
2506
2503
|
event !== components.PickerListenerEvent.Cancel && onChange(value);
|
|
2507
2504
|
formControl?.touch();
|
|
2508
2505
|
setModalIsVisible(false);
|
|
@@ -2593,12 +2590,12 @@ function RlsFieldSelectTemplate(props) {
|
|
|
2593
2590
|
const select = useFieldSelect(props);
|
|
2594
2591
|
const { render, suggestions, children, formControl, msgErrorDisabled, placeholder, rlsTheme, unremovable } = props;
|
|
2595
2592
|
const _disabled = formControl?.disabled || props.disabled;
|
|
2596
|
-
const className =
|
|
2593
|
+
const className = useRenderClassStatus('rls-field-box', {
|
|
2597
2594
|
focused: select.focused && !_disabled,
|
|
2598
2595
|
error: formControl?.wrong,
|
|
2599
2596
|
disabled: _disabled
|
|
2600
2597
|
}, 'rls-field-list rls-field-select');
|
|
2601
|
-
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:
|
|
2598
|
+
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.jsxs("div", { className: useRenderClassStatus('rls-field-list__suggestions', {
|
|
2602
2599
|
visible: select.modalIsVisible,
|
|
2603
2600
|
higher: select.higher,
|
|
2604
2601
|
hide: !select.modalIsVisible
|
|
@@ -2609,7 +2606,7 @@ function RlsFieldSelect(props) {
|
|
|
2609
2606
|
}
|
|
2610
2607
|
|
|
2611
2608
|
function RlsFormNavigation({ children, visible, rlsTheme }) {
|
|
2612
|
-
return (jsxRuntimeExports.jsx("div", { className:
|
|
2609
|
+
return (jsxRuntimeExports.jsx("div", { className: useRenderClassStatus('rls-form-navigation', { visible }), "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-form-navigation__body", children: children }) }));
|
|
2613
2610
|
}
|
|
2614
2611
|
|
|
2615
2612
|
const DURATION_ANIMATION = 240;
|
|
@@ -2628,7 +2625,7 @@ function calculateDuration({ length }) {
|
|
|
2628
2625
|
return duration + DURATION_RESET;
|
|
2629
2626
|
}
|
|
2630
2627
|
function RlsSnackbar({ content, icon, title, visible, rlsTheme }) {
|
|
2631
|
-
return (jsxRuntimeExports.jsxs("div", { className:
|
|
2628
|
+
return (jsxRuntimeExports.jsxs("div", { className: useRenderClassStatus('rls-snackbar', { visible }), "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 })] })] }));
|
|
2632
2629
|
}
|
|
2633
2630
|
function useSnackbarService() {
|
|
2634
2631
|
const [config, setConfig] = require$$0.useState({});
|
|
@@ -2749,5 +2746,6 @@ exports.renderClassStatus = renderClassStatus;
|
|
|
2749
2746
|
exports.useConfirmationService = useConfirmationService;
|
|
2750
2747
|
exports.useDatatable = useDatatable;
|
|
2751
2748
|
exports.useListController = useListController;
|
|
2749
|
+
exports.useRenderClassStatus = useRenderClassStatus;
|
|
2752
2750
|
exports.useSnackbarService = useSnackbarService;
|
|
2753
2751
|
//# sourceMappingURL=index.js.map
|