@dynamic-framework/ui-react 1.12.1 → 1.14.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 +51 -27
- package/dist/css/dynamic-ui-non-root.min.css +1 -1
- 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 +52 -28
- package/dist/css/dynamic-ui.min.css +1 -1
- package/dist/index.esm.js +174 -166
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +174 -166
- package/dist/index.js.map +1 -1
- package/dist/types/components/DCurrencyText/DCurrencyText.d.ts +0 -1
- package/dist/types/components/DIcon/DIcon.d.ts +4 -15
- package/dist/types/components/DIconBase/DIconBase.d.ts +17 -0
- package/dist/types/components/DIconBase/index.d.ts +2 -0
- package/dist/types/components/DMonthPicker/DMonthPicker.d.ts +1 -1
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/components/interface.d.ts +2 -0
- package/dist/types/contexts/DContext.d.ts +15 -6
- package/package.json +2 -2
- package/src/style/abstracts/variables/_+import.scss +1 -1
- package/src/style/abstracts/variables/_forms.scss +3 -2
- package/src/style/abstracts/variables/_navs.scss +1 -1
- package/src/style/abstracts/variables/_quick-action-check.scss +1 -1
- package/src/style/components/_d-datepicker.scss +18 -5
- package/src/style/components/_d-icon.scss +4 -2
- package/src/style/components/_d-input.scss +18 -10
- package/src/style/components/_d-tabs.scss +5 -0
- package/dist/types/components/DListItemMovement/DListItemMovement.d.ts +0 -10
- package/dist/types/components/DListItemMovement/index.d.ts +0 -2
package/dist/index.esm.js
CHANGED
|
@@ -58,10 +58,10 @@ const ALERT_TYPE_ICON = {
|
|
|
58
58
|
secondary: 'info-circle',
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
function
|
|
61
|
+
function DIconBase({ icon, theme, style, className, size = '1.5rem', loading = false, loadingDuration = 1.8, hasCircle = false, circleSize = `calc(var(--${PREFIX_BS}icon-component-size) * 1)`, color, backgroundColor, materialStyle = false, familyClass = 'bi', familyPrefix = 'bi-', }) {
|
|
62
62
|
const colorStyle = useMemo(() => {
|
|
63
63
|
if (color) {
|
|
64
|
-
return { [`--${PREFIX_BS}component-color`]: color };
|
|
64
|
+
return { [`--${PREFIX_BS}icon-component-color`]: color };
|
|
65
65
|
}
|
|
66
66
|
if (theme) {
|
|
67
67
|
return { [`--${PREFIX_BS}icon-component-color`]: `var(--${PREFIX_BS}${theme})` };
|
|
@@ -87,139 +87,17 @@ function DIcon({ icon, theme, style, className, size = '1.5rem', loading = false
|
|
|
87
87
|
return { [`--${PREFIX_BS}icon-component-padding`]: '0' };
|
|
88
88
|
}, [circleSize, hasCircle]);
|
|
89
89
|
const generateStyleVariables = useMemo(() => (Object.assign(Object.assign(Object.assign(Object.assign({ [`--${PREFIX_BS}icon-component-size`]: size, [`--${PREFIX_BS}icon-component-loading-duration`]: `${loadingDuration}s` }, colorStyle), backgroundStyle), circleSizeStyle), style)), [size, loadingDuration, colorStyle, backgroundStyle, circleSizeStyle, style]);
|
|
90
|
-
const generateClasses = useMemo(() => (Object.assign({ 'd-icon': true, [familyClass]: true,
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const generateStyleVariables = useMemo(() => (Object.assign(Object.assign({}, style), { [`--${PREFIX_BS}alert-component-separator-opacity`]: '0.3' })), [style]);
|
|
102
|
-
return (jsxs("div", { className: classNames(generateClasses), style: generateStyleVariables, role: "alert", id: id, children: [(showIcon || icon) && (jsx(DIcon, Object.assign({ className: "alert-icon", icon: getIcon }, iconFamilyClass && { familyClass: iconFamilyClass }, iconFamilyPrefix && { familyPrefix: iconFamilyPrefix }))), jsx("div", { className: "alert-text", children: children }), showClose && (jsx("div", { className: "alert-separator" })), showClose && (jsx("button", { type: "button", className: "btn-close", "aria-label": "Close", onClick: onClose, children: jsx(DIcon, { className: "alert-close-icon", icon: "x-lg", familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix }) }))] }));
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function DBoxFile(_a) {
|
|
106
|
-
var { icon = 'cloud-upload', iconFamilyClass, iconFamilyPrefix, disabled = false, children, className, style } = _a, dropzoneOptions = __rest(_a, ["icon", "iconFamilyClass", "iconFamilyPrefix", "disabled", "children", "className", "style"]);
|
|
107
|
-
const { acceptedFiles, getRootProps, getInputProps, } = useDropzone(Object.assign({ disabled }, dropzoneOptions));
|
|
108
|
-
return (jsxs("section", { className: classNames('d-box-file', {
|
|
109
|
-
'd-box-file-selected': !!acceptedFiles.length,
|
|
110
|
-
}, className), style: style, children: [jsxs("div", Object.assign({}, getRootProps({
|
|
111
|
-
className: classNames('d-box-file-dropzone', {
|
|
112
|
-
disabled,
|
|
113
|
-
}),
|
|
114
|
-
}), { children: [jsx("input", Object.assign({}, getInputProps())), jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix }), jsx("div", { className: "d-box-content", children: children })] })), !!acceptedFiles.length && (jsx("aside", { className: "d-box-files", children: acceptedFiles.map((file) => (jsx("div", { className: "d-box-files-text", children: `${file.name} - ${file.size} bytes` }, file.name))) }))] }));
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function DButton({ theme = 'primary', size, variant, state, text = '', ariaLabel, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, value, type = 'button', pill = false, loading = false, loadingAriaLabel, disabled = false, stopPropagationEnabled = true, className, form, onClick, }) {
|
|
118
|
-
const generateClasses = useMemo(() => {
|
|
119
|
-
const variantClass = variant
|
|
120
|
-
? `btn-${variant}-${theme}`
|
|
121
|
-
: `btn-${theme}`;
|
|
122
|
-
return Object.assign(Object.assign(Object.assign({ btn: true, [variantClass]: true }, size && { [`btn-${size}`]: true }), (state && state !== 'disabled') && { [state]: true }), { loading });
|
|
123
|
-
}, [variant, theme, size, state, loading]);
|
|
124
|
-
const generateStyleVariables = useMemo(() => {
|
|
125
|
-
if (pill) {
|
|
126
|
-
return {
|
|
127
|
-
[`--${PREFIX_BS}btn-component-border-radius`]: `var(--${PREFIX_BS}border-radius-pill)`,
|
|
128
|
-
[`--${PREFIX_BS}btn-component-lg-border-radius`]: `var(--${PREFIX_BS}border-radius-pill)`,
|
|
129
|
-
[`--${PREFIX_BS}btn-component-sm-border-radius`]: `var(--${PREFIX_BS}border-radius-pill)`,
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
return {};
|
|
133
|
-
}, [pill]);
|
|
134
|
-
const clickHandler = useCallback((event) => {
|
|
135
|
-
if (stopPropagationEnabled) {
|
|
136
|
-
event.stopPropagation();
|
|
137
|
-
}
|
|
138
|
-
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
139
|
-
}, [stopPropagationEnabled, onClick]);
|
|
140
|
-
const isDisabled = useMemo(() => (state === 'disabled' || loading || disabled), [state, loading, disabled]);
|
|
141
|
-
const newAriaLabel = useMemo(() => (loading
|
|
142
|
-
? (loadingAriaLabel || ariaLabel || text)
|
|
143
|
-
: (ariaLabel || text)), [loading, loadingAriaLabel, ariaLabel, text]);
|
|
144
|
-
return (jsxs("button", Object.assign({ className: classNames(generateClasses, className), style: generateStyleVariables, type: type, disabled: isDisabled, onClick: clickHandler, "aria-label": newAriaLabel, form: form }, value && { value }, { children: [iconStart && (jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix })), (text && !loading) && (jsx("span", { children: text })), loading && (jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsx("span", { className: "visually-hidden", children: "Loading..." }) })), iconEnd && (jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix }))] })));
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
function DCardHeader({ className, style, children, }) {
|
|
148
|
-
return (jsx("div", { className: classNames('card-header', className), style: style, children: children }));
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
function DCardBody({ className, style, children, }) {
|
|
152
|
-
return (jsx("div", { className: classNames('card-body', className), style: style, children: children }));
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
function DCardFooter({ className, style, children, }) {
|
|
156
|
-
return (jsx("div", { className: classNames('card-footer', className), style: style, children: children }));
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
function DCard({ className, style, children, }) {
|
|
160
|
-
return (jsx("div", { style: style, className: classNames('card', className), children: children }));
|
|
161
|
-
}
|
|
162
|
-
var DCard$1 = Object.assign(DCard, {
|
|
163
|
-
Header: DCardHeader,
|
|
164
|
-
Body: DCardBody,
|
|
165
|
-
Footer: DCardFooter,
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
function DCardAccount({ className, style, icon, theme, name, number, balance, balanceText, onClick, actionText, }) {
|
|
169
|
-
return (jsx(DCard$1, { className: classNames('d-card-account', className), style: style, children: jsxs(DCard$1.Body, { children: [jsxs("div", { className: "d-flex gap-3 align-items-center", children: [jsx(DIcon, { icon: icon, hasCircle: true, theme: theme, size: "1.5rem" }), jsxs("div", { className: "d-block flex-grow-1", children: [jsx("p", { className: "text-gray-700", children: name }), jsx("small", { className: "text-gray-500", children: number })] })] }), jsxs("div", { className: "d-block", children: [jsx("p", { className: "fw-bold fs-6 text-body", children: balance }), jsx("small", { className: "text-gray-700", children: balanceText })] }), jsx("div", { className: "d-flex justify-content-end", children: jsx(DButton, { text: actionText, variant: "link", size: "sm", theme: "secondary", iconEnd: "chevron-right", onClick: onClick }) })] }) }));
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
function DCarouselSlide(_a) {
|
|
173
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
174
|
-
return (jsx(SplideSlide, Object.assign({ className: classNames('d-carousel-slide', className) }, props)));
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
function DCarousel(_a) {
|
|
178
|
-
var { children, className, style, options } = _a, props = __rest(_a, ["children", "className", "style", "options"]);
|
|
179
|
-
return (jsx(Splide, Object.assign({ className: classNames('d-carousel', className), style: style, options: Object.assign(Object.assign({}, options), { classes: {
|
|
180
|
-
// Arrows
|
|
181
|
-
arrows: 'splide__arrows d-carousel-arrows',
|
|
182
|
-
arrow: 'splide__arrow d-carousel-arrow',
|
|
183
|
-
prev: 'splide__arrow--prev d-carousel-arrow-prev',
|
|
184
|
-
next: 'splide__arrow--next d-carousel-arrow-next',
|
|
185
|
-
// Paginator
|
|
186
|
-
pagination: 'splide__pagination d-carousel-pagination',
|
|
187
|
-
page: 'splide__pagination__page d-carousel-pagination-page',
|
|
188
|
-
} }) }, props, { children: children })));
|
|
189
|
-
}
|
|
190
|
-
var DCarousel$1 = Object.assign(DCarousel, {
|
|
191
|
-
Slide: DCarouselSlide,
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
function DChip({ theme = 'primary', text, icon, iconFamilyClass, iconFamilyPrefix, showClose = false, closeAriaLabel = 'close', className, style, onClose, }) {
|
|
195
|
-
const generateClasses = useMemo(() => ({
|
|
196
|
-
'd-chip': true,
|
|
197
|
-
[`d-chip-${theme}`]: !!theme,
|
|
198
|
-
}), [theme]);
|
|
199
|
-
return (jsxs("span", { className: classNames(generateClasses, className), style: style, children: [icon && (jsx("div", { className: "d-chip-icon-container", children: jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix }) })), jsx("span", { children: text }), showClose && (jsx("button", { type: "button", className: "d-chip-icon-container", onClick: onClose, "aria-label": closeAriaLabel, children: jsx(DIcon, { icon: "x-lg" }) }))] }));
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
function DCollapse({ id, className, style, Component, hasSeparator = false, defaultCollapsed = false, onChange, children, }) {
|
|
203
|
-
const [toggle, setToggle] = useState(defaultCollapsed);
|
|
204
|
-
const onChangeCollapse = () => setToggle((prev) => !prev);
|
|
205
|
-
useEffect(() => {
|
|
206
|
-
if (onChange) {
|
|
207
|
-
onChange(toggle);
|
|
208
|
-
}
|
|
209
|
-
}, [toggle, onChange]);
|
|
210
|
-
useEffect(() => {
|
|
211
|
-
setToggle(defaultCollapsed);
|
|
212
|
-
}, [defaultCollapsed]);
|
|
213
|
-
const generateStyles = useMemo(() => ({
|
|
214
|
-
[`--${PREFIX_BS}collapse-separator-display`]: hasSeparator ? 'block' : 'none',
|
|
215
|
-
}), [hasSeparator]);
|
|
216
|
-
return (jsxs("div", { id: id, className: classNames('collapse-container', className), style: style, children: [jsxs("button", { className: "collapse-button", type: "button", onClick: onChangeCollapse, children: [jsx("div", { className: "flex-grow-1", children: Component }), jsx(DIcon, { color: `var(--${PREFIX_BS}gray)`, size: `var(--${PREFIX_BS}ref-fs-small)`, icon: toggle ? 'chevron-up' : 'chevron-down' })] }), toggle && (jsx("div", { className: classNames({
|
|
217
|
-
'collapse-body': true,
|
|
218
|
-
}), style: generateStyles, children: children }))] }));
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
function DCollapseIconText({ children, icon, iconSize = '1.5rem', iconTheme = 'primary', title, iconFamilyClass, iconFamilyPrefix, className, style, }) {
|
|
222
|
-
return (jsx(DCollapse, { defaultCollapsed: true, className: classNames('d-collapse-icon-text', className), style: style, Component: (jsxs("div", { className: "d-collapse-icon-text-header", children: [jsx(DIcon, { icon: icon, size: iconSize, theme: iconTheme, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, hasCircle: true }), jsx("span", { className: "d-collapse-icon-text-title", children: title })] })), children: children }));
|
|
90
|
+
const generateClasses = useMemo(() => (Object.assign(Object.assign({ 'd-icon': true, [familyClass]: true, 'd-icon-loading': loading }, !materialStyle && {
|
|
91
|
+
[`${familyPrefix}${icon}`]: true,
|
|
92
|
+
}), className && { [className]: true })), [
|
|
93
|
+
familyClass,
|
|
94
|
+
loading,
|
|
95
|
+
className,
|
|
96
|
+
materialStyle,
|
|
97
|
+
familyPrefix,
|
|
98
|
+
icon,
|
|
99
|
+
]);
|
|
100
|
+
return (jsx("i", { className: classNames(generateClasses), style: generateStyleVariables, children: materialStyle && icon }));
|
|
223
101
|
}
|
|
224
102
|
|
|
225
103
|
const defaultState = {
|
|
@@ -230,13 +108,21 @@ const defaultState = {
|
|
|
230
108
|
separator: ',',
|
|
231
109
|
decimal: '.',
|
|
232
110
|
},
|
|
111
|
+
icon: {
|
|
112
|
+
familyClass: 'bi',
|
|
113
|
+
familyPrefix: 'bi-',
|
|
114
|
+
materialStyle: false,
|
|
115
|
+
},
|
|
116
|
+
setContext: () => { },
|
|
233
117
|
};
|
|
234
118
|
const DContext = createContext(defaultState);
|
|
235
|
-
function DContextProvider({ language = defaultState.language, currency = defaultState.currency, children, }) {
|
|
236
|
-
const
|
|
119
|
+
function DContextProvider({ language = defaultState.language, currency = defaultState.currency, icon = defaultState.icon, children, }) {
|
|
120
|
+
const [internalContext, setInternalContext,] = useState({
|
|
237
121
|
language,
|
|
238
122
|
currency,
|
|
239
|
-
|
|
123
|
+
icon,
|
|
124
|
+
});
|
|
125
|
+
const value = useMemo(() => (Object.assign(Object.assign({}, internalContext), { setContext: (newValue) => setInternalContext(newValue) })), [internalContext]);
|
|
240
126
|
return (jsx(DContext.Provider, { value: value, children: children }));
|
|
241
127
|
}
|
|
242
128
|
function useDContext() {
|
|
@@ -397,6 +283,143 @@ function useDOffcanvasContext() {
|
|
|
397
283
|
return context;
|
|
398
284
|
}
|
|
399
285
|
|
|
286
|
+
function DIcon(_a) {
|
|
287
|
+
var { familyClass: propFamilyClass, familyPrefix: propFamilyPrefix, materialStyle: propMaterialStyle } = _a, props = __rest(_a, ["familyClass", "familyPrefix", "materialStyle"]);
|
|
288
|
+
const { icon: { familyClass, familyPrefix, materialStyle, }, } = useDContext();
|
|
289
|
+
return (jsx(DIconBase, Object.assign({ familyClass: propFamilyClass || familyClass, familyPrefix: propFamilyPrefix || familyPrefix, materialStyle: propMaterialStyle || materialStyle }, props)));
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
function DSummaryCard({ title, description, icon, iconSize, iconTheme, Summary, }) {
|
|
293
|
+
return (jsxs("div", { children: [jsx("h6", { className: "fw-bold fs-6", children: title }), jsx("p", { className: "fs-8", children: description }), jsxs("div", { className: "bg-white rounded p-4 d-flex gap-3 shadow-sm text-gray-700 fs-8", children: [jsx(DIcon, { icon: icon, theme: iconTheme, size: iconSize }), Summary] })] }));
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
function DAlert({ type = 'success', icon, iconFamilyClass, iconFamilyPrefix, showIcon = true, soft = false, showClose, onClose, children, id, className, style, }) {
|
|
297
|
+
const generateClasses = useMemo(() => (Object.assign({ alert: true, [`alert-${type}`]: true, 'fade show': !!showClose, 'alert-soft': soft }, className && { [className]: true })), [type, showClose, soft, className]);
|
|
298
|
+
const getIcon = useMemo(() => icon || ALERT_TYPE_ICON[type] || '', [icon, type]);
|
|
299
|
+
const generateStyleVariables = useMemo(() => (Object.assign(Object.assign({}, style), { [`--${PREFIX_BS}alert-component-separator-opacity`]: '0.3' })), [style]);
|
|
300
|
+
return (jsxs("div", { className: classNames(generateClasses), style: generateStyleVariables, role: "alert", id: id, children: [(showIcon || icon) && (jsx(DIcon, Object.assign({ className: "alert-icon", icon: getIcon }, iconFamilyClass && { familyClass: iconFamilyClass }, iconFamilyPrefix && { familyPrefix: iconFamilyPrefix }))), jsx("div", { className: "alert-text", children: children }), showClose && (jsx("div", { className: "alert-separator" })), showClose && (jsx("button", { type: "button", className: "btn-close", "aria-label": "Close", onClick: onClose, children: jsx(DIcon, { className: "alert-close-icon", icon: "x-lg", familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix }) }))] }));
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
function DBoxFile(_a) {
|
|
304
|
+
var { icon = 'cloud-upload', iconFamilyClass, iconFamilyPrefix, disabled = false, children, className, style } = _a, dropzoneOptions = __rest(_a, ["icon", "iconFamilyClass", "iconFamilyPrefix", "disabled", "children", "className", "style"]);
|
|
305
|
+
const { acceptedFiles, getRootProps, getInputProps, } = useDropzone(Object.assign({ disabled }, dropzoneOptions));
|
|
306
|
+
return (jsxs("section", { className: classNames('d-box-file', {
|
|
307
|
+
'd-box-file-selected': !!acceptedFiles.length,
|
|
308
|
+
}, className), style: style, children: [jsxs("div", Object.assign({}, getRootProps({
|
|
309
|
+
className: classNames('d-box-file-dropzone', {
|
|
310
|
+
disabled,
|
|
311
|
+
}),
|
|
312
|
+
}), { children: [jsx("input", Object.assign({}, getInputProps())), jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix }), jsx("div", { className: "d-box-content", children: children })] })), !!acceptedFiles.length && (jsx("aside", { className: "d-box-files", children: acceptedFiles.map((file) => (jsx("div", { className: "d-box-files-text", children: `${file.name} - ${file.size} bytes` }, file.name))) }))] }));
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
function DButton({ theme = 'primary', size, variant, state, text = '', ariaLabel, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, value, type = 'button', pill = false, loading = false, loadingAriaLabel, disabled = false, stopPropagationEnabled = true, className, form, onClick, }) {
|
|
316
|
+
const generateClasses = useMemo(() => {
|
|
317
|
+
const variantClass = variant
|
|
318
|
+
? `btn-${variant}-${theme}`
|
|
319
|
+
: `btn-${theme}`;
|
|
320
|
+
return Object.assign(Object.assign(Object.assign({ btn: true, [variantClass]: true }, size && { [`btn-${size}`]: true }), (state && state !== 'disabled') && { [state]: true }), { loading });
|
|
321
|
+
}, [variant, theme, size, state, loading]);
|
|
322
|
+
const generateStyleVariables = useMemo(() => {
|
|
323
|
+
if (pill) {
|
|
324
|
+
return {
|
|
325
|
+
[`--${PREFIX_BS}btn-component-border-radius`]: `var(--${PREFIX_BS}border-radius-pill)`,
|
|
326
|
+
[`--${PREFIX_BS}btn-component-lg-border-radius`]: `var(--${PREFIX_BS}border-radius-pill)`,
|
|
327
|
+
[`--${PREFIX_BS}btn-component-sm-border-radius`]: `var(--${PREFIX_BS}border-radius-pill)`,
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
return {};
|
|
331
|
+
}, [pill]);
|
|
332
|
+
const clickHandler = useCallback((event) => {
|
|
333
|
+
if (stopPropagationEnabled) {
|
|
334
|
+
event.stopPropagation();
|
|
335
|
+
}
|
|
336
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
337
|
+
}, [stopPropagationEnabled, onClick]);
|
|
338
|
+
const isDisabled = useMemo(() => (state === 'disabled' || loading || disabled), [state, loading, disabled]);
|
|
339
|
+
const newAriaLabel = useMemo(() => (loading
|
|
340
|
+
? (loadingAriaLabel || ariaLabel || text)
|
|
341
|
+
: (ariaLabel || text)), [loading, loadingAriaLabel, ariaLabel, text]);
|
|
342
|
+
return (jsxs("button", Object.assign({ className: classNames(generateClasses, className), style: generateStyleVariables, type: type, disabled: isDisabled, onClick: clickHandler, "aria-label": newAriaLabel, form: form }, value && { value }, { children: [iconStart && (jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix })), (text && !loading) && (jsx("span", { children: text })), loading && (jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsx("span", { className: "visually-hidden", children: "Loading..." }) })), iconEnd && (jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix }))] })));
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
function DCardHeader({ className, style, children, }) {
|
|
346
|
+
return (jsx("div", { className: classNames('card-header', className), style: style, children: children }));
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
function DCardBody({ className, style, children, }) {
|
|
350
|
+
return (jsx("div", { className: classNames('card-body', className), style: style, children: children }));
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
function DCardFooter({ className, style, children, }) {
|
|
354
|
+
return (jsx("div", { className: classNames('card-footer', className), style: style, children: children }));
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
function DCard({ className, style, children, }) {
|
|
358
|
+
return (jsx("div", { style: style, className: classNames('card', className), children: children }));
|
|
359
|
+
}
|
|
360
|
+
var DCard$1 = Object.assign(DCard, {
|
|
361
|
+
Header: DCardHeader,
|
|
362
|
+
Body: DCardBody,
|
|
363
|
+
Footer: DCardFooter,
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
function DCardAccount({ className, style, icon, theme, name, number, balance, balanceText, onClick, actionText, }) {
|
|
367
|
+
return (jsx(DCard$1, { className: classNames('d-card-account', className), style: style, children: jsxs(DCard$1.Body, { children: [jsxs("div", { className: "d-flex gap-3 align-items-center", children: [jsx(DIcon, { icon: icon, hasCircle: true, theme: theme, size: "1.5rem" }), jsxs("div", { className: "d-block flex-grow-1", children: [jsx("p", { className: "text-gray-700", children: name }), jsx("small", { className: "text-gray-500", children: number })] })] }), jsxs("div", { className: "d-block", children: [jsx("p", { className: "fw-bold fs-6 text-body", children: balance }), jsx("small", { className: "text-gray-700", children: balanceText })] }), jsx("div", { className: "d-flex justify-content-end", children: jsx(DButton, { text: actionText, variant: "link", size: "sm", theme: "secondary", iconEnd: "chevron-right", onClick: onClick }) })] }) }));
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
function DCarouselSlide(_a) {
|
|
371
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
372
|
+
return (jsx(SplideSlide, Object.assign({ className: classNames('d-carousel-slide', className) }, props)));
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
function DCarousel(_a) {
|
|
376
|
+
var { children, className, style, options } = _a, props = __rest(_a, ["children", "className", "style", "options"]);
|
|
377
|
+
return (jsx(Splide, Object.assign({ className: classNames('d-carousel', className), style: style, options: Object.assign(Object.assign({}, options), { classes: {
|
|
378
|
+
// Arrows
|
|
379
|
+
arrows: 'splide__arrows d-carousel-arrows',
|
|
380
|
+
arrow: 'splide__arrow d-carousel-arrow',
|
|
381
|
+
prev: 'splide__arrow--prev d-carousel-arrow-prev',
|
|
382
|
+
next: 'splide__arrow--next d-carousel-arrow-next',
|
|
383
|
+
// Paginator
|
|
384
|
+
pagination: 'splide__pagination d-carousel-pagination',
|
|
385
|
+
page: 'splide__pagination__page d-carousel-pagination-page',
|
|
386
|
+
} }) }, props, { children: children })));
|
|
387
|
+
}
|
|
388
|
+
var DCarousel$1 = Object.assign(DCarousel, {
|
|
389
|
+
Slide: DCarouselSlide,
|
|
390
|
+
});
|
|
391
|
+
|
|
392
|
+
function DChip({ theme = 'primary', text, icon, iconFamilyClass, iconFamilyPrefix, showClose = false, closeAriaLabel = 'close', className, style, onClose, }) {
|
|
393
|
+
const generateClasses = useMemo(() => ({
|
|
394
|
+
'd-chip': true,
|
|
395
|
+
[`d-chip-${theme}`]: !!theme,
|
|
396
|
+
}), [theme]);
|
|
397
|
+
return (jsxs("span", { className: classNames(generateClasses, className), style: style, children: [icon && (jsx("div", { className: "d-chip-icon-container", children: jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix }) })), jsx("span", { children: text }), showClose && (jsx("button", { type: "button", className: "d-chip-icon-container", onClick: onClose, "aria-label": closeAriaLabel, children: jsx(DIcon, { icon: "x-lg" }) }))] }));
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
function DCollapse({ id, className, style, Component, hasSeparator = false, defaultCollapsed = false, onChange, children, }) {
|
|
401
|
+
const [toggle, setToggle] = useState(defaultCollapsed);
|
|
402
|
+
const onChangeCollapse = () => setToggle((prev) => !prev);
|
|
403
|
+
useEffect(() => {
|
|
404
|
+
if (onChange) {
|
|
405
|
+
onChange(toggle);
|
|
406
|
+
}
|
|
407
|
+
}, [toggle, onChange]);
|
|
408
|
+
useEffect(() => {
|
|
409
|
+
setToggle(defaultCollapsed);
|
|
410
|
+
}, [defaultCollapsed]);
|
|
411
|
+
const generateStyles = useMemo(() => ({
|
|
412
|
+
[`--${PREFIX_BS}collapse-separator-display`]: hasSeparator ? 'block' : 'none',
|
|
413
|
+
}), [hasSeparator]);
|
|
414
|
+
return (jsxs("div", { id: id, className: classNames('collapse-container', className), style: style, children: [jsxs("button", { className: "collapse-button", type: "button", onClick: onChangeCollapse, children: [jsx("div", { className: "flex-grow-1", children: Component }), jsx(DIcon, { color: `var(--${PREFIX_BS}gray)`, size: `var(--${PREFIX_BS}ref-fs-small)`, icon: toggle ? 'chevron-up' : 'chevron-down' })] }), toggle && (jsx("div", { className: classNames({
|
|
415
|
+
'collapse-body': true,
|
|
416
|
+
}), style: generateStyles, children: children }))] }));
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
function DCollapseIconText({ children, icon, iconSize = '1.5rem', iconTheme = 'primary', title, iconFamilyClass, iconFamilyPrefix, className, style, }) {
|
|
420
|
+
return (jsx(DCollapse, { defaultCollapsed: true, className: classNames('d-collapse-icon-text', className), style: style, Component: (jsxs("div", { className: "d-collapse-icon-text-header", children: [jsx(DIcon, { icon: icon, size: iconSize, theme: iconTheme, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, hasCircle: true }), jsx("span", { className: "d-collapse-icon-text-title", children: title })] })), children: children }));
|
|
421
|
+
}
|
|
422
|
+
|
|
400
423
|
function formatCurrency(amount, options) {
|
|
401
424
|
return currency(amount, options).format();
|
|
402
425
|
}
|
|
@@ -437,7 +460,7 @@ function useProvidedRefOrCreate(providedRef) {
|
|
|
437
460
|
}
|
|
438
461
|
|
|
439
462
|
function DInput(_a, ref) {
|
|
440
|
-
var { id, style, className, label = '', labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, disabled = false, readOnly = false, loading = false, iconFamilyClass, iconFamilyPrefix, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconStartAriaLabel, iconStartTabIndex, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, iconEndAriaLabel, iconEndTabIndex, hint, invalid = false, valid = false, floatingLabel = false, inputStart, value, placeholder = '', onChange, onIconStartClick, onIconEndClick } = _a, inputProps = __rest(_a, ["id", "style", "className", "label", "labelIcon", "labelIconFamilyClass", "labelIconFamilyPrefix", "disabled", "readOnly", "loading", "iconFamilyClass", "iconFamilyPrefix", "iconStart", "iconStartFamilyClass", "iconStartFamilyPrefix", "iconStartAriaLabel", "iconStartTabIndex", "iconEnd", "iconEndFamilyClass", "iconEndFamilyPrefix", "iconEndAriaLabel", "iconEndTabIndex", "hint", "invalid", "valid", "floatingLabel", "inputStart", "value", "placeholder", "onChange", "onIconStartClick", "onIconEndClick"]);
|
|
463
|
+
var { id, style, className, label = '', labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, disabled = false, readOnly = false, loading = false, iconFamilyClass, iconFamilyPrefix, iconStart, iconStartDisabled, iconStartFamilyClass, iconStartFamilyPrefix, iconStartAriaLabel, iconStartTabIndex, iconEnd, iconEndDisabled, iconEndFamilyClass, iconEndFamilyPrefix, iconEndAriaLabel, iconEndTabIndex, hint, invalid = false, valid = false, floatingLabel = false, inputStart, value, placeholder = '', onChange, onIconStartClick, onIconEndClick } = _a, inputProps = __rest(_a, ["id", "style", "className", "label", "labelIcon", "labelIconFamilyClass", "labelIconFamilyPrefix", "disabled", "readOnly", "loading", "iconFamilyClass", "iconFamilyPrefix", "iconStart", "iconStartDisabled", "iconStartFamilyClass", "iconStartFamilyPrefix", "iconStartAriaLabel", "iconStartTabIndex", "iconEnd", "iconEndDisabled", "iconEndFamilyClass", "iconEndFamilyPrefix", "iconEndAriaLabel", "iconEndTabIndex", "hint", "invalid", "valid", "floatingLabel", "inputStart", "value", "placeholder", "onChange", "onIconStartClick", "onIconEndClick"]);
|
|
441
464
|
const inputRef = useProvidedRefOrCreate(ref);
|
|
442
465
|
const handleOnChange = useCallback((event) => {
|
|
443
466
|
onChange === null || onChange === void 0 ? void 0 : onChange(event.currentTarget.value);
|
|
@@ -490,7 +513,7 @@ function DInput(_a, ref) {
|
|
|
490
513
|
'input-group': true,
|
|
491
514
|
'has-validation': invalid,
|
|
492
515
|
disabled: disabled || loading,
|
|
493
|
-
}), children: [!!inputStart && (jsx("div", { className: "input-group-text", children: inputStart })), iconStart && (jsx("button", { type: "button", className: "input-group-text", id: `${id}Start`, onClick: handleOnIconStartClick, disabled: disabled || loading, "aria-label": iconStartAriaLabel, tabIndex: iconStartTabIndex, children:
|
|
516
|
+
}), children: [!!inputStart && (jsx("div", { className: "input-group-text", children: inputStart })), iconStart && (jsx("button", { type: "button", className: "input-group-text", id: `${id}Start`, onClick: handleOnIconStartClick, disabled: disabled || loading || iconStartDisabled, "aria-label": iconStartAriaLabel, tabIndex: iconStartTabIndex, children: jsx(DIcon, { className: "d-input-icon", icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix }) })), dynamicComponent, ((invalid || valid) && !iconEnd && !loading) && (jsx("span", { className: "input-group-text", id: `${id}State`, children: jsx(DIcon, { className: "d-input-validation-icon", icon: invalid ? 'exclamation-circle' : 'check', familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix }) })), (iconEnd && !loading) && (jsx("button", { type: "button", className: "input-group-text", id: `${id}End`, onClick: handleOnIconEndClick, disabled: disabled || loading || iconEndDisabled, "aria-label": iconEndAriaLabel, tabIndex: iconEndTabIndex, children: jsx(DIcon, { className: "d-input-icon", icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix }) })), loading && (jsx("div", { className: "input-group-text d-input-icon", children: jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsx("span", { className: "visually-hidden", children: "Loading..." }) }) }))] }), hint && (jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] })] }));
|
|
494
517
|
}
|
|
495
518
|
const ForwardedDInput = forwardRef(DInput);
|
|
496
519
|
ForwardedDInput.displayName = 'DInput';
|
|
@@ -512,10 +535,10 @@ ForwardedDDatePickerInput.displayName = 'DDatePickerInput';
|
|
|
512
535
|
var DDatePickerInput$1 = ForwardedDDatePickerInput;
|
|
513
536
|
|
|
514
537
|
function DMonthPicker(_a) {
|
|
515
|
-
var { onChangeDate, date, locale, className, headerPrevYearAriaLabel = 'decrease year', headerNextYearAriaLabel = 'increase year' } = _a, props = __rest(_a, ["onChangeDate", "date", "locale", "className", "headerPrevYearAriaLabel", "headerNextYearAriaLabel"]);
|
|
538
|
+
var { onChangeDate, date, locale, className, calendarClassName, headerPrevYearAriaLabel = 'decrease year', headerNextYearAriaLabel = 'increase year' } = _a, props = __rest(_a, ["onChangeDate", "date", "locale", "className", "calendarClassName", "headerPrevYearAriaLabel", "headerNextYearAriaLabel"]);
|
|
516
539
|
const selected = useMemo(() => parseISO(date), [date]);
|
|
517
540
|
const dateFormatted = useMemo(() => (format(new Date(date), 'MMMM yyyy', { locale })), [date, locale]);
|
|
518
|
-
return (jsx(DatePicker, Object.assign({ showMonthYearPicker: true, selected: selected, calendarClassName: classNames('d-month-picker',
|
|
541
|
+
return (jsx(DatePicker, Object.assign({ showMonthYearPicker: true, selected: selected, className: className, calendarClassName: classNames('d-month-picker', calendarClassName), onChange: onChangeDate }, locale && { locale }, { customInput: (jsx("p", { className: "fw-bold text-capitalize", children: dateFormatted })), renderCustomHeader: ({ monthDate, decreaseYear, increaseYear, prevYearButtonDisabled, nextYearButtonDisabled, }) => (jsxs("div", { className: "d-flex align-items-center justify-content-between gap-4 fs-6 bg-dark", children: [jsx(DButton, { iconStart: "chevron-left", size: "sm", variant: "link", theme: "light", onClick: decreaseYear, disabled: prevYearButtonDisabled, ariaLabel: headerPrevYearAriaLabel }), jsx("p", { className: "fs-6 fw-bold", children: monthDate.getFullYear() }), jsx(DButton, { iconStart: "chevron-right", size: "sm", variant: "link", theme: "light", onClick: increaseYear, disabled: nextYearButtonDisabled, ariaLabel: headerNextYearAriaLabel })] })) }, props)));
|
|
519
542
|
}
|
|
520
543
|
|
|
521
544
|
function DDatePickerHeader({ monthDate, changeMonth, changeYear, decreaseMonth, increaseMonth, prevMonthButtonDisabled, nextMonthButtonDisabled, withMonthSelector, prevMonthIcon, nextMonthIcon, prevMonthAriaLabel = 'decrease month', nextMonthAriaLabel = 'increase month', iconSize, buttonVariant, buttonTheme, locale, style, className, }) {
|
|
@@ -525,7 +548,7 @@ function DDatePickerHeader({ monthDate, changeMonth, changeYear, decreaseMonth,
|
|
|
525
548
|
changeYear(getYear(value));
|
|
526
549
|
}
|
|
527
550
|
}, [changeMonth, changeYear]);
|
|
528
|
-
return (jsxs("div", { className: classNames('d-flex align-items-center justify-content-between d-datepicker-header', className), style: style, children: [jsx(DButton, { iconStart: prevMonthIcon, size: iconSize, variant: buttonVariant, theme: buttonTheme, onClick: decreaseMonth, disabled: prevMonthButtonDisabled, ariaLabel: prevMonthAriaLabel }), jsx(DMonthPicker, Object.assign({}, !withMonthSelector && { readOnly: true }, { date: monthDate.toISOString(), onChangeDate: onChangeDate }, locale && { locale })), jsx(DButton, { iconStart: nextMonthIcon, size: iconSize, variant: buttonVariant, theme: buttonTheme, onClick: increaseMonth, disabled: nextMonthButtonDisabled, ariaLabel: nextMonthAriaLabel })] }));
|
|
551
|
+
return (jsxs("div", { className: classNames('d-flex align-items-center justify-content-between d-datepicker-header', className), style: style, children: [jsx(DButton, { iconStart: prevMonthIcon, size: iconSize, variant: buttonVariant, theme: buttonTheme, onClick: decreaseMonth, disabled: prevMonthButtonDisabled, ariaLabel: prevMonthAriaLabel }), jsx(DMonthPicker, Object.assign({}, !withMonthSelector && { readOnly: true }, withMonthSelector && { className: 'cursor-pointer' }, { date: monthDate.toISOString(), onChangeDate: onChangeDate }, locale && { locale })), jsx(DButton, { iconStart: nextMonthIcon, size: iconSize, variant: buttonVariant, theme: buttonTheme, onClick: increaseMonth, disabled: nextMonthButtonDisabled, ariaLabel: nextMonthAriaLabel })] }));
|
|
529
552
|
}
|
|
530
553
|
|
|
531
554
|
function DDatePicker(_a) {
|
|
@@ -577,7 +600,11 @@ function DInputCounter(_a, ref) {
|
|
|
577
600
|
useEffect(() => {
|
|
578
601
|
setInternalIsInvalid(!(internalValue >= minValue && internalValue <= maxValue));
|
|
579
602
|
}, [internalValue, minValue, maxValue]);
|
|
580
|
-
return (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 },
|
|
603
|
+
return (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 && {
|
|
604
|
+
iconStartDisabled: true,
|
|
605
|
+
}, internalValue === maxValue && {
|
|
606
|
+
iconEndDisabled: true,
|
|
607
|
+
}, props)));
|
|
581
608
|
}
|
|
582
609
|
const ForwardedDInputCounter = forwardRef(DInputCounter);
|
|
583
610
|
ForwardedDInputCounter.displayName = 'DInputCounter';
|
|
@@ -652,7 +679,7 @@ function useInputCurrency(currencyOptions, value, onFocus, onChange, onBlur, ref
|
|
|
652
679
|
}
|
|
653
680
|
|
|
654
681
|
function DInputCurrencyBase(_a, ref) {
|
|
655
|
-
var { value, minValue, maxValue, currencyOptions, currencyCode,
|
|
682
|
+
var { value, minValue, maxValue, currencyOptions, currencyCode, onFocus, onBlur, onChange } = _a, inputProps = __rest(_a, ["value", "minValue", "maxValue", "currencyOptions", "currencyCode", "onFocus", "onBlur", "onChange"]);
|
|
656
683
|
const { inputRef, innerValue, innerType, handleOnFocus, handleOnChange, handleOnBlur, handleOnWheel, generateStyleVariables, generateSymbolStyleVariables, } = useInputCurrency(currencyOptions, value, onFocus, onChange, onBlur, ref);
|
|
657
684
|
return (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: (jsx("span", { slot: "input-start", style: generateSymbolStyleVariables, children: currencyCode || currencyOptions.symbol })) }, inputProps)));
|
|
658
685
|
}
|
|
@@ -661,7 +688,7 @@ ForwardedDInputCurrencyBase$1.displayName = 'DInputCurrencyBase';
|
|
|
661
688
|
var DInputCurrencyBase$1 = ForwardedDInputCurrencyBase$1;
|
|
662
689
|
|
|
663
690
|
function DInputCurrency(_a, ref) {
|
|
664
|
-
var { value, minValue, maxValue, currencyCode,
|
|
691
|
+
var { value, minValue, maxValue, currencyCode, onFocus, onBlur, onChange } = _a, props = __rest(_a, ["value", "minValue", "maxValue", "currencyCode", "onFocus", "onBlur", "onChange"]);
|
|
665
692
|
const { currency: currencyOptions } = useDContext();
|
|
666
693
|
const { inputRef, innerValue, innerType, handleOnFocus, handleOnChange, handleOnBlur, handleOnWheel, generateStyleVariables, generateSymbolStyleVariables, } = useInputCurrency(currencyOptions, value, onFocus, onChange, onBlur, ref);
|
|
667
694
|
return (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: (jsx("span", { slot: "input-start", style: generateSymbolStyleVariables, children: currencyCode || currencyOptions.symbol })) }, props)));
|
|
@@ -874,25 +901,6 @@ var DList$1 = Object.assign(DList, {
|
|
|
874
901
|
Item: DListItem,
|
|
875
902
|
});
|
|
876
903
|
|
|
877
|
-
function DListItemMovement(_a) {
|
|
878
|
-
var { description, date, amount, className, style } = _a, props = __rest(_a, ["description", "date", "amount", "className", "style"]);
|
|
879
|
-
const { format } = useFormatCurrency();
|
|
880
|
-
const value = useMemo(() => {
|
|
881
|
-
const valueFormatted = format(amount);
|
|
882
|
-
if (amount > 0) {
|
|
883
|
-
return {
|
|
884
|
-
theme: 'text-success',
|
|
885
|
-
valueFormatted,
|
|
886
|
-
};
|
|
887
|
-
}
|
|
888
|
-
return {
|
|
889
|
-
theme: 'text-danger',
|
|
890
|
-
valueFormatted,
|
|
891
|
-
};
|
|
892
|
-
}, [format, amount]);
|
|
893
|
-
return (jsx(DListItem, Object.assign({}, props, { children: jsxs("div", { className: classNames('d-flex justify-content-between align-items-center p-3 gap-3', className), style: style, children: [jsxs("div", { className: "d-flex flex-column gap-1", children: [jsx("span", { className: "fs-6", children: description }), jsx("span", { className: "small text-gray-700", children: date })] }), jsx("span", { className: classNames('fs-6', value.theme), children: value.valueFormatted })] }) })));
|
|
894
|
-
}
|
|
895
|
-
|
|
896
904
|
function DModalHeader({ showCloseButton, onClose, children, className, style, }) {
|
|
897
905
|
return (jsxs("div", { className: classNames('modal-header', className), style: style, children: [jsx("div", { className: "d-modal-slot", children: children }), showCloseButton && (jsx("button", { type: "button", className: "d-modal-close", "aria-label": "Close", onClick: onClose, children: jsx(DIcon, { icon: "x-lg" }) }))] }));
|
|
898
906
|
}
|
|
@@ -1242,5 +1250,5 @@ async function configureI8n(resources, _a = {}) {
|
|
|
1242
1250
|
.then((t) => t);
|
|
1243
1251
|
}
|
|
1244
1252
|
|
|
1245
|
-
export { DAlert, DBadge, DBoxFile, DButton, DCard$1 as DCard, DCardAccount, DCardBody, DCardFooter, DCardHeader, DCarousel$1 as DCarousel, DCarouselSlide, DChip, DCollapse, DCollapseIconText, DContext, DContextProvider, DCurrencyText, DDatePicker, DIcon, DInput$1 as DInput, DInputCheck, DInputCounter$1 as DInputCounter, DInputCurrency$1 as DInputCurrency, DInputCurrencyBase$1 as DInputCurrencyBase, DInputMask$1 as DInputMask, DInputPassword$1 as DInputPassword, DInputPin, DInputSearch$1 as DInputSearch, DInputSelect, DInputSwitch, DList$1 as DList, DListItem,
|
|
1253
|
+
export { DAlert, DBadge, DBoxFile, DButton, DCard$1 as DCard, DCardAccount, DCardBody, DCardFooter, DCardHeader, DCarousel$1 as DCarousel, DCarouselSlide, DChip, DCollapse, DCollapseIconText, DContext, DContextProvider, DCurrencyText, DDatePicker, DIcon, DIconBase, DInput$1 as DInput, DInputCheck, DInputCounter$1 as DInputCounter, DInputCurrency$1 as DInputCurrency, DInputCurrencyBase$1 as DInputCurrencyBase, DInputMask$1 as DInputMask, DInputPassword$1 as DInputPassword, DInputPin, DInputSearch$1 as DInputSearch, DInputSelect, DInputSwitch, DList$1 as DList, DListItem, DModal$1 as DModal, DModalBody, DModalContext, DModalContextProvider, DModalFooter, DModalHeader, DOffcanvas$1 as DOffcanvas, DOffcanvasBody, DOffcanvasContext, DOffcanvasContextProvider, DOffcanvasFooter, DOffcanvasHeader, DPaginator, DPermissionGroup, DPermissionItem, DPopover, DProgress, DQuickActionButton, DQuickActionCheck, DQuickActionSelect, DQuickActionSwitch, DSkeleton, DStepper, DStepper$2 as DStepperDesktop, DStepper$1 as DStepperMobile, DSummaryCard, DTabContent, DTabs$1 as DTabs, DToastContainer, DTooltip, configureI8n as configureI18n, formatCurrency, useDContext, useDModalContext, useDOffcanvasContext, useDisableBodyScrollEffect, useFormatCurrency, useInputCurrency, usePortal, useProvidedRefOrCreate, useStackState, useTabContext, useToast };
|
|
1246
1254
|
//# sourceMappingURL=index.esm.js.map
|