@dynamic-framework/ui-react 1.18.0 → 1.19.0
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/css/dynamic-ui-non-root.css +1363 -868
- package/dist/css/dynamic-ui-non-root.min.css +2 -2
- package/dist/css/dynamic-ui-root.css +493 -29
- package/dist/css/dynamic-ui-root.min.css +2 -2
- package/dist/css/dynamic-ui.css +1855 -896
- package/dist/css/dynamic-ui.min.css +2 -2
- package/dist/index.esm.js +117 -151
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +118 -155
- package/dist/index.js.map +1 -1
- package/dist/types/components/DAvatar/DAvatar.d.ts +9 -0
- package/dist/types/components/DAvatar/index.d.ts +2 -0
- package/dist/types/components/DCarousel/DCarousel.d.ts +5 -4
- package/dist/types/components/DToastContainer/DToastContainer.d.ts +9 -7
- package/dist/types/components/DToastContainer/index.d.ts +1 -1
- package/dist/types/components/DToastContainer/{useToast.d.ts → useDToast.d.ts} +7 -4
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/components/interface.d.ts +1 -0
- package/dist/types/contexts/DContext.d.ts +8 -7
- package/dist/types/contexts/DPortalContext.d.ts +29 -0
- package/dist/types/contexts/index.d.ts +1 -2
- package/package.json +3 -3
- package/src/style/abstracts/_mixins.scss +110 -94
- package/src/style/abstracts/_utilities.scss +34 -1
- package/src/style/abstracts/variables/_+import.scss +2 -0
- package/src/style/abstracts/variables/_accordion.scss +2 -2
- package/src/style/abstracts/variables/_alerts.scss +1 -1
- package/src/style/abstracts/variables/_cards.scss +2 -0
- package/src/style/abstracts/variables/_collapse-icon-text.scss +2 -2
- package/src/style/abstracts/variables/_forms.scss +5 -7
- package/src/style/abstracts/variables/_navs.scss +2 -2
- package/src/style/abstracts/variables/_pagination.scss +4 -4
- package/src/style/abstracts/variables/_progress.scss +2 -2
- package/src/style/abstracts/variables/_quick-action-button.scss +4 -4
- package/src/style/abstracts/variables/_quick-action-check.scss +4 -4
- package/src/style/abstracts/variables/_quick-action-select.scss +3 -3
- package/src/style/abstracts/variables/_quick-action-switch.scss +2 -2
- package/src/style/abstracts/variables/_tooltip.scss +16 -0
- package/src/style/abstracts/variables/_typography.scss +76 -20
- package/src/style/abstracts/variables/_z-index.scss +11 -0
- package/src/style/base/_+import.scss +7 -2
- package/src/style/base/_avatar.scss +61 -0
- package/src/style/base/_backdrop.scss +9 -0
- package/src/style/base/_button-group.scss +13 -0
- package/src/style/base/{_button.scss → _buttons.scss} +14 -48
- package/src/style/base/_form-check.scss +2 -1
- package/src/style/base/_input-group.scss +11 -6
- package/src/style/base/_tooltip.scss +23 -0
- package/src/style/base/_type.scss +104 -0
- package/src/style/components/_+import.scss +0 -1
- package/src/style/components/_d-datepicker.scss +7 -7
- package/src/style/components/_d-monthpicker.scss +4 -4
- package/src/style/components/_d-quick-action-button.scss +8 -0
- package/src/style/components/_d-quick-action-select.scss +2 -0
- package/src/style/components/_d-quick-action-switch.scss +4 -4
- package/src/style/components/_d-select.scss +1 -1
- package/src/style/components/_d-stepper-mobile.scss +3 -3
- package/src/style/helpers/_+import.scss +1 -0
- package/src/style/helpers/_text-truncate.scss +8 -0
- package/src/style/root/_root.scss +98 -21
- package/dist/types/contexts/DModalContext.d.ts +0 -31
- package/dist/types/contexts/DOffcanvasContext.d.ts +0 -31
- package/src/style/components/_d-tooltip.scss +0 -35
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var classNames = require('classnames');
|
|
6
6
|
var tslib = require('tslib');
|
|
7
|
+
var reactDom = require('react-dom');
|
|
7
8
|
var reactDropzone = require('react-dropzone');
|
|
8
9
|
var reactSplide = require('@splidejs/react-splide');
|
|
9
10
|
var currency = require('currency.js');
|
|
@@ -17,7 +18,6 @@ var ContentLoader = require('react-content-loader');
|
|
|
17
18
|
var reactToastify = require('react-toastify');
|
|
18
19
|
var i18n = require('i18next');
|
|
19
20
|
var reactI18next = require('react-i18next');
|
|
20
|
-
var reactDom = require('react-dom');
|
|
21
21
|
|
|
22
22
|
const PREFIX_BS = 'bs-';
|
|
23
23
|
|
|
@@ -63,71 +63,6 @@ function DIconBase({ icon, theme, style, className, size = '1.5rem', loading = f
|
|
|
63
63
|
return (jsxRuntime.jsx("i", { className: classNames(generateClasses), style: generateStyleVariables, children: materialStyle && icon }));
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
const defaultState = {
|
|
67
|
-
language: 'en',
|
|
68
|
-
currency: {
|
|
69
|
-
symbol: '$',
|
|
70
|
-
precision: 2,
|
|
71
|
-
separator: ',',
|
|
72
|
-
decimal: '.',
|
|
73
|
-
},
|
|
74
|
-
icon: {
|
|
75
|
-
familyClass: 'bi',
|
|
76
|
-
familyPrefix: 'bi-',
|
|
77
|
-
materialStyle: false,
|
|
78
|
-
},
|
|
79
|
-
iconMap: {
|
|
80
|
-
x: 'x',
|
|
81
|
-
xLg: 'x-lg',
|
|
82
|
-
chevronUp: 'chevron-up',
|
|
83
|
-
chevronDown: 'chevron-down',
|
|
84
|
-
chevronLeft: 'chevron-left',
|
|
85
|
-
chevronRight: 'chevron-right',
|
|
86
|
-
upload: 'cloud-upload',
|
|
87
|
-
calendar: 'calendar',
|
|
88
|
-
check: 'check',
|
|
89
|
-
alert: {
|
|
90
|
-
warning: 'exclamation-circle',
|
|
91
|
-
danger: 'exclamation-triangle',
|
|
92
|
-
success: 'check-circle',
|
|
93
|
-
info: 'info-circle',
|
|
94
|
-
dark: 'info-circle',
|
|
95
|
-
light: 'info-circle',
|
|
96
|
-
primary: 'info-circle',
|
|
97
|
-
secondary: 'info-circle',
|
|
98
|
-
},
|
|
99
|
-
input: {
|
|
100
|
-
invalid: 'exclamation-circle',
|
|
101
|
-
valid: 'check',
|
|
102
|
-
search: 'search',
|
|
103
|
-
show: 'eye',
|
|
104
|
-
hide: 'eye-slash',
|
|
105
|
-
increase: 'plus-square',
|
|
106
|
-
decrease: 'dash-square',
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
setContext: () => { },
|
|
110
|
-
};
|
|
111
|
-
const DContext = React.createContext(defaultState);
|
|
112
|
-
function DContextProvider({ language = defaultState.language, currency = defaultState.currency, icon = defaultState.icon, iconMap = defaultState.iconMap, children, }) {
|
|
113
|
-
const [internalContext, setInternalContext,] = React.useState({
|
|
114
|
-
language,
|
|
115
|
-
currency,
|
|
116
|
-
icon,
|
|
117
|
-
iconMap,
|
|
118
|
-
});
|
|
119
|
-
const setContext = React.useCallback((newValue) => (setInternalContext((prevInternalContext) => (Object.assign(Object.assign({}, prevInternalContext), newValue)))), []);
|
|
120
|
-
const value = React.useMemo(() => (Object.assign(Object.assign({}, internalContext), { setContext })), [internalContext, setContext]);
|
|
121
|
-
return (jsxRuntime.jsx(DContext.Provider, { value: value, children: children }));
|
|
122
|
-
}
|
|
123
|
-
function useDContext() {
|
|
124
|
-
const context = React.useContext(DContext);
|
|
125
|
-
if (context === undefined) {
|
|
126
|
-
throw new Error('useDContext was used outside of DContextProvider');
|
|
127
|
-
}
|
|
128
|
-
return context;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
66
|
function useDisableBodyScrollEffect(disable) {
|
|
132
67
|
React.useEffect(() => {
|
|
133
68
|
if (disable) {
|
|
@@ -175,20 +110,9 @@ function useStackState(initialList) {
|
|
|
175
110
|
]);
|
|
176
111
|
}, []);
|
|
177
112
|
const pop = React.useCallback(() => {
|
|
178
|
-
setList((prevList) =>
|
|
179
|
-
if (prevList.length === 0) {
|
|
180
|
-
return prevList;
|
|
181
|
-
}
|
|
182
|
-
const [, ...newList] = prevList;
|
|
183
|
-
return newList;
|
|
184
|
-
});
|
|
113
|
+
setList((prevList) => (prevList.slice(0, prevList.length - 1)));
|
|
185
114
|
}, []);
|
|
186
|
-
const peek = React.useCallback(() =>
|
|
187
|
-
if (list.length > 0) {
|
|
188
|
-
return list[list.length - 1];
|
|
189
|
-
}
|
|
190
|
-
return undefined;
|
|
191
|
-
}, [list]);
|
|
115
|
+
const peek = React.useCallback(() => list.at(-1), [list]);
|
|
192
116
|
const clear = () => setList([]);
|
|
193
117
|
const isEmpty = React.useCallback(() => list.length === 0, [list]);
|
|
194
118
|
const controls = {
|
|
@@ -202,78 +126,108 @@ function useStackState(initialList) {
|
|
|
202
126
|
return [list, controls];
|
|
203
127
|
}
|
|
204
128
|
|
|
205
|
-
const
|
|
206
|
-
function
|
|
129
|
+
const DPortalContext = React.createContext(undefined);
|
|
130
|
+
function DPortalContextProvider({ portalName, children, availablePortals, }) {
|
|
207
131
|
const { created } = usePortal(portalName);
|
|
208
|
-
const [stack, { push, pop,
|
|
132
|
+
const [stack, { push, pop, isEmpty }] = useStackState([]);
|
|
209
133
|
useDisableBodyScrollEffect(Boolean(stack.length));
|
|
210
|
-
const
|
|
211
|
-
|
|
134
|
+
const openPortal = React.useCallback((name, payload) => {
|
|
135
|
+
if (!availablePortals) {
|
|
136
|
+
throw new Error(`there is no component for portal ${name.toString()}`);
|
|
137
|
+
}
|
|
138
|
+
const Component = availablePortals[name];
|
|
212
139
|
if (!Component) {
|
|
213
|
-
throw new Error(`there is no component for
|
|
140
|
+
throw new Error(`there is no component for portal ${name.toString()}`);
|
|
214
141
|
}
|
|
215
142
|
push({
|
|
216
|
-
|
|
143
|
+
name,
|
|
217
144
|
Component,
|
|
218
145
|
payload,
|
|
219
146
|
});
|
|
220
|
-
}, [
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
if (!stackItem) {
|
|
147
|
+
}, [availablePortals, push]);
|
|
148
|
+
const closePortal = React.useCallback(() => {
|
|
149
|
+
if (isEmpty()) {
|
|
224
150
|
return;
|
|
225
151
|
}
|
|
226
152
|
pop();
|
|
227
|
-
}, [
|
|
153
|
+
}, [isEmpty, pop]);
|
|
228
154
|
const value = React.useMemo(() => ({
|
|
229
155
|
stack,
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}), [stack,
|
|
233
|
-
return (jsxRuntime.jsxs(
|
|
156
|
+
openPortal,
|
|
157
|
+
closePortal,
|
|
158
|
+
}), [stack, openPortal, closePortal]);
|
|
159
|
+
return (jsxRuntime.jsxs(DPortalContext.Provider, { value: value, children: [children, created && reactDom.createPortal(jsxRuntime.jsx(jsxRuntime.Fragment, { children: stack.map(({ Component, name, payload, }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "backdrop fade show" }), jsxRuntime.jsx(Component, { name: name, payload: payload })] }))) }), document.getElementById(portalName))] }));
|
|
234
160
|
}
|
|
235
|
-
function
|
|
236
|
-
const context = React.useContext(
|
|
161
|
+
function useDPortalContext() {
|
|
162
|
+
const context = React.useContext(DPortalContext);
|
|
237
163
|
if (context === undefined) {
|
|
238
|
-
throw new Error('
|
|
164
|
+
throw new Error('usePortalContext was used outside of PortalContextProvider');
|
|
239
165
|
}
|
|
240
166
|
return context;
|
|
241
167
|
}
|
|
242
168
|
|
|
243
|
-
const
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
169
|
+
const defaultState = {
|
|
170
|
+
language: 'en',
|
|
171
|
+
currency: {
|
|
172
|
+
symbol: '$',
|
|
173
|
+
precision: 2,
|
|
174
|
+
separator: ',',
|
|
175
|
+
decimal: '.',
|
|
176
|
+
},
|
|
177
|
+
icon: {
|
|
178
|
+
familyClass: 'bi',
|
|
179
|
+
familyPrefix: 'bi-',
|
|
180
|
+
materialStyle: false,
|
|
181
|
+
},
|
|
182
|
+
iconMap: {
|
|
183
|
+
x: 'x',
|
|
184
|
+
xLg: 'x-lg',
|
|
185
|
+
chevronUp: 'chevron-up',
|
|
186
|
+
chevronDown: 'chevron-down',
|
|
187
|
+
chevronLeft: 'chevron-left',
|
|
188
|
+
chevronRight: 'chevron-right',
|
|
189
|
+
upload: 'cloud-upload',
|
|
190
|
+
calendar: 'calendar',
|
|
191
|
+
check: 'check',
|
|
192
|
+
alert: {
|
|
193
|
+
warning: 'exclamation-circle',
|
|
194
|
+
danger: 'exclamation-triangle',
|
|
195
|
+
success: 'check-circle',
|
|
196
|
+
info: 'info-circle',
|
|
197
|
+
dark: 'info-circle',
|
|
198
|
+
light: 'info-circle',
|
|
199
|
+
primary: 'info-circle',
|
|
200
|
+
secondary: 'info-circle',
|
|
201
|
+
},
|
|
202
|
+
input: {
|
|
203
|
+
invalid: 'exclamation-circle',
|
|
204
|
+
valid: 'check',
|
|
205
|
+
search: 'search',
|
|
206
|
+
show: 'eye',
|
|
207
|
+
hide: 'eye-slash',
|
|
208
|
+
increase: 'plus-square',
|
|
209
|
+
decrease: 'dash-square',
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
setContext: () => { },
|
|
213
|
+
portalName: 'd-portal',
|
|
214
|
+
};
|
|
215
|
+
const DContext = React.createContext(defaultState);
|
|
216
|
+
function DContextProvider({ language = defaultState.language, currency = defaultState.currency, icon = defaultState.icon, iconMap = defaultState.iconMap, portalName = defaultState.portalName, availablePortals, children, }) {
|
|
217
|
+
const [internalContext, setInternalContext,] = React.useState({
|
|
218
|
+
language,
|
|
219
|
+
currency,
|
|
220
|
+
icon,
|
|
221
|
+
iconMap,
|
|
222
|
+
});
|
|
223
|
+
const setContext = React.useCallback((newValue) => (setInternalContext((prevInternalContext) => (Object.assign(Object.assign({}, prevInternalContext), newValue)))), []);
|
|
224
|
+
const value = React.useMemo(() => (Object.assign(Object.assign({}, internalContext), { setContext })), [internalContext, setContext]);
|
|
225
|
+
return (jsxRuntime.jsx(DContext.Provider, { value: value, children: jsxRuntime.jsx(DPortalContextProvider, { portalName: portalName, availablePortals: availablePortals, children: children }) }));
|
|
272
226
|
}
|
|
273
|
-
function
|
|
274
|
-
const context = React.useContext(
|
|
227
|
+
function useDContext() {
|
|
228
|
+
const context = React.useContext(DContext);
|
|
275
229
|
if (context === undefined) {
|
|
276
|
-
throw new Error('
|
|
230
|
+
throw new Error('useDContext was used outside of DContextProvider');
|
|
277
231
|
}
|
|
278
232
|
return context;
|
|
279
233
|
}
|
|
@@ -363,9 +317,9 @@ function DCarouselSlide(_a) {
|
|
|
363
317
|
return (jsxRuntime.jsx(reactSplide.SplideSlide, Object.assign({ className: classNames('d-carousel-slide', className) }, props)));
|
|
364
318
|
}
|
|
365
319
|
|
|
366
|
-
function DCarousel(_a) {
|
|
320
|
+
function DCarousel(_a, ref) {
|
|
367
321
|
var { children, className, style, options } = _a, props = tslib.__rest(_a, ["children", "className", "style", "options"]);
|
|
368
|
-
return (jsxRuntime.jsx(reactSplide.Splide, Object.assign({ className: classNames('d-carousel', className), style: style, options: Object.assign(Object.assign({}, options), { classes: {
|
|
322
|
+
return (jsxRuntime.jsx(reactSplide.Splide, Object.assign({ className: classNames('d-carousel', className), style: style, ref: ref, options: Object.assign(Object.assign({}, options), { classes: {
|
|
369
323
|
// Arrows
|
|
370
324
|
arrows: 'splide__arrows d-carousel-arrows',
|
|
371
325
|
arrow: 'splide__arrow d-carousel-arrow',
|
|
@@ -376,7 +330,9 @@ function DCarousel(_a) {
|
|
|
376
330
|
page: 'splide__pagination__page d-carousel-pagination-page',
|
|
377
331
|
} }) }, props, { children: children })));
|
|
378
332
|
}
|
|
379
|
-
|
|
333
|
+
const ForwardedDCarousel = React.forwardRef(DCarousel);
|
|
334
|
+
ForwardedDCarousel.displayName = 'DCarousel';
|
|
335
|
+
var DCarousel$1 = Object.assign(ForwardedDCarousel, {
|
|
380
336
|
Slide: DCarouselSlide,
|
|
381
337
|
});
|
|
382
338
|
|
|
@@ -407,7 +363,7 @@ function DCollapse({ id, className, style, Component, hasSeparator = false, defa
|
|
|
407
363
|
const generateStyles = React.useMemo(() => ({
|
|
408
364
|
[`--${PREFIX_BS}collapse-separator-display`]: hasSeparator ? 'block' : 'none',
|
|
409
365
|
}), [hasSeparator]);
|
|
410
|
-
return (jsxRuntime.jsxs("div", { id: id, className: classNames('collapse-container', className), style: style, children: [jsxRuntime.jsxs("button", { className: "collapse-button", type: "button", onClick: onChangeCollapse, children: [jsxRuntime.jsx("div", { className: "flex-grow-1", children: Component }), jsxRuntime.jsx(DIcon, { color: `var(--${PREFIX_BS}gray)`, size: `var(--${PREFIX_BS}
|
|
366
|
+
return (jsxRuntime.jsxs("div", { id: id, className: classNames('collapse-container', className), style: style, children: [jsxRuntime.jsxs("button", { className: "collapse-button", type: "button", onClick: onChangeCollapse, children: [jsxRuntime.jsx("div", { className: "flex-grow-1", children: Component }), jsxRuntime.jsx(DIcon, { color: `var(--${PREFIX_BS}gray)`, size: `var(--${PREFIX_BS}fs-small)`, icon: toggle ? iconOpen : iconClose, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle })] }), toggle && (jsxRuntime.jsx("div", { className: classNames({
|
|
411
367
|
'collapse-body': true,
|
|
412
368
|
}), style: generateStyles, children: children }))] }));
|
|
413
369
|
}
|
|
@@ -1059,7 +1015,7 @@ function DModal({ name, className, style, staticBackdrop, scrollable, centered,
|
|
|
1059
1015
|
}
|
|
1060
1016
|
return '';
|
|
1061
1017
|
}, [fullScreenFrom, fullScreen]);
|
|
1062
|
-
const generateClasses = React.useMemo(() => (Object.assign({ 'modal fade show': true }, className && { [className]: true })), [className]);
|
|
1018
|
+
const generateClasses = React.useMemo(() => (Object.assign({ 'modal portal fade show': true }, className && { [className]: true })), [className]);
|
|
1063
1019
|
const generateModalDialogClasses = React.useMemo(() => (Object.assign({ 'modal-dialog': true, 'modal-dialog-centered': !!centered, 'modal-dialog-scrollable': !!scrollable, [fullScreenClass]: !!fullScreen }, size && { [`modal-${size}`]: true })), [fullScreenClass, centered, fullScreen, scrollable, size]);
|
|
1064
1020
|
return (jsxRuntime.jsx("div", Object.assign({ className: classNames(generateClasses), id: name, tabIndex: -1, "aria-labelledby": `${name}Label`, "aria-hidden": "false", style: style }, staticBackdrop && ({
|
|
1065
1021
|
[`data-${PREFIX_BS}backdrop`]: 'static',
|
|
@@ -1087,7 +1043,7 @@ function DOffcanvasFooter({ footerActionPlacement = 'fill', children, className,
|
|
|
1087
1043
|
}
|
|
1088
1044
|
|
|
1089
1045
|
function DOffcanvas({ name, className, style, staticBackdrop, scrollable, openFrom = 'end', children, }) {
|
|
1090
|
-
return (jsxRuntime.jsx("div", Object.assign({ className: classNames('offcanvas show', {
|
|
1046
|
+
return (jsxRuntime.jsx("div", Object.assign({ className: classNames('offcanvas portal show', {
|
|
1091
1047
|
[`offcanvas-${openFrom}`]: openFrom,
|
|
1092
1048
|
}, className), style: style, id: name, tabIndex: -1, "aria-labelledby": `${name}Label`, "aria-hidden": "false" }, staticBackdrop && ({
|
|
1093
1049
|
[`data-${PREFIX_BS}backdrop`]: 'static',
|
|
@@ -1205,7 +1161,7 @@ function DQuickActionSwitch({ id, name, label, hint, checked, disabled, classNam
|
|
|
1205
1161
|
event.stopPropagation();
|
|
1206
1162
|
onClick === null || onClick === void 0 ? void 0 : onClick(checked);
|
|
1207
1163
|
}, [checked, onClick]);
|
|
1208
|
-
return (jsxRuntime.jsxs("button", { className: classNames('d-quick-action-switch', className), type: "button", onClick: clickHandler, style: style, children: [jsxRuntime.
|
|
1164
|
+
return (jsxRuntime.jsxs("button", { className: classNames('d-quick-action-switch', className), type: "button", onClick: clickHandler, style: style, children: [jsxRuntime.jsx("div", { className: "d-quick-action-switch-content", children: jsxRuntime.jsx(DInputSwitch, { id: id, name: name, disabled: disabled, checked: checked, readonly: true, label: label }) }), jsxRuntime.jsx("div", { className: "d-quick-action-switch-hint", children: hint })] }));
|
|
1209
1165
|
}
|
|
1210
1166
|
|
|
1211
1167
|
function DSkeleton({ speed = 2, viewBox, backgroundColor, foregroundColor, children, }) {
|
|
@@ -1312,8 +1268,8 @@ function DTooltip({ className, childrenClassName, style, offSet = ARROW_HEIGHT +
|
|
|
1312
1268
|
dismiss,
|
|
1313
1269
|
role,
|
|
1314
1270
|
]);
|
|
1315
|
-
const generateClasses = React.useMemo(() => (Object.assign({ '
|
|
1316
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", Object.assign({ className: childrenClassName, ref: refs.setReference }, getReferenceProps(), { children: Component })), jsxRuntime.jsx(react.FloatingPortal, { children: isOpen && (jsxRuntime.jsxs("div", Object.assign({ className: classNames(generateClasses), ref: refs.setFloating, style: Object.assign(Object.assign({}, floatingStyles), style) }, getFloatingProps(), { children: [jsxRuntime.jsx(react.FloatingArrow, { ref: arrowRef, context: context, width: ARROW_WIDTH, height: ARROW_HEIGHT }), children] }))) })] }));
|
|
1271
|
+
const generateClasses = React.useMemo(() => (Object.assign({ 'tooltip show': true, [`tooltip-${size}`]: !!size, [`tooltip-${theme}`]: !!theme }, className && { [className]: true })), [size, theme, className]);
|
|
1272
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", Object.assign({ className: childrenClassName, ref: refs.setReference }, getReferenceProps(), { children: Component })), jsxRuntime.jsx(react.FloatingPortal, { children: isOpen && (jsxRuntime.jsxs("div", Object.assign({ className: classNames(generateClasses), ref: refs.setFloating, style: Object.assign(Object.assign({}, floatingStyles), style) }, getFloatingProps(), { children: [jsxRuntime.jsx(react.FloatingArrow, { ref: arrowRef, context: context, width: ARROW_WIDTH, height: ARROW_HEIGHT }), jsxRuntime.jsx("div", { className: "tooltip-inner", children: children })] }))) })] }));
|
|
1317
1273
|
}
|
|
1318
1274
|
|
|
1319
1275
|
const TabContext = React.createContext(undefined);
|
|
@@ -1360,17 +1316,27 @@ var DTabs$1 = Object.assign(DTabs, {
|
|
|
1360
1316
|
Tab: DTabContent,
|
|
1361
1317
|
});
|
|
1362
1318
|
|
|
1363
|
-
|
|
1364
|
-
|
|
1319
|
+
const TOAST_TRANSITIONS$1 = {
|
|
1320
|
+
bounce: reactToastify.Bounce,
|
|
1321
|
+
flip: reactToastify.Flip,
|
|
1322
|
+
slide: reactToastify.Slide,
|
|
1323
|
+
zoom: reactToastify.Zoom,
|
|
1324
|
+
};
|
|
1325
|
+
function DToastContainer({ style, className, closeOnClick, position = 'bottom-center', autoClose = false, stacked = false, transition = 'slide', containerId, }) {
|
|
1326
|
+
const selectedTransition = React.useMemo(() => TOAST_TRANSITIONS$1[transition], [transition]);
|
|
1327
|
+
return (jsxRuntime.jsx(reactToastify.ToastContainer, { toastClassName: () => classNames('shadow-none p-0 cursor-default', className), position: position, autoClose: autoClose, closeOnClick: closeOnClick, transition: selectedTransition, closeButton: false, style: style, hideProgressBar: true, stacked: stacked, containerId: containerId }));
|
|
1365
1328
|
}
|
|
1366
1329
|
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1330
|
+
const TOAST_TRANSITIONS = {
|
|
1331
|
+
bounce: reactToastify.Bounce,
|
|
1332
|
+
flip: reactToastify.Flip,
|
|
1333
|
+
slide: reactToastify.Slide,
|
|
1334
|
+
zoom: reactToastify.Zoom,
|
|
1335
|
+
};
|
|
1336
|
+
function useDToast() {
|
|
1337
|
+
const toast = React.useCallback((message, _a) => {
|
|
1338
|
+
var { icon, iconClose, type = 'info', showClose = true, transition } = _a, rest = tslib.__rest(_a, ["icon", "iconClose", "type", "showClose", "transition"]);
|
|
1339
|
+
reactToastify.toast(({ closeToast }) => (jsxRuntime.jsx(DAlert, { onClose: closeToast, id: "alertID", type: type, icon: icon, iconClose: iconClose, showClose: showClose, children: message })), Object.assign({ transition: transition && TOAST_TRANSITIONS[transition] }, rest));
|
|
1374
1340
|
}, []);
|
|
1375
1341
|
return {
|
|
1376
1342
|
toast,
|
|
@@ -1424,18 +1390,16 @@ exports.DList = DList$1;
|
|
|
1424
1390
|
exports.DListItem = DListItem;
|
|
1425
1391
|
exports.DModal = DModal$1;
|
|
1426
1392
|
exports.DModalBody = DModalBody;
|
|
1427
|
-
exports.DModalContext = DModalContext;
|
|
1428
|
-
exports.DModalContextProvider = DModalContextProvider;
|
|
1429
1393
|
exports.DModalFooter = DModalFooter;
|
|
1430
1394
|
exports.DModalHeader = DModalHeader;
|
|
1431
1395
|
exports.DOffcanvas = DOffcanvas$1;
|
|
1432
1396
|
exports.DOffcanvasBody = DOffcanvasBody;
|
|
1433
|
-
exports.DOffcanvasContext = DOffcanvasContext;
|
|
1434
|
-
exports.DOffcanvasContextProvider = DOffcanvasContextProvider;
|
|
1435
1397
|
exports.DOffcanvasFooter = DOffcanvasFooter;
|
|
1436
1398
|
exports.DOffcanvasHeader = DOffcanvasHeader;
|
|
1437
1399
|
exports.DPaginator = DPaginator;
|
|
1438
1400
|
exports.DPopover = DPopover;
|
|
1401
|
+
exports.DPortalContext = DPortalContext;
|
|
1402
|
+
exports.DPortalContextProvider = DPortalContextProvider;
|
|
1439
1403
|
exports.DProgress = DProgress;
|
|
1440
1404
|
exports.DQuickActionButton = DQuickActionButton;
|
|
1441
1405
|
exports.DQuickActionCheck = DQuickActionCheck;
|
|
@@ -1453,8 +1417,8 @@ exports.DTooltip = DTooltip;
|
|
|
1453
1417
|
exports.configureI18n = configureI8n;
|
|
1454
1418
|
exports.formatCurrency = formatCurrency;
|
|
1455
1419
|
exports.useDContext = useDContext;
|
|
1456
|
-
exports.
|
|
1457
|
-
exports.
|
|
1420
|
+
exports.useDPortalContext = useDPortalContext;
|
|
1421
|
+
exports.useDToast = useDToast;
|
|
1458
1422
|
exports.useDisableBodyScrollEffect = useDisableBodyScrollEffect;
|
|
1459
1423
|
exports.useDisableInputWheel = useDisableInputWheel;
|
|
1460
1424
|
exports.useFormatCurrency = useFormatCurrency;
|
|
@@ -1463,5 +1427,4 @@ exports.usePortal = usePortal;
|
|
|
1463
1427
|
exports.useProvidedRefOrCreate = useProvidedRefOrCreate;
|
|
1464
1428
|
exports.useStackState = useStackState;
|
|
1465
1429
|
exports.useTabContext = useTabContext;
|
|
1466
|
-
exports.useToast = useToast;
|
|
1467
1430
|
//# sourceMappingURL=index.js.map
|