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