@dynamic-framework/ui-react 1.31.0 → 1.32.1
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 +311 -126
- package/dist/css/dynamic-ui-non-root.min.css +2 -2
- package/dist/css/dynamic-ui-root.css +18 -15
- package/dist/css/dynamic-ui-root.min.css +2 -2
- package/dist/css/dynamic-ui.css +328 -140
- package/dist/css/dynamic-ui.min.css +2 -2
- package/dist/index.esm.js +203 -62
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +207 -62
- 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/_colors.scss +14 -14
- 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 +12 -5
- package/src/style/components/_d-select.scss +15 -6
- package/src/style/root/_root.scss +9 -2
- 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) {
|
|
@@ -801,27 +810,20 @@ function useInputCurrency(currencyOptions, value, onFocus, onChange, onBlur, ref
|
|
|
801
810
|
color: `var(--${PREFIX_BS}input-currency-symbol-color)`,
|
|
802
811
|
}), []);
|
|
803
812
|
const handleOnChange = React.useCallback((newValue) => {
|
|
804
|
-
const newNumber = (newValue === undefined || newValue === '')
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(innerNumber);
|
|
812
|
-
}, [onChange, innerNumber]);
|
|
813
|
+
const newNumber = (newValue === undefined || newValue === '') ? undefined : Number(newValue);
|
|
814
|
+
if (newNumber !== innerNumber) {
|
|
815
|
+
setInnerNumber(newNumber);
|
|
816
|
+
setInnerString(formatValue(newNumber, currencyOptions));
|
|
817
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newNumber);
|
|
818
|
+
}
|
|
819
|
+
}, [currencyOptions, onChange, innerNumber]);
|
|
813
820
|
React.useEffect(() => {
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
if (value === undefined || value.toString() === '') {
|
|
818
|
-
return '';
|
|
821
|
+
if (value !== innerNumber) {
|
|
822
|
+
setInnerNumber(value);
|
|
823
|
+
setInnerString(formatValue(value, currencyOptions));
|
|
819
824
|
}
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
: innerString;
|
|
823
|
-
return valueToUse !== null && valueToUse !== void 0 ? valueToUse : '';
|
|
824
|
-
}, [value, innerType, innerNumber, innerString]);
|
|
825
|
+
}, [value, currencyOptions, innerNumber]);
|
|
826
|
+
const innerValue = React.useMemo(() => { var _a; return (innerType === 'number' ? (_a = innerNumber === null || innerNumber === void 0 ? void 0 : innerNumber.toString()) !== null && _a !== void 0 ? _a : '' : innerString !== null && innerString !== void 0 ? innerString : ''); }, [innerType, innerNumber, innerString]);
|
|
825
827
|
return {
|
|
826
828
|
inputRef,
|
|
827
829
|
innerValue,
|
|
@@ -846,6 +848,37 @@ function useDisableInputWheel(ref) {
|
|
|
846
848
|
};
|
|
847
849
|
}
|
|
848
850
|
|
|
851
|
+
function useItemSelection({ getItemIdentifier: getItemIdentifierProp, previousSelected = [], } = {}) {
|
|
852
|
+
const getItemIdentifier = React.useCallback((item) => (String(getItemIdentifierProp ? getItemIdentifierProp(item) : item.id)), [getItemIdentifierProp]);
|
|
853
|
+
const [selectionMap, setSelectionMap] = React.useState(() => new Map(previousSelected.map((item) => [getItemIdentifier(item), item])));
|
|
854
|
+
const selectedItems = React.useMemo(() => Array.from(selectionMap.values()), [selectionMap]);
|
|
855
|
+
const setSelectedItems = React.useCallback((items) => {
|
|
856
|
+
setSelectionMap(new Map(items.map((item) => [getItemIdentifier(item), item])));
|
|
857
|
+
}, [getItemIdentifier]);
|
|
858
|
+
const isSelectedItem = React.useCallback((item) => selectionMap.has(getItemIdentifier(item)), [getItemIdentifier, selectionMap]);
|
|
859
|
+
const toggleSelectedItem = React.useCallback((item) => {
|
|
860
|
+
const identifier = getItemIdentifier(item);
|
|
861
|
+
setSelectionMap((prev) => {
|
|
862
|
+
const newMap = new Map(prev);
|
|
863
|
+
if (newMap.has(identifier)) {
|
|
864
|
+
newMap.delete(identifier);
|
|
865
|
+
}
|
|
866
|
+
else {
|
|
867
|
+
newMap.set(identifier, item);
|
|
868
|
+
}
|
|
869
|
+
return newMap;
|
|
870
|
+
});
|
|
871
|
+
}, [getItemIdentifier]);
|
|
872
|
+
const resetSelectedItems = React.useCallback(() => setSelectionMap(new Map()), []);
|
|
873
|
+
return {
|
|
874
|
+
selectedItems,
|
|
875
|
+
isSelectedItem,
|
|
876
|
+
toggleSelectedItem,
|
|
877
|
+
resetSelectedItems,
|
|
878
|
+
setSelectedItems,
|
|
879
|
+
};
|
|
880
|
+
}
|
|
881
|
+
|
|
849
882
|
function DInputCounter(_a, ref) {
|
|
850
883
|
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
884
|
const { handleOnWheel, } = useDisableInputWheel(ref);
|
|
@@ -885,6 +918,9 @@ const ForwardedDInputCounter = React.forwardRef(DInputCounter);
|
|
|
885
918
|
ForwardedDInputCounter.displayName = 'DInputCounter';
|
|
886
919
|
var DInputCounter$1 = ForwardedDInputCounter;
|
|
887
920
|
|
|
921
|
+
/**
|
|
922
|
+
* @deprecated
|
|
923
|
+
*/
|
|
888
924
|
function DInputCurrencyBase(_a, ref) {
|
|
889
925
|
var { value, minValue, maxValue, currencyOptions, currencyCode, onFocus, onBlur, onChange } = _a, inputProps = tslib.__rest(_a, ["value", "minValue", "maxValue", "currencyOptions", "currencyCode", "onFocus", "onBlur", "onChange"]);
|
|
890
926
|
const { handleOnWheel, } = useDisableInputWheel(ref);
|
|
@@ -906,6 +942,9 @@ const ForwardedDInputCurrencyBase = React.forwardRef(DInputCurrency);
|
|
|
906
942
|
ForwardedDInputCurrencyBase.displayName = 'DInputCurrency';
|
|
907
943
|
var DInputCurrency$1 = ForwardedDInputCurrencyBase;
|
|
908
944
|
|
|
945
|
+
/**
|
|
946
|
+
* @deprecated
|
|
947
|
+
*/
|
|
909
948
|
function DInputSearch(_a, ref) {
|
|
910
949
|
var { type, iconEnd: iconEndProp, iconEndAriaLabel = 'search' } = _a, props = tslib.__rest(_a, ["type", "iconEnd", "iconEndAriaLabel"]);
|
|
911
950
|
const inputRef = useProvidedRefOrCreate(ref);
|
|
@@ -931,7 +970,7 @@ const ForwardedDInputPassword = React.forwardRef(DInputPassword);
|
|
|
931
970
|
ForwardedDInputPassword.displayName = 'DInputPassword';
|
|
932
971
|
var DInputPassword$1 = ForwardedDInputPassword;
|
|
933
972
|
|
|
934
|
-
function DInputPin({ id: idProp, label = '', labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, placeholder, type = 'text', disabled = false, loading = false, secret = false,
|
|
973
|
+
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
974
|
const innerId = React.useId();
|
|
936
975
|
const id = React.useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
937
976
|
const [pattern, setPattern] = React.useState('');
|
|
@@ -998,17 +1037,14 @@ function DInputPin({ id: idProp, label = '', labelIcon, labelIconFamilyClass, la
|
|
|
998
1037
|
const wheelInput = React.useCallback((event) => {
|
|
999
1038
|
event.currentTarget.blur();
|
|
1000
1039
|
}, []);
|
|
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
1040
|
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
1041
|
'form-control': true,
|
|
1006
1042
|
'is-invalid': invalid,
|
|
1007
1043
|
'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))),
|
|
1044
|
+
}), 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
1045
|
}
|
|
1010
1046
|
|
|
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,
|
|
1047
|
+
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
1048
|
const innerId = React.useId();
|
|
1013
1049
|
const id = React.useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
1014
1050
|
const internalValueExtractor = React.useCallback((option) => {
|
|
@@ -1045,9 +1081,6 @@ function DInputSelect({ id: idProp, name, label = '', className, style, options
|
|
|
1045
1081
|
const iconEndClickHandler = React.useCallback((event) => {
|
|
1046
1082
|
onIconEndClick === null || onIconEndClick === void 0 ? void 0 : onIconEndClick(event);
|
|
1047
1083
|
}, [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
1084
|
const ariaDescribedby = React.useMemo(() => ([
|
|
1052
1085
|
iconStart && `${id}Start`,
|
|
1053
1086
|
hint && `${id}Hint`,
|
|
@@ -1094,7 +1127,7 @@ function DInputSelect({ id: idProp, name, label = '', className, style, options
|
|
|
1094
1127
|
}, [floatingLabel, labelComponent, selectComponent]);
|
|
1095
1128
|
return (jsxRuntime.jsxs("div", Object.assign({ className: className, style: style }, dataAttributes, { children: [label && !floatingLabel && (labelComponent), jsxRuntime.jsxs("div", { className: classNames({
|
|
1096
1129
|
'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,
|
|
1130
|
+
}), 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
1131
|
}
|
|
1099
1132
|
|
|
1100
1133
|
function DInputSwitch({ id: idProp, label, ariaLabel, name, checked, disabled, invalid = false, valid = false, readonly, className, style, dataAttributes, onChange, }) {
|
|
@@ -1153,6 +1186,9 @@ const ForwardedDInputRange = React.forwardRef(DInputRange);
|
|
|
1153
1186
|
ForwardedDInputRange.displayName = 'DInputRange';
|
|
1154
1187
|
var DInputRange$1 = ForwardedDInputRange;
|
|
1155
1188
|
|
|
1189
|
+
/**
|
|
1190
|
+
* @deprecated Please use DListGroup.Item or DListGroupItem instead
|
|
1191
|
+
*/
|
|
1156
1192
|
function DListItem({ children, className, style, active = false, disabled = false, theme, onClick, }) {
|
|
1157
1193
|
const Tag = React.useMemo(() => (onClick ? 'button' : 'div'), [onClick]);
|
|
1158
1194
|
return (jsxRuntime.jsx(Tag, Object.assign({}, Tag === 'button' && {
|
|
@@ -1164,6 +1200,9 @@ function DListItem({ children, className, style, active = false, disabled = fals
|
|
|
1164
1200
|
}), style: style }, active && { 'aria-current': true }, { children: children })));
|
|
1165
1201
|
}
|
|
1166
1202
|
|
|
1203
|
+
/**
|
|
1204
|
+
* @deprecated Please use DListGroup instead
|
|
1205
|
+
*/
|
|
1167
1206
|
function DList({ children, className, style, flush = false, numbered = false, horizontal = false, horizontalBreakpoint, dataAttributes, }) {
|
|
1168
1207
|
if (flush && horizontal) {
|
|
1169
1208
|
throw new Error("Horizontal and Flush props don't work together");
|
|
@@ -1178,6 +1217,62 @@ var DList$1 = Object.assign(DList, {
|
|
|
1178
1217
|
Item: DListItem,
|
|
1179
1218
|
});
|
|
1180
1219
|
|
|
1220
|
+
function DListGroupItem({ as = 'li', action: actionProp, active, disabled, href, onClick, theme, children, className, style, dataAttributes, }) {
|
|
1221
|
+
const Tag = React.useMemo(() => {
|
|
1222
|
+
if (href) {
|
|
1223
|
+
return 'a';
|
|
1224
|
+
}
|
|
1225
|
+
if (actionProp) {
|
|
1226
|
+
return 'button';
|
|
1227
|
+
}
|
|
1228
|
+
return as;
|
|
1229
|
+
}, [href, as, actionProp]);
|
|
1230
|
+
const action = React.useMemo(() => {
|
|
1231
|
+
if (Tag === 'a' || Tag === 'button') {
|
|
1232
|
+
return true;
|
|
1233
|
+
}
|
|
1234
|
+
return actionProp;
|
|
1235
|
+
}, [Tag, actionProp]);
|
|
1236
|
+
const generateClasses = React.useMemo(() => ({
|
|
1237
|
+
'list-group-item': true,
|
|
1238
|
+
'list-group-item-action': action,
|
|
1239
|
+
[`list-group-item-${theme}`]: !!theme,
|
|
1240
|
+
active,
|
|
1241
|
+
disabled,
|
|
1242
|
+
}), [action, active, disabled, theme]);
|
|
1243
|
+
const ariaAttributes = React.useMemo(() => {
|
|
1244
|
+
if (Tag === 'button') {
|
|
1245
|
+
return Object.assign(Object.assign({}, active && { 'aria-current': true }), disabled && { disabled: true });
|
|
1246
|
+
}
|
|
1247
|
+
return Object.assign(Object.assign({}, active && { 'aria-current': true }), disabled && { 'aria-disabled': true });
|
|
1248
|
+
}, [Tag, active, disabled]);
|
|
1249
|
+
return (jsxRuntime.jsx(Tag, Object.assign({ className: classNames(generateClasses, className), style: style }, Tag === 'a' && href && { href }, onClick && { onClick }, ariaAttributes, dataAttributes, { children: children })));
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
function DListGroup({ as = 'ul', numbered, flush, horizontal, children, className, style, dataAttributes, }) {
|
|
1253
|
+
const Tag = React.useMemo(() => {
|
|
1254
|
+
if (numbered) {
|
|
1255
|
+
return 'ol';
|
|
1256
|
+
}
|
|
1257
|
+
return as;
|
|
1258
|
+
}, [numbered, as]);
|
|
1259
|
+
const generateClasses = React.useMemo(() => {
|
|
1260
|
+
const listGroupHorizontalClass = typeof horizontal === 'string'
|
|
1261
|
+
? `list-group-horizontal-${horizontal}`
|
|
1262
|
+
: 'list-group-horizontal';
|
|
1263
|
+
return {
|
|
1264
|
+
'list-group': true,
|
|
1265
|
+
'list-group-numbered': numbered,
|
|
1266
|
+
'list-group-flush': flush,
|
|
1267
|
+
[listGroupHorizontalClass]: !!horizontal,
|
|
1268
|
+
};
|
|
1269
|
+
}, [flush, horizontal, numbered]);
|
|
1270
|
+
return (jsxRuntime.jsx(Tag, Object.assign({ className: classNames(generateClasses, className), style: style }, dataAttributes, { children: children })));
|
|
1271
|
+
}
|
|
1272
|
+
var DListGroup$1 = Object.assign(DListGroup, {
|
|
1273
|
+
Item: DListGroupItem,
|
|
1274
|
+
});
|
|
1275
|
+
|
|
1181
1276
|
function DModalHeader({ showCloseButton, onClose, children, className, style, iconFamilyClass, iconFamilyPrefix, icon: iconProp, materialStyle = false, }) {
|
|
1182
1277
|
const { iconMap: { xLg, }, } = useDContext();
|
|
1183
1278
|
const icon = React.useMemo(() => iconProp || xLg, [iconProp, xLg]);
|
|
@@ -1188,8 +1283,12 @@ function DModalBody({ children, className, style, }) {
|
|
|
1188
1283
|
return (jsxRuntime.jsx("div", { className: classNames('modal-body', className), style: style, children: children }));
|
|
1189
1284
|
}
|
|
1190
1285
|
|
|
1191
|
-
function DModalFooter({ className, style, actionPlacement
|
|
1192
|
-
|
|
1286
|
+
function DModalFooter({ className, style, actionPlacement, children, }) {
|
|
1287
|
+
const generateClasses = React.useMemo(() => ({
|
|
1288
|
+
'modal-footer': true,
|
|
1289
|
+
[`d-modal-action-${actionPlacement}`]: !!actionPlacement,
|
|
1290
|
+
}), [actionPlacement]);
|
|
1291
|
+
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
1292
|
}
|
|
1194
1293
|
|
|
1195
1294
|
function DModal({ name, className, style, staticBackdrop, scrollable, centered, fullScreen, fullScreenFrom, size, children, dataAttributes, }) {
|
|
@@ -1202,9 +1301,8 @@ function DModal({ name, className, style, staticBackdrop, scrollable, centered,
|
|
|
1202
1301
|
}
|
|
1203
1302
|
return '';
|
|
1204
1303
|
}, [fullScreenFrom, fullScreen]);
|
|
1205
|
-
const generateClasses = React.useMemo(() => (Object.assign({ 'modal portal fade show': true }, className && { [className]: true })), [className]);
|
|
1206
1304
|
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(
|
|
1305
|
+
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
1306
|
[`data-${PREFIX_BS}backdrop`]: 'static',
|
|
1209
1307
|
[`data-${PREFIX_BS}keyboard`]: 'false',
|
|
1210
1308
|
}), dataAttributes, { children: jsxRuntime.jsx("div", { className: classNames(generateModalDialogClasses), children: jsxRuntime.jsx("div", { className: "modal-content", children: children }) }) })));
|
|
@@ -1225,8 +1323,12 @@ function DOffcanvasBody({ children, className, style, }) {
|
|
|
1225
1323
|
return (jsxRuntime.jsx("div", { className: classNames('offcanvas-body', className), style: style, children: children }));
|
|
1226
1324
|
}
|
|
1227
1325
|
|
|
1228
|
-
function DOffcanvasFooter({
|
|
1229
|
-
|
|
1326
|
+
function DOffcanvasFooter({ actionPlacement, children, className, style, }) {
|
|
1327
|
+
const generateClasses = React.useMemo(() => ({
|
|
1328
|
+
'd-offcanvas-footer': true,
|
|
1329
|
+
[`d-offcanvas-action-${actionPlacement}`]: !!actionPlacement,
|
|
1330
|
+
}), [actionPlacement]);
|
|
1331
|
+
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
1332
|
}
|
|
1231
1333
|
|
|
1232
1334
|
function DOffcanvas({ name, className, style, staticBackdrop, scrollable, openFrom = 'end', children, dataAttributes, }) {
|
|
@@ -1247,10 +1349,16 @@ var DOffcanvas$1 = Object.assign(DOffcanvas, {
|
|
|
1247
1349
|
});
|
|
1248
1350
|
|
|
1249
1351
|
function DPaginator(_a) {
|
|
1250
|
-
var { className,
|
|
1251
|
-
|
|
1352
|
+
var { className, page, current, showArrows, navClassName } = _a, props = tslib.__rest(_a, ["className", "page", "current", "showArrows", "navClassName"]);
|
|
1353
|
+
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 && {
|
|
1354
|
+
extraClassName: className,
|
|
1355
|
+
})), [props, page, current, showArrows, className]);
|
|
1356
|
+
return (jsxRuntime.jsx(ResponsivePagination, Object.assign({ navClassName: classNames('page-item-arrow', navClassName) }, backwardCompatibilityProps)));
|
|
1252
1357
|
}
|
|
1253
1358
|
|
|
1359
|
+
/**
|
|
1360
|
+
* @deprecated
|
|
1361
|
+
*/
|
|
1254
1362
|
function DPopover({ children, renderComponent, open, setOpen, adjustContentToRender = false, className, style, dataAttributes, }) {
|
|
1255
1363
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
1256
1364
|
React.useEffect(() => {
|
|
@@ -1299,6 +1407,9 @@ function DProgress({ className, style, currentValue, minValue = 0, maxValue = 10
|
|
|
1299
1407
|
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
1408
|
}
|
|
1301
1409
|
|
|
1410
|
+
/**
|
|
1411
|
+
* @deprecated
|
|
1412
|
+
*/
|
|
1302
1413
|
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
1414
|
const globalClickHandler = React.useCallback(() => {
|
|
1304
1415
|
if (actionLinkText) {
|
|
@@ -1321,6 +1432,9 @@ function DQuickActionButton({ line1, line2, className, actionLinkText, actionLin
|
|
|
1321
1432
|
: `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
1433
|
}
|
|
1323
1434
|
|
|
1435
|
+
/**
|
|
1436
|
+
* @deprecated
|
|
1437
|
+
*/
|
|
1324
1438
|
function DQuickActionCheck({ id: idProp, name, value, line1, line2, line3, className, style, checked, dataAttributes, onChange, }) {
|
|
1325
1439
|
const innerId = React.useId();
|
|
1326
1440
|
const id = React.useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
@@ -1347,6 +1461,9 @@ function DQuickActionSelect({ id: idProp, name, value, line1, line2, className,
|
|
|
1347
1461
|
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
1462
|
}
|
|
1349
1463
|
|
|
1464
|
+
/**
|
|
1465
|
+
* @deprecated
|
|
1466
|
+
*/
|
|
1350
1467
|
function DQuickActionSwitch({ id: idProp, name, label, hint, checked, disabled, className, style, dataAttributes, onClick, }) {
|
|
1351
1468
|
const innerId = React.useId();
|
|
1352
1469
|
const id = React.useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
@@ -1492,7 +1609,7 @@ function DTabs({ children, defaultSelected, onChange, options, className, classN
|
|
|
1492
1609
|
if (option.tab) {
|
|
1493
1610
|
setSelected(option.tab);
|
|
1494
1611
|
}
|
|
1495
|
-
onChange(option);
|
|
1612
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(option);
|
|
1496
1613
|
}, [onChange]);
|
|
1497
1614
|
React.useEffect(() => {
|
|
1498
1615
|
setSelected(defaultSelected);
|
|
@@ -1588,6 +1705,30 @@ async function configureI8n(resources, _a = {}) {
|
|
|
1588
1705
|
.then((t) => t);
|
|
1589
1706
|
}
|
|
1590
1707
|
|
|
1708
|
+
function getQueryString(value, config = {
|
|
1709
|
+
useSearch: true,
|
|
1710
|
+
}) {
|
|
1711
|
+
const urlParams = new URLSearchParams(config.useSearch ? window.location.search : '');
|
|
1712
|
+
return urlParams.get(value) || config.default;
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
function changeQueryString(values, { useSearch = true, pushState = false, } = {}) {
|
|
1716
|
+
const searchParams = new URLSearchParams(useSearch ? window.location.search : '');
|
|
1717
|
+
Object.entries(values).forEach(([key, value]) => {
|
|
1718
|
+
if (!value) {
|
|
1719
|
+
searchParams.delete(key);
|
|
1720
|
+
return;
|
|
1721
|
+
}
|
|
1722
|
+
searchParams.set(key, String(value));
|
|
1723
|
+
});
|
|
1724
|
+
if (pushState) {
|
|
1725
|
+
const url = new URL(window.location.href);
|
|
1726
|
+
url.search = searchParams.toString();
|
|
1727
|
+
window.history.pushState(null, '', url.toString());
|
|
1728
|
+
}
|
|
1729
|
+
return searchParams.toString();
|
|
1730
|
+
}
|
|
1731
|
+
|
|
1591
1732
|
exports.DAlert = DAlert;
|
|
1592
1733
|
exports.DAvatar = DAvatar;
|
|
1593
1734
|
exports.DBadge = DBadge;
|
|
@@ -1621,6 +1762,8 @@ exports.DInputSearch = DInputSearch$1;
|
|
|
1621
1762
|
exports.DInputSelect = DInputSelect;
|
|
1622
1763
|
exports.DInputSwitch = DInputSwitch;
|
|
1623
1764
|
exports.DList = DList$1;
|
|
1765
|
+
exports.DListGroup = DListGroup$1;
|
|
1766
|
+
exports.DListGroupItem = DListGroupItem;
|
|
1624
1767
|
exports.DListItem = DListItem;
|
|
1625
1768
|
exports.DModal = DModal$1;
|
|
1626
1769
|
exports.DModalBody = DModalBody;
|
|
@@ -1642,14 +1785,15 @@ exports.DSkeleton = DSkeleton;
|
|
|
1642
1785
|
exports.DStepper = DStepper;
|
|
1643
1786
|
exports.DStepperDesktop = DStepper$2;
|
|
1644
1787
|
exports.DStepperMobile = DStepper$1;
|
|
1645
|
-
exports.DTabContent = DTabContent;
|
|
1646
1788
|
exports.DTableHead = DTableHead;
|
|
1647
1789
|
exports.DTabs = DTabs$1;
|
|
1648
1790
|
exports.DToast = DToast$1;
|
|
1649
1791
|
exports.DToastContainer = DToastContainer;
|
|
1650
1792
|
exports.DTooltip = DTooltip;
|
|
1793
|
+
exports.changeQueryString = changeQueryString;
|
|
1651
1794
|
exports.configureI18n = configureI8n;
|
|
1652
1795
|
exports.formatCurrency = formatCurrency;
|
|
1796
|
+
exports.getQueryString = getQueryString;
|
|
1653
1797
|
exports.useDContext = useDContext;
|
|
1654
1798
|
exports.useDPortalContext = useDPortalContext;
|
|
1655
1799
|
exports.useDToast = useDToast;
|
|
@@ -1657,6 +1801,7 @@ exports.useDisableBodyScrollEffect = useDisableBodyScrollEffect;
|
|
|
1657
1801
|
exports.useDisableInputWheel = useDisableInputWheel;
|
|
1658
1802
|
exports.useFormatCurrency = useFormatCurrency;
|
|
1659
1803
|
exports.useInputCurrency = useInputCurrency;
|
|
1804
|
+
exports.useItemSelection = useItemSelection;
|
|
1660
1805
|
exports.usePortal = usePortal;
|
|
1661
1806
|
exports.useProvidedRefOrCreate = useProvidedRefOrCreate;
|
|
1662
1807
|
exports.useStackState = useStackState;
|