@sustaina/shared-ui 1.66.0 → 1.67.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 +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +28 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -39,6 +39,7 @@ type AuditFooterProps = {
|
|
|
39
39
|
updatedBy?: string | null;
|
|
40
40
|
onDelete?: () => void;
|
|
41
41
|
canDelete?: boolean;
|
|
42
|
+
canDeleteBehavior?: "hidden" | "disabled";
|
|
42
43
|
emptyValue?: React__default.ReactNode;
|
|
43
44
|
labels?: {
|
|
44
45
|
createdOn?: string;
|
|
@@ -641,7 +642,7 @@ interface DialogAlertProps {
|
|
|
641
642
|
outlet?: React.ReactNode | null;
|
|
642
643
|
persistent?: boolean;
|
|
643
644
|
}
|
|
644
|
-
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.reset_form" | "confirm.remove" | "confirm.logout";
|
|
645
|
+
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.reset_form" | "confirm.remove" | "confirm.logout" | "confirm.set_default" | "confirm.unset_default";
|
|
645
646
|
type DialogAlertTemplateUnit = Omit<DialogAlertProps, "open" | "onOpenChange">;
|
|
646
647
|
type DialogAlertTemplates = Record<TemplateKeys, DialogAlertTemplateUnit>;
|
|
647
648
|
type DialogAlertI18nResource = Resource;
|
package/dist/index.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ type AuditFooterProps = {
|
|
|
39
39
|
updatedBy?: string | null;
|
|
40
40
|
onDelete?: () => void;
|
|
41
41
|
canDelete?: boolean;
|
|
42
|
+
canDeleteBehavior?: "hidden" | "disabled";
|
|
42
43
|
emptyValue?: React__default.ReactNode;
|
|
43
44
|
labels?: {
|
|
44
45
|
createdOn?: string;
|
|
@@ -641,7 +642,7 @@ interface DialogAlertProps {
|
|
|
641
642
|
outlet?: React.ReactNode | null;
|
|
642
643
|
persistent?: boolean;
|
|
643
644
|
}
|
|
644
|
-
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.reset_form" | "confirm.remove" | "confirm.logout";
|
|
645
|
+
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.reset_form" | "confirm.remove" | "confirm.logout" | "confirm.set_default" | "confirm.unset_default";
|
|
645
646
|
type DialogAlertTemplateUnit = Omit<DialogAlertProps, "open" | "onOpenChange">;
|
|
646
647
|
type DialogAlertTemplates = Record<TemplateKeys, DialogAlertTemplateUnit>;
|
|
647
648
|
type DialogAlertI18nResource = Resource;
|
package/dist/index.js
CHANGED
|
@@ -3472,6 +3472,7 @@ var AuditFooter = ({
|
|
|
3472
3472
|
updatedBy,
|
|
3473
3473
|
onDelete,
|
|
3474
3474
|
canDelete = true,
|
|
3475
|
+
canDeleteBehavior,
|
|
3475
3476
|
emptyValue = "-",
|
|
3476
3477
|
labels,
|
|
3477
3478
|
classNames,
|
|
@@ -3492,6 +3493,9 @@ var AuditFooter = ({
|
|
|
3492
3493
|
const timeFormatter = formatters?.time ?? ((value) => formatISODate(value, "H:i:s"));
|
|
3493
3494
|
const userFormatter = formatters?.user ?? ((value) => value ?? emptyValue);
|
|
3494
3495
|
const resolvedDeleteIcon = deleteIcon ?? /* @__PURE__ */ jsxRuntime.jsx(TrashIcon, { className: "w-5 h-5" });
|
|
3496
|
+
const resolvedCanDeleteBehavior = canDeleteBehavior ?? "hidden";
|
|
3497
|
+
const shouldShowDelete = canDelete || resolvedCanDeleteBehavior === "disabled";
|
|
3498
|
+
const deleteButtonClassName = canDelete ? cn("w-5 h-5 cursor-pointer text-red-500", classNames?.deleteButton) : cn("w-5 h-5 text-gray-300 cursor-not-allowed", classNames?.deleteButtonDisabled);
|
|
3495
3499
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex w-full h-14 mt-12 justify-between items-end px-3", classNames?.root), children: [
|
|
3496
3500
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3497
3501
|
"div",
|
|
@@ -3516,10 +3520,10 @@ var AuditFooter = ({
|
|
|
3516
3520
|
]
|
|
3517
3521
|
}
|
|
3518
3522
|
),
|
|
3519
|
-
|
|
3523
|
+
shouldShowDelete && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3520
3524
|
"div",
|
|
3521
3525
|
{
|
|
3522
|
-
className:
|
|
3526
|
+
className: deleteButtonClassName,
|
|
3523
3527
|
onClick: canDelete ? onDelete : void 0,
|
|
3524
3528
|
"aria-label": deleteAriaLabel,
|
|
3525
3529
|
role: "button",
|
|
@@ -10800,6 +10804,18 @@ var DIALOG_ALERT_TEMPLATES = {
|
|
|
10800
10804
|
title: "confirm.logout.title",
|
|
10801
10805
|
description: "confirm.logout.description",
|
|
10802
10806
|
confirmText: "confirm.logout.confirm_text"
|
|
10807
|
+
},
|
|
10808
|
+
"confirm.set_default": {
|
|
10809
|
+
variant: "confirm",
|
|
10810
|
+
title: "confirm.set_default.title",
|
|
10811
|
+
description: "confirm.set_default.description",
|
|
10812
|
+
confirmText: "confirm.set_default.confirm_text"
|
|
10813
|
+
},
|
|
10814
|
+
"confirm.unset_default": {
|
|
10815
|
+
variant: "confirm",
|
|
10816
|
+
title: "confirm.unset_default.title",
|
|
10817
|
+
description: "confirm.unset_default.description",
|
|
10818
|
+
confirmText: "confirm.unset_default.confirm_text"
|
|
10803
10819
|
}
|
|
10804
10820
|
};
|
|
10805
10821
|
|
|
@@ -10929,6 +10945,16 @@ var defaultResource = {
|
|
|
10929
10945
|
title: "Confirmation",
|
|
10930
10946
|
description: "Do you want to log out?",
|
|
10931
10947
|
confirm_text: "Logout"
|
|
10948
|
+
},
|
|
10949
|
+
"confirm.set_default": {
|
|
10950
|
+
title: "Confirmation",
|
|
10951
|
+
description: "Set this item as the default?",
|
|
10952
|
+
confirm_text: "Confirm"
|
|
10953
|
+
},
|
|
10954
|
+
"confirm.unset_default": {
|
|
10955
|
+
title: "Confirmation",
|
|
10956
|
+
description: "Remove default status from this item?",
|
|
10957
|
+
confirm_text: "Confirm"
|
|
10932
10958
|
}
|
|
10933
10959
|
}
|
|
10934
10960
|
}
|