@dynamic-framework/ui-react 1.25.0 → 1.26.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 +46 -31
- package/dist/css/dynamic-ui-non-root.min.css +2 -2
- package/dist/css/dynamic-ui-root.css +1 -1
- package/dist/css/dynamic-ui-root.min.css +1 -1
- package/dist/css/dynamic-ui.css +46 -31
- package/dist/css/dynamic-ui.min.css +2 -2
- package/dist/index.esm.js +124 -22
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +122 -18
- package/dist/index.js.map +1 -1
- package/dist/types/components/DInputCheck/DInputCheck.d.ts +2 -2
- package/dist/types/components/DInputPin/DInputPin.d.ts +2 -2
- package/dist/types/components/DInputRange/DInputRange.d.ts +8 -0
- package/dist/types/components/DInputRange/index.d.ts +2 -0
- package/dist/types/components/DInputSelect/DInputSelect.d.ts +5 -3
- package/dist/types/components/DInputSwitch/DInputSwitch.d.ts +2 -2
- package/dist/types/components/DQuickActionCheck/DQuickActionCheck.d.ts +2 -2
- package/dist/types/components/DQuickActionSelect/DQuickActionSelect.d.ts +2 -2
- package/dist/types/components/DQuickActionSwitch/DQuickActionSwitch.d.ts +2 -2
- package/dist/types/components/DTabs/DTabs.d.ts +2 -1
- package/dist/types/components/DToast/DToast.d.ts +11 -0
- package/dist/types/components/DToast/components/DToastBody.d.ts +5 -0
- package/dist/types/components/DToast/components/DToastHeader.d.ts +5 -0
- package/dist/types/components/DToast/index.d.ts +4 -0
- package/dist/types/components/index.d.ts +2 -0
- package/package.json +2 -3
- package/src/style/abstracts/variables/_+import.scss +2 -1
- package/src/style/abstracts/variables/_forms.scss +5 -1
- package/src/style/base/_+import.scss +1 -0
- package/src/style/base/_form-range.scss +52 -0
- package/src/style/base/_input-group.scss +1 -1
- package/src/style/components/_d-select.scss +2 -0
package/dist/index.js
CHANGED
|
@@ -438,8 +438,10 @@ function useProvidedRefOrCreate(providedRef) {
|
|
|
438
438
|
}
|
|
439
439
|
|
|
440
440
|
function DInput(_a, ref) {
|
|
441
|
-
var { id, 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, invalidIcon: invalidIconProp, validIcon: validIconProp, hint, invalid = false, valid = false, floatingLabel = false, inputStart, inputEnd, value, placeholder = '', onChange, onIconStartClick, onIconEndClick } = _a, inputProps = tslib.__rest(_a, ["id", "style", "className", "label", "labelIcon", "labelIconFamilyClass", "labelIconFamilyPrefix", "labelIconMaterialStyle", "disabled", "loading", "iconFamilyClass", "iconFamilyPrefix", "iconMaterialStyle", "iconStart", "iconStartDisabled", "iconStartFamilyClass", "iconStartFamilyPrefix", "iconStartAriaLabel", "iconStartTabIndex", "iconStartMaterialStyle", "iconEnd", "iconEndDisabled", "iconEndFamilyClass", "iconEndFamilyPrefix", "iconEndAriaLabel", "iconEndTabIndex", "iconEndMaterialStyle", "invalidIcon", "validIcon", "hint", "invalid", "valid", "floatingLabel", "inputStart", "inputEnd", "value", "placeholder", "onChange", "onIconStartClick", "onIconEndClick"]);
|
|
441
|
+
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, invalidIcon: invalidIconProp, validIcon: validIconProp, hint, invalid = false, valid = false, floatingLabel = false, inputStart, inputEnd, value, placeholder = '', onChange, onIconStartClick, onIconEndClick } = _a, inputProps = tslib.__rest(_a, ["id", "style", "className", "label", "labelIcon", "labelIconFamilyClass", "labelIconFamilyPrefix", "labelIconMaterialStyle", "disabled", "loading", "iconFamilyClass", "iconFamilyPrefix", "iconMaterialStyle", "iconStart", "iconStartDisabled", "iconStartFamilyClass", "iconStartFamilyPrefix", "iconStartAriaLabel", "iconStartTabIndex", "iconStartMaterialStyle", "iconEnd", "iconEndDisabled", "iconEndFamilyClass", "iconEndFamilyPrefix", "iconEndAriaLabel", "iconEndTabIndex", "iconEndMaterialStyle", "invalidIcon", "validIcon", "hint", "invalid", "valid", "floatingLabel", "inputStart", "inputEnd", "value", "placeholder", "onChange", "onIconStartClick", "onIconEndClick"]);
|
|
442
442
|
const inputRef = useProvidedRefOrCreate(ref);
|
|
443
|
+
const innerId = React.useId();
|
|
444
|
+
const id = React.useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
443
445
|
const handleOnChange = React.useCallback((event) => {
|
|
444
446
|
onChange === null || onChange === void 0 ? void 0 : onChange(event.currentTarget.value);
|
|
445
447
|
}, [onChange]);
|
|
@@ -450,12 +452,26 @@ function DInput(_a, ref) {
|
|
|
450
452
|
onIconEndClick === null || onIconEndClick === void 0 ? void 0 : onIconEndClick(value);
|
|
451
453
|
}, [onIconEndClick, value]);
|
|
452
454
|
const ariaDescribedby = React.useMemo(() => ([
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
iconEnd && `${id}
|
|
455
|
+
!!inputStart && `${id}InputStart`,
|
|
456
|
+
!!iconStart && `${id}Start`,
|
|
457
|
+
(invalid || valid) && !iconEnd && !loading && `${id}State`,
|
|
458
|
+
(iconEnd && !loading) && `${id}End`,
|
|
459
|
+
loading && `${id}Loading`,
|
|
460
|
+
!!inputEnd && `${id}InputEnd`,
|
|
461
|
+
!!hint && `${id}Hint`,
|
|
456
462
|
]
|
|
457
463
|
.filter(Boolean)
|
|
458
|
-
.join(' ')), [
|
|
464
|
+
.join(' ')), [
|
|
465
|
+
id,
|
|
466
|
+
inputStart,
|
|
467
|
+
iconStart,
|
|
468
|
+
invalid,
|
|
469
|
+
valid,
|
|
470
|
+
iconEnd,
|
|
471
|
+
loading,
|
|
472
|
+
inputEnd,
|
|
473
|
+
hint,
|
|
474
|
+
]);
|
|
459
475
|
const inputComponent = React.useMemo(() => (jsxRuntime.jsx("input", Object.assign({ ref: inputRef, id: id, className: classNames('form-control', {
|
|
460
476
|
'is-invalid': invalid,
|
|
461
477
|
'is-valid': valid,
|
|
@@ -493,7 +509,7 @@ function DInput(_a, ref) {
|
|
|
493
509
|
return (jsxRuntime.jsxs("div", { className: className, style: style, children: [label && !floatingLabel && labelComponent, jsxRuntime.jsxs("div", { className: classNames({
|
|
494
510
|
'input-group': true,
|
|
495
511
|
'has-validation': invalid || valid,
|
|
496
|
-
}), 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: onIconStartClick ? iconStartTabIndex : -1, 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: onIconEndClick ? iconEndTabIndex : -1, 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 }))] }));
|
|
512
|
+
}), children: [!!inputStart && (jsxRuntime.jsx("div", { className: "input-group-text", id: `${id}InputStart`, children: inputStart })), iconStart && (jsxRuntime.jsx("button", { type: "button", className: "input-group-text", id: `${id}Start`, onClick: handleOnIconStartClick, disabled: disabled || loading || iconStartDisabled, "aria-label": iconStartAriaLabel, tabIndex: onIconStartClick ? iconStartTabIndex : -1, children: jsxRuntime.jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix, materialStyle: iconStartMaterialStyle }) })), dynamicComponent, ((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: onIconEndClick ? iconEndTabIndex : -1, children: jsxRuntime.jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix, materialStyle: iconEndMaterialStyle }) })), loading && (jsxRuntime.jsx("div", { className: "input-group-text", id: `${id}Loading`, children: jsxRuntime.jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsxRuntime.jsx("span", { className: "visually-hidden", children: "Loading..." }) }) })), !!inputEnd && (jsxRuntime.jsx("div", { className: "input-group-text", id: `${id}InputEnd`, children: inputEnd }))] }), hint && (jsxRuntime.jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] }));
|
|
497
513
|
}
|
|
498
514
|
const ForwardedDInput = React.forwardRef(DInput);
|
|
499
515
|
ForwardedDInput.displayName = 'DInput';
|
|
@@ -514,8 +530,10 @@ const ForwardedDDatePickerInput = React.forwardRef(DDatePickerInput);
|
|
|
514
530
|
ForwardedDDatePickerInput.displayName = 'DDatePickerInput';
|
|
515
531
|
var DDatePickerInput$1 = ForwardedDDatePickerInput;
|
|
516
532
|
|
|
517
|
-
function DInputCheck({ type, name, label, ariaLabel, checked = false,
|
|
533
|
+
function DInputCheck({ id: idProp, type, name, label, ariaLabel, checked = false, disabled = false, indeterminate, value, onChange, className, style, }) {
|
|
518
534
|
const innerRef = React.useRef(null);
|
|
535
|
+
const innerId = React.useId();
|
|
536
|
+
const id = React.useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
519
537
|
const handleChange = React.useCallback((event) => {
|
|
520
538
|
onChange === null || onChange === void 0 ? void 0 : onChange(event);
|
|
521
539
|
}, [onChange]);
|
|
@@ -529,10 +547,21 @@ function DInputCheck({ type, name, label, ariaLabel, checked = false, id, disabl
|
|
|
529
547
|
innerRef.current.checked = checked;
|
|
530
548
|
}
|
|
531
549
|
}, [checked]);
|
|
550
|
+
const inputComponent = React.useMemo(() => (jsxRuntime.jsx("input", { ref: innerRef, onChange: handleChange, className: classNames('form-check-input', className), style: style, id: id, disabled: disabled, type: type, name: name, value: value, "aria-label": ariaLabel })), [
|
|
551
|
+
ariaLabel,
|
|
552
|
+
className,
|
|
553
|
+
disabled,
|
|
554
|
+
handleChange,
|
|
555
|
+
id,
|
|
556
|
+
name,
|
|
557
|
+
style,
|
|
558
|
+
type,
|
|
559
|
+
value,
|
|
560
|
+
]);
|
|
532
561
|
if (!label) {
|
|
533
|
-
return
|
|
562
|
+
return inputComponent;
|
|
534
563
|
}
|
|
535
|
-
return (jsxRuntime.jsxs("div", { className: "form-check", children: [
|
|
564
|
+
return (jsxRuntime.jsxs("div", { className: "form-check", children: [inputComponent, jsxRuntime.jsx("label", { className: "form-check-label", htmlFor: id, children: label })] }));
|
|
536
565
|
}
|
|
537
566
|
|
|
538
567
|
function DSelectOptionCheck(_a) {
|
|
@@ -850,7 +879,9 @@ const ForwardedDInputPassword = React.forwardRef(DInputPassword);
|
|
|
850
879
|
ForwardedDInputPassword.displayName = 'DInputPassword';
|
|
851
880
|
var DInputPassword$1 = ForwardedDInputPassword;
|
|
852
881
|
|
|
853
|
-
function DInputPin({ id, label = '', labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, placeholder, type = 'text', disabled = false, loading = false, secret = false, iconFamilyClass, iconFamilyPrefix, characters = 4, invalidIcon: invalidIconProp, validIcon: validIconProp, innerInputMode = 'text', hint, invalid = false, valid = false, className, style, onChange, }) {
|
|
882
|
+
function DInputPin({ id: idProp, label = '', labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, placeholder, type = 'text', disabled = false, loading = false, secret = false, iconFamilyClass, iconFamilyPrefix, characters = 4, invalidIcon: invalidIconProp, validIcon: validIconProp, innerInputMode = 'text', hint, invalid = false, valid = false, className, style, onChange, }) {
|
|
883
|
+
const innerId = React.useId();
|
|
884
|
+
const id = React.useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
854
885
|
const [pattern, setPattern] = React.useState('');
|
|
855
886
|
const [activeInput, setActiveInput] = React.useState(Array.from({ length: characters }).fill(''));
|
|
856
887
|
const isInputNum = React.useMemo(() => type === 'number' || type === 'tel', [type]);
|
|
@@ -925,7 +956,9 @@ function DInputPin({ id, label = '', labelIcon, labelIconFamilyClass, labelIconF
|
|
|
925
956
|
}), 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))), (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 }))] }));
|
|
926
957
|
}
|
|
927
958
|
|
|
928
|
-
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, }) {
|
|
959
|
+
function DInputSelect({ id: idProp, name, label = '', className, style, options = [], labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, disabled = false, loading = false, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconStartAriaLabel, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, iconEndAriaLabel, iconFamilyClass, iconFamilyPrefix, iconMaterialStyle, invalidIcon: invalidIconProp, validIcon: validIconProp, hint, value, floatingLabel = false, invalid = false, valid = false, valueExtractor, labelExtractor, onChange, onBlur, onIconStartClick, onIconEndClick, }) {
|
|
960
|
+
const innerId = React.useId();
|
|
961
|
+
const id = React.useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
929
962
|
const internalValueExtractor = React.useCallback((option) => {
|
|
930
963
|
if (valueExtractor) {
|
|
931
964
|
return valueExtractor(option);
|
|
@@ -960,6 +993,9 @@ function DInputSelect({ id, name, label = '', className, style, options = [], la
|
|
|
960
993
|
const iconEndClickHandler = React.useCallback((event) => {
|
|
961
994
|
onIconEndClick === null || onIconEndClick === void 0 ? void 0 : onIconEndClick(event);
|
|
962
995
|
}, [onIconEndClick]);
|
|
996
|
+
const { iconMap: { input } } = useDContext();
|
|
997
|
+
const invalidIcon = React.useMemo(() => invalidIconProp || input.invalid, [input.invalid, invalidIconProp]);
|
|
998
|
+
const validIcon = React.useMemo(() => validIconProp || input.valid, [input.valid, validIconProp]);
|
|
963
999
|
const ariaDescribedby = React.useMemo(() => ([
|
|
964
1000
|
iconStart && `${id}Start`,
|
|
965
1001
|
hint && `${id}Hint`,
|
|
@@ -970,6 +1006,8 @@ function DInputSelect({ id, name, label = '', className, style, options = [], la
|
|
|
970
1006
|
const selectComponent = React.useMemo(() => (jsxRuntime.jsx("select", Object.assign({ id: id, name: name, className: classNames({
|
|
971
1007
|
'form-select': true,
|
|
972
1008
|
'floating-label': floatingLabel,
|
|
1009
|
+
'is-invalid': invalid,
|
|
1010
|
+
'is-valid': valid,
|
|
973
1011
|
}), "aria-label": label, disabled: disabled || loading, onChange: changeHandler, onBlur: blurHandler }, ariaDescribedby && { 'aria-describedby': ariaDescribedby }, value && { value }, { children: options.map((option) => (jsxRuntime.jsx("option", { value: internalValueExtractor(option), children: internalLabelExtractor(option) }, internalValueExtractor(option)))) }))), [
|
|
974
1012
|
ariaDescribedby,
|
|
975
1013
|
blurHandler,
|
|
@@ -984,6 +1022,8 @@ function DInputSelect({ id, name, label = '', className, style, options = [], la
|
|
|
984
1022
|
options,
|
|
985
1023
|
value,
|
|
986
1024
|
floatingLabel,
|
|
1025
|
+
invalid,
|
|
1026
|
+
valid,
|
|
987
1027
|
]);
|
|
988
1028
|
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 }))] })), [
|
|
989
1029
|
id,
|
|
@@ -1000,10 +1040,12 @@ function DInputSelect({ id, name, label = '', className, style, options = [], la
|
|
|
1000
1040
|
}, [floatingLabel, labelComponent, selectComponent]);
|
|
1001
1041
|
return (jsxRuntime.jsxs("div", { className: className, style: style, children: [label && !floatingLabel && (labelComponent), jsxRuntime.jsxs("div", { className: classNames({
|
|
1002
1042
|
'input-group': true,
|
|
1003
|
-
}), 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 }))] }));
|
|
1043
|
+
}), 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, ((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: 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 }))] }));
|
|
1004
1044
|
}
|
|
1005
1045
|
|
|
1006
|
-
function DInputSwitch({ label, ariaLabel,
|
|
1046
|
+
function DInputSwitch({ id: idProp, label, ariaLabel, name, checked, disabled, readonly, className, style, onChange, }) {
|
|
1047
|
+
const innerId = React.useId();
|
|
1048
|
+
const id = React.useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
1007
1049
|
const [internalIsChecked, setInternalIsChecked] = React.useState(checked);
|
|
1008
1050
|
React.useEffect(() => {
|
|
1009
1051
|
setInternalIsChecked(checked);
|
|
@@ -1016,6 +1058,44 @@ function DInputSwitch({ label, ariaLabel, id, name, checked, disabled, readonly,
|
|
|
1016
1058
|
return (jsxRuntime.jsxs("div", { className: "form-check form-switch", children: [jsxRuntime.jsx("input", { id: id, name: name, onChange: readonly ? () => false : changeHandler, className: classNames('form-check-input', className), style: style, type: "checkbox", role: "switch", checked: internalIsChecked, disabled: disabled, "aria-label": ariaLabel }), label && (jsxRuntime.jsx("label", { className: "form-check-label", htmlFor: id, children: label }))] }));
|
|
1017
1059
|
}
|
|
1018
1060
|
|
|
1061
|
+
function DInputRange(_a, ref) {
|
|
1062
|
+
var { id: idProp, label, ariaLabel, className, style, value = '0', min = '0', max = '100', filledValue = true, onChange } = _a, props = tslib.__rest(_a, ["id", "label", "ariaLabel", "className", "style", "value", "min", "max", "filledValue", "onChange"]);
|
|
1063
|
+
const innerRef = useProvidedRefOrCreate(ref);
|
|
1064
|
+
const innerId = React.useId();
|
|
1065
|
+
const id = React.useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
1066
|
+
const generateClasses = React.useMemo(() => ({
|
|
1067
|
+
'form-range': true,
|
|
1068
|
+
'form-range-value-indicator': filledValue,
|
|
1069
|
+
}), [filledValue]);
|
|
1070
|
+
const generateStyleVariables = React.useMemo(() => {
|
|
1071
|
+
const minNumber = parseFloat(min.toString());
|
|
1072
|
+
const maxNumber = parseFloat(max.toString());
|
|
1073
|
+
const valueNumber = parseFloat(value.toString());
|
|
1074
|
+
const percentage = ((valueNumber - minNumber) / (maxNumber - minNumber)) * 100;
|
|
1075
|
+
return Object.assign(Object.assign({}, style), { [`--${PREFIX_BS}form-range-component-value`]: `${percentage}%` });
|
|
1076
|
+
}, [min, max, value, style]);
|
|
1077
|
+
const inputComponent = React.useMemo(() => (jsxRuntime.jsx("input", Object.assign({ id: id, ref: innerRef, className: classNames(generateClasses, className), "aria-label": ariaLabel, type: "range", value: value, min: min, max: max, style: generateStyleVariables, onChange: onChange }, props))), [
|
|
1078
|
+
ariaLabel,
|
|
1079
|
+
className,
|
|
1080
|
+
generateClasses,
|
|
1081
|
+
generateStyleVariables,
|
|
1082
|
+
id,
|
|
1083
|
+
innerRef,
|
|
1084
|
+
max,
|
|
1085
|
+
min,
|
|
1086
|
+
onChange,
|
|
1087
|
+
props,
|
|
1088
|
+
value,
|
|
1089
|
+
]);
|
|
1090
|
+
if (!label) {
|
|
1091
|
+
return inputComponent;
|
|
1092
|
+
}
|
|
1093
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("label", { className: "form-label", htmlFor: id, children: label }), inputComponent] }));
|
|
1094
|
+
}
|
|
1095
|
+
const ForwardedDInputRange = React.forwardRef(DInputRange);
|
|
1096
|
+
ForwardedDInputRange.displayName = 'DInputRange';
|
|
1097
|
+
var DInputRange$1 = ForwardedDInputRange;
|
|
1098
|
+
|
|
1019
1099
|
function DListItem({ children, className, style, active = false, disabled = false, theme, onClick, }) {
|
|
1020
1100
|
const Tag = React.useMemo(() => (onClick ? 'button' : 'div'), [onClick]);
|
|
1021
1101
|
return (jsxRuntime.jsx(Tag, Object.assign({}, Tag === 'button' && {
|
|
@@ -1184,7 +1264,9 @@ function DQuickActionButton({ line1, line2, className, actionLinkText, actionLin
|
|
|
1184
1264
|
: `var(--${PREFIX_BS}quick-action-button-representative-image-size)`, icon: representativeIcon, hasCircle: representativeIconHasCircle, theme: representativeIconTheme, familyClass: representativeIconFamilyClass, familyPrefix: representativeIconFamilyPrefix })), representativeImage && (jsxRuntime.jsx("img", { className: "d-quick-action-button-representative-image", src: representativeImage, alt: "" })), jsxRuntime.jsx("div", { className: "d-quick-action-button-content", children: jsxRuntime.jsxs("div", { className: "d-quick-action-button-text", children: [jsxRuntime.jsx("span", { className: "d-quick-action-button-line1", children: line1 }), jsxRuntime.jsx("small", { className: "d-quick-action-button-line2", children: line2 })] }) }), secondaryActionIcon && (jsxRuntime.jsx(DButton, { className: "d-quick-action-button-secondary-action-link", type: "button", variant: "link", iconStart: secondaryActionIcon, ariaLabel: secondaryActionAriaLabel, iconStartFamilyClass: actionIconFamilyClass, iconStartFamilyPrefix: actionIconFamilyPrefix, theme: actionLinkTheme, onClick: secondaryActionLinkClickHandler, stopPropagationEnabled: true })), actionLinkText && !actionIcon && (jsxRuntime.jsx(DButton, { className: "d-quick-action-button-action-link", type: "button", variant: "link", theme: actionLinkTheme, text: actionLinkText, onClick: actionLinkClickHandler, stopPropagationEnabled: true })), actionIcon && !actionLinkText && (jsxRuntime.jsx(DIcon, { className: "d-quick-action-button-action-icon", icon: actionIcon, size: `var(--${PREFIX_BS}quick-action-button-action-icon-size)`, familyClass: actionIconFamilyClass, familyPrefix: actionIconFamilyPrefix }))] }));
|
|
1185
1265
|
}
|
|
1186
1266
|
|
|
1187
|
-
function DQuickActionCheck({ id, name, value, line1, line2, line3, className, style, checked, onChange, }) {
|
|
1267
|
+
function DQuickActionCheck({ id: idProp, name, value, line1, line2, line3, className, style, checked, onChange, }) {
|
|
1268
|
+
const innerId = React.useId();
|
|
1269
|
+
const id = React.useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
1188
1270
|
const changeHandler = React.useCallback((event) => {
|
|
1189
1271
|
event.stopPropagation();
|
|
1190
1272
|
onChange === null || onChange === void 0 ? void 0 : onChange(event);
|
|
@@ -1192,8 +1274,10 @@ function DQuickActionCheck({ id, name, value, line1, line2, line3, className, st
|
|
|
1192
1274
|
return (jsxRuntime.jsxs("label", { className: classNames('d-quick-action-check', className), htmlFor: id, style: style, children: [jsxRuntime.jsx(DInputCheck, { id: id, type: "radio", name: name, value: value, checked: checked, onChange: changeHandler }), jsxRuntime.jsxs("div", { className: "d-quick-action-check-detail", children: [jsxRuntime.jsx("span", { className: "d-quick-action-check-line1", children: line1 }), jsxRuntime.jsx("span", { className: "d-quick-action-check-line2", children: line2 })] }), jsxRuntime.jsx("span", { className: "d-quick-action-check-line3", children: line3 })] }));
|
|
1193
1275
|
}
|
|
1194
1276
|
|
|
1195
|
-
function DQuickActionSelect({ id, name, value, line1, line2, className, style, selected = false, onChange, }) {
|
|
1277
|
+
function DQuickActionSelect({ id: idProp, name, value, line1, line2, className, style, selected = false, onChange, }) {
|
|
1196
1278
|
const innerRef = React.useRef(null);
|
|
1279
|
+
const innerId = React.useId();
|
|
1280
|
+
const id = React.useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
1197
1281
|
const changeHandler = React.useCallback((event) => {
|
|
1198
1282
|
event.stopPropagation();
|
|
1199
1283
|
onChange === null || onChange === void 0 ? void 0 : onChange(event);
|
|
@@ -1206,7 +1290,9 @@ function DQuickActionSelect({ id, name, value, line1, line2, className, style, s
|
|
|
1206
1290
|
return (jsxRuntime.jsxs("label", { className: classNames('d-quick-action-select', className), htmlFor: id, style: style, children: [jsxRuntime.jsx("input", { ref: innerRef, id: id, type: "radio", name: name, value: value, onChange: changeHandler }), jsxRuntime.jsx("span", { className: "d-quick-action-select-line1", children: line1 }), jsxRuntime.jsx("span", { className: "d-quick-action-select-line2", children: line2 })] }));
|
|
1207
1291
|
}
|
|
1208
1292
|
|
|
1209
|
-
function DQuickActionSwitch({ id, name, label, hint, checked, disabled, className, style, onClick, }) {
|
|
1293
|
+
function DQuickActionSwitch({ id: idProp, name, label, hint, checked, disabled, className, style, onClick, }) {
|
|
1294
|
+
const innerId = React.useId();
|
|
1295
|
+
const id = React.useMemo(() => idProp || innerId, [idProp, innerId]);
|
|
1210
1296
|
const clickHandler = React.useCallback((event) => {
|
|
1211
1297
|
event.stopPropagation();
|
|
1212
1298
|
onClick === null || onClick === void 0 ? void 0 : onClick(checked);
|
|
@@ -1339,7 +1425,7 @@ function DTabContent({ tab, children, className, style, }) {
|
|
|
1339
1425
|
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 }));
|
|
1340
1426
|
}
|
|
1341
1427
|
|
|
1342
|
-
function DTabs({ children, defaultSelected, onChange, options, className, style, vertical, variant = 'underline', }) {
|
|
1428
|
+
function DTabs({ children, defaultSelected, onChange, options, className, classNameTab, style, vertical, variant = 'underline', }) {
|
|
1343
1429
|
const [selected, setSelected] = React.useState(defaultSelected);
|
|
1344
1430
|
const onSelect = React.useCallback((option) => {
|
|
1345
1431
|
if (option.tab) {
|
|
@@ -1360,12 +1446,28 @@ function DTabs({ children, defaultSelected, onChange, options, className, style,
|
|
|
1360
1446
|
'flex-column': !vertical || variant === 'tabs',
|
|
1361
1447
|
}), style: style, children: [jsxRuntime.jsx("nav", { className: classNames(generateClasses), children: options.map((option) => (jsxRuntime.jsx("button", { id: `${option.tab}Tab`, className: classNames('nav-link', {
|
|
1362
1448
|
active: option.tab === selected,
|
|
1363
|
-
},
|
|
1449
|
+
}, classNameTab), 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 })] }) }));
|
|
1364
1450
|
}
|
|
1365
1451
|
var DTabs$1 = Object.assign(DTabs, {
|
|
1366
1452
|
Tab: DTabContent,
|
|
1367
1453
|
});
|
|
1368
1454
|
|
|
1455
|
+
function DToastHeader({ children, className, style }) {
|
|
1456
|
+
return (jsxRuntime.jsx("div", { className: classNames('toast-header', className), style: style, children: children }));
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
function DToastBody({ children, className, style }) {
|
|
1460
|
+
return (jsxRuntime.jsx("div", { className: classNames('toast-body', className), style: style, children: children }));
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
function DToast({ children, className, style }) {
|
|
1464
|
+
return (jsxRuntime.jsx("div", { className: classNames('toast', className), role: "alert", "aria-live": "assertive", "aria-atomic": "true", style: style, children: children }));
|
|
1465
|
+
}
|
|
1466
|
+
var DToast$1 = Object.assign(DToast, {
|
|
1467
|
+
Header: DToastHeader,
|
|
1468
|
+
Body: DToastBody,
|
|
1469
|
+
});
|
|
1470
|
+
|
|
1369
1471
|
const TOAST_TRANSITIONS$1 = {
|
|
1370
1472
|
bounce: reactToastify.Bounce,
|
|
1371
1473
|
flip: reactToastify.Flip,
|
|
@@ -1433,6 +1535,7 @@ exports.DInputCurrencyBase = DInputCurrencyBase$1;
|
|
|
1433
1535
|
exports.DInputMask = DInputMask$1;
|
|
1434
1536
|
exports.DInputPassword = DInputPassword$1;
|
|
1435
1537
|
exports.DInputPin = DInputPin;
|
|
1538
|
+
exports.DInputRange = DInputRange$1;
|
|
1436
1539
|
exports.DInputSearch = DInputSearch$1;
|
|
1437
1540
|
exports.DInputSelect = DInputSelect;
|
|
1438
1541
|
exports.DInputSwitch = DInputSwitch;
|
|
@@ -1460,6 +1563,7 @@ exports.DStepperDesktop = DStepper$2;
|
|
|
1460
1563
|
exports.DStepperMobile = DStepper$1;
|
|
1461
1564
|
exports.DTabContent = DTabContent;
|
|
1462
1565
|
exports.DTabs = DTabs$1;
|
|
1566
|
+
exports.DToast = DToast$1;
|
|
1463
1567
|
exports.DToastContainer = DToastContainer;
|
|
1464
1568
|
exports.DTooltip = DTooltip;
|
|
1465
1569
|
exports.configureI18n = configureI8n;
|