@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.esm.js
CHANGED
|
@@ -280,11 +280,27 @@ function DAlert({ theme = 'success', icon: iconProp, iconFamilyClass, iconFamily
|
|
|
280
280
|
return (jsxs("div", Object.assign({ className: classNames(generateClasses), style: style, role: "alert", id: id }, dataAttributes, { children: [icon && (jsx(DIcon, { className: "alert-icon", icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle })), jsx("div", { className: "alert-text", children: children }), showClose && (jsx("button", { type: "button", className: "d-close", "aria-label": "Close", onClick: onClose, children: jsx(DIcon, { icon: iconClose, familyClass: iconCloseFamilyClass, familyPrefix: iconCloseFamilyPrefix, materialStyle: iconCloseMaterialStyle }) }))] })));
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
-
function DAvatar({ id, size, image,
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
283
|
+
function DAvatar({ id, size, image, name: nameProp, useNameAsInitials = false, theme = 'secondary', variant, className, style, dataAttributes, }) {
|
|
284
|
+
const generateClasses = useMemo(() => {
|
|
285
|
+
const variantClass = variant
|
|
286
|
+
? `d-avatar-${variant}-${theme}`
|
|
287
|
+
: `d-avatar-${theme}`;
|
|
288
|
+
return {
|
|
289
|
+
'd-avatar': true,
|
|
290
|
+
[variantClass]: true,
|
|
291
|
+
[`d-avatar-${size}`]: !!size,
|
|
292
|
+
};
|
|
293
|
+
}, [variant, theme, size]);
|
|
294
|
+
const name = useMemo(() => {
|
|
295
|
+
if (!nameProp) {
|
|
296
|
+
return undefined;
|
|
297
|
+
}
|
|
298
|
+
if (useNameAsInitials) {
|
|
299
|
+
return nameProp;
|
|
300
|
+
}
|
|
301
|
+
return nameProp.split(/\s+/).map((word) => word.charAt(0)).join('').toUpperCase();
|
|
302
|
+
}, [nameProp, useNameAsInitials]);
|
|
303
|
+
return (jsxs("div", Object.assign({ className: classNames(generateClasses, className), style: style, id: id }, dataAttributes, { children: [image && jsx("img", { src: image, alt: nameProp, className: "d-avatar-img" }), (name && !image) && jsx("span", { className: "d-avatar-name", children: name })] })));
|
|
288
304
|
}
|
|
289
305
|
|
|
290
306
|
function DBadge({ text, soft = false, theme = 'primary', id, rounded, className, style, iconStart, iconEnd, iconMaterialStyle, iconFamilyClass, iconFamilyPrefix, dataAttributes, }) {
|
|
@@ -470,7 +486,7 @@ function useProvidedRefOrCreate(providedRef) {
|
|
|
470
486
|
}
|
|
471
487
|
|
|
472
488
|
function DInput(_a, ref) {
|
|
473
|
-
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,
|
|
489
|
+
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 = __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"]);
|
|
474
490
|
const inputRef = useProvidedRefOrCreate(ref);
|
|
475
491
|
const innerId = useId();
|
|
476
492
|
const id = useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
@@ -537,13 +553,10 @@ function DInput(_a, ref) {
|
|
|
537
553
|
}
|
|
538
554
|
return inputComponent;
|
|
539
555
|
}, [floatingLabel, inputComponent, labelComponent]);
|
|
540
|
-
const { iconMap: { input } } = useDContext();
|
|
541
|
-
const invalidIcon = useMemo(() => invalidIconProp || input.invalid, [input.invalid, invalidIconProp]);
|
|
542
|
-
const validIcon = useMemo(() => validIconProp || input.valid, [input.valid, validIconProp]);
|
|
543
556
|
return (jsxs("div", Object.assign({ className: className, style: style }, dataAttributes, { children: [label && !floatingLabel && labelComponent, jsxs("div", { className: classNames({
|
|
544
557
|
'input-group': true,
|
|
545
558
|
'has-validation': invalid || valid,
|
|
546
|
-
}), children: [!!inputStart && (jsx("div", { className: "input-group-text", id: `${id}InputStart`, children: inputStart })), iconStart && (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: jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix, materialStyle: iconStartMaterialStyle }) })), dynamicComponent, (
|
|
559
|
+
}), children: [!!inputStart && (jsx("div", { className: "input-group-text", id: `${id}InputStart`, children: inputStart })), iconStart && (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: jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix, materialStyle: iconStartMaterialStyle }) })), dynamicComponent, (iconEnd && !loading) && (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: jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix, materialStyle: iconEndMaterialStyle }) })), loading && (jsx("div", { className: "input-group-text", id: `${id}Loading`, children: jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsx("span", { className: "visually-hidden", children: "Loading..." }) }) })), !!inputEnd && (jsx("div", { className: "input-group-text", id: `${id}InputEnd`, children: inputEnd }))] }), hint && (jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] })));
|
|
547
560
|
}
|
|
548
561
|
const ForwardedDInput = forwardRef(DInput);
|
|
549
562
|
ForwardedDInput.displayName = 'DInput';
|
|
@@ -557,8 +570,8 @@ function DDatePickerTime(_a) {
|
|
|
557
570
|
}
|
|
558
571
|
|
|
559
572
|
function DDatePickerInput(_a, ref) {
|
|
560
|
-
var { value, onClick, id, iconEnd, className, style, inputLabel,
|
|
561
|
-
return (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
|
|
573
|
+
var { value, onClick, id, iconEnd, className, style, inputLabel, readOnly: ignored } = _a, props = __rest(_a, ["value", "onClick", "id", "iconEnd", "className", "style", "inputLabel", "readOnly"]);
|
|
574
|
+
return (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)));
|
|
562
575
|
}
|
|
563
576
|
const ForwardedDDatePickerInput = forwardRef(DDatePickerInput);
|
|
564
577
|
ForwardedDDatePickerInput.displayName = 'DDatePickerInput';
|
|
@@ -674,16 +687,13 @@ function DSelectSingleValueEmojiText(_a) {
|
|
|
674
687
|
}
|
|
675
688
|
|
|
676
689
|
function DSelect(_a) {
|
|
677
|
-
var { id, className, style, label, labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, hint, iconFamilyClass, iconFamilyPrefix, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconStartAriaLabel, iconStartTabIndex, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, iconEndAriaLabel, iconEndTabIndex, invalid, valid,
|
|
690
|
+
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 = __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"]);
|
|
678
691
|
const handleOnIconStartClick = useCallback(() => {
|
|
679
692
|
onIconStartClick === null || onIconStartClick === void 0 ? void 0 : onIconStartClick(defaultValue);
|
|
680
693
|
}, [onIconStartClick, defaultValue]);
|
|
681
694
|
const handleOnIconEndClick = useCallback(() => {
|
|
682
695
|
onIconEndClick === null || onIconEndClick === void 0 ? void 0 : onIconEndClick(defaultValue);
|
|
683
696
|
}, [onIconEndClick, defaultValue]);
|
|
684
|
-
const { iconMap: { input } } = useDContext();
|
|
685
|
-
const invalidIcon = useMemo(() => invalidIconProp || input.invalid, [input.invalid, invalidIconProp]);
|
|
686
|
-
const validIcon = useMemo(() => validIconProp || input.valid, [input.valid, validIconProp]);
|
|
687
697
|
return (jsxs("div", Object.assign({ className: classNames('d-select', className, {
|
|
688
698
|
disabled: disabled || loading,
|
|
689
699
|
}), style: style }, dataAttributes, { children: [label && (jsxs("label", { htmlFor: id, children: [label, labelIcon && (jsx(DIcon, { icon: labelIcon, size: `var(--${PREFIX_BS}input-label-font-size)`, familyClass: labelIconFamilyClass, familyPrefix: labelIconFamilyPrefix }))] })), jsxs("div", { className: classNames({
|
|
@@ -697,7 +707,7 @@ function DSelect(_a) {
|
|
|
697
707
|
}, className: classNames('d-select-component', {
|
|
698
708
|
'is-invalid': invalid,
|
|
699
709
|
'is-valid': valid,
|
|
700
|
-
}), 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)), (
|
|
710
|
+
}), 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) && (jsx("button", { type: "button", className: "input-group-text", id: `${id}End`, onClick: handleOnIconEndClick, disabled: disabled || loading, "aria-label": iconEndAriaLabel, tabIndex: iconEndTabIndex, children: iconEnd && (jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix })) }))] }), hint && (jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] })));
|
|
701
711
|
}
|
|
702
712
|
var DSelect$1 = Object.assign(DSelect, {
|
|
703
713
|
OptionCheck: DSelectOptionCheck,
|
|
@@ -731,8 +741,11 @@ function DDatePickerHeader({ date, changeYear, changeMonth, decreaseMonth, incre
|
|
|
731
741
|
return (jsxs("div", { className: classNames('d-flex align-items-center d-datepicker-header', className), style: style, children: [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" }), jsxs("div", { className: "d-flex justify-content-center flex-grow-1", children: [jsx(DSelect$1, { options: months, value: defaultMonth, defaultValue: defaultMonth, onChange: (month) => changeMonth((month === null || month === void 0 ? void 0 : month.value) || 0), searchable: false }), jsx(DSelect$1, { options: years, value: defaultYear, defaultValue: defaultYear, onChange: (year) => changeYear(Number(year === null || year === void 0 ? void 0 : year.value)), searchable: false })] }), jsx(DButton, { iconStart: iconNextMonth, iconStartFamilyClass: iconFamilyClass, iconStartFamilyPrefix: iconFamilyPrefix, iconStartMaterialStyle: iconMaterialStyle, size: iconSize, variant: buttonVariant, theme: buttonTheme, onClick: increaseMonth, disabled: nextMonthButtonDisabled, ariaLabel: nextMonthAriaLabel, className: "header-button" })] }));
|
|
732
742
|
}
|
|
733
743
|
|
|
744
|
+
/**
|
|
745
|
+
* @deprecated
|
|
746
|
+
*/
|
|
734
747
|
function DDatePicker(_a) {
|
|
735
|
-
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,
|
|
748
|
+
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 = __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"]);
|
|
736
749
|
const { iconMap: { calendar, chevronLeft, chevronRight, }, } = useDContext();
|
|
737
750
|
const selected = useMemo(() => (date ? parseISO(date) : null), [date]);
|
|
738
751
|
const iconInput = useMemo(() => iconInputProp || calendar, [calendar, iconInputProp]);
|
|
@@ -756,11 +769,7 @@ function DDatePicker(_a) {
|
|
|
756
769
|
]);
|
|
757
770
|
const defaultRenderCustomHeader = useCallback((headerProps) => (jsx(DatePickerHeader, Object.assign({}, headerProps))), [DatePickerHeader]);
|
|
758
771
|
const renderCustomHeader = useMemo(() => (renderCustomHeaderProp || defaultRenderCustomHeader), [defaultRenderCustomHeader, renderCustomHeaderProp]);
|
|
759
|
-
return (jsx(DatePicker, Object.assign({ selected: selected, calendarClassName: "d-date-picker", renderCustomHeader: renderCustomHeader, selectsRange: selectsRange, formatWeekDay: handleFormatWeekDay, customInput: (jsx(DDatePickerInput$1,
|
|
760
|
-
|| (valid && !validIcon)
|
|
761
|
-
|| (invalid && !invalidIcon)) && {
|
|
762
|
-
iconEnd: iconInput,
|
|
763
|
-
}, { inputLabel: inputLabel, className: className, style: style, invalid: invalid, valid: valid, validIcon: validIcon, invalidIcon: invalidIcon, hint: inputHint }))), customTimeInput: (jsx(DDatePickerTime, { id: timeId, label: timeLabel })) }, locale && { locale }, dataAttributes, props)));
|
|
772
|
+
return (jsx(DatePicker, Object.assign({ selected: selected, calendarClassName: "d-date-picker", renderCustomHeader: renderCustomHeader, selectsRange: selectsRange, formatWeekDay: handleFormatWeekDay, customInput: (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: (jsx(DDatePickerTime, { id: timeId, label: timeLabel })), placeholderText: placeholder }, locale && { locale }, dataAttributes, props)));
|
|
764
773
|
}
|
|
765
774
|
|
|
766
775
|
function DInputMask(props, ref) {
|
|
@@ -799,27 +808,20 @@ function useInputCurrency(currencyOptions, value, onFocus, onChange, onBlur, ref
|
|
|
799
808
|
color: `var(--${PREFIX_BS}input-currency-symbol-color)`,
|
|
800
809
|
}), []);
|
|
801
810
|
const handleOnChange = useCallback((newValue) => {
|
|
802
|
-
const newNumber = (newValue === undefined || newValue === '')
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(innerNumber);
|
|
810
|
-
}, [onChange, innerNumber]);
|
|
811
|
+
const newNumber = (newValue === undefined || newValue === '') ? undefined : Number(newValue);
|
|
812
|
+
if (newNumber !== innerNumber) {
|
|
813
|
+
setInnerNumber(newNumber);
|
|
814
|
+
setInnerString(formatValue(newNumber, currencyOptions));
|
|
815
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newNumber);
|
|
816
|
+
}
|
|
817
|
+
}, [currencyOptions, onChange, innerNumber]);
|
|
811
818
|
useEffect(() => {
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
if (value === undefined || value.toString() === '') {
|
|
816
|
-
return '';
|
|
819
|
+
if (value !== innerNumber) {
|
|
820
|
+
setInnerNumber(value);
|
|
821
|
+
setInnerString(formatValue(value, currencyOptions));
|
|
817
822
|
}
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
: innerString;
|
|
821
|
-
return valueToUse !== null && valueToUse !== void 0 ? valueToUse : '';
|
|
822
|
-
}, [value, innerType, innerNumber, innerString]);
|
|
823
|
+
}, [value, currencyOptions, innerNumber]);
|
|
824
|
+
const innerValue = 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]);
|
|
823
825
|
return {
|
|
824
826
|
inputRef,
|
|
825
827
|
innerValue,
|
|
@@ -844,6 +846,37 @@ function useDisableInputWheel(ref) {
|
|
|
844
846
|
};
|
|
845
847
|
}
|
|
846
848
|
|
|
849
|
+
function useItemSelection({ getItemIdentifier: getItemIdentifierProp, previousSelected = [], } = {}) {
|
|
850
|
+
const getItemIdentifier = useCallback((item) => (String(getItemIdentifierProp ? getItemIdentifierProp(item) : item.id)), [getItemIdentifierProp]);
|
|
851
|
+
const [selectionMap, setSelectionMap] = useState(() => new Map(previousSelected.map((item) => [getItemIdentifier(item), item])));
|
|
852
|
+
const selectedItems = useMemo(() => Array.from(selectionMap.values()), [selectionMap]);
|
|
853
|
+
const setSelectedItems = useCallback((items) => {
|
|
854
|
+
setSelectionMap(new Map(items.map((item) => [getItemIdentifier(item), item])));
|
|
855
|
+
}, [getItemIdentifier]);
|
|
856
|
+
const isSelectedItem = useCallback((item) => selectionMap.has(getItemIdentifier(item)), [getItemIdentifier, selectionMap]);
|
|
857
|
+
const toggleSelectedItem = useCallback((item) => {
|
|
858
|
+
const identifier = getItemIdentifier(item);
|
|
859
|
+
setSelectionMap((prev) => {
|
|
860
|
+
const newMap = new Map(prev);
|
|
861
|
+
if (newMap.has(identifier)) {
|
|
862
|
+
newMap.delete(identifier);
|
|
863
|
+
}
|
|
864
|
+
else {
|
|
865
|
+
newMap.set(identifier, item);
|
|
866
|
+
}
|
|
867
|
+
return newMap;
|
|
868
|
+
});
|
|
869
|
+
}, [getItemIdentifier]);
|
|
870
|
+
const resetSelectedItems = useCallback(() => setSelectionMap(new Map()), []);
|
|
871
|
+
return {
|
|
872
|
+
selectedItems,
|
|
873
|
+
isSelectedItem,
|
|
874
|
+
toggleSelectedItem,
|
|
875
|
+
resetSelectedItems,
|
|
876
|
+
setSelectedItems,
|
|
877
|
+
};
|
|
878
|
+
}
|
|
879
|
+
|
|
847
880
|
function DInputCounter(_a, ref) {
|
|
848
881
|
var { minValue, maxValue, value = minValue, invalid, iconStart: iconStartProp, iconEnd: iconEndProp, iconStartAriaLabel = 'decrease action', iconEndAriaLabel = 'increase action', style, onChange } = _a, props = __rest(_a, ["minValue", "maxValue", "value", "invalid", "iconStart", "iconEnd", "iconStartAriaLabel", "iconEndAriaLabel", "style", "onChange"]);
|
|
849
882
|
const { handleOnWheel, } = useDisableInputWheel(ref);
|
|
@@ -883,6 +916,9 @@ const ForwardedDInputCounter = forwardRef(DInputCounter);
|
|
|
883
916
|
ForwardedDInputCounter.displayName = 'DInputCounter';
|
|
884
917
|
var DInputCounter$1 = ForwardedDInputCounter;
|
|
885
918
|
|
|
919
|
+
/**
|
|
920
|
+
* @deprecated
|
|
921
|
+
*/
|
|
886
922
|
function DInputCurrencyBase(_a, ref) {
|
|
887
923
|
var { value, minValue, maxValue, currencyOptions, currencyCode, onFocus, onBlur, onChange } = _a, inputProps = __rest(_a, ["value", "minValue", "maxValue", "currencyOptions", "currencyCode", "onFocus", "onBlur", "onChange"]);
|
|
888
924
|
const { handleOnWheel, } = useDisableInputWheel(ref);
|
|
@@ -904,6 +940,9 @@ const ForwardedDInputCurrencyBase = forwardRef(DInputCurrency);
|
|
|
904
940
|
ForwardedDInputCurrencyBase.displayName = 'DInputCurrency';
|
|
905
941
|
var DInputCurrency$1 = ForwardedDInputCurrencyBase;
|
|
906
942
|
|
|
943
|
+
/**
|
|
944
|
+
* @deprecated
|
|
945
|
+
*/
|
|
907
946
|
function DInputSearch(_a, ref) {
|
|
908
947
|
var { type, iconEnd: iconEndProp, iconEndAriaLabel = 'search' } = _a, props = __rest(_a, ["type", "iconEnd", "iconEndAriaLabel"]);
|
|
909
948
|
const inputRef = useProvidedRefOrCreate(ref);
|
|
@@ -929,7 +968,7 @@ const ForwardedDInputPassword = forwardRef(DInputPassword);
|
|
|
929
968
|
ForwardedDInputPassword.displayName = 'DInputPassword';
|
|
930
969
|
var DInputPassword$1 = ForwardedDInputPassword;
|
|
931
970
|
|
|
932
|
-
function DInputPin({ id: idProp, label = '', labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, placeholder, type = 'text', disabled = false, loading = false, secret = false,
|
|
971
|
+
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, }) {
|
|
933
972
|
const innerId = useId();
|
|
934
973
|
const id = useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
935
974
|
const [pattern, setPattern] = useState('');
|
|
@@ -996,17 +1035,14 @@ function DInputPin({ id: idProp, label = '', labelIcon, labelIconFamilyClass, la
|
|
|
996
1035
|
const wheelInput = useCallback((event) => {
|
|
997
1036
|
event.currentTarget.blur();
|
|
998
1037
|
}, []);
|
|
999
|
-
const { iconMap: { input } } = useDContext();
|
|
1000
|
-
const invalidIcon = useMemo(() => invalidIconProp || input.invalid, [input.invalid, invalidIconProp]);
|
|
1001
|
-
const validIcon = useMemo(() => validIconProp || input.valid, [input.valid, validIconProp]);
|
|
1002
1038
|
return (jsxs("div", Object.assign({ className: classNames('d-input-pin', className), style: style }, dataAttributes, { children: [label && (jsxs("label", { htmlFor: "pinIndex0", children: [label, labelIcon && (jsx(DIcon, { icon: labelIcon, size: `var(--${PREFIX_BS}input-label-font-size)`, familyClass: labelIconFamilyClass, familyPrefix: labelIconFamilyPrefix }))] })), jsxs("div", { className: "d-input-pin-group", id: id, children: [Array.from({ length: characters }).map((_, index) => (jsx("input", Object.assign({ className: classNames({
|
|
1003
1039
|
'form-control': true,
|
|
1004
1040
|
'is-invalid': invalid,
|
|
1005
1041
|
'is-valid': valid,
|
|
1006
|
-
}), 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))),
|
|
1042
|
+
}), 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 && (jsx("div", { className: "input-group-text", children: jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsx("span", { className: "visually-hidden", children: "Loading..." }) }) }))] }), hint && (jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] })));
|
|
1007
1043
|
}
|
|
1008
1044
|
|
|
1009
|
-
function DInputSelect({ id: idProp, name, label = '', className, style, options = [], labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, disabled = false, loading = false, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconStartAriaLabel, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, iconEndAriaLabel,
|
|
1045
|
+
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, }) {
|
|
1010
1046
|
const innerId = useId();
|
|
1011
1047
|
const id = useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
1012
1048
|
const internalValueExtractor = useCallback((option) => {
|
|
@@ -1043,9 +1079,6 @@ function DInputSelect({ id: idProp, name, label = '', className, style, options
|
|
|
1043
1079
|
const iconEndClickHandler = useCallback((event) => {
|
|
1044
1080
|
onIconEndClick === null || onIconEndClick === void 0 ? void 0 : onIconEndClick(event);
|
|
1045
1081
|
}, [onIconEndClick]);
|
|
1046
|
-
const { iconMap: { input } } = useDContext();
|
|
1047
|
-
const invalidIcon = useMemo(() => invalidIconProp || input.invalid, [input.invalid, invalidIconProp]);
|
|
1048
|
-
const validIcon = useMemo(() => validIconProp || input.valid, [input.valid, validIconProp]);
|
|
1049
1082
|
const ariaDescribedby = useMemo(() => ([
|
|
1050
1083
|
iconStart && `${id}Start`,
|
|
1051
1084
|
hint && `${id}Hint`,
|
|
@@ -1092,7 +1125,7 @@ function DInputSelect({ id: idProp, name, label = '', className, style, options
|
|
|
1092
1125
|
}, [floatingLabel, labelComponent, selectComponent]);
|
|
1093
1126
|
return (jsxs("div", Object.assign({ className: className, style: style }, dataAttributes, { children: [label && !floatingLabel && (labelComponent), jsxs("div", { className: classNames({
|
|
1094
1127
|
'input-group': true,
|
|
1095
|
-
}), children: [iconStart && (jsx("button", { type: "button", className: "input-group-text", id: `${id}Start`, onClick: iconStartClickHandler, disabled: disabled || loading, "aria-label": iconStartAriaLabel, children: iconStart && (jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix })) })), dynamicComponent,
|
|
1128
|
+
}), children: [iconStart && (jsx("button", { type: "button", className: "input-group-text", id: `${id}Start`, onClick: iconStartClickHandler, disabled: disabled || loading, "aria-label": iconStartAriaLabel, children: iconStart && (jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix })) })), dynamicComponent, iconEnd && !loading && (jsx("button", { type: "button", className: "input-group-text", id: `${id}End`, onClick: iconEndClickHandler, disabled: disabled || loading, "aria-label": iconEndAriaLabel, children: iconEnd && (jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix })) })), loading && (jsx("div", { className: "input-group-text form-control-icon loading", children: jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsx("span", { className: "visually-hidden", children: "Loading..." }) }) }))] }), hint && (jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] })));
|
|
1096
1129
|
}
|
|
1097
1130
|
|
|
1098
1131
|
function DInputSwitch({ id: idProp, label, ariaLabel, name, checked, disabled, invalid = false, valid = false, readonly, className, style, dataAttributes, onChange, }) {
|
|
@@ -1151,6 +1184,9 @@ const ForwardedDInputRange = forwardRef(DInputRange);
|
|
|
1151
1184
|
ForwardedDInputRange.displayName = 'DInputRange';
|
|
1152
1185
|
var DInputRange$1 = ForwardedDInputRange;
|
|
1153
1186
|
|
|
1187
|
+
/**
|
|
1188
|
+
* @deprecated Please use DListGroup.Item or DListGroupItem instead
|
|
1189
|
+
*/
|
|
1154
1190
|
function DListItem({ children, className, style, active = false, disabled = false, theme, onClick, }) {
|
|
1155
1191
|
const Tag = useMemo(() => (onClick ? 'button' : 'div'), [onClick]);
|
|
1156
1192
|
return (jsx(Tag, Object.assign({}, Tag === 'button' && {
|
|
@@ -1162,6 +1198,9 @@ function DListItem({ children, className, style, active = false, disabled = fals
|
|
|
1162
1198
|
}), style: style }, active && { 'aria-current': true }, { children: children })));
|
|
1163
1199
|
}
|
|
1164
1200
|
|
|
1201
|
+
/**
|
|
1202
|
+
* @deprecated Please use DListGroup instead
|
|
1203
|
+
*/
|
|
1165
1204
|
function DList({ children, className, style, flush = false, numbered = false, horizontal = false, horizontalBreakpoint, dataAttributes, }) {
|
|
1166
1205
|
if (flush && horizontal) {
|
|
1167
1206
|
throw new Error("Horizontal and Flush props don't work together");
|
|
@@ -1176,6 +1215,62 @@ var DList$1 = Object.assign(DList, {
|
|
|
1176
1215
|
Item: DListItem,
|
|
1177
1216
|
});
|
|
1178
1217
|
|
|
1218
|
+
function DListGroupItem({ as = 'li', action: actionProp, active, disabled, href, onClick, theme, children, className, style, dataAttributes, }) {
|
|
1219
|
+
const Tag = useMemo(() => {
|
|
1220
|
+
if (href) {
|
|
1221
|
+
return 'a';
|
|
1222
|
+
}
|
|
1223
|
+
if (actionProp) {
|
|
1224
|
+
return 'button';
|
|
1225
|
+
}
|
|
1226
|
+
return as;
|
|
1227
|
+
}, [href, as, actionProp]);
|
|
1228
|
+
const action = useMemo(() => {
|
|
1229
|
+
if (Tag === 'a' || Tag === 'button') {
|
|
1230
|
+
return true;
|
|
1231
|
+
}
|
|
1232
|
+
return actionProp;
|
|
1233
|
+
}, [Tag, actionProp]);
|
|
1234
|
+
const generateClasses = useMemo(() => ({
|
|
1235
|
+
'list-group-item': true,
|
|
1236
|
+
'list-group-item-action': action,
|
|
1237
|
+
[`list-group-item-${theme}`]: !!theme,
|
|
1238
|
+
active,
|
|
1239
|
+
disabled,
|
|
1240
|
+
}), [action, active, disabled, theme]);
|
|
1241
|
+
const ariaAttributes = useMemo(() => {
|
|
1242
|
+
if (Tag === 'button') {
|
|
1243
|
+
return Object.assign(Object.assign({}, active && { 'aria-current': true }), disabled && { disabled: true });
|
|
1244
|
+
}
|
|
1245
|
+
return Object.assign(Object.assign({}, active && { 'aria-current': true }), disabled && { 'aria-disabled': true });
|
|
1246
|
+
}, [Tag, active, disabled]);
|
|
1247
|
+
return (jsx(Tag, Object.assign({ className: classNames(generateClasses, className), style: style }, Tag === 'a' && href && { href }, onClick && { onClick }, ariaAttributes, dataAttributes, { children: children })));
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
function DListGroup({ as = 'ul', numbered, flush, horizontal, children, className, style, dataAttributes, }) {
|
|
1251
|
+
const Tag = useMemo(() => {
|
|
1252
|
+
if (numbered) {
|
|
1253
|
+
return 'ol';
|
|
1254
|
+
}
|
|
1255
|
+
return as;
|
|
1256
|
+
}, [numbered, as]);
|
|
1257
|
+
const generateClasses = useMemo(() => {
|
|
1258
|
+
const listGroupHorizontalClass = typeof horizontal === 'string'
|
|
1259
|
+
? `list-group-horizontal-${horizontal}`
|
|
1260
|
+
: 'list-group-horizontal';
|
|
1261
|
+
return {
|
|
1262
|
+
'list-group': true,
|
|
1263
|
+
'list-group-numbered': numbered,
|
|
1264
|
+
'list-group-flush': flush,
|
|
1265
|
+
[listGroupHorizontalClass]: !!horizontal,
|
|
1266
|
+
};
|
|
1267
|
+
}, [flush, horizontal, numbered]);
|
|
1268
|
+
return (jsx(Tag, Object.assign({ className: classNames(generateClasses, className), style: style }, dataAttributes, { children: children })));
|
|
1269
|
+
}
|
|
1270
|
+
var DListGroup$1 = Object.assign(DListGroup, {
|
|
1271
|
+
Item: DListGroupItem,
|
|
1272
|
+
});
|
|
1273
|
+
|
|
1179
1274
|
function DModalHeader({ showCloseButton, onClose, children, className, style, iconFamilyClass, iconFamilyPrefix, icon: iconProp, materialStyle = false, }) {
|
|
1180
1275
|
const { iconMap: { xLg, }, } = useDContext();
|
|
1181
1276
|
const icon = useMemo(() => iconProp || xLg, [iconProp, xLg]);
|
|
@@ -1186,8 +1281,12 @@ function DModalBody({ children, className, style, }) {
|
|
|
1186
1281
|
return (jsx("div", { className: classNames('modal-body', className), style: style, children: children }));
|
|
1187
1282
|
}
|
|
1188
1283
|
|
|
1189
|
-
function DModalFooter({ className, style, actionPlacement
|
|
1190
|
-
|
|
1284
|
+
function DModalFooter({ className, style, actionPlacement, children, }) {
|
|
1285
|
+
const generateClasses = useMemo(() => ({
|
|
1286
|
+
'modal-footer': true,
|
|
1287
|
+
[`d-modal-action-${actionPlacement}`]: !!actionPlacement,
|
|
1288
|
+
}), [actionPlacement]);
|
|
1289
|
+
return (jsxs(Fragment$1, { children: [jsx("div", { className: "d-modal-separator" }), jsx("div", { className: classNames(generateClasses, className), style: style, children: children })] }));
|
|
1191
1290
|
}
|
|
1192
1291
|
|
|
1193
1292
|
function DModal({ name, className, style, staticBackdrop, scrollable, centered, fullScreen, fullScreenFrom, size, children, dataAttributes, }) {
|
|
@@ -1200,9 +1299,8 @@ function DModal({ name, className, style, staticBackdrop, scrollable, centered,
|
|
|
1200
1299
|
}
|
|
1201
1300
|
return '';
|
|
1202
1301
|
}, [fullScreenFrom, fullScreen]);
|
|
1203
|
-
const generateClasses = useMemo(() => (Object.assign({ 'modal portal fade show': true }, className && { [className]: true })), [className]);
|
|
1204
1302
|
const generateModalDialogClasses = 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]);
|
|
1205
|
-
return (jsx("div", Object.assign({ className: classNames(
|
|
1303
|
+
return (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 && ({
|
|
1206
1304
|
[`data-${PREFIX_BS}backdrop`]: 'static',
|
|
1207
1305
|
[`data-${PREFIX_BS}keyboard`]: 'false',
|
|
1208
1306
|
}), dataAttributes, { children: jsx("div", { className: classNames(generateModalDialogClasses), children: jsx("div", { className: "modal-content", children: children }) }) })));
|
|
@@ -1223,8 +1321,12 @@ function DOffcanvasBody({ children, className, style, }) {
|
|
|
1223
1321
|
return (jsx("div", { className: classNames('offcanvas-body', className), style: style, children: children }));
|
|
1224
1322
|
}
|
|
1225
1323
|
|
|
1226
|
-
function DOffcanvasFooter({
|
|
1227
|
-
|
|
1324
|
+
function DOffcanvasFooter({ actionPlacement, children, className, style, }) {
|
|
1325
|
+
const generateClasses = useMemo(() => ({
|
|
1326
|
+
'd-offcanvas-footer': true,
|
|
1327
|
+
[`d-offcanvas-action-${actionPlacement}`]: !!actionPlacement,
|
|
1328
|
+
}), [actionPlacement]);
|
|
1329
|
+
return (jsxs(Fragment$1, { children: [jsx("div", { className: "d-offcanvas-separator" }), jsx("div", { className: classNames(generateClasses, className), style: style, children: children })] }));
|
|
1228
1330
|
}
|
|
1229
1331
|
|
|
1230
1332
|
function DOffcanvas({ name, className, style, staticBackdrop, scrollable, openFrom = 'end', children, dataAttributes, }) {
|
|
@@ -1245,10 +1347,16 @@ var DOffcanvas$1 = Object.assign(DOffcanvas, {
|
|
|
1245
1347
|
});
|
|
1246
1348
|
|
|
1247
1349
|
function DPaginator(_a) {
|
|
1248
|
-
var { className,
|
|
1249
|
-
|
|
1350
|
+
var { className, page, current, showArrows, navClassName } = _a, props = __rest(_a, ["className", "page", "current", "showArrows", "navClassName"]);
|
|
1351
|
+
const backwardCompatibilityProps = 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 && {
|
|
1352
|
+
extraClassName: className,
|
|
1353
|
+
})), [props, page, current, showArrows, className]);
|
|
1354
|
+
return (jsx(ResponsivePagination, Object.assign({ navClassName: classNames('page-item-arrow', navClassName) }, backwardCompatibilityProps)));
|
|
1250
1355
|
}
|
|
1251
1356
|
|
|
1357
|
+
/**
|
|
1358
|
+
* @deprecated
|
|
1359
|
+
*/
|
|
1252
1360
|
function DPopover({ children, renderComponent, open, setOpen, adjustContentToRender = false, className, style, dataAttributes, }) {
|
|
1253
1361
|
const [isOpen, setIsOpen] = useState(false);
|
|
1254
1362
|
useEffect(() => {
|
|
@@ -1297,6 +1405,9 @@ function DProgress({ className, style, currentValue, minValue = 0, maxValue = 10
|
|
|
1297
1405
|
return (jsx("div", Object.assign({ className: classNames('progress', className) }, dataAttributes, { children: 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 }) })));
|
|
1298
1406
|
}
|
|
1299
1407
|
|
|
1408
|
+
/**
|
|
1409
|
+
* @deprecated
|
|
1410
|
+
*/
|
|
1300
1411
|
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, }) {
|
|
1301
1412
|
const globalClickHandler = useCallback(() => {
|
|
1302
1413
|
if (actionLinkText) {
|
|
@@ -1319,6 +1430,9 @@ function DQuickActionButton({ line1, line2, className, actionLinkText, actionLin
|
|
|
1319
1430
|
: `var(--${PREFIX_BS}quick-action-button-representative-image-size)`, icon: representativeIcon, hasCircle: representativeIconHasCircle, theme: representativeIconTheme, familyClass: representativeIconFamilyClass, familyPrefix: representativeIconFamilyPrefix })), representativeImage && (jsx("img", { className: "d-quick-action-button-representative-image", src: representativeImage, alt: "" })), jsx("div", { className: "d-quick-action-button-content", children: jsxs("div", { className: "d-quick-action-button-text", children: [jsx("span", { className: "d-quick-action-button-line1", children: line1 }), jsx("small", { className: "d-quick-action-button-line2", children: line2 })] }) }), secondaryActionIcon && (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 && (jsx(DButton, { className: "d-quick-action-button-action-link", type: "button", variant: "link", theme: actionLinkTheme, text: actionLinkText, onClick: actionLinkClickHandler, stopPropagationEnabled: true })), actionIcon && !actionLinkText && (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 }))] })));
|
|
1320
1431
|
}
|
|
1321
1432
|
|
|
1433
|
+
/**
|
|
1434
|
+
* @deprecated
|
|
1435
|
+
*/
|
|
1322
1436
|
function DQuickActionCheck({ id: idProp, name, value, line1, line2, line3, className, style, checked, dataAttributes, onChange, }) {
|
|
1323
1437
|
const innerId = useId();
|
|
1324
1438
|
const id = useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
@@ -1345,6 +1459,9 @@ function DQuickActionSelect({ id: idProp, name, value, line1, line2, className,
|
|
|
1345
1459
|
return (jsxs("label", Object.assign({ className: classNames('d-quick-action-select', className), htmlFor: id, style: style }, dataAttributes, { children: [jsx("input", { ref: innerRef, id: id, type: "radio", name: name, value: value, onChange: changeHandler }), jsx("span", { className: "d-quick-action-select-line1", children: line1 }), jsx("span", { className: "d-quick-action-select-line2", children: line2 })] })));
|
|
1346
1460
|
}
|
|
1347
1461
|
|
|
1462
|
+
/**
|
|
1463
|
+
* @deprecated
|
|
1464
|
+
*/
|
|
1348
1465
|
function DQuickActionSwitch({ id: idProp, name, label, hint, checked, disabled, className, style, dataAttributes, onClick, }) {
|
|
1349
1466
|
const innerId = useId();
|
|
1350
1467
|
const id = useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
@@ -1490,7 +1607,7 @@ function DTabs({ children, defaultSelected, onChange, options, className, classN
|
|
|
1490
1607
|
if (option.tab) {
|
|
1491
1608
|
setSelected(option.tab);
|
|
1492
1609
|
}
|
|
1493
|
-
onChange(option);
|
|
1610
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(option);
|
|
1494
1611
|
}, [onChange]);
|
|
1495
1612
|
useEffect(() => {
|
|
1496
1613
|
setSelected(defaultSelected);
|
|
@@ -1586,5 +1703,29 @@ async function configureI8n(resources, _a = {}) {
|
|
|
1586
1703
|
.then((t) => t);
|
|
1587
1704
|
}
|
|
1588
1705
|
|
|
1589
|
-
|
|
1706
|
+
function getQueryString(value, config = {
|
|
1707
|
+
useSearch: true,
|
|
1708
|
+
}) {
|
|
1709
|
+
const urlParams = new URLSearchParams(config.useSearch ? window.location.search : '');
|
|
1710
|
+
return urlParams.get(value) || config.default;
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
function changeQueryString(values, { useSearch = true, pushState = false, } = {}) {
|
|
1714
|
+
const searchParams = new URLSearchParams(useSearch ? window.location.search : '');
|
|
1715
|
+
Object.entries(values).forEach(([key, value]) => {
|
|
1716
|
+
if (!value) {
|
|
1717
|
+
searchParams.delete(key);
|
|
1718
|
+
return;
|
|
1719
|
+
}
|
|
1720
|
+
searchParams.set(key, String(value));
|
|
1721
|
+
});
|
|
1722
|
+
if (pushState) {
|
|
1723
|
+
const url = new URL(window.location.href);
|
|
1724
|
+
url.search = searchParams.toString();
|
|
1725
|
+
window.history.pushState(null, '', url.toString());
|
|
1726
|
+
}
|
|
1727
|
+
return searchParams.toString();
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
export { DAlert, DAvatar, DBadge, DBoxFile, DButton, DButtonIcon, DCard$1 as DCard, DCardBody, DCardFooter, DCardHeader, DCarousel$1 as DCarousel, DCarouselSlide, DChip, DCollapse, DContext, DContextProvider, DCurrencyText, DDatePicker, DIcon, DIconBase, DInput$1 as DInput, DInputCheck, DInputCounter$1 as DInputCounter, DInputCurrency$1 as DInputCurrency, DInputCurrencyBase$1 as DInputCurrencyBase, DInputMask$1 as DInputMask, DInputPassword$1 as DInputPassword, DInputPin, DInputRange$1 as DInputRange, DInputSearch$1 as DInputSearch, DInputSelect, DInputSwitch, DList$1 as DList, DListGroup$1 as DListGroup, DListGroupItem, DListItem, DModal$1 as DModal, DModalBody, DModalFooter, DModalHeader, DOffcanvas$1 as DOffcanvas, DOffcanvasBody, DOffcanvasFooter, DOffcanvasHeader, DPaginator, DPopover, DProgress, DQuickActionButton, DQuickActionCheck, DQuickActionSelect, DQuickActionSwitch, DSelect$1 as DSelect, DSkeleton, DStepper, DStepper$2 as DStepperDesktop, DStepper$1 as DStepperMobile, DTableHead, DTabs$1 as DTabs, DToast$1 as DToast, DToastContainer, DTooltip, changeQueryString, configureI8n as configureI18n, formatCurrency, getQueryString, useDContext, useDPortalContext, useDToast, useDisableBodyScrollEffect, useDisableInputWheel, useFormatCurrency, useInputCurrency, useItemSelection, usePortal, useProvidedRefOrCreate, useStackState, useTabContext };
|
|
1590
1731
|
//# sourceMappingURL=index.esm.js.map
|