@rolster/react-components 18.18.3 → 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 +284 -293
- 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 +285 -295
- 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.d.ts +4 -3
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js +9 -10
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js.map +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocompleteController.d.ts +5 -5
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocompleteController.js +8 -8
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocompleteController.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.d.ts +4 -3
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js +8 -9
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js.map +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelectController.d.ts +5 -5
- package/dist/esm/components/organisms/FieldSelect/FieldSelectController.js +8 -8
- package/dist/esm/components/organisms/FieldSelect/FieldSelectController.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.d.ts +4 -3
- package/dist/esm/controllers/ListController.js +48 -52
- 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/definitions.d.ts +10 -0
- package/dist/esm/definitions.js +2 -0
- package/dist/esm/definitions.js.map +1 -0
- 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 +5 -7
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');
|
|
@@ -27,8 +27,8 @@ var hasRequiredReactJsxRuntime_production_min;
|
|
|
27
27
|
function requireReactJsxRuntime_production_min () {
|
|
28
28
|
if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
|
|
29
29
|
hasRequiredReactJsxRuntime_production_min = 1;
|
|
30
|
-
var f=require$$0,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key
|
|
31
|
-
function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return {$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;
|
|
30
|
+
var f=require$$0,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:true,ref:true,__self:true,__source:true};
|
|
31
|
+
function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a) void 0===d[b]&&(d[b]=a[b]);return {$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;
|
|
32
32
|
return reactJsxRuntime_production_min;
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -758,11 +758,6 @@ function requireReactJsxRuntime_development () {
|
|
|
758
758
|
};
|
|
759
759
|
var specialPropKeyWarningShown;
|
|
760
760
|
var specialPropRefWarningShown;
|
|
761
|
-
var didWarnAboutStringRefs;
|
|
762
|
-
|
|
763
|
-
{
|
|
764
|
-
didWarnAboutStringRefs = {};
|
|
765
|
-
}
|
|
766
761
|
|
|
767
762
|
function hasValidRef(config) {
|
|
768
763
|
{
|
|
@@ -794,15 +789,7 @@ function requireReactJsxRuntime_development () {
|
|
|
794
789
|
|
|
795
790
|
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
|
796
791
|
{
|
|
797
|
-
if (typeof config.ref === 'string' && ReactCurrentOwner.current && self
|
|
798
|
-
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
799
|
-
|
|
800
|
-
if (!didWarnAboutStringRefs[componentName]) {
|
|
801
|
-
error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
|
|
802
|
-
|
|
803
|
-
didWarnAboutStringRefs[componentName] = true;
|
|
804
|
-
}
|
|
805
|
-
}
|
|
792
|
+
if (typeof config.ref === 'string' && ReactCurrentOwner.current && self) ;
|
|
806
793
|
}
|
|
807
794
|
}
|
|
808
795
|
|
|
@@ -1359,20 +1346,156 @@ var jsxRuntimeExports = jsxRuntime.exports;
|
|
|
1359
1346
|
|
|
1360
1347
|
const className = 'rls-tabular-text';
|
|
1361
1348
|
const pointers = ['.', ','];
|
|
1362
|
-
function
|
|
1349
|
+
function getCharClass(char) {
|
|
1363
1350
|
return pointers.includes(char)
|
|
1364
1351
|
? `${className}__pointer`
|
|
1365
1352
|
: `${className}__char`;
|
|
1366
1353
|
}
|
|
1367
1354
|
function RlsTabularText({ value }) {
|
|
1368
|
-
|
|
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 });
|
|
1369
1360
|
}
|
|
1370
1361
|
|
|
1371
1362
|
function RlsAmount({ value, decimals, rlsTheme, symbol }) {
|
|
1372
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 }) })] }));
|
|
1373
1364
|
}
|
|
1374
1365
|
|
|
1375
|
-
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) {
|
|
1376
1499
|
const resultClass = [base];
|
|
1377
1500
|
Object.entries(status).forEach(([name, value]) => {
|
|
1378
1501
|
if (value) {
|
|
@@ -1381,20 +1504,12 @@ function renderClassStatus(base, status = {}, aditionals) {
|
|
|
1381
1504
|
: resultClass.push(`${base}--${name}`);
|
|
1382
1505
|
}
|
|
1383
1506
|
});
|
|
1384
|
-
if (
|
|
1385
|
-
resultClass.push(
|
|
1507
|
+
if (additionals) {
|
|
1508
|
+
resultClass.push(additionals);
|
|
1386
1509
|
}
|
|
1387
1510
|
return resultClass.join(' ');
|
|
1388
1511
|
}
|
|
1389
1512
|
|
|
1390
|
-
function RlsAvatar({ children, rounded, skeleton, rlsTheme }) {
|
|
1391
|
-
return (jsxRuntimeExports.jsx("div", { className: renderClassStatus('rls-avatar', { rounded, skeleton }), "rls-theme": rlsTheme, children: children }));
|
|
1392
|
-
}
|
|
1393
|
-
|
|
1394
|
-
function RlsBadge({ children, rlsTheme }) {
|
|
1395
|
-
return (jsxRuntimeExports.jsx("div", { className: "rls-badge", "rls-theme": rlsTheme, children: children }));
|
|
1396
|
-
}
|
|
1397
|
-
|
|
1398
1513
|
const DATE_RANGE_FORMAT = '{dd}/{mx}/{aa}';
|
|
1399
1514
|
|
|
1400
1515
|
function rangeFormatTemplate({ maxDate, minDate }) {
|
|
@@ -1403,18 +1518,34 @@ function rangeFormatTemplate({ maxDate, minDate }) {
|
|
|
1403
1518
|
return `${minFormat} - ${maxFormat}`;
|
|
1404
1519
|
}
|
|
1405
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
|
+
|
|
1406
1537
|
function RlsBreadcrumb({ labels }) {
|
|
1407
|
-
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:
|
|
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: useRenderClassStatus('rls-breadcrumb__label__a', {
|
|
1408
1539
|
actionable: !!onClick
|
|
1409
1540
|
}), children: label }) }, index))) }));
|
|
1410
1541
|
}
|
|
1411
1542
|
|
|
1412
1543
|
function RlsIcon({ value, skeleton }) {
|
|
1413
|
-
return (jsxRuntimeExports.jsx("div", { className:
|
|
1544
|
+
return (jsxRuntimeExports.jsx("div", { className: useRenderClassStatus('rls-icon', { skeleton }), children: jsxRuntimeExports.jsx("i", { className: `rls-icon-${value}` }) }));
|
|
1414
1545
|
}
|
|
1415
1546
|
|
|
1416
1547
|
function RlsButton({ type, children, disabled, identifier, prefixIcon, suffixIcon, rlsTheme, onClick }) {
|
|
1417
|
-
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 })] }) }));
|
|
1418
1549
|
}
|
|
1419
1550
|
|
|
1420
1551
|
function RlsButtonAction({ icon, disabled, identifier, onClick, tooltip }) {
|
|
@@ -1422,7 +1553,7 @@ function RlsButtonAction({ icon, disabled, identifier, onClick, tooltip }) {
|
|
|
1422
1553
|
}
|
|
1423
1554
|
|
|
1424
1555
|
function RlsCheckBox({ checked, disabled, identifier, onClick, rlsTheme }) {
|
|
1425
|
-
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" }) }));
|
|
1426
1557
|
}
|
|
1427
1558
|
function RlsCheckBoxControl({ formControl, disabled, identifier, rlsTheme }) {
|
|
1428
1559
|
return (jsxRuntimeExports.jsx(RlsCheckBox, { identifier: identifier, checked: !!formControl.value, disabled: disabled, onClick: () => {
|
|
@@ -1432,22 +1563,20 @@ function RlsCheckBoxControl({ formControl, disabled, identifier, rlsTheme }) {
|
|
|
1432
1563
|
|
|
1433
1564
|
function RlsInput({ children, disabled, formControl, identifier, onValue, placeholder, type, value }) {
|
|
1434
1565
|
const [focused, setFocused] = require$$0.useState(false);
|
|
1435
|
-
|
|
1436
|
-
|
|
1566
|
+
const onChange = require$$0.useCallback((event) => {
|
|
1567
|
+
const value = type === 'number' ? +event.target.value : event.target.value;
|
|
1437
1568
|
onValue && onValue(value);
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
}
|
|
1442
|
-
function onFocus() {
|
|
1569
|
+
formControl?.setValue(value);
|
|
1570
|
+
}, [formControl, onValue]);
|
|
1571
|
+
const onFocus = require$$0.useCallback(() => {
|
|
1443
1572
|
formControl?.focus();
|
|
1444
|
-
setFocused(true);
|
|
1445
|
-
}
|
|
1446
|
-
|
|
1573
|
+
setFocused(() => true);
|
|
1574
|
+
}, [formControl]);
|
|
1575
|
+
const onBlur = require$$0.useCallback(() => {
|
|
1447
1576
|
formControl?.blur();
|
|
1448
|
-
setFocused(false);
|
|
1449
|
-
}
|
|
1450
|
-
return (jsxRuntimeExports.jsxs("div", { id: identifier, className:
|
|
1577
|
+
setFocused(() => false);
|
|
1578
|
+
}, [formControl]);
|
|
1579
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: useRenderClassStatus('rls-input', {
|
|
1451
1580
|
focused: formControl?.focused ?? focused,
|
|
1452
1581
|
disabled: formControl?.disabled || disabled
|
|
1453
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 })] }));
|
|
@@ -1455,36 +1584,36 @@ function RlsInput({ children, disabled, formControl, identifier, onValue, placeh
|
|
|
1455
1584
|
|
|
1456
1585
|
function RlsInputMoney({ decimals, disabled, formControl, identifier, onValue, placeholder, symbol, value }) {
|
|
1457
1586
|
const [valueInput, setValueInput] = require$$0.useState(value || 0);
|
|
1458
|
-
|
|
1587
|
+
const onValueInput = require$$0.useCallback((value) => {
|
|
1459
1588
|
!formControl && setValueInput(value);
|
|
1460
1589
|
onValue && onValue(value);
|
|
1461
|
-
}
|
|
1590
|
+
}, [formControl, onValue]);
|
|
1462
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 }) }) }));
|
|
1463
1592
|
}
|
|
1464
1593
|
|
|
1465
1594
|
function RlsInputNumber({ disabled, formControl, identifier, onValue, placeholder, value }) {
|
|
1466
1595
|
const [valueInput, setValueInput] = require$$0.useState(value ?? 0);
|
|
1467
|
-
|
|
1596
|
+
const onValueInput = require$$0.useCallback((value) => {
|
|
1468
1597
|
!formControl && setValueInput(value);
|
|
1469
1598
|
onValue && onValue(value);
|
|
1470
|
-
}
|
|
1599
|
+
}, [formControl, onValue]);
|
|
1471
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 }) }));
|
|
1472
1601
|
}
|
|
1473
1602
|
|
|
1474
1603
|
function RlsInputPassword({ disabled, formControl, identifier, onValue, placeholder, type }) {
|
|
1475
1604
|
const [focused, setFocused] = require$$0.useState(false);
|
|
1476
|
-
|
|
1605
|
+
const onChange = require$$0.useCallback((event) => {
|
|
1477
1606
|
formControl?.setValue(event.target.value);
|
|
1478
1607
|
onValue && onValue(event.target.value);
|
|
1479
|
-
}
|
|
1480
|
-
|
|
1608
|
+
}, [formControl, onValue]);
|
|
1609
|
+
const onFocus = require$$0.useCallback(() => {
|
|
1481
1610
|
formControl?.focus();
|
|
1482
|
-
setFocused(true);
|
|
1483
|
-
}
|
|
1484
|
-
|
|
1611
|
+
setFocused(() => true);
|
|
1612
|
+
}, [formControl]);
|
|
1613
|
+
const onBlur = require$$0.useCallback(() => {
|
|
1485
1614
|
formControl?.blur();
|
|
1486
|
-
setFocused(false);
|
|
1487
|
-
}
|
|
1615
|
+
setFocused(() => false);
|
|
1616
|
+
}, [formControl]);
|
|
1488
1617
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: renderClassStatus('rls-input-password', {
|
|
1489
1618
|
focused: formControl?.focused ?? focused,
|
|
1490
1619
|
disabled: formControl?.disabled || disabled
|
|
@@ -1493,18 +1622,18 @@ function RlsInputPassword({ disabled, formControl, identifier, onValue, placehol
|
|
|
1493
1622
|
|
|
1494
1623
|
function RlsInputSearch({ formControl, identifier, onSearch, placeholder }) {
|
|
1495
1624
|
const [value, setValue] = require$$0.useState('');
|
|
1496
|
-
|
|
1497
|
-
!formControl && setValue(value);
|
|
1498
|
-
}
|
|
1499
|
-
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 })] }));
|
|
1500
1629
|
}
|
|
1501
1630
|
|
|
1502
1631
|
function RlsInputText({ disabled, formControl, identifier, onValue, placeholder, value }) {
|
|
1503
1632
|
const [valueInput, setValueInput] = require$$0.useState(value ?? '');
|
|
1504
|
-
|
|
1633
|
+
const onValueInput = require$$0.useCallback((value) => {
|
|
1505
1634
|
!formControl && setValueInput(value);
|
|
1506
1635
|
onValue && onValue(value);
|
|
1507
|
-
}
|
|
1636
|
+
}, [formControl, onValue]);
|
|
1508
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 }) }));
|
|
1509
1638
|
}
|
|
1510
1639
|
|
|
@@ -1517,11 +1646,11 @@ function RlsMessageIcon({ icon, children, rlsTheme }) {
|
|
|
1517
1646
|
}
|
|
1518
1647
|
|
|
1519
1648
|
function RlsPoster({ children, contrast, outline, rlsTheme }) {
|
|
1520
|
-
return (jsxRuntimeExports.jsx("div", { className:
|
|
1649
|
+
return (jsxRuntimeExports.jsx("div", { className: useRenderClassStatus('rls-poster', { contrast, outline }), "rls-theme": rlsTheme, children: children }));
|
|
1521
1650
|
}
|
|
1522
1651
|
|
|
1523
1652
|
function RlsProgressBar({ indeterminate, percentage, rlsTheme }) {
|
|
1524
|
-
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}%` } }) }));
|
|
1525
1654
|
}
|
|
1526
1655
|
|
|
1527
1656
|
function RlsProgressCircular({ rlsTheme }) {
|
|
@@ -1529,7 +1658,7 @@ function RlsProgressCircular({ rlsTheme }) {
|
|
|
1529
1658
|
}
|
|
1530
1659
|
|
|
1531
1660
|
function RlsRadioButton({ checked, disabled, identifier, rlsTheme, onClick }) {
|
|
1532
|
-
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" }) }));
|
|
1533
1662
|
}
|
|
1534
1663
|
|
|
1535
1664
|
function RlsSkeleton({ rlsTheme }) {
|
|
@@ -1541,7 +1670,7 @@ function RlsSkeletonText({ active, children, rlsTheme }) {
|
|
|
1541
1670
|
}
|
|
1542
1671
|
|
|
1543
1672
|
function RlsSwitch({ checked, disabled, identifier, onClick, rlsTheme }) {
|
|
1544
|
-
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" })] }) }));
|
|
1545
1674
|
}
|
|
1546
1675
|
function RlsSwitchControl({ formControl, disabled, identifier, rlsTheme }) {
|
|
1547
1676
|
return (jsxRuntimeExports.jsx(RlsSwitch, { identifier: identifier, checked: formControl.value || false, disabled: disabled, onClick: () => {
|
|
@@ -1550,11 +1679,11 @@ function RlsSwitchControl({ formControl, disabled, identifier, rlsTheme }) {
|
|
|
1550
1679
|
}
|
|
1551
1680
|
|
|
1552
1681
|
function RlsBallot({ bordered, children, img, initials, skeleton, subtitle, rlsTheme }) {
|
|
1553
|
-
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 }) }) }))] })] }));
|
|
1554
1683
|
}
|
|
1555
1684
|
|
|
1556
1685
|
function RlsButtonProgress({ icon, disabled, onClick, progressing, rlsTheme }) {
|
|
1557
|
-
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, {})] }));
|
|
1558
1687
|
}
|
|
1559
1688
|
|
|
1560
1689
|
function RlsButtonToggle({ onAction, options, type, automatic, disabled, rlsTheme }) {
|
|
@@ -1571,17 +1700,17 @@ function RlsButtonToggle({ onAction, options, type, automatic, disabled, rlsThem
|
|
|
1571
1700
|
document.removeEventListener('click', onCloseMenu);
|
|
1572
1701
|
};
|
|
1573
1702
|
}, []);
|
|
1574
|
-
|
|
1575
|
-
setVisible((
|
|
1576
|
-
}
|
|
1577
|
-
|
|
1578
|
-
setAction(action);
|
|
1579
|
-
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);
|
|
1580
1709
|
automatic && onAction(action.value);
|
|
1581
|
-
}
|
|
1710
|
+
}, [onAction, automatic]);
|
|
1582
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: () => {
|
|
1583
1712
|
onAction(action.value);
|
|
1584
|
-
}, 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', {
|
|
1585
1714
|
visible,
|
|
1586
1715
|
hide: !visible
|
|
1587
1716
|
}), children: jsxRuntimeExports.jsx("ul", { children: options.map((action, index) => (jsxRuntimeExports.jsx("li", { className: "truncate", onClick: () => {
|
|
@@ -1595,7 +1724,7 @@ function RlsMessageFormError({ className, formControl }) {
|
|
|
1595
1724
|
|
|
1596
1725
|
function RlsFieldMoney({ children, decimals, disabled, formControl, identifier, msgErrorDisabled, onValue, placeholder, symbol, rlsTheme, value }) {
|
|
1597
1726
|
const _disabled = formControl?.disabled || disabled;
|
|
1598
|
-
return (jsxRuntimeExports.jsxs("div", { id: identifier, className:
|
|
1727
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: useRenderClassStatus('rls-field-box', {
|
|
1599
1728
|
focused: formControl?.focused && !_disabled,
|
|
1600
1729
|
error: formControl?.wrong,
|
|
1601
1730
|
disabled: _disabled
|
|
@@ -1604,7 +1733,7 @@ function RlsFieldMoney({ children, decimals, disabled, formControl, identifier,
|
|
|
1604
1733
|
|
|
1605
1734
|
function RlsFieldNumber({ children, disabled, formControl, identifier, msgErrorDisabled, onValue, placeholder, rlsTheme, value }) {
|
|
1606
1735
|
const _disabled = formControl?.disabled || disabled;
|
|
1607
|
-
return (jsxRuntimeExports.jsxs("div", { id: identifier, className:
|
|
1736
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: useRenderClassStatus('rls-field-box', {
|
|
1608
1737
|
focused: formControl?.focused && !_disabled,
|
|
1609
1738
|
error: formControl?.wrong,
|
|
1610
1739
|
disabled: _disabled
|
|
@@ -1613,11 +1742,11 @@ function RlsFieldNumber({ children, disabled, formControl, identifier, msgErrorD
|
|
|
1613
1742
|
|
|
1614
1743
|
function RlsFieldPassword({ children, disabled, formControl, identifier, msgErrorDisabled, placeholder, rlsTheme }) {
|
|
1615
1744
|
const [password, setPassword] = require$$0.useState(true);
|
|
1616
|
-
|
|
1617
|
-
setPassword(!password);
|
|
1618
|
-
}
|
|
1745
|
+
const onToggleInput = require$$0.useCallback(() => {
|
|
1746
|
+
setPassword((password) => !password);
|
|
1747
|
+
}, []);
|
|
1619
1748
|
const _disabled = formControl?.disabled || disabled;
|
|
1620
|
-
return (jsxRuntimeExports.jsxs("div", { id: identifier, className:
|
|
1749
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: useRenderClassStatus(' rls-field-box', {
|
|
1621
1750
|
focused: formControl?.focused && !_disabled,
|
|
1622
1751
|
error: formControl?.wrong,
|
|
1623
1752
|
disabled: _disabled
|
|
@@ -1626,7 +1755,7 @@ function RlsFieldPassword({ children, disabled, formControl, identifier, msgErro
|
|
|
1626
1755
|
|
|
1627
1756
|
function RlsFieldText({ children, disabled, formControl, identifier, msgErrorDisabled, onValue, placeholder, rlsTheme, value }) {
|
|
1628
1757
|
const _disabled = formControl?.disabled || disabled;
|
|
1629
|
-
return (jsxRuntimeExports.jsxs("div", { id: identifier, className:
|
|
1758
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: useRenderClassStatus('rls-field-box', {
|
|
1630
1759
|
focused: formControl?.focused && !_disabled,
|
|
1631
1760
|
error: formControl?.wrong,
|
|
1632
1761
|
disabled: _disabled
|
|
@@ -1638,15 +1767,12 @@ function RlsLabelCheckBox({ children, disabled, extended, identifier, formContro
|
|
|
1638
1767
|
require$$0.useEffect(() => {
|
|
1639
1768
|
setChecked(!!formControl?.value);
|
|
1640
1769
|
}, [formControl?.value]);
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
formControl?.setValue(!formControl.value)
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
}
|
|
1648
|
-
}
|
|
1649
|
-
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', {
|
|
1650
1776
|
disabled,
|
|
1651
1777
|
extended
|
|
1652
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 })] }));
|
|
@@ -1657,10 +1783,10 @@ function RlsLabelRadioButton({ children, disabled, extended, identifier, formCon
|
|
|
1657
1783
|
require$$0.useEffect(() => {
|
|
1658
1784
|
setChecked(formControl?.value === value);
|
|
1659
1785
|
}, [formControl?.value]);
|
|
1660
|
-
|
|
1786
|
+
const onSelect = require$$0.useCallback(() => {
|
|
1661
1787
|
formControl && formControl?.setValue(value);
|
|
1662
|
-
}
|
|
1663
|
-
return (jsxRuntimeExports.jsxs("div", { id: identifier, className:
|
|
1788
|
+
}, [formControl, value]);
|
|
1789
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: useRenderClassStatus('rls-label-radiobutton', {
|
|
1664
1790
|
disabled,
|
|
1665
1791
|
extended
|
|
1666
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 })] }));
|
|
@@ -1671,15 +1797,15 @@ function RlsLabelSwitch({ children, disabled, extended, identifier, formControl,
|
|
|
1671
1797
|
require$$0.useEffect(() => {
|
|
1672
1798
|
setChecked(!!formControl?.value);
|
|
1673
1799
|
}, [formControl?.value]);
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
formControl?.setValue(!formControl.value)
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
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 })] }));
|
|
1683
1809
|
}
|
|
1684
1810
|
|
|
1685
1811
|
function RlsPagination({ suggestions, count, filter, onPagination }) {
|
|
@@ -1731,7 +1857,7 @@ function RlsPagination({ suggestions, count, filter, onPagination }) {
|
|
|
1731
1857
|
refreshPagination(controller.current.goLastPage());
|
|
1732
1858
|
}
|
|
1733
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) => {
|
|
1734
|
-
return (jsxRuntimeExports.jsx("div", { className:
|
|
1860
|
+
return (jsxRuntimeExports.jsx("div", { className: useRenderClassStatus('rls-pagination__page', {
|
|
1735
1861
|
active: page.active
|
|
1736
1862
|
}), onClick: () => {
|
|
1737
1863
|
goToPagination(page);
|
|
@@ -1965,7 +2091,7 @@ function RlsToolbar({ actions, children, subtitle }) {
|
|
|
1965
2091
|
}
|
|
1966
2092
|
|
|
1967
2093
|
function RlsCard({ children, outline, rlsTheme }) {
|
|
1968
|
-
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 }) }));
|
|
1969
2095
|
}
|
|
1970
2096
|
|
|
1971
2097
|
const reactI18n = i18n.i18n({
|
|
@@ -1998,7 +2124,7 @@ class ConfirmationResult extends commons.PartialSealed {
|
|
|
1998
2124
|
}
|
|
1999
2125
|
}
|
|
2000
2126
|
function RlsConfirmation({ approved, content, reject, rlsTheme, subtitle, title, visible }) {
|
|
2001
|
-
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" })] }));
|
|
2002
2128
|
}
|
|
2003
2129
|
function useConfirmationService() {
|
|
2004
2130
|
const [config, setConfig] = require$$0.useState({});
|
|
@@ -2044,162 +2170,26 @@ function RlsDatatableHeader({ children, identifier }) {
|
|
|
2044
2170
|
return (jsxRuntimeExports.jsx("tr", { id: identifier, className: "rls-datatable__header", children: children }));
|
|
2045
2171
|
}
|
|
2046
2172
|
function RlsDatatableTitle({ children, className, control, identifier }) {
|
|
2047
|
-
return (jsxRuntimeExports.jsx("th", { id: identifier, className:
|
|
2173
|
+
return (jsxRuntimeExports.jsx("th", { id: identifier, className: useRenderClassStatus('rls-datatable__title', { control }, className).trim(), children: children }));
|
|
2048
2174
|
}
|
|
2049
2175
|
function RlsDatatableRecord({ children, className, error, identifier, info, successs, warning }) {
|
|
2050
|
-
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 }));
|
|
2051
2177
|
}
|
|
2052
2178
|
function RlsDatatableTotals({ children, className, error, identifier, info, successs, warning }) {
|
|
2053
|
-
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 }));
|
|
2054
2180
|
}
|
|
2055
2181
|
function RlsDatatableCell({ children, className, control, identifier, overflow }) {
|
|
2056
|
-
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 }));
|
|
2057
2183
|
}
|
|
2058
2184
|
function RlsDatatableData({ children, className, control, identifier, overflow }) {
|
|
2059
|
-
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 }));
|
|
2060
2186
|
}
|
|
2061
2187
|
function RlsDatatable({ children, datatable, footer, header, identifier, rlsTheme, summary }) {
|
|
2062
|
-
return (jsxRuntimeExports.jsxs("div", { className:
|
|
2188
|
+
return (jsxRuntimeExports.jsxs("div", { className: useRenderClassStatus('rls-datatable', {
|
|
2063
2189
|
scrolleable: datatable?.scrolleable
|
|
2064
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 })] }));
|
|
2065
2191
|
}
|
|
2066
2192
|
|
|
2067
|
-
function createObserver(options) {
|
|
2068
|
-
const { setScrolleable, table } = options;
|
|
2069
|
-
const observer = new ResizeObserver(() => {
|
|
2070
|
-
const scrollHeight = table.scrollHeight || 0;
|
|
2071
|
-
const clientHeight = table.clientHeight || 0;
|
|
2072
|
-
setScrolleable(scrollHeight > clientHeight);
|
|
2073
|
-
});
|
|
2074
|
-
observer.observe(table);
|
|
2075
|
-
return observer;
|
|
2076
|
-
}
|
|
2077
|
-
function useDatatable() {
|
|
2078
|
-
const [scrolleable, setScrolleable] = require$$0.useState(false);
|
|
2079
|
-
const tableRef = require$$0.useRef(null);
|
|
2080
|
-
require$$0.useEffect(() => {
|
|
2081
|
-
const observer = tableRef?.current &&
|
|
2082
|
-
createObserver({ setScrolleable, table: tableRef?.current });
|
|
2083
|
-
return () => {
|
|
2084
|
-
observer?.disconnect();
|
|
2085
|
-
};
|
|
2086
|
-
}, []);
|
|
2087
|
-
return { scrolleable, tableRef };
|
|
2088
|
-
}
|
|
2089
|
-
|
|
2090
|
-
function useListController(props) {
|
|
2091
|
-
const { suggestions, automatic, formControl, value } = props;
|
|
2092
|
-
const listIsOpen = require$$0.useRef(false);
|
|
2093
|
-
const contentRef = require$$0.useRef(null);
|
|
2094
|
-
const listRef = require$$0.useRef(null);
|
|
2095
|
-
const inputRef = require$$0.useRef(null);
|
|
2096
|
-
const [state, setState] = require$$0.useState({
|
|
2097
|
-
focused: false,
|
|
2098
|
-
higher: false,
|
|
2099
|
-
value: '',
|
|
2100
|
-
modalIsVisible: false
|
|
2101
|
-
});
|
|
2102
|
-
const collection = require$$0.useRef(new components.ListCollection([]));
|
|
2103
|
-
const position = require$$0.useRef(0);
|
|
2104
|
-
const _protected = require$$0.useRef();
|
|
2105
|
-
require$$0.useEffect(() => {
|
|
2106
|
-
function onCloseSuggestions({ target }) {
|
|
2107
|
-
!contentRef?.current?.contains(target) &&
|
|
2108
|
-
setState((state) => ({ ...state, modalIsVisible: false }));
|
|
2109
|
-
}
|
|
2110
|
-
document.addEventListener('click', onCloseSuggestions);
|
|
2111
|
-
return () => {
|
|
2112
|
-
document.removeEventListener('click', onCloseSuggestions);
|
|
2113
|
-
};
|
|
2114
|
-
}, []);
|
|
2115
|
-
require$$0.useEffect(() => {
|
|
2116
|
-
if (!listIsOpen.current && state.modalIsVisible) {
|
|
2117
|
-
listIsOpen.current = true;
|
|
2118
|
-
}
|
|
2119
|
-
if (listIsOpen.current && !state.modalIsVisible) {
|
|
2120
|
-
formControl?.touch();
|
|
2121
|
-
}
|
|
2122
|
-
setState((state) => ({
|
|
2123
|
-
...state,
|
|
2124
|
-
higher: components.locationListCanTop(contentRef.current, listRef.current)
|
|
2125
|
-
}));
|
|
2126
|
-
}, [state.modalIsVisible]);
|
|
2127
|
-
require$$0.useEffect(() => {
|
|
2128
|
-
collection.current = new components.ListCollection(suggestions);
|
|
2129
|
-
refresh(collection.current, formControl?.value, automatic);
|
|
2130
|
-
}, [suggestions]);
|
|
2131
|
-
require$$0.useEffect(() => {
|
|
2132
|
-
refresh(collection.current, formControl?.value);
|
|
2133
|
-
}, [formControl?.value]);
|
|
2134
|
-
function refresh(collection, state, automatic) {
|
|
2135
|
-
if (!state) {
|
|
2136
|
-
!refreshWithProtected(collection, automatic) &&
|
|
2137
|
-
refreshState({ value: '' });
|
|
2138
|
-
return undefined;
|
|
2139
|
-
}
|
|
2140
|
-
const element = collection.find(state);
|
|
2141
|
-
if (element) {
|
|
2142
|
-
_protected.current = undefined;
|
|
2143
|
-
return refreshState({ value: element.description });
|
|
2144
|
-
}
|
|
2145
|
-
if (!refreshWithProtected(collection, automatic)) {
|
|
2146
|
-
_protected.current = state;
|
|
2147
|
-
setFormValue(value);
|
|
2148
|
-
refreshState({ value: '' });
|
|
2149
|
-
}
|
|
2150
|
-
}
|
|
2151
|
-
function refreshWithProtected(collection, automatic) {
|
|
2152
|
-
if (automatic && collection.value[0]) {
|
|
2153
|
-
formControl?.setInitialValue(collection.value[0].value);
|
|
2154
|
-
return true;
|
|
2155
|
-
}
|
|
2156
|
-
if (_protected.current) {
|
|
2157
|
-
const element = collection.find(_protected.current);
|
|
2158
|
-
if (element) {
|
|
2159
|
-
formControl?.setValue(_protected.current);
|
|
2160
|
-
_protected.current = undefined;
|
|
2161
|
-
return true;
|
|
2162
|
-
}
|
|
2163
|
-
}
|
|
2164
|
-
return false;
|
|
2165
|
-
}
|
|
2166
|
-
function refreshState(state) {
|
|
2167
|
-
setState((currentState) => ({ ...currentState, ...state }));
|
|
2168
|
-
}
|
|
2169
|
-
const setFormValue = require$$0.useCallback((value) => {
|
|
2170
|
-
formControl?.setValue(value);
|
|
2171
|
-
}, [formControl]);
|
|
2172
|
-
function navigationInput(event) {
|
|
2173
|
-
if (state.modalIsVisible) {
|
|
2174
|
-
const newPosition = components.navigationListFromInput({
|
|
2175
|
-
content: contentRef.current,
|
|
2176
|
-
event: event,
|
|
2177
|
-
list: listRef.current
|
|
2178
|
-
});
|
|
2179
|
-
position.current = newPosition ?? 0;
|
|
2180
|
-
}
|
|
2181
|
-
}
|
|
2182
|
-
function navigationElement(event) {
|
|
2183
|
-
position.current = components.navigationListFromElement({
|
|
2184
|
-
content: contentRef.current,
|
|
2185
|
-
event: event,
|
|
2186
|
-
input: inputRef.current,
|
|
2187
|
-
list: listRef.current,
|
|
2188
|
-
position: position.current
|
|
2189
|
-
});
|
|
2190
|
-
}
|
|
2191
|
-
return {
|
|
2192
|
-
...state,
|
|
2193
|
-
contentRef,
|
|
2194
|
-
inputRef,
|
|
2195
|
-
listRef,
|
|
2196
|
-
navigationElement,
|
|
2197
|
-
navigationInput,
|
|
2198
|
-
setFormValue,
|
|
2199
|
-
setState: refreshState
|
|
2200
|
-
};
|
|
2201
|
-
}
|
|
2202
|
-
|
|
2203
2193
|
const DURATION_ANIMATION$1 = 240;
|
|
2204
2194
|
const MAX_ELEMENTS = 6;
|
|
2205
2195
|
function useFieldAutocomplete(props) {
|
|
@@ -2242,8 +2232,8 @@ function useFieldAutocomplete(props) {
|
|
|
2242
2232
|
}
|
|
2243
2233
|
function onClickAction() {
|
|
2244
2234
|
if (controller.value) {
|
|
2245
|
-
controller.setState({ modalIsVisible: false
|
|
2246
|
-
controller.setFormValue(
|
|
2235
|
+
controller.setState({ modalIsVisible: false });
|
|
2236
|
+
controller.setFormValue(undefined);
|
|
2247
2237
|
props.onValue && props.onValue(props.value);
|
|
2248
2238
|
}
|
|
2249
2239
|
else {
|
|
@@ -2265,17 +2255,17 @@ function useFieldAutocomplete(props) {
|
|
|
2265
2255
|
: controller.navigationElement(event);
|
|
2266
2256
|
};
|
|
2267
2257
|
}
|
|
2268
|
-
function onChange(
|
|
2258
|
+
function onChange(element) {
|
|
2269
2259
|
const { onSelect, onValue } = props;
|
|
2270
2260
|
if (onSelect) {
|
|
2271
2261
|
controller.setState({ modalIsVisible: false });
|
|
2272
|
-
value && onSelect(value);
|
|
2262
|
+
element.value && onSelect(element.value);
|
|
2273
2263
|
}
|
|
2274
2264
|
else {
|
|
2275
|
-
controller.setState({ modalIsVisible: false
|
|
2276
|
-
controller.setFormValue(
|
|
2265
|
+
controller.setState({ modalIsVisible: false });
|
|
2266
|
+
controller.setFormValue(element);
|
|
2277
2267
|
}
|
|
2278
|
-
onValue && onValue(value);
|
|
2268
|
+
onValue && onValue(element.value);
|
|
2279
2269
|
}
|
|
2280
2270
|
function refreshCoincidences(pattern, reboot = false) {
|
|
2281
2271
|
const { collection, store } = components.createAutocompleteStore({
|
|
@@ -2288,8 +2278,8 @@ function useFieldAutocomplete(props) {
|
|
|
2288
2278
|
setCoincidences(collection.slice(0, MAX_ELEMENTS));
|
|
2289
2279
|
}
|
|
2290
2280
|
return {
|
|
2281
|
+
...controller,
|
|
2291
2282
|
coincidences,
|
|
2292
|
-
controller,
|
|
2293
2283
|
onBlurInput,
|
|
2294
2284
|
onClickAction,
|
|
2295
2285
|
onClickBackdrop,
|
|
@@ -2305,20 +2295,19 @@ function useFieldAutocomplete(props) {
|
|
|
2305
2295
|
|
|
2306
2296
|
function RlsFieldAutocompleteTemplate(props) {
|
|
2307
2297
|
const autocomplete = useFieldAutocomplete(props);
|
|
2308
|
-
const { controller } = autocomplete;
|
|
2309
2298
|
const { render, children, formControl, msgErrorDisabled, onSearch, placeholder, rlsTheme, searching } = props;
|
|
2310
2299
|
const _disabled = formControl?.disabled || props.disabled;
|
|
2311
|
-
const className =
|
|
2312
|
-
focused:
|
|
2300
|
+
const className = useRenderClassStatus('rls-field-box', {
|
|
2301
|
+
focused: autocomplete.focused && !_disabled,
|
|
2313
2302
|
error: formControl?.wrong,
|
|
2314
2303
|
disabled: _disabled,
|
|
2315
|
-
selected: !!
|
|
2304
|
+
selected: !!autocomplete.value
|
|
2316
2305
|
}, 'rls-field-list rls-field-autocomplete');
|
|
2317
|
-
return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref:
|
|
2318
|
-
visible:
|
|
2319
|
-
higher:
|
|
2320
|
-
hide: !
|
|
2321
|
-
}), children: [jsxRuntimeExports.jsx("div", { className: "rls-field-list__suggestions__body", children: jsxRuntimeExports.jsxs("ul", { ref:
|
|
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', {
|
|
2307
|
+
visible: autocomplete.modalIsVisible,
|
|
2308
|
+
higher: autocomplete.higher,
|
|
2309
|
+
hide: !autocomplete.modalIsVisible
|
|
2310
|
+
}), children: [jsxRuntimeExports.jsx("div", { className: "rls-field-list__suggestions__body", children: jsxRuntimeExports.jsxs("ul", { ref: autocomplete.listRef, className: "rls-field-list__ul", children: [jsxRuntimeExports.jsxs("div", { className: "rls-field-list__ul__search", children: [jsxRuntimeExports.jsx("input", { ref: autocomplete.inputRef, className: "rls-field-list__ul__control", type: "text", placeholder: reactI18n('listInputPlaceholder'), value: autocomplete.pattern, onChange: (event) => {
|
|
2322
2311
|
autocomplete.setPattern(event.target.value);
|
|
2323
2312
|
}, disabled: _disabled || searching, onFocus: autocomplete.onFocusInput, onBlur: autocomplete.onBlurInput, onKeyDown: autocomplete.onKeydownInput }), onSearch && (jsxRuntimeExports.jsx("button", { disabled: _disabled || searching, onClick: () => {
|
|
2324
2313
|
onSearch(autocomplete.pattern);
|
|
@@ -2329,7 +2318,7 @@ function RlsFieldAutocomplete(props) {
|
|
|
2329
2318
|
}
|
|
2330
2319
|
|
|
2331
2320
|
function RlsModal({ children, overflow, visible, rlsTheme }) {
|
|
2332
|
-
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);
|
|
2333
2322
|
}
|
|
2334
2323
|
|
|
2335
2324
|
const FORMAT_TITLE = '{dw}, {mx} {dd} de {aa}';
|
|
@@ -2385,7 +2374,7 @@ function RlsPickerDate({ automatic, date, disabled, formControl, maxDate, minDat
|
|
|
2385
2374
|
formControl?.setValue(value);
|
|
2386
2375
|
onListener && onListener({ event: components.PickerListenerEvent.Select, value });
|
|
2387
2376
|
}
|
|
2388
|
-
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', {
|
|
2389
2378
|
day: visibility === 'DAY',
|
|
2390
2379
|
month: visibility === 'MONTH',
|
|
2391
2380
|
year: visibility === 'YEAR'
|
|
@@ -2427,7 +2416,7 @@ function RlsFieldDate({ children, date, disabled, formControl, format, identifie
|
|
|
2427
2416
|
? dates.dateFormatTemplate(value, format || FORMAT_DATE)
|
|
2428
2417
|
: '';
|
|
2429
2418
|
const _disabled = formControl?.disabled || disabled;
|
|
2430
|
-
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 }) => {
|
|
2431
2420
|
event !== components.PickerListenerEvent.Cancel && onChange(value);
|
|
2432
2421
|
formControl?.touch();
|
|
2433
2422
|
setModalIsVisible(false);
|
|
@@ -2477,11 +2466,11 @@ function RlsPickerDateRange({ automatic, date: datePicker, disabled, formControl
|
|
|
2477
2466
|
formControl?.setValue(value);
|
|
2478
2467
|
onListener && onListener({ event: components.PickerListenerEvent.Select, value });
|
|
2479
2468
|
}
|
|
2480
|
-
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', {
|
|
2481
2470
|
day: visibility === 'DAY',
|
|
2482
2471
|
month: visibility === 'MONTH',
|
|
2483
2472
|
year: visibility === 'YEAR'
|
|
2484
|
-
}), 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', {
|
|
2485
2474
|
automatic
|
|
2486
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') }) })] }) })] }));
|
|
2487
2476
|
}
|
|
@@ -2508,7 +2497,9 @@ function RlsFieldDateRange({ children, date: datePicker, disabled, formControl,
|
|
|
2508
2497
|
onValue && onValue(value);
|
|
2509
2498
|
}
|
|
2510
2499
|
const _disabled = formControl?.disabled || disabled;
|
|
2511
|
-
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 }) => {
|
|
2512
2503
|
event !== components.PickerListenerEvent.Cancel && onChange(value);
|
|
2513
2504
|
formControl?.touch();
|
|
2514
2505
|
setModalIsVisible(false);
|
|
@@ -2544,8 +2535,8 @@ function useFieldSelect(props) {
|
|
|
2544
2535
|
function onClickAction() {
|
|
2545
2536
|
const removable = !props.unremovable && !!controller.value;
|
|
2546
2537
|
if (removable) {
|
|
2547
|
-
controller.setState({ modalIsVisible: false
|
|
2548
|
-
controller.setFormValue(
|
|
2538
|
+
controller.setState({ modalIsVisible: false });
|
|
2539
|
+
controller.setFormValue(undefined);
|
|
2549
2540
|
props.onValue && props.onValue(props.value);
|
|
2550
2541
|
}
|
|
2551
2542
|
else {
|
|
@@ -2569,21 +2560,21 @@ function useFieldSelect(props) {
|
|
|
2569
2560
|
: controller.navigationElement(event);
|
|
2570
2561
|
};
|
|
2571
2562
|
}
|
|
2572
|
-
function onChange(
|
|
2563
|
+
function onChange(element) {
|
|
2573
2564
|
const { onSelect, onValue } = props;
|
|
2574
2565
|
controller.inputRef?.current?.focus();
|
|
2575
2566
|
if (onSelect) {
|
|
2576
2567
|
controller.setState({ modalIsVisible: false });
|
|
2577
|
-
value && onSelect(value);
|
|
2568
|
+
element.value && onSelect(element.value);
|
|
2578
2569
|
}
|
|
2579
2570
|
else {
|
|
2580
|
-
controller.setFormValue(
|
|
2581
|
-
controller.setState({ modalIsVisible: false
|
|
2571
|
+
controller.setFormValue(element);
|
|
2572
|
+
controller.setState({ modalIsVisible: false });
|
|
2582
2573
|
}
|
|
2583
|
-
onValue && onValue(value);
|
|
2574
|
+
onValue && onValue(element.value);
|
|
2584
2575
|
}
|
|
2585
2576
|
return {
|
|
2586
|
-
controller,
|
|
2577
|
+
...controller,
|
|
2587
2578
|
onBlurInput,
|
|
2588
2579
|
onClickAction,
|
|
2589
2580
|
onClickBackdrop,
|
|
@@ -2597,26 +2588,25 @@ function useFieldSelect(props) {
|
|
|
2597
2588
|
|
|
2598
2589
|
function RlsFieldSelectTemplate(props) {
|
|
2599
2590
|
const select = useFieldSelect(props);
|
|
2600
|
-
const { controller } = select;
|
|
2601
2591
|
const { render, suggestions, children, formControl, msgErrorDisabled, placeholder, rlsTheme, unremovable } = props;
|
|
2602
2592
|
const _disabled = formControl?.disabled || props.disabled;
|
|
2603
|
-
const className =
|
|
2604
|
-
focused:
|
|
2593
|
+
const className = useRenderClassStatus('rls-field-box', {
|
|
2594
|
+
focused: select.focused && !_disabled,
|
|
2605
2595
|
error: formControl?.wrong,
|
|
2606
2596
|
disabled: _disabled
|
|
2607
2597
|
}, 'rls-field-list rls-field-select');
|
|
2608
|
-
return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref:
|
|
2609
|
-
visible:
|
|
2610
|
-
higher:
|
|
2611
|
-
hide: !
|
|
2612
|
-
}), children: [jsxRuntimeExports.jsx("div", { className: "rls-field-list__suggestions__body", children: jsxRuntimeExports.jsxs("ul", { ref:
|
|
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', {
|
|
2599
|
+
visible: select.modalIsVisible,
|
|
2600
|
+
higher: select.higher,
|
|
2601
|
+
hide: !select.modalIsVisible
|
|
2602
|
+
}), children: [jsxRuntimeExports.jsx("div", { className: "rls-field-list__suggestions__body", children: jsxRuntimeExports.jsxs("ul", { ref: select.listRef, className: "rls-field-list__ul", children: [suggestions.map((element, index) => (jsxRuntimeExports.jsx("li", { className: "rls-field-list__element", tabIndex: -1, onClick: select.onClickElement(element), onKeyDown: select.onKeydownElement(element), children: render(element) }, index))), !suggestions.length && (jsxRuntimeExports.jsx("li", { className: "rls-field-list__empty", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-list__empty__description", children: [jsxRuntimeExports.jsx("label", { className: "rls-label-bold truncate", children: reactI18n('listEmptyTitle') }), jsxRuntimeExports.jsx("p", { className: "rls-caption-regular", children: reactI18n('listEmptyDescription') })] }) }))] }) }), jsxRuntimeExports.jsx("div", { className: "rls-field-list__backdrop", onClick: select.onClickBackdrop })] })] }));
|
|
2613
2603
|
}
|
|
2614
2604
|
function RlsFieldSelect(props) {
|
|
2615
2605
|
return (jsxRuntimeExports.jsx(RlsFieldSelectTemplate, { ...props, render: (element) => (jsxRuntimeExports.jsx(RlsBallot, { subtitle: element.subtitle, img: element.img, initials: element.initials, children: jsxRuntimeExports.jsx("span", { children: element.title }) })) }));
|
|
2616
2606
|
}
|
|
2617
2607
|
|
|
2618
2608
|
function RlsFormNavigation({ children, visible, rlsTheme }) {
|
|
2619
|
-
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 }) }));
|
|
2620
2610
|
}
|
|
2621
2611
|
|
|
2622
2612
|
const DURATION_ANIMATION = 240;
|
|
@@ -2635,7 +2625,7 @@ function calculateDuration({ length }) {
|
|
|
2635
2625
|
return duration + DURATION_RESET;
|
|
2636
2626
|
}
|
|
2637
2627
|
function RlsSnackbar({ content, icon, title, visible, rlsTheme }) {
|
|
2638
|
-
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 })] })] }));
|
|
2639
2629
|
}
|
|
2640
2630
|
function useSnackbarService() {
|
|
2641
2631
|
const [config, setConfig] = require$$0.useState({});
|
|
@@ -2756,5 +2746,6 @@ exports.renderClassStatus = renderClassStatus;
|
|
|
2756
2746
|
exports.useConfirmationService = useConfirmationService;
|
|
2757
2747
|
exports.useDatatable = useDatatable;
|
|
2758
2748
|
exports.useListController = useListController;
|
|
2749
|
+
exports.useRenderClassStatus = useRenderClassStatus;
|
|
2759
2750
|
exports.useSnackbarService = useSnackbarService;
|
|
2760
2751
|
//# sourceMappingURL=index.js.map
|