@dynamic-framework/ui-react 1.17.1 → 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 +1365 -873
- package/dist/css/dynamic-ui-non-root.min.css +2 -2
- package/dist/css/dynamic-ui-root.css +493 -26
- package/dist/css/dynamic-ui-root.min.css +2 -2
- package/dist/css/dynamic-ui.css +1857 -898
- package/dist/css/dynamic-ui.min.css +2 -2
- package/dist/index.esm.js +119 -163
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +120 -167
- 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/DButton/DButton.d.ts +1 -1
- 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/_buttons.scss +3 -3
- 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 -53
- 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 -17
- 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.esm.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import React, { useMemo,
|
|
2
|
+
import React, { useMemo, useEffect, useState, useCallback, createContext, useContext, forwardRef, useRef } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { __rest } from 'tslib';
|
|
5
|
+
import { createPortal } from 'react-dom';
|
|
5
6
|
import { useDropzone } from 'react-dropzone';
|
|
6
7
|
import { SplideSlide, Splide } from '@splidejs/react-splide';
|
|
7
8
|
import currency from 'currency.js';
|
|
@@ -12,10 +13,9 @@ import Select, { components } from 'react-select';
|
|
|
12
13
|
import ResponsivePagination from 'react-responsive-pagination';
|
|
13
14
|
import { useFloating, offset, flip, shift, autoUpdate, useClick, useDismiss, useRole, useInteractions, useId, FloatingFocusManager, arrow, useHover, useFocus, FloatingPortal, FloatingArrow } from '@floating-ui/react';
|
|
14
15
|
import ContentLoader from 'react-content-loader';
|
|
15
|
-
import { ToastContainer, Slide, toast } from 'react-toastify';
|
|
16
|
+
import { ToastContainer, Bounce, Flip, Slide, Zoom, toast } from 'react-toastify';
|
|
16
17
|
import i18n from 'i18next';
|
|
17
18
|
import { initReactI18next } from 'react-i18next';
|
|
18
|
-
import { createPortal } from 'react-dom';
|
|
19
19
|
|
|
20
20
|
const PREFIX_BS = 'bs-';
|
|
21
21
|
|
|
@@ -61,71 +61,6 @@ function DIconBase({ icon, theme, style, className, size = '1.5rem', loading = f
|
|
|
61
61
|
return (jsx("i", { className: classNames(generateClasses), style: generateStyleVariables, children: materialStyle && icon }));
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
const defaultState = {
|
|
65
|
-
language: 'en',
|
|
66
|
-
currency: {
|
|
67
|
-
symbol: '$',
|
|
68
|
-
precision: 2,
|
|
69
|
-
separator: ',',
|
|
70
|
-
decimal: '.',
|
|
71
|
-
},
|
|
72
|
-
icon: {
|
|
73
|
-
familyClass: 'bi',
|
|
74
|
-
familyPrefix: 'bi-',
|
|
75
|
-
materialStyle: false,
|
|
76
|
-
},
|
|
77
|
-
iconMap: {
|
|
78
|
-
x: 'x',
|
|
79
|
-
xLg: 'x-lg',
|
|
80
|
-
chevronUp: 'chevron-up',
|
|
81
|
-
chevronDown: 'chevron-down',
|
|
82
|
-
chevronLeft: 'chevron-left',
|
|
83
|
-
chevronRight: 'chevron-right',
|
|
84
|
-
upload: 'cloud-upload',
|
|
85
|
-
calendar: 'calendar',
|
|
86
|
-
check: 'check',
|
|
87
|
-
alert: {
|
|
88
|
-
warning: 'exclamation-circle',
|
|
89
|
-
danger: 'exclamation-triangle',
|
|
90
|
-
success: 'check-circle',
|
|
91
|
-
info: 'info-circle',
|
|
92
|
-
dark: 'info-circle',
|
|
93
|
-
light: 'info-circle',
|
|
94
|
-
primary: 'info-circle',
|
|
95
|
-
secondary: 'info-circle',
|
|
96
|
-
},
|
|
97
|
-
input: {
|
|
98
|
-
invalid: 'exclamation-circle',
|
|
99
|
-
valid: 'check',
|
|
100
|
-
search: 'search',
|
|
101
|
-
show: 'eye',
|
|
102
|
-
hide: 'eye-slash',
|
|
103
|
-
increase: 'plus-square',
|
|
104
|
-
decrease: 'dash-square',
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
setContext: () => { },
|
|
108
|
-
};
|
|
109
|
-
const DContext = createContext(defaultState);
|
|
110
|
-
function DContextProvider({ language = defaultState.language, currency = defaultState.currency, icon = defaultState.icon, iconMap = defaultState.iconMap, children, }) {
|
|
111
|
-
const [internalContext, setInternalContext,] = useState({
|
|
112
|
-
language,
|
|
113
|
-
currency,
|
|
114
|
-
icon,
|
|
115
|
-
iconMap,
|
|
116
|
-
});
|
|
117
|
-
const setContext = useCallback((newValue) => (setInternalContext((prevInternalContext) => (Object.assign(Object.assign({}, prevInternalContext), newValue)))), []);
|
|
118
|
-
const value = useMemo(() => (Object.assign(Object.assign({}, internalContext), { setContext })), [internalContext, setContext]);
|
|
119
|
-
return (jsx(DContext.Provider, { value: value, children: children }));
|
|
120
|
-
}
|
|
121
|
-
function useDContext() {
|
|
122
|
-
const context = useContext(DContext);
|
|
123
|
-
if (context === undefined) {
|
|
124
|
-
throw new Error('useDContext was used outside of DContextProvider');
|
|
125
|
-
}
|
|
126
|
-
return context;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
64
|
function useDisableBodyScrollEffect(disable) {
|
|
130
65
|
useEffect(() => {
|
|
131
66
|
if (disable) {
|
|
@@ -173,20 +108,9 @@ function useStackState(initialList) {
|
|
|
173
108
|
]);
|
|
174
109
|
}, []);
|
|
175
110
|
const pop = useCallback(() => {
|
|
176
|
-
setList((prevList) =>
|
|
177
|
-
if (prevList.length === 0) {
|
|
178
|
-
return prevList;
|
|
179
|
-
}
|
|
180
|
-
const [, ...newList] = prevList;
|
|
181
|
-
return newList;
|
|
182
|
-
});
|
|
111
|
+
setList((prevList) => (prevList.slice(0, prevList.length - 1)));
|
|
183
112
|
}, []);
|
|
184
|
-
const peek = useCallback(() =>
|
|
185
|
-
if (list.length > 0) {
|
|
186
|
-
return list[list.length - 1];
|
|
187
|
-
}
|
|
188
|
-
return undefined;
|
|
189
|
-
}, [list]);
|
|
113
|
+
const peek = useCallback(() => list.at(-1), [list]);
|
|
190
114
|
const clear = () => setList([]);
|
|
191
115
|
const isEmpty = useCallback(() => list.length === 0, [list]);
|
|
192
116
|
const controls = {
|
|
@@ -200,78 +124,108 @@ function useStackState(initialList) {
|
|
|
200
124
|
return [list, controls];
|
|
201
125
|
}
|
|
202
126
|
|
|
203
|
-
const
|
|
204
|
-
function
|
|
127
|
+
const DPortalContext = createContext(undefined);
|
|
128
|
+
function DPortalContextProvider({ portalName, children, availablePortals, }) {
|
|
205
129
|
const { created } = usePortal(portalName);
|
|
206
|
-
const [stack, { push, pop,
|
|
130
|
+
const [stack, { push, pop, isEmpty }] = useStackState([]);
|
|
207
131
|
useDisableBodyScrollEffect(Boolean(stack.length));
|
|
208
|
-
const
|
|
209
|
-
|
|
132
|
+
const openPortal = useCallback((name, payload) => {
|
|
133
|
+
if (!availablePortals) {
|
|
134
|
+
throw new Error(`there is no component for portal ${name.toString()}`);
|
|
135
|
+
}
|
|
136
|
+
const Component = availablePortals[name];
|
|
210
137
|
if (!Component) {
|
|
211
|
-
throw new Error(`there is no component for
|
|
138
|
+
throw new Error(`there is no component for portal ${name.toString()}`);
|
|
212
139
|
}
|
|
213
140
|
push({
|
|
214
|
-
|
|
141
|
+
name,
|
|
215
142
|
Component,
|
|
216
143
|
payload,
|
|
217
144
|
});
|
|
218
|
-
}, [
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
if (!stackItem) {
|
|
145
|
+
}, [availablePortals, push]);
|
|
146
|
+
const closePortal = useCallback(() => {
|
|
147
|
+
if (isEmpty()) {
|
|
222
148
|
return;
|
|
223
149
|
}
|
|
224
150
|
pop();
|
|
225
|
-
}, [
|
|
151
|
+
}, [isEmpty, pop]);
|
|
226
152
|
const value = useMemo(() => ({
|
|
227
153
|
stack,
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}), [stack,
|
|
231
|
-
return (jsxs(
|
|
154
|
+
openPortal,
|
|
155
|
+
closePortal,
|
|
156
|
+
}), [stack, openPortal, closePortal]);
|
|
157
|
+
return (jsxs(DPortalContext.Provider, { value: value, children: [children, created && createPortal(jsx(Fragment, { children: stack.map(({ Component, name, payload, }) => (jsxs(Fragment, { children: [jsx("div", { className: "backdrop fade show" }), jsx(Component, { name: name, payload: payload })] }))) }), document.getElementById(portalName))] }));
|
|
232
158
|
}
|
|
233
|
-
function
|
|
234
|
-
const context = useContext(
|
|
159
|
+
function useDPortalContext() {
|
|
160
|
+
const context = useContext(DPortalContext);
|
|
235
161
|
if (context === undefined) {
|
|
236
|
-
throw new Error('
|
|
162
|
+
throw new Error('usePortalContext was used outside of PortalContextProvider');
|
|
237
163
|
}
|
|
238
164
|
return context;
|
|
239
165
|
}
|
|
240
166
|
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
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
|
-
|
|
167
|
+
const defaultState = {
|
|
168
|
+
language: 'en',
|
|
169
|
+
currency: {
|
|
170
|
+
symbol: '$',
|
|
171
|
+
precision: 2,
|
|
172
|
+
separator: ',',
|
|
173
|
+
decimal: '.',
|
|
174
|
+
},
|
|
175
|
+
icon: {
|
|
176
|
+
familyClass: 'bi',
|
|
177
|
+
familyPrefix: 'bi-',
|
|
178
|
+
materialStyle: false,
|
|
179
|
+
},
|
|
180
|
+
iconMap: {
|
|
181
|
+
x: 'x',
|
|
182
|
+
xLg: 'x-lg',
|
|
183
|
+
chevronUp: 'chevron-up',
|
|
184
|
+
chevronDown: 'chevron-down',
|
|
185
|
+
chevronLeft: 'chevron-left',
|
|
186
|
+
chevronRight: 'chevron-right',
|
|
187
|
+
upload: 'cloud-upload',
|
|
188
|
+
calendar: 'calendar',
|
|
189
|
+
check: 'check',
|
|
190
|
+
alert: {
|
|
191
|
+
warning: 'exclamation-circle',
|
|
192
|
+
danger: 'exclamation-triangle',
|
|
193
|
+
success: 'check-circle',
|
|
194
|
+
info: 'info-circle',
|
|
195
|
+
dark: 'info-circle',
|
|
196
|
+
light: 'info-circle',
|
|
197
|
+
primary: 'info-circle',
|
|
198
|
+
secondary: 'info-circle',
|
|
199
|
+
},
|
|
200
|
+
input: {
|
|
201
|
+
invalid: 'exclamation-circle',
|
|
202
|
+
valid: 'check',
|
|
203
|
+
search: 'search',
|
|
204
|
+
show: 'eye',
|
|
205
|
+
hide: 'eye-slash',
|
|
206
|
+
increase: 'plus-square',
|
|
207
|
+
decrease: 'dash-square',
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
setContext: () => { },
|
|
211
|
+
portalName: 'd-portal',
|
|
212
|
+
};
|
|
213
|
+
const DContext = createContext(defaultState);
|
|
214
|
+
function DContextProvider({ language = defaultState.language, currency = defaultState.currency, icon = defaultState.icon, iconMap = defaultState.iconMap, portalName = defaultState.portalName, availablePortals, children, }) {
|
|
215
|
+
const [internalContext, setInternalContext,] = useState({
|
|
216
|
+
language,
|
|
217
|
+
currency,
|
|
218
|
+
icon,
|
|
219
|
+
iconMap,
|
|
220
|
+
});
|
|
221
|
+
const setContext = useCallback((newValue) => (setInternalContext((prevInternalContext) => (Object.assign(Object.assign({}, prevInternalContext), newValue)))), []);
|
|
222
|
+
const value = useMemo(() => (Object.assign(Object.assign({}, internalContext), { setContext })), [internalContext, setContext]);
|
|
223
|
+
return (jsx(DContext.Provider, { value: value, children: jsx(DPortalContextProvider, { portalName: portalName, availablePortals: availablePortals, children: children }) }));
|
|
270
224
|
}
|
|
271
|
-
function
|
|
272
|
-
const context = useContext(
|
|
225
|
+
function useDContext() {
|
|
226
|
+
const context = useContext(DContext);
|
|
273
227
|
if (context === undefined) {
|
|
274
|
-
throw new Error('
|
|
228
|
+
throw new Error('useDContext was used outside of DContextProvider');
|
|
275
229
|
}
|
|
276
230
|
return context;
|
|
277
231
|
}
|
|
@@ -315,23 +269,13 @@ function DBoxFile(_a) {
|
|
|
315
269
|
}), { children: [jsx("input", Object.assign({}, getInputProps())), jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle }), jsx("div", { className: "d-box-content", children: children })] })), !!acceptedFiles.length && (jsx("aside", { className: "d-box-files", children: acceptedFiles.map((file) => (jsx("div", { className: "d-box-files-text", children: `${file.name} - ${file.size} bytes` }, file.name))) }))] }));
|
|
316
270
|
}
|
|
317
271
|
|
|
318
|
-
function DButton({ theme = 'primary', size, variant, state, text = '', ariaLabel, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconStartMaterialStyle, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, iconEndMaterialStyle, value, type = 'button',
|
|
272
|
+
function DButton({ theme = 'primary', size, variant, state, text = '', ariaLabel, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconStartMaterialStyle, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, iconEndMaterialStyle, value, type = 'button', loading = false, loadingAriaLabel, disabled = false, stopPropagationEnabled = true, className, style, form, onClick, }) {
|
|
319
273
|
const generateClasses = useMemo(() => {
|
|
320
274
|
const variantClass = variant
|
|
321
275
|
? `btn-${variant}-${theme}`
|
|
322
276
|
: `btn-${theme}`;
|
|
323
277
|
return Object.assign(Object.assign(Object.assign({ btn: true, [variantClass]: true }, size && { [`btn-${size}`]: true }), (state && state !== 'disabled') && { [state]: true }), { loading });
|
|
324
278
|
}, [variant, theme, size, state, loading]);
|
|
325
|
-
const generateStyleVariables = useMemo(() => {
|
|
326
|
-
if (pill) {
|
|
327
|
-
return {
|
|
328
|
-
[`--${PREFIX_BS}btn-component-border-radius`]: `var(--${PREFIX_BS}border-radius-pill)`,
|
|
329
|
-
[`--${PREFIX_BS}btn-component-lg-border-radius`]: `var(--${PREFIX_BS}border-radius-pill)`,
|
|
330
|
-
[`--${PREFIX_BS}btn-component-sm-border-radius`]: `var(--${PREFIX_BS}border-radius-pill)`,
|
|
331
|
-
};
|
|
332
|
-
}
|
|
333
|
-
return {};
|
|
334
|
-
}, [pill]);
|
|
335
279
|
const clickHandler = useCallback((event) => {
|
|
336
280
|
if (stopPropagationEnabled) {
|
|
337
281
|
event.stopPropagation();
|
|
@@ -342,7 +286,7 @@ function DButton({ theme = 'primary', size, variant, state, text = '', ariaLabel
|
|
|
342
286
|
const newAriaLabel = useMemo(() => (loading
|
|
343
287
|
? (loadingAriaLabel || ariaLabel || text)
|
|
344
288
|
: (ariaLabel || text)), [loading, loadingAriaLabel, ariaLabel, text]);
|
|
345
|
-
return (jsxs("button", Object.assign({ className: classNames(generateClasses, className), style:
|
|
289
|
+
return (jsxs("button", Object.assign({ className: classNames(generateClasses, className), style: style, type: type, disabled: isDisabled, onClick: clickHandler, "aria-label": newAriaLabel, form: form }, value && { value }, { children: [iconStart && (jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix, materialStyle: iconStartMaterialStyle })), (text && !loading) && (jsx("span", { children: text })), loading && (jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsx("span", { className: "visually-hidden", children: "Loading..." }) })), iconEnd && (jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix, materialStyle: iconEndMaterialStyle }))] })));
|
|
346
290
|
}
|
|
347
291
|
|
|
348
292
|
function DCardHeader({ className, style, children, }) {
|
|
@@ -371,9 +315,9 @@ function DCarouselSlide(_a) {
|
|
|
371
315
|
return (jsx(SplideSlide, Object.assign({ className: classNames('d-carousel-slide', className) }, props)));
|
|
372
316
|
}
|
|
373
317
|
|
|
374
|
-
function DCarousel(_a) {
|
|
318
|
+
function DCarousel(_a, ref) {
|
|
375
319
|
var { children, className, style, options } = _a, props = __rest(_a, ["children", "className", "style", "options"]);
|
|
376
|
-
return (jsx(Splide, Object.assign({ className: classNames('d-carousel', className), style: style, options: Object.assign(Object.assign({}, options), { classes: {
|
|
320
|
+
return (jsx(Splide, Object.assign({ className: classNames('d-carousel', className), style: style, ref: ref, options: Object.assign(Object.assign({}, options), { classes: {
|
|
377
321
|
// Arrows
|
|
378
322
|
arrows: 'splide__arrows d-carousel-arrows',
|
|
379
323
|
arrow: 'splide__arrow d-carousel-arrow',
|
|
@@ -384,7 +328,9 @@ function DCarousel(_a) {
|
|
|
384
328
|
page: 'splide__pagination__page d-carousel-pagination-page',
|
|
385
329
|
} }) }, props, { children: children })));
|
|
386
330
|
}
|
|
387
|
-
|
|
331
|
+
const ForwardedDCarousel = forwardRef(DCarousel);
|
|
332
|
+
ForwardedDCarousel.displayName = 'DCarousel';
|
|
333
|
+
var DCarousel$1 = Object.assign(ForwardedDCarousel, {
|
|
388
334
|
Slide: DCarouselSlide,
|
|
389
335
|
});
|
|
390
336
|
|
|
@@ -415,7 +361,7 @@ function DCollapse({ id, className, style, Component, hasSeparator = false, defa
|
|
|
415
361
|
const generateStyles = useMemo(() => ({
|
|
416
362
|
[`--${PREFIX_BS}collapse-separator-display`]: hasSeparator ? 'block' : 'none',
|
|
417
363
|
}), [hasSeparator]);
|
|
418
|
-
return (jsxs("div", { id: id, className: classNames('collapse-container', className), style: style, children: [jsxs("button", { className: "collapse-button", type: "button", onClick: onChangeCollapse, children: [jsx("div", { className: "flex-grow-1", children: Component }), jsx(DIcon, { color: `var(--${PREFIX_BS}gray)`, size: `var(--${PREFIX_BS}
|
|
364
|
+
return (jsxs("div", { id: id, className: classNames('collapse-container', className), style: style, children: [jsxs("button", { className: "collapse-button", type: "button", onClick: onChangeCollapse, children: [jsx("div", { className: "flex-grow-1", children: Component }), jsx(DIcon, { color: `var(--${PREFIX_BS}gray)`, size: `var(--${PREFIX_BS}fs-small)`, icon: toggle ? iconOpen : iconClose, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle })] }), toggle && (jsx("div", { className: classNames({
|
|
419
365
|
'collapse-body': true,
|
|
420
366
|
}), style: generateStyles, children: children }))] }));
|
|
421
367
|
}
|
|
@@ -1067,7 +1013,7 @@ function DModal({ name, className, style, staticBackdrop, scrollable, centered,
|
|
|
1067
1013
|
}
|
|
1068
1014
|
return '';
|
|
1069
1015
|
}, [fullScreenFrom, fullScreen]);
|
|
1070
|
-
const generateClasses = useMemo(() => (Object.assign({ 'modal fade show': true }, className && { [className]: true })), [className]);
|
|
1016
|
+
const generateClasses = useMemo(() => (Object.assign({ 'modal portal fade show': true }, className && { [className]: true })), [className]);
|
|
1071
1017
|
const generateModalDialogClasses = 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]);
|
|
1072
1018
|
return (jsx("div", Object.assign({ className: classNames(generateClasses), id: name, tabIndex: -1, "aria-labelledby": `${name}Label`, "aria-hidden": "false", style: style }, staticBackdrop && ({
|
|
1073
1019
|
[`data-${PREFIX_BS}backdrop`]: 'static',
|
|
@@ -1095,7 +1041,7 @@ function DOffcanvasFooter({ footerActionPlacement = 'fill', children, className,
|
|
|
1095
1041
|
}
|
|
1096
1042
|
|
|
1097
1043
|
function DOffcanvas({ name, className, style, staticBackdrop, scrollable, openFrom = 'end', children, }) {
|
|
1098
|
-
return (jsx("div", Object.assign({ className: classNames('offcanvas show', {
|
|
1044
|
+
return (jsx("div", Object.assign({ className: classNames('offcanvas portal show', {
|
|
1099
1045
|
[`offcanvas-${openFrom}`]: openFrom,
|
|
1100
1046
|
}, className), style: style, id: name, tabIndex: -1, "aria-labelledby": `${name}Label`, "aria-hidden": "false" }, staticBackdrop && ({
|
|
1101
1047
|
[`data-${PREFIX_BS}backdrop`]: 'static',
|
|
@@ -1213,7 +1159,7 @@ function DQuickActionSwitch({ id, name, label, hint, checked, disabled, classNam
|
|
|
1213
1159
|
event.stopPropagation();
|
|
1214
1160
|
onClick === null || onClick === void 0 ? void 0 : onClick(checked);
|
|
1215
1161
|
}, [checked, onClick]);
|
|
1216
|
-
return (jsxs("button", { className: classNames('d-quick-action-switch', className), type: "button", onClick: clickHandler, style: style, children: [
|
|
1162
|
+
return (jsxs("button", { className: classNames('d-quick-action-switch', className), type: "button", onClick: clickHandler, style: style, children: [jsx("div", { className: "d-quick-action-switch-content", children: jsx(DInputSwitch, { id: id, name: name, disabled: disabled, checked: checked, readonly: true, label: label }) }), jsx("div", { className: "d-quick-action-switch-hint", children: hint })] }));
|
|
1217
1163
|
}
|
|
1218
1164
|
|
|
1219
1165
|
function DSkeleton({ speed = 2, viewBox, backgroundColor, foregroundColor, children, }) {
|
|
@@ -1320,8 +1266,8 @@ function DTooltip({ className, childrenClassName, style, offSet = ARROW_HEIGHT +
|
|
|
1320
1266
|
dismiss,
|
|
1321
1267
|
role,
|
|
1322
1268
|
]);
|
|
1323
|
-
const generateClasses = useMemo(() => (Object.assign({ '
|
|
1324
|
-
return (jsxs(Fragment, { children: [jsx("div", Object.assign({ className: childrenClassName, ref: refs.setReference }, getReferenceProps(), { children: Component })), jsx(FloatingPortal, { children: isOpen && (jsxs("div", Object.assign({ className: classNames(generateClasses), ref: refs.setFloating, style: Object.assign(Object.assign({}, floatingStyles), style) }, getFloatingProps(), { children: [jsx(FloatingArrow, { ref: arrowRef, context: context, width: ARROW_WIDTH, height: ARROW_HEIGHT }), children] }))) })] }));
|
|
1269
|
+
const generateClasses = useMemo(() => (Object.assign({ 'tooltip show': true, [`tooltip-${size}`]: !!size, [`tooltip-${theme}`]: !!theme }, className && { [className]: true })), [size, theme, className]);
|
|
1270
|
+
return (jsxs(Fragment, { children: [jsx("div", Object.assign({ className: childrenClassName, ref: refs.setReference }, getReferenceProps(), { children: Component })), jsx(FloatingPortal, { children: isOpen && (jsxs("div", Object.assign({ className: classNames(generateClasses), ref: refs.setFloating, style: Object.assign(Object.assign({}, floatingStyles), style) }, getFloatingProps(), { children: [jsx(FloatingArrow, { ref: arrowRef, context: context, width: ARROW_WIDTH, height: ARROW_HEIGHT }), jsx("div", { className: "tooltip-inner", children: children })] }))) })] }));
|
|
1325
1271
|
}
|
|
1326
1272
|
|
|
1327
1273
|
const TabContext = createContext(undefined);
|
|
@@ -1368,17 +1314,27 @@ var DTabs$1 = Object.assign(DTabs, {
|
|
|
1368
1314
|
Tab: DTabContent,
|
|
1369
1315
|
});
|
|
1370
1316
|
|
|
1371
|
-
|
|
1372
|
-
|
|
1317
|
+
const TOAST_TRANSITIONS$1 = {
|
|
1318
|
+
bounce: Bounce,
|
|
1319
|
+
flip: Flip,
|
|
1320
|
+
slide: Slide,
|
|
1321
|
+
zoom: Zoom,
|
|
1322
|
+
};
|
|
1323
|
+
function DToastContainer({ style, className, closeOnClick, position = 'bottom-center', autoClose = false, stacked = false, transition = 'slide', containerId, }) {
|
|
1324
|
+
const selectedTransition = useMemo(() => TOAST_TRANSITIONS$1[transition], [transition]);
|
|
1325
|
+
return (jsx(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 }));
|
|
1373
1326
|
}
|
|
1374
1327
|
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1328
|
+
const TOAST_TRANSITIONS = {
|
|
1329
|
+
bounce: Bounce,
|
|
1330
|
+
flip: Flip,
|
|
1331
|
+
slide: Slide,
|
|
1332
|
+
zoom: Zoom,
|
|
1333
|
+
};
|
|
1334
|
+
function useDToast() {
|
|
1335
|
+
const toast$1 = useCallback((message, _a) => {
|
|
1336
|
+
var { icon, iconClose, type = 'info', showClose = true, transition } = _a, rest = __rest(_a, ["icon", "iconClose", "type", "showClose", "transition"]);
|
|
1337
|
+
toast(({ closeToast }) => (jsx(DAlert, { onClose: closeToast, id: "alertID", type: type, icon: icon, iconClose: iconClose, showClose: showClose, children: message })), Object.assign({ transition: transition && TOAST_TRANSITIONS[transition] }, rest));
|
|
1382
1338
|
}, []);
|
|
1383
1339
|
return {
|
|
1384
1340
|
toast: toast$1,
|
|
@@ -1399,5 +1355,5 @@ async function configureI8n(resources, _a = {}) {
|
|
|
1399
1355
|
.then((t) => t);
|
|
1400
1356
|
}
|
|
1401
1357
|
|
|
1402
|
-
export { DAlert, DBadge, DBoxFile, DButton, DCard$1 as DCard, DCardBody, DCardFooter, DCardHeader, DCarousel$1 as DCarousel, DCarouselSlide, DChip, DCollapse, DContext, DContextProvider, DCurrencyText, DDatePicker, DIcon, DIconBase, DInput$1 as DInput, DInputCheck, DInputCounter$1 as DInputCounter, DInputCurrency$1 as DInputCurrency, DInputCurrencyBase$1 as DInputCurrencyBase, DInputMask$1 as DInputMask, DInputPassword$1 as DInputPassword, DInputPin, DInputSearch$1 as DInputSearch, DInputSelect, DInputSwitch, DList$1 as DList, DListItem, DModal$1 as DModal, DModalBody,
|
|
1358
|
+
export { DAlert, DBadge, DBoxFile, DButton, DCard$1 as DCard, DCardBody, DCardFooter, DCardHeader, DCarousel$1 as DCarousel, DCarouselSlide, DChip, DCollapse, DContext, DContextProvider, DCurrencyText, DDatePicker, DIcon, DIconBase, DInput$1 as DInput, DInputCheck, DInputCounter$1 as DInputCounter, DInputCurrency$1 as DInputCurrency, DInputCurrencyBase$1 as DInputCurrencyBase, DInputMask$1 as DInputMask, DInputPassword$1 as DInputPassword, DInputPin, DInputSearch$1 as DInputSearch, DInputSelect, DInputSwitch, DList$1 as DList, DListItem, DModal$1 as DModal, DModalBody, DModalFooter, DModalHeader, DOffcanvas$1 as DOffcanvas, DOffcanvasBody, DOffcanvasFooter, DOffcanvasHeader, DPaginator, DPopover, DPortalContext, DPortalContextProvider, DProgress, DQuickActionButton, DQuickActionCheck, DQuickActionSelect, DQuickActionSwitch, DSelect$1 as DSelect, DSkeleton, DStepper, DStepper$2 as DStepperDesktop, DStepper$1 as DStepperMobile, DTabContent, DTabs$1 as DTabs, DToastContainer, DTooltip, configureI8n as configureI18n, formatCurrency, useDContext, useDPortalContext, useDToast, useDisableBodyScrollEffect, useDisableInputWheel, useFormatCurrency, useInputCurrency, usePortal, useProvidedRefOrCreate, useStackState, useTabContext };
|
|
1403
1359
|
//# sourceMappingURL=index.esm.js.map
|