@sustaina/shared-ui 1.5.0 → 1.6.1
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/index.d.mts +32 -16
- package/dist/index.d.ts +32 -16
- package/dist/index.js +123 -53
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +118 -53
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.d.mts
CHANGED
|
@@ -369,22 +369,30 @@ interface AdvanceSearchProps {
|
|
|
369
369
|
|
|
370
370
|
declare const AdvanceSearch: React__default.FC<AdvanceSearchProps>;
|
|
371
371
|
|
|
372
|
-
type
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
372
|
+
type DialogVariant = "default" | "success" | "error" | "warning";
|
|
373
|
+
interface DialogAlertProps {
|
|
374
|
+
open: boolean;
|
|
375
|
+
onOpenChange: (state: boolean) => void;
|
|
376
|
+
title?: string;
|
|
377
|
+
description?: string;
|
|
378
|
+
variant?: DialogVariant;
|
|
379
|
+
confirmText?: string;
|
|
380
|
+
cancelText?: string;
|
|
381
|
+
onConfirm?: () => void;
|
|
382
|
+
onCancel?: () => void;
|
|
383
|
+
showCancel?: boolean;
|
|
384
|
+
align?: "start" | "center" | "end";
|
|
385
|
+
outlet?: React__default.ReactNode | null;
|
|
386
|
+
}
|
|
387
|
+
declare function DialogAlert({ open, onOpenChange, title, description, variant, confirmText, cancelText, onConfirm, onCancel, showCancel, align, outlet }: DialogAlertProps): react_jsx_runtime.JSX.Element;
|
|
388
|
+
|
|
389
|
+
declare function isDefined(value: any): boolean;
|
|
390
|
+
declare function isEmptyObject(value: any): boolean;
|
|
391
|
+
declare function debounce<T extends (...args: any[]) => void>(fn: T, delay?: number): (...args: Parameters<T>) => void;
|
|
392
|
+
|
|
393
|
+
declare function stripNullishObject<T extends Record<string, any>>(value: Partial<T>): {
|
|
394
|
+
[k: string]: any;
|
|
386
395
|
};
|
|
387
|
-
declare function ConfirmDialog({ dialogData, setDialog, onClose }: ConfirmDialogProps): react_jsx_runtime.JSX.Element;
|
|
388
396
|
|
|
389
397
|
/**
|
|
390
398
|
* Utility function to intelligently combine class names using `clsx`
|
|
@@ -489,4 +497,12 @@ type Breakpoints = {
|
|
|
489
497
|
};
|
|
490
498
|
declare const useScreenSize: (breakpoints?: Breakpoints) => UseScreenSizeResult;
|
|
491
499
|
|
|
492
|
-
|
|
500
|
+
type UseTruncatedOptions<T> = {
|
|
501
|
+
elementRef: React.RefObject<T | null>;
|
|
502
|
+
onChange?: (isTruncated: boolean) => void;
|
|
503
|
+
resizeDetectDelay?: number;
|
|
504
|
+
};
|
|
505
|
+
type UseTruncatedResult = boolean;
|
|
506
|
+
declare const useTruncated: <T extends HTMLElement = any>({ elementRef, onChange, resizeDetectDelay }: UseTruncatedOptions<T>) => UseTruncatedResult;
|
|
507
|
+
|
|
508
|
+
export { AdvanceSearch, type Breakpoints, Button, type Column, type ContentSlot, DataTable, type DataTableChildrenKeyHandler, type DataTableColumnFilter, type DataTableColumnFilterProps, type DataTableColumnGrouping, type DataTableColumnOrdering, type DataTableColumnPinning, type DataTableColumnSorting, type DataTableColumnVisibility, type DataTableComponentProps, type DataTableFilterConfig, type DataTableFilters, type DataTableGlobalFilter, type DataTableHeaderCell, type DataTableProps, type DataTableRenderHeaderHandler, type DataTableRenderHeaderProps, type DataTableRenderRowHandler, type DataTableRenderRowProps, type DataTableRowCell, type DataTableRowClickHandler, type DataTableRowClickMode, type DataTableRowExpansion, type DataTableRowIdKeyHandler, type DataTableRowSelection, type DataTableScrollFetch, type DataTableStatusContent, type DatatableColumnResizing, DialogAlert, type DialogAlertProps, type DialogVariant, type FieldSchema, FormErrorMessage, type FormErrorMessageProps, FormField, FormFieldContext, type FormFieldContextValue, type FormFieldProps, FormItem, FormItemContext, type FormItemContextValue, type FormItemProps, FormLabel, type FormLabelProps, type GridPayload, GridSettingsModal, type GridSettingsModalProps, HeaderCell, type HeaderCellProps, _default as Navbar, type NavbarProps, NumberInput, type NumberInputProps, PreventPageLeave, type RowClickType, type SorterProps, TextInput, type TextInputProps, type UseFormFieldOptions, type UseFormFieldReturn, type UseHoverResult, type UseMediaQueryOptions, type UseMediaQueryResult, type UsePreventPageLeaveOptions, type UseScreenSizeResult, type UseTruncatedOptions, type UseTruncatedResult, booleanToSelectValue, buttonVariants, cn, compareAlphanumeric, debounce, getColumnIdFromTable, isDefined, isEmptyObject, renderContentSlot, selectValueToBoolean, stripNullishObject, useFormField, useGridSettingsStore, useHover, useIntersectionObserver, useMediaQuery, usePreventPageLeave, usePreventPageLeaveStore, useScreenSize, useTruncated };
|
package/dist/index.d.ts
CHANGED
|
@@ -369,22 +369,30 @@ interface AdvanceSearchProps {
|
|
|
369
369
|
|
|
370
370
|
declare const AdvanceSearch: React__default.FC<AdvanceSearchProps>;
|
|
371
371
|
|
|
372
|
-
type
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
372
|
+
type DialogVariant = "default" | "success" | "error" | "warning";
|
|
373
|
+
interface DialogAlertProps {
|
|
374
|
+
open: boolean;
|
|
375
|
+
onOpenChange: (state: boolean) => void;
|
|
376
|
+
title?: string;
|
|
377
|
+
description?: string;
|
|
378
|
+
variant?: DialogVariant;
|
|
379
|
+
confirmText?: string;
|
|
380
|
+
cancelText?: string;
|
|
381
|
+
onConfirm?: () => void;
|
|
382
|
+
onCancel?: () => void;
|
|
383
|
+
showCancel?: boolean;
|
|
384
|
+
align?: "start" | "center" | "end";
|
|
385
|
+
outlet?: React__default.ReactNode | null;
|
|
386
|
+
}
|
|
387
|
+
declare function DialogAlert({ open, onOpenChange, title, description, variant, confirmText, cancelText, onConfirm, onCancel, showCancel, align, outlet }: DialogAlertProps): react_jsx_runtime.JSX.Element;
|
|
388
|
+
|
|
389
|
+
declare function isDefined(value: any): boolean;
|
|
390
|
+
declare function isEmptyObject(value: any): boolean;
|
|
391
|
+
declare function debounce<T extends (...args: any[]) => void>(fn: T, delay?: number): (...args: Parameters<T>) => void;
|
|
392
|
+
|
|
393
|
+
declare function stripNullishObject<T extends Record<string, any>>(value: Partial<T>): {
|
|
394
|
+
[k: string]: any;
|
|
386
395
|
};
|
|
387
|
-
declare function ConfirmDialog({ dialogData, setDialog, onClose }: ConfirmDialogProps): react_jsx_runtime.JSX.Element;
|
|
388
396
|
|
|
389
397
|
/**
|
|
390
398
|
* Utility function to intelligently combine class names using `clsx`
|
|
@@ -489,4 +497,12 @@ type Breakpoints = {
|
|
|
489
497
|
};
|
|
490
498
|
declare const useScreenSize: (breakpoints?: Breakpoints) => UseScreenSizeResult;
|
|
491
499
|
|
|
492
|
-
|
|
500
|
+
type UseTruncatedOptions<T> = {
|
|
501
|
+
elementRef: React.RefObject<T | null>;
|
|
502
|
+
onChange?: (isTruncated: boolean) => void;
|
|
503
|
+
resizeDetectDelay?: number;
|
|
504
|
+
};
|
|
505
|
+
type UseTruncatedResult = boolean;
|
|
506
|
+
declare const useTruncated: <T extends HTMLElement = any>({ elementRef, onChange, resizeDetectDelay }: UseTruncatedOptions<T>) => UseTruncatedResult;
|
|
507
|
+
|
|
508
|
+
export { AdvanceSearch, type Breakpoints, Button, type Column, type ContentSlot, DataTable, type DataTableChildrenKeyHandler, type DataTableColumnFilter, type DataTableColumnFilterProps, type DataTableColumnGrouping, type DataTableColumnOrdering, type DataTableColumnPinning, type DataTableColumnSorting, type DataTableColumnVisibility, type DataTableComponentProps, type DataTableFilterConfig, type DataTableFilters, type DataTableGlobalFilter, type DataTableHeaderCell, type DataTableProps, type DataTableRenderHeaderHandler, type DataTableRenderHeaderProps, type DataTableRenderRowHandler, type DataTableRenderRowProps, type DataTableRowCell, type DataTableRowClickHandler, type DataTableRowClickMode, type DataTableRowExpansion, type DataTableRowIdKeyHandler, type DataTableRowSelection, type DataTableScrollFetch, type DataTableStatusContent, type DatatableColumnResizing, DialogAlert, type DialogAlertProps, type DialogVariant, type FieldSchema, FormErrorMessage, type FormErrorMessageProps, FormField, FormFieldContext, type FormFieldContextValue, type FormFieldProps, FormItem, FormItemContext, type FormItemContextValue, type FormItemProps, FormLabel, type FormLabelProps, type GridPayload, GridSettingsModal, type GridSettingsModalProps, HeaderCell, type HeaderCellProps, _default as Navbar, type NavbarProps, NumberInput, type NumberInputProps, PreventPageLeave, type RowClickType, type SorterProps, TextInput, type TextInputProps, type UseFormFieldOptions, type UseFormFieldReturn, type UseHoverResult, type UseMediaQueryOptions, type UseMediaQueryResult, type UsePreventPageLeaveOptions, type UseScreenSizeResult, type UseTruncatedOptions, type UseTruncatedResult, booleanToSelectValue, buttonVariants, cn, compareAlphanumeric, debounce, getColumnIdFromTable, isDefined, isEmptyObject, renderContentSlot, selectValueToBoolean, stripNullishObject, useFormField, useGridSettingsStore, useHover, useIntersectionObserver, useMediaQuery, usePreventPageLeave, usePreventPageLeaveStore, useScreenSize, useTruncated };
|
package/dist/index.js
CHANGED
|
@@ -17,6 +17,7 @@ var utilities = require('@dnd-kit/utilities');
|
|
|
17
17
|
var SelectPrimitive = require('@radix-ui/react-select');
|
|
18
18
|
var TooltipPrimitive = require('@radix-ui/react-tooltip');
|
|
19
19
|
var core = require('@dnd-kit/core');
|
|
20
|
+
var modifiers = require('@dnd-kit/modifiers');
|
|
20
21
|
var zod = require('zod');
|
|
21
22
|
var reactDom = require('react-dom');
|
|
22
23
|
var PopoverPrimitive = require('@radix-ui/react-popover');
|
|
@@ -152,6 +153,35 @@ function FormLabel({ children, className, errorClassName, required, ...props })
|
|
|
152
153
|
);
|
|
153
154
|
}
|
|
154
155
|
|
|
156
|
+
// src/utils/common.ts
|
|
157
|
+
function isDefined(value) {
|
|
158
|
+
return value !== null && value !== void 0;
|
|
159
|
+
}
|
|
160
|
+
function isEmptyObject(value) {
|
|
161
|
+
return !!value && Object.keys(value).length === 0 && value.constructor === Object;
|
|
162
|
+
}
|
|
163
|
+
function debounce(fn, delay = 150) {
|
|
164
|
+
let timeout = null;
|
|
165
|
+
return (...args) => {
|
|
166
|
+
if (timeout) clearTimeout(timeout);
|
|
167
|
+
timeout = setTimeout(() => {
|
|
168
|
+
fn(...args);
|
|
169
|
+
}, delay);
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// src/utils/filters.ts
|
|
174
|
+
function stripNullishObject(value) {
|
|
175
|
+
if (!isDefined(value)) {
|
|
176
|
+
return {};
|
|
177
|
+
}
|
|
178
|
+
try {
|
|
179
|
+
return Object.fromEntries(Object.entries(value).filter(([, propValue]) => isDefined(propValue)));
|
|
180
|
+
} catch {
|
|
181
|
+
return {};
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
155
185
|
// src/utils/getColumnIdFromTable.ts
|
|
156
186
|
function getColumnIdFromTable(table) {
|
|
157
187
|
const allColumns = table.getAllColumns();
|
|
@@ -365,23 +395,36 @@ var useScreenSize = (breakpoints) => {
|
|
|
365
395
|
return { isMobile, isTablet, isDesktop };
|
|
366
396
|
};
|
|
367
397
|
var useScreenSize_default = useScreenSize;
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
}
|
|
398
|
+
var useTruncated = ({
|
|
399
|
+
elementRef,
|
|
400
|
+
onChange,
|
|
401
|
+
resizeDetectDelay = 150
|
|
402
|
+
}) => {
|
|
403
|
+
const [isTruncated, setIsTruncated] = React4.useState(false);
|
|
404
|
+
React4.useEffect(() => {
|
|
405
|
+
const element = elementRef.current;
|
|
406
|
+
if (!element) return;
|
|
407
|
+
const checkTruncate = debounce(() => {
|
|
408
|
+
const truncated = element.scrollWidth > element.clientWidth;
|
|
409
|
+
setIsTruncated((prev) => {
|
|
410
|
+
if (prev !== truncated) {
|
|
411
|
+
onChange?.(truncated);
|
|
412
|
+
}
|
|
413
|
+
return truncated;
|
|
414
|
+
});
|
|
415
|
+
}, resizeDetectDelay);
|
|
416
|
+
checkTruncate();
|
|
417
|
+
const observer = new ResizeObserver(checkTruncate);
|
|
418
|
+
observer.observe(element);
|
|
419
|
+
window.addEventListener("resize", checkTruncate);
|
|
420
|
+
return () => {
|
|
421
|
+
observer.disconnect();
|
|
422
|
+
window.removeEventListener("resize", checkTruncate);
|
|
423
|
+
};
|
|
424
|
+
}, [elementRef, onChange, resizeDetectDelay]);
|
|
425
|
+
return isTruncated;
|
|
426
|
+
};
|
|
427
|
+
var useTruncated_default = useTruncated;
|
|
385
428
|
var HeaderCell = ({ rootClassName, labelClassName, context, label, sorterProps }) => {
|
|
386
429
|
const { ref, hovering } = useHover_default();
|
|
387
430
|
const showSorter = sorterProps?.show ?? context.column.getCanSort();
|
|
@@ -1400,6 +1443,7 @@ function SelectContent({
|
|
|
1400
1443
|
function SelectItem({
|
|
1401
1444
|
className,
|
|
1402
1445
|
children,
|
|
1446
|
+
hideCheckIcon,
|
|
1403
1447
|
...props
|
|
1404
1448
|
}) {
|
|
1405
1449
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1412,6 +1456,7 @@ function SelectItem({
|
|
|
1412
1456
|
),
|
|
1413
1457
|
...props,
|
|
1414
1458
|
children: [
|
|
1459
|
+
!hideCheckIcon && //
|
|
1415
1460
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "size-4" }) }) }),
|
|
1416
1461
|
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { children })
|
|
1417
1462
|
]
|
|
@@ -1551,6 +1596,7 @@ function SortableRow({
|
|
|
1551
1596
|
SelectItem,
|
|
1552
1597
|
{
|
|
1553
1598
|
value: opt.id,
|
|
1599
|
+
hideCheckIcon: true,
|
|
1554
1600
|
className: cn(
|
|
1555
1601
|
"focus:bg-[#e8edea]",
|
|
1556
1602
|
opt.id === field.value ? "font-bold bg-[#dae5de] focus:bg-[#dae5de]" : ""
|
|
@@ -1744,11 +1790,12 @@ var GridSettingsModal = ({
|
|
|
1744
1790
|
},
|
|
1745
1791
|
fields[0]?.fieldId
|
|
1746
1792
|
),
|
|
1747
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1793
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1748
1794
|
core.DndContext,
|
|
1749
1795
|
{
|
|
1750
1796
|
sensors,
|
|
1751
1797
|
collisionDetection: core.closestCenter,
|
|
1798
|
+
modifiers: [modifiers.restrictToParentElement, modifiers.restrictToVerticalAxis],
|
|
1752
1799
|
onDragStart: () => setIsDragging(true),
|
|
1753
1800
|
onDragEnd: (event) => {
|
|
1754
1801
|
setIsDragging(false);
|
|
@@ -1774,7 +1821,7 @@ var GridSettingsModal = ({
|
|
|
1774
1821
|
}
|
|
1775
1822
|
)
|
|
1776
1823
|
}
|
|
1777
|
-
),
|
|
1824
|
+
) }),
|
|
1778
1825
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-6", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1779
1826
|
Button2,
|
|
1780
1827
|
{
|
|
@@ -4945,7 +4992,7 @@ function DialogContent2({
|
|
|
4945
4992
|
{
|
|
4946
4993
|
"data-slot": "dialog-content",
|
|
4947
4994
|
className: cn3(
|
|
4948
|
-
"bg-
|
|
4995
|
+
"bg-white data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
|
|
4949
4996
|
className
|
|
4950
4997
|
),
|
|
4951
4998
|
...props,
|
|
@@ -5005,13 +5052,15 @@ var buttonVariants4 = classVarianceAuthority.cva(
|
|
|
5005
5052
|
{
|
|
5006
5053
|
variants: {
|
|
5007
5054
|
variant: {
|
|
5008
|
-
default: "bg-
|
|
5009
|
-
|
|
5010
|
-
|
|
5055
|
+
default: "border bg-[#8B8B8B] text-white shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:hover:bg-input/50",
|
|
5056
|
+
success: "bg-sus-primary-1 text-primary-foreground shadow-xs hover:bg-sus-primary/90",
|
|
5057
|
+
error: "border border-[#BB0B0E] bg-background shadow-xs hover:bg-accent hover:text-accent-foreground text-[#BB0B0E]",
|
|
5058
|
+
warning: "bg-yellow-500 text-black shadow-xs hover:bg-yellow-600 dark:hover:bg-yellow-400",
|
|
5059
|
+
cancel: "border bg-[#8B8B8B] text-white shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:hover:bg-input/50"
|
|
5011
5060
|
},
|
|
5012
5061
|
size: {
|
|
5013
|
-
default: "h-9 px-4
|
|
5014
|
-
option: "py-5 h-9 px-4
|
|
5062
|
+
default: "h-9 px-4 has-[>svg]:px-3",
|
|
5063
|
+
option: "py-5 h-9 px-4 has-[>svg]:px-3",
|
|
5015
5064
|
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
5016
5065
|
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
5017
5066
|
icon: "size-9",
|
|
@@ -5021,7 +5070,7 @@ var buttonVariants4 = classVarianceAuthority.cva(
|
|
|
5021
5070
|
"icon-lg": "size-10"
|
|
5022
5071
|
},
|
|
5023
5072
|
active: {
|
|
5024
|
-
true: "
|
|
5073
|
+
true: "opacity-90 ring-2 ring-offset-1 ring-ring",
|
|
5025
5074
|
false: ""
|
|
5026
5075
|
}
|
|
5027
5076
|
},
|
|
@@ -5044,46 +5093,62 @@ function Button4({
|
|
|
5044
5093
|
Comp,
|
|
5045
5094
|
{
|
|
5046
5095
|
"data-slot": "button",
|
|
5047
|
-
className: cn3(buttonVariants4({ variant, size,
|
|
5096
|
+
className: cn3(buttonVariants4({ variant, size, active, className })),
|
|
5048
5097
|
...props
|
|
5049
5098
|
}
|
|
5050
5099
|
);
|
|
5051
5100
|
}
|
|
5052
|
-
function
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5101
|
+
function DialogAlert({
|
|
5102
|
+
open,
|
|
5103
|
+
onOpenChange,
|
|
5104
|
+
title,
|
|
5105
|
+
description,
|
|
5106
|
+
variant = "default",
|
|
5107
|
+
confirmText,
|
|
5108
|
+
cancelText = "Cancel",
|
|
5109
|
+
onConfirm,
|
|
5110
|
+
onCancel,
|
|
5111
|
+
showCancel = true,
|
|
5112
|
+
align = "center",
|
|
5113
|
+
outlet
|
|
5114
|
+
}) {
|
|
5115
|
+
const alignClass = align === "start" ? "justify-start" : align === "end" ? "justify-end" : "justify-center";
|
|
5116
|
+
const handleCancel = React4.useCallback(() => {
|
|
5117
|
+
onCancel?.();
|
|
5118
|
+
onOpenChange(false);
|
|
5119
|
+
}, [onCancel, onOpenChange]);
|
|
5120
|
+
const handleConfirm = React4.useCallback(() => {
|
|
5121
|
+
onConfirm?.();
|
|
5122
|
+
}, [onConfirm]);
|
|
5123
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Dialog2, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent2, { className: "max-w-md", children: [
|
|
5064
5124
|
/* @__PURE__ */ jsxRuntime.jsxs(DialogHeader2, { children: [
|
|
5065
|
-
/* @__PURE__ */ jsxRuntime.jsx(DialogTitle2, { className:
|
|
5066
|
-
/* @__PURE__ */ jsxRuntime.jsx(DialogDescription2, { children:
|
|
5125
|
+
title && /* @__PURE__ */ jsxRuntime.jsx(DialogTitle2, { className: variantClass(variant), children: title }),
|
|
5126
|
+
description && /* @__PURE__ */ jsxRuntime.jsx(DialogDescription2, { children: description })
|
|
5067
5127
|
] }),
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
{
|
|
5073
|
-
variant: dialogData.variantBtn || "default",
|
|
5074
|
-
disabled: dialogData.btnState === false,
|
|
5075
|
-
onClick: dialogData.onClickBtn,
|
|
5076
|
-
children: dialogData.btn
|
|
5077
|
-
}
|
|
5078
|
-
)
|
|
5128
|
+
outlet && outlet,
|
|
5129
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex gap-3 mt-3 ${alignClass}`, children: [
|
|
5130
|
+
showCancel && /* @__PURE__ */ jsxRuntime.jsx(Button4, { variant: "cancel", onClick: handleCancel, children: cancelText }),
|
|
5131
|
+
confirmText && /* @__PURE__ */ jsxRuntime.jsx(Button4, { variant, onClick: handleConfirm, children: confirmText })
|
|
5079
5132
|
] })
|
|
5080
5133
|
] }) });
|
|
5081
5134
|
}
|
|
5135
|
+
function variantClass(variant) {
|
|
5136
|
+
switch (variant) {
|
|
5137
|
+
case "success":
|
|
5138
|
+
return "text-green-600";
|
|
5139
|
+
case "error":
|
|
5140
|
+
return "text-red-600";
|
|
5141
|
+
case "warning":
|
|
5142
|
+
return "text-yellow-600";
|
|
5143
|
+
default:
|
|
5144
|
+
return "";
|
|
5145
|
+
}
|
|
5146
|
+
}
|
|
5082
5147
|
|
|
5083
5148
|
exports.AdvanceSearch = AdvanceSearch_default;
|
|
5084
5149
|
exports.Button = Button;
|
|
5085
5150
|
exports.DataTable = DataTable_default;
|
|
5086
|
-
exports.
|
|
5151
|
+
exports.DialogAlert = DialogAlert;
|
|
5087
5152
|
exports.FormErrorMessage = FormErrorMessage;
|
|
5088
5153
|
exports.FormField = FormField;
|
|
5089
5154
|
exports.FormFieldContext = FormFieldContext;
|
|
@@ -5100,9 +5165,13 @@ exports.booleanToSelectValue = booleanToSelectValue;
|
|
|
5100
5165
|
exports.buttonVariants = buttonVariants;
|
|
5101
5166
|
exports.cn = cn;
|
|
5102
5167
|
exports.compareAlphanumeric = compareAlphanumeric;
|
|
5168
|
+
exports.debounce = debounce;
|
|
5103
5169
|
exports.getColumnIdFromTable = getColumnIdFromTable;
|
|
5170
|
+
exports.isDefined = isDefined;
|
|
5171
|
+
exports.isEmptyObject = isEmptyObject;
|
|
5104
5172
|
exports.renderContentSlot = renderContentSlot;
|
|
5105
5173
|
exports.selectValueToBoolean = selectValueToBoolean;
|
|
5174
|
+
exports.stripNullishObject = stripNullishObject;
|
|
5106
5175
|
exports.useFormField = useFormField;
|
|
5107
5176
|
exports.useGridSettingsStore = useGridSettingsStore;
|
|
5108
5177
|
exports.useHover = useHover_default;
|
|
@@ -5111,5 +5180,6 @@ exports.useMediaQuery = useMediaQuery_default;
|
|
|
5111
5180
|
exports.usePreventPageLeave = usePreventPageLeave_default;
|
|
5112
5181
|
exports.usePreventPageLeaveStore = usePreventPageLeaveStore_default;
|
|
5113
5182
|
exports.useScreenSize = useScreenSize_default;
|
|
5183
|
+
exports.useTruncated = useTruncated_default;
|
|
5114
5184
|
//# sourceMappingURL=index.js.map
|
|
5115
5185
|
//# sourceMappingURL=index.js.map
|