@dynamic-framework/ui-react 1.16.1 → 1.17.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 +3473 -1156
- package/dist/css/dynamic-ui-non-root.min.css +2 -2
- package/dist/css/dynamic-ui-root.css +22 -16
- package/dist/css/dynamic-ui-root.min.css +2 -2
- package/dist/css/dynamic-ui.css +3494 -1171
- package/dist/css/dynamic-ui.min.css +2 -2
- package/dist/index.esm.js +88 -78
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +88 -77
- package/dist/index.js.map +1 -1
- package/dist/types/components/DTabs/DTabs.d.ts +3 -2
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/useDisableInputWheel.d.ts +4 -0
- package/dist/types/hooks/useInputCurrency.d.ts +1 -2
- package/package.json +3 -3
- package/src/style/abstracts/_utilities.scss +12 -3
- package/src/style/abstracts/variables/_+import.scss +6 -81
- package/src/style/abstracts/variables/_accordion.scss +3 -23
- package/src/style/abstracts/variables/_alerts.scss +7 -13
- package/src/style/abstracts/variables/_badges.scss +2 -2
- package/src/style/abstracts/variables/_body.scss +2 -22
- package/src/style/abstracts/variables/_border.scss +5 -17
- package/src/style/abstracts/variables/_box-file.scss +3 -3
- package/src/style/abstracts/variables/_buttons.scss +8 -27
- package/src/style/abstracts/variables/_cards.scss +1 -17
- package/src/style/abstracts/variables/_carousel.scss +0 -25
- package/src/style/abstracts/variables/_chips.scss +1 -1
- package/src/style/abstracts/variables/_close.scss +0 -6
- package/src/style/abstracts/variables/_code.scss +0 -10
- package/src/style/abstracts/variables/_collapse-icon-text.scss +1 -1
- package/src/style/abstracts/variables/_dropdowns.scss +3 -27
- package/src/style/abstracts/variables/_forms.scss +21 -161
- package/src/style/abstracts/variables/_list-group.scss +6 -12
- package/src/style/abstracts/variables/_modals.scss +11 -32
- package/src/style/abstracts/variables/_navbar.scss +0 -28
- package/src/style/abstracts/variables/_navs.scss +11 -20
- package/src/style/abstracts/variables/_offcanvas.scss +7 -15
- package/src/style/abstracts/variables/_pagination.scss +20 -25
- package/src/style/abstracts/variables/_progress.scss +0 -3
- package/src/style/abstracts/variables/_quick-action-button.scss +3 -3
- package/src/style/abstracts/variables/_quick-action-check.scss +2 -2
- package/src/style/abstracts/variables/_quick-action-select.scss +1 -1
- package/src/style/abstracts/variables/_quick-action-switch.scss +1 -1
- package/src/style/abstracts/variables/_spacers.scss +20 -8
- package/src/style/abstracts/variables/_tables.scss +0 -18
- package/src/style/abstracts/variables/_typography.scss +4 -34
- package/src/style/base/_+import.scss +5 -0
- package/src/style/base/_body.scss +3 -0
- package/src/style/base/_collapse.scss +5 -5
- package/src/style/base/_form-control.scss +10 -0
- package/src/style/base/_form-text.scss +12 -0
- package/src/style/base/_input-group.scss +114 -0
- package/src/style/base/_label.scss +15 -0
- package/src/style/base/_pagination.scss +12 -82
- package/src/style/base/_tables.scss +1 -1
- package/src/style/components/_+import.scss +0 -2
- package/src/style/components/_d-card-account.scss +2 -2
- package/src/style/components/_d-carousel.scss +2 -2
- package/src/style/components/_d-datepicker.scss +9 -9
- package/src/style/components/_d-icon.scss +1 -1
- package/src/style/components/_d-input-pin.scss +14 -63
- package/src/style/components/_d-modal.scss +1 -1
- package/src/style/components/_d-monthpicker.scss +3 -3
- package/src/style/components/_d-offcanvas.scss +1 -1
- package/src/style/components/_d-select.scss +59 -111
- package/src/style/components/_d-stepper-desktop.scss +12 -8
- package/src/style/components/_d-stepper-mobile.scss +1 -1
- package/src/style/components/_d-tabs.scss +22 -29
- package/src/style/helpers/_+import.scss +2 -0
- package/src/style/helpers/_overlay.scss +17 -0
- package/src/style/abstracts/variables/_breadcrumb.scss +0 -15
- package/src/style/abstracts/variables/_figures.scss +0 -6
- package/src/style/abstracts/variables/_grid.scss +0 -41
- package/src/style/abstracts/variables/_popovers.scss +0 -31
- package/src/style/abstracts/variables/_spinners.scss +0 -13
- package/src/style/abstracts/variables/_thumbnails.scss +0 -10
- package/src/style/abstracts/variables/_toasts.scss +0 -19
- package/src/style/abstracts/variables/_tooltips.scss +0 -29
- package/src/style/abstracts/variables/_z-index.scss +0 -28
- package/src/style/components/_d-input-select.scss +0 -27
- package/src/style/components/_d-input.scss +0 -178
package/dist/index.js
CHANGED
|
@@ -497,7 +497,7 @@ function DInput(_a, ref) {
|
|
|
497
497
|
valid,
|
|
498
498
|
value,
|
|
499
499
|
]);
|
|
500
|
-
const labelComponent = React.useMemo(() => (jsxRuntime.jsxs("label", { htmlFor: id, children: [label, labelIcon && (jsxRuntime.jsx(DIcon, {
|
|
500
|
+
const labelComponent = React.useMemo(() => (jsxRuntime.jsxs("label", { htmlFor: id, children: [label, labelIcon && (jsxRuntime.jsx(DIcon, { icon: labelIcon, size: `var(--${PREFIX_BS}input-label-font-size)`, familyClass: labelIconFamilyClass, familyPrefix: labelIconFamilyPrefix, materialStyle: labelIconMaterialStyle }))] })), [
|
|
501
501
|
id,
|
|
502
502
|
label,
|
|
503
503
|
labelIcon,
|
|
@@ -514,11 +514,10 @@ function DInput(_a, ref) {
|
|
|
514
514
|
const { iconMap: { input } } = useDContext();
|
|
515
515
|
const invalidIcon = React.useMemo(() => invalidIconProp || input.invalid, [input.invalid, invalidIconProp]);
|
|
516
516
|
const validIcon = React.useMemo(() => validIconProp || input.valid, [input.valid, validIconProp]);
|
|
517
|
-
return (jsxRuntime.jsxs("div", { className:
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
}), children: [!!inputStart && (jsxRuntime.jsx("div", { className: "input-group-text", children: inputStart })), iconStart && (jsxRuntime.jsx("button", { type: "button", className: "input-group-text", id: `${id}Start`, onClick: handleOnIconStartClick, disabled: disabled || loading || iconStartDisabled, "aria-label": iconStartAriaLabel, tabIndex: iconStartTabIndex, children: jsxRuntime.jsx(DIcon, { className: "d-input-icon", icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix, materialStyle: iconStartMaterialStyle }) })), dynamicComponent, ((invalid || valid) && !iconEnd && !loading) && (jsxRuntime.jsx("span", { className: "input-group-text", id: `${id}State`, children: jsxRuntime.jsx(DIcon, { className: "d-input-validation-icon", icon: invalid ? invalidIcon : validIcon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle }) })), (iconEnd && !loading) && (jsxRuntime.jsx("button", { type: "button", className: "input-group-text", id: `${id}End`, onClick: handleOnIconEndClick, disabled: disabled || loading || iconEndDisabled, "aria-label": iconEndAriaLabel, tabIndex: iconEndTabIndex, children: jsxRuntime.jsx(DIcon, { className: "d-input-icon", icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix, materialStyle: iconEndMaterialStyle }) })), loading && (jsxRuntime.jsx("div", { className: "input-group-text d-input-icon", children: jsxRuntime.jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsxRuntime.jsx("span", { className: "visually-hidden", children: "Loading..." }) }) })), !!inputEnd && (jsxRuntime.jsx("div", { className: "input-group-text", children: inputEnd }))] }), hint && (jsxRuntime.jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] })] }));
|
|
517
|
+
return (jsxRuntime.jsxs("div", { className: className, style: style, children: [label && !floatingLabel && labelComponent, jsxRuntime.jsxs("div", { className: classNames({
|
|
518
|
+
'input-group': true,
|
|
519
|
+
'has-validation': invalid || valid,
|
|
520
|
+
}), children: [!!inputStart && (jsxRuntime.jsx("div", { className: "input-group-text", children: inputStart })), iconStart && (jsxRuntime.jsx("button", { type: "button", className: "input-group-text", id: `${id}Start`, onClick: handleOnIconStartClick, disabled: disabled || loading || iconStartDisabled, "aria-label": iconStartAriaLabel, tabIndex: iconStartTabIndex, children: jsxRuntime.jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix, materialStyle: iconStartMaterialStyle }) })), dynamicComponent, ((invalid || valid) && !iconEnd && !loading) && (jsxRuntime.jsx("span", { className: "input-group-text", id: `${id}State`, children: jsxRuntime.jsx(DIcon, { className: "input-group-validation-icon", icon: invalid ? invalidIcon : validIcon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle }) })), (iconEnd && !loading) && (jsxRuntime.jsx("button", { type: "button", className: "input-group-text", id: `${id}End`, onClick: handleOnIconEndClick, disabled: disabled || loading || iconEndDisabled, "aria-label": iconEndAriaLabel, tabIndex: iconEndTabIndex, children: jsxRuntime.jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix, materialStyle: iconEndMaterialStyle }) })), loading && (jsxRuntime.jsx("div", { className: "input-group-text", children: jsxRuntime.jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsxRuntime.jsx("span", { className: "visually-hidden", children: "Loading..." }) }) })), !!inputEnd && (jsxRuntime.jsx("div", { className: "input-group-text", children: inputEnd }))] }), hint && (jsxRuntime.jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] }));
|
|
522
521
|
}
|
|
523
522
|
const ForwardedDInput = React.forwardRef(DInput);
|
|
524
523
|
ForwardedDInput.displayName = 'DInput';
|
|
@@ -546,7 +545,7 @@ function DMonthPicker(_a) {
|
|
|
546
545
|
const iconPrevMonth = React.useMemo(() => iconPrevMonthProp || chevronLeft, [chevronLeft, iconPrevMonthProp]);
|
|
547
546
|
const iconNextMonth = React.useMemo(() => iconNextMonthProp || chevronRight, [chevronRight, iconNextMonthProp]);
|
|
548
547
|
const dateFormatted = React.useMemo(() => (dateFns.format(new Date(date), 'MMMM yyyy', { locale })), [date, locale]);
|
|
549
|
-
return (jsxRuntime.jsx(DatePicker, Object.assign({ showMonthYearPicker: true, selected: selected, className: className, calendarClassName: classNames('d-month-picker', calendarClassName), onChange: onChange }, locale && { locale }, { customInput: (jsxRuntime.jsx("p", { className: "fw-bold text-capitalize", children: dateFormatted })), renderCustomHeader: ({ monthDate, decreaseYear, increaseYear, prevYearButtonDisabled, nextYearButtonDisabled, }) => (jsxRuntime.jsxs("div", { className: "d-flex align-items-center justify-content-between gap-
|
|
548
|
+
return (jsxRuntime.jsx(DatePicker, Object.assign({ showMonthYearPicker: true, selected: selected, className: className, calendarClassName: classNames('d-month-picker', calendarClassName), onChange: onChange }, locale && { locale }, { customInput: (jsxRuntime.jsx("p", { className: "fw-bold text-capitalize", children: dateFormatted })), renderCustomHeader: ({ monthDate, decreaseYear, increaseYear, prevYearButtonDisabled, nextYearButtonDisabled, }) => (jsxRuntime.jsxs("div", { className: "d-flex align-items-center justify-content-between gap-6 fs-6 bg-dark", children: [jsxRuntime.jsx(DButton, { iconStart: iconPrevMonth, size: "sm", variant: "link", theme: "light", onClick: decreaseYear, disabled: prevYearButtonDisabled, ariaLabel: headerPrevYearAriaLabel, iconStartFamilyClass: iconFamilyClass, iconStartFamilyPrefix: iconFamilyPrefix }), jsxRuntime.jsx("p", { className: "fs-6 fw-bold", children: monthDate.getFullYear() }), jsxRuntime.jsx(DButton, { iconStart: iconNextMonth, size: "sm", variant: "link", theme: "light", onClick: increaseYear, disabled: nextYearButtonDisabled, ariaLabel: headerNextYearAriaLabel, iconEndFamilyClass: iconFamilyPrefix, iconEndFamilyPrefix: iconFamilyPrefix })] })) }, props)));
|
|
550
549
|
}
|
|
551
550
|
|
|
552
551
|
function DDatePickerHeader({ monthDate, changeMonth, changeYear, decreaseMonth, increaseMonth, prevMonthButtonDisabled, nextMonthButtonDisabled, withMonthSelector, iconPrevMonth, iconNextMonth, iconFamilyClass, iconFamilyPrefix, iconMaterialStyle, prevMonthAriaLabel = 'decrease month', nextMonthAriaLabel = 'increase month', iconSize, buttonVariant, buttonTheme, locale, style, className, }) {
|
|
@@ -587,44 +586,6 @@ const ForwardedDInputMask = React.forwardRef(DInputMask);
|
|
|
587
586
|
ForwardedDInputMask.displayName = 'DInputMask';
|
|
588
587
|
var DInputMask$1 = ForwardedDInputMask;
|
|
589
588
|
|
|
590
|
-
function DInputCounter(_a, ref) {
|
|
591
|
-
var { minValue, maxValue, value = minValue, invalid, iconStart: iconStartProp, iconEnd: iconEndProp, iconStartAriaLabel = 'decrease action', iconEndAriaLabel = 'increase action', style, onChange } = _a, props = tslib.__rest(_a, ["minValue", "maxValue", "value", "invalid", "iconStart", "iconEnd", "iconStartAriaLabel", "iconEndAriaLabel", "style", "onChange"]);
|
|
592
|
-
const inputRef = useProvidedRefOrCreate(ref);
|
|
593
|
-
const [internalIsInvalid, setInternalIsInvalid] = React.useState(false);
|
|
594
|
-
const [internalValue, setInternalValue] = React.useState(value);
|
|
595
|
-
React.useEffect(() => {
|
|
596
|
-
setInternalValue(value);
|
|
597
|
-
}, [value]);
|
|
598
|
-
React.useEffect(() => {
|
|
599
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(Number(internalValue));
|
|
600
|
-
}, [onChange, internalValue]);
|
|
601
|
-
const handleOnChange = React.useCallback((newValue) => {
|
|
602
|
-
setInternalValue(Number(newValue || '0'));
|
|
603
|
-
}, []);
|
|
604
|
-
const handleOnIconStartClick = React.useCallback(() => {
|
|
605
|
-
setInternalValue((prevInternalValue) => Math.max(prevInternalValue - 1, minValue));
|
|
606
|
-
}, [minValue]);
|
|
607
|
-
const handleOnIconEndClick = React.useCallback(() => {
|
|
608
|
-
setInternalValue((prevInternalValue) => Math.min(prevInternalValue + 1, maxValue));
|
|
609
|
-
}, [maxValue]);
|
|
610
|
-
const generateStyleVariables = React.useMemo(() => (Object.assign(Object.assign({}, style), { [`--${PREFIX_BS}input-component-form-control-text-align`]: 'center' })), [style]);
|
|
611
|
-
const valueString = React.useMemo(() => (internalValue.toString()), [internalValue]);
|
|
612
|
-
React.useEffect(() => {
|
|
613
|
-
setInternalIsInvalid(!(internalValue >= minValue && internalValue <= maxValue));
|
|
614
|
-
}, [internalValue, minValue, maxValue]);
|
|
615
|
-
const { iconMap: { input } } = useDContext();
|
|
616
|
-
const iconEnd = React.useMemo(() => iconEndProp || input.increase, [iconEndProp, input.increase]);
|
|
617
|
-
const iconStart = React.useMemo(() => iconStartProp || input.decrease, [iconStartProp, input.decrease]);
|
|
618
|
-
return (jsxRuntime.jsx(DInput$1, Object.assign({ ref: inputRef, value: valueString, style: generateStyleVariables, iconStart: iconStart, iconEnd: iconEnd, invalid: internalIsInvalid || invalid, type: "number", onChange: handleOnChange, onIconStartClick: handleOnIconStartClick, onIconEndClick: handleOnIconEndClick, iconStartAriaLabel: iconStartAriaLabel, iconEndAriaLabel: iconEndAriaLabel }, internalValue === minValue && {
|
|
619
|
-
iconStartDisabled: true,
|
|
620
|
-
}, internalValue === maxValue && {
|
|
621
|
-
iconEndDisabled: true,
|
|
622
|
-
}, props)));
|
|
623
|
-
}
|
|
624
|
-
const ForwardedDInputCounter = React.forwardRef(DInputCounter);
|
|
625
|
-
ForwardedDInputCounter.displayName = 'DInputCounter';
|
|
626
|
-
var DInputCounter$1 = ForwardedDInputCounter;
|
|
627
|
-
|
|
628
589
|
function formatValue(value, currencyOptions) {
|
|
629
590
|
if (value === undefined) {
|
|
630
591
|
return '';
|
|
@@ -646,17 +607,12 @@ function useInputCurrency(currencyOptions, value, onFocus, onChange, onBlur, ref
|
|
|
646
607
|
setInnerType('text');
|
|
647
608
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
648
609
|
}, [onBlur]);
|
|
649
|
-
const handleOnWheel = React.useCallback((event) => {
|
|
650
|
-
var _a;
|
|
651
|
-
event.stopPropagation();
|
|
652
|
-
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
653
|
-
}, [inputRef]);
|
|
654
610
|
const generateStyleVariables = React.useMemo(() => ({
|
|
655
611
|
[`--${PREFIX_BS}input-currency-component-symbol-color`]: `var(--${PREFIX_BS}secondary)`,
|
|
656
612
|
[`--${PREFIX_BS}input-currency-symbol-color`]: `var(--${PREFIX_BS}input-currency-component-symbol-color)`,
|
|
657
613
|
}), []);
|
|
658
614
|
const generateSymbolStyleVariables = React.useMemo(() => ({
|
|
659
|
-
color: `var(--${PREFIX_BS}
|
|
615
|
+
color: `var(--${PREFIX_BS}input-currency-symbol-color)`,
|
|
660
616
|
}), []);
|
|
661
617
|
const handleOnChange = React.useCallback((newValue) => {
|
|
662
618
|
const newNumber = (newValue === undefined || newValue === '')
|
|
@@ -687,15 +643,66 @@ function useInputCurrency(currencyOptions, value, onFocus, onChange, onBlur, ref
|
|
|
687
643
|
handleOnFocus,
|
|
688
644
|
handleOnChange,
|
|
689
645
|
handleOnBlur,
|
|
690
|
-
handleOnWheel,
|
|
691
646
|
generateStyleVariables,
|
|
692
647
|
generateSymbolStyleVariables,
|
|
693
648
|
};
|
|
694
649
|
}
|
|
695
650
|
|
|
651
|
+
function useDisableInputWheel(ref) {
|
|
652
|
+
const inputRef = useProvidedRefOrCreate(ref);
|
|
653
|
+
const handleOnWheel = React.useCallback((event) => {
|
|
654
|
+
var _a;
|
|
655
|
+
event.stopPropagation();
|
|
656
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
657
|
+
}, [inputRef]);
|
|
658
|
+
return {
|
|
659
|
+
handleOnWheel,
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
function DInputCounter(_a, ref) {
|
|
664
|
+
var { minValue, maxValue, value = minValue, invalid, iconStart: iconStartProp, iconEnd: iconEndProp, iconStartAriaLabel = 'decrease action', iconEndAriaLabel = 'increase action', style, onChange } = _a, props = tslib.__rest(_a, ["minValue", "maxValue", "value", "invalid", "iconStart", "iconEnd", "iconStartAriaLabel", "iconEndAriaLabel", "style", "onChange"]);
|
|
665
|
+
const { handleOnWheel, } = useDisableInputWheel(ref);
|
|
666
|
+
const inputRef = useProvidedRefOrCreate(ref);
|
|
667
|
+
const [internalIsInvalid, setInternalIsInvalid] = React.useState(false);
|
|
668
|
+
const [internalValue, setInternalValue] = React.useState(value);
|
|
669
|
+
React.useEffect(() => {
|
|
670
|
+
setInternalValue(value);
|
|
671
|
+
}, [value]);
|
|
672
|
+
React.useEffect(() => {
|
|
673
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(Number(internalValue));
|
|
674
|
+
}, [onChange, internalValue]);
|
|
675
|
+
const handleOnChange = React.useCallback((newValue) => {
|
|
676
|
+
setInternalValue(Number(newValue || '0'));
|
|
677
|
+
}, []);
|
|
678
|
+
const handleOnIconStartClick = React.useCallback(() => {
|
|
679
|
+
setInternalValue((prevInternalValue) => Math.max(prevInternalValue - 1, minValue));
|
|
680
|
+
}, [minValue]);
|
|
681
|
+
const handleOnIconEndClick = React.useCallback(() => {
|
|
682
|
+
setInternalValue((prevInternalValue) => Math.min(prevInternalValue + 1, maxValue));
|
|
683
|
+
}, [maxValue]);
|
|
684
|
+
const generateStyleVariables = React.useMemo(() => (Object.assign(Object.assign({}, style), { [`--${PREFIX_BS}form-control-component-text-align`]: 'center' })), [style]);
|
|
685
|
+
const valueString = React.useMemo(() => (internalValue.toString()), [internalValue]);
|
|
686
|
+
React.useEffect(() => {
|
|
687
|
+
setInternalIsInvalid(!(internalValue >= minValue && internalValue <= maxValue));
|
|
688
|
+
}, [internalValue, minValue, maxValue]);
|
|
689
|
+
const { iconMap: { input } } = useDContext();
|
|
690
|
+
const iconEnd = React.useMemo(() => iconEndProp || input.increase, [iconEndProp, input.increase]);
|
|
691
|
+
const iconStart = React.useMemo(() => iconStartProp || input.decrease, [iconStartProp, input.decrease]);
|
|
692
|
+
return (jsxRuntime.jsx(DInput$1, Object.assign({ ref: inputRef, value: valueString, style: generateStyleVariables, iconStart: iconStart, iconEnd: iconEnd, invalid: internalIsInvalid || invalid, type: "number", onChange: handleOnChange, onWheel: handleOnWheel, onIconStartClick: handleOnIconStartClick, onIconEndClick: handleOnIconEndClick, iconStartAriaLabel: iconStartAriaLabel, iconEndAriaLabel: iconEndAriaLabel }, internalValue === minValue && {
|
|
693
|
+
iconStartDisabled: true,
|
|
694
|
+
}, internalValue === maxValue && {
|
|
695
|
+
iconEndDisabled: true,
|
|
696
|
+
}, props)));
|
|
697
|
+
}
|
|
698
|
+
const ForwardedDInputCounter = React.forwardRef(DInputCounter);
|
|
699
|
+
ForwardedDInputCounter.displayName = 'DInputCounter';
|
|
700
|
+
var DInputCounter$1 = ForwardedDInputCounter;
|
|
701
|
+
|
|
696
702
|
function DInputCurrencyBase(_a, ref) {
|
|
697
703
|
var { value, minValue, maxValue, currencyOptions, currencyCode, onFocus, onBlur, onChange } = _a, inputProps = tslib.__rest(_a, ["value", "minValue", "maxValue", "currencyOptions", "currencyCode", "onFocus", "onBlur", "onChange"]);
|
|
698
|
-
const {
|
|
704
|
+
const { handleOnWheel, } = useDisableInputWheel(ref);
|
|
705
|
+
const { inputRef, innerValue, innerType, handleOnFocus, handleOnChange, handleOnBlur, generateStyleVariables, generateSymbolStyleVariables, } = useInputCurrency(currencyOptions, value, onFocus, onChange, onBlur, ref);
|
|
699
706
|
return (jsxRuntime.jsx(DInput$1, Object.assign({ ref: inputRef, value: innerValue, onChange: handleOnChange, style: generateStyleVariables, inputMode: "decimal", pattern: "^[0-9]", type: innerType, onFocus: handleOnFocus, onBlur: handleOnBlur, onWheel: handleOnWheel, inputStart: (jsxRuntime.jsx("span", { slot: "input-start", style: generateSymbolStyleVariables, children: currencyCode || currencyOptions.symbol })) }, inputProps)));
|
|
700
707
|
}
|
|
701
708
|
const ForwardedDInputCurrencyBase$1 = React.forwardRef(DInputCurrencyBase);
|
|
@@ -705,7 +712,8 @@ var DInputCurrencyBase$1 = ForwardedDInputCurrencyBase$1;
|
|
|
705
712
|
function DInputCurrency(_a, ref) {
|
|
706
713
|
var { value, minValue, maxValue, currencyCode, onFocus, onBlur, onChange } = _a, props = tslib.__rest(_a, ["value", "minValue", "maxValue", "currencyCode", "onFocus", "onBlur", "onChange"]);
|
|
707
714
|
const { currency: currencyOptions } = useDContext();
|
|
708
|
-
const {
|
|
715
|
+
const { handleOnWheel, } = useDisableInputWheel(ref);
|
|
716
|
+
const { inputRef, innerValue, innerType, handleOnFocus, handleOnChange, handleOnBlur, generateStyleVariables, generateSymbolStyleVariables, } = useInputCurrency(currencyOptions, value, onFocus, onChange, onBlur, ref);
|
|
709
717
|
return (jsxRuntime.jsx(DInput$1, Object.assign({ ref: inputRef, value: innerValue, onChange: handleOnChange, style: generateStyleVariables, inputMode: "decimal", pattern: "^[0-9]", type: innerType, onFocus: handleOnFocus, onBlur: handleOnBlur, onWheel: handleOnWheel, inputStart: (jsxRuntime.jsx("span", { slot: "input-start", style: generateSymbolStyleVariables, children: currencyCode || currencyOptions.symbol })) }, props)));
|
|
710
718
|
}
|
|
711
719
|
const ForwardedDInputCurrencyBase = React.forwardRef(DInputCurrency);
|
|
@@ -810,11 +818,11 @@ function DInputPin({ id, label = '', labelIcon, labelIconFamilyClass, labelIconF
|
|
|
810
818
|
const { iconMap: { input } } = useDContext();
|
|
811
819
|
const invalidIcon = React.useMemo(() => invalidIconProp || input.invalid, [input.invalid, invalidIconProp]);
|
|
812
820
|
const validIcon = React.useMemo(() => validIconProp || input.valid, [input.valid, validIconProp]);
|
|
813
|
-
return (jsxRuntime.jsxs("div", { className: classNames('d-input-pin', className), style: style, children: [label && (jsxRuntime.jsxs("label", { htmlFor: "pinIndex0", children: [label, labelIcon && (jsxRuntime.jsx(DIcon, {
|
|
821
|
+
return (jsxRuntime.jsxs("div", { className: classNames('d-input-pin', className), style: style, children: [label && (jsxRuntime.jsxs("label", { htmlFor: "pinIndex0", children: [label, labelIcon && (jsxRuntime.jsx(DIcon, { icon: labelIcon, size: `var(--${PREFIX_BS}input-label-font-size)`, familyClass: labelIconFamilyClass, familyPrefix: labelIconFamilyPrefix }))] })), jsxRuntime.jsxs("form", { id: id, onInput: formChange, onSubmit: preventDefaultEvent, children: [Array.from({ length: characters }).map((_, index) => (jsxRuntime.jsx("input", Object.assign({ className: classNames({
|
|
814
822
|
'form-control': true,
|
|
815
823
|
'is-invalid': invalid,
|
|
816
824
|
'is-valid': valid,
|
|
817
|
-
}), type: secret ? 'password' : type, "aria-describedby": `${id}State`, inputMode: innerInputMode, id: `pinIndex${index}`, name: `pin-${index}`, maxLength: 1, onChange: nextInput, onKeyDown: prevInput, onFocus: focusInput, onWheel: wheelInput, onClick: preventDefaultEvent, autoComplete: "off", placeholder: placeholder, disabled: disabled || loading, required: true }, type === 'number' && ({ min: 0, max: 9 })), index))), (invalid || valid) && !loading && (jsxRuntime.jsx("span", { className: "input-group-text", id: `${id}State`, children: jsxRuntime.jsx(DIcon, { className: "
|
|
825
|
+
}), type: secret ? 'password' : type, "aria-describedby": `${id}State`, inputMode: innerInputMode, id: `pinIndex${index}`, name: `pin-${index}`, maxLength: 1, onChange: nextInput, onKeyDown: prevInput, onFocus: focusInput, onWheel: wheelInput, onClick: preventDefaultEvent, autoComplete: "off", placeholder: placeholder, disabled: disabled || loading, required: true }, type === 'number' && ({ min: 0, max: 9 })), index))), (invalid || valid) && !loading && (jsxRuntime.jsx("span", { className: "input-group-text", id: `${id}State`, children: jsxRuntime.jsx(DIcon, { className: "input-group-validation-icon", icon: invalid ? invalidIcon : validIcon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix }) })), loading && (jsxRuntime.jsx("div", { className: "input-group-text", children: jsxRuntime.jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsxRuntime.jsx("span", { className: "visually-hidden", children: "Loading..." }) }) }))] }), hint && (jsxRuntime.jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] }));
|
|
818
826
|
}
|
|
819
827
|
|
|
820
828
|
function DInputSelect({ id, name, label = '', className, style, options = [], labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, disabled = false, loading = false, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconStartAriaLabel, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, iconEndAriaLabel, hint, value, floatingLabel = false, valueExtractor, labelExtractor, onChange, onBlur, onIconStartClick, onIconEndClick, }) {
|
|
@@ -877,7 +885,7 @@ function DInputSelect({ id, name, label = '', className, style, options = [], la
|
|
|
877
885
|
value,
|
|
878
886
|
floatingLabel,
|
|
879
887
|
]);
|
|
880
|
-
const labelComponent = React.useMemo(() => (jsxRuntime.jsxs("label", { htmlFor: id, children: [label, labelIcon && (jsxRuntime.jsx(DIcon, {
|
|
888
|
+
const labelComponent = React.useMemo(() => (jsxRuntime.jsxs("label", { htmlFor: id, children: [label, labelIcon && (jsxRuntime.jsx(DIcon, { icon: labelIcon, size: `var(--${PREFIX_BS}input-label-font-size)`, familyClass: labelIconFamilyClass, familyPrefix: labelIconFamilyPrefix }))] })), [
|
|
881
889
|
id,
|
|
882
890
|
label,
|
|
883
891
|
labelIcon,
|
|
@@ -890,10 +898,9 @@ function DInputSelect({ id, name, label = '', className, style, options = [], la
|
|
|
890
898
|
}
|
|
891
899
|
return selectComponent;
|
|
892
900
|
}, [floatingLabel, labelComponent, selectComponent]);
|
|
893
|
-
return (jsxRuntime.jsxs("div", { className:
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
}), children: [iconStart && (jsxRuntime.jsx("button", { type: "button", className: "input-group-text", id: `${id}Start`, onClick: iconStartClickHandler, disabled: disabled || loading, "aria-label": iconStartAriaLabel, children: iconStart && (jsxRuntime.jsx(DIcon, { className: "d-input-icon", icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix })) })), dynamicComponent, iconEnd && !loading && (jsxRuntime.jsx("button", { type: "button", className: "input-group-text", id: `${id}End`, onClick: iconEndClickHandler, disabled: disabled || loading, "aria-label": iconEndAriaLabel, children: iconEnd && (jsxRuntime.jsx(DIcon, { className: "d-input-icon", icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix })) })), loading && (jsxRuntime.jsx("div", { className: "input-group-text form-control-icon loading", children: jsxRuntime.jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsxRuntime.jsx("span", { className: "visually-hidden", children: "Loading..." }) }) }))] }), hint && (jsxRuntime.jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] })] }));
|
|
901
|
+
return (jsxRuntime.jsxs("div", { className: className, style: style, children: [label && !floatingLabel && (labelComponent), jsxRuntime.jsxs("div", { className: classNames({
|
|
902
|
+
'input-group': true,
|
|
903
|
+
}), children: [iconStart && (jsxRuntime.jsx("button", { type: "button", className: "input-group-text", id: `${id}Start`, onClick: iconStartClickHandler, disabled: disabled || loading, "aria-label": iconStartAriaLabel, children: iconStart && (jsxRuntime.jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix })) })), dynamicComponent, iconEnd && !loading && (jsxRuntime.jsx("button", { type: "button", className: "input-group-text", id: `${id}End`, onClick: iconEndClickHandler, disabled: disabled || loading, "aria-label": iconEndAriaLabel, children: iconEnd && (jsxRuntime.jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix })) })), loading && (jsxRuntime.jsx("div", { className: "input-group-text form-control-icon loading", children: jsxRuntime.jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsxRuntime.jsx("span", { className: "visually-hidden", children: "Loading..." }) }) }))] }), hint && (jsxRuntime.jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] }));
|
|
897
904
|
}
|
|
898
905
|
|
|
899
906
|
function DInputSwitch({ label, ariaLabel, id, name, checked, disabled, readonly, className, style, onChange, }) {
|
|
@@ -987,15 +994,18 @@ function DSelect(_a) {
|
|
|
987
994
|
}, [onIconEndClick, defaultValue]);
|
|
988
995
|
return (jsxRuntime.jsxs("div", { className: classNames('d-select', className, {
|
|
989
996
|
disabled: disabled || loading,
|
|
990
|
-
}), style: style, children: [label && (jsxRuntime.jsxs("label", { htmlFor: id, children: [label, labelIcon && (jsxRuntime.jsx(DIcon, {
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
997
|
+
}), style: style, children: [label && (jsxRuntime.jsxs("label", { htmlFor: id, children: [label, labelIcon && (jsxRuntime.jsx(DIcon, { icon: labelIcon, size: `var(--${PREFIX_BS}input-label-font-size)`, familyClass: labelIconFamilyClass, familyPrefix: labelIconFamilyPrefix }))] })), jsxRuntime.jsxs("div", { className: classNames({
|
|
998
|
+
'input-group': true,
|
|
999
|
+
'has-validation': invalid,
|
|
1000
|
+
disabled: disabled || loading,
|
|
1001
|
+
}), children: [iconStart && (jsxRuntime.jsx("button", { type: "button", className: "input-group-text", id: `${id}Start`, onClick: handleOnIconStartClick, disabled: disabled || loading, "aria-label": iconStartAriaLabel, tabIndex: iconStartTabIndex, children: jsxRuntime.jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix }) })), jsxRuntime.jsx(Select, Object.assign({ styles: {
|
|
1002
|
+
control: (base) => (Object.assign(Object.assign({}, base), { minHeight: 'unset' })),
|
|
1003
|
+
container: (base) => (Object.assign(Object.assign({}, base), { flex: 1 })),
|
|
1004
|
+
menu: (base) => (Object.assign(Object.assign({}, base), { width: menuWithMaxContent ? 'max-context' : '100%' })),
|
|
1005
|
+
}, className: classNames('d-select-component', {
|
|
1006
|
+
'is-invalid': invalid,
|
|
1007
|
+
'is-valid': valid,
|
|
1008
|
+
}), 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)), ((invalid || valid) && !iconEnd && !loading) && (jsxRuntime.jsx("span", { className: "input-group-text", id: `${id}State`, children: jsxRuntime.jsx(DIcon, { className: "input-group-validation-icon", icon: invalid ? 'exclamation-circle' : 'check', familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix }) })), (iconEnd && !loading) && (jsxRuntime.jsx("button", { type: "button", className: "input-group-text", id: `${id}End`, onClick: handleOnIconEndClick, disabled: disabled || loading, "aria-label": iconEndAriaLabel, tabIndex: iconEndTabIndex, children: iconEnd && (jsxRuntime.jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix })) }))] }), hint && (jsxRuntime.jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] }));
|
|
999
1009
|
}
|
|
1000
1010
|
var DSelect$1 = Object.assign(DSelect, {
|
|
1001
1011
|
OptionCheck: DSelectOptionCheck,
|
|
@@ -1105,7 +1115,7 @@ var DOffcanvas$1 = Object.assign(DOffcanvas, {
|
|
|
1105
1115
|
|
|
1106
1116
|
function DPaginator(_a) {
|
|
1107
1117
|
var { className, nextLabel, previousLabel, showArrows = true, page, onPageChange } = _a, props = tslib.__rest(_a, ["className", "nextLabel", "previousLabel", "showArrows", "page", "onPageChange"]);
|
|
1108
|
-
return (jsxRuntime.jsx(ResponsivePagination, Object.assign({ extraClassName:
|
|
1118
|
+
return (jsxRuntime.jsx(ResponsivePagination, Object.assign({ extraClassName: className, nextLabel: nextLabel, previousLabel: previousLabel, renderNav: showArrows, current: page, onPageChange: onPageChange }, props)));
|
|
1109
1119
|
}
|
|
1110
1120
|
|
|
1111
1121
|
function DPopover({ children, renderComponent, open, setOpen, adjustContentToRender = false, className, style, }) {
|
|
@@ -1333,7 +1343,7 @@ function DTabContent({ tab, children, className, style, }) {
|
|
|
1333
1343
|
return (jsxRuntime.jsx("div", { className: classNames('tab-pane fade show active', className), id: `${tab}Pane`, role: "tabpanel", tabIndex: 0, "aria-labelledby": `${tab}Tab`, style: style, children: children }));
|
|
1334
1344
|
}
|
|
1335
1345
|
|
|
1336
|
-
function DTabs({ children, defaultSelected, onChange, options, className, style, vertical,
|
|
1346
|
+
function DTabs({ children, defaultSelected, onChange, options, className, style, vertical, variant = 'underline', }) {
|
|
1337
1347
|
const [selected, setSelected] = React.useState(defaultSelected);
|
|
1338
1348
|
const onSelect = React.useCallback((option) => {
|
|
1339
1349
|
if (option.tab) {
|
|
@@ -1348,13 +1358,13 @@ function DTabs({ children, defaultSelected, onChange, options, className, style,
|
|
|
1348
1358
|
const value = React.useMemo(() => ({
|
|
1349
1359
|
isSelected,
|
|
1350
1360
|
}), [isSelected]);
|
|
1351
|
-
const generateClasses = React.useMemo(() => (Object.assign({ nav: true, 'flex-column align-items-center': vertical
|
|
1361
|
+
const generateClasses = React.useMemo(() => (Object.assign({ nav: true, 'flex-column align-items-center': vertical && variant !== 'tabs', [`nav-${variant}`]: true }, className && { [className]: true })), [vertical, variant, className]);
|
|
1352
1362
|
return (jsxRuntime.jsx(TabContext.Provider, { value: value, children: jsxRuntime.jsxs("div", { className: classNames({
|
|
1353
|
-
'd-flex': true,
|
|
1354
|
-
'flex-column': !vertical,
|
|
1355
|
-
}
|
|
1363
|
+
'd-flex w-100': true,
|
|
1364
|
+
'flex-column': !vertical || variant === 'tabs',
|
|
1365
|
+
}), style: style, children: [jsxRuntime.jsx("nav", { className: classNames(generateClasses), children: options.map((option) => (jsxRuntime.jsx("button", { id: `${option.tab}Tab`, className: classNames('nav-link', {
|
|
1356
1366
|
active: option.tab === selected,
|
|
1357
|
-
}, className), type: "button", role: "tab", "aria-controls": `${option.tab}Pane`, "aria-selected": option.tab === selected, disabled: option.disabled, onClick: () => onSelect(option), children: option.label }, option.label))) }), jsxRuntime.jsx("div", { className: "tab-content", children: children })] }) }));
|
|
1367
|
+
}, className), type: "button", role: "tab", "aria-controls": `${option.tab}Pane`, "aria-selected": option.tab === selected, disabled: option.disabled, onClick: () => onSelect(option), children: option.label }, option.label))) }), jsxRuntime.jsx("div", { className: "tab-content w-100", children: children })] }) }));
|
|
1358
1368
|
}
|
|
1359
1369
|
var DTabs$1 = Object.assign(DTabs, {
|
|
1360
1370
|
Tab: DTabContent,
|
|
@@ -1456,6 +1466,7 @@ exports.useDContext = useDContext;
|
|
|
1456
1466
|
exports.useDModalContext = useDModalContext;
|
|
1457
1467
|
exports.useDOffcanvasContext = useDOffcanvasContext;
|
|
1458
1468
|
exports.useDisableBodyScrollEffect = useDisableBodyScrollEffect;
|
|
1469
|
+
exports.useDisableInputWheel = useDisableInputWheel;
|
|
1459
1470
|
exports.useFormatCurrency = useFormatCurrency;
|
|
1460
1471
|
exports.useInputCurrency = useInputCurrency;
|
|
1461
1472
|
exports.usePortal = usePortal;
|