@sustaina/shared-ui 1.16.0 → 1.18.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/index.d.mts +30 -18
- package/dist/index.d.ts +30 -18
- package/dist/index.js +204 -130
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +203 -130
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -9,6 +9,7 @@ import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
|
9
9
|
import { Header, RowData as RowData$1, Column as Column$1, Table as Table$1, ColumnDef, ColumnFiltersState, OnChangeFn, FilterFnOption, SortingState, ColumnOrderState, VisibilityState, ColumnPinningState, GroupingState, GroupingOptions, ColumnResizeMode, RowSelectionState, Row, ExpandedState, Cell, HeaderGroup, HeaderContext } from '@tanstack/react-table';
|
|
10
10
|
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
11
11
|
import { DialogContentProps as DialogContentProps$1 } from '@radix-ui/react-dialog';
|
|
12
|
+
import { Resource } from 'i18next';
|
|
12
13
|
import * as react_hook_form from 'react-hook-form';
|
|
13
14
|
import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
|
|
14
15
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
@@ -456,14 +457,9 @@ interface DialogAlertProps {
|
|
|
456
457
|
persistent?: boolean;
|
|
457
458
|
}
|
|
458
459
|
type TemplateKeys = "success.saved" | "success.deleted" | "success.removed" | "error.api_db_error" | "error.permission_denied" | "error.session_expired" | "error.user_not_found" | "error.data_not_found" | "error.data_restrict_editing" | "error.network_timeout_error" | "error.queue_full" | "error.invalid_data_format" | "error.data_linked_to_system_data" | "error.pending_workflow_conflict" | "error.invalid_incomplete_data" | "error.client_side_error" | "error.system_limitation" | "error.timeout" | "error.duplicate_data" | "error.something_went_wrong" | "confirm.delete" | "confirm.inactive" | "confirm.active" | "confirm.leave_page" | "confirm.remove" | "confirm.logout";
|
|
459
|
-
type
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
[namespace: string]: {
|
|
463
|
-
[key: string]: any;
|
|
464
|
-
};
|
|
465
|
-
};
|
|
466
|
-
}
|
|
460
|
+
type DialogAlertTemplateUnit = Omit<DialogAlertProps, "open" | "onOpenChange">;
|
|
461
|
+
type DialogAlertTemplates = Record<TemplateKeys, DialogAlertTemplateUnit>;
|
|
462
|
+
type DialogAlertI18nResource = Resource;
|
|
467
463
|
|
|
468
464
|
declare function DialogAlert({ open, onOpenChange, title, description, variant, confirmText, cancelText, onConfirm, onCancel, showCancel, align, outlet, persistent }: DialogAlertProps): react_jsx_runtime.JSX.Element;
|
|
469
465
|
|
|
@@ -481,14 +477,16 @@ interface DialogAlertProviderProps extends React.PropsWithChildren {
|
|
|
481
477
|
* ```
|
|
482
478
|
* {
|
|
483
479
|
* en: {
|
|
484
|
-
*
|
|
485
|
-
*
|
|
486
|
-
*
|
|
487
|
-
*
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
480
|
+
* translation: {
|
|
481
|
+
* dialog_alert: {
|
|
482
|
+
* close: "Close",
|
|
483
|
+
* cancel: "Cancel",
|
|
484
|
+
* "success.saved": {
|
|
485
|
+
title: "Successfully",
|
|
486
|
+
description: "Data has been successfully saved"
|
|
487
|
+
},
|
|
488
|
+
* ....
|
|
489
|
+
* }
|
|
492
490
|
* }
|
|
493
491
|
* }
|
|
494
492
|
* }
|
|
@@ -510,7 +508,7 @@ declare const getDialogAlertControls: () => {
|
|
|
510
508
|
openErrorDialogAlert: (error: unknown) => void;
|
|
511
509
|
};
|
|
512
510
|
|
|
513
|
-
declare const
|
|
511
|
+
declare const DIALOG_ALERT_I18N_SUBNAMESPACE = "dialog_alert";
|
|
514
512
|
|
|
515
513
|
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React$1.JSX.Element;
|
|
516
514
|
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
|
|
@@ -1180,6 +1178,20 @@ declare const ErrorSVGExceedSize: CropperModalError;
|
|
|
1180
1178
|
|
|
1181
1179
|
declare const CropperModal: ({ open, onOpenChange, imageSrc, isSVG, onConfirm, onCancel, onError, cropSize, outputExactCropSize, targetFileSizeKB, generateBlobUrlOutput, title, props }: CropperModalProps) => react_jsx_runtime.JSX.Element;
|
|
1182
1180
|
|
|
1181
|
+
type EllipsisConfig = boolean | {
|
|
1182
|
+
content?: ReactNode;
|
|
1183
|
+
lineClamp?: number;
|
|
1184
|
+
side?: "top" | "bottom" | "left" | "right";
|
|
1185
|
+
} | number;
|
|
1186
|
+
type TruncatedProps = {
|
|
1187
|
+
className?: string;
|
|
1188
|
+
ellipsis?: EllipsisConfig;
|
|
1189
|
+
children: ReactNode;
|
|
1190
|
+
as?: keyof React__default.JSX.IntrinsicElements;
|
|
1191
|
+
style?: CSSProperties;
|
|
1192
|
+
};
|
|
1193
|
+
declare const Truncated: ({ children, className, ellipsis, as, style }: TruncatedProps) => react_jsx_runtime.JSX.Element;
|
|
1194
|
+
|
|
1183
1195
|
declare function isDefined(value: any): boolean;
|
|
1184
1196
|
declare function isEmptyObject(value: any): boolean;
|
|
1185
1197
|
type DebounceOptions = {
|
|
@@ -1292,4 +1304,4 @@ type UseTruncatedOptions<T> = {
|
|
|
1292
1304
|
type UseTruncatedResult = boolean;
|
|
1293
1305
|
declare const useTruncated: <T extends HTMLElement = any>({ elementRef, onChange, resizeDetectDelay }: UseTruncatedOptions<T>) => UseTruncatedResult;
|
|
1294
1306
|
|
|
1295
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AdvanceSearch, ArrowIcon, type Breakpoints, Button, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, type Column, type CroppedImagePayload, type CroppedImagePayloadWithBlobUrl, CropperModal, CropperModalError, type CropperModalErrorType, type CropperModalProps,
|
|
1307
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AdvanceSearch, ArrowIcon, type Breakpoints, Button, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, type Column, type CroppedImagePayload, type CroppedImagePayloadWithBlobUrl, CropperModal, CropperModalError, type CropperModalErrorType, type CropperModalProps, DIALOG_ALERT_I18N_SUBNAMESPACE, DataTable, type DataTableChildrenKeyHandler, type DataTableColumnFilter, type DataTableColumnFilterProps, type DataTableColumnGrouping, type DataTableColumnOrdering, type DataTableColumnPinning, type DataTableColumnSeparatorProps, 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 DataTableRowExpansion, type DataTableRowIdKeyHandler, type DataTableRowSelection, type DataTableScrollFetch, type DataTableStatusContent, type DatatableColumnResizing, DatePicker, type DatePickerProps, type DebounceOptions, type DebouncedFunction, Dialog, DialogAlert, type DialogAlertI18nResource, type DialogAlertProps, DialogAlertProvider, type DialogAlertTemplateUnit, type DialogAlertTemplates, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogTitle, DialogTrigger, type DialogVariant, type EllipsisConfig, ErrorCompression, ErrorCreateCanvas, ErrorGeneratingBlob, ErrorInvalidSVG, ErrorSVGExceedSize, type FieldSchema, type FieldType, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, type GridPayload, GridSettingsModal, type GridSettingsModalProps, HeaderCell, type HeaderCellProps, Image, type ImageLoader, type ImageLoaderProps, type ImageProps, Input, type InputProps, Label, List, ListContainer, type ListContainerProps, ListHeader, type ListHeaderProps, type ListProps, ListTable, type ListTableProps, LookupSelect, type LookupSelectOption, type LookupSelectProps, MonthPicker, type MonthPickerProps, _default as Navbar, type NavbarProps, NotFoundIcon, type Params, Popover, PopoverAnchor, PopoverArrow, PopoverContent, PopoverTrigger, PreventPageLeave, RadioGroupItem, RadioGroupRoot, RadioLabel, RichText, type RowClickType, type RowState, type ScrollInfo, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarLayout, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, type SorterProps, Spinner, type SpinnerProps, type StatusContentKey, SuiCalendarIcon, SuiCheckIcon, SuiDotsVerticalIcon, SuiEmptyDataIcon, SuiExpandIcon, SuiFilterIcon, SuiSettingIcon, SuiTriangleDownIcon, SuiWarningIcon, Switch, type TemplateKeys, Textarea, Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipTrigger, Truncated, type TruncatedProps, index as UI, type UseHoverResult, type UseMediaQueryOptions, type UseMediaQueryResult, type UsePreventPageLeaveOptions, type UseScreenSizeResult, type UseTruncatedOptions, type UseTruncatedResult, booleanToSelectValue, buttonVariants, cn, compareAlphanumeric, debounce, formatISODate, getDialogAlertControls, getDialogTemplates, inputVariants, isDefined, isEmptyObject, selectValueToBoolean, spinnerVariants, stripNullishObject, throttle, useFormField, useGridSettingsStore, useHover, useIntersectionObserver, useMediaQuery, usePreventPageLeave, usePreventPageLeaveStore, useScreenSize, useSidebar, useTruncated };
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
|
9
9
|
import { Header, RowData as RowData$1, Column as Column$1, Table as Table$1, ColumnDef, ColumnFiltersState, OnChangeFn, FilterFnOption, SortingState, ColumnOrderState, VisibilityState, ColumnPinningState, GroupingState, GroupingOptions, ColumnResizeMode, RowSelectionState, Row, ExpandedState, Cell, HeaderGroup, HeaderContext } from '@tanstack/react-table';
|
|
10
10
|
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
11
11
|
import { DialogContentProps as DialogContentProps$1 } from '@radix-ui/react-dialog';
|
|
12
|
+
import { Resource } from 'i18next';
|
|
12
13
|
import * as react_hook_form from 'react-hook-form';
|
|
13
14
|
import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
|
|
14
15
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
@@ -456,14 +457,9 @@ interface DialogAlertProps {
|
|
|
456
457
|
persistent?: boolean;
|
|
457
458
|
}
|
|
458
459
|
type TemplateKeys = "success.saved" | "success.deleted" | "success.removed" | "error.api_db_error" | "error.permission_denied" | "error.session_expired" | "error.user_not_found" | "error.data_not_found" | "error.data_restrict_editing" | "error.network_timeout_error" | "error.queue_full" | "error.invalid_data_format" | "error.data_linked_to_system_data" | "error.pending_workflow_conflict" | "error.invalid_incomplete_data" | "error.client_side_error" | "error.system_limitation" | "error.timeout" | "error.duplicate_data" | "error.something_went_wrong" | "confirm.delete" | "confirm.inactive" | "confirm.active" | "confirm.leave_page" | "confirm.remove" | "confirm.logout";
|
|
459
|
-
type
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
[namespace: string]: {
|
|
463
|
-
[key: string]: any;
|
|
464
|
-
};
|
|
465
|
-
};
|
|
466
|
-
}
|
|
460
|
+
type DialogAlertTemplateUnit = Omit<DialogAlertProps, "open" | "onOpenChange">;
|
|
461
|
+
type DialogAlertTemplates = Record<TemplateKeys, DialogAlertTemplateUnit>;
|
|
462
|
+
type DialogAlertI18nResource = Resource;
|
|
467
463
|
|
|
468
464
|
declare function DialogAlert({ open, onOpenChange, title, description, variant, confirmText, cancelText, onConfirm, onCancel, showCancel, align, outlet, persistent }: DialogAlertProps): react_jsx_runtime.JSX.Element;
|
|
469
465
|
|
|
@@ -481,14 +477,16 @@ interface DialogAlertProviderProps extends React.PropsWithChildren {
|
|
|
481
477
|
* ```
|
|
482
478
|
* {
|
|
483
479
|
* en: {
|
|
484
|
-
*
|
|
485
|
-
*
|
|
486
|
-
*
|
|
487
|
-
*
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
480
|
+
* translation: {
|
|
481
|
+
* dialog_alert: {
|
|
482
|
+
* close: "Close",
|
|
483
|
+
* cancel: "Cancel",
|
|
484
|
+
* "success.saved": {
|
|
485
|
+
title: "Successfully",
|
|
486
|
+
description: "Data has been successfully saved"
|
|
487
|
+
},
|
|
488
|
+
* ....
|
|
489
|
+
* }
|
|
492
490
|
* }
|
|
493
491
|
* }
|
|
494
492
|
* }
|
|
@@ -510,7 +508,7 @@ declare const getDialogAlertControls: () => {
|
|
|
510
508
|
openErrorDialogAlert: (error: unknown) => void;
|
|
511
509
|
};
|
|
512
510
|
|
|
513
|
-
declare const
|
|
511
|
+
declare const DIALOG_ALERT_I18N_SUBNAMESPACE = "dialog_alert";
|
|
514
512
|
|
|
515
513
|
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React$1.JSX.Element;
|
|
516
514
|
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
|
|
@@ -1180,6 +1178,20 @@ declare const ErrorSVGExceedSize: CropperModalError;
|
|
|
1180
1178
|
|
|
1181
1179
|
declare const CropperModal: ({ open, onOpenChange, imageSrc, isSVG, onConfirm, onCancel, onError, cropSize, outputExactCropSize, targetFileSizeKB, generateBlobUrlOutput, title, props }: CropperModalProps) => react_jsx_runtime.JSX.Element;
|
|
1182
1180
|
|
|
1181
|
+
type EllipsisConfig = boolean | {
|
|
1182
|
+
content?: ReactNode;
|
|
1183
|
+
lineClamp?: number;
|
|
1184
|
+
side?: "top" | "bottom" | "left" | "right";
|
|
1185
|
+
} | number;
|
|
1186
|
+
type TruncatedProps = {
|
|
1187
|
+
className?: string;
|
|
1188
|
+
ellipsis?: EllipsisConfig;
|
|
1189
|
+
children: ReactNode;
|
|
1190
|
+
as?: keyof React__default.JSX.IntrinsicElements;
|
|
1191
|
+
style?: CSSProperties;
|
|
1192
|
+
};
|
|
1193
|
+
declare const Truncated: ({ children, className, ellipsis, as, style }: TruncatedProps) => react_jsx_runtime.JSX.Element;
|
|
1194
|
+
|
|
1183
1195
|
declare function isDefined(value: any): boolean;
|
|
1184
1196
|
declare function isEmptyObject(value: any): boolean;
|
|
1185
1197
|
type DebounceOptions = {
|
|
@@ -1292,4 +1304,4 @@ type UseTruncatedOptions<T> = {
|
|
|
1292
1304
|
type UseTruncatedResult = boolean;
|
|
1293
1305
|
declare const useTruncated: <T extends HTMLElement = any>({ elementRef, onChange, resizeDetectDelay }: UseTruncatedOptions<T>) => UseTruncatedResult;
|
|
1294
1306
|
|
|
1295
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AdvanceSearch, ArrowIcon, type Breakpoints, Button, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, type Column, type CroppedImagePayload, type CroppedImagePayloadWithBlobUrl, CropperModal, CropperModalError, type CropperModalErrorType, type CropperModalProps,
|
|
1307
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AdvanceSearch, ArrowIcon, type Breakpoints, Button, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, type Column, type CroppedImagePayload, type CroppedImagePayloadWithBlobUrl, CropperModal, CropperModalError, type CropperModalErrorType, type CropperModalProps, DIALOG_ALERT_I18N_SUBNAMESPACE, DataTable, type DataTableChildrenKeyHandler, type DataTableColumnFilter, type DataTableColumnFilterProps, type DataTableColumnGrouping, type DataTableColumnOrdering, type DataTableColumnPinning, type DataTableColumnSeparatorProps, 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 DataTableRowExpansion, type DataTableRowIdKeyHandler, type DataTableRowSelection, type DataTableScrollFetch, type DataTableStatusContent, type DatatableColumnResizing, DatePicker, type DatePickerProps, type DebounceOptions, type DebouncedFunction, Dialog, DialogAlert, type DialogAlertI18nResource, type DialogAlertProps, DialogAlertProvider, type DialogAlertTemplateUnit, type DialogAlertTemplates, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogTitle, DialogTrigger, type DialogVariant, type EllipsisConfig, ErrorCompression, ErrorCreateCanvas, ErrorGeneratingBlob, ErrorInvalidSVG, ErrorSVGExceedSize, type FieldSchema, type FieldType, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, type GridPayload, GridSettingsModal, type GridSettingsModalProps, HeaderCell, type HeaderCellProps, Image, type ImageLoader, type ImageLoaderProps, type ImageProps, Input, type InputProps, Label, List, ListContainer, type ListContainerProps, ListHeader, type ListHeaderProps, type ListProps, ListTable, type ListTableProps, LookupSelect, type LookupSelectOption, type LookupSelectProps, MonthPicker, type MonthPickerProps, _default as Navbar, type NavbarProps, NotFoundIcon, type Params, Popover, PopoverAnchor, PopoverArrow, PopoverContent, PopoverTrigger, PreventPageLeave, RadioGroupItem, RadioGroupRoot, RadioLabel, RichText, type RowClickType, type RowState, type ScrollInfo, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarLayout, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, type SorterProps, Spinner, type SpinnerProps, type StatusContentKey, SuiCalendarIcon, SuiCheckIcon, SuiDotsVerticalIcon, SuiEmptyDataIcon, SuiExpandIcon, SuiFilterIcon, SuiSettingIcon, SuiTriangleDownIcon, SuiWarningIcon, Switch, type TemplateKeys, Textarea, Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipTrigger, Truncated, type TruncatedProps, index as UI, type UseHoverResult, type UseMediaQueryOptions, type UseMediaQueryResult, type UsePreventPageLeaveOptions, type UseScreenSizeResult, type UseTruncatedOptions, type UseTruncatedResult, booleanToSelectValue, buttonVariants, cn, compareAlphanumeric, debounce, formatISODate, getDialogAlertControls, getDialogTemplates, inputVariants, isDefined, isEmptyObject, selectValueToBoolean, spinnerVariants, stripNullishObject, throttle, useFormField, useGridSettingsStore, useHover, useIntersectionObserver, useMediaQuery, usePreventPageLeave, usePreventPageLeaveStore, useScreenSize, useSidebar, useTruncated };
|
package/dist/index.js
CHANGED
|
@@ -4948,127 +4948,130 @@ function Button2({
|
|
|
4948
4948
|
}
|
|
4949
4949
|
|
|
4950
4950
|
// src/components/dialog-alert/lib/constants.ts
|
|
4951
|
-
var
|
|
4951
|
+
var DIALOG_ALERT_I18N_SUBNAMESPACE = "dialog_alert";
|
|
4952
|
+
var i18nPrefix = `translation:${DIALOG_ALERT_I18N_SUBNAMESPACE}.`;
|
|
4952
4953
|
|
|
4953
4954
|
// src/components/dialog-alert/locale/default.ts
|
|
4954
4955
|
var defaultResource = {
|
|
4955
4956
|
sharedui: {
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
4957
|
+
translation: {
|
|
4958
|
+
[DIALOG_ALERT_I18N_SUBNAMESPACE]: {
|
|
4959
|
+
cancel: "Cancel",
|
|
4960
|
+
close: "Close",
|
|
4961
|
+
"success.saved": {
|
|
4962
|
+
title: "Successfully",
|
|
4963
|
+
description: "Data has been successfully saved"
|
|
4964
|
+
},
|
|
4965
|
+
"success.deleted": {
|
|
4966
|
+
title: "Successfully",
|
|
4967
|
+
description: "Data has been successfully deleted"
|
|
4968
|
+
},
|
|
4969
|
+
"success.removed": {
|
|
4970
|
+
title: "Successfully",
|
|
4971
|
+
description: "Data has been successfully removed"
|
|
4972
|
+
},
|
|
4973
|
+
"error.api_db_error": {
|
|
4974
|
+
title: "API/Database Error",
|
|
4975
|
+
description: "Failed to connect to the system. Please check API or database connection."
|
|
4976
|
+
},
|
|
4977
|
+
"error.permission_denied": {
|
|
4978
|
+
title: "Permission Denied",
|
|
4979
|
+
description: "You do not have permission to delete this data.",
|
|
4980
|
+
confirm_text: "Discard"
|
|
4981
|
+
},
|
|
4982
|
+
"error.session_expired": {
|
|
4983
|
+
title: "Session Expired",
|
|
4984
|
+
description: "Your session has expired or you have been logged out. Please sign in again.",
|
|
4985
|
+
confirm_text: "Logout"
|
|
4986
|
+
},
|
|
4987
|
+
"error.user_not_found": {
|
|
4988
|
+
title: "User Not Found",
|
|
4989
|
+
description: "The system could not locate the user account.",
|
|
4990
|
+
confirm_text: "Logout"
|
|
4991
|
+
},
|
|
4992
|
+
"error.data_not_found": {
|
|
4993
|
+
title: "Data Not Found",
|
|
4994
|
+
description: "The data has already been deleted or does not exist in the system."
|
|
4995
|
+
},
|
|
4996
|
+
"error.data_restrict_editing": {
|
|
4997
|
+
title: "Data Status Restricts Editing",
|
|
4998
|
+
description: "Data status does not allow editing."
|
|
4999
|
+
},
|
|
5000
|
+
"error.network_timeout_error": {
|
|
5001
|
+
title: "Network Error / Timeout",
|
|
5002
|
+
description: "The system could not connect to the network or the request took too long to process."
|
|
5003
|
+
},
|
|
5004
|
+
"error.queue_full": {
|
|
5005
|
+
title: "Queue Full",
|
|
5006
|
+
description: "The notification queue has reached its limit. Please try again later."
|
|
5007
|
+
},
|
|
5008
|
+
"error.invalid_data_format": {
|
|
5009
|
+
title: "Invalid Data Format",
|
|
5010
|
+
description: "Data creation failed due to invalid or incorrectly formatted data."
|
|
5011
|
+
},
|
|
5012
|
+
"error.data_linked_to_system_data": {
|
|
5013
|
+
title: "Data Linked to System Data",
|
|
5014
|
+
description: "Cannot delete data because they are linked to existing system data."
|
|
5015
|
+
},
|
|
5016
|
+
"error.pending_workflow_conflict": {
|
|
5017
|
+
title: "Pending Workflow Conflict ",
|
|
5018
|
+
description: "The data is currently involved in a pending workflow or approval process and cannot be deactivated."
|
|
5019
|
+
},
|
|
5020
|
+
"error.invalid_incomplete_data": {
|
|
5021
|
+
title: "Invalid or Incomplete Data",
|
|
5022
|
+
description: "Data status cannot be changed due to incomplete or invalid information."
|
|
5023
|
+
},
|
|
5024
|
+
"error.client_side_error": {
|
|
5025
|
+
title: "Client-Side Error",
|
|
5026
|
+
description: "An error occurred on the client side. Please refresh the page or try again."
|
|
5027
|
+
},
|
|
5028
|
+
"error.system_limitation": {
|
|
5029
|
+
title: "System Limitation",
|
|
5030
|
+
description: "The search cannot be completed due to system limitations. Please simplify your query."
|
|
5031
|
+
},
|
|
5032
|
+
"error.timeout": {
|
|
5033
|
+
title: "Timeout",
|
|
5034
|
+
description: "Request failed due to a system error or timeout. Please try again."
|
|
5035
|
+
},
|
|
5036
|
+
"error.duplicate_data": {
|
|
5037
|
+
title: "Duplicate Data",
|
|
5038
|
+
description: "The data you entered already exists in the system."
|
|
5039
|
+
},
|
|
5040
|
+
"error.something_went_wrong": {
|
|
5041
|
+
title: "Something Went Wrong",
|
|
5042
|
+
description: "An unknown error occurred."
|
|
5043
|
+
},
|
|
5044
|
+
"confirm.delete": {
|
|
5045
|
+
title: "Confirmation",
|
|
5046
|
+
description: "Are you sure you want to delete this item?",
|
|
5047
|
+
confirm_text: "Delete"
|
|
5048
|
+
},
|
|
5049
|
+
"confirm.inactive": {
|
|
5050
|
+
title: "Confirmation",
|
|
5051
|
+
description: "Are you sure you want to inactive this item?",
|
|
5052
|
+
confirm_text: "Inactive"
|
|
5053
|
+
},
|
|
5054
|
+
"confirm.active": {
|
|
5055
|
+
variant: "confirm-green",
|
|
5056
|
+
title: "Confirmation",
|
|
5057
|
+
description: "Are you sure you want to active this item?",
|
|
5058
|
+
confirm_text: "Active"
|
|
5059
|
+
},
|
|
5060
|
+
"confirm.leave_page": {
|
|
5061
|
+
title: "Confirmation",
|
|
5062
|
+
description: "Unsaved changes. Do you want to leave this page?",
|
|
5063
|
+
confirm_text: "Leave"
|
|
5064
|
+
},
|
|
5065
|
+
"confirm.remove": {
|
|
5066
|
+
title: "Confirmation",
|
|
5067
|
+
description: "Are you sure you want to remove this item?",
|
|
5068
|
+
confirm_text: "Remove"
|
|
5069
|
+
},
|
|
5070
|
+
"confirm.logout": {
|
|
5071
|
+
title: "Confirmation",
|
|
5072
|
+
description: "Do you want to log out?",
|
|
5073
|
+
confirm_text: "Logout"
|
|
5074
|
+
}
|
|
5072
5075
|
}
|
|
5073
5076
|
}
|
|
5074
5077
|
}
|
|
@@ -5079,7 +5082,7 @@ i18n__default.default.use(reactI18next.initReactI18next).init({
|
|
|
5079
5082
|
resources: defaultResource,
|
|
5080
5083
|
lng: "sharedui",
|
|
5081
5084
|
fallbackLng: "sharedui",
|
|
5082
|
-
defaultNS:
|
|
5085
|
+
defaultNS: "translation",
|
|
5083
5086
|
interpolation: {
|
|
5084
5087
|
escapeValue: false
|
|
5085
5088
|
// react already safes from xss
|
|
@@ -5110,7 +5113,7 @@ function DialogAlert({
|
|
|
5110
5113
|
persistent = false
|
|
5111
5114
|
}) {
|
|
5112
5115
|
const alignClass = align === "start" ? "justify-start" : align === "end" ? "justify-end" : "justify-center";
|
|
5113
|
-
const { t } = reactI18next.useTranslation(
|
|
5116
|
+
const { t } = reactI18next.useTranslation();
|
|
5114
5117
|
const handleCancel = React4.useCallback(() => {
|
|
5115
5118
|
onCancel?.();
|
|
5116
5119
|
onOpenChange(false);
|
|
@@ -5305,6 +5308,10 @@ var useDialogAlertStore = zustand.create((set, get) => ({
|
|
|
5305
5308
|
let templateVal;
|
|
5306
5309
|
if (payload?.template) {
|
|
5307
5310
|
templateVal = getDialogTemplates({ setOpen: get().setOpen })[payload.template];
|
|
5311
|
+
templateVal.title = templateVal.title ? i18nPrefix + templateVal.title : void 0;
|
|
5312
|
+
templateVal.description = templateVal.description ? i18nPrefix + templateVal.description : void 0;
|
|
5313
|
+
templateVal.confirmText = templateVal.confirmText ? i18nPrefix + templateVal.confirmText : void 0;
|
|
5314
|
+
templateVal.cancelText = templateVal.cancelText ? i18nPrefix + templateVal.cancelText : void 0;
|
|
5308
5315
|
}
|
|
5309
5316
|
get().setDialogProps({ ...templateVal, ...payload?.props });
|
|
5310
5317
|
get().setOpen(true);
|
|
@@ -5322,17 +5329,16 @@ var DialogAlertProvider = ({ children, i18nResource, i18nLang }) => {
|
|
|
5322
5329
|
i18n_default.changeLanguage("sharedui");
|
|
5323
5330
|
return;
|
|
5324
5331
|
}
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
lang,
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5332
|
+
try {
|
|
5333
|
+
const langs = Object.keys(i18nResource);
|
|
5334
|
+
for (const lang of langs) {
|
|
5335
|
+
i18n_default.addResourceBundle(lang, "translation", i18nResource[lang]["translation"], false, true);
|
|
5336
|
+
}
|
|
5337
|
+
i18n_default.changeLanguage(i18nLang);
|
|
5338
|
+
} catch {
|
|
5339
|
+
i18n_default.changeLanguage("sharedui");
|
|
5340
|
+
return;
|
|
5334
5341
|
}
|
|
5335
|
-
i18n_default.changeLanguage(i18nLang);
|
|
5336
5342
|
}, [i18nLang, i18nResource]);
|
|
5337
5343
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5338
5344
|
children,
|
|
@@ -8709,6 +8715,73 @@ var CropperModal = ({
|
|
|
8709
8715
|
}
|
|
8710
8716
|
);
|
|
8711
8717
|
};
|
|
8718
|
+
var Truncated = ({ children, className, ellipsis = true, as = "p", style }) => {
|
|
8719
|
+
const elementRef = React4.useRef(null);
|
|
8720
|
+
const [open, setOpen] = React4.useState(false);
|
|
8721
|
+
const [isTruncated, setIsTruncated] = React4.useState(false);
|
|
8722
|
+
const Comp = as;
|
|
8723
|
+
const normalizedChildren = typeof children === "string" ? children.replace(/>/g, ">\u200B") : children;
|
|
8724
|
+
React4.useEffect(() => {
|
|
8725
|
+
const el = elementRef.current;
|
|
8726
|
+
if (!el) return;
|
|
8727
|
+
const checkTruncate = debounce(() => {
|
|
8728
|
+
const overflowX = el.scrollWidth > el.clientWidth;
|
|
8729
|
+
const overflowY = el.scrollHeight > el.clientHeight;
|
|
8730
|
+
setIsTruncated(overflowX || overflowY);
|
|
8731
|
+
}, 300);
|
|
8732
|
+
const resizeObserver = new ResizeObserver(checkTruncate);
|
|
8733
|
+
resizeObserver.observe(el);
|
|
8734
|
+
return () => {
|
|
8735
|
+
resizeObserver.disconnect();
|
|
8736
|
+
};
|
|
8737
|
+
}, []);
|
|
8738
|
+
const lineClampLines = typeof ellipsis === "number" ? ellipsis : typeof ellipsis === "object" ? ellipsis.lineClamp ?? 3 : null;
|
|
8739
|
+
const truncationClass = React4.useMemo(() => {
|
|
8740
|
+
if (!ellipsis) return "";
|
|
8741
|
+
if (typeof ellipsis === "number") return `line-clamp-${ellipsis}`;
|
|
8742
|
+
if (typeof ellipsis === "object") return `line-clamp-${lineClampLines ?? 3}`;
|
|
8743
|
+
return "truncate";
|
|
8744
|
+
}, [ellipsis, lineClampLines]);
|
|
8745
|
+
const clampedStyle = React4.useMemo(() => {
|
|
8746
|
+
if (!lineClampLines) return style;
|
|
8747
|
+
return {
|
|
8748
|
+
...style,
|
|
8749
|
+
display: "-webkit-box",
|
|
8750
|
+
WebkitLineClamp: lineClampLines,
|
|
8751
|
+
WebkitBoxOrient: "vertical",
|
|
8752
|
+
overflow: "hidden"
|
|
8753
|
+
};
|
|
8754
|
+
}, [lineClampLines, style]);
|
|
8755
|
+
const baseContent = /* @__PURE__ */ jsxRuntime.jsx(Comp, { ref: elementRef, className: cn(truncationClass, className), style: clampedStyle, children: normalizedChildren });
|
|
8756
|
+
let tooltipContent = normalizedChildren;
|
|
8757
|
+
let tooltipSide = "top";
|
|
8758
|
+
if (typeof ellipsis === "object") {
|
|
8759
|
+
tooltipContent = ellipsis?.content ?? normalizedChildren;
|
|
8760
|
+
tooltipSide = ellipsis?.side ?? "top";
|
|
8761
|
+
}
|
|
8762
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8763
|
+
Tooltip2,
|
|
8764
|
+
{
|
|
8765
|
+
open,
|
|
8766
|
+
onOpenChange: (open2) => {
|
|
8767
|
+
setOpen(isTruncated && open2);
|
|
8768
|
+
},
|
|
8769
|
+
children: [
|
|
8770
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger2, { asChild: true, children: baseContent }),
|
|
8771
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8772
|
+
TooltipContent2,
|
|
8773
|
+
{
|
|
8774
|
+
side: tooltipSide,
|
|
8775
|
+
className: cn("text-white bg-[#8B8B8B] max-w-md wrap-break-word shadow-lg"),
|
|
8776
|
+
arrowClassName: "bg-[#8B8B8B] fill-[#8B8B8B]",
|
|
8777
|
+
children: tooltipContent
|
|
8778
|
+
}
|
|
8779
|
+
)
|
|
8780
|
+
]
|
|
8781
|
+
}
|
|
8782
|
+
);
|
|
8783
|
+
};
|
|
8784
|
+
var truncated_default = Truncated;
|
|
8712
8785
|
|
|
8713
8786
|
exports.Accordion = Accordion;
|
|
8714
8787
|
exports.AccordionContent = AccordionContent;
|
|
@@ -8723,7 +8796,7 @@ exports.CollapsibleContent = CollapsibleContent2;
|
|
|
8723
8796
|
exports.CollapsibleTrigger = CollapsibleTrigger2;
|
|
8724
8797
|
exports.CropperModal = CropperModal;
|
|
8725
8798
|
exports.CropperModalError = CropperModalError;
|
|
8726
|
-
exports.
|
|
8799
|
+
exports.DIALOG_ALERT_I18N_SUBNAMESPACE = DIALOG_ALERT_I18N_SUBNAMESPACE;
|
|
8727
8800
|
exports.DataTable = DataTable_default;
|
|
8728
8801
|
exports.DatePicker = DatePicker2;
|
|
8729
8802
|
exports.Dialog = Dialog;
|
|
@@ -8830,6 +8903,7 @@ exports.TooltipArrow = TooltipArrow;
|
|
|
8830
8903
|
exports.TooltipContent = TooltipContent;
|
|
8831
8904
|
exports.TooltipProvider = TooltipProvider;
|
|
8832
8905
|
exports.TooltipTrigger = TooltipTrigger;
|
|
8906
|
+
exports.Truncated = truncated_default;
|
|
8833
8907
|
exports.UI = ui_exports;
|
|
8834
8908
|
exports.booleanToSelectValue = booleanToSelectValue;
|
|
8835
8909
|
exports.buttonVariants = buttonVariants;
|