@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.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
|
}
|
|
@@ -317,23 +271,13 @@ function DBoxFile(_a) {
|
|
|
317
271
|
}), { children: [jsxRuntime.jsx("input", Object.assign({}, getInputProps())), jsxRuntime.jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle }), jsxRuntime.jsx("div", { className: "d-box-content", children: children })] })), !!acceptedFiles.length && (jsxRuntime.jsx("aside", { className: "d-box-files", children: acceptedFiles.map((file) => (jsxRuntime.jsx("div", { className: "d-box-files-text", children: `${file.name} - ${file.size} bytes` }, file.name))) }))] }));
|
|
318
272
|
}
|
|
319
273
|
|
|
320
|
-
function DButton({ theme = 'primary', size, variant, state, text = '', ariaLabel, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconStartMaterialStyle, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, iconEndMaterialStyle, value, type = 'button',
|
|
274
|
+
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, }) {
|
|
321
275
|
const generateClasses = React.useMemo(() => {
|
|
322
276
|
const variantClass = variant
|
|
323
277
|
? `btn-${variant}-${theme}`
|
|
324
278
|
: `btn-${theme}`;
|
|
325
279
|
return Object.assign(Object.assign(Object.assign({ btn: true, [variantClass]: true }, size && { [`btn-${size}`]: true }), (state && state !== 'disabled') && { [state]: true }), { loading });
|
|
326
280
|
}, [variant, theme, size, state, loading]);
|
|
327
|
-
const generateStyleVariables = React.useMemo(() => {
|
|
328
|
-
if (pill) {
|
|
329
|
-
return {
|
|
330
|
-
[`--${PREFIX_BS}btn-component-border-radius`]: `var(--${PREFIX_BS}border-radius-pill)`,
|
|
331
|
-
[`--${PREFIX_BS}btn-component-lg-border-radius`]: `var(--${PREFIX_BS}border-radius-pill)`,
|
|
332
|
-
[`--${PREFIX_BS}btn-component-sm-border-radius`]: `var(--${PREFIX_BS}border-radius-pill)`,
|
|
333
|
-
};
|
|
334
|
-
}
|
|
335
|
-
return {};
|
|
336
|
-
}, [pill]);
|
|
337
281
|
const clickHandler = React.useCallback((event) => {
|
|
338
282
|
if (stopPropagationEnabled) {
|
|
339
283
|
event.stopPropagation();
|
|
@@ -344,7 +288,7 @@ function DButton({ theme = 'primary', size, variant, state, text = '', ariaLabel
|
|
|
344
288
|
const newAriaLabel = React.useMemo(() => (loading
|
|
345
289
|
? (loadingAriaLabel || ariaLabel || text)
|
|
346
290
|
: (ariaLabel || text)), [loading, loadingAriaLabel, ariaLabel, text]);
|
|
347
|
-
return (jsxRuntime.jsxs("button", Object.assign({ className: classNames(generateClasses, className), style:
|
|
291
|
+
return (jsxRuntime.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 && (jsxRuntime.jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix, materialStyle: iconStartMaterialStyle })), (text && !loading) && (jsxRuntime.jsx("span", { children: text })), loading && (jsxRuntime.jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsxRuntime.jsx("span", { className: "visually-hidden", children: "Loading..." }) })), iconEnd && (jsxRuntime.jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix, materialStyle: iconEndMaterialStyle }))] })));
|
|
348
292
|
}
|
|
349
293
|
|
|
350
294
|
function DCardHeader({ className, style, children, }) {
|
|
@@ -373,9 +317,9 @@ function DCarouselSlide(_a) {
|
|
|
373
317
|
return (jsxRuntime.jsx(reactSplide.SplideSlide, Object.assign({ className: classNames('d-carousel-slide', className) }, props)));
|
|
374
318
|
}
|
|
375
319
|
|
|
376
|
-
function DCarousel(_a) {
|
|
320
|
+
function DCarousel(_a, ref) {
|
|
377
321
|
var { children, className, style, options } = _a, props = tslib.__rest(_a, ["children", "className", "style", "options"]);
|
|
378
|
-
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: {
|
|
379
323
|
// Arrows
|
|
380
324
|
arrows: 'splide__arrows d-carousel-arrows',
|
|
381
325
|
arrow: 'splide__arrow d-carousel-arrow',
|
|
@@ -386,7 +330,9 @@ function DCarousel(_a) {
|
|
|
386
330
|
page: 'splide__pagination__page d-carousel-pagination-page',
|
|
387
331
|
} }) }, props, { children: children })));
|
|
388
332
|
}
|
|
389
|
-
|
|
333
|
+
const ForwardedDCarousel = React.forwardRef(DCarousel);
|
|
334
|
+
ForwardedDCarousel.displayName = 'DCarousel';
|
|
335
|
+
var DCarousel$1 = Object.assign(ForwardedDCarousel, {
|
|
390
336
|
Slide: DCarouselSlide,
|
|
391
337
|
});
|
|
392
338
|
|
|
@@ -417,7 +363,7 @@ function DCollapse({ id, className, style, Component, hasSeparator = false, defa
|
|
|
417
363
|
const generateStyles = React.useMemo(() => ({
|
|
418
364
|
[`--${PREFIX_BS}collapse-separator-display`]: hasSeparator ? 'block' : 'none',
|
|
419
365
|
}), [hasSeparator]);
|
|
420
|
-
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({
|
|
421
367
|
'collapse-body': true,
|
|
422
368
|
}), style: generateStyles, children: children }))] }));
|
|
423
369
|
}
|
|
@@ -1069,7 +1015,7 @@ function DModal({ name, className, style, staticBackdrop, scrollable, centered,
|
|
|
1069
1015
|
}
|
|
1070
1016
|
return '';
|
|
1071
1017
|
}, [fullScreenFrom, fullScreen]);
|
|
1072
|
-
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]);
|
|
1073
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]);
|
|
1074
1020
|
return (jsxRuntime.jsx("div", Object.assign({ className: classNames(generateClasses), id: name, tabIndex: -1, "aria-labelledby": `${name}Label`, "aria-hidden": "false", style: style }, staticBackdrop && ({
|
|
1075
1021
|
[`data-${PREFIX_BS}backdrop`]: 'static',
|
|
@@ -1097,7 +1043,7 @@ function DOffcanvasFooter({ footerActionPlacement = 'fill', children, className,
|
|
|
1097
1043
|
}
|
|
1098
1044
|
|
|
1099
1045
|
function DOffcanvas({ name, className, style, staticBackdrop, scrollable, openFrom = 'end', children, }) {
|
|
1100
|
-
return (jsxRuntime.jsx("div", Object.assign({ className: classNames('offcanvas show', {
|
|
1046
|
+
return (jsxRuntime.jsx("div", Object.assign({ className: classNames('offcanvas portal show', {
|
|
1101
1047
|
[`offcanvas-${openFrom}`]: openFrom,
|
|
1102
1048
|
}, className), style: style, id: name, tabIndex: -1, "aria-labelledby": `${name}Label`, "aria-hidden": "false" }, staticBackdrop && ({
|
|
1103
1049
|
[`data-${PREFIX_BS}backdrop`]: 'static',
|
|
@@ -1215,7 +1161,7 @@ function DQuickActionSwitch({ id, name, label, hint, checked, disabled, classNam
|
|
|
1215
1161
|
event.stopPropagation();
|
|
1216
1162
|
onClick === null || onClick === void 0 ? void 0 : onClick(checked);
|
|
1217
1163
|
}, [checked, onClick]);
|
|
1218
|
-
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 })] }));
|
|
1219
1165
|
}
|
|
1220
1166
|
|
|
1221
1167
|
function DSkeleton({ speed = 2, viewBox, backgroundColor, foregroundColor, children, }) {
|
|
@@ -1322,8 +1268,8 @@ function DTooltip({ className, childrenClassName, style, offSet = ARROW_HEIGHT +
|
|
|
1322
1268
|
dismiss,
|
|
1323
1269
|
role,
|
|
1324
1270
|
]);
|
|
1325
|
-
const generateClasses = React.useMemo(() => (Object.assign({ '
|
|
1326
|
-
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 })] }))) })] }));
|
|
1327
1273
|
}
|
|
1328
1274
|
|
|
1329
1275
|
const TabContext = React.createContext(undefined);
|
|
@@ -1370,17 +1316,27 @@ var DTabs$1 = Object.assign(DTabs, {
|
|
|
1370
1316
|
Tab: DTabContent,
|
|
1371
1317
|
});
|
|
1372
1318
|
|
|
1373
|
-
|
|
1374
|
-
|
|
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 }));
|
|
1375
1328
|
}
|
|
1376
1329
|
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
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));
|
|
1384
1340
|
}, []);
|
|
1385
1341
|
return {
|
|
1386
1342
|
toast,
|
|
@@ -1434,18 +1390,16 @@ exports.DList = DList$1;
|
|
|
1434
1390
|
exports.DListItem = DListItem;
|
|
1435
1391
|
exports.DModal = DModal$1;
|
|
1436
1392
|
exports.DModalBody = DModalBody;
|
|
1437
|
-
exports.DModalContext = DModalContext;
|
|
1438
|
-
exports.DModalContextProvider = DModalContextProvider;
|
|
1439
1393
|
exports.DModalFooter = DModalFooter;
|
|
1440
1394
|
exports.DModalHeader = DModalHeader;
|
|
1441
1395
|
exports.DOffcanvas = DOffcanvas$1;
|
|
1442
1396
|
exports.DOffcanvasBody = DOffcanvasBody;
|
|
1443
|
-
exports.DOffcanvasContext = DOffcanvasContext;
|
|
1444
|
-
exports.DOffcanvasContextProvider = DOffcanvasContextProvider;
|
|
1445
1397
|
exports.DOffcanvasFooter = DOffcanvasFooter;
|
|
1446
1398
|
exports.DOffcanvasHeader = DOffcanvasHeader;
|
|
1447
1399
|
exports.DPaginator = DPaginator;
|
|
1448
1400
|
exports.DPopover = DPopover;
|
|
1401
|
+
exports.DPortalContext = DPortalContext;
|
|
1402
|
+
exports.DPortalContextProvider = DPortalContextProvider;
|
|
1449
1403
|
exports.DProgress = DProgress;
|
|
1450
1404
|
exports.DQuickActionButton = DQuickActionButton;
|
|
1451
1405
|
exports.DQuickActionCheck = DQuickActionCheck;
|
|
@@ -1463,8 +1417,8 @@ exports.DTooltip = DTooltip;
|
|
|
1463
1417
|
exports.configureI18n = configureI8n;
|
|
1464
1418
|
exports.formatCurrency = formatCurrency;
|
|
1465
1419
|
exports.useDContext = useDContext;
|
|
1466
|
-
exports.
|
|
1467
|
-
exports.
|
|
1420
|
+
exports.useDPortalContext = useDPortalContext;
|
|
1421
|
+
exports.useDToast = useDToast;
|
|
1468
1422
|
exports.useDisableBodyScrollEffect = useDisableBodyScrollEffect;
|
|
1469
1423
|
exports.useDisableInputWheel = useDisableInputWheel;
|
|
1470
1424
|
exports.useFormatCurrency = useFormatCurrency;
|
|
@@ -1473,5 +1427,4 @@ exports.usePortal = usePortal;
|
|
|
1473
1427
|
exports.useProvidedRefOrCreate = useProvidedRefOrCreate;
|
|
1474
1428
|
exports.useStackState = useStackState;
|
|
1475
1429
|
exports.useTabContext = useTabContext;
|
|
1476
|
-
exports.useToast = useToast;
|
|
1477
1430
|
//# sourceMappingURL=index.js.map
|