@dynamic-framework/ui-react 2.0.0-dev.5 → 2.0.0-dev.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/css/dynamic-ui-non-root.css +128 -511
- package/dist/css/dynamic-ui-non-root.min.css +2 -2
- package/dist/css/dynamic-ui-root.css +62 -556
- package/dist/css/dynamic-ui-root.min.css +2 -2
- package/dist/css/dynamic-ui.css +189 -1066
- package/dist/css/dynamic-ui.min.css +2 -2
- package/dist/index.esm.js +204 -132
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +192 -121
- package/dist/index.js.map +1 -1
- package/dist/types/components/DBoxFile/DBoxFile.d.ts +1 -1
- package/dist/types/components/DIconBase/DIconBase.d.ts +10 -2
- package/dist/types/components/DInput/DInput.d.ts +2 -1
- package/dist/types/components/DInputCounter/DInputCounter.d.ts +3 -2
- package/dist/types/components/DInputCurrency/DInputCurrency.d.ts +3 -2
- package/dist/types/components/DInputPhone/DInputPhone.d.ts +1 -1
- package/dist/types/components/DModal/DModal.d.ts +3 -1
- package/dist/types/components/DOffcanvas/DOffcanvas.d.ts +3 -1
- package/dist/types/components/config.d.ts +0 -2
- package/dist/types/components/index.d.ts +0 -1
- package/dist/types/hooks/useResponsiveProp.d.ts +35 -0
- package/package.json +16 -24
- package/src/style/abstracts/_mixins.scss +34 -16
- package/src/style/abstracts/variables/_colors.scss +8 -2
- package/src/style/base/_buttons.scss +11 -125
- package/src/style/base/_label.scss +0 -4
- package/src/style/components/_d-box-file.scss +1 -1
- package/src/style/components/_d-datepicker.scss +23 -4
- package/src/style/root/_root.scss +94 -88
- package/dist/types/components/DBarChart/DBarChart.d.ts +0 -9
- package/dist/types/components/DMinimalLineChart/DMinimalLineChart.d.ts +0 -9
- package/dist/types/components/DMultiLineChart/DMultiLineChart.d.ts +0 -9
- package/dist/types/components/DPieChart/DPieChart.d.ts +0 -9
- package/dist/types/components/DRadialBarChart/DRadialBarChart.d.ts +0 -6
- package/dist/types/components/DTableHead/DTableHead.d.ts +0 -9
- package/dist/types/components/DTableHead/index.d.ts +0 -2
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ var React = require('react');
|
|
|
6
6
|
var tslib = require('tslib');
|
|
7
7
|
var LucideIcons = require('lucide-react');
|
|
8
8
|
var reactDom = require('react-dom');
|
|
9
|
+
var framerMotion = require('framer-motion');
|
|
9
10
|
var fileSelector = require('file-selector');
|
|
10
11
|
var reactSplide = require('@splidejs/react-splide');
|
|
11
12
|
var currency = require('currency.js');
|
|
@@ -43,60 +44,6 @@ var LucideIcons__namespace = /*#__PURE__*/_interopNamespaceDefault(LucideIcons);
|
|
|
43
44
|
|
|
44
45
|
const PREFIX_BS = 'bs-';
|
|
45
46
|
|
|
46
|
-
function DIconBase({ icon, color, style, className, size, hasCircle = false, materialStyle = false, familyClass = 'material-symbols-outlined', strokeWidth = 2, dataAttributes, }) {
|
|
47
|
-
// If materialStyle is true, use Material Design icons (legacy)
|
|
48
|
-
const useMaterialIcons = materialStyle;
|
|
49
|
-
// Get Lucide icon component
|
|
50
|
-
const LucideIcon = React.useMemo(() => {
|
|
51
|
-
if (useMaterialIcons)
|
|
52
|
-
return null;
|
|
53
|
-
// Try to find the icon in Lucide (expects PascalCase)
|
|
54
|
-
const icons = LucideIcons__namespace;
|
|
55
|
-
return icons[icon] || null;
|
|
56
|
-
}, [icon, useMaterialIcons]);
|
|
57
|
-
const colorStyle = React.useMemo(() => {
|
|
58
|
-
if (color) {
|
|
59
|
-
return { [`--${PREFIX_BS}icon-component-color`]: `var(--${PREFIX_BS}${color})` };
|
|
60
|
-
}
|
|
61
|
-
return {};
|
|
62
|
-
}, [color]);
|
|
63
|
-
const backgroundStyle = React.useMemo(() => {
|
|
64
|
-
if (hasCircle) {
|
|
65
|
-
if (color) {
|
|
66
|
-
return { [`--${PREFIX_BS}icon-component-bg-color`]: `rgba(var(--${PREFIX_BS}${color}-rgb), 0.1)` };
|
|
67
|
-
}
|
|
68
|
-
return { [`--${PREFIX_BS}icon-component-bg-color`]: `rgba(var(--${PREFIX_BS}body-color-rgb), 0.1)` };
|
|
69
|
-
}
|
|
70
|
-
return {};
|
|
71
|
-
}, [hasCircle, color]);
|
|
72
|
-
const generateStyleVariables = React.useMemo(() => (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, size && { [`--${PREFIX_BS}icon-component-size`]: size }), colorStyle), backgroundStyle), hasCircle && { [`--${PREFIX_BS}icon-component-padding`]: `calc(var(--${PREFIX_BS}icon-component-size, 24px) * 0.4)` }), style)), [size, colorStyle, backgroundStyle, hasCircle, style]);
|
|
73
|
-
const generateClasses = React.useMemo(() => (Object.assign(Object.assign({ 'd-icon': true }, useMaterialIcons && {
|
|
74
|
-
[familyClass]: true,
|
|
75
|
-
}), className && { [className]: true })), [
|
|
76
|
-
className,
|
|
77
|
-
useMaterialIcons,
|
|
78
|
-
familyClass,
|
|
79
|
-
]);
|
|
80
|
-
const iconSize = React.useMemo(() => {
|
|
81
|
-
if (size) {
|
|
82
|
-
const numSize = parseInt(size, 10);
|
|
83
|
-
return !Number.isNaN(numSize) ? numSize : size;
|
|
84
|
-
}
|
|
85
|
-
return undefined;
|
|
86
|
-
}, [size]);
|
|
87
|
-
// Render Material Design icon (legacy support)
|
|
88
|
-
if (useMaterialIcons) {
|
|
89
|
-
return (jsxRuntime.jsx("i", Object.assign({ className: classNames(generateClasses), style: generateStyleVariables }, dataAttributes, { children: icon })));
|
|
90
|
-
}
|
|
91
|
-
// Render Lucide icon
|
|
92
|
-
if (!LucideIcon) {
|
|
93
|
-
// eslint-disable-next-line no-console
|
|
94
|
-
console.warn(`Icon "${icon}" not found in Lucide. Make sure to use PascalCase names (e.g., "Home", "User", "Settings")`);
|
|
95
|
-
return (jsxRuntime.jsx("span", Object.assign({ className: classNames(generateClasses), style: generateStyleVariables }, dataAttributes, { children: "?" })));
|
|
96
|
-
}
|
|
97
|
-
return (jsxRuntime.jsx("span", Object.assign({ className: classNames(generateClasses), style: generateStyleVariables }, dataAttributes, { children: jsxRuntime.jsx(LucideIcon, { size: iconSize || 24, strokeWidth: strokeWidth }) })));
|
|
98
|
-
}
|
|
99
|
-
|
|
100
47
|
function useDisableBodyScrollEffect(disable) {
|
|
101
48
|
React.useEffect(() => {
|
|
102
49
|
if (disable) {
|
|
@@ -253,7 +200,10 @@ function DPortalContextProvider({ portalName, children, availablePortals, }) {
|
|
|
253
200
|
return (jsxRuntime.jsxs(DPortalContext.Provider, { value: value, children: [children, created && reactDom.createPortal(
|
|
254
201
|
// eslint-disable-next-line max-len
|
|
255
202
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
256
|
-
jsxRuntime.jsx("div", { onClick: ({ target }) => handleClose(target), onKeyDown: () => { }, children:
|
|
203
|
+
jsxRuntime.jsx("div", { onClick: ({ target }) => handleClose(target), onKeyDown: () => { }, children: jsxRuntime.jsx(framerMotion.AnimatePresence, { children: stack.flatMap(({ Component, name, payload, }) => [
|
|
204
|
+
jsxRuntime.jsx(framerMotion.motion.div, { className: "backdrop", initial: { opacity: 0 }, animate: { opacity: 0.5 }, exit: { opacity: 0, transition: { delay: 0.3 } }, transition: { duration: 0.15, ease: 'linear' } }, `${name}-backdrop`),
|
|
205
|
+
jsxRuntime.jsx(Component, { name: name, payload: payload }, name),
|
|
206
|
+
]) }) }), document.getElementById(portalName))] }));
|
|
257
207
|
}
|
|
258
208
|
function useDPortalContext() {
|
|
259
209
|
const context = React.useContext(DPortalContext);
|
|
@@ -349,6 +299,151 @@ function useDContext() {
|
|
|
349
299
|
return context;
|
|
350
300
|
}
|
|
351
301
|
|
|
302
|
+
function subscribeToMediaQuery(query, callback) {
|
|
303
|
+
const mediaQueryList = window.matchMedia(query);
|
|
304
|
+
mediaQueryList.addEventListener('change', callback);
|
|
305
|
+
return () => {
|
|
306
|
+
mediaQueryList.removeEventListener('change', callback);
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
function checkMediaQuery(query) {
|
|
310
|
+
return window.matchMedia(query).matches;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
function useMediaQuery(mediaQuery, useListener = false) {
|
|
314
|
+
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
|
|
315
|
+
const noop = (_) => () => { };
|
|
316
|
+
return React.useSyncExternalStore(useListener ? (cb) => subscribeToMediaQuery(mediaQuery, cb) : noop, () => (mediaQuery ? checkMediaQuery(mediaQuery) : true), () => false);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
function useMediaBreakpointUp(breakpoint, useListener = false) {
|
|
320
|
+
const { breakpoints } = useDContext();
|
|
321
|
+
const mediaQuery = React.useMemo(() => (`(min-width: ${breakpoints[breakpoint]})`), [breakpoint, breakpoints]);
|
|
322
|
+
return useMediaQuery(mediaQuery, useListener);
|
|
323
|
+
}
|
|
324
|
+
function useMediaBreakpointUpXs(useListener = false) {
|
|
325
|
+
return useMediaBreakpointUp('xs', useListener);
|
|
326
|
+
}
|
|
327
|
+
function useMediaBreakpointUpSm(useListener = false) {
|
|
328
|
+
return useMediaBreakpointUp('sm', useListener);
|
|
329
|
+
}
|
|
330
|
+
function useMediaBreakpointUpMd(useListener = false) {
|
|
331
|
+
return useMediaBreakpointUp('md', useListener);
|
|
332
|
+
}
|
|
333
|
+
function useMediaBreakpointUpLg(useListener = false) {
|
|
334
|
+
return useMediaBreakpointUp('lg', useListener);
|
|
335
|
+
}
|
|
336
|
+
function useMediaBreakpointUpXl(useListener = false) {
|
|
337
|
+
return useMediaBreakpointUp('xl', useListener);
|
|
338
|
+
}
|
|
339
|
+
function useMediaBreakpointUpXxl(useListener = false) {
|
|
340
|
+
return useMediaBreakpointUp('xxl', useListener);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* React hook to resolve a responsive property value based on the current viewport breakpoint.
|
|
345
|
+
*
|
|
346
|
+
* Given a `ResponsiveProp` object, this hook returns the value for the highest matching breakpoint.
|
|
347
|
+
* If multiple breakpoints match, the value for the largest (highest) breakpoint is used.
|
|
348
|
+
* If no breakpoints match, `undefined` is returned.
|
|
349
|
+
*
|
|
350
|
+
* @param useListener - Whether to listen for breakpoint changes (default: false).
|
|
351
|
+
* @returns An object with a `responsivePropValue` function that takes a
|
|
352
|
+
* `ResponsiveProp` and returns the resolved value.
|
|
353
|
+
*
|
|
354
|
+
* Usage example:
|
|
355
|
+
* ```ts
|
|
356
|
+
* const { responsivePropValue } = useResponsiveProp();
|
|
357
|
+
* const value = responsivePropValue({ xs: "A", md: "B", xl: "C" });
|
|
358
|
+
* // value will be "C" if xl breakpoint is active, "B" if md is active, etc.
|
|
359
|
+
* ```
|
|
360
|
+
*/
|
|
361
|
+
function useResponsiveProp(useListener = false) {
|
|
362
|
+
const bpXsUp = useMediaBreakpointUpXs(useListener);
|
|
363
|
+
const bpSmUp = useMediaBreakpointUpSm(useListener);
|
|
364
|
+
const bpMdUp = useMediaBreakpointUpMd(useListener);
|
|
365
|
+
const bpLgUp = useMediaBreakpointUpLg(useListener);
|
|
366
|
+
const bpXlUp = useMediaBreakpointUpXl(useListener);
|
|
367
|
+
const bpXxlUp = useMediaBreakpointUpXxl(useListener);
|
|
368
|
+
const responsivePropValue = React.useCallback((prop) => {
|
|
369
|
+
// Pick the highest matched breakpoint value that is defined in prop
|
|
370
|
+
if (prop.xxl !== undefined && bpXxlUp)
|
|
371
|
+
return prop.xxl;
|
|
372
|
+
if (prop.xl !== undefined && bpXlUp)
|
|
373
|
+
return prop.xl;
|
|
374
|
+
if (prop.lg !== undefined && bpLgUp)
|
|
375
|
+
return prop.lg;
|
|
376
|
+
if (prop.md !== undefined && bpMdUp)
|
|
377
|
+
return prop.md;
|
|
378
|
+
if (prop.sm !== undefined && bpSmUp)
|
|
379
|
+
return prop.sm;
|
|
380
|
+
if (prop.xs !== undefined && bpXsUp)
|
|
381
|
+
return prop.xs;
|
|
382
|
+
// Fallback: return undefined if no breakpoint matches
|
|
383
|
+
return undefined;
|
|
384
|
+
}, [bpSmUp, bpMdUp, bpLgUp, bpXlUp, bpXxlUp, bpXsUp]);
|
|
385
|
+
return { responsivePropValue };
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
function DIconBase({ icon, color, style, className, size, useListenerSize = false, hasCircle = false, materialStyle = false, familyClass, familyPrefix, strokeWidth = 2, dataAttributes, }) {
|
|
389
|
+
// If materialStyle is true, use Material Design icons (legacy)
|
|
390
|
+
const useMaterialIcons = materialStyle;
|
|
391
|
+
// Get Lucide icon component
|
|
392
|
+
const LucideIcon = React.useMemo(() => {
|
|
393
|
+
if (useMaterialIcons)
|
|
394
|
+
return null;
|
|
395
|
+
// Try to find the icon in Lucide (expects PascalCase)
|
|
396
|
+
const icons = LucideIcons__namespace;
|
|
397
|
+
return icons[icon] || null;
|
|
398
|
+
}, [icon, useMaterialIcons]);
|
|
399
|
+
const colorStyle = React.useMemo(() => {
|
|
400
|
+
if (color) {
|
|
401
|
+
return { [`--${PREFIX_BS}icon-component-color`]: `var(--${PREFIX_BS}${color})` };
|
|
402
|
+
}
|
|
403
|
+
return {};
|
|
404
|
+
}, [color]);
|
|
405
|
+
const backgroundStyle = React.useMemo(() => {
|
|
406
|
+
if (hasCircle) {
|
|
407
|
+
if (color) {
|
|
408
|
+
return { [`--${PREFIX_BS}icon-component-bg-color`]: `rgba(var(--${PREFIX_BS}${color}-rgb), 0.1)` };
|
|
409
|
+
}
|
|
410
|
+
return { [`--${PREFIX_BS}icon-component-bg-color`]: `rgba(var(--${PREFIX_BS}body-color-rgb), 0.1)` };
|
|
411
|
+
}
|
|
412
|
+
return {};
|
|
413
|
+
}, [hasCircle, color]);
|
|
414
|
+
const { responsivePropValue } = useResponsiveProp(useListenerSize);
|
|
415
|
+
const resolvedSize = React.useMemo(() => {
|
|
416
|
+
if (!size)
|
|
417
|
+
return undefined;
|
|
418
|
+
if (typeof size === 'string')
|
|
419
|
+
return size;
|
|
420
|
+
return responsivePropValue(size);
|
|
421
|
+
}, [responsivePropValue, size]);
|
|
422
|
+
const generateStyleVariables = React.useMemo(() => (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, resolvedSize && { [`--${PREFIX_BS}icon-component-size`]: resolvedSize }), colorStyle), backgroundStyle), hasCircle && { [`--${PREFIX_BS}icon-component-padding`]: `calc(var(--${PREFIX_BS}icon-component-size, 24px) * 0.4)` }), style)), [resolvedSize, colorStyle, backgroundStyle, hasCircle, style]);
|
|
423
|
+
const generateClasses = React.useMemo(() => (Object.assign({ 'd-icon': true }, className && { [className]: true })), [className]);
|
|
424
|
+
const iconSize = React.useMemo(() => {
|
|
425
|
+
if (resolvedSize) {
|
|
426
|
+
const numSize = parseInt(resolvedSize, 10);
|
|
427
|
+
return !Number.isNaN(numSize) ? numSize : resolvedSize;
|
|
428
|
+
}
|
|
429
|
+
return undefined;
|
|
430
|
+
}, [resolvedSize]);
|
|
431
|
+
// Render Material Design icon (legacy support)
|
|
432
|
+
if (useMaterialIcons) {
|
|
433
|
+
return (jsxRuntime.jsx("i", Object.assign({ className: classNames(generateClasses, familyClass), style: generateStyleVariables }, dataAttributes, { children: icon })));
|
|
434
|
+
}
|
|
435
|
+
// Render Lucide icon
|
|
436
|
+
if (!LucideIcon) {
|
|
437
|
+
if (familyClass && familyPrefix) {
|
|
438
|
+
return (jsxRuntime.jsx("i", Object.assign({ className: classNames(generateClasses, familyClass, `${familyPrefix}${icon}`), style: generateStyleVariables }, dataAttributes)));
|
|
439
|
+
}
|
|
440
|
+
// eslint-disable-next-line no-console
|
|
441
|
+
console.warn(`Icon "${icon}" not found in Lucide. Make sure to use PascalCase names (e.g., "Home", "User", "Settings")`);
|
|
442
|
+
return (jsxRuntime.jsx("span", Object.assign({ className: classNames(generateClasses), style: generateStyleVariables }, dataAttributes, { children: "?" })));
|
|
443
|
+
}
|
|
444
|
+
return (jsxRuntime.jsx("span", Object.assign({ className: classNames(generateClasses), style: generateStyleVariables }, dataAttributes, { children: jsxRuntime.jsx(LucideIcon, { size: iconSize || 24, strokeWidth: strokeWidth }) })));
|
|
445
|
+
}
|
|
446
|
+
|
|
352
447
|
function DIcon(_a) {
|
|
353
448
|
var { familyClass: propFamilyClass, familyPrefix: propFamilyPrefix, materialStyle: propMaterialStyle } = _a, props = tslib.__rest(_a, ["familyClass", "familyPrefix", "materialStyle"]);
|
|
354
449
|
const { icon: { familyClass, familyPrefix, materialStyle, }, } = useDContext();
|
|
@@ -416,7 +511,7 @@ function useProvidedRefOrCreate(providedRef) {
|
|
|
416
511
|
}
|
|
417
512
|
|
|
418
513
|
function DInput(_a, ref) {
|
|
419
|
-
var { id: idProp, style, className, label = '', disabled = false, loading = false, iconFamilyClass, iconFamilyPrefix, iconMaterialStyle, iconStart, iconStartDisabled, iconStartFamilyClass, iconStartFamilyPrefix, iconStartAriaLabel, iconStartTabIndex, iconStartMaterialStyle, iconEnd, iconEndDisabled, iconEndFamilyClass, iconEndFamilyPrefix, iconEndAriaLabel, iconEndTabIndex, iconEndMaterialStyle, hint, size, invalid = false, valid = false, floatingLabel = false, inputStart, inputEnd, value, placeholder = '', dataAttributes, onChange, onIconStartClick, onIconEndClick } = _a, inputProps = tslib.__rest(_a, ["id", "style", "className", "label", "disabled", "loading", "iconFamilyClass", "iconFamilyPrefix", "iconMaterialStyle", "iconStart", "iconStartDisabled", "iconStartFamilyClass", "iconStartFamilyPrefix", "iconStartAriaLabel", "iconStartTabIndex", "iconStartMaterialStyle", "iconEnd", "iconEndDisabled", "iconEndFamilyClass", "iconEndFamilyPrefix", "iconEndAriaLabel", "iconEndTabIndex", "iconEndMaterialStyle", "hint", "size", "invalid", "valid", "floatingLabel", "inputStart", "inputEnd", "value", "placeholder", "dataAttributes", "onChange", "onIconStartClick", "onIconEndClick"]);
|
|
514
|
+
var { id: idProp, style, className, label = '', disabled = false, loading = false, iconFamilyClass, iconFamilyPrefix, iconMaterialStyle, iconStart, iconStartDisabled, iconStartFamilyClass, iconStartFamilyPrefix, iconStartAriaLabel, iconStartTabIndex, iconStartMaterialStyle, iconEnd, iconEndDisabled, iconEndFamilyClass, iconEndFamilyPrefix, iconEndAriaLabel, iconEndTabIndex, iconEndMaterialStyle, hint, size, invalid = false, valid = false, floatingLabel = false, inputStart, inputEnd, value, placeholder = '', dataAttributes, readonly, onChange, onIconStartClick, onIconEndClick } = _a, inputProps = tslib.__rest(_a, ["id", "style", "className", "label", "disabled", "loading", "iconFamilyClass", "iconFamilyPrefix", "iconMaterialStyle", "iconStart", "iconStartDisabled", "iconStartFamilyClass", "iconStartFamilyPrefix", "iconStartAriaLabel", "iconStartTabIndex", "iconStartMaterialStyle", "iconEnd", "iconEndDisabled", "iconEndFamilyClass", "iconEndFamilyPrefix", "iconEndAriaLabel", "iconEndTabIndex", "iconEndMaterialStyle", "hint", "size", "invalid", "valid", "floatingLabel", "inputStart", "inputEnd", "value", "placeholder", "dataAttributes", "readonly", "onChange", "onIconStartClick", "onIconEndClick"]);
|
|
420
515
|
const inputRef = useProvidedRefOrCreate(ref);
|
|
421
516
|
const innerId = React.useId();
|
|
422
517
|
const id = React.useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
@@ -453,7 +548,7 @@ function DInput(_a, ref) {
|
|
|
453
548
|
const inputComponent = React.useMemo(() => (jsxRuntime.jsx("input", Object.assign({ ref: inputRef, id: id, className: classNames('form-control', {
|
|
454
549
|
'is-invalid': invalid,
|
|
455
550
|
'is-valid': valid,
|
|
456
|
-
}), disabled: disabled || loading, value: value, onChange: handleOnChange }, (floatingLabel || placeholder) && { placeholder: floatingLabel ? '' : placeholder }, ariaDescribedby && { 'aria-describedby': ariaDescribedby }, inputProps))), [
|
|
551
|
+
}), disabled: disabled || loading, readOnly: readonly, value: value, onChange: handleOnChange }, (floatingLabel || placeholder) && { placeholder: floatingLabel ? '' : placeholder }, ariaDescribedby && { 'aria-describedby': ariaDescribedby }, inputProps))), [
|
|
457
552
|
ariaDescribedby,
|
|
458
553
|
disabled,
|
|
459
554
|
handleOnChange,
|
|
@@ -466,6 +561,7 @@ function DInput(_a, ref) {
|
|
|
466
561
|
floatingLabel,
|
|
467
562
|
valid,
|
|
468
563
|
value,
|
|
564
|
+
readonly,
|
|
469
565
|
]);
|
|
470
566
|
const labelComponent = React.useMemo(() => (jsxRuntime.jsx("label", { htmlFor: id, children: label })), [
|
|
471
567
|
id,
|
|
@@ -885,9 +981,9 @@ function DBoxFile(_a) {
|
|
|
885
981
|
'd-box-file-disabled': props.disabled,
|
|
886
982
|
'd-box-file-valid': isDragValid,
|
|
887
983
|
'd-box-file-invalid': isDragInvalid,
|
|
888
|
-
}, className), style: style }, dataAttributes, { children: jsxRuntime.jsxs("div", Object.assign({ className: "d-box-file-dropzone", ref: rootRef, onDragEnter: handleDragEnter, onDragOver: (e) => e.preventDefault(), onDragLeave: handleDragLeave, onDrop: handleDrop, onClick: handleClick, onKeyDown: handleKeyDown }, (!props.disabled && !props.noKeyboard ? { tabIndex: 0 } : {}), { role: "presentation", children: [jsxRuntime.jsx("input", { type: "file", multiple: props.multiple, style: { display: 'none' }, ref: inputRef, disabled: props.disabled, onChange: handleFileSelect, onClick: (e) => e.stopPropagation(), tabIndex: -1, accept: acceptAttr }), jsxRuntime.jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle }), jsxRuntime.jsx("div", { className: "d-box-content", children: typeof children === 'function'
|
|
984
|
+
}, className), style: style }, dataAttributes, { children: jsxRuntime.jsxs("div", Object.assign({ className: "d-box-file-dropzone", ref: rootRef, onDragEnter: handleDragEnter, onDragOver: (e) => e.preventDefault(), onDragLeave: handleDragLeave, onDrop: handleDrop, onClick: handleClick, onKeyDown: handleKeyDown }, (!props.disabled && !props.noKeyboard ? { tabIndex: 0 } : {}), { role: "presentation", children: [jsxRuntime.jsx("input", { type: "file", multiple: props.multiple, style: { display: 'none' }, ref: inputRef, disabled: props.disabled, onChange: handleFileSelect, onClick: (e) => e.stopPropagation(), tabIndex: -1, accept: acceptAttr }), icon && iconProp !== false && (jsxRuntime.jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle })), jsxRuntime.jsx("div", { className: "d-box-content", children: typeof children === 'function'
|
|
889
985
|
? children(openFileDialog)
|
|
890
|
-
: children })] })) })), !!files.length && (jsxRuntime.jsx("ul", { className: "d-box-files", children: files.map((file, index) => (jsxRuntime.jsx(ForwardedDInput, { value: file.name, iconStart: "
|
|
986
|
+
: children || (jsxRuntime.jsx("p", { className: "text-center m-0", children: "Drag and drop some files here, or click to select files" })) })] })) })), !!files.length && (jsxRuntime.jsx("ul", { className: "d-box-files", children: files.map((file, index) => (jsxRuntime.jsx(ForwardedDInput, { value: file.name, iconStart: "Paperclip", iconEnd: "Trash", readOnly: true, onIconEndClick: () => handleRemoveFile(index) }, `${file.name} ${index}`))) }))] }));
|
|
891
987
|
}
|
|
892
988
|
|
|
893
989
|
const DButton = React.forwardRef((props, ref) => {
|
|
@@ -1278,7 +1374,7 @@ function DDatePickerHeaderSelector({ date, changeYear, changeMonth, decreaseMont
|
|
|
1278
1374
|
if (pickerType === PickerType.Quarter || pickerType === PickerType.Month) {
|
|
1279
1375
|
return (jsxRuntime.jsxs("div", { className: classNames(`react-datepicker__header-selector react-datepicker__header-${pickerType}-selector`, className), style: style, children: [jsxRuntime.jsx(DButtonIcon, { icon: iconPrev || chevronLeft, size: iconSize, variant: "link", onClick: decreaseYear, disabled: prevMonthButtonDisabled, ariaLabel: prevMonthAriaLabel, className: "header-button", style: { visibility: customHeaderCount === 0 ? 'visible' : 'hidden' } }), jsxRuntime.jsx("div", { className: "d-flex justify-content-center flex-grow-1", children: showHeaderSelectors ? (jsxRuntime.jsx(DSelect, { options: years, value: defaultYear, defaultValue: defaultYear, onChange: (year) => changeYear(Number(year === null || year === void 0 ? void 0 : year.value)), searchable: false })) : (jsxRuntime.jsx("p", { children: defaultYear === null || defaultYear === void 0 ? void 0 : defaultYear.label })) }), jsxRuntime.jsx(DButtonIcon, { icon: iconNext || chevronRight, size: iconSize, variant: "link", onClick: increaseYear, disabled: nextMonthButtonDisabled, ariaLabel: nextMonthAriaLabel, className: "header-button", style: { visibility: customHeaderCount === monthsShown - 1 ? 'visible' : 'hidden' } })] }));
|
|
1280
1376
|
}
|
|
1281
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "datepicker-top-header", children: [showHeaderSelectors && (jsxRuntime.jsx(
|
|
1377
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "datepicker-top-header", children: [showHeaderSelectors && (jsxRuntime.jsx(DSelect, { options: years, value: defaultYear, defaultValue: defaultYear, onChange: (year) => changeYear(Number(year === null || year === void 0 ? void 0 : year.value)), searchable: false, className: "custom-year-selector" })), jsxRuntime.jsx("h4", { className: "mb-0 fw-normal", children: dateFns.format(monthDate, 'LLLL, dd', { locale }) })] }), jsxRuntime.jsxs("div", { className: classNames('react-datepicker__header-selector react-datepicker__header-day-selector', className), style: style, children: [jsxRuntime.jsx(DButtonIcon, { icon: iconPrev || chevronLeft, size: iconSize, variant: "link", onClick: decreaseMonth, disabled: prevMonthButtonDisabled, ariaLabel: prevMonthAriaLabel, className: "header-button", style: { visibility: customHeaderCount === 0 ? 'visible' : 'hidden' } }), showHeaderSelectors ? (jsxRuntime.jsx(DSelect, { options: months, value: defaultMonth, defaultValue: defaultMonth, onChange: (month) => changeMonth((month === null || month === void 0 ? void 0 : month.value) || 0), searchable: false, className: "custom-month-selector" })) : (jsxRuntime.jsx("p", { children: `${defaultMonth.label} ${defaultYear === null || defaultYear === void 0 ? void 0 : defaultYear.label}` })), jsxRuntime.jsx(DButtonIcon, { icon: iconNext || chevronRight, size: iconSize, variant: "link", onClick: increaseMonth, disabled: nextMonthButtonDisabled, ariaLabel: nextMonthAriaLabel, className: "header-button", style: { visibility: customHeaderCount === monthsShown - 1 ? 'visible' : 'hidden' } })] })] }));
|
|
1282
1378
|
}
|
|
1283
1379
|
|
|
1284
1380
|
function DDatePicker(_a) {
|
|
@@ -1443,47 +1539,6 @@ function useItemSelection({ getItemIdentifier: getItemIdentifierProp, previousSe
|
|
|
1443
1539
|
};
|
|
1444
1540
|
}
|
|
1445
1541
|
|
|
1446
|
-
function subscribeToMediaQuery(query, callback) {
|
|
1447
|
-
const mediaQueryList = window.matchMedia(query);
|
|
1448
|
-
mediaQueryList.addEventListener('change', callback);
|
|
1449
|
-
return () => {
|
|
1450
|
-
mediaQueryList.removeEventListener('change', callback);
|
|
1451
|
-
};
|
|
1452
|
-
}
|
|
1453
|
-
function checkMediaQuery(query) {
|
|
1454
|
-
return window.matchMedia(query).matches;
|
|
1455
|
-
}
|
|
1456
|
-
|
|
1457
|
-
function useMediaQuery(mediaQuery, useListener = false) {
|
|
1458
|
-
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
|
|
1459
|
-
const noop = (_) => () => { };
|
|
1460
|
-
return React.useSyncExternalStore(useListener ? (cb) => subscribeToMediaQuery(mediaQuery, cb) : noop, () => (mediaQuery ? checkMediaQuery(mediaQuery) : true), () => false);
|
|
1461
|
-
}
|
|
1462
|
-
|
|
1463
|
-
function useMediaBreakpointUp(breakpoint, useListener = false) {
|
|
1464
|
-
const { breakpoints } = useDContext();
|
|
1465
|
-
const mediaQuery = React.useMemo(() => (`(min-width: ${breakpoints[breakpoint]})`), [breakpoint, breakpoints]);
|
|
1466
|
-
return useMediaQuery(mediaQuery, useListener);
|
|
1467
|
-
}
|
|
1468
|
-
function useMediaBreakpointUpXs(useListener = false) {
|
|
1469
|
-
return useMediaBreakpointUp('xs', useListener);
|
|
1470
|
-
}
|
|
1471
|
-
function useMediaBreakpointUpSm(useListener = false) {
|
|
1472
|
-
return useMediaBreakpointUp('sm', useListener);
|
|
1473
|
-
}
|
|
1474
|
-
function useMediaBreakpointUpMd(useListener = false) {
|
|
1475
|
-
return useMediaBreakpointUp('md', useListener);
|
|
1476
|
-
}
|
|
1477
|
-
function useMediaBreakpointUpLg(useListener = false) {
|
|
1478
|
-
return useMediaBreakpointUp('lg', useListener);
|
|
1479
|
-
}
|
|
1480
|
-
function useMediaBreakpointUpXl(useListener = false) {
|
|
1481
|
-
return useMediaBreakpointUp('xl', useListener);
|
|
1482
|
-
}
|
|
1483
|
-
function useMediaBreakpointUpXxl(useListener = false) {
|
|
1484
|
-
return useMediaBreakpointUp('xxl', useListener);
|
|
1485
|
-
}
|
|
1486
|
-
|
|
1487
1542
|
function DInputCounter(_a, ref) {
|
|
1488
1543
|
var { minValue, maxValue, value = minValue, invalid, iconStart: iconStartProp, iconEnd: iconEndProp, iconStartAriaLabel = 'decrease action', iconEndAriaLabel = 'increase action', style, onChange } = _a, props = tslib.__rest(_a, ["minValue", "maxValue", "value", "invalid", "iconStart", "iconEnd", "iconStartAriaLabel", "iconEndAriaLabel", "style", "onChange"]);
|
|
1489
1544
|
const { handleOnWheel, } = useDisableInputWheel(ref);
|
|
@@ -1874,7 +1929,7 @@ function DListGroupItem({ as = 'li', action: actionProp, active, disabled, href,
|
|
|
1874
1929
|
}
|
|
1875
1930
|
return Object.assign(Object.assign({}, active && { 'aria-current': true }), disabled && { 'aria-disabled': true });
|
|
1876
1931
|
}, [Tag, active, disabled]);
|
|
1877
|
-
return (jsxRuntime.jsxs(Tag, Object.assign({ className: classNames(generateClasses, className), style: style }, Tag === 'a' && href && { href }, onClick && { onClick }, ariaAttributes, dataAttributes, Tag === 'button' && { type: 'button' }, { children: [iconStart && (jsxRuntime.jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix, materialStyle: iconStartMaterialStyle })),
|
|
1932
|
+
return (jsxRuntime.jsxs(Tag, Object.assign({ className: classNames(generateClasses, className), style: style }, Tag === 'a' && href && { href }, onClick && { onClick }, ariaAttributes, dataAttributes, Tag === 'button' && { type: 'button' }, { children: [iconStart && (jsxRuntime.jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix, materialStyle: iconStartMaterialStyle })), children, iconEnd && (jsxRuntime.jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix, materialStyle: iconEndMaterialStyle, className: "ms-auto" }))] })));
|
|
1878
1933
|
}
|
|
1879
1934
|
|
|
1880
1935
|
function DListGroup$1({ as = 'ul', numbered, flush, horizontal, children, className, style, dataAttributes, }) {
|
|
@@ -1919,7 +1974,11 @@ function DModalFooter({ className, style, actionPlacement, children, }) {
|
|
|
1919
1974
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "d-modal-separator" }), jsxRuntime.jsx("div", { className: classNames(generateClasses, className), style: style, children: children })] }));
|
|
1920
1975
|
}
|
|
1921
1976
|
|
|
1922
|
-
|
|
1977
|
+
const defaultTransition$1 = {
|
|
1978
|
+
ease: 'easeInOut',
|
|
1979
|
+
duration: 0.3,
|
|
1980
|
+
};
|
|
1981
|
+
function DModal$1({ name, className, style, staticBackdrop, scrollable, centered, fullScreen, fullScreenFrom, size, transition, children, dataAttributes, }) {
|
|
1923
1982
|
const fullScreenClass = React.useMemo(() => {
|
|
1924
1983
|
if (fullScreen) {
|
|
1925
1984
|
if (fullScreenFrom) {
|
|
@@ -1930,7 +1989,7 @@ function DModal$1({ name, className, style, staticBackdrop, scrollable, centered
|
|
|
1930
1989
|
return '';
|
|
1931
1990
|
}, [fullScreenFrom, fullScreen]);
|
|
1932
1991
|
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]);
|
|
1933
|
-
return (jsxRuntime.jsx(
|
|
1992
|
+
return (jsxRuntime.jsx(framerMotion.motion.div, Object.assign({ className: classNames('modal portal show', className), id: name, tabIndex: -1, "aria-labelledby": `${name}Label`, "aria-hidden": "false", style: style, initial: { opacity: 0, scale: 0.95 }, animate: { opacity: 1, scale: 1 }, exit: { opacity: 0, scale: 0.95 }, transition: Object.assign(Object.assign({}, (transition !== null && transition !== void 0 ? transition : defaultTransition$1)), { delay: 0.15 }) }, staticBackdrop && ({
|
|
1934
1993
|
[`data-${PREFIX_BS}backdrop`]: 'static',
|
|
1935
1994
|
[`data-${PREFIX_BS}keyboard`]: 'false',
|
|
1936
1995
|
}), dataAttributes, { children: jsxRuntime.jsx("div", { className: classNames(generateModalDialogClasses), children: jsxRuntime.jsx("div", { className: "modal-content", children: children }) }) })));
|
|
@@ -1959,10 +2018,36 @@ function DOffcanvasFooter({ actionPlacement, children, className, style, }) {
|
|
|
1959
2018
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "d-offcanvas-separator" }), jsxRuntime.jsx("div", { className: classNames(generateClasses, className), style: style, children: children })] }));
|
|
1960
2019
|
}
|
|
1961
2020
|
|
|
1962
|
-
|
|
1963
|
-
|
|
2021
|
+
const variants = {
|
|
2022
|
+
hidden: (openFrom) => {
|
|
2023
|
+
const properties = {};
|
|
2024
|
+
if (openFrom === 'start') {
|
|
2025
|
+
properties.x = '-100%';
|
|
2026
|
+
}
|
|
2027
|
+
if (openFrom === 'end') {
|
|
2028
|
+
properties.x = '100%';
|
|
2029
|
+
}
|
|
2030
|
+
if (openFrom === 'top') {
|
|
2031
|
+
properties.y = '-100%';
|
|
2032
|
+
}
|
|
2033
|
+
if (openFrom === 'bottom') {
|
|
2034
|
+
properties.y = '100%';
|
|
2035
|
+
}
|
|
2036
|
+
return properties;
|
|
2037
|
+
},
|
|
2038
|
+
visible: {
|
|
2039
|
+
x: 0,
|
|
2040
|
+
y: 0,
|
|
2041
|
+
},
|
|
2042
|
+
};
|
|
2043
|
+
const defaultTransition = {
|
|
2044
|
+
ease: 'easeInOut',
|
|
2045
|
+
duration: 0.3,
|
|
2046
|
+
};
|
|
2047
|
+
function DOffcanvas$1({ name, className, style, staticBackdrop, scrollable, openFrom = 'end', transition, children, dataAttributes, }) {
|
|
2048
|
+
return (jsxRuntime.jsx(framerMotion.motion.div, Object.assign({ className: classNames('offcanvas portal show', {
|
|
1964
2049
|
[`offcanvas-${openFrom}`]: openFrom,
|
|
1965
|
-
}, className), style: style, id: name, tabIndex: -1, "aria-labelledby": `${name}Label`, "aria-hidden": "false" }, staticBackdrop && ({
|
|
2050
|
+
}, className), style: Object.assign(Object.assign({}, style), { transition: 'none' }), id: name, tabIndex: -1, "aria-labelledby": `${name}Label`, "aria-hidden": "false", custom: openFrom, variants: variants, initial: "hidden", animate: "visible", exit: "hidden", transition: Object.assign(Object.assign({}, (transition !== null && transition !== void 0 ? transition : defaultTransition)), { delay: 0.15 }) }, staticBackdrop && ({
|
|
1966
2051
|
[`data-${PREFIX_BS}backdrop`]: 'static',
|
|
1967
2052
|
[`data-${PREFIX_BS}keyboard`]: 'false',
|
|
1968
2053
|
}), scrollable && ({
|
|
@@ -2216,19 +2301,6 @@ function useDToast() {
|
|
|
2216
2301
|
};
|
|
2217
2302
|
}
|
|
2218
2303
|
|
|
2219
|
-
function DTableHead({ className, style, field, label, value = '', onChange, }) {
|
|
2220
|
-
const handleOnChange = React.useCallback(() => {
|
|
2221
|
-
if (value === field) {
|
|
2222
|
-
return onChange(`-${field}`);
|
|
2223
|
-
}
|
|
2224
|
-
if (value === `-${field}`) {
|
|
2225
|
-
return onChange('');
|
|
2226
|
-
}
|
|
2227
|
-
return onChange(field);
|
|
2228
|
-
}, [field, value, onChange]);
|
|
2229
|
-
return (jsxRuntime.jsx("th", { style: style, className: classNames('d-table-head', className), children: jsxRuntime.jsxs("button", { type: "button", onClick: handleOnChange, children: [label, value && value.includes(field) && (jsxRuntime.jsx(DIcon, { icon: value === field ? 'arrow-up' : 'arrow-down' }))] }) }));
|
|
2230
|
-
}
|
|
2231
|
-
|
|
2232
2304
|
async function configureI8n(resources, _a = {}) {
|
|
2233
2305
|
var { lng = 'en', fallbackLng = 'en' } = _a, config = tslib.__rest(_a, ["lng", "fallbackLng"]);
|
|
2234
2306
|
return i18n
|
|
@@ -2591,7 +2663,6 @@ exports.DStepper = DStepper;
|
|
|
2591
2663
|
exports.DStepperDesktop = DStepper$2;
|
|
2592
2664
|
exports.DStepperMobile = DStepper$1;
|
|
2593
2665
|
exports.DTabContent = DTabContent;
|
|
2594
|
-
exports.DTableHead = DTableHead;
|
|
2595
2666
|
exports.DTabs = DTabs;
|
|
2596
2667
|
exports.DTimeline = DTimeline;
|
|
2597
2668
|
exports.DToast = DToast;
|