@rolster/react-components 18.20.6 → 18.20.7
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/index.js +11 -11
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/index.js +10 -10
- package/dist/es/index.js.map +1 -1
- package/dist/esm/components/organisms/Confirmation/Confirmation.d.ts +1 -1
- package/dist/esm/components/organisms/Confirmation/Confirmation.js +5 -5
- package/dist/esm/components/organisms/Confirmation/Confirmation.js.map +1 -1
- package/dist/esm/components/organisms/Snackbar/Snackbar.d.ts +1 -1
- package/dist/esm/components/organisms/Snackbar/Snackbar.js +5 -5
- 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/i18n.d.ts +0 -8
- package/package.json +3 -3
package/dist/cjs/index.js
CHANGED
|
@@ -2130,11 +2130,11 @@ class ConfirmationResult extends commons.PartialSealed {
|
|
|
2130
2130
|
function RlsConfirmation({ approved, content, reject, rlsTheme, subtitle, title, visible }) {
|
|
2131
2131
|
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" })] }));
|
|
2132
2132
|
}
|
|
2133
|
-
function
|
|
2133
|
+
function useConfirmation() {
|
|
2134
2134
|
const [config, setConfig] = require$$0.useState({});
|
|
2135
2135
|
const [visible, setVisible] = require$$0.useState(false);
|
|
2136
2136
|
const rlsConfirmation = ReactDOM.createPortal(jsxRuntimeExports.jsx(RlsConfirmation, { ...config, visible: visible }), document.body);
|
|
2137
|
-
|
|
2137
|
+
const confirmation = require$$0.useCallback((options) => {
|
|
2138
2138
|
return new Promise((resolve) => {
|
|
2139
2139
|
const { content, rlsTheme, subtitle, title, approved, reject } = options;
|
|
2140
2140
|
setConfig({
|
|
@@ -2163,7 +2163,7 @@ function useConfirmationService() {
|
|
|
2163
2163
|
});
|
|
2164
2164
|
setVisible(true);
|
|
2165
2165
|
});
|
|
2166
|
-
}
|
|
2166
|
+
}, []);
|
|
2167
2167
|
return {
|
|
2168
2168
|
RlsConfirmation: rlsConfirmation,
|
|
2169
2169
|
confirmation
|
|
@@ -2632,7 +2632,7 @@ function calculateDuration({ length }) {
|
|
|
2632
2632
|
function RlsSnackbar({ content, icon, title, visible, rlsTheme }) {
|
|
2633
2633
|
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 })] })] }));
|
|
2634
2634
|
}
|
|
2635
|
-
function
|
|
2635
|
+
function useSnackbar() {
|
|
2636
2636
|
const [config, setConfig] = require$$0.useState({});
|
|
2637
2637
|
const [duration, setDuration] = require$$0.useState(4000);
|
|
2638
2638
|
const [timeoutId, setTimeoutId] = require$$0.useState();
|
|
@@ -2651,12 +2651,12 @@ function useSnackbarService() {
|
|
|
2651
2651
|
setTimeout(() => snackbar(config), DURATION_ANIMATION);
|
|
2652
2652
|
}
|
|
2653
2653
|
}, [visible]);
|
|
2654
|
-
|
|
2654
|
+
const snackbar = require$$0.useCallback((config) => {
|
|
2655
2655
|
const { content } = config;
|
|
2656
2656
|
setConfig(config);
|
|
2657
2657
|
setDuration(calculateDuration(String(content)));
|
|
2658
|
-
setVisible(!visible);
|
|
2659
|
-
}
|
|
2658
|
+
setVisible((visible) => !visible);
|
|
2659
|
+
}, []);
|
|
2660
2660
|
return {
|
|
2661
2661
|
RlsSnackbar: rlsSnackbar,
|
|
2662
2662
|
snackbar
|
|
@@ -2671,8 +2671,8 @@ const RlsContext = require$$0.createContext({
|
|
|
2671
2671
|
withNavbar: () => { }
|
|
2672
2672
|
});
|
|
2673
2673
|
function RlsApplication({ children }) {
|
|
2674
|
-
const { RlsConfirmation, confirmation } =
|
|
2675
|
-
const { RlsSnackbar, snackbar } =
|
|
2674
|
+
const { RlsConfirmation, confirmation } = useConfirmation();
|
|
2675
|
+
const { RlsSnackbar, snackbar } = useSnackbar();
|
|
2676
2676
|
const [currentWithNavbar, withNavbar] = require$$0.useState(false);
|
|
2677
2677
|
return (jsxRuntimeExports.jsxs(RlsContext.Provider, { value: { confirmation, snackbar, withNavbar }, children: [jsxRuntimeExports.jsxs("div", { className: renderClassStatus('rls-app__body', {
|
|
2678
2678
|
snackbar: currentWithNavbar
|
|
@@ -2750,9 +2750,9 @@ exports.RlsTabularText = RlsTabularText;
|
|
|
2750
2750
|
exports.RlsToolbar = RlsToolbar;
|
|
2751
2751
|
exports.rangeFormatTemplate = rangeFormatTemplate;
|
|
2752
2752
|
exports.renderClassStatus = renderClassStatus;
|
|
2753
|
-
exports.
|
|
2753
|
+
exports.useConfirmation = useConfirmation;
|
|
2754
2754
|
exports.useDatatable = useDatatable;
|
|
2755
2755
|
exports.useListController = useListController;
|
|
2756
2756
|
exports.useRenderClassStatus = useRenderClassStatus;
|
|
2757
|
-
exports.
|
|
2757
|
+
exports.useSnackbar = useSnackbar;
|
|
2758
2758
|
//# sourceMappingURL=index.js.map
|