@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.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import React, {
|
|
3
|
+
import React, { useEffect, useState, useCallback, useMemo, useContext, createContext, useLayoutEffect, useSyncExternalStore, forwardRef, useId, useRef } from 'react';
|
|
4
4
|
import { __rest } from 'tslib';
|
|
5
5
|
import * as LucideIcons from 'lucide-react';
|
|
6
6
|
import { createPortal } from 'react-dom';
|
|
@@ -23,57 +23,6 @@ import { initReactI18next } from 'react-i18next';
|
|
|
23
23
|
|
|
24
24
|
const PREFIX_BS = 'bs-';
|
|
25
25
|
|
|
26
|
-
function DIconBase({ icon, color, style, className, size, hasCircle = false, materialStyle = false, familyClass, familyPrefix, strokeWidth = 2, dataAttributes, }) {
|
|
27
|
-
// If materialStyle is true, use Material Design icons (legacy)
|
|
28
|
-
const useMaterialIcons = materialStyle;
|
|
29
|
-
// Get Lucide icon component
|
|
30
|
-
const LucideIcon = useMemo(() => {
|
|
31
|
-
if (useMaterialIcons)
|
|
32
|
-
return null;
|
|
33
|
-
// Try to find the icon in Lucide (expects PascalCase)
|
|
34
|
-
const icons = LucideIcons;
|
|
35
|
-
return icons[icon] || null;
|
|
36
|
-
}, [icon, useMaterialIcons]);
|
|
37
|
-
const colorStyle = useMemo(() => {
|
|
38
|
-
if (color) {
|
|
39
|
-
return { [`--${PREFIX_BS}icon-component-color`]: `var(--${PREFIX_BS}${color})` };
|
|
40
|
-
}
|
|
41
|
-
return {};
|
|
42
|
-
}, [color]);
|
|
43
|
-
const backgroundStyle = useMemo(() => {
|
|
44
|
-
if (hasCircle) {
|
|
45
|
-
if (color) {
|
|
46
|
-
return { [`--${PREFIX_BS}icon-component-bg-color`]: `rgba(var(--${PREFIX_BS}${color}-rgb), 0.1)` };
|
|
47
|
-
}
|
|
48
|
-
return { [`--${PREFIX_BS}icon-component-bg-color`]: `rgba(var(--${PREFIX_BS}body-color-rgb), 0.1)` };
|
|
49
|
-
}
|
|
50
|
-
return {};
|
|
51
|
-
}, [hasCircle, color]);
|
|
52
|
-
const generateStyleVariables = 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]);
|
|
53
|
-
const generateClasses = useMemo(() => (Object.assign({ 'd-icon': true }, className && { [className]: true })), [className]);
|
|
54
|
-
const iconSize = useMemo(() => {
|
|
55
|
-
if (size) {
|
|
56
|
-
const numSize = parseInt(size, 10);
|
|
57
|
-
return !Number.isNaN(numSize) ? numSize : size;
|
|
58
|
-
}
|
|
59
|
-
return undefined;
|
|
60
|
-
}, [size]);
|
|
61
|
-
// Render Material Design icon (legacy support)
|
|
62
|
-
if (useMaterialIcons) {
|
|
63
|
-
return (jsx("i", Object.assign({ className: classNames(generateClasses, familyClass), style: generateStyleVariables }, dataAttributes, { children: icon })));
|
|
64
|
-
}
|
|
65
|
-
// Render Lucide icon
|
|
66
|
-
if (!LucideIcon) {
|
|
67
|
-
if (familyClass && familyPrefix) {
|
|
68
|
-
return (jsx("i", Object.assign({ className: classNames(generateClasses, familyClass, `${familyPrefix}${icon}`), style: generateStyleVariables }, dataAttributes)));
|
|
69
|
-
}
|
|
70
|
-
// eslint-disable-next-line no-console
|
|
71
|
-
console.warn(`Icon "${icon}" not found in Lucide. Make sure to use PascalCase names (e.g., "Home", "User", "Settings")`);
|
|
72
|
-
return (jsx("span", Object.assign({ className: classNames(generateClasses), style: generateStyleVariables }, dataAttributes, { children: "?" })));
|
|
73
|
-
}
|
|
74
|
-
return (jsx("span", Object.assign({ className: classNames(generateClasses), style: generateStyleVariables }, dataAttributes, { children: jsx(LucideIcon, { size: iconSize || 24, strokeWidth: strokeWidth }) })));
|
|
75
|
-
}
|
|
76
|
-
|
|
77
26
|
function useDisableBodyScrollEffect(disable) {
|
|
78
27
|
useEffect(() => {
|
|
79
28
|
if (disable) {
|
|
@@ -329,6 +278,151 @@ function useDContext() {
|
|
|
329
278
|
return context;
|
|
330
279
|
}
|
|
331
280
|
|
|
281
|
+
function subscribeToMediaQuery(query, callback) {
|
|
282
|
+
const mediaQueryList = window.matchMedia(query);
|
|
283
|
+
mediaQueryList.addEventListener('change', callback);
|
|
284
|
+
return () => {
|
|
285
|
+
mediaQueryList.removeEventListener('change', callback);
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
function checkMediaQuery(query) {
|
|
289
|
+
return window.matchMedia(query).matches;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
function useMediaQuery(mediaQuery, useListener = false) {
|
|
293
|
+
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
|
|
294
|
+
const noop = (_) => () => { };
|
|
295
|
+
return useSyncExternalStore(useListener ? (cb) => subscribeToMediaQuery(mediaQuery, cb) : noop, () => (mediaQuery ? checkMediaQuery(mediaQuery) : true), () => false);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
function useMediaBreakpointUp(breakpoint, useListener = false) {
|
|
299
|
+
const { breakpoints } = useDContext();
|
|
300
|
+
const mediaQuery = useMemo(() => (`(min-width: ${breakpoints[breakpoint]})`), [breakpoint, breakpoints]);
|
|
301
|
+
return useMediaQuery(mediaQuery, useListener);
|
|
302
|
+
}
|
|
303
|
+
function useMediaBreakpointUpXs(useListener = false) {
|
|
304
|
+
return useMediaBreakpointUp('xs', useListener);
|
|
305
|
+
}
|
|
306
|
+
function useMediaBreakpointUpSm(useListener = false) {
|
|
307
|
+
return useMediaBreakpointUp('sm', useListener);
|
|
308
|
+
}
|
|
309
|
+
function useMediaBreakpointUpMd(useListener = false) {
|
|
310
|
+
return useMediaBreakpointUp('md', useListener);
|
|
311
|
+
}
|
|
312
|
+
function useMediaBreakpointUpLg(useListener = false) {
|
|
313
|
+
return useMediaBreakpointUp('lg', useListener);
|
|
314
|
+
}
|
|
315
|
+
function useMediaBreakpointUpXl(useListener = false) {
|
|
316
|
+
return useMediaBreakpointUp('xl', useListener);
|
|
317
|
+
}
|
|
318
|
+
function useMediaBreakpointUpXxl(useListener = false) {
|
|
319
|
+
return useMediaBreakpointUp('xxl', useListener);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* React hook to resolve a responsive property value based on the current viewport breakpoint.
|
|
324
|
+
*
|
|
325
|
+
* Given a `ResponsiveProp` object, this hook returns the value for the highest matching breakpoint.
|
|
326
|
+
* If multiple breakpoints match, the value for the largest (highest) breakpoint is used.
|
|
327
|
+
* If no breakpoints match, `undefined` is returned.
|
|
328
|
+
*
|
|
329
|
+
* @param useListener - Whether to listen for breakpoint changes (default: false).
|
|
330
|
+
* @returns An object with a `responsivePropValue` function that takes a
|
|
331
|
+
* `ResponsiveProp` and returns the resolved value.
|
|
332
|
+
*
|
|
333
|
+
* Usage example:
|
|
334
|
+
* ```ts
|
|
335
|
+
* const { responsivePropValue } = useResponsiveProp();
|
|
336
|
+
* const value = responsivePropValue({ xs: "A", md: "B", xl: "C" });
|
|
337
|
+
* // value will be "C" if xl breakpoint is active, "B" if md is active, etc.
|
|
338
|
+
* ```
|
|
339
|
+
*/
|
|
340
|
+
function useResponsiveProp(useListener = false) {
|
|
341
|
+
const bpXsUp = useMediaBreakpointUpXs(useListener);
|
|
342
|
+
const bpSmUp = useMediaBreakpointUpSm(useListener);
|
|
343
|
+
const bpMdUp = useMediaBreakpointUpMd(useListener);
|
|
344
|
+
const bpLgUp = useMediaBreakpointUpLg(useListener);
|
|
345
|
+
const bpXlUp = useMediaBreakpointUpXl(useListener);
|
|
346
|
+
const bpXxlUp = useMediaBreakpointUpXxl(useListener);
|
|
347
|
+
const responsivePropValue = useCallback((prop) => {
|
|
348
|
+
// Pick the highest matched breakpoint value that is defined in prop
|
|
349
|
+
if (prop.xxl !== undefined && bpXxlUp)
|
|
350
|
+
return prop.xxl;
|
|
351
|
+
if (prop.xl !== undefined && bpXlUp)
|
|
352
|
+
return prop.xl;
|
|
353
|
+
if (prop.lg !== undefined && bpLgUp)
|
|
354
|
+
return prop.lg;
|
|
355
|
+
if (prop.md !== undefined && bpMdUp)
|
|
356
|
+
return prop.md;
|
|
357
|
+
if (prop.sm !== undefined && bpSmUp)
|
|
358
|
+
return prop.sm;
|
|
359
|
+
if (prop.xs !== undefined && bpXsUp)
|
|
360
|
+
return prop.xs;
|
|
361
|
+
// Fallback: return undefined if no breakpoint matches
|
|
362
|
+
return undefined;
|
|
363
|
+
}, [bpSmUp, bpMdUp, bpLgUp, bpXlUp, bpXxlUp, bpXsUp]);
|
|
364
|
+
return { responsivePropValue };
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
function DIconBase({ icon, color, style, className, size, useListenerSize = false, hasCircle = false, materialStyle = false, familyClass, familyPrefix, strokeWidth = 2, dataAttributes, }) {
|
|
368
|
+
// If materialStyle is true, use Material Design icons (legacy)
|
|
369
|
+
const useMaterialIcons = materialStyle;
|
|
370
|
+
// Get Lucide icon component
|
|
371
|
+
const LucideIcon = useMemo(() => {
|
|
372
|
+
if (useMaterialIcons)
|
|
373
|
+
return null;
|
|
374
|
+
// Try to find the icon in Lucide (expects PascalCase)
|
|
375
|
+
const icons = LucideIcons;
|
|
376
|
+
return icons[icon] || null;
|
|
377
|
+
}, [icon, useMaterialIcons]);
|
|
378
|
+
const colorStyle = useMemo(() => {
|
|
379
|
+
if (color) {
|
|
380
|
+
return { [`--${PREFIX_BS}icon-component-color`]: `var(--${PREFIX_BS}${color})` };
|
|
381
|
+
}
|
|
382
|
+
return {};
|
|
383
|
+
}, [color]);
|
|
384
|
+
const backgroundStyle = useMemo(() => {
|
|
385
|
+
if (hasCircle) {
|
|
386
|
+
if (color) {
|
|
387
|
+
return { [`--${PREFIX_BS}icon-component-bg-color`]: `rgba(var(--${PREFIX_BS}${color}-rgb), 0.1)` };
|
|
388
|
+
}
|
|
389
|
+
return { [`--${PREFIX_BS}icon-component-bg-color`]: `rgba(var(--${PREFIX_BS}body-color-rgb), 0.1)` };
|
|
390
|
+
}
|
|
391
|
+
return {};
|
|
392
|
+
}, [hasCircle, color]);
|
|
393
|
+
const { responsivePropValue } = useResponsiveProp(useListenerSize);
|
|
394
|
+
const resolvedSize = useMemo(() => {
|
|
395
|
+
if (!size)
|
|
396
|
+
return undefined;
|
|
397
|
+
if (typeof size === 'string')
|
|
398
|
+
return size;
|
|
399
|
+
return responsivePropValue(size);
|
|
400
|
+
}, [responsivePropValue, size]);
|
|
401
|
+
const generateStyleVariables = 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]);
|
|
402
|
+
const generateClasses = useMemo(() => (Object.assign({ 'd-icon': true }, className && { [className]: true })), [className]);
|
|
403
|
+
const iconSize = useMemo(() => {
|
|
404
|
+
if (resolvedSize) {
|
|
405
|
+
const numSize = parseInt(resolvedSize, 10);
|
|
406
|
+
return !Number.isNaN(numSize) ? numSize : resolvedSize;
|
|
407
|
+
}
|
|
408
|
+
return undefined;
|
|
409
|
+
}, [resolvedSize]);
|
|
410
|
+
// Render Material Design icon (legacy support)
|
|
411
|
+
if (useMaterialIcons) {
|
|
412
|
+
return (jsx("i", Object.assign({ className: classNames(generateClasses, familyClass), style: generateStyleVariables }, dataAttributes, { children: icon })));
|
|
413
|
+
}
|
|
414
|
+
// Render Lucide icon
|
|
415
|
+
if (!LucideIcon) {
|
|
416
|
+
if (familyClass && familyPrefix) {
|
|
417
|
+
return (jsx("i", Object.assign({ className: classNames(generateClasses, familyClass, `${familyPrefix}${icon}`), style: generateStyleVariables }, dataAttributes)));
|
|
418
|
+
}
|
|
419
|
+
// eslint-disable-next-line no-console
|
|
420
|
+
console.warn(`Icon "${icon}" not found in Lucide. Make sure to use PascalCase names (e.g., "Home", "User", "Settings")`);
|
|
421
|
+
return (jsx("span", Object.assign({ className: classNames(generateClasses), style: generateStyleVariables }, dataAttributes, { children: "?" })));
|
|
422
|
+
}
|
|
423
|
+
return (jsx("span", Object.assign({ className: classNames(generateClasses), style: generateStyleVariables }, dataAttributes, { children: jsx(LucideIcon, { size: iconSize || 24, strokeWidth: strokeWidth }) })));
|
|
424
|
+
}
|
|
425
|
+
|
|
332
426
|
function DIcon(_a) {
|
|
333
427
|
var { familyClass: propFamilyClass, familyPrefix: propFamilyPrefix, materialStyle: propMaterialStyle } = _a, props = __rest(_a, ["familyClass", "familyPrefix", "materialStyle"]);
|
|
334
428
|
const { icon: { familyClass, familyPrefix, materialStyle, }, } = useDContext();
|
|
@@ -396,7 +490,7 @@ function useProvidedRefOrCreate(providedRef) {
|
|
|
396
490
|
}
|
|
397
491
|
|
|
398
492
|
function DInput(_a, ref) {
|
|
399
|
-
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 = __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"]);
|
|
493
|
+
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 = __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"]);
|
|
400
494
|
const inputRef = useProvidedRefOrCreate(ref);
|
|
401
495
|
const innerId = useId();
|
|
402
496
|
const id = useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
@@ -433,7 +527,7 @@ function DInput(_a, ref) {
|
|
|
433
527
|
const inputComponent = useMemo(() => (jsx("input", Object.assign({ ref: inputRef, id: id, className: classNames('form-control', {
|
|
434
528
|
'is-invalid': invalid,
|
|
435
529
|
'is-valid': valid,
|
|
436
|
-
}), disabled: disabled || loading, value: value, onChange: handleOnChange }, (floatingLabel || placeholder) && { placeholder: floatingLabel ? '' : placeholder }, ariaDescribedby && { 'aria-describedby': ariaDescribedby }, inputProps))), [
|
|
530
|
+
}), disabled: disabled || loading, readOnly: readonly, value: value, onChange: handleOnChange }, (floatingLabel || placeholder) && { placeholder: floatingLabel ? '' : placeholder }, ariaDescribedby && { 'aria-describedby': ariaDescribedby }, inputProps))), [
|
|
437
531
|
ariaDescribedby,
|
|
438
532
|
disabled,
|
|
439
533
|
handleOnChange,
|
|
@@ -446,6 +540,7 @@ function DInput(_a, ref) {
|
|
|
446
540
|
floatingLabel,
|
|
447
541
|
valid,
|
|
448
542
|
value,
|
|
543
|
+
readonly,
|
|
449
544
|
]);
|
|
450
545
|
const labelComponent = useMemo(() => (jsx("label", { htmlFor: id, children: label })), [
|
|
451
546
|
id,
|
|
@@ -1258,7 +1353,7 @@ function DDatePickerHeaderSelector({ date, changeYear, changeMonth, decreaseMont
|
|
|
1258
1353
|
if (pickerType === PickerType.Quarter || pickerType === PickerType.Month) {
|
|
1259
1354
|
return (jsxs("div", { className: classNames(`react-datepicker__header-selector react-datepicker__header-${pickerType}-selector`, className), style: style, children: [jsx(DButtonIcon, { icon: iconPrev || chevronLeft, size: iconSize, variant: "link", onClick: decreaseYear, disabled: prevMonthButtonDisabled, ariaLabel: prevMonthAriaLabel, className: "header-button", style: { visibility: customHeaderCount === 0 ? 'visible' : 'hidden' } }), jsx("div", { className: "d-flex justify-content-center flex-grow-1", children: showHeaderSelectors ? (jsx(DSelect$1, { options: years, value: defaultYear, defaultValue: defaultYear, onChange: (year) => changeYear(Number(year === null || year === void 0 ? void 0 : year.value)), searchable: false })) : (jsx("p", { children: defaultYear === null || defaultYear === void 0 ? void 0 : defaultYear.label })) }), 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' } })] }));
|
|
1260
1355
|
}
|
|
1261
|
-
return (jsxs(Fragment, { children: [jsxs("div", { className: "datepicker-top-header", children: [showHeaderSelectors && (jsx(
|
|
1356
|
+
return (jsxs(Fragment, { children: [jsxs("div", { className: "datepicker-top-header", children: [showHeaderSelectors && (jsx(DSelect$1, { 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" })), jsx("h4", { className: "mb-0 fw-normal", children: format(monthDate, 'LLLL, dd', { locale }) })] }), jsxs("div", { className: classNames('react-datepicker__header-selector react-datepicker__header-day-selector', className), style: style, children: [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 ? (jsx(DSelect$1, { 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" })) : (jsx("p", { children: `${defaultMonth.label} ${defaultYear === null || defaultYear === void 0 ? void 0 : defaultYear.label}` })), 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' } })] })] }));
|
|
1262
1357
|
}
|
|
1263
1358
|
|
|
1264
1359
|
function DDatePicker(_a) {
|
|
@@ -1423,47 +1518,6 @@ function useItemSelection({ getItemIdentifier: getItemIdentifierProp, previousSe
|
|
|
1423
1518
|
};
|
|
1424
1519
|
}
|
|
1425
1520
|
|
|
1426
|
-
function subscribeToMediaQuery(query, callback) {
|
|
1427
|
-
const mediaQueryList = window.matchMedia(query);
|
|
1428
|
-
mediaQueryList.addEventListener('change', callback);
|
|
1429
|
-
return () => {
|
|
1430
|
-
mediaQueryList.removeEventListener('change', callback);
|
|
1431
|
-
};
|
|
1432
|
-
}
|
|
1433
|
-
function checkMediaQuery(query) {
|
|
1434
|
-
return window.matchMedia(query).matches;
|
|
1435
|
-
}
|
|
1436
|
-
|
|
1437
|
-
function useMediaQuery(mediaQuery, useListener = false) {
|
|
1438
|
-
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
|
|
1439
|
-
const noop = (_) => () => { };
|
|
1440
|
-
return useSyncExternalStore(useListener ? (cb) => subscribeToMediaQuery(mediaQuery, cb) : noop, () => (mediaQuery ? checkMediaQuery(mediaQuery) : true), () => false);
|
|
1441
|
-
}
|
|
1442
|
-
|
|
1443
|
-
function useMediaBreakpointUp(breakpoint, useListener = false) {
|
|
1444
|
-
const { breakpoints } = useDContext();
|
|
1445
|
-
const mediaQuery = useMemo(() => (`(min-width: ${breakpoints[breakpoint]})`), [breakpoint, breakpoints]);
|
|
1446
|
-
return useMediaQuery(mediaQuery, useListener);
|
|
1447
|
-
}
|
|
1448
|
-
function useMediaBreakpointUpXs(useListener = false) {
|
|
1449
|
-
return useMediaBreakpointUp('xs', useListener);
|
|
1450
|
-
}
|
|
1451
|
-
function useMediaBreakpointUpSm(useListener = false) {
|
|
1452
|
-
return useMediaBreakpointUp('sm', useListener);
|
|
1453
|
-
}
|
|
1454
|
-
function useMediaBreakpointUpMd(useListener = false) {
|
|
1455
|
-
return useMediaBreakpointUp('md', useListener);
|
|
1456
|
-
}
|
|
1457
|
-
function useMediaBreakpointUpLg(useListener = false) {
|
|
1458
|
-
return useMediaBreakpointUp('lg', useListener);
|
|
1459
|
-
}
|
|
1460
|
-
function useMediaBreakpointUpXl(useListener = false) {
|
|
1461
|
-
return useMediaBreakpointUp('xl', useListener);
|
|
1462
|
-
}
|
|
1463
|
-
function useMediaBreakpointUpXxl(useListener = false) {
|
|
1464
|
-
return useMediaBreakpointUp('xxl', useListener);
|
|
1465
|
-
}
|
|
1466
|
-
|
|
1467
1521
|
function DInputCounter(_a, ref) {
|
|
1468
1522
|
var { minValue, maxValue, value = minValue, invalid, iconStart: iconStartProp, iconEnd: iconEndProp, iconStartAriaLabel = 'decrease action', iconEndAriaLabel = 'increase action', style, onChange } = _a, props = __rest(_a, ["minValue", "maxValue", "value", "invalid", "iconStart", "iconEnd", "iconStartAriaLabel", "iconEndAriaLabel", "style", "onChange"]);
|
|
1469
1523
|
const { handleOnWheel, } = useDisableInputWheel(ref);
|
|
@@ -1854,7 +1908,7 @@ function DListGroupItem({ as = 'li', action: actionProp, active, disabled, href,
|
|
|
1854
1908
|
}
|
|
1855
1909
|
return Object.assign(Object.assign({}, active && { 'aria-current': true }), disabled && { 'aria-disabled': true });
|
|
1856
1910
|
}, [Tag, active, disabled]);
|
|
1857
|
-
return (jsxs(Tag, Object.assign({ className: classNames(generateClasses, className), style: style }, Tag === 'a' && href && { href }, onClick && { onClick }, ariaAttributes, dataAttributes, Tag === 'button' && { type: 'button' }, { children: [iconStart && (jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix, materialStyle: iconStartMaterialStyle })),
|
|
1911
|
+
return (jsxs(Tag, Object.assign({ className: classNames(generateClasses, className), style: style }, Tag === 'a' && href && { href }, onClick && { onClick }, ariaAttributes, dataAttributes, Tag === 'button' && { type: 'button' }, { children: [iconStart && (jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix, materialStyle: iconStartMaterialStyle })), children, iconEnd && (jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix, materialStyle: iconEndMaterialStyle, className: "ms-auto" }))] })));
|
|
1858
1912
|
}
|
|
1859
1913
|
|
|
1860
1914
|
function DListGroup({ as = 'ul', numbered, flush, horizontal, children, className, style, dataAttributes, }) {
|