@dynamic-framework/ui-react 2.0.0-dev.5 → 2.0.0-dev.6
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 +2 -2
- 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 +2 -2
- package/dist/css/dynamic-ui.min.css +2 -2
- package/dist/index.esm.js +61 -43
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +48 -31
- package/dist/index.js.map +1 -1
- package/dist/types/components/DBoxFile/DBoxFile.d.ts +1 -1
- package/dist/types/components/DIconBase/DIconBase.d.ts +1 -1
- package/dist/types/components/DModal/DModal.d.ts +3 -1
- package/dist/types/components/DOffcanvas/DOffcanvas.d.ts +3 -1
- package/dist/types/components/index.d.ts +0 -1
- package/package.json +2 -1
- package/src/style/components/_d-box-file.scss +1 -1
- package/dist/types/components/DTableHead/DTableHead.d.ts +0 -9
- package/dist/types/components/DTableHead/index.d.ts +0 -2
package/dist/index.esm.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import React, { useMemo, useEffect, useState, useCallback, useContext, createContext,
|
|
3
|
+
import React, { useMemo, useEffect, useState, useCallback, useContext, createContext, useLayoutEffect, forwardRef, useId, useRef, useSyncExternalStore } from 'react';
|
|
4
4
|
import { __rest } from 'tslib';
|
|
5
5
|
import * as LucideIcons from 'lucide-react';
|
|
6
6
|
import { createPortal } from 'react-dom';
|
|
7
|
+
import { AnimatePresence, motion } from 'framer-motion';
|
|
7
8
|
import { fromEvent } from 'file-selector';
|
|
8
9
|
import { SplideSlide, Splide } from '@splidejs/react-splide';
|
|
9
10
|
import currency from 'currency.js';
|
|
@@ -22,7 +23,7 @@ import { initReactI18next } from 'react-i18next';
|
|
|
22
23
|
|
|
23
24
|
const PREFIX_BS = 'bs-';
|
|
24
25
|
|
|
25
|
-
function DIconBase({ icon, color, style, className, size, hasCircle = false, materialStyle = false, familyClass
|
|
26
|
+
function DIconBase({ icon, color, style, className, size, hasCircle = false, materialStyle = false, familyClass, familyPrefix, strokeWidth = 2, dataAttributes, }) {
|
|
26
27
|
// If materialStyle is true, use Material Design icons (legacy)
|
|
27
28
|
const useMaterialIcons = materialStyle;
|
|
28
29
|
// Get Lucide icon component
|
|
@@ -49,13 +50,7 @@ function DIconBase({ icon, color, style, className, size, hasCircle = false, mat
|
|
|
49
50
|
return {};
|
|
50
51
|
}, [hasCircle, color]);
|
|
51
52
|
const generateStyleVariables = useMemo(() => (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, size && { [`--${PREFIX_BS}icon-component-size`]: size }), colorStyle), backgroundStyle), hasCircle && { [`--${PREFIX_BS}icon-component-padding`]: `calc(var(--${PREFIX_BS}icon-component-size, 24px) * 0.4)` }), style)), [size, colorStyle, backgroundStyle, hasCircle, style]);
|
|
52
|
-
const generateClasses = useMemo(() => (Object.assign(
|
|
53
|
-
[familyClass]: true,
|
|
54
|
-
}), className && { [className]: true })), [
|
|
55
|
-
className,
|
|
56
|
-
useMaterialIcons,
|
|
57
|
-
familyClass,
|
|
58
|
-
]);
|
|
53
|
+
const generateClasses = useMemo(() => (Object.assign({ 'd-icon': true }, className && { [className]: true })), [className]);
|
|
59
54
|
const iconSize = useMemo(() => {
|
|
60
55
|
if (size) {
|
|
61
56
|
const numSize = parseInt(size, 10);
|
|
@@ -65,10 +60,13 @@ function DIconBase({ icon, color, style, className, size, hasCircle = false, mat
|
|
|
65
60
|
}, [size]);
|
|
66
61
|
// Render Material Design icon (legacy support)
|
|
67
62
|
if (useMaterialIcons) {
|
|
68
|
-
return (jsx("i", Object.assign({ className: classNames(generateClasses), style: generateStyleVariables }, dataAttributes, { children: icon })));
|
|
63
|
+
return (jsx("i", Object.assign({ className: classNames(generateClasses, familyClass), style: generateStyleVariables }, dataAttributes, { children: icon })));
|
|
69
64
|
}
|
|
70
65
|
// Render Lucide icon
|
|
71
66
|
if (!LucideIcon) {
|
|
67
|
+
if (familyClass && familyPrefix) {
|
|
68
|
+
return (jsx("i", Object.assign({ className: classNames(generateClasses, familyClass, `${familyPrefix}${icon}`), style: generateStyleVariables }, dataAttributes)));
|
|
69
|
+
}
|
|
72
70
|
// eslint-disable-next-line no-console
|
|
73
71
|
console.warn(`Icon "${icon}" not found in Lucide. Make sure to use PascalCase names (e.g., "Home", "User", "Settings")`);
|
|
74
72
|
return (jsx("span", Object.assign({ className: classNames(generateClasses), style: generateStyleVariables }, dataAttributes, { children: "?" })));
|
|
@@ -232,7 +230,10 @@ function DPortalContextProvider({ portalName, children, availablePortals, }) {
|
|
|
232
230
|
return (jsxs(DPortalContext.Provider, { value: value, children: [children, created && createPortal(
|
|
233
231
|
// eslint-disable-next-line max-len
|
|
234
232
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
235
|
-
jsx("div", { onClick: ({ target }) => handleClose(target), onKeyDown: () => { }, children:
|
|
233
|
+
jsx("div", { onClick: ({ target }) => handleClose(target), onKeyDown: () => { }, children: jsx(AnimatePresence, { children: stack.flatMap(({ Component, name, payload, }) => [
|
|
234
|
+
jsx(motion.div, { className: "backdrop", initial: { opacity: 0 }, animate: { opacity: 0.5 }, exit: { opacity: 0, transition: { delay: 0.3 } }, transition: { duration: 0.15, ease: 'linear' } }, `${name}-backdrop`),
|
|
235
|
+
jsx(Component, { name: name, payload: payload }, name),
|
|
236
|
+
]) }) }), document.getElementById(portalName))] }));
|
|
236
237
|
}
|
|
237
238
|
function useDPortalContext() {
|
|
238
239
|
const context = useContext(DPortalContext);
|
|
@@ -859,14 +860,14 @@ function DBoxFile(_a) {
|
|
|
859
860
|
const { iconMap: { upload } } = useDContext();
|
|
860
861
|
const icon = useMemo(() => iconProp || upload, [iconProp, upload]);
|
|
861
862
|
const { inputRef, rootRef, isDragValid, isDragInvalid, acceptAttr, files, handleFileSelect, handleDrop, handleDragEnter, handleDragLeave, handleClick, handleKeyDown, handleRemoveFile, openFileDialog, } = useDBoxFile(props);
|
|
862
|
-
return (jsxs(Fragment
|
|
863
|
+
return (jsxs(Fragment, { children: [jsx("section", Object.assign({ className: classNames('d-box-file', {
|
|
863
864
|
'd-box-file-selected': files.length > 0,
|
|
864
865
|
'd-box-file-disabled': props.disabled,
|
|
865
866
|
'd-box-file-valid': isDragValid,
|
|
866
867
|
'd-box-file-invalid': isDragInvalid,
|
|
867
|
-
}, className), style: style }, dataAttributes, { children: jsxs("div", Object.assign({ className: "d-box-file-dropzone", ref: rootRef, onDragEnter: handleDragEnter, onDragOver: (e) => e.preventDefault(), onDragLeave: handleDragLeave, onDrop: handleDrop, onClick: handleClick, onKeyDown: handleKeyDown }, (!props.disabled && !props.noKeyboard ? { tabIndex: 0 } : {}), { role: "presentation", children: [jsx("input", { type: "file", multiple: props.multiple, style: { display: 'none' }, ref: inputRef, disabled: props.disabled, onChange: handleFileSelect, onClick: (e) => e.stopPropagation(), tabIndex: -1, accept: acceptAttr }), jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle }), jsx("div", { className: "d-box-content", children: typeof children === 'function'
|
|
868
|
+
}, className), style: style }, dataAttributes, { children: jsxs("div", Object.assign({ className: "d-box-file-dropzone", ref: rootRef, onDragEnter: handleDragEnter, onDragOver: (e) => e.preventDefault(), onDragLeave: handleDragLeave, onDrop: handleDrop, onClick: handleClick, onKeyDown: handleKeyDown }, (!props.disabled && !props.noKeyboard ? { tabIndex: 0 } : {}), { role: "presentation", children: [jsx("input", { type: "file", multiple: props.multiple, style: { display: 'none' }, ref: inputRef, disabled: props.disabled, onChange: handleFileSelect, onClick: (e) => e.stopPropagation(), tabIndex: -1, accept: acceptAttr }), icon && iconProp !== false && (jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle })), jsx("div", { className: "d-box-content", children: typeof children === 'function'
|
|
868
869
|
? children(openFileDialog)
|
|
869
|
-
: children })] })) })), !!files.length && (jsx("ul", { className: "d-box-files", children: files.map((file, index) => (jsx(ForwardedDInput, { value: file.name, iconStart: "
|
|
870
|
+
: children || (jsx("p", { className: "text-center m-0", children: "Drag and drop some files here, or click to select files" })) })] })) })), !!files.length && (jsx("ul", { className: "d-box-files", children: files.map((file, index) => (jsx(ForwardedDInput, { value: file.name, iconStart: "Paperclip", iconEnd: "Trash", readOnly: true, onIconEndClick: () => handleRemoveFile(index) }, `${file.name} ${index}`))) }))] }));
|
|
870
871
|
}
|
|
871
872
|
|
|
872
873
|
const DButton = forwardRef((props, ref) => {
|
|
@@ -919,7 +920,7 @@ const DButton = forwardRef((props, ref) => {
|
|
|
919
920
|
// eslint-disable-next-line react/button-has-type
|
|
920
921
|
type: type, className: classNames(classes, className), style: Object.assign(Object.assign({}, style), (loading && buttonWidth
|
|
921
922
|
? { minWidth: `${buttonWidth}px` }
|
|
922
|
-
: undefined)), disabled: isDisabled, "aria-label": ariaLabel, "aria-busy": loading, "aria-disabled": isDisabled, onClick: handleClick }, dataAttributes, rest, { children: [loading && (jsxs("span", { className: "btn-loading", children: [jsx("span", { className: "spinner-border spinner-border-sm", "aria-hidden": "true" }), loadingText && jsx("span", { role: "status", children: loadingText })] })), !loading && (jsxs(Fragment
|
|
923
|
+
: undefined)), disabled: isDisabled, "aria-label": ariaLabel, "aria-busy": loading, "aria-disabled": isDisabled, onClick: handleClick }, dataAttributes, rest, { children: [loading && (jsxs("span", { className: "btn-loading", children: [jsx("span", { className: "spinner-border spinner-border-sm", "aria-hidden": "true" }), loadingText && jsx("span", { role: "status", children: loadingText })] })), !loading && (jsxs(Fragment, { children: [iconStart && (jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix, materialStyle: iconStartMaterialStyle })), content, iconEnd && (jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix, materialStyle: iconEndMaterialStyle }))] }))] })));
|
|
923
924
|
});
|
|
924
925
|
DButton.displayName = 'DButton';
|
|
925
926
|
|
|
@@ -1257,7 +1258,7 @@ function DDatePickerHeaderSelector({ date, changeYear, changeMonth, decreaseMont
|
|
|
1257
1258
|
if (pickerType === PickerType.Quarter || pickerType === PickerType.Month) {
|
|
1258
1259
|
return (jsxs("div", { className: classNames(`react-datepicker__header-selector react-datepicker__header-${pickerType}-selector`, className), style: style, children: [jsx(DButtonIcon, { icon: iconPrev || chevronLeft, size: iconSize, variant: "link", onClick: decreaseYear, disabled: prevMonthButtonDisabled, ariaLabel: prevMonthAriaLabel, className: "header-button", style: { visibility: customHeaderCount === 0 ? 'visible' : 'hidden' } }), jsx("div", { className: "d-flex justify-content-center flex-grow-1", children: showHeaderSelectors ? (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("p", { children: defaultYear === null || defaultYear === void 0 ? void 0 : defaultYear.label })) }), jsx(DButtonIcon, { icon: iconNext || chevronRight, size: iconSize, variant: "link", onClick: increaseYear, disabled: nextMonthButtonDisabled, ariaLabel: nextMonthAriaLabel, className: "header-button", style: { visibility: customHeaderCount === monthsShown - 1 ? 'visible' : 'hidden' } })] }));
|
|
1259
1260
|
}
|
|
1260
|
-
return (jsxs(Fragment
|
|
1261
|
+
return (jsxs(Fragment, { children: [jsxs("div", { className: "datepicker-top-header", children: [showHeaderSelectors && (jsx("select", { value: defaultYear === null || defaultYear === void 0 ? void 0 : defaultYear.value, onChange: (e) => changeYear(Number(e.target.value)), className: "custom-year-selector", children: years.map((year) => (jsx("option", { value: year.value, children: year.label }, year.value))) })), jsx("h4", { className: "mb-0 fw-normal", children: format(monthDate, 'LLLL, dd', { locale }) })] }), jsxs("div", { className: classNames('react-datepicker__header-selector react-datepicker__header-day-selector', className), style: style, children: [jsx(DButtonIcon, { icon: iconPrev || chevronLeft, size: iconSize, variant: "link", onClick: decreaseMonth, disabled: prevMonthButtonDisabled, ariaLabel: prevMonthAriaLabel, className: "header-button", style: { visibility: customHeaderCount === 0 ? 'visible' : 'hidden' } }), showHeaderSelectors ? (jsx(DSelect$1, { options: months, value: defaultMonth, defaultValue: defaultMonth, onChange: (month) => changeMonth((month === null || month === void 0 ? void 0 : month.value) || 0), searchable: false, className: "custom-month-selector" })) : (jsx("p", { children: `${defaultMonth.label} ${defaultYear === null || defaultYear === void 0 ? void 0 : defaultYear.label}` })), jsx(DButtonIcon, { icon: iconNext || chevronRight, size: iconSize, variant: "link", onClick: increaseMonth, disabled: nextMonthButtonDisabled, ariaLabel: nextMonthAriaLabel, className: "header-button", style: { visibility: customHeaderCount === monthsShown - 1 ? 'visible' : 'hidden' } })] })] }));
|
|
1261
1262
|
}
|
|
1262
1263
|
|
|
1263
1264
|
function DDatePicker(_a) {
|
|
@@ -1819,7 +1820,7 @@ function DInputRange(_a, ref) {
|
|
|
1819
1820
|
if (!label) {
|
|
1820
1821
|
return inputComponent;
|
|
1821
1822
|
}
|
|
1822
|
-
return (jsxs(Fragment
|
|
1823
|
+
return (jsxs(Fragment, { children: [jsx("label", { className: "form-label", htmlFor: id, children: label }), inputComponent] }));
|
|
1823
1824
|
}
|
|
1824
1825
|
const ForwardedDInputRange = forwardRef(DInputRange);
|
|
1825
1826
|
ForwardedDInputRange.displayName = 'DInputRange';
|
|
@@ -1883,7 +1884,7 @@ var DListGroup$1 = Object.assign(DListGroup, {
|
|
|
1883
1884
|
function DModalHeader({ showCloseButton, onClose, children, className, style, iconFamilyClass, iconFamilyPrefix, icon: iconProp, materialStyle = false, }) {
|
|
1884
1885
|
const { iconMap: { xLg, }, } = useDContext();
|
|
1885
1886
|
const icon = useMemo(() => iconProp || xLg, [iconProp, xLg]);
|
|
1886
|
-
return (jsxs(Fragment
|
|
1887
|
+
return (jsxs(Fragment, { children: [jsxs("div", { className: classNames('modal-header', className), style: style, children: [jsx("div", { children: children }), showCloseButton && (jsx("button", { type: "button", className: "d-close align-self-center", "aria-label": "Close", onClick: onClose, children: jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: materialStyle }) }))] }), jsx("div", { className: "d-modal-separator" })] }));
|
|
1887
1888
|
}
|
|
1888
1889
|
|
|
1889
1890
|
function DModalBody({ children, className, style, }) {
|
|
@@ -1895,10 +1896,14 @@ function DModalFooter({ className, style, actionPlacement, children, }) {
|
|
|
1895
1896
|
'modal-footer': true,
|
|
1896
1897
|
[`d-modal-action-${actionPlacement}`]: !!actionPlacement,
|
|
1897
1898
|
}), [actionPlacement]);
|
|
1898
|
-
return (jsxs(Fragment
|
|
1899
|
+
return (jsxs(Fragment, { children: [jsx("div", { className: "d-modal-separator" }), jsx("div", { className: classNames(generateClasses, className), style: style, children: children })] }));
|
|
1899
1900
|
}
|
|
1900
1901
|
|
|
1901
|
-
|
|
1902
|
+
const defaultTransition$1 = {
|
|
1903
|
+
ease: 'easeInOut',
|
|
1904
|
+
duration: 0.3,
|
|
1905
|
+
};
|
|
1906
|
+
function DModal({ name, className, style, staticBackdrop, scrollable, centered, fullScreen, fullScreenFrom, size, transition, children, dataAttributes, }) {
|
|
1902
1907
|
const fullScreenClass = useMemo(() => {
|
|
1903
1908
|
if (fullScreen) {
|
|
1904
1909
|
if (fullScreenFrom) {
|
|
@@ -1909,7 +1914,7 @@ function DModal({ name, className, style, staticBackdrop, scrollable, centered,
|
|
|
1909
1914
|
return '';
|
|
1910
1915
|
}, [fullScreenFrom, fullScreen]);
|
|
1911
1916
|
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]);
|
|
1912
|
-
return (jsx(
|
|
1917
|
+
return (jsx(motion.div, Object.assign({ className: classNames('modal portal show', className), id: name, tabIndex: -1, "aria-labelledby": `${name}Label`, "aria-hidden": "false", style: style, initial: { opacity: 0, scale: 0.95 }, animate: { opacity: 1, scale: 1 }, exit: { opacity: 0, scale: 0.95 }, transition: Object.assign(Object.assign({}, (transition !== null && transition !== void 0 ? transition : defaultTransition$1)), { delay: 0.15 }) }, staticBackdrop && ({
|
|
1913
1918
|
[`data-${PREFIX_BS}backdrop`]: 'static',
|
|
1914
1919
|
[`data-${PREFIX_BS}keyboard`]: 'false',
|
|
1915
1920
|
}), dataAttributes, { children: jsx("div", { className: classNames(generateModalDialogClasses), children: jsx("div", { className: "modal-content", children: children }) }) })));
|
|
@@ -1923,7 +1928,7 @@ var DModal$1 = Object.assign(DModal, {
|
|
|
1923
1928
|
function DOffcanvasHeader({ showCloseButton, onClose, children, className, style, iconFamilyClass, iconFamilyPrefix, icon: iconProp, materialStyle = false, }) {
|
|
1924
1929
|
const { iconMap: { xLg, }, } = useDContext();
|
|
1925
1930
|
const icon = useMemo(() => iconProp || xLg, [iconProp, xLg]);
|
|
1926
|
-
return (jsxs(Fragment
|
|
1931
|
+
return (jsxs(Fragment, { children: [jsxs("div", { className: classNames('offcanvas-header', className), style: style, children: [jsx("div", { children: children }), showCloseButton && (jsx("button", { type: "button", className: "d-close align-self-center", "aria-label": "Close", onClick: onClose, children: jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: materialStyle }) }))] }), jsx("div", { className: "d-offcanvas-separator" })] }));
|
|
1927
1932
|
}
|
|
1928
1933
|
|
|
1929
1934
|
function DOffcanvasBody({ children, className, style, }) {
|
|
@@ -1935,13 +1940,39 @@ function DOffcanvasFooter({ actionPlacement, children, className, style, }) {
|
|
|
1935
1940
|
'd-offcanvas-footer': true,
|
|
1936
1941
|
[`d-offcanvas-action-${actionPlacement}`]: !!actionPlacement,
|
|
1937
1942
|
}), [actionPlacement]);
|
|
1938
|
-
return (jsxs(Fragment
|
|
1943
|
+
return (jsxs(Fragment, { children: [jsx("div", { className: "d-offcanvas-separator" }), jsx("div", { className: classNames(generateClasses, className), style: style, children: children })] }));
|
|
1939
1944
|
}
|
|
1940
1945
|
|
|
1941
|
-
|
|
1942
|
-
|
|
1946
|
+
const variants = {
|
|
1947
|
+
hidden: (openFrom) => {
|
|
1948
|
+
const properties = {};
|
|
1949
|
+
if (openFrom === 'start') {
|
|
1950
|
+
properties.x = '-100%';
|
|
1951
|
+
}
|
|
1952
|
+
if (openFrom === 'end') {
|
|
1953
|
+
properties.x = '100%';
|
|
1954
|
+
}
|
|
1955
|
+
if (openFrom === 'top') {
|
|
1956
|
+
properties.y = '-100%';
|
|
1957
|
+
}
|
|
1958
|
+
if (openFrom === 'bottom') {
|
|
1959
|
+
properties.y = '100%';
|
|
1960
|
+
}
|
|
1961
|
+
return properties;
|
|
1962
|
+
},
|
|
1963
|
+
visible: {
|
|
1964
|
+
x: 0,
|
|
1965
|
+
y: 0,
|
|
1966
|
+
},
|
|
1967
|
+
};
|
|
1968
|
+
const defaultTransition = {
|
|
1969
|
+
ease: 'easeInOut',
|
|
1970
|
+
duration: 0.3,
|
|
1971
|
+
};
|
|
1972
|
+
function DOffcanvas({ name, className, style, staticBackdrop, scrollable, openFrom = 'end', transition, children, dataAttributes, }) {
|
|
1973
|
+
return (jsx(motion.div, Object.assign({ className: classNames('offcanvas portal show', {
|
|
1943
1974
|
[`offcanvas-${openFrom}`]: openFrom,
|
|
1944
|
-
}, className), style: style, id: name, tabIndex: -1, "aria-labelledby": `${name}Label`, "aria-hidden": "false" }, staticBackdrop && ({
|
|
1975
|
+
}, className), style: Object.assign(Object.assign({}, style), { transition: 'none' }), id: name, tabIndex: -1, "aria-labelledby": `${name}Label`, "aria-hidden": "false", custom: openFrom, variants: variants, initial: "hidden", animate: "visible", exit: "hidden", transition: Object.assign(Object.assign({}, (transition !== null && transition !== void 0 ? transition : defaultTransition)), { delay: 0.15 }) }, staticBackdrop && ({
|
|
1945
1976
|
[`data-${PREFIX_BS}backdrop`]: 'static',
|
|
1946
1977
|
[`data-${PREFIX_BS}keyboard`]: 'false',
|
|
1947
1978
|
}), scrollable && ({
|
|
@@ -2054,7 +2085,7 @@ function DStepper$1({ options, currentStep, className, style, }) {
|
|
|
2054
2085
|
from 0deg,
|
|
2055
2086
|
var(--${PREFIX_BS}step-progress-outter-fill-background-color) ${currentAngle}deg,
|
|
2056
2087
|
var(--${PREFIX_BS}step-progress-outter-background-color) 0deg)`, [currentAngle]);
|
|
2057
|
-
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
|
|
2088
|
+
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, { children: [jsx("div", { className: "d-step-label", children: currentOption.label }), jsx("div", { className: "d-step-description", children: currentOption.description || '' })] })) })] }));
|
|
2058
2089
|
}
|
|
2059
2090
|
|
|
2060
2091
|
function DStepper({ options, currentStep, iconSuccess, iconSuccessFamilyClass, iconSuccessFamilyPrefix, iconSuccessMaterialStyle = false, vertical = false, breakpoint = 'lg', className, completed = false, style, dataAttributes, }) {
|
|
@@ -2096,7 +2127,7 @@ function DTooltip({ className, childrenClassName, style, offSet = ARROW_HEIGHT +
|
|
|
2096
2127
|
role,
|
|
2097
2128
|
]);
|
|
2098
2129
|
const generateClasses = useMemo(() => (Object.assign({ 'tooltip show': true, [`tooltip-${size}`]: !!size }, className && { [className]: true })), [size, className]);
|
|
2099
|
-
return (jsxs(Fragment
|
|
2130
|
+
return (jsxs(Fragment, { children: [jsx("div", Object.assign({ className: childrenClassName, ref: refs.setReference }, getReferenceProps(), { children: Component })), jsx(FloatingPortal, { children: isOpen && (jsxs("div", Object.assign({ className: classNames(generateClasses), ref: refs.setFloating, style: Object.assign(Object.assign({}, floatingStyles), style) }, getFloatingProps(), { children: [jsx(FloatingArrow, { ref: arrowRef, context: context, width: ARROW_WIDTH, height: ARROW_HEIGHT }), jsx("div", { className: "tooltip-inner", children: children })] }))) })] }));
|
|
2100
2131
|
}
|
|
2101
2132
|
|
|
2102
2133
|
function DTimeline({ className, style, dataAttributes, items, }) {
|
|
@@ -2195,19 +2226,6 @@ function useDToast() {
|
|
|
2195
2226
|
};
|
|
2196
2227
|
}
|
|
2197
2228
|
|
|
2198
|
-
function DTableHead({ className, style, field, label, value = '', onChange, }) {
|
|
2199
|
-
const handleOnChange = useCallback(() => {
|
|
2200
|
-
if (value === field) {
|
|
2201
|
-
return onChange(`-${field}`);
|
|
2202
|
-
}
|
|
2203
|
-
if (value === `-${field}`) {
|
|
2204
|
-
return onChange('');
|
|
2205
|
-
}
|
|
2206
|
-
return onChange(field);
|
|
2207
|
-
}, [field, value, onChange]);
|
|
2208
|
-
return (jsx("th", { style: style, className: classNames('d-table-head', className), children: jsxs("button", { type: "button", onClick: handleOnChange, children: [label, value && value.includes(field) && (jsx(DIcon, { icon: value === field ? 'arrow-up' : 'arrow-down' }))] }) }));
|
|
2209
|
-
}
|
|
2210
|
-
|
|
2211
2229
|
async function configureI8n(resources, _a = {}) {
|
|
2212
2230
|
var { lng = 'en', fallbackLng = 'en' } = _a, config = __rest(_a, ["lng", "fallbackLng"]);
|
|
2213
2231
|
return i18n
|
|
@@ -2515,5 +2533,5 @@ function DVoucher({ amount, amountDetails, icon = 'CircleCheckBig', color = 'suc
|
|
|
2515
2533
|
}, children: jsxs("div", { children: [jsxs("div", { className: "d-voucher-header", children: [jsx(DIcon, { icon: icon, color: color }), jsxs("div", { className: "text-center", children: [jsx("h3", { className: "mb-2", children: title }), jsx("p", { className: "m-0", children: message })] })] }), amount && (jsxs("div", { className: "d-voucher-amount", children: [jsx("div", { className: classNames('text-center fw-bold fs-3', amountDetails ? 'mb-1' : 'm-0'), children: amount }), amountDetails] })), jsx("hr", { className: "my-4" }), children, jsx("hr", { className: "my-4" }), jsxs("div", { className: "d-voucher-footer", children: [jsx(DButton, { onClick: handleShare, iconStart: "Share2", text: shareText, variant: "outline", size: "sm" }), jsx(DButton, { onClick: handleDownload, iconStart: "Download", text: downloadText, variant: "outline", size: "sm" })] })] }) }));
|
|
2516
2534
|
}
|
|
2517
2535
|
|
|
2518
|
-
export { DAlert, DAvatar, DBadge, DBox, DBoxFile, DButton, DButtonIcon, DCard$1 as DCard, DCardBody, DCardFooter, DCardHeader, DCarousel$1 as DCarousel, DCarouselSlide, DChip, DCollapse, DContext, DContextProvider, DCreditCard, DCurrencyText, DDatePicker, DDropdown, DIcon, DIconBase, ForwardedDInput as DInput, DInputCheck, ForwardedDInputCounter as DInputCounter, ForwardedDInputCurrency as DInputCurrency, ForwardedDInputMask as DInputMask, ForwardedDInputPassword as DInputPassword, ForwardedDInputPhone as DInputPhone, DInputPin, ForwardedDInputRange as DInputRange, DInputSelect, DInputSwitch, DLayout$1 as DLayout, DLayoutPane, DListGroup$1 as DListGroup, DListGroupItem, DModal$1 as DModal, DModalBody, DModalFooter, DModalHeader, DOffcanvas$1 as DOffcanvas, DOffcanvasBody, DOffcanvasFooter, DOffcanvasHeader, DPaginator, DPasswordStrengthMeter, DPopover, DProgress, DSelect$1 as DSelect, DStepper, DStepper$2 as DStepperDesktop, DStepper$1 as DStepperMobile, DTabContent,
|
|
2536
|
+
export { DAlert, DAvatar, DBadge, DBox, DBoxFile, DButton, DButtonIcon, DCard$1 as DCard, DCardBody, DCardFooter, DCardHeader, DCarousel$1 as DCarousel, DCarouselSlide, DChip, DCollapse, DContext, DContextProvider, DCreditCard, DCurrencyText, DDatePicker, DDropdown, DIcon, DIconBase, ForwardedDInput as DInput, DInputCheck, ForwardedDInputCounter as DInputCounter, ForwardedDInputCurrency as DInputCurrency, ForwardedDInputMask as DInputMask, ForwardedDInputPassword as DInputPassword, ForwardedDInputPhone as DInputPhone, DInputPin, ForwardedDInputRange as DInputRange, DInputSelect, DInputSwitch, DLayout$1 as DLayout, DLayoutPane, DListGroup$1 as DListGroup, DListGroupItem, DModal$1 as DModal, DModalBody, DModalFooter, DModalHeader, DOffcanvas$1 as DOffcanvas, DOffcanvasBody, DOffcanvasFooter, DOffcanvasHeader, DPaginator, DPasswordStrengthMeter, DPopover, DProgress, DSelect$1 as DSelect, DStepper, DStepper$2 as DStepperDesktop, DStepper$1 as DStepperMobile, DTabContent, DTabs$1 as DTabs, DTimeline, DToast$1 as DToast, DToastContainer, DTooltip, DVoucher, changeQueryString, checkMediaQuery, configureI8n as configureI18n, formatCurrency, getCssVariable, getQueryString, subscribeToMediaQuery, useDContext, useDPortalContext, useDToast, useDisableBodyScrollEffect, useDisableInputWheel, useFormatCurrency, useInputCurrency, useItemSelection, useMediaBreakpointUpLg, useMediaBreakpointUpMd, useMediaBreakpointUpSm, useMediaBreakpointUpXl, useMediaBreakpointUpXs, useMediaBreakpointUpXxl, useMediaQuery, usePortal, useProvidedRefOrCreate, useStackState, useTabContext, validatePhoneNumber };
|
|
2519
2537
|
//# sourceMappingURL=index.esm.js.map
|