@dynamic-framework/ui-react 1.30.1 → 1.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/dynamic-ui-non-root.css +353 -150
- package/dist/css/dynamic-ui-non-root.min.css +2 -2
- package/dist/css/dynamic-ui-root.css +10 -6
- package/dist/css/dynamic-ui-root.min.css +2 -2
- package/dist/css/dynamic-ui.css +362 -155
- package/dist/css/dynamic-ui.min.css +2 -2
- package/dist/index.esm.js +197 -48
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +201 -48
- 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/DStepperDesktop/DStepperDesktop.d.ts +3 -1
- 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 +21 -17
- package/src/style/abstracts/variables/_+import.scss +0 -1
- package/src/style/abstracts/variables/_forms.scss +6 -5
- 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/abstracts/variables/_tooltip.scss +4 -4
- package/src/style/base/_+import.scss +2 -1
- package/src/style/base/_alert.scss +20 -0
- package/src/style/base/_form-check.scss +6 -2
- package/src/style/base/_input-group.scss +4 -1
- package/src/style/base/_label.scss +1 -0
- package/src/style/base/_nav.scss +72 -0
- package/src/style/base/_pagination.scss +7 -5
- package/src/style/base/_placeholder.scss +3 -0
- package/src/style/components/_+import.scss +1 -1
- package/src/style/components/_d-avatar.scss +85 -0
- package/src/style/components/_d-input-pin.scss +11 -5
- package/src/style/components/_d-select.scss +15 -6
- package/src/style/components/_d-stepper-desktop.scss +25 -5
- package/src/style/components/_d-stepper-mobile.scss +6 -6
- package/src/style/root/_root.scss +9 -1
- package/src/style/abstracts/variables/_box-shadow.scss +0 -6
- 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) {
|
|
@@ -844,6 +853,37 @@ function useDisableInputWheel(ref) {
|
|
|
844
853
|
};
|
|
845
854
|
}
|
|
846
855
|
|
|
856
|
+
function useItemSelection({ getItemIdentifier: getItemIdentifierProp, previousSelected = [], } = {}) {
|
|
857
|
+
const getItemIdentifier = useCallback((item) => (String(getItemIdentifierProp ? getItemIdentifierProp(item) : item.id)), [getItemIdentifierProp]);
|
|
858
|
+
const [selectionMap, setSelectionMap] = useState(() => new Map(previousSelected.map((item) => [getItemIdentifier(item), item])));
|
|
859
|
+
const selectedItems = useMemo(() => Array.from(selectionMap.values()), [selectionMap]);
|
|
860
|
+
const setSelectedItems = useCallback((items) => {
|
|
861
|
+
setSelectionMap(new Map(items.map((item) => [getItemIdentifier(item), item])));
|
|
862
|
+
}, [getItemIdentifier]);
|
|
863
|
+
const isSelectedItem = useCallback((item) => selectionMap.has(getItemIdentifier(item)), [getItemIdentifier, selectionMap]);
|
|
864
|
+
const toggleSelectedItem = useCallback((item) => {
|
|
865
|
+
const identifier = getItemIdentifier(item);
|
|
866
|
+
setSelectionMap((prev) => {
|
|
867
|
+
const newMap = new Map(prev);
|
|
868
|
+
if (newMap.has(identifier)) {
|
|
869
|
+
newMap.delete(identifier);
|
|
870
|
+
}
|
|
871
|
+
else {
|
|
872
|
+
newMap.set(identifier, item);
|
|
873
|
+
}
|
|
874
|
+
return newMap;
|
|
875
|
+
});
|
|
876
|
+
}, [getItemIdentifier]);
|
|
877
|
+
const resetSelectedItems = useCallback(() => setSelectionMap(new Map()), []);
|
|
878
|
+
return {
|
|
879
|
+
selectedItems,
|
|
880
|
+
isSelectedItem,
|
|
881
|
+
toggleSelectedItem,
|
|
882
|
+
resetSelectedItems,
|
|
883
|
+
setSelectedItems,
|
|
884
|
+
};
|
|
885
|
+
}
|
|
886
|
+
|
|
847
887
|
function DInputCounter(_a, ref) {
|
|
848
888
|
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
889
|
const { handleOnWheel, } = useDisableInputWheel(ref);
|
|
@@ -883,6 +923,9 @@ const ForwardedDInputCounter = forwardRef(DInputCounter);
|
|
|
883
923
|
ForwardedDInputCounter.displayName = 'DInputCounter';
|
|
884
924
|
var DInputCounter$1 = ForwardedDInputCounter;
|
|
885
925
|
|
|
926
|
+
/**
|
|
927
|
+
* @deprecated
|
|
928
|
+
*/
|
|
886
929
|
function DInputCurrencyBase(_a, ref) {
|
|
887
930
|
var { value, minValue, maxValue, currencyOptions, currencyCode, onFocus, onBlur, onChange } = _a, inputProps = __rest(_a, ["value", "minValue", "maxValue", "currencyOptions", "currencyCode", "onFocus", "onBlur", "onChange"]);
|
|
888
931
|
const { handleOnWheel, } = useDisableInputWheel(ref);
|
|
@@ -904,6 +947,9 @@ const ForwardedDInputCurrencyBase = forwardRef(DInputCurrency);
|
|
|
904
947
|
ForwardedDInputCurrencyBase.displayName = 'DInputCurrency';
|
|
905
948
|
var DInputCurrency$1 = ForwardedDInputCurrencyBase;
|
|
906
949
|
|
|
950
|
+
/**
|
|
951
|
+
* @deprecated
|
|
952
|
+
*/
|
|
907
953
|
function DInputSearch(_a, ref) {
|
|
908
954
|
var { type, iconEnd: iconEndProp, iconEndAriaLabel = 'search' } = _a, props = __rest(_a, ["type", "iconEnd", "iconEndAriaLabel"]);
|
|
909
955
|
const inputRef = useProvidedRefOrCreate(ref);
|
|
@@ -929,7 +975,7 @@ const ForwardedDInputPassword = forwardRef(DInputPassword);
|
|
|
929
975
|
ForwardedDInputPassword.displayName = 'DInputPassword';
|
|
930
976
|
var DInputPassword$1 = ForwardedDInputPassword;
|
|
931
977
|
|
|
932
|
-
function DInputPin({ id: idProp, label = '', labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, placeholder, type = 'text', disabled = false, loading = false, secret = false,
|
|
978
|
+
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
979
|
const innerId = useId();
|
|
934
980
|
const id = useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
935
981
|
const [pattern, setPattern] = useState('');
|
|
@@ -996,17 +1042,14 @@ function DInputPin({ id: idProp, label = '', labelIcon, labelIconFamilyClass, la
|
|
|
996
1042
|
const wheelInput = useCallback((event) => {
|
|
997
1043
|
event.currentTarget.blur();
|
|
998
1044
|
}, []);
|
|
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
1045
|
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
1046
|
'form-control': true,
|
|
1004
1047
|
'is-invalid': invalid,
|
|
1005
1048
|
'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))),
|
|
1049
|
+
}), 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
1050
|
}
|
|
1008
1051
|
|
|
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,
|
|
1052
|
+
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
1053
|
const innerId = useId();
|
|
1011
1054
|
const id = useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
1012
1055
|
const internalValueExtractor = useCallback((option) => {
|
|
@@ -1043,9 +1086,6 @@ function DInputSelect({ id: idProp, name, label = '', className, style, options
|
|
|
1043
1086
|
const iconEndClickHandler = useCallback((event) => {
|
|
1044
1087
|
onIconEndClick === null || onIconEndClick === void 0 ? void 0 : onIconEndClick(event);
|
|
1045
1088
|
}, [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
1089
|
const ariaDescribedby = useMemo(() => ([
|
|
1050
1090
|
iconStart && `${id}Start`,
|
|
1051
1091
|
hint && `${id}Hint`,
|
|
@@ -1092,7 +1132,7 @@ function DInputSelect({ id: idProp, name, label = '', className, style, options
|
|
|
1092
1132
|
}, [floatingLabel, labelComponent, selectComponent]);
|
|
1093
1133
|
return (jsxs("div", Object.assign({ className: className, style: style }, dataAttributes, { children: [label && !floatingLabel && (labelComponent), jsxs("div", { className: classNames({
|
|
1094
1134
|
'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,
|
|
1135
|
+
}), 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
1136
|
}
|
|
1097
1137
|
|
|
1098
1138
|
function DInputSwitch({ id: idProp, label, ariaLabel, name, checked, disabled, invalid = false, valid = false, readonly, className, style, dataAttributes, onChange, }) {
|
|
@@ -1151,6 +1191,9 @@ const ForwardedDInputRange = forwardRef(DInputRange);
|
|
|
1151
1191
|
ForwardedDInputRange.displayName = 'DInputRange';
|
|
1152
1192
|
var DInputRange$1 = ForwardedDInputRange;
|
|
1153
1193
|
|
|
1194
|
+
/**
|
|
1195
|
+
* @deprecated Please use DListGroup.Item or DListGroupItem instead
|
|
1196
|
+
*/
|
|
1154
1197
|
function DListItem({ children, className, style, active = false, disabled = false, theme, onClick, }) {
|
|
1155
1198
|
const Tag = useMemo(() => (onClick ? 'button' : 'div'), [onClick]);
|
|
1156
1199
|
return (jsx(Tag, Object.assign({}, Tag === 'button' && {
|
|
@@ -1162,6 +1205,9 @@ function DListItem({ children, className, style, active = false, disabled = fals
|
|
|
1162
1205
|
}), style: style }, active && { 'aria-current': true }, { children: children })));
|
|
1163
1206
|
}
|
|
1164
1207
|
|
|
1208
|
+
/**
|
|
1209
|
+
* @deprecated Please use DListGroup instead
|
|
1210
|
+
*/
|
|
1165
1211
|
function DList({ children, className, style, flush = false, numbered = false, horizontal = false, horizontalBreakpoint, dataAttributes, }) {
|
|
1166
1212
|
if (flush && horizontal) {
|
|
1167
1213
|
throw new Error("Horizontal and Flush props don't work together");
|
|
@@ -1176,6 +1222,62 @@ var DList$1 = Object.assign(DList, {
|
|
|
1176
1222
|
Item: DListItem,
|
|
1177
1223
|
});
|
|
1178
1224
|
|
|
1225
|
+
function DListGroupItem({ as = 'li', action: actionProp, active, disabled, href, onClick, theme, children, className, style, dataAttributes, }) {
|
|
1226
|
+
const Tag = useMemo(() => {
|
|
1227
|
+
if (href) {
|
|
1228
|
+
return 'a';
|
|
1229
|
+
}
|
|
1230
|
+
if (actionProp) {
|
|
1231
|
+
return 'button';
|
|
1232
|
+
}
|
|
1233
|
+
return as;
|
|
1234
|
+
}, [href, as, actionProp]);
|
|
1235
|
+
const action = useMemo(() => {
|
|
1236
|
+
if (Tag === 'a' || Tag === 'button') {
|
|
1237
|
+
return true;
|
|
1238
|
+
}
|
|
1239
|
+
return actionProp;
|
|
1240
|
+
}, [Tag, actionProp]);
|
|
1241
|
+
const generateClasses = useMemo(() => ({
|
|
1242
|
+
'list-group-item': true,
|
|
1243
|
+
'list-group-item-action': action,
|
|
1244
|
+
[`list-group-item-${theme}`]: !!theme,
|
|
1245
|
+
active,
|
|
1246
|
+
disabled,
|
|
1247
|
+
}), [action, active, disabled, theme]);
|
|
1248
|
+
const ariaAttributes = useMemo(() => {
|
|
1249
|
+
if (Tag === 'button') {
|
|
1250
|
+
return Object.assign(Object.assign({}, active && { 'aria-current': true }), disabled && { disabled: true });
|
|
1251
|
+
}
|
|
1252
|
+
return Object.assign(Object.assign({}, active && { 'aria-current': true }), disabled && { 'aria-disabled': true });
|
|
1253
|
+
}, [Tag, active, disabled]);
|
|
1254
|
+
return (jsx(Tag, Object.assign({ className: classNames(generateClasses, className), style: style }, Tag === 'a' && href && { href }, onClick && { onClick }, ariaAttributes, dataAttributes, { children: children })));
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
function DListGroup({ as = 'ul', numbered, flush, horizontal, children, className, style, dataAttributes, }) {
|
|
1258
|
+
const Tag = useMemo(() => {
|
|
1259
|
+
if (numbered) {
|
|
1260
|
+
return 'ol';
|
|
1261
|
+
}
|
|
1262
|
+
return as;
|
|
1263
|
+
}, [numbered, as]);
|
|
1264
|
+
const generateClasses = useMemo(() => {
|
|
1265
|
+
const listGroupHorizontalClass = typeof horizontal === 'string'
|
|
1266
|
+
? `list-group-horizontal-${horizontal}`
|
|
1267
|
+
: 'list-group-horizontal';
|
|
1268
|
+
return {
|
|
1269
|
+
'list-group': true,
|
|
1270
|
+
'list-group-numbered': numbered,
|
|
1271
|
+
'list-group-flush': flush,
|
|
1272
|
+
[listGroupHorizontalClass]: !!horizontal,
|
|
1273
|
+
};
|
|
1274
|
+
}, [flush, horizontal, numbered]);
|
|
1275
|
+
return (jsx(Tag, Object.assign({ className: classNames(generateClasses, className), style: style }, dataAttributes, { children: children })));
|
|
1276
|
+
}
|
|
1277
|
+
var DListGroup$1 = Object.assign(DListGroup, {
|
|
1278
|
+
Item: DListGroupItem,
|
|
1279
|
+
});
|
|
1280
|
+
|
|
1179
1281
|
function DModalHeader({ showCloseButton, onClose, children, className, style, iconFamilyClass, iconFamilyPrefix, icon: iconProp, materialStyle = false, }) {
|
|
1180
1282
|
const { iconMap: { xLg, }, } = useDContext();
|
|
1181
1283
|
const icon = useMemo(() => iconProp || xLg, [iconProp, xLg]);
|
|
@@ -1186,8 +1288,12 @@ function DModalBody({ children, className, style, }) {
|
|
|
1186
1288
|
return (jsx("div", { className: classNames('modal-body', className), style: style, children: children }));
|
|
1187
1289
|
}
|
|
1188
1290
|
|
|
1189
|
-
function DModalFooter({ className, style, actionPlacement
|
|
1190
|
-
|
|
1291
|
+
function DModalFooter({ className, style, actionPlacement, children, }) {
|
|
1292
|
+
const generateClasses = useMemo(() => ({
|
|
1293
|
+
'modal-footer': true,
|
|
1294
|
+
[`d-modal-action-${actionPlacement}`]: !!actionPlacement,
|
|
1295
|
+
}), [actionPlacement]);
|
|
1296
|
+
return (jsxs(Fragment$1, { children: [jsx("div", { className: "d-modal-separator" }), jsx("div", { className: classNames(generateClasses, className), style: style, children: children })] }));
|
|
1191
1297
|
}
|
|
1192
1298
|
|
|
1193
1299
|
function DModal({ name, className, style, staticBackdrop, scrollable, centered, fullScreen, fullScreenFrom, size, children, dataAttributes, }) {
|
|
@@ -1200,9 +1306,8 @@ function DModal({ name, className, style, staticBackdrop, scrollable, centered,
|
|
|
1200
1306
|
}
|
|
1201
1307
|
return '';
|
|
1202
1308
|
}, [fullScreenFrom, fullScreen]);
|
|
1203
|
-
const generateClasses = useMemo(() => (Object.assign({ 'modal portal fade show': true }, className && { [className]: true })), [className]);
|
|
1204
1309
|
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(
|
|
1310
|
+
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
1311
|
[`data-${PREFIX_BS}backdrop`]: 'static',
|
|
1207
1312
|
[`data-${PREFIX_BS}keyboard`]: 'false',
|
|
1208
1313
|
}), dataAttributes, { children: jsx("div", { className: classNames(generateModalDialogClasses), children: jsx("div", { className: "modal-content", children: children }) }) })));
|
|
@@ -1223,8 +1328,12 @@ function DOffcanvasBody({ children, className, style, }) {
|
|
|
1223
1328
|
return (jsx("div", { className: classNames('offcanvas-body', className), style: style, children: children }));
|
|
1224
1329
|
}
|
|
1225
1330
|
|
|
1226
|
-
function DOffcanvasFooter({
|
|
1227
|
-
|
|
1331
|
+
function DOffcanvasFooter({ actionPlacement, children, className, style, }) {
|
|
1332
|
+
const generateClasses = useMemo(() => ({
|
|
1333
|
+
'd-offcanvas-footer': true,
|
|
1334
|
+
[`d-offcanvas-action-${actionPlacement}`]: !!actionPlacement,
|
|
1335
|
+
}), [actionPlacement]);
|
|
1336
|
+
return (jsxs(Fragment$1, { children: [jsx("div", { className: "d-offcanvas-separator" }), jsx("div", { className: classNames(generateClasses, className), style: style, children: children })] }));
|
|
1228
1337
|
}
|
|
1229
1338
|
|
|
1230
1339
|
function DOffcanvas({ name, className, style, staticBackdrop, scrollable, openFrom = 'end', children, dataAttributes, }) {
|
|
@@ -1245,10 +1354,16 @@ var DOffcanvas$1 = Object.assign(DOffcanvas, {
|
|
|
1245
1354
|
});
|
|
1246
1355
|
|
|
1247
1356
|
function DPaginator(_a) {
|
|
1248
|
-
var { className,
|
|
1249
|
-
|
|
1357
|
+
var { className, page, current, showArrows, navClassName } = _a, props = __rest(_a, ["className", "page", "current", "showArrows", "navClassName"]);
|
|
1358
|
+
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 && {
|
|
1359
|
+
extraClassName: className,
|
|
1360
|
+
})), [props, page, current, showArrows, className]);
|
|
1361
|
+
return (jsx(ResponsivePagination, Object.assign({ navClassName: classNames('page-item-arrow', navClassName) }, backwardCompatibilityProps)));
|
|
1250
1362
|
}
|
|
1251
1363
|
|
|
1364
|
+
/**
|
|
1365
|
+
* @deprecated
|
|
1366
|
+
*/
|
|
1252
1367
|
function DPopover({ children, renderComponent, open, setOpen, adjustContentToRender = false, className, style, dataAttributes, }) {
|
|
1253
1368
|
const [isOpen, setIsOpen] = useState(false);
|
|
1254
1369
|
useEffect(() => {
|
|
@@ -1297,6 +1412,9 @@ function DProgress({ className, style, currentValue, minValue = 0, maxValue = 10
|
|
|
1297
1412
|
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
1413
|
}
|
|
1299
1414
|
|
|
1415
|
+
/**
|
|
1416
|
+
* @deprecated
|
|
1417
|
+
*/
|
|
1300
1418
|
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
1419
|
const globalClickHandler = useCallback(() => {
|
|
1302
1420
|
if (actionLinkText) {
|
|
@@ -1319,6 +1437,9 @@ function DQuickActionButton({ line1, line2, className, actionLinkText, actionLin
|
|
|
1319
1437
|
: `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
1438
|
}
|
|
1321
1439
|
|
|
1440
|
+
/**
|
|
1441
|
+
* @deprecated
|
|
1442
|
+
*/
|
|
1322
1443
|
function DQuickActionCheck({ id: idProp, name, value, line1, line2, line3, className, style, checked, dataAttributes, onChange, }) {
|
|
1323
1444
|
const innerId = useId();
|
|
1324
1445
|
const id = useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
@@ -1345,6 +1466,9 @@ function DQuickActionSelect({ id: idProp, name, value, line1, line2, className,
|
|
|
1345
1466
|
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
1467
|
}
|
|
1347
1468
|
|
|
1469
|
+
/**
|
|
1470
|
+
* @deprecated
|
|
1471
|
+
*/
|
|
1348
1472
|
function DQuickActionSwitch({ id: idProp, name, label, hint, checked, disabled, className, style, dataAttributes, onClick, }) {
|
|
1349
1473
|
const innerId = useId();
|
|
1350
1474
|
const id = useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
@@ -1376,7 +1500,7 @@ function DSkeleton({ speed = 2, viewBox, backgroundColor, foregroundColor, child
|
|
|
1376
1500
|
return (jsx(ContentLoader, { speed: speed, viewBox: viewBox, backgroundColor: innerBackgroundColor, foregroundColor: innerForegroundColor, children: children }));
|
|
1377
1501
|
}
|
|
1378
1502
|
|
|
1379
|
-
function DStepper$2({ options, currentStep, iconSuccess: iconSuccessProp, iconSuccessFamilyClass, iconSuccessFamilyPrefix, iconSuccessMaterialStyle = false, vertical = false, completed, className, style, }) {
|
|
1503
|
+
function DStepper$2({ options, currentStep, iconSuccess: iconSuccessProp, iconSuccessFamilyClass, iconSuccessFamilyPrefix, iconSuccessMaterialStyle = false, vertical = false, completed, alignStart = false, className, style, }) {
|
|
1380
1504
|
const { iconMap: { check, }, } = useDContext();
|
|
1381
1505
|
const icon = useMemo(() => iconSuccessProp || check, [check, iconSuccessProp]);
|
|
1382
1506
|
if (currentStep < 1 || currentStep > options.length) {
|
|
@@ -1385,13 +1509,14 @@ function DStepper$2({ options, currentStep, iconSuccess: iconSuccessProp, iconSu
|
|
|
1385
1509
|
return (jsx("div", { className: classNames({
|
|
1386
1510
|
'd-stepper-desktop': true,
|
|
1387
1511
|
'is-vertical': vertical,
|
|
1388
|
-
|
|
1512
|
+
'is-align-start': alignStart && !vertical,
|
|
1513
|
+
}, className), style: style, children: options.map(({ label, value, description }) => (jsxs("div", { className: "d-step", children: [jsx("div", { className: "d-step-value", children: jsx("div", { className: classNames({
|
|
1389
1514
|
'd-step-icon-container': true,
|
|
1390
1515
|
'd-step-check': value < currentStep || completed,
|
|
1391
1516
|
'd-step-current': value === currentStep && !completed,
|
|
1392
1517
|
}), children: value < currentStep || completed
|
|
1393
1518
|
? (jsx(DIcon, { icon: icon, familyClass: iconSuccessFamilyClass, familyPrefix: iconSuccessFamilyPrefix, materialStyle: iconSuccessMaterialStyle, className: "d-step-icon" }))
|
|
1394
|
-
: value }) }), jsx("div", { className: "d-step-label", children: label })] }, value))) }));
|
|
1519
|
+
: value }) }), jsxs("div", { className: "d-step-text-container", children: [jsx("div", { className: "d-step-label", children: label }), description && (jsx("div", { className: "d-step-description", children: description }))] })] }, value))) }));
|
|
1395
1520
|
}
|
|
1396
1521
|
|
|
1397
1522
|
function DStepper$1({ options, currentStep, className, style, }) {
|
|
@@ -1418,7 +1543,7 @@ function DStepper$1({ options, currentStep, className, style, }) {
|
|
|
1418
1543
|
};
|
|
1419
1544
|
}, [currentAngle, currentStep, options.length]);
|
|
1420
1545
|
const progressStyle = useMemo(() => `conic-gradient(
|
|
1421
|
-
from
|
|
1546
|
+
from 0deg,
|
|
1422
1547
|
var(--${PREFIX_BS}step-progress-outter-fill-background-color) ${currentAngle}deg,
|
|
1423
1548
|
var(--${PREFIX_BS}step-progress-outter-background-color) 0deg)`, [currentAngle]);
|
|
1424
1549
|
return (jsxs("div", { className: classNames('d-stepper', className), style: style, children: [jsx("div", { className: "d-step-bar", style: { background: progressStyle }, children: jsx("p", { className: "d-step-number", children: `${currentStep}/${options.length}` }) }), jsx("div", { className: "d-step-info", children: Object.keys(currentOption).length > 0 && (jsxs(Fragment$1, { children: [jsx("div", { className: "d-step-label", children: currentOption.label }), jsx("div", { className: "d-step-description", children: currentOption.description || '' })] })) })] }));
|
|
@@ -1431,7 +1556,7 @@ function DStepper({ options, currentStep, iconSuccess, iconSuccessFamilyClass, i
|
|
|
1431
1556
|
const ARROW_WIDTH = 8;
|
|
1432
1557
|
const ARROW_HEIGHT = 4;
|
|
1433
1558
|
const GAP = 2;
|
|
1434
|
-
function DTooltip({ className, childrenClassName, style, offSet = ARROW_HEIGHT + GAP, padding, withFocus = false, withClick = false, withHover = true, open = false, theme = '
|
|
1559
|
+
function DTooltip({ className, childrenClassName, style, offSet = ARROW_HEIGHT + GAP, padding, withFocus = false, withClick = false, withHover = true, open = false, theme = 'dark', placement = 'top', size, Component, children, }) {
|
|
1435
1560
|
const [isOpen, setIsOpen] = useState(open);
|
|
1436
1561
|
const arrowRef = useRef(null);
|
|
1437
1562
|
const { refs, context, floatingStyles, } = useFloating({
|
|
@@ -1489,7 +1614,7 @@ function DTabs({ children, defaultSelected, onChange, options, className, classN
|
|
|
1489
1614
|
if (option.tab) {
|
|
1490
1615
|
setSelected(option.tab);
|
|
1491
1616
|
}
|
|
1492
|
-
onChange(option);
|
|
1617
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(option);
|
|
1493
1618
|
}, [onChange]);
|
|
1494
1619
|
useEffect(() => {
|
|
1495
1620
|
setSelected(defaultSelected);
|
|
@@ -1585,5 +1710,29 @@ async function configureI8n(resources, _a = {}) {
|
|
|
1585
1710
|
.then((t) => t);
|
|
1586
1711
|
}
|
|
1587
1712
|
|
|
1588
|
-
|
|
1713
|
+
function getQueryString(value, config = {
|
|
1714
|
+
useSearch: true,
|
|
1715
|
+
}) {
|
|
1716
|
+
const urlParams = new URLSearchParams(config.useSearch ? window.location.search : '');
|
|
1717
|
+
return urlParams.get(value) || config.default;
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
function changeQueryString(values, { useSearch = true, pushState = false, } = {}) {
|
|
1721
|
+
const searchParams = new URLSearchParams(useSearch ? window.location.search : '');
|
|
1722
|
+
Object.entries(values).forEach(([key, value]) => {
|
|
1723
|
+
if (!value) {
|
|
1724
|
+
searchParams.delete(key);
|
|
1725
|
+
return;
|
|
1726
|
+
}
|
|
1727
|
+
searchParams.set(key, String(value));
|
|
1728
|
+
});
|
|
1729
|
+
if (pushState) {
|
|
1730
|
+
const url = new URL(window.location.href);
|
|
1731
|
+
url.search = searchParams.toString();
|
|
1732
|
+
window.history.pushState(null, '', url.toString());
|
|
1733
|
+
}
|
|
1734
|
+
return searchParams.toString();
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
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 };
|
|
1589
1738
|
//# sourceMappingURL=index.esm.js.map
|