@rolster/react-components 19.7.3 → 19.7.10
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/LICENSE +21 -21
- package/dist/cjs/index.cjs +120 -41
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/es/index.mjs +121 -43
- package/dist/es/index.mjs.map +1 -1
- package/dist/esm/components/molecules/Tabs/Tabs.d.ts +4 -1
- package/dist/esm/components/molecules/Tabs/Tabs.js +25 -11
- package/dist/esm/components/molecules/Tabs/Tabs.js.map +1 -1
- package/dist/esm/components/organisms/Confirmation/Confirmation.d.ts +2 -1
- package/dist/esm/components/organisms/Confirmation/Confirmation.js +13 -4
- package/dist/esm/components/organisms/Confirmation/Confirmation.js.map +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocompleteController.js +16 -3
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocompleteController.js.map +1 -1
- package/dist/esm/components/organisms/FieldList/FieldListController.js +13 -3
- package/dist/esm/components/organisms/FieldList/FieldListController.js.map +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelectController.js +13 -3
- package/dist/esm/components/organisms/FieldSelect/FieldSelectController.js.map +1 -1
- package/dist/esm/components/organisms/Notifications/Notifications.d.ts +2 -1
- package/dist/esm/components/organisms/Notifications/Notifications.js +11 -5
- package/dist/esm/components/organisms/Notifications/Notifications.js.map +1 -1
- package/dist/esm/components/organisms/Snackbar/Snackbar.d.ts +2 -1
- package/dist/esm/components/organisms/Snackbar/Snackbar.js +12 -6
- package/dist/esm/components/organisms/Snackbar/Snackbar.js.map +1 -1
- package/dist/esm/context.js +3 -3
- package/dist/esm/context.js.map +1 -1
- package/dist/esm/controllers/DropdownController.js +2 -8
- package/dist/esm/controllers/DropdownController.js.map +1 -1
- package/dist/esm/controllers/ListController.js +3 -3
- package/dist/esm/controllers/ListController.js.map +1 -1
- package/dist/esm/controllers/PortalController.js +2 -2
- package/dist/esm/controllers/PortalController.js.map +1 -1
- package/dist/esm/controllers/TabsController.d.ts +18 -0
- package/dist/esm/controllers/TabsController.js +20 -0
- package/dist/esm/controllers/TabsController.js.map +1 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/package.json +83 -83
package/dist/es/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { i18n, i18nSubscribe } from '@rolster/i18n';
|
|
|
4
4
|
import { PaginationController, verifyDayPicker, createDayPicker, createDayRangePicker, verifyMonthPicker, createMonthPicker, monthLimitTemplate, createYearPicker, verifyYearPicker, ListCollection, navigationListFromInput, navigationListFromElement, createAutocompleteStore, PickerListenerEvent, dateOutRange, verifyDateRange } from '@rolster/components';
|
|
5
5
|
import { DAY_LABELS, DateRange, normalizeMinTime, assignDayInDate, dateIsBefore, MONTH_NAMES, Month, Time, dateFormatTemplate, assignYearInDate, assignMonthInDate } from '@rolster/dates';
|
|
6
6
|
import ReactDOM from 'react-dom';
|
|
7
|
-
import { useReactControl } from '@rolster/react-forms';
|
|
7
|
+
import { useReactControl, useFormControl } from '@rolster/react-forms';
|
|
8
8
|
|
|
9
9
|
var jsxRuntime = {exports: {}};
|
|
10
10
|
|
|
@@ -2298,32 +2298,46 @@ function RlsSliderComponent({ children, className, disabled, formControl, identi
|
|
|
2298
2298
|
}
|
|
2299
2299
|
const RlsSlider = memo(RlsSliderComponent);
|
|
2300
2300
|
|
|
2301
|
-
function RlsTab({ onSelect, tab, value }) {
|
|
2301
|
+
function RlsTab({ disabled, onSelect, tab, value }) {
|
|
2302
2302
|
const className = renderClassStatus('rls-tabs__children', {
|
|
2303
2303
|
active: tab.value === value,
|
|
2304
|
-
disabled: tab.disabled
|
|
2304
|
+
disabled: disabled || tab.disabled
|
|
2305
2305
|
});
|
|
2306
2306
|
const onClick = useCallback(() => {
|
|
2307
|
-
if (!tab.disabled) {
|
|
2307
|
+
if (!disabled && !tab.disabled) {
|
|
2308
2308
|
onSelect(tab.value);
|
|
2309
2309
|
}
|
|
2310
|
-
}, [tab.disabled]);
|
|
2310
|
+
}, [disabled, tab.disabled, onSelect]);
|
|
2311
2311
|
return (jsxRuntimeExports.jsx("div", { className: className, onClick: onClick, children: jsxRuntimeExports.jsx("span", { children: tab.label }) }));
|
|
2312
2312
|
}
|
|
2313
|
-
function RlsTabsComponent({ tabs, onValue, rlsTheme }) {
|
|
2314
|
-
const [
|
|
2313
|
+
function RlsTabsComponent({ tabs, formControl, onValue, value, rlsTheme }) {
|
|
2314
|
+
const [valueInternal, setValueInternal] = useState();
|
|
2315
|
+
const valueSelected = useMemo(() => {
|
|
2316
|
+
return formControl ? formControl.value : valueInternal;
|
|
2317
|
+
}, [formControl?.value, valueInternal]);
|
|
2315
2318
|
const onSelect = useCallback((value) => {
|
|
2316
|
-
|
|
2319
|
+
if (formControl) {
|
|
2320
|
+
formControl?.setValue(value);
|
|
2321
|
+
}
|
|
2322
|
+
else {
|
|
2323
|
+
setValueInternal(value);
|
|
2324
|
+
}
|
|
2317
2325
|
onValue?.(value);
|
|
2318
|
-
}, [onValue]);
|
|
2326
|
+
}, [formControl, onValue]);
|
|
2319
2327
|
useEffect(() => {
|
|
2328
|
+
if (formControl?.value !== undefined) {
|
|
2329
|
+
return setValueInternal(formControl.value);
|
|
2330
|
+
}
|
|
2331
|
+
if (value !== undefined) {
|
|
2332
|
+
return setValueInternal(value);
|
|
2333
|
+
}
|
|
2320
2334
|
const initial = tabs.find((tab) => tab.defaultActive) ?? tabs[0];
|
|
2321
2335
|
if (initial) {
|
|
2322
2336
|
onSelect(initial.value);
|
|
2323
2337
|
}
|
|
2324
|
-
}, []);
|
|
2338
|
+
}, [value, formControl?.value]);
|
|
2325
2339
|
return (jsxRuntimeExports.jsx("div", { className: "rls-tabs", "rls-theme": rlsTheme, children: tabs.map((tab, index) => {
|
|
2326
|
-
return (jsxRuntimeExports.jsx(RlsTab, { tab: tab, value:
|
|
2340
|
+
return (jsxRuntimeExports.jsx(RlsTab, { tab: tab, disabled: formControl?.disabled, value: valueSelected, onSelect: onSelect }, index));
|
|
2327
2341
|
}) }));
|
|
2328
2342
|
}
|
|
2329
2343
|
const RlsTabs = memo(RlsTabsComponent);
|
|
@@ -2364,10 +2378,19 @@ function RlsConfirmationComponent({ approved, className, content, reject, rlsThe
|
|
|
2364
2378
|
return (jsxRuntimeExports.jsxs("div", { className: classConfirmation, "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__content", 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: approved.type, onClick: approved.onClick, disabled: approved.disabled, rlsTheme: approved.rlsTheme, children: approved.label })), reject && (jsxRuntimeExports.jsx(RlsButton, { identifier: reject.identifier, type: reject.type, onClick: reject.onClick, disabled: reject.disabled, rlsTheme: reject.rlsTheme, children: reject.label }))] }) }))] }), jsxRuntimeExports.jsx("div", { className: "rls-confirmation__backdrop" })] }));
|
|
2365
2379
|
}
|
|
2366
2380
|
const RlsConfirmation = memo(RlsConfirmationComponent);
|
|
2381
|
+
const RlsConfirmationBase = RlsConfirmation;
|
|
2367
2382
|
function useConfirmation() {
|
|
2368
2383
|
const [config, setConfig] = useState({});
|
|
2369
2384
|
const [visible, setVisible] = useState(false);
|
|
2370
|
-
const
|
|
2385
|
+
const configRef = useRef(config);
|
|
2386
|
+
configRef.current = config;
|
|
2387
|
+
const visibleRef = useRef(visible);
|
|
2388
|
+
visibleRef.current = visible;
|
|
2389
|
+
const RlsConfirmation = useMemo(() => {
|
|
2390
|
+
return function RlsConfirmation(props) {
|
|
2391
|
+
return ReactDOM.createPortal(jsxRuntimeExports.jsx(RlsConfirmationBase, { ...props, ...configRef.current, visible: visibleRef.current }), document.body);
|
|
2392
|
+
};
|
|
2393
|
+
}, []);
|
|
2371
2394
|
const confirmation = useCallback((options) => {
|
|
2372
2395
|
return new Promise((resolve) => {
|
|
2373
2396
|
setConfig({
|
|
@@ -2401,8 +2424,8 @@ function useConfirmation() {
|
|
|
2401
2424
|
});
|
|
2402
2425
|
}, []);
|
|
2403
2426
|
return {
|
|
2404
|
-
|
|
2405
|
-
|
|
2427
|
+
confirmation,
|
|
2428
|
+
RlsConfirmation
|
|
2406
2429
|
};
|
|
2407
2430
|
}
|
|
2408
2431
|
|
|
@@ -2540,7 +2563,7 @@ function useListController({ suggestions, automatic, formControl, reference }) {
|
|
|
2540
2563
|
const refInput = useRef(null);
|
|
2541
2564
|
const listIsOpen = useRef(false);
|
|
2542
2565
|
const stableSuggestions = useStableSuggestions(suggestions);
|
|
2543
|
-
const collection = useMemo(() => new ListCollection(stableSuggestions, reference), [stableSuggestions]);
|
|
2566
|
+
const collection = useMemo(() => new ListCollection(stableSuggestions, reference), [stableSuggestions, reference]);
|
|
2544
2567
|
const [state, refreshState] = useState({
|
|
2545
2568
|
focused: false,
|
|
2546
2569
|
higher: false,
|
|
@@ -2649,7 +2672,7 @@ function useListController({ suggestions, automatic, formControl, reference }) {
|
|
|
2649
2672
|
position: position.current
|
|
2650
2673
|
});
|
|
2651
2674
|
}, [state.higher]);
|
|
2652
|
-
return {
|
|
2675
|
+
return useMemo(() => ({
|
|
2653
2676
|
...state,
|
|
2654
2677
|
navigationElement,
|
|
2655
2678
|
navigationInput,
|
|
@@ -2658,7 +2681,7 @@ function useListController({ suggestions, automatic, formControl, reference }) {
|
|
|
2658
2681
|
refList,
|
|
2659
2682
|
setFormValue,
|
|
2660
2683
|
setState
|
|
2661
|
-
};
|
|
2684
|
+
}), [state, navigationElement, navigationInput, setFormValue, setState]);
|
|
2662
2685
|
}
|
|
2663
2686
|
|
|
2664
2687
|
const DURATION_ANIMATION$2 = 240;
|
|
@@ -2788,7 +2811,7 @@ function useFieldAutocomplete(props) {
|
|
|
2788
2811
|
}
|
|
2789
2812
|
};
|
|
2790
2813
|
}, [onChange, controller.navigationElement]);
|
|
2791
|
-
return {
|
|
2814
|
+
return useMemo(() => ({
|
|
2792
2815
|
...controller,
|
|
2793
2816
|
coincidences,
|
|
2794
2817
|
onBlurInput,
|
|
@@ -2801,7 +2824,20 @@ function useFieldAutocomplete(props) {
|
|
|
2801
2824
|
onKeydownInput,
|
|
2802
2825
|
pattern,
|
|
2803
2826
|
setPattern
|
|
2804
|
-
}
|
|
2827
|
+
}), [
|
|
2828
|
+
controller,
|
|
2829
|
+
coincidences,
|
|
2830
|
+
onBlurInput,
|
|
2831
|
+
onClickAction,
|
|
2832
|
+
onClickBackdrop,
|
|
2833
|
+
onClickControl,
|
|
2834
|
+
onClickElement,
|
|
2835
|
+
onFocusInput,
|
|
2836
|
+
onKeydownElement,
|
|
2837
|
+
onKeydownInput,
|
|
2838
|
+
pattern,
|
|
2839
|
+
setPattern
|
|
2840
|
+
]);
|
|
2805
2841
|
}
|
|
2806
2842
|
|
|
2807
2843
|
function RlsFieldAutocompleteTemplateComponent(props) {
|
|
@@ -3811,7 +3847,7 @@ function useFieldList(props) {
|
|
|
3811
3847
|
}
|
|
3812
3848
|
};
|
|
3813
3849
|
}, [toggleElement]);
|
|
3814
|
-
return {
|
|
3850
|
+
return useMemo(() => ({
|
|
3815
3851
|
...state,
|
|
3816
3852
|
selected,
|
|
3817
3853
|
refContent,
|
|
@@ -3823,7 +3859,17 @@ function useFieldList(props) {
|
|
|
3823
3859
|
onClickInput,
|
|
3824
3860
|
onKeydownElement,
|
|
3825
3861
|
onRemoveElement
|
|
3826
|
-
}
|
|
3862
|
+
}), [
|
|
3863
|
+
state,
|
|
3864
|
+
selected,
|
|
3865
|
+
isSelected,
|
|
3866
|
+
onClickAction,
|
|
3867
|
+
onClickBackdrop,
|
|
3868
|
+
onClickElement,
|
|
3869
|
+
onClickInput,
|
|
3870
|
+
onKeydownElement,
|
|
3871
|
+
onRemoveElement
|
|
3872
|
+
]);
|
|
3827
3873
|
}
|
|
3828
3874
|
|
|
3829
3875
|
function RlsFieldListInner({ render, suggestions, action, children, formControl, fieldList, msgErrorDisabled, placeholder, rlsTheme, ...props }) {
|
|
@@ -3946,7 +3992,7 @@ function useFieldSelect(props) {
|
|
|
3946
3992
|
}
|
|
3947
3993
|
};
|
|
3948
3994
|
}, [onChange, controller.navigationElement]);
|
|
3949
|
-
return {
|
|
3995
|
+
return useMemo(() => ({
|
|
3950
3996
|
...controller,
|
|
3951
3997
|
onBlurInput,
|
|
3952
3998
|
onClickAction,
|
|
@@ -3956,7 +4002,17 @@ function useFieldSelect(props) {
|
|
|
3956
4002
|
onFocusInput,
|
|
3957
4003
|
onKeydownElement,
|
|
3958
4004
|
onKeydownInput
|
|
3959
|
-
}
|
|
4005
|
+
}), [
|
|
4006
|
+
controller,
|
|
4007
|
+
onBlurInput,
|
|
4008
|
+
onClickAction,
|
|
4009
|
+
onClickBackdrop,
|
|
4010
|
+
onClickInput,
|
|
4011
|
+
onClickElement,
|
|
4012
|
+
onFocusInput,
|
|
4013
|
+
onKeydownElement,
|
|
4014
|
+
onKeydownInput
|
|
4015
|
+
]);
|
|
3960
4016
|
}
|
|
3961
4017
|
|
|
3962
4018
|
function RlsFieldSelectTemplateComponent(props) {
|
|
@@ -4453,6 +4509,8 @@ function RlsNotification({ content, icon, onClose, rlsTheme, title, visible }) {
|
|
|
4453
4509
|
function useNotifications() {
|
|
4454
4510
|
const [notifications, setNotifications] = useState([]);
|
|
4455
4511
|
const timersRef = useRef(new Map());
|
|
4512
|
+
const notificationsRef = useRef(notifications);
|
|
4513
|
+
notificationsRef.current = notifications;
|
|
4456
4514
|
useEffect(() => {
|
|
4457
4515
|
const timers = timersRef.current;
|
|
4458
4516
|
return () => {
|
|
@@ -4473,6 +4531,14 @@ function useNotifications() {
|
|
|
4473
4531
|
setNotifications((notifications) => notifications.filter((notification) => notification.id !== id));
|
|
4474
4532
|
}, DURATION_ANIMATION$1);
|
|
4475
4533
|
}, []);
|
|
4534
|
+
const RlsNotifications = useMemo(() => {
|
|
4535
|
+
return function RlsNotifications(props) {
|
|
4536
|
+
const className = renderClassStatus('rls-notifications', {
|
|
4537
|
+
visible: notificationsRef.current.length > 0
|
|
4538
|
+
});
|
|
4539
|
+
return ReactDOM.createPortal(jsxRuntimeExports.jsx("div", { className: className, ...props, children: notificationsRef.current.map((notification) => (jsxRuntimeExports.jsx(RlsNotification, { ...notification.config, visible: notification.visible, onClose: () => remove(notification.id) }, notification.id))) }), document.body);
|
|
4540
|
+
};
|
|
4541
|
+
}, [remove]);
|
|
4476
4542
|
const notify = useCallback((config) => {
|
|
4477
4543
|
const id = generateId();
|
|
4478
4544
|
const duration = config.duration ?? DURATION_DEFAULT;
|
|
@@ -4492,10 +4558,6 @@ function useNotifications() {
|
|
|
4492
4558
|
}, duration);
|
|
4493
4559
|
timersRef.current.set(id, timer);
|
|
4494
4560
|
}, [remove]);
|
|
4495
|
-
const className = renderClassStatus('rls-notifications', {
|
|
4496
|
-
visible: notifications.length > 0
|
|
4497
|
-
});
|
|
4498
|
-
const RlsNotifications = ReactDOM.createPortal(jsxRuntimeExports.jsx("div", { className: className, children: notifications.map((notification) => (jsxRuntimeExports.jsx(RlsNotification, { ...notification.config, visible: notification.visible, onClose: () => remove(notification.id) }, notification.id))) }), document.body);
|
|
4499
4561
|
return {
|
|
4500
4562
|
RlsNotifications,
|
|
4501
4563
|
notify
|
|
@@ -4522,6 +4584,7 @@ function RlsSnackbarComponent({ content, onClose, icon, rlsTheme, title, visible
|
|
|
4522
4584
|
return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [icon && (jsxRuntimeExports.jsx("div", { className: "rls-snackbar__avatar", children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) })), jsxRuntimeExports.jsxs("div", { className: "rls-snackbar__component", children: [jsxRuntimeExports.jsxs("div", { className: "rls-snackbar__header", children: [jsxRuntimeExports.jsx("div", { className: "rls-snackbar__title", children: title }), jsxRuntimeExports.jsx("button", { onClick: onClose, children: jsxRuntimeExports.jsx(RlsIcon, { value: "close" }) })] }), jsxRuntimeExports.jsx("div", { className: "rls-snackbar__content", children: content })] })] }));
|
|
4523
4585
|
}
|
|
4524
4586
|
const RlsSnackbar = memo(RlsSnackbarComponent);
|
|
4587
|
+
const RlsSnackbarNode = RlsSnackbar;
|
|
4525
4588
|
function useSnackbar() {
|
|
4526
4589
|
const timeoutId = useRef(undefined);
|
|
4527
4590
|
const duration = useRef(4000);
|
|
@@ -4529,6 +4592,8 @@ function useSnackbar() {
|
|
|
4529
4592
|
config: {},
|
|
4530
4593
|
visible: false
|
|
4531
4594
|
});
|
|
4595
|
+
const stateRef = useRef(state);
|
|
4596
|
+
stateRef.current = state;
|
|
4532
4597
|
const onClose = useCallback(() => {
|
|
4533
4598
|
if (timeoutId.current) {
|
|
4534
4599
|
clearTimeout(timeoutId.current);
|
|
@@ -4536,7 +4601,13 @@ function useSnackbar() {
|
|
|
4536
4601
|
timeoutId.current = undefined;
|
|
4537
4602
|
setState((state) => ({ ...state, visible: false }));
|
|
4538
4603
|
}, []);
|
|
4539
|
-
const
|
|
4604
|
+
const onCloseRef = useRef(onClose);
|
|
4605
|
+
onCloseRef.current = onClose;
|
|
4606
|
+
const RlsSnackbar = useMemo(() => {
|
|
4607
|
+
return function RlsSnackbar(props) {
|
|
4608
|
+
return (jsxRuntimeExports.jsx(RlsSnackbarNode, { ...props, ...stateRef.current.config, visible: stateRef.current.visible, onClose: onCloseRef.current }));
|
|
4609
|
+
};
|
|
4610
|
+
}, []);
|
|
4540
4611
|
useEffect(() => {
|
|
4541
4612
|
if (state.visible) {
|
|
4542
4613
|
timeoutId.current = setTimeout(() => {
|
|
@@ -4560,10 +4631,7 @@ function useSnackbar() {
|
|
|
4560
4631
|
visible: !state.visible
|
|
4561
4632
|
}));
|
|
4562
4633
|
}, []);
|
|
4563
|
-
return {
|
|
4564
|
-
RlsSnackbar: rlsSnackbar,
|
|
4565
|
-
snackbar
|
|
4566
|
-
};
|
|
4634
|
+
return { RlsSnackbar, snackbar };
|
|
4567
4635
|
}
|
|
4568
4636
|
|
|
4569
4637
|
const RlsContext = createContext(null);
|
|
@@ -4576,8 +4644,8 @@ function useRlsContext() {
|
|
|
4576
4644
|
}
|
|
4577
4645
|
function RlsApplication({ children }) {
|
|
4578
4646
|
const { RlsConfirmation, confirmation } = useConfirmation();
|
|
4579
|
-
const { RlsNotifications, notify } = useNotifications();
|
|
4580
4647
|
const { RlsSnackbar, snackbar } = useSnackbar();
|
|
4648
|
+
const { RlsNotifications, notify } = useNotifications();
|
|
4581
4649
|
const [navbarInApp, setNavbarInApp] = useState(false);
|
|
4582
4650
|
const [navbarIsCondense, setNavbarIsCondense] = useState(false);
|
|
4583
4651
|
const [appIsMobile, setIsMobile] = useState(false);
|
|
@@ -4594,7 +4662,7 @@ function RlsApplication({ children }) {
|
|
|
4594
4662
|
setNavbarIsCondense,
|
|
4595
4663
|
snackbar
|
|
4596
4664
|
}), [confirmation, notify, snackbar]);
|
|
4597
|
-
return (jsxRuntimeExports.jsxs(RlsContext, { value: state, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children, RlsSnackbar] }), RlsNotifications,
|
|
4665
|
+
return (jsxRuntimeExports.jsxs(RlsContext, { value: state, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children, jsxRuntimeExports.jsx(RlsSnackbar, {})] }), jsxRuntimeExports.jsx(RlsConfirmation, {}), jsxRuntimeExports.jsx(RlsNotifications, {})] }));
|
|
4598
4666
|
}
|
|
4599
4667
|
|
|
4600
4668
|
const DEFAULT_DESIGN_SYSTEM = 'bordered';
|
|
@@ -4700,13 +4768,7 @@ function useDropdownController(effect = '0% 0%') {
|
|
|
4700
4768
|
const close = useCallback(() => {
|
|
4701
4769
|
setVisible(false);
|
|
4702
4770
|
}, []);
|
|
4703
|
-
return {
|
|
4704
|
-
close,
|
|
4705
|
-
component,
|
|
4706
|
-
open,
|
|
4707
|
-
openWithEvent,
|
|
4708
|
-
visible
|
|
4709
|
-
};
|
|
4771
|
+
return useMemo(() => ({ close, component, open, openWithEvent, visible }), [close, open, openWithEvent, visible]);
|
|
4710
4772
|
}
|
|
4711
4773
|
|
|
4712
4774
|
function usePortalController() {
|
|
@@ -4717,7 +4779,23 @@ function usePortalController() {
|
|
|
4717
4779
|
const close = useCallback(() => {
|
|
4718
4780
|
setVisible(false);
|
|
4719
4781
|
}, []);
|
|
4720
|
-
return { close, open, visible };
|
|
4782
|
+
return useMemo(() => ({ close, open, visible }), [close, open, visible]);
|
|
4783
|
+
}
|
|
4784
|
+
|
|
4785
|
+
function useTabsController(options) {
|
|
4786
|
+
const formControl = useFormControl(options.value);
|
|
4787
|
+
const tabsRef = useRef(options.tabs);
|
|
4788
|
+
tabsRef.current = options.tabs;
|
|
4789
|
+
const onValueRef = useRef(options.onValue);
|
|
4790
|
+
onValueRef.current = options.onValue;
|
|
4791
|
+
const formControlRef = useRef(formControl);
|
|
4792
|
+
formControlRef.current = formControl;
|
|
4793
|
+
const Tabs = useMemo(() => {
|
|
4794
|
+
return function Tabs(props) {
|
|
4795
|
+
return (jsxRuntimeExports.jsx(RlsTabs, { ...props, tabs: tabsRef.current, formControl: formControlRef.current, onValue: onValueRef.current }));
|
|
4796
|
+
};
|
|
4797
|
+
}, []);
|
|
4798
|
+
return useMemo(() => ({ Tabs, formControl }), [Tabs, formControl]);
|
|
4721
4799
|
}
|
|
4722
4800
|
|
|
4723
4801
|
const APP_THEME_ATTRIBUTE = 'app-theme';
|
|
@@ -4741,5 +4819,5 @@ function toggleAppTheme() {
|
|
|
4741
4819
|
return theme;
|
|
4742
4820
|
}
|
|
4743
4821
|
|
|
4744
|
-
export { ConfirmationResult, DEFAULT_COLOR, RlsAccordion, RlsAlert, RlsAmount, RlsApplication, RlsAreaText, RlsAvatar, RlsBadge, RlsBallot, RlsBody, RlsBottomSheet, RlsBreadcrumb, RlsButton, RlsButtonAction, RlsButtonIcon, RlsButtonOption, RlsButtonProgress, RlsButtonStepper, RlsButtonToggle, RlsCard, RlsCheckBox, RlsCheckBoxControl, RlsConfirmation, RlsContent, RlsContext, RlsDatatable, RlsDatatableCell, RlsDatatableData, RlsDatatableFloating, RlsDatatableHeader, RlsDatatableRecord, RlsDatatableSubheader, RlsDatatableTitle, RlsDatatableTotals, RlsDropdown, RlsFieldArea, RlsFieldAutocomplete, RlsFieldAutocompleteTemplate, RlsFieldClock, RlsFieldColor, RlsFieldDate, RlsFieldDateRange, RlsFieldDecimal, RlsFieldFile, RlsFieldList, RlsFieldListSuggestions, RlsFieldListTemplate, RlsFieldMoney, RlsFieldNumber, RlsFieldPassword, RlsFieldPercentage, RlsFieldReadonly, RlsFieldSelect, RlsFieldSelectTemplate, RlsFieldText, RlsFormNavigation, RlsIcon, RlsImage, RlsImageChooser, RlsImageEditor, RlsInput, RlsInputCounter, RlsInputDecimal, RlsInputMoney, RlsInputNumber, RlsInputPassword, RlsInputPercentage, RlsInputSearch, RlsInputText, RlsLabel, RlsLabelCheckBox, RlsLabelRadioButton, RlsLabelSwitch, RlsLed, RlsMessageEmpty, RlsMessageFormError, RlsMessageIcon, RlsModal, RlsModalClock, RlsModalDate, RlsModalDateRange, RlsModalSheet, RlsNavbar, RlsNavbarMenu, RlsPagination, RlsPickerClock, RlsPickerColor, RlsPickerDate, RlsPickerDateRange, RlsPickerDay, RlsPickerDayRange, RlsPickerMonth, RlsPickerSelectorTitle, RlsPickerYear, RlsPoster, RlsProgressBar, RlsProgressCircular, RlsRadioButton, RlsSkeleton, RlsSkeletonText, RlsSlider, RlsSnackbar, RlsSpinner, RlsSwitch, RlsSwitchControl, RlsTabs, RlsTabularText, RlsToolbar, calculateImgDimension, generateThemePalette, getAppTheme, hexIsValid, hexToHsl, hexToHsv, hexToRgb, hslToHex, hsvToHex, hsvToRgb, normalizeHex, rangeFormatTemplate, renderClassStatus, rgbToHex, rgbToHsl, rgbToHsv, setAppTheme, setDesignSystem, setErrorsI18n, setThemeColor, toggleAppTheme, useConfirmation, useDatatable, useDesingSystemController, useDropdownController, useFieldAutocomplete, useFieldList, useFieldSelect, useFormSingleSelectionController, useFormToggleController, useImageEditorController, useListController, useNotifications, usePortalController, useRelocationOnComponent, useResize, useRlsContext, useSnackbar };
|
|
4822
|
+
export { ConfirmationResult, DEFAULT_COLOR, RlsAccordion, RlsAlert, RlsAmount, RlsApplication, RlsAreaText, RlsAvatar, RlsBadge, RlsBallot, RlsBody, RlsBottomSheet, RlsBreadcrumb, RlsButton, RlsButtonAction, RlsButtonIcon, RlsButtonOption, RlsButtonProgress, RlsButtonStepper, RlsButtonToggle, RlsCard, RlsCheckBox, RlsCheckBoxControl, RlsConfirmation, RlsContent, RlsContext, RlsDatatable, RlsDatatableCell, RlsDatatableData, RlsDatatableFloating, RlsDatatableHeader, RlsDatatableRecord, RlsDatatableSubheader, RlsDatatableTitle, RlsDatatableTotals, RlsDropdown, RlsFieldArea, RlsFieldAutocomplete, RlsFieldAutocompleteTemplate, RlsFieldClock, RlsFieldColor, RlsFieldDate, RlsFieldDateRange, RlsFieldDecimal, RlsFieldFile, RlsFieldList, RlsFieldListSuggestions, RlsFieldListTemplate, RlsFieldMoney, RlsFieldNumber, RlsFieldPassword, RlsFieldPercentage, RlsFieldReadonly, RlsFieldSelect, RlsFieldSelectTemplate, RlsFieldText, RlsFormNavigation, RlsIcon, RlsImage, RlsImageChooser, RlsImageEditor, RlsInput, RlsInputCounter, RlsInputDecimal, RlsInputMoney, RlsInputNumber, RlsInputPassword, RlsInputPercentage, RlsInputSearch, RlsInputText, RlsLabel, RlsLabelCheckBox, RlsLabelRadioButton, RlsLabelSwitch, RlsLed, RlsMessageEmpty, RlsMessageFormError, RlsMessageIcon, RlsModal, RlsModalClock, RlsModalDate, RlsModalDateRange, RlsModalSheet, RlsNavbar, RlsNavbarMenu, RlsPagination, RlsPickerClock, RlsPickerColor, RlsPickerDate, RlsPickerDateRange, RlsPickerDay, RlsPickerDayRange, RlsPickerMonth, RlsPickerSelectorTitle, RlsPickerYear, RlsPoster, RlsProgressBar, RlsProgressCircular, RlsRadioButton, RlsSkeleton, RlsSkeletonText, RlsSlider, RlsSnackbar, RlsSpinner, RlsSwitch, RlsSwitchControl, RlsTabs, RlsTabularText, RlsToolbar, calculateImgDimension, generateThemePalette, getAppTheme, hexIsValid, hexToHsl, hexToHsv, hexToRgb, hslToHex, hsvToHex, hsvToRgb, normalizeHex, rangeFormatTemplate, renderClassStatus, rgbToHex, rgbToHsl, rgbToHsv, setAppTheme, setDesignSystem, setErrorsI18n, setThemeColor, toggleAppTheme, useConfirmation, useDatatable, useDesingSystemController, useDropdownController, useFieldAutocomplete, useFieldList, useFieldSelect, useFormSingleSelectionController, useFormToggleController, useImageEditorController, useListController, useNotifications, usePortalController, useRelocationOnComponent, useResize, useRlsContext, useSnackbar, useTabsController };
|
|
4745
4823
|
//# sourceMappingURL=index.mjs.map
|