@dynamic-framework/ui-react 2.0.0-dev.6 → 2.0.0-dev.8
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 +127 -510
- 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 +188 -1065
- package/dist/css/dynamic-ui.min.css +2 -2
- package/dist/index.esm.js +152 -98
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +150 -96
- package/dist/index.js.map +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/config.d.ts +0 -2
- package/dist/types/hooks/useResponsiveProp.d.ts +35 -0
- package/package.json +16 -25
- 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-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/index.js
CHANGED
|
@@ -44,57 +44,6 @@ var LucideIcons__namespace = /*#__PURE__*/_interopNamespaceDefault(LucideIcons);
|
|
|
44
44
|
|
|
45
45
|
const PREFIX_BS = 'bs-';
|
|
46
46
|
|
|
47
|
-
function DIconBase({ icon, color, style, className, size, hasCircle = false, materialStyle = false, familyClass, familyPrefix, strokeWidth = 2, dataAttributes, }) {
|
|
48
|
-
// If materialStyle is true, use Material Design icons (legacy)
|
|
49
|
-
const useMaterialIcons = materialStyle;
|
|
50
|
-
// Get Lucide icon component
|
|
51
|
-
const LucideIcon = React.useMemo(() => {
|
|
52
|
-
if (useMaterialIcons)
|
|
53
|
-
return null;
|
|
54
|
-
// Try to find the icon in Lucide (expects PascalCase)
|
|
55
|
-
const icons = LucideIcons__namespace;
|
|
56
|
-
return icons[icon] || null;
|
|
57
|
-
}, [icon, useMaterialIcons]);
|
|
58
|
-
const colorStyle = React.useMemo(() => {
|
|
59
|
-
if (color) {
|
|
60
|
-
return { [`--${PREFIX_BS}icon-component-color`]: `var(--${PREFIX_BS}${color})` };
|
|
61
|
-
}
|
|
62
|
-
return {};
|
|
63
|
-
}, [color]);
|
|
64
|
-
const backgroundStyle = React.useMemo(() => {
|
|
65
|
-
if (hasCircle) {
|
|
66
|
-
if (color) {
|
|
67
|
-
return { [`--${PREFIX_BS}icon-component-bg-color`]: `rgba(var(--${PREFIX_BS}${color}-rgb), 0.1)` };
|
|
68
|
-
}
|
|
69
|
-
return { [`--${PREFIX_BS}icon-component-bg-color`]: `rgba(var(--${PREFIX_BS}body-color-rgb), 0.1)` };
|
|
70
|
-
}
|
|
71
|
-
return {};
|
|
72
|
-
}, [hasCircle, color]);
|
|
73
|
-
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]);
|
|
74
|
-
const generateClasses = React.useMemo(() => (Object.assign({ 'd-icon': true }, className && { [className]: true })), [className]);
|
|
75
|
-
const iconSize = React.useMemo(() => {
|
|
76
|
-
if (size) {
|
|
77
|
-
const numSize = parseInt(size, 10);
|
|
78
|
-
return !Number.isNaN(numSize) ? numSize : size;
|
|
79
|
-
}
|
|
80
|
-
return undefined;
|
|
81
|
-
}, [size]);
|
|
82
|
-
// Render Material Design icon (legacy support)
|
|
83
|
-
if (useMaterialIcons) {
|
|
84
|
-
return (jsxRuntime.jsx("i", Object.assign({ className: classNames(generateClasses, familyClass), style: generateStyleVariables }, dataAttributes, { children: icon })));
|
|
85
|
-
}
|
|
86
|
-
// Render Lucide icon
|
|
87
|
-
if (!LucideIcon) {
|
|
88
|
-
if (familyClass && familyPrefix) {
|
|
89
|
-
return (jsxRuntime.jsx("i", Object.assign({ className: classNames(generateClasses, familyClass, `${familyPrefix}${icon}`), style: generateStyleVariables }, dataAttributes)));
|
|
90
|
-
}
|
|
91
|
-
// eslint-disable-next-line no-console
|
|
92
|
-
console.warn(`Icon "${icon}" not found in Lucide. Make sure to use PascalCase names (e.g., "Home", "User", "Settings")`);
|
|
93
|
-
return (jsxRuntime.jsx("span", Object.assign({ className: classNames(generateClasses), style: generateStyleVariables }, dataAttributes, { children: "?" })));
|
|
94
|
-
}
|
|
95
|
-
return (jsxRuntime.jsx("span", Object.assign({ className: classNames(generateClasses), style: generateStyleVariables }, dataAttributes, { children: jsxRuntime.jsx(LucideIcon, { size: iconSize || 24, strokeWidth: strokeWidth }) })));
|
|
96
|
-
}
|
|
97
|
-
|
|
98
47
|
function useDisableBodyScrollEffect(disable) {
|
|
99
48
|
React.useEffect(() => {
|
|
100
49
|
if (disable) {
|
|
@@ -350,6 +299,151 @@ function useDContext() {
|
|
|
350
299
|
return context;
|
|
351
300
|
}
|
|
352
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
|
+
|
|
353
447
|
function DIcon(_a) {
|
|
354
448
|
var { familyClass: propFamilyClass, familyPrefix: propFamilyPrefix, materialStyle: propMaterialStyle } = _a, props = tslib.__rest(_a, ["familyClass", "familyPrefix", "materialStyle"]);
|
|
355
449
|
const { icon: { familyClass, familyPrefix, materialStyle, }, } = useDContext();
|
|
@@ -417,7 +511,7 @@ function useProvidedRefOrCreate(providedRef) {
|
|
|
417
511
|
}
|
|
418
512
|
|
|
419
513
|
function DInput(_a, ref) {
|
|
420
|
-
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"]);
|
|
421
515
|
const inputRef = useProvidedRefOrCreate(ref);
|
|
422
516
|
const innerId = React.useId();
|
|
423
517
|
const id = React.useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
@@ -454,7 +548,7 @@ function DInput(_a, ref) {
|
|
|
454
548
|
const inputComponent = React.useMemo(() => (jsxRuntime.jsx("input", Object.assign({ ref: inputRef, id: id, className: classNames('form-control', {
|
|
455
549
|
'is-invalid': invalid,
|
|
456
550
|
'is-valid': valid,
|
|
457
|
-
}), 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))), [
|
|
458
552
|
ariaDescribedby,
|
|
459
553
|
disabled,
|
|
460
554
|
handleOnChange,
|
|
@@ -467,6 +561,7 @@ function DInput(_a, ref) {
|
|
|
467
561
|
floatingLabel,
|
|
468
562
|
valid,
|
|
469
563
|
value,
|
|
564
|
+
readonly,
|
|
470
565
|
]);
|
|
471
566
|
const labelComponent = React.useMemo(() => (jsxRuntime.jsx("label", { htmlFor: id, children: label })), [
|
|
472
567
|
id,
|
|
@@ -1279,7 +1374,7 @@ function DDatePickerHeaderSelector({ date, changeYear, changeMonth, decreaseMont
|
|
|
1279
1374
|
if (pickerType === PickerType.Quarter || pickerType === PickerType.Month) {
|
|
1280
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' } })] }));
|
|
1281
1376
|
}
|
|
1282
|
-
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' } })] })] }));
|
|
1283
1378
|
}
|
|
1284
1379
|
|
|
1285
1380
|
function DDatePicker(_a) {
|
|
@@ -1444,47 +1539,6 @@ function useItemSelection({ getItemIdentifier: getItemIdentifierProp, previousSe
|
|
|
1444
1539
|
};
|
|
1445
1540
|
}
|
|
1446
1541
|
|
|
1447
|
-
function subscribeToMediaQuery(query, callback) {
|
|
1448
|
-
const mediaQueryList = window.matchMedia(query);
|
|
1449
|
-
mediaQueryList.addEventListener('change', callback);
|
|
1450
|
-
return () => {
|
|
1451
|
-
mediaQueryList.removeEventListener('change', callback);
|
|
1452
|
-
};
|
|
1453
|
-
}
|
|
1454
|
-
function checkMediaQuery(query) {
|
|
1455
|
-
return window.matchMedia(query).matches;
|
|
1456
|
-
}
|
|
1457
|
-
|
|
1458
|
-
function useMediaQuery(mediaQuery, useListener = false) {
|
|
1459
|
-
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
|
|
1460
|
-
const noop = (_) => () => { };
|
|
1461
|
-
return React.useSyncExternalStore(useListener ? (cb) => subscribeToMediaQuery(mediaQuery, cb) : noop, () => (mediaQuery ? checkMediaQuery(mediaQuery) : true), () => false);
|
|
1462
|
-
}
|
|
1463
|
-
|
|
1464
|
-
function useMediaBreakpointUp(breakpoint, useListener = false) {
|
|
1465
|
-
const { breakpoints } = useDContext();
|
|
1466
|
-
const mediaQuery = React.useMemo(() => (`(min-width: ${breakpoints[breakpoint]})`), [breakpoint, breakpoints]);
|
|
1467
|
-
return useMediaQuery(mediaQuery, useListener);
|
|
1468
|
-
}
|
|
1469
|
-
function useMediaBreakpointUpXs(useListener = false) {
|
|
1470
|
-
return useMediaBreakpointUp('xs', useListener);
|
|
1471
|
-
}
|
|
1472
|
-
function useMediaBreakpointUpSm(useListener = false) {
|
|
1473
|
-
return useMediaBreakpointUp('sm', useListener);
|
|
1474
|
-
}
|
|
1475
|
-
function useMediaBreakpointUpMd(useListener = false) {
|
|
1476
|
-
return useMediaBreakpointUp('md', useListener);
|
|
1477
|
-
}
|
|
1478
|
-
function useMediaBreakpointUpLg(useListener = false) {
|
|
1479
|
-
return useMediaBreakpointUp('lg', useListener);
|
|
1480
|
-
}
|
|
1481
|
-
function useMediaBreakpointUpXl(useListener = false) {
|
|
1482
|
-
return useMediaBreakpointUp('xl', useListener);
|
|
1483
|
-
}
|
|
1484
|
-
function useMediaBreakpointUpXxl(useListener = false) {
|
|
1485
|
-
return useMediaBreakpointUp('xxl', useListener);
|
|
1486
|
-
}
|
|
1487
|
-
|
|
1488
1542
|
function DInputCounter(_a, ref) {
|
|
1489
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"]);
|
|
1490
1544
|
const { handleOnWheel, } = useDisableInputWheel(ref);
|
|
@@ -1875,7 +1929,7 @@ function DListGroupItem({ as = 'li', action: actionProp, active, disabled, href,
|
|
|
1875
1929
|
}
|
|
1876
1930
|
return Object.assign(Object.assign({}, active && { 'aria-current': true }), disabled && { 'aria-disabled': true });
|
|
1877
1931
|
}, [Tag, active, disabled]);
|
|
1878
|
-
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" }))] })));
|
|
1879
1933
|
}
|
|
1880
1934
|
|
|
1881
1935
|
function DListGroup$1({ as = 'ul', numbered, flush, horizontal, children, className, style, dataAttributes, }) {
|