@dynamic-framework/ui-react 1.31.0 → 1.32.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 +309 -126
- package/dist/css/dynamic-ui-non-root.min.css +2 -2
- package/dist/css/dynamic-ui-root.css +4 -1
- package/dist/css/dynamic-ui-root.min.css +2 -2
- package/dist/css/dynamic-ui.css +312 -126
- package/dist/css/dynamic-ui.min.css +2 -2
- package/dist/index.esm.js +191 -43
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +195 -43
- package/dist/index.js.map +1 -1
- package/dist/types/components/DAvatar/DAvatar.d.ts +5 -2
- package/dist/types/components/DDatePicker/DDatePicker.d.ts +7 -3
- package/dist/types/components/DInput/DInput.d.ts +2 -2
- package/dist/types/components/DInputCounter/DInputCounter.d.ts +2 -2
- package/dist/types/components/DInputCurrency/DInputCurrency.d.ts +1 -1
- package/dist/types/components/DInputCurrencyBase/DInputCurrencyBase.d.ts +1 -1
- package/dist/types/components/DInputMask/DInputMask.d.ts +1 -1
- package/dist/types/components/DInputPin/DInputPin.d.ts +3 -3
- package/dist/types/components/DInputSearch/DInputSearch.d.ts +1 -1
- package/dist/types/components/DInputSelect/DInputSelect.d.ts +3 -3
- package/dist/types/components/DList/DList.d.ts +3 -0
- package/dist/types/components/DList/components/DListItem.d.ts +3 -0
- package/dist/types/components/DListGroup/DListGroup.d.ts +14 -0
- package/dist/types/components/DListGroup/components/DListGroupItem.d.ts +13 -0
- package/dist/types/components/DListGroup/index.d.ts +3 -0
- package/dist/types/components/DModal/components/DModalFooter.d.ts +1 -1
- package/dist/types/components/DOffcanvas/components/DOffcanvasFooter.d.ts +3 -3
- package/dist/types/components/DPaginator/DPaginator.d.ts +25 -8
- package/dist/types/components/DPopover/DPopover.d.ts +3 -0
- package/dist/types/components/DQuickActionButton/DQuickActionButton.d.ts +3 -0
- package/dist/types/components/DQuickActionCheck/DQuickActionCheck.d.ts +3 -0
- package/dist/types/components/DQuickActionSwitch/DQuickActionSwitch.d.ts +3 -0
- package/dist/types/components/DSelect/DSelect.d.ts +3 -3
- package/dist/types/components/DTabs/DTabs.d.ts +1 -1
- package/dist/types/components/index.d.ts +5 -2
- package/dist/types/components/interface.d.ts +0 -4
- package/dist/types/contexts/index.d.ts +2 -1
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/useItemSelection.d.ts +16 -0
- package/dist/types/utils/changeQueryString.d.ts +4 -0
- package/dist/types/utils/getQueryString.d.ts +4 -0
- package/dist/types/utils/index.d.ts +3 -1
- package/package.json +17 -16
- package/src/style/abstracts/variables/_forms.scss +3 -2
- package/src/style/abstracts/variables/_list-group.scss +3 -3
- package/src/style/abstracts/variables/_navs.scss +14 -17
- package/src/style/abstracts/variables/_options.scss +1 -1
- package/src/style/base/_+import.scss +2 -1
- package/src/style/base/_alert.scss +20 -0
- package/src/style/base/_input-group.scss +4 -1
- package/src/style/base/_nav.scss +72 -0
- package/src/style/base/_pagination.scss +7 -5
- package/src/style/base/_placeholder.scss +3 -0
- package/src/style/components/_+import.scss +1 -1
- package/src/style/components/_d-avatar.scss +85 -0
- package/src/style/components/_d-input-pin.scss +11 -5
- package/src/style/components/_d-select.scss +15 -6
- package/src/style/root/_root.scss +7 -0
- package/src/style/base/_avatar.scss +0 -61
- package/src/style/components/_d-tabs.scss +0 -44
- /package/dist/types/utils/{format-currency.d.ts → formatCurrency.d.ts} +0 -0
package/dist/index.js
CHANGED
|
@@ -282,11 +282,27 @@ function DAlert({ theme = 'success', icon: iconProp, iconFamilyClass, iconFamily
|
|
|
282
282
|
return (jsxRuntime.jsxs("div", Object.assign({ className: classNames(generateClasses), style: style, role: "alert", id: id }, dataAttributes, { children: [icon && (jsxRuntime.jsx(DIcon, { className: "alert-icon", icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle })), jsxRuntime.jsx("div", { className: "alert-text", children: children }), showClose && (jsxRuntime.jsx("button", { type: "button", className: "d-close", "aria-label": "Close", onClick: onClose, children: jsxRuntime.jsx(DIcon, { icon: iconClose, familyClass: iconCloseFamilyClass, familyPrefix: iconCloseFamilyPrefix, materialStyle: iconCloseMaterialStyle }) }))] })));
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
-
function DAvatar({ id, size, image,
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
285
|
+
function DAvatar({ id, size, image, name: nameProp, useNameAsInitials = false, theme = 'secondary', variant, className, style, dataAttributes, }) {
|
|
286
|
+
const generateClasses = React.useMemo(() => {
|
|
287
|
+
const variantClass = variant
|
|
288
|
+
? `d-avatar-${variant}-${theme}`
|
|
289
|
+
: `d-avatar-${theme}`;
|
|
290
|
+
return {
|
|
291
|
+
'd-avatar': true,
|
|
292
|
+
[variantClass]: true,
|
|
293
|
+
[`d-avatar-${size}`]: !!size,
|
|
294
|
+
};
|
|
295
|
+
}, [variant, theme, size]);
|
|
296
|
+
const name = React.useMemo(() => {
|
|
297
|
+
if (!nameProp) {
|
|
298
|
+
return undefined;
|
|
299
|
+
}
|
|
300
|
+
if (useNameAsInitials) {
|
|
301
|
+
return nameProp;
|
|
302
|
+
}
|
|
303
|
+
return nameProp.split(/\s+/).map((word) => word.charAt(0)).join('').toUpperCase();
|
|
304
|
+
}, [nameProp, useNameAsInitials]);
|
|
305
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: classNames(generateClasses, className), style: style, id: id }, dataAttributes, { children: [image && jsxRuntime.jsx("img", { src: image, alt: nameProp, className: "d-avatar-img" }), (name && !image) && jsxRuntime.jsx("span", { className: "d-avatar-name", children: name })] })));
|
|
290
306
|
}
|
|
291
307
|
|
|
292
308
|
function DBadge({ text, soft = false, theme = 'primary', id, rounded, className, style, iconStart, iconEnd, iconMaterialStyle, iconFamilyClass, iconFamilyPrefix, dataAttributes, }) {
|
|
@@ -472,7 +488,7 @@ function useProvidedRefOrCreate(providedRef) {
|
|
|
472
488
|
}
|
|
473
489
|
|
|
474
490
|
function DInput(_a, ref) {
|
|
475
|
-
var { id: idProp, style, className, label = '', labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, labelIconMaterialStyle, disabled = false, loading = false, iconFamilyClass, iconFamilyPrefix, iconMaterialStyle, iconStart, iconStartDisabled, iconStartFamilyClass, iconStartFamilyPrefix, iconStartAriaLabel, iconStartTabIndex, iconStartMaterialStyle, iconEnd, iconEndDisabled, iconEndFamilyClass, iconEndFamilyPrefix, iconEndAriaLabel, iconEndTabIndex, iconEndMaterialStyle,
|
|
491
|
+
var { id: idProp, style, className, label = '', labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, labelIconMaterialStyle, 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", "labelIcon", "labelIconFamilyClass", "labelIconFamilyPrefix", "labelIconMaterialStyle", "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"]);
|
|
476
492
|
const inputRef = useProvidedRefOrCreate(ref);
|
|
477
493
|
const innerId = React.useId();
|
|
478
494
|
const id = React.useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
@@ -539,13 +555,10 @@ function DInput(_a, ref) {
|
|
|
539
555
|
}
|
|
540
556
|
return inputComponent;
|
|
541
557
|
}, [floatingLabel, inputComponent, labelComponent]);
|
|
542
|
-
const { iconMap: { input } } = useDContext();
|
|
543
|
-
const invalidIcon = React.useMemo(() => invalidIconProp || input.invalid, [input.invalid, invalidIconProp]);
|
|
544
|
-
const validIcon = React.useMemo(() => validIconProp || input.valid, [input.valid, validIconProp]);
|
|
545
558
|
return (jsxRuntime.jsxs("div", Object.assign({ className: className, style: style }, dataAttributes, { children: [label && !floatingLabel && labelComponent, jsxRuntime.jsxs("div", { className: classNames({
|
|
546
559
|
'input-group': true,
|
|
547
560
|
'has-validation': invalid || valid,
|
|
548
|
-
}), children: [!!inputStart && (jsxRuntime.jsx("div", { className: "input-group-text", id: `${id}InputStart`, children: inputStart })), iconStart && (jsxRuntime.jsx("button", { type: "button", className: "input-group-text", id: `${id}Start`, onClick: handleOnIconStartClick, disabled: disabled || loading || iconStartDisabled, "aria-label": iconStartAriaLabel, tabIndex: onIconStartClick ? iconStartTabIndex : -1, children: jsxRuntime.jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix, materialStyle: iconStartMaterialStyle }) })), dynamicComponent, (
|
|
561
|
+
}), children: [!!inputStart && (jsxRuntime.jsx("div", { className: "input-group-text", id: `${id}InputStart`, children: inputStart })), iconStart && (jsxRuntime.jsx("button", { type: "button", className: "input-group-text", id: `${id}Start`, onClick: handleOnIconStartClick, disabled: disabled || loading || iconStartDisabled, "aria-label": iconStartAriaLabel, tabIndex: onIconStartClick ? iconStartTabIndex : -1, children: jsxRuntime.jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix, materialStyle: iconStartMaterialStyle }) })), dynamicComponent, (iconEnd && !loading) && (jsxRuntime.jsx("button", { type: "button", className: "input-group-text", id: `${id}End`, onClick: handleOnIconEndClick, disabled: disabled || loading || iconEndDisabled, "aria-label": iconEndAriaLabel, tabIndex: onIconEndClick ? iconEndTabIndex : -1, children: jsxRuntime.jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix, materialStyle: iconEndMaterialStyle }) })), loading && (jsxRuntime.jsx("div", { className: "input-group-text", id: `${id}Loading`, children: jsxRuntime.jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsxRuntime.jsx("span", { className: "visually-hidden", children: "Loading..." }) }) })), !!inputEnd && (jsxRuntime.jsx("div", { className: "input-group-text", id: `${id}InputEnd`, children: inputEnd }))] }), hint && (jsxRuntime.jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] })));
|
|
549
562
|
}
|
|
550
563
|
const ForwardedDInput = React.forwardRef(DInput);
|
|
551
564
|
ForwardedDInput.displayName = 'DInput';
|
|
@@ -559,8 +572,8 @@ function DDatePickerTime(_a) {
|
|
|
559
572
|
}
|
|
560
573
|
|
|
561
574
|
function DDatePickerInput(_a, ref) {
|
|
562
|
-
var { value, onClick, id, iconEnd, className, style, inputLabel,
|
|
563
|
-
return (jsxRuntime.jsx(DInput$1, Object.assign({ ref: ref, onClick: onClick, readOnly: true, type: "text", id: id, value: value, onIconEndClick: onClick, iconEnd: iconEnd, className: className, style: style, label: inputLabel
|
|
575
|
+
var { value, onClick, id, iconEnd, className, style, inputLabel, readOnly: ignored } = _a, props = tslib.__rest(_a, ["value", "onClick", "id", "iconEnd", "className", "style", "inputLabel", "readOnly"]);
|
|
576
|
+
return (jsxRuntime.jsx(DInput$1, Object.assign({ ref: ref, onClick: onClick, readOnly: true, type: "text", id: id, value: value, onIconEndClick: onClick, iconEnd: iconEnd, className: className, style: style, label: inputLabel }, props)));
|
|
564
577
|
}
|
|
565
578
|
const ForwardedDDatePickerInput = React.forwardRef(DDatePickerInput);
|
|
566
579
|
ForwardedDDatePickerInput.displayName = 'DDatePickerInput';
|
|
@@ -676,16 +689,13 @@ function DSelectSingleValueEmojiText(_a) {
|
|
|
676
689
|
}
|
|
677
690
|
|
|
678
691
|
function DSelect(_a) {
|
|
679
|
-
var { id, className, style, label, labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, hint, iconFamilyClass, iconFamilyPrefix, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconStartAriaLabel, iconStartTabIndex, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, iconEndAriaLabel, iconEndTabIndex, invalid, valid,
|
|
692
|
+
var { id, className, style, label, labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, hint, iconFamilyClass, iconFamilyPrefix, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconStartAriaLabel, iconStartTabIndex, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, iconEndAriaLabel, iconEndTabIndex, invalid, valid, menuWithMaxContent = false, disabled, clearable, loading, rtl, searchable, multi, components, defaultValue, onIconStartClick, onIconEndClick, dataAttributes } = _a, props = tslib.__rest(_a, ["id", "className", "style", "label", "labelIcon", "labelIconFamilyClass", "labelIconFamilyPrefix", "hint", "iconFamilyClass", "iconFamilyPrefix", "iconStart", "iconStartFamilyClass", "iconStartFamilyPrefix", "iconStartAriaLabel", "iconStartTabIndex", "iconEnd", "iconEndFamilyClass", "iconEndFamilyPrefix", "iconEndAriaLabel", "iconEndTabIndex", "invalid", "valid", "menuWithMaxContent", "disabled", "clearable", "loading", "rtl", "searchable", "multi", "components", "defaultValue", "onIconStartClick", "onIconEndClick", "dataAttributes"]);
|
|
680
693
|
const handleOnIconStartClick = React.useCallback(() => {
|
|
681
694
|
onIconStartClick === null || onIconStartClick === void 0 ? void 0 : onIconStartClick(defaultValue);
|
|
682
695
|
}, [onIconStartClick, defaultValue]);
|
|
683
696
|
const handleOnIconEndClick = React.useCallback(() => {
|
|
684
697
|
onIconEndClick === null || onIconEndClick === void 0 ? void 0 : onIconEndClick(defaultValue);
|
|
685
698
|
}, [onIconEndClick, defaultValue]);
|
|
686
|
-
const { iconMap: { input } } = useDContext();
|
|
687
|
-
const invalidIcon = React.useMemo(() => invalidIconProp || input.invalid, [input.invalid, invalidIconProp]);
|
|
688
|
-
const validIcon = React.useMemo(() => validIconProp || input.valid, [input.valid, validIconProp]);
|
|
689
699
|
return (jsxRuntime.jsxs("div", Object.assign({ className: classNames('d-select', className, {
|
|
690
700
|
disabled: disabled || loading,
|
|
691
701
|
}), style: style }, dataAttributes, { children: [label && (jsxRuntime.jsxs("label", { htmlFor: id, children: [label, labelIcon && (jsxRuntime.jsx(DIcon, { icon: labelIcon, size: `var(--${PREFIX_BS}input-label-font-size)`, familyClass: labelIconFamilyClass, familyPrefix: labelIconFamilyPrefix }))] })), jsxRuntime.jsxs("div", { className: classNames({
|
|
@@ -699,7 +709,7 @@ function DSelect(_a) {
|
|
|
699
709
|
}, className: classNames('d-select-component', {
|
|
700
710
|
'is-invalid': invalid,
|
|
701
711
|
'is-valid': valid,
|
|
702
|
-
}), classNamePrefix: "d-select", isDisabled: disabled || loading, isClearable: clearable, isLoading: loading, isRtl: rtl, isSearchable: searchable, isMulti: multi, defaultValue: defaultValue, unstyled: true, components: Object.assign({ DropdownIndicator: DSelectDropdownIndicator, ClearIndicator: DSelectClearIndicator, MultiValueRemove: DSelectMultiValueRemove, LoadingIndicator: DSelectLoadingIndicator }, components) }, props)), (
|
|
712
|
+
}), classNamePrefix: "d-select", isDisabled: disabled || loading, isClearable: clearable, isLoading: loading, isRtl: rtl, isSearchable: searchable, isMulti: multi, defaultValue: defaultValue, unstyled: true, components: Object.assign({ DropdownIndicator: DSelectDropdownIndicator, ClearIndicator: DSelectClearIndicator, MultiValueRemove: DSelectMultiValueRemove, LoadingIndicator: DSelectLoadingIndicator }, components) }, props)), (iconEnd && !loading) && (jsxRuntime.jsx("button", { type: "button", className: "input-group-text", id: `${id}End`, onClick: handleOnIconEndClick, disabled: disabled || loading, "aria-label": iconEndAriaLabel, tabIndex: iconEndTabIndex, children: iconEnd && (jsxRuntime.jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix })) }))] }), hint && (jsxRuntime.jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] })));
|
|
703
713
|
}
|
|
704
714
|
var DSelect$1 = Object.assign(DSelect, {
|
|
705
715
|
OptionCheck: DSelectOptionCheck,
|
|
@@ -733,8 +743,11 @@ function DDatePickerHeader({ date, changeYear, changeMonth, decreaseMonth, incre
|
|
|
733
743
|
return (jsxRuntime.jsxs("div", { className: classNames('d-flex align-items-center d-datepicker-header', className), style: style, children: [jsxRuntime.jsx(DButton, { iconStart: iconPrevMonth, iconStartFamilyClass: iconFamilyClass, iconStartFamilyPrefix: iconFamilyPrefix, iconStartMaterialStyle: iconMaterialStyle, size: iconSize, variant: buttonVariant, theme: buttonTheme, onClick: decreaseMonth, disabled: prevMonthButtonDisabled, ariaLabel: prevMonthAriaLabel, className: "header-button" }), jsxRuntime.jsxs("div", { className: "d-flex justify-content-center flex-grow-1", children: [jsxRuntime.jsx(DSelect$1, { options: months, value: defaultMonth, defaultValue: defaultMonth, onChange: (month) => changeMonth((month === null || month === void 0 ? void 0 : month.value) || 0), searchable: false }), jsxRuntime.jsx(DSelect$1, { options: years, value: defaultYear, defaultValue: defaultYear, onChange: (year) => changeYear(Number(year === null || year === void 0 ? void 0 : year.value)), searchable: false })] }), jsxRuntime.jsx(DButton, { iconStart: iconNextMonth, iconStartFamilyClass: iconFamilyClass, iconStartFamilyPrefix: iconFamilyPrefix, iconStartMaterialStyle: iconMaterialStyle, size: iconSize, variant: buttonVariant, theme: buttonTheme, onClick: increaseMonth, disabled: nextMonthButtonDisabled, ariaLabel: nextMonthAriaLabel, className: "header-button" })] }));
|
|
734
744
|
}
|
|
735
745
|
|
|
746
|
+
/**
|
|
747
|
+
* @deprecated
|
|
748
|
+
*/
|
|
736
749
|
function DDatePicker(_a) {
|
|
737
|
-
var { date, selectsRange = false, inputLabel, inputHint, inputAriaLabel, inputActionAriaLabel = 'open calendar', inputId = 'input-calendar', timeId = 'input-time', timeLabel, iconInput: iconInputProp, iconHeaderPrevMonth: iconHeaderPrevMonthProp, iconHeaderNextMonth: iconHeaderNextMonthProp, iconMaterialStyle: iconMaterialStyleProp, iconFamilyClass, iconFamilyPrefix, minYearSelect = 1900, maxYearSelect = 2100, iconHeaderSize = 'sm', headerPrevMonthAriaLabel = 'decrease month', headerNextMonthAriaLabel = 'increase month', headerButtonVariant = 'link', headerButtonTheme = 'dark', invalid = false, valid = false, renderCustomHeader: renderCustomHeaderProp,
|
|
750
|
+
var { date, selectsRange = false, inputLabel, inputHint, inputAriaLabel, inputActionAriaLabel = 'open calendar', inputId = 'input-calendar', timeId = 'input-time', timeLabel, iconInput: iconInputProp, iconHeaderPrevMonth: iconHeaderPrevMonthProp, iconHeaderNextMonth: iconHeaderNextMonthProp, iconMaterialStyle: iconMaterialStyleProp, iconFamilyClass, iconFamilyPrefix, minYearSelect = 1900, maxYearSelect = 2100, iconHeaderSize = 'sm', headerPrevMonthAriaLabel = 'decrease month', headerNextMonthAriaLabel = 'increase month', headerButtonVariant = 'link', headerButtonTheme = 'dark', invalid = false, valid = false, renderCustomHeader: renderCustomHeaderProp, locale, className, formatWeekDay: formatWeekDayProp, style, dataAttributes, placeholder } = _a, props = tslib.__rest(_a, ["date", "selectsRange", "inputLabel", "inputHint", "inputAriaLabel", "inputActionAriaLabel", "inputId", "timeId", "timeLabel", "iconInput", "iconHeaderPrevMonth", "iconHeaderNextMonth", "iconMaterialStyle", "iconFamilyClass", "iconFamilyPrefix", "minYearSelect", "maxYearSelect", "iconHeaderSize", "headerPrevMonthAriaLabel", "headerNextMonthAriaLabel", "headerButtonVariant", "headerButtonTheme", "invalid", "valid", "renderCustomHeader", "locale", "className", "formatWeekDay", "style", "dataAttributes", "placeholder"]);
|
|
738
751
|
const { iconMap: { calendar, chevronLeft, chevronRight, }, } = useDContext();
|
|
739
752
|
const selected = React.useMemo(() => (date ? dateFns.parseISO(date) : null), [date]);
|
|
740
753
|
const iconInput = React.useMemo(() => iconInputProp || calendar, [calendar, iconInputProp]);
|
|
@@ -758,11 +771,7 @@ function DDatePicker(_a) {
|
|
|
758
771
|
]);
|
|
759
772
|
const defaultRenderCustomHeader = React.useCallback((headerProps) => (jsxRuntime.jsx(DatePickerHeader, Object.assign({}, headerProps))), [DatePickerHeader]);
|
|
760
773
|
const renderCustomHeader = React.useMemo(() => (renderCustomHeaderProp || defaultRenderCustomHeader), [defaultRenderCustomHeader, renderCustomHeaderProp]);
|
|
761
|
-
return (jsxRuntime.jsx(DatePicker, Object.assign({ selected: selected, calendarClassName: "d-date-picker", renderCustomHeader: renderCustomHeader, selectsRange: selectsRange, formatWeekDay: handleFormatWeekDay, customInput: (jsxRuntime.jsx(DDatePickerInput$1,
|
|
762
|
-
|| (valid && !validIcon)
|
|
763
|
-
|| (invalid && !invalidIcon)) && {
|
|
764
|
-
iconEnd: iconInput,
|
|
765
|
-
}, { inputLabel: inputLabel, className: className, style: style, invalid: invalid, valid: valid, validIcon: validIcon, invalidIcon: invalidIcon, hint: inputHint }))), customTimeInput: (jsxRuntime.jsx(DDatePickerTime, { id: timeId, label: timeLabel })) }, locale && { locale }, dataAttributes, props)));
|
|
774
|
+
return (jsxRuntime.jsx(DatePicker, Object.assign({ selected: selected, calendarClassName: "d-date-picker", renderCustomHeader: renderCustomHeader, selectsRange: selectsRange, formatWeekDay: handleFormatWeekDay, customInput: (jsxRuntime.jsx(DDatePickerInput$1, { id: inputId, "aria-label": inputAriaLabel, iconEndAriaLabel: inputActionAriaLabel, iconMaterialStyle: iconMaterialStyleProp, iconEnd: iconInput, inputLabel: inputLabel, className: className, style: style, invalid: invalid, valid: valid, hint: inputHint })), customTimeInput: (jsxRuntime.jsx(DDatePickerTime, { id: timeId, label: timeLabel })), placeholderText: placeholder }, locale && { locale }, dataAttributes, props)));
|
|
766
775
|
}
|
|
767
776
|
|
|
768
777
|
function DInputMask(props, ref) {
|
|
@@ -846,6 +855,37 @@ function useDisableInputWheel(ref) {
|
|
|
846
855
|
};
|
|
847
856
|
}
|
|
848
857
|
|
|
858
|
+
function useItemSelection({ getItemIdentifier: getItemIdentifierProp, previousSelected = [], } = {}) {
|
|
859
|
+
const getItemIdentifier = React.useCallback((item) => (String(getItemIdentifierProp ? getItemIdentifierProp(item) : item.id)), [getItemIdentifierProp]);
|
|
860
|
+
const [selectionMap, setSelectionMap] = React.useState(() => new Map(previousSelected.map((item) => [getItemIdentifier(item), item])));
|
|
861
|
+
const selectedItems = React.useMemo(() => Array.from(selectionMap.values()), [selectionMap]);
|
|
862
|
+
const setSelectedItems = React.useCallback((items) => {
|
|
863
|
+
setSelectionMap(new Map(items.map((item) => [getItemIdentifier(item), item])));
|
|
864
|
+
}, [getItemIdentifier]);
|
|
865
|
+
const isSelectedItem = React.useCallback((item) => selectionMap.has(getItemIdentifier(item)), [getItemIdentifier, selectionMap]);
|
|
866
|
+
const toggleSelectedItem = React.useCallback((item) => {
|
|
867
|
+
const identifier = getItemIdentifier(item);
|
|
868
|
+
setSelectionMap((prev) => {
|
|
869
|
+
const newMap = new Map(prev);
|
|
870
|
+
if (newMap.has(identifier)) {
|
|
871
|
+
newMap.delete(identifier);
|
|
872
|
+
}
|
|
873
|
+
else {
|
|
874
|
+
newMap.set(identifier, item);
|
|
875
|
+
}
|
|
876
|
+
return newMap;
|
|
877
|
+
});
|
|
878
|
+
}, [getItemIdentifier]);
|
|
879
|
+
const resetSelectedItems = React.useCallback(() => setSelectionMap(new Map()), []);
|
|
880
|
+
return {
|
|
881
|
+
selectedItems,
|
|
882
|
+
isSelectedItem,
|
|
883
|
+
toggleSelectedItem,
|
|
884
|
+
resetSelectedItems,
|
|
885
|
+
setSelectedItems,
|
|
886
|
+
};
|
|
887
|
+
}
|
|
888
|
+
|
|
849
889
|
function DInputCounter(_a, ref) {
|
|
850
890
|
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"]);
|
|
851
891
|
const { handleOnWheel, } = useDisableInputWheel(ref);
|
|
@@ -885,6 +925,9 @@ const ForwardedDInputCounter = React.forwardRef(DInputCounter);
|
|
|
885
925
|
ForwardedDInputCounter.displayName = 'DInputCounter';
|
|
886
926
|
var DInputCounter$1 = ForwardedDInputCounter;
|
|
887
927
|
|
|
928
|
+
/**
|
|
929
|
+
* @deprecated
|
|
930
|
+
*/
|
|
888
931
|
function DInputCurrencyBase(_a, ref) {
|
|
889
932
|
var { value, minValue, maxValue, currencyOptions, currencyCode, onFocus, onBlur, onChange } = _a, inputProps = tslib.__rest(_a, ["value", "minValue", "maxValue", "currencyOptions", "currencyCode", "onFocus", "onBlur", "onChange"]);
|
|
890
933
|
const { handleOnWheel, } = useDisableInputWheel(ref);
|
|
@@ -906,6 +949,9 @@ const ForwardedDInputCurrencyBase = React.forwardRef(DInputCurrency);
|
|
|
906
949
|
ForwardedDInputCurrencyBase.displayName = 'DInputCurrency';
|
|
907
950
|
var DInputCurrency$1 = ForwardedDInputCurrencyBase;
|
|
908
951
|
|
|
952
|
+
/**
|
|
953
|
+
* @deprecated
|
|
954
|
+
*/
|
|
909
955
|
function DInputSearch(_a, ref) {
|
|
910
956
|
var { type, iconEnd: iconEndProp, iconEndAriaLabel = 'search' } = _a, props = tslib.__rest(_a, ["type", "iconEnd", "iconEndAriaLabel"]);
|
|
911
957
|
const inputRef = useProvidedRefOrCreate(ref);
|
|
@@ -931,7 +977,7 @@ const ForwardedDInputPassword = React.forwardRef(DInputPassword);
|
|
|
931
977
|
ForwardedDInputPassword.displayName = 'DInputPassword';
|
|
932
978
|
var DInputPassword$1 = ForwardedDInputPassword;
|
|
933
979
|
|
|
934
|
-
function DInputPin({ id: idProp, label = '', labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, placeholder, type = 'text', disabled = false, loading = false, secret = false,
|
|
980
|
+
function DInputPin({ id: idProp, label = '', labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, placeholder, type = 'text', disabled = false, loading = false, secret = false, characters = 4, innerInputMode = 'text', hint, invalid = false, valid = false, className, style, dataAttributes, onChange, }) {
|
|
935
981
|
const innerId = React.useId();
|
|
936
982
|
const id = React.useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
937
983
|
const [pattern, setPattern] = React.useState('');
|
|
@@ -998,17 +1044,14 @@ function DInputPin({ id: idProp, label = '', labelIcon, labelIconFamilyClass, la
|
|
|
998
1044
|
const wheelInput = React.useCallback((event) => {
|
|
999
1045
|
event.currentTarget.blur();
|
|
1000
1046
|
}, []);
|
|
1001
|
-
const { iconMap: { input } } = useDContext();
|
|
1002
|
-
const invalidIcon = React.useMemo(() => invalidIconProp || input.invalid, [input.invalid, invalidIconProp]);
|
|
1003
|
-
const validIcon = React.useMemo(() => validIconProp || input.valid, [input.valid, validIconProp]);
|
|
1004
1047
|
return (jsxRuntime.jsxs("div", Object.assign({ className: classNames('d-input-pin', className), style: style }, dataAttributes, { children: [label && (jsxRuntime.jsxs("label", { htmlFor: "pinIndex0", children: [label, labelIcon && (jsxRuntime.jsx(DIcon, { icon: labelIcon, size: `var(--${PREFIX_BS}input-label-font-size)`, familyClass: labelIconFamilyClass, familyPrefix: labelIconFamilyPrefix }))] })), jsxRuntime.jsxs("div", { className: "d-input-pin-group", id: id, children: [Array.from({ length: characters }).map((_, index) => (jsxRuntime.jsx("input", Object.assign({ className: classNames({
|
|
1005
1048
|
'form-control': true,
|
|
1006
1049
|
'is-invalid': invalid,
|
|
1007
1050
|
'is-valid': valid,
|
|
1008
|
-
}), value: activeInput[index], type: secret ? 'password' : type, "aria-describedby": `${id}State`, inputMode: innerInputMode, id: `pinIndex${index}`, name: `pin-${index}`, maxLength: 1, onInput: (event) => nextInput(event, index), onKeyDown: (event) => prevInput(event, index), onFocus: () => focusInput(index), onWheel: wheelInput, onClick: (event) => event.preventDefault(), onPaste: (event) => handlePaste(event), autoComplete: "off", placeholder: placeholder, disabled: disabled || loading, required: true }, type === 'number' && ({ min: 0, max: 9 })), index))),
|
|
1051
|
+
}), value: activeInput[index], type: secret ? 'password' : type, "aria-describedby": `${id}State`, inputMode: innerInputMode, id: `pinIndex${index}`, name: `pin-${index}`, maxLength: 1, onInput: (event) => nextInput(event, index), onKeyDown: (event) => prevInput(event, index), onFocus: () => focusInput(index), onWheel: wheelInput, onClick: (event) => event.preventDefault(), onPaste: (event) => handlePaste(event), autoComplete: "off", placeholder: placeholder, disabled: disabled || loading, required: true }, type === 'number' && ({ min: 0, max: 9 })), index))), loading && (jsxRuntime.jsx("div", { className: "input-group-text", children: jsxRuntime.jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsxRuntime.jsx("span", { className: "visually-hidden", children: "Loading..." }) }) }))] }), hint && (jsxRuntime.jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] })));
|
|
1009
1052
|
}
|
|
1010
1053
|
|
|
1011
|
-
function DInputSelect({ id: idProp, name, label = '', className, style, options = [], labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, disabled = false, loading = false, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconStartAriaLabel, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, iconEndAriaLabel,
|
|
1054
|
+
function DInputSelect({ id: idProp, name, label = '', className, style, options = [], labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, disabled = false, loading = false, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconStartAriaLabel, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, iconEndAriaLabel, hint, value, size, floatingLabel = false, invalid = false, valid = false, dataAttributes, valueExtractor, labelExtractor, onChange, onBlur, onIconStartClick, onIconEndClick, }) {
|
|
1012
1055
|
const innerId = React.useId();
|
|
1013
1056
|
const id = React.useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
1014
1057
|
const internalValueExtractor = React.useCallback((option) => {
|
|
@@ -1045,9 +1088,6 @@ function DInputSelect({ id: idProp, name, label = '', className, style, options
|
|
|
1045
1088
|
const iconEndClickHandler = React.useCallback((event) => {
|
|
1046
1089
|
onIconEndClick === null || onIconEndClick === void 0 ? void 0 : onIconEndClick(event);
|
|
1047
1090
|
}, [onIconEndClick]);
|
|
1048
|
-
const { iconMap: { input } } = useDContext();
|
|
1049
|
-
const invalidIcon = React.useMemo(() => invalidIconProp || input.invalid, [input.invalid, invalidIconProp]);
|
|
1050
|
-
const validIcon = React.useMemo(() => validIconProp || input.valid, [input.valid, validIconProp]);
|
|
1051
1091
|
const ariaDescribedby = React.useMemo(() => ([
|
|
1052
1092
|
iconStart && `${id}Start`,
|
|
1053
1093
|
hint && `${id}Hint`,
|
|
@@ -1094,7 +1134,7 @@ function DInputSelect({ id: idProp, name, label = '', className, style, options
|
|
|
1094
1134
|
}, [floatingLabel, labelComponent, selectComponent]);
|
|
1095
1135
|
return (jsxRuntime.jsxs("div", Object.assign({ className: className, style: style }, dataAttributes, { children: [label && !floatingLabel && (labelComponent), jsxRuntime.jsxs("div", { className: classNames({
|
|
1096
1136
|
'input-group': true,
|
|
1097
|
-
}), children: [iconStart && (jsxRuntime.jsx("button", { type: "button", className: "input-group-text", id: `${id}Start`, onClick: iconStartClickHandler, disabled: disabled || loading, "aria-label": iconStartAriaLabel, children: iconStart && (jsxRuntime.jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix })) })), dynamicComponent,
|
|
1137
|
+
}), children: [iconStart && (jsxRuntime.jsx("button", { type: "button", className: "input-group-text", id: `${id}Start`, onClick: iconStartClickHandler, disabled: disabled || loading, "aria-label": iconStartAriaLabel, children: iconStart && (jsxRuntime.jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix })) })), dynamicComponent, iconEnd && !loading && (jsxRuntime.jsx("button", { type: "button", className: "input-group-text", id: `${id}End`, onClick: iconEndClickHandler, disabled: disabled || loading, "aria-label": iconEndAriaLabel, children: iconEnd && (jsxRuntime.jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix })) })), loading && (jsxRuntime.jsx("div", { className: "input-group-text form-control-icon loading", children: jsxRuntime.jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsxRuntime.jsx("span", { className: "visually-hidden", children: "Loading..." }) }) }))] }), hint && (jsxRuntime.jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] })));
|
|
1098
1138
|
}
|
|
1099
1139
|
|
|
1100
1140
|
function DInputSwitch({ id: idProp, label, ariaLabel, name, checked, disabled, invalid = false, valid = false, readonly, className, style, dataAttributes, onChange, }) {
|
|
@@ -1153,6 +1193,9 @@ const ForwardedDInputRange = React.forwardRef(DInputRange);
|
|
|
1153
1193
|
ForwardedDInputRange.displayName = 'DInputRange';
|
|
1154
1194
|
var DInputRange$1 = ForwardedDInputRange;
|
|
1155
1195
|
|
|
1196
|
+
/**
|
|
1197
|
+
* @deprecated Please use DListGroup.Item or DListGroupItem instead
|
|
1198
|
+
*/
|
|
1156
1199
|
function DListItem({ children, className, style, active = false, disabled = false, theme, onClick, }) {
|
|
1157
1200
|
const Tag = React.useMemo(() => (onClick ? 'button' : 'div'), [onClick]);
|
|
1158
1201
|
return (jsxRuntime.jsx(Tag, Object.assign({}, Tag === 'button' && {
|
|
@@ -1164,6 +1207,9 @@ function DListItem({ children, className, style, active = false, disabled = fals
|
|
|
1164
1207
|
}), style: style }, active && { 'aria-current': true }, { children: children })));
|
|
1165
1208
|
}
|
|
1166
1209
|
|
|
1210
|
+
/**
|
|
1211
|
+
* @deprecated Please use DListGroup instead
|
|
1212
|
+
*/
|
|
1167
1213
|
function DList({ children, className, style, flush = false, numbered = false, horizontal = false, horizontalBreakpoint, dataAttributes, }) {
|
|
1168
1214
|
if (flush && horizontal) {
|
|
1169
1215
|
throw new Error("Horizontal and Flush props don't work together");
|
|
@@ -1178,6 +1224,62 @@ var DList$1 = Object.assign(DList, {
|
|
|
1178
1224
|
Item: DListItem,
|
|
1179
1225
|
});
|
|
1180
1226
|
|
|
1227
|
+
function DListGroupItem({ as = 'li', action: actionProp, active, disabled, href, onClick, theme, children, className, style, dataAttributes, }) {
|
|
1228
|
+
const Tag = React.useMemo(() => {
|
|
1229
|
+
if (href) {
|
|
1230
|
+
return 'a';
|
|
1231
|
+
}
|
|
1232
|
+
if (actionProp) {
|
|
1233
|
+
return 'button';
|
|
1234
|
+
}
|
|
1235
|
+
return as;
|
|
1236
|
+
}, [href, as, actionProp]);
|
|
1237
|
+
const action = React.useMemo(() => {
|
|
1238
|
+
if (Tag === 'a' || Tag === 'button') {
|
|
1239
|
+
return true;
|
|
1240
|
+
}
|
|
1241
|
+
return actionProp;
|
|
1242
|
+
}, [Tag, actionProp]);
|
|
1243
|
+
const generateClasses = React.useMemo(() => ({
|
|
1244
|
+
'list-group-item': true,
|
|
1245
|
+
'list-group-item-action': action,
|
|
1246
|
+
[`list-group-item-${theme}`]: !!theme,
|
|
1247
|
+
active,
|
|
1248
|
+
disabled,
|
|
1249
|
+
}), [action, active, disabled, theme]);
|
|
1250
|
+
const ariaAttributes = React.useMemo(() => {
|
|
1251
|
+
if (Tag === 'button') {
|
|
1252
|
+
return Object.assign(Object.assign({}, active && { 'aria-current': true }), disabled && { disabled: true });
|
|
1253
|
+
}
|
|
1254
|
+
return Object.assign(Object.assign({}, active && { 'aria-current': true }), disabled && { 'aria-disabled': true });
|
|
1255
|
+
}, [Tag, active, disabled]);
|
|
1256
|
+
return (jsxRuntime.jsx(Tag, Object.assign({ className: classNames(generateClasses, className), style: style }, Tag === 'a' && href && { href }, onClick && { onClick }, ariaAttributes, dataAttributes, { children: children })));
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
function DListGroup({ as = 'ul', numbered, flush, horizontal, children, className, style, dataAttributes, }) {
|
|
1260
|
+
const Tag = React.useMemo(() => {
|
|
1261
|
+
if (numbered) {
|
|
1262
|
+
return 'ol';
|
|
1263
|
+
}
|
|
1264
|
+
return as;
|
|
1265
|
+
}, [numbered, as]);
|
|
1266
|
+
const generateClasses = React.useMemo(() => {
|
|
1267
|
+
const listGroupHorizontalClass = typeof horizontal === 'string'
|
|
1268
|
+
? `list-group-horizontal-${horizontal}`
|
|
1269
|
+
: 'list-group-horizontal';
|
|
1270
|
+
return {
|
|
1271
|
+
'list-group': true,
|
|
1272
|
+
'list-group-numbered': numbered,
|
|
1273
|
+
'list-group-flush': flush,
|
|
1274
|
+
[listGroupHorizontalClass]: !!horizontal,
|
|
1275
|
+
};
|
|
1276
|
+
}, [flush, horizontal, numbered]);
|
|
1277
|
+
return (jsxRuntime.jsx(Tag, Object.assign({ className: classNames(generateClasses, className), style: style }, dataAttributes, { children: children })));
|
|
1278
|
+
}
|
|
1279
|
+
var DListGroup$1 = Object.assign(DListGroup, {
|
|
1280
|
+
Item: DListGroupItem,
|
|
1281
|
+
});
|
|
1282
|
+
|
|
1181
1283
|
function DModalHeader({ showCloseButton, onClose, children, className, style, iconFamilyClass, iconFamilyPrefix, icon: iconProp, materialStyle = false, }) {
|
|
1182
1284
|
const { iconMap: { xLg, }, } = useDContext();
|
|
1183
1285
|
const icon = React.useMemo(() => iconProp || xLg, [iconProp, xLg]);
|
|
@@ -1188,8 +1290,12 @@ function DModalBody({ children, className, style, }) {
|
|
|
1188
1290
|
return (jsxRuntime.jsx("div", { className: classNames('modal-body', className), style: style, children: children }));
|
|
1189
1291
|
}
|
|
1190
1292
|
|
|
1191
|
-
function DModalFooter({ className, style, actionPlacement
|
|
1192
|
-
|
|
1293
|
+
function DModalFooter({ className, style, actionPlacement, children, }) {
|
|
1294
|
+
const generateClasses = React.useMemo(() => ({
|
|
1295
|
+
'modal-footer': true,
|
|
1296
|
+
[`d-modal-action-${actionPlacement}`]: !!actionPlacement,
|
|
1297
|
+
}), [actionPlacement]);
|
|
1298
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "d-modal-separator" }), jsxRuntime.jsx("div", { className: classNames(generateClasses, className), style: style, children: children })] }));
|
|
1193
1299
|
}
|
|
1194
1300
|
|
|
1195
1301
|
function DModal({ name, className, style, staticBackdrop, scrollable, centered, fullScreen, fullScreenFrom, size, children, dataAttributes, }) {
|
|
@@ -1202,9 +1308,8 @@ function DModal({ name, className, style, staticBackdrop, scrollable, centered,
|
|
|
1202
1308
|
}
|
|
1203
1309
|
return '';
|
|
1204
1310
|
}, [fullScreenFrom, fullScreen]);
|
|
1205
|
-
const generateClasses = React.useMemo(() => (Object.assign({ 'modal portal fade show': true }, className && { [className]: true })), [className]);
|
|
1206
1311
|
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]);
|
|
1207
|
-
return (jsxRuntime.jsx("div", Object.assign({ className: classNames(
|
|
1312
|
+
return (jsxRuntime.jsx("div", Object.assign({ className: classNames('modal portal fade show', className), id: name, tabIndex: -1, "aria-labelledby": `${name}Label`, "aria-hidden": "false", style: style }, staticBackdrop && ({
|
|
1208
1313
|
[`data-${PREFIX_BS}backdrop`]: 'static',
|
|
1209
1314
|
[`data-${PREFIX_BS}keyboard`]: 'false',
|
|
1210
1315
|
}), dataAttributes, { children: jsxRuntime.jsx("div", { className: classNames(generateModalDialogClasses), children: jsxRuntime.jsx("div", { className: "modal-content", children: children }) }) })));
|
|
@@ -1225,8 +1330,12 @@ function DOffcanvasBody({ children, className, style, }) {
|
|
|
1225
1330
|
return (jsxRuntime.jsx("div", { className: classNames('offcanvas-body', className), style: style, children: children }));
|
|
1226
1331
|
}
|
|
1227
1332
|
|
|
1228
|
-
function DOffcanvasFooter({
|
|
1229
|
-
|
|
1333
|
+
function DOffcanvasFooter({ actionPlacement, children, className, style, }) {
|
|
1334
|
+
const generateClasses = React.useMemo(() => ({
|
|
1335
|
+
'd-offcanvas-footer': true,
|
|
1336
|
+
[`d-offcanvas-action-${actionPlacement}`]: !!actionPlacement,
|
|
1337
|
+
}), [actionPlacement]);
|
|
1338
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "d-offcanvas-separator" }), jsxRuntime.jsx("div", { className: classNames(generateClasses, className), style: style, children: children })] }));
|
|
1230
1339
|
}
|
|
1231
1340
|
|
|
1232
1341
|
function DOffcanvas({ name, className, style, staticBackdrop, scrollable, openFrom = 'end', children, dataAttributes, }) {
|
|
@@ -1247,10 +1356,16 @@ var DOffcanvas$1 = Object.assign(DOffcanvas, {
|
|
|
1247
1356
|
});
|
|
1248
1357
|
|
|
1249
1358
|
function DPaginator(_a) {
|
|
1250
|
-
var { className,
|
|
1251
|
-
|
|
1359
|
+
var { className, page, current, showArrows, navClassName } = _a, props = tslib.__rest(_a, ["className", "page", "current", "showArrows", "navClassName"]);
|
|
1360
|
+
const backwardCompatibilityProps = React.useMemo(() => (Object.assign(Object.assign(Object.assign(Object.assign({}, props), { current: Number(page !== undefined ? page : current) }), showArrows !== undefined && { renderNav: showArrows }), props.extraClassName === undefined && className !== undefined && {
|
|
1361
|
+
extraClassName: className,
|
|
1362
|
+
})), [props, page, current, showArrows, className]);
|
|
1363
|
+
return (jsxRuntime.jsx(ResponsivePagination, Object.assign({ navClassName: classNames('page-item-arrow', navClassName) }, backwardCompatibilityProps)));
|
|
1252
1364
|
}
|
|
1253
1365
|
|
|
1366
|
+
/**
|
|
1367
|
+
* @deprecated
|
|
1368
|
+
*/
|
|
1254
1369
|
function DPopover({ children, renderComponent, open, setOpen, adjustContentToRender = false, className, style, dataAttributes, }) {
|
|
1255
1370
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
1256
1371
|
React.useEffect(() => {
|
|
@@ -1299,6 +1414,9 @@ function DProgress({ className, style, currentValue, minValue = 0, maxValue = 10
|
|
|
1299
1414
|
return (jsxRuntime.jsx("div", Object.assign({ className: classNames('progress', className) }, dataAttributes, { children: jsxRuntime.jsx("div", { className: classNames(generateClasses), role: "progressbar", "aria-label": "Progress bar", style: Object.assign({ width: formatProgress }, style), "aria-valuenow": currentValue, "aria-valuemin": minValue, "aria-valuemax": maxValue, children: !hideCurrentValue && formatProgress }) })));
|
|
1300
1415
|
}
|
|
1301
1416
|
|
|
1417
|
+
/**
|
|
1418
|
+
* @deprecated
|
|
1419
|
+
*/
|
|
1302
1420
|
function DQuickActionButton({ line1, line2, className, actionLinkText, actionLinkTheme = 'secondary', actionIcon, secondaryActionIcon, secondaryActionAriaLabel, actionIconFamilyClass, actionIconFamilyPrefix, representativeImage, representativeIcon, representativeIconTheme = 'secondary', representativeIconHasCircle = false, representativeIconFamilyClass, representativeIconFamilyPrefix, onClick, onClickSecondary, style, dataAttributes, }) {
|
|
1303
1421
|
const globalClickHandler = React.useCallback(() => {
|
|
1304
1422
|
if (actionLinkText) {
|
|
@@ -1321,6 +1439,9 @@ function DQuickActionButton({ line1, line2, className, actionLinkText, actionLin
|
|
|
1321
1439
|
: `var(--${PREFIX_BS}quick-action-button-representative-image-size)`, icon: representativeIcon, hasCircle: representativeIconHasCircle, theme: representativeIconTheme, familyClass: representativeIconFamilyClass, familyPrefix: representativeIconFamilyPrefix })), representativeImage && (jsxRuntime.jsx("img", { className: "d-quick-action-button-representative-image", src: representativeImage, alt: "" })), jsxRuntime.jsx("div", { className: "d-quick-action-button-content", children: jsxRuntime.jsxs("div", { className: "d-quick-action-button-text", children: [jsxRuntime.jsx("span", { className: "d-quick-action-button-line1", children: line1 }), jsxRuntime.jsx("small", { className: "d-quick-action-button-line2", children: line2 })] }) }), secondaryActionIcon && (jsxRuntime.jsx(DButton, { className: "d-quick-action-button-secondary-action-link", type: "button", variant: "link", iconStart: secondaryActionIcon, ariaLabel: secondaryActionAriaLabel, iconStartFamilyClass: actionIconFamilyClass, iconStartFamilyPrefix: actionIconFamilyPrefix, theme: actionLinkTheme, onClick: secondaryActionLinkClickHandler, stopPropagationEnabled: true })), actionLinkText && !actionIcon && (jsxRuntime.jsx(DButton, { className: "d-quick-action-button-action-link", type: "button", variant: "link", theme: actionLinkTheme, text: actionLinkText, onClick: actionLinkClickHandler, stopPropagationEnabled: true })), actionIcon && !actionLinkText && (jsxRuntime.jsx(DIcon, { className: "d-quick-action-button-action-icon", icon: actionIcon, size: `var(--${PREFIX_BS}quick-action-button-action-icon-size)`, familyClass: actionIconFamilyClass, familyPrefix: actionIconFamilyPrefix }))] })));
|
|
1322
1440
|
}
|
|
1323
1441
|
|
|
1442
|
+
/**
|
|
1443
|
+
* @deprecated
|
|
1444
|
+
*/
|
|
1324
1445
|
function DQuickActionCheck({ id: idProp, name, value, line1, line2, line3, className, style, checked, dataAttributes, onChange, }) {
|
|
1325
1446
|
const innerId = React.useId();
|
|
1326
1447
|
const id = React.useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
@@ -1347,6 +1468,9 @@ function DQuickActionSelect({ id: idProp, name, value, line1, line2, className,
|
|
|
1347
1468
|
return (jsxRuntime.jsxs("label", Object.assign({ className: classNames('d-quick-action-select', className), htmlFor: id, style: style }, dataAttributes, { children: [jsxRuntime.jsx("input", { ref: innerRef, id: id, type: "radio", name: name, value: value, onChange: changeHandler }), jsxRuntime.jsx("span", { className: "d-quick-action-select-line1", children: line1 }), jsxRuntime.jsx("span", { className: "d-quick-action-select-line2", children: line2 })] })));
|
|
1348
1469
|
}
|
|
1349
1470
|
|
|
1471
|
+
/**
|
|
1472
|
+
* @deprecated
|
|
1473
|
+
*/
|
|
1350
1474
|
function DQuickActionSwitch({ id: idProp, name, label, hint, checked, disabled, className, style, dataAttributes, onClick, }) {
|
|
1351
1475
|
const innerId = React.useId();
|
|
1352
1476
|
const id = React.useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
@@ -1492,7 +1616,7 @@ function DTabs({ children, defaultSelected, onChange, options, className, classN
|
|
|
1492
1616
|
if (option.tab) {
|
|
1493
1617
|
setSelected(option.tab);
|
|
1494
1618
|
}
|
|
1495
|
-
onChange(option);
|
|
1619
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(option);
|
|
1496
1620
|
}, [onChange]);
|
|
1497
1621
|
React.useEffect(() => {
|
|
1498
1622
|
setSelected(defaultSelected);
|
|
@@ -1588,6 +1712,30 @@ async function configureI8n(resources, _a = {}) {
|
|
|
1588
1712
|
.then((t) => t);
|
|
1589
1713
|
}
|
|
1590
1714
|
|
|
1715
|
+
function getQueryString(value, config = {
|
|
1716
|
+
useSearch: true,
|
|
1717
|
+
}) {
|
|
1718
|
+
const urlParams = new URLSearchParams(config.useSearch ? window.location.search : '');
|
|
1719
|
+
return urlParams.get(value) || config.default;
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
function changeQueryString(values, { useSearch = true, pushState = false, } = {}) {
|
|
1723
|
+
const searchParams = new URLSearchParams(useSearch ? window.location.search : '');
|
|
1724
|
+
Object.entries(values).forEach(([key, value]) => {
|
|
1725
|
+
if (!value) {
|
|
1726
|
+
searchParams.delete(key);
|
|
1727
|
+
return;
|
|
1728
|
+
}
|
|
1729
|
+
searchParams.set(key, String(value));
|
|
1730
|
+
});
|
|
1731
|
+
if (pushState) {
|
|
1732
|
+
const url = new URL(window.location.href);
|
|
1733
|
+
url.search = searchParams.toString();
|
|
1734
|
+
window.history.pushState(null, '', url.toString());
|
|
1735
|
+
}
|
|
1736
|
+
return searchParams.toString();
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1591
1739
|
exports.DAlert = DAlert;
|
|
1592
1740
|
exports.DAvatar = DAvatar;
|
|
1593
1741
|
exports.DBadge = DBadge;
|
|
@@ -1621,6 +1769,8 @@ exports.DInputSearch = DInputSearch$1;
|
|
|
1621
1769
|
exports.DInputSelect = DInputSelect;
|
|
1622
1770
|
exports.DInputSwitch = DInputSwitch;
|
|
1623
1771
|
exports.DList = DList$1;
|
|
1772
|
+
exports.DListGroup = DListGroup$1;
|
|
1773
|
+
exports.DListGroupItem = DListGroupItem;
|
|
1624
1774
|
exports.DListItem = DListItem;
|
|
1625
1775
|
exports.DModal = DModal$1;
|
|
1626
1776
|
exports.DModalBody = DModalBody;
|
|
@@ -1642,14 +1792,15 @@ exports.DSkeleton = DSkeleton;
|
|
|
1642
1792
|
exports.DStepper = DStepper;
|
|
1643
1793
|
exports.DStepperDesktop = DStepper$2;
|
|
1644
1794
|
exports.DStepperMobile = DStepper$1;
|
|
1645
|
-
exports.DTabContent = DTabContent;
|
|
1646
1795
|
exports.DTableHead = DTableHead;
|
|
1647
1796
|
exports.DTabs = DTabs$1;
|
|
1648
1797
|
exports.DToast = DToast$1;
|
|
1649
1798
|
exports.DToastContainer = DToastContainer;
|
|
1650
1799
|
exports.DTooltip = DTooltip;
|
|
1800
|
+
exports.changeQueryString = changeQueryString;
|
|
1651
1801
|
exports.configureI18n = configureI8n;
|
|
1652
1802
|
exports.formatCurrency = formatCurrency;
|
|
1803
|
+
exports.getQueryString = getQueryString;
|
|
1653
1804
|
exports.useDContext = useDContext;
|
|
1654
1805
|
exports.useDPortalContext = useDPortalContext;
|
|
1655
1806
|
exports.useDToast = useDToast;
|
|
@@ -1657,6 +1808,7 @@ exports.useDisableBodyScrollEffect = useDisableBodyScrollEffect;
|
|
|
1657
1808
|
exports.useDisableInputWheel = useDisableInputWheel;
|
|
1658
1809
|
exports.useFormatCurrency = useFormatCurrency;
|
|
1659
1810
|
exports.useInputCurrency = useInputCurrency;
|
|
1811
|
+
exports.useItemSelection = useItemSelection;
|
|
1660
1812
|
exports.usePortal = usePortal;
|
|
1661
1813
|
exports.useProvidedRefOrCreate = useProvidedRefOrCreate;
|
|
1662
1814
|
exports.useStackState = useStackState;
|