@sustaina/shared-ui 1.36.0 → 1.37.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 -2
- package/dist/index.d.ts +30 -2
- package/dist/index.js +243 -160
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +243 -162
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import * as React25 from 'react';
|
|
2
|
+
import React25__default, { forwardRef, useRef, useMemo, useCallback, useState, isValidElement, useEffect, useLayoutEffect, createElement } from 'react';
|
|
3
|
+
import { useRouter } from '@tanstack/react-router';
|
|
4
|
+
import { create } from 'zustand';
|
|
1
5
|
import clsx2, { clsx } from 'clsx';
|
|
2
6
|
import { twMerge } from 'tailwind-merge';
|
|
3
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
8
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
5
|
-
import * as React25 from 'react';
|
|
6
|
-
import React25__default, { forwardRef, useRef, useMemo, useCallback, useState, isValidElement, useEffect, useLayoutEffect, createElement } from 'react';
|
|
7
9
|
import { CircleX, Undo, Redo, Bold, Italic, Underline, Strikethrough, Code, Pilcrow, Heading1, Heading2, Heading3, List, ListOrdered, Quote, CodeSquare, Link, Link2Off, Image as Image$1, AlignLeft, AlignCenter, AlignRight, CircleHelp, ChevronDown, X, Check, XIcon, SearchIcon, ChevronRight, CheckIcon, Triangle, CalendarIcon, Search, ChevronUp, ChevronLeft, PanelLeftIcon, Minimize2, Maximize2, Plus, MoreVertical, Bug, GripVertical, Info, CircleMinus, Minus } from 'lucide-react';
|
|
8
10
|
import { createPortal } from 'react-dom';
|
|
9
11
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
@@ -17,9 +19,8 @@ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
|
17
19
|
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
18
20
|
import { reSplitAlphaNumeric, useReactTable, getCoreRowModel, getGroupedRowModel, getExpandedRowModel, getSortedRowModel, getFilteredRowModel, flexRender } from '@tanstack/react-table';
|
|
19
21
|
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
20
|
-
import { initReactI18next, useTranslation } from 'react-i18next';
|
|
22
|
+
import { initReactI18next, useTranslation, I18nextProvider } from 'react-i18next';
|
|
21
23
|
import i18n from 'i18next';
|
|
22
|
-
import { create } from 'zustand';
|
|
23
24
|
import StarterKit from '@tiptap/starter-kit';
|
|
24
25
|
import { ReactNodeViewRenderer, NodeViewWrapper, useEditor, EditorContent } from '@tiptap/react';
|
|
25
26
|
import ReactDOM from 'react-dom/client';
|
|
@@ -225,6 +226,82 @@ function formatISODate(isoDate, format5 = "d/m/Y H:i") {
|
|
|
225
226
|
return partKey ? parts[partKey] : match;
|
|
226
227
|
});
|
|
227
228
|
}
|
|
229
|
+
function useSafeBlocker({
|
|
230
|
+
shouldBlockFn,
|
|
231
|
+
enableBeforeUnload = true,
|
|
232
|
+
disabled = false,
|
|
233
|
+
withResolver = false
|
|
234
|
+
}) {
|
|
235
|
+
const router = useRouter({ warn: false });
|
|
236
|
+
const [resolver, setResolver] = useState({
|
|
237
|
+
status: "idle",
|
|
238
|
+
proceed: void 0,
|
|
239
|
+
reset: void 0
|
|
240
|
+
});
|
|
241
|
+
useEffect(() => {
|
|
242
|
+
if (disabled || !router?.history?.block) {
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
return router.history.block({
|
|
246
|
+
enableBeforeUnload,
|
|
247
|
+
blockerFn: async () => {
|
|
248
|
+
const shouldBlock = await shouldBlockFn();
|
|
249
|
+
if (!withResolver) {
|
|
250
|
+
return shouldBlock;
|
|
251
|
+
}
|
|
252
|
+
if (!shouldBlock) {
|
|
253
|
+
return false;
|
|
254
|
+
}
|
|
255
|
+
const canNavigate = await new Promise((resolve) => {
|
|
256
|
+
setResolver({
|
|
257
|
+
status: "blocked",
|
|
258
|
+
proceed: () => resolve(false),
|
|
259
|
+
reset: () => resolve(true)
|
|
260
|
+
});
|
|
261
|
+
});
|
|
262
|
+
setResolver({
|
|
263
|
+
status: "idle",
|
|
264
|
+
proceed: void 0,
|
|
265
|
+
reset: void 0
|
|
266
|
+
});
|
|
267
|
+
return canNavigate;
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
}, [disabled, enableBeforeUnload, router, shouldBlockFn, withResolver]);
|
|
271
|
+
useEffect(() => {
|
|
272
|
+
if (disabled || router?.history || typeof window === "undefined") {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
const shouldEnable = enableBeforeUnload;
|
|
276
|
+
if (!shouldEnable) {
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
const handler = (event) => {
|
|
280
|
+
const shouldBlock = typeof shouldEnable === "function" ? shouldEnable() : shouldEnable;
|
|
281
|
+
if (!shouldBlock) {
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
event.preventDefault();
|
|
285
|
+
event.returnValue = "";
|
|
286
|
+
};
|
|
287
|
+
window.addEventListener("beforeunload", handler, { capture: true });
|
|
288
|
+
return () => window.removeEventListener("beforeunload", handler, { capture: true });
|
|
289
|
+
}, [disabled, enableBeforeUnload, router]);
|
|
290
|
+
return resolver;
|
|
291
|
+
}
|
|
292
|
+
var useDraftGuardStore = create((set) => ({
|
|
293
|
+
isDirty: false,
|
|
294
|
+
source: null,
|
|
295
|
+
isInitialized: false,
|
|
296
|
+
markDirty: (source) => set((state) => {
|
|
297
|
+
if (!state.isInitialized || !source) {
|
|
298
|
+
return state;
|
|
299
|
+
}
|
|
300
|
+
return { ...state, isDirty: true, source };
|
|
301
|
+
}),
|
|
302
|
+
clearDraft: () => set({ isDirty: false, source: null }),
|
|
303
|
+
markInitialized: () => set({ isInitialized: true })
|
|
304
|
+
}));
|
|
228
305
|
function cn(...args) {
|
|
229
306
|
return twMerge(clsx(args));
|
|
230
307
|
}
|
|
@@ -3194,6 +3271,7 @@ var LookupSelect = ({
|
|
|
3194
3271
|
}) => {
|
|
3195
3272
|
const [inputValue, setInputValue] = useState("");
|
|
3196
3273
|
const inputRef = useRef(null);
|
|
3274
|
+
const [inputFocused, setInputFocused] = useState(false);
|
|
3197
3275
|
const [suggestions, setSuggestions] = useState([]);
|
|
3198
3276
|
const [optionLabels, setOptionLabels] = useState({});
|
|
3199
3277
|
const [loading, setLoading] = useState(false);
|
|
@@ -3244,8 +3322,6 @@ var LookupSelect = ({
|
|
|
3244
3322
|
onChange([trimmed]);
|
|
3245
3323
|
}
|
|
3246
3324
|
setInputValue("");
|
|
3247
|
-
setSuggestions([]);
|
|
3248
|
-
setIsDropdownOpen(false);
|
|
3249
3325
|
},
|
|
3250
3326
|
[value, onChange, maxTags, multiple]
|
|
3251
3327
|
);
|
|
@@ -3254,12 +3330,15 @@ var LookupSelect = ({
|
|
|
3254
3330
|
if (index < 0) return;
|
|
3255
3331
|
const newTags = value.filter((_, i) => i !== index);
|
|
3256
3332
|
onChange(newTags);
|
|
3333
|
+
setIsDropdownOpen(false);
|
|
3334
|
+
setInputFocused(false);
|
|
3257
3335
|
},
|
|
3258
3336
|
[value, onChange]
|
|
3259
3337
|
);
|
|
3260
3338
|
const handleClear = useCallback(() => {
|
|
3261
3339
|
setInputValue("");
|
|
3262
3340
|
setSuggestions([]);
|
|
3341
|
+
setInputFocused(false);
|
|
3263
3342
|
setIsDropdownOpen(false);
|
|
3264
3343
|
setFetchError(null);
|
|
3265
3344
|
if (onClear) onClear();
|
|
@@ -3275,7 +3354,10 @@ var LookupSelect = ({
|
|
|
3275
3354
|
}, 100);
|
|
3276
3355
|
} else {
|
|
3277
3356
|
inputRef.current?.blur();
|
|
3357
|
+
setInputFocused(false);
|
|
3358
|
+
setIsDropdownOpen(false);
|
|
3278
3359
|
}
|
|
3360
|
+
inputRef.current.value = "";
|
|
3279
3361
|
},
|
|
3280
3362
|
[addTag, multiple, upsertOptionLabels]
|
|
3281
3363
|
);
|
|
@@ -3318,16 +3400,16 @@ var LookupSelect = ({
|
|
|
3318
3400
|
});
|
|
3319
3401
|
}, [dropdownPortalElement]);
|
|
3320
3402
|
useEffect(() => {
|
|
3321
|
-
if (!fetchSuggestions) return;
|
|
3403
|
+
if (!fetchSuggestions || !inputFocused) return;
|
|
3322
3404
|
if (fetchDelayRef.current) {
|
|
3323
3405
|
clearTimeout(fetchDelayRef.current);
|
|
3324
3406
|
}
|
|
3325
3407
|
const query = inputValue.trim();
|
|
3326
3408
|
if (!query) {
|
|
3327
|
-
setSuggestions([]);
|
|
3328
|
-
setIsDropdownOpen(false);
|
|
3329
3409
|
setLoading(false);
|
|
3330
3410
|
setFetchError(null);
|
|
3411
|
+
setSuggestions([]);
|
|
3412
|
+
setIsDropdownOpen(false);
|
|
3331
3413
|
return;
|
|
3332
3414
|
}
|
|
3333
3415
|
setLoading(true);
|
|
@@ -3357,7 +3439,7 @@ var LookupSelect = ({
|
|
|
3357
3439
|
clearTimeout(fetchDelayRef.current);
|
|
3358
3440
|
}
|
|
3359
3441
|
};
|
|
3360
|
-
}, [inputValue, fetchSuggestions, suggestionDebounce, upsertOptionLabels]);
|
|
3442
|
+
}, [inputValue, fetchSuggestions, suggestionDebounce, upsertOptionLabels, inputFocused]);
|
|
3361
3443
|
useEffect(() => {
|
|
3362
3444
|
if (!fetchSuggestions) return;
|
|
3363
3445
|
if (value.length === 0) return;
|
|
@@ -3374,6 +3456,7 @@ var LookupSelect = ({
|
|
|
3374
3456
|
if (containerRef.current?.contains(target)) return;
|
|
3375
3457
|
if (dropdownContentRef.current?.contains(target)) return;
|
|
3376
3458
|
setIsDropdownOpen(false);
|
|
3459
|
+
setInputFocused(false);
|
|
3377
3460
|
};
|
|
3378
3461
|
document.addEventListener("mousedown", handleDocumentClick);
|
|
3379
3462
|
return () => {
|
|
@@ -3395,7 +3478,7 @@ var LookupSelect = ({
|
|
|
3395
3478
|
window.removeEventListener("resize", handleReposition);
|
|
3396
3479
|
window.removeEventListener("scroll", handleReposition, true);
|
|
3397
3480
|
};
|
|
3398
|
-
}, [dropdownPortalElement, isDropdownOpen, updateDropdownPosition]);
|
|
3481
|
+
}, [dropdownPortalElement, isDropdownOpen, updateDropdownPosition, value]);
|
|
3399
3482
|
useEffect(() => {
|
|
3400
3483
|
if (suggestions.length === 0) {
|
|
3401
3484
|
setActiveSuggestionIndex(-1);
|
|
@@ -3450,7 +3533,7 @@ var LookupSelect = ({
|
|
|
3450
3533
|
return /* @__PURE__ */ jsxs(
|
|
3451
3534
|
"span",
|
|
3452
3535
|
{
|
|
3453
|
-
className: "flex items-center gap-1 rounded-lg border border-
|
|
3536
|
+
className: "flex items-center gap-1 rounded-lg border border-sus-secondary-gray-3 bg-sus-secondary-gray-2 px-2 py-1 my-1 text-sm text-inherit max-w-full wrap-break-word",
|
|
3454
3537
|
children: [
|
|
3455
3538
|
/* @__PURE__ */ jsx("span", { className: "whitespace-pre-wrap break-all", children: label }),
|
|
3456
3539
|
/* @__PURE__ */ jsx(
|
|
@@ -3478,9 +3561,7 @@ var LookupSelect = ({
|
|
|
3478
3561
|
onChange: (e) => setInputValue(e.target.value),
|
|
3479
3562
|
onKeyDown: handleKeyDown,
|
|
3480
3563
|
onFocus: () => {
|
|
3481
|
-
|
|
3482
|
-
setIsDropdownOpen(true);
|
|
3483
|
-
}
|
|
3564
|
+
setInputFocused(true);
|
|
3484
3565
|
},
|
|
3485
3566
|
hidden: !multiple && selectedLabel !== void 0,
|
|
3486
3567
|
placeholder: value.length === 0 && resolvedPlaceholder || "",
|
|
@@ -5734,151 +5815,6 @@ function DialogDescription2({
|
|
|
5734
5815
|
// src/components/dialog-alert/lib/constants.ts
|
|
5735
5816
|
var DIALOG_ALERT_I18N_SUBNAMESPACE = "dialog_alert";
|
|
5736
5817
|
var i18nPrefix = `translation:${DIALOG_ALERT_I18N_SUBNAMESPACE}.`;
|
|
5737
|
-
|
|
5738
|
-
// src/components/dialog-alert/locale/default.ts
|
|
5739
|
-
var defaultResource = {
|
|
5740
|
-
sharedui: {
|
|
5741
|
-
translation: {
|
|
5742
|
-
[DIALOG_ALERT_I18N_SUBNAMESPACE]: {
|
|
5743
|
-
ok: "OK",
|
|
5744
|
-
cancel: "Cancel",
|
|
5745
|
-
close: "Close",
|
|
5746
|
-
"success.saved": {
|
|
5747
|
-
title: "Successfully",
|
|
5748
|
-
description: "Data has been successfully saved"
|
|
5749
|
-
},
|
|
5750
|
-
"success.deleted": {
|
|
5751
|
-
title: "Successfully",
|
|
5752
|
-
description: "Data has been successfully deleted"
|
|
5753
|
-
},
|
|
5754
|
-
"success.removed": {
|
|
5755
|
-
title: "Successfully",
|
|
5756
|
-
description: "Data has been successfully removed"
|
|
5757
|
-
},
|
|
5758
|
-
"error.api_db_error": {
|
|
5759
|
-
title: "API/Database Error",
|
|
5760
|
-
description: "Failed to connect to the system. Please check API or database connection."
|
|
5761
|
-
},
|
|
5762
|
-
"error.permission_denied": {
|
|
5763
|
-
title: "Permission Denied",
|
|
5764
|
-
description: "You do not have permission to perform this action.",
|
|
5765
|
-
confirm_text: "Discard"
|
|
5766
|
-
},
|
|
5767
|
-
"error.session_expired": {
|
|
5768
|
-
title: "Session Expired",
|
|
5769
|
-
description: "Your session has expired or you have been logged out. Please sign in again.",
|
|
5770
|
-
confirm_text: "Logout"
|
|
5771
|
-
},
|
|
5772
|
-
"error.user_not_found": {
|
|
5773
|
-
title: "User Not Found",
|
|
5774
|
-
description: "The system could not locate the user account.",
|
|
5775
|
-
confirm_text: "Logout"
|
|
5776
|
-
},
|
|
5777
|
-
"error.data_not_found": {
|
|
5778
|
-
title: "Data Not Found",
|
|
5779
|
-
description: "The data has already been deleted or does not exist in the system."
|
|
5780
|
-
},
|
|
5781
|
-
"error.data_restrict_editing": {
|
|
5782
|
-
title: "Data Status Restricts Editing",
|
|
5783
|
-
description: "Data status does not allow editing."
|
|
5784
|
-
},
|
|
5785
|
-
"error.network_timeout_error": {
|
|
5786
|
-
title: "Network Error / Timeout",
|
|
5787
|
-
description: "The system could not connect to the network or the request took too long to process."
|
|
5788
|
-
},
|
|
5789
|
-
"error.queue_full": {
|
|
5790
|
-
title: "Queue Full",
|
|
5791
|
-
description: "The notification queue has reached its limit. Please try again later."
|
|
5792
|
-
},
|
|
5793
|
-
"error.invalid_data_format": {
|
|
5794
|
-
title: "Invalid Data Format",
|
|
5795
|
-
description: "Data creation failed due to invalid or incorrectly formatted data."
|
|
5796
|
-
},
|
|
5797
|
-
"error.data_linked_to_system_data": {
|
|
5798
|
-
title: "Data Linked to System Data",
|
|
5799
|
-
description: "Cannot delete data because they are linked to existing system data."
|
|
5800
|
-
},
|
|
5801
|
-
"error.pending_workflow_conflict": {
|
|
5802
|
-
title: "Pending Workflow Conflict ",
|
|
5803
|
-
description: "The data is currently involved in a pending workflow or approval process and cannot be deactivated."
|
|
5804
|
-
},
|
|
5805
|
-
"error.invalid_incomplete_data": {
|
|
5806
|
-
title: "Invalid or Incomplete Data",
|
|
5807
|
-
description: "Data status cannot be changed due to incomplete or invalid information."
|
|
5808
|
-
},
|
|
5809
|
-
"error.client_side_error": {
|
|
5810
|
-
title: "Client-Side Error",
|
|
5811
|
-
description: "An error occurred on the client side. Please refresh the page or try again."
|
|
5812
|
-
},
|
|
5813
|
-
"error.system_limitation": {
|
|
5814
|
-
title: "System Limitation",
|
|
5815
|
-
description: "The search cannot be completed due to system limitations. Please simplify your query."
|
|
5816
|
-
},
|
|
5817
|
-
"error.timeout": {
|
|
5818
|
-
title: "Timeout",
|
|
5819
|
-
description: "Request failed due to a system error or timeout. Please try again."
|
|
5820
|
-
},
|
|
5821
|
-
"error.duplicate_data": {
|
|
5822
|
-
title: "Duplicate Data",
|
|
5823
|
-
description: "The data you entered already exists in the system."
|
|
5824
|
-
},
|
|
5825
|
-
"error.something_went_wrong": {
|
|
5826
|
-
title: "Something Went Wrong",
|
|
5827
|
-
description: "An unknown error occurred."
|
|
5828
|
-
},
|
|
5829
|
-
"confirm.delete": {
|
|
5830
|
-
title: "Confirmation",
|
|
5831
|
-
description: "Are you sure you want to delete this item?",
|
|
5832
|
-
confirm_text: "Delete"
|
|
5833
|
-
},
|
|
5834
|
-
"confirm.inactive": {
|
|
5835
|
-
title: "Confirmation",
|
|
5836
|
-
description: "Are you sure you want to inactive this item?",
|
|
5837
|
-
confirm_text: "Inactive"
|
|
5838
|
-
},
|
|
5839
|
-
"confirm.active": {
|
|
5840
|
-
variant: "confirm-green",
|
|
5841
|
-
title: "Confirmation",
|
|
5842
|
-
description: "Are you sure you want to active this item?",
|
|
5843
|
-
confirm_text: "Active"
|
|
5844
|
-
},
|
|
5845
|
-
"confirm.leave_page": {
|
|
5846
|
-
title: "Confirmation",
|
|
5847
|
-
description: "Unsaved changes. Do you want to leave this page?",
|
|
5848
|
-
confirm_text: "Leave"
|
|
5849
|
-
},
|
|
5850
|
-
"confirm.reset_form": {
|
|
5851
|
-
title: "Confirmation",
|
|
5852
|
-
description: "Unsaved changes. If you continue, all changes will be lost.",
|
|
5853
|
-
confirm_text: "Reset"
|
|
5854
|
-
},
|
|
5855
|
-
"confirm.remove": {
|
|
5856
|
-
title: "Confirmation",
|
|
5857
|
-
description: "Are you sure you want to remove this item?",
|
|
5858
|
-
confirm_text: "Remove"
|
|
5859
|
-
},
|
|
5860
|
-
"confirm.logout": {
|
|
5861
|
-
title: "Confirmation",
|
|
5862
|
-
description: "Do you want to log out?",
|
|
5863
|
-
confirm_text: "Logout"
|
|
5864
|
-
}
|
|
5865
|
-
}
|
|
5866
|
-
}
|
|
5867
|
-
}
|
|
5868
|
-
};
|
|
5869
|
-
|
|
5870
|
-
// src/components/dialog-alert/locale/i18n.ts
|
|
5871
|
-
var instance = i18n.createInstance({
|
|
5872
|
-
resources: defaultResource,
|
|
5873
|
-
lng: "sharedui",
|
|
5874
|
-
fallbackLng: "sharedui",
|
|
5875
|
-
defaultNS: "translation",
|
|
5876
|
-
interpolation: {
|
|
5877
|
-
escapeValue: false
|
|
5878
|
-
}
|
|
5879
|
-
}).use(initReactI18next);
|
|
5880
|
-
instance.init();
|
|
5881
|
-
var i18n_default = instance;
|
|
5882
5818
|
var titleColorVariant = {
|
|
5883
5819
|
default: "",
|
|
5884
5820
|
success: "text-sus-button-green-3",
|
|
@@ -6110,6 +6046,151 @@ var DIALOG_ALERT_TEMPLATES = {
|
|
|
6110
6046
|
confirmText: "confirm.logout.confirm_text"
|
|
6111
6047
|
}
|
|
6112
6048
|
};
|
|
6049
|
+
|
|
6050
|
+
// src/components/dialog-alert/locale/default.ts
|
|
6051
|
+
var defaultResource = {
|
|
6052
|
+
sharedui: {
|
|
6053
|
+
translation: {
|
|
6054
|
+
[DIALOG_ALERT_I18N_SUBNAMESPACE]: {
|
|
6055
|
+
ok: "OK",
|
|
6056
|
+
cancel: "Cancel",
|
|
6057
|
+
close: "Close",
|
|
6058
|
+
"success.saved": {
|
|
6059
|
+
title: "Successfully",
|
|
6060
|
+
description: "Data has been successfully saved"
|
|
6061
|
+
},
|
|
6062
|
+
"success.deleted": {
|
|
6063
|
+
title: "Successfully",
|
|
6064
|
+
description: "Data has been successfully deleted"
|
|
6065
|
+
},
|
|
6066
|
+
"success.removed": {
|
|
6067
|
+
title: "Successfully",
|
|
6068
|
+
description: "Data has been successfully removed"
|
|
6069
|
+
},
|
|
6070
|
+
"error.api_db_error": {
|
|
6071
|
+
title: "API/Database Error",
|
|
6072
|
+
description: "Failed to connect to the system. Please check API or database connection."
|
|
6073
|
+
},
|
|
6074
|
+
"error.permission_denied": {
|
|
6075
|
+
title: "Permission Denied",
|
|
6076
|
+
description: "You do not have permission to perform this action.",
|
|
6077
|
+
confirm_text: "Discard"
|
|
6078
|
+
},
|
|
6079
|
+
"error.session_expired": {
|
|
6080
|
+
title: "Session Expired",
|
|
6081
|
+
description: "Your session has expired or you have been logged out. Please sign in again.",
|
|
6082
|
+
confirm_text: "Logout"
|
|
6083
|
+
},
|
|
6084
|
+
"error.user_not_found": {
|
|
6085
|
+
title: "User Not Found",
|
|
6086
|
+
description: "The system could not locate the user account.",
|
|
6087
|
+
confirm_text: "Logout"
|
|
6088
|
+
},
|
|
6089
|
+
"error.data_not_found": {
|
|
6090
|
+
title: "Data Not Found",
|
|
6091
|
+
description: "The data has already been deleted or does not exist in the system."
|
|
6092
|
+
},
|
|
6093
|
+
"error.data_restrict_editing": {
|
|
6094
|
+
title: "Data Status Restricts Editing",
|
|
6095
|
+
description: "Data status does not allow editing."
|
|
6096
|
+
},
|
|
6097
|
+
"error.network_timeout_error": {
|
|
6098
|
+
title: "Network Error / Timeout",
|
|
6099
|
+
description: "The system could not connect to the network or the request took too long to process."
|
|
6100
|
+
},
|
|
6101
|
+
"error.queue_full": {
|
|
6102
|
+
title: "Queue Full",
|
|
6103
|
+
description: "The notification queue has reached its limit. Please try again later."
|
|
6104
|
+
},
|
|
6105
|
+
"error.invalid_data_format": {
|
|
6106
|
+
title: "Invalid Data Format",
|
|
6107
|
+
description: "Data creation failed due to invalid or incorrectly formatted data."
|
|
6108
|
+
},
|
|
6109
|
+
"error.data_linked_to_system_data": {
|
|
6110
|
+
title: "Data Linked to System Data",
|
|
6111
|
+
description: "Cannot delete data because they are linked to existing system data."
|
|
6112
|
+
},
|
|
6113
|
+
"error.pending_workflow_conflict": {
|
|
6114
|
+
title: "Pending Workflow Conflict ",
|
|
6115
|
+
description: "The data is currently involved in a pending workflow or approval process and cannot be deactivated."
|
|
6116
|
+
},
|
|
6117
|
+
"error.invalid_incomplete_data": {
|
|
6118
|
+
title: "Invalid or Incomplete Data",
|
|
6119
|
+
description: "Data status cannot be changed due to incomplete or invalid information."
|
|
6120
|
+
},
|
|
6121
|
+
"error.client_side_error": {
|
|
6122
|
+
title: "Client-Side Error",
|
|
6123
|
+
description: "An error occurred on the client side. Please refresh the page or try again."
|
|
6124
|
+
},
|
|
6125
|
+
"error.system_limitation": {
|
|
6126
|
+
title: "System Limitation",
|
|
6127
|
+
description: "The search cannot be completed due to system limitations. Please simplify your query."
|
|
6128
|
+
},
|
|
6129
|
+
"error.timeout": {
|
|
6130
|
+
title: "Timeout",
|
|
6131
|
+
description: "Request failed due to a system error or timeout. Please try again."
|
|
6132
|
+
},
|
|
6133
|
+
"error.duplicate_data": {
|
|
6134
|
+
title: "Duplicate Data",
|
|
6135
|
+
description: "The data you entered already exists in the system."
|
|
6136
|
+
},
|
|
6137
|
+
"error.something_went_wrong": {
|
|
6138
|
+
title: "Something Went Wrong",
|
|
6139
|
+
description: "An unknown error occurred."
|
|
6140
|
+
},
|
|
6141
|
+
"confirm.delete": {
|
|
6142
|
+
title: "Confirmation",
|
|
6143
|
+
description: "Are you sure you want to delete this item?",
|
|
6144
|
+
confirm_text: "Delete"
|
|
6145
|
+
},
|
|
6146
|
+
"confirm.inactive": {
|
|
6147
|
+
title: "Confirmation",
|
|
6148
|
+
description: "Are you sure you want to inactive this item?",
|
|
6149
|
+
confirm_text: "Inactive"
|
|
6150
|
+
},
|
|
6151
|
+
"confirm.active": {
|
|
6152
|
+
variant: "confirm-green",
|
|
6153
|
+
title: "Confirmation",
|
|
6154
|
+
description: "Are you sure you want to active this item?",
|
|
6155
|
+
confirm_text: "Active"
|
|
6156
|
+
},
|
|
6157
|
+
"confirm.leave_page": {
|
|
6158
|
+
title: "Confirmation",
|
|
6159
|
+
description: "Unsaved changes. Do you want to leave this page?",
|
|
6160
|
+
confirm_text: "Leave"
|
|
6161
|
+
},
|
|
6162
|
+
"confirm.reset_form": {
|
|
6163
|
+
title: "Confirmation",
|
|
6164
|
+
description: "Unsaved changes. If you continue, all changes will be lost.",
|
|
6165
|
+
confirm_text: "Reset"
|
|
6166
|
+
},
|
|
6167
|
+
"confirm.remove": {
|
|
6168
|
+
title: "Confirmation",
|
|
6169
|
+
description: "Are you sure you want to remove this item?",
|
|
6170
|
+
confirm_text: "Remove"
|
|
6171
|
+
},
|
|
6172
|
+
"confirm.logout": {
|
|
6173
|
+
title: "Confirmation",
|
|
6174
|
+
description: "Do you want to log out?",
|
|
6175
|
+
confirm_text: "Logout"
|
|
6176
|
+
}
|
|
6177
|
+
}
|
|
6178
|
+
}
|
|
6179
|
+
}
|
|
6180
|
+
};
|
|
6181
|
+
|
|
6182
|
+
// src/components/dialog-alert/locale/i18n.ts
|
|
6183
|
+
var instance = i18n.createInstance({
|
|
6184
|
+
resources: defaultResource,
|
|
6185
|
+
lng: "sharedui",
|
|
6186
|
+
fallbackLng: "sharedui",
|
|
6187
|
+
defaultNS: "translation",
|
|
6188
|
+
interpolation: {
|
|
6189
|
+
escapeValue: false
|
|
6190
|
+
}
|
|
6191
|
+
}).use(initReactI18next);
|
|
6192
|
+
instance.init();
|
|
6193
|
+
var i18n_default = instance;
|
|
6113
6194
|
var useDialogAlertStore = create((set, get) => ({
|
|
6114
6195
|
open: false,
|
|
6115
6196
|
dialogProps: {},
|
|
@@ -6162,7 +6243,7 @@ var DialogAlertProvider = ({ children, i18nResource, i18nLang }) => {
|
|
|
6162
6243
|
return;
|
|
6163
6244
|
}
|
|
6164
6245
|
}, [i18nLang, i18nResource]);
|
|
6165
|
-
return /* @__PURE__ */ jsxs(
|
|
6246
|
+
return /* @__PURE__ */ jsxs(I18nextProvider, { i18n: i18n_default, children: [
|
|
6166
6247
|
children,
|
|
6167
6248
|
/* @__PURE__ */ jsx(DialogAlert, { open, onOpenChange: setOpen, ...dialogProps })
|
|
6168
6249
|
] });
|
|
@@ -11836,6 +11917,6 @@ var TruncatedMouseEnterDiv = ({
|
|
|
11836
11917
|
};
|
|
11837
11918
|
var truncatedMouseEnterDiv_default = TruncatedMouseEnterDiv;
|
|
11838
11919
|
|
|
11839
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionMenu, AdvanceSearch_default as AdvanceSearch, arrow_default as ArrowIcon, AuditFooter, Button, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Combobox_default as Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CropperModal, CropperModalError, custom_field_default as CustomFieldIcon, DIALOG_ALERT_I18N_SUBNAMESPACE, DIALOG_ALERT_TEMPLATES, DataTable_default as DataTable, DatePicker2 as DatePicker, decrease_default as DecreaseIcon, Dialog, DialogAlert, DialogAlertProvider, DialogContent, DialogDescription, DialogFooter, DialogTitle, DialogTrigger, ErrorCompression, ErrorCreateCanvas, ErrorGeneratingBlob, ErrorInvalidSVG, ErrorSVGExceedSize, filters_default as FiltersIcon, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormulaEditor, GridSettingsModal_default as GridSettingsModal, HeaderCell_default as HeaderCell, Image2 as Image, information_default as InformationIcon, Input, InputNumber_default as InputNumber, Label2 as Label, LookupSelect, MainListContainer_default as MainListContainer, MonthPicker2 as MonthPicker, navbar_default as Navbar, not_found_default as NotFoundIcon, plus_default as PlusIcon, Popover, PopoverAnchor, PopoverArrow, PopoverContent, PopoverTrigger, PreventPageLeave_default as PreventPageLeave, RadioGroupItem, RadioGroupRoot, RadioLabel, RichText, RightPanelContainer_default as RightPanelContainer, role_default as RoleIcon, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator2 as 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, Spinner, calendar_default as SuiCalendarIcon, calendar2_default as SuiCalendarIcon2, check_default as SuiCheckIcon, dots_vertical_default as SuiDotsVerticalIcon, empty_data_default as SuiEmptyDataIcon, expand_default as SuiExpandIcon, filter_default as SuiFilterIcon, setting_default as SuiSettingIcon, triangle_down_default as SuiTriangleDownIcon, warning_default as SuiWarningIcon, Switch, Textarea, Tooltip2 as Tooltip, TooltipArrow, TooltipContent2 as TooltipContent, TooltipProvider2 as TooltipProvider, TooltipTrigger2 as TooltipTrigger, trash_default as TrashIcon, truncated_default as Truncated, truncatedMouseEnterDiv_default as TruncatedMouseEnterDiv, ui_exports as UI, user_alone_default as UserAloneIcon, user_friend_default as UserFriendIcon, user_default as UserIcon, VirtualizedCommand_default as VirtualizedCommand, booleanToSelectValue, buildPrefixMap, buttonVariants, cn, compareAlphanumeric, debounce, defaultOperatorShortcuts, defaultOperators, formatISODate, getDialogAlertControls, inputVariants, isDefined, isEmptyObject, isValidParentheses, mapTokensToOutput, parseFormula, parseFormulaToToken, resetVisibleTableState, selectValueToBoolean, spinnerVariants, splitOperators, stripNullishObject, throttle, tokenizeFormulaString, useControllableState_default as useControllableState, useFormField, useGridSettingsStore_default as useGridSettingsStore, useHover_default as useHover, useIntersectionObserver_default as useIntersectionObserver, useIsomorphicLayoutEffect, useMediaQuery_default as useMediaQuery, usePreventPageLeave_default as usePreventPageLeave, usePreventPageLeaveStore_default as usePreventPageLeaveStore, useScreenSize_default as useScreenSize, useSidebar, useTruncated_default as useTruncated, validateTokenPrefixes };
|
|
11920
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionMenu, AdvanceSearch_default as AdvanceSearch, arrow_default as ArrowIcon, AuditFooter, Button, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Combobox_default as Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CropperModal, CropperModalError, custom_field_default as CustomFieldIcon, DIALOG_ALERT_I18N_SUBNAMESPACE, DIALOG_ALERT_TEMPLATES, DataTable_default as DataTable, DatePicker2 as DatePicker, decrease_default as DecreaseIcon, Dialog, DialogAlert, DialogAlertProvider, DialogContent, DialogDescription, DialogFooter, DialogTitle, DialogTrigger, ErrorCompression, ErrorCreateCanvas, ErrorGeneratingBlob, ErrorInvalidSVG, ErrorSVGExceedSize, filters_default as FiltersIcon, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormulaEditor, GridSettingsModal_default as GridSettingsModal, HeaderCell_default as HeaderCell, Image2 as Image, information_default as InformationIcon, Input, InputNumber_default as InputNumber, Label2 as Label, LookupSelect, MainListContainer_default as MainListContainer, MonthPicker2 as MonthPicker, navbar_default as Navbar, not_found_default as NotFoundIcon, plus_default as PlusIcon, Popover, PopoverAnchor, PopoverArrow, PopoverContent, PopoverTrigger, PreventPageLeave_default as PreventPageLeave, RadioGroupItem, RadioGroupRoot, RadioLabel, RichText, RightPanelContainer_default as RightPanelContainer, role_default as RoleIcon, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator2 as 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, Spinner, calendar_default as SuiCalendarIcon, calendar2_default as SuiCalendarIcon2, check_default as SuiCheckIcon, dots_vertical_default as SuiDotsVerticalIcon, empty_data_default as SuiEmptyDataIcon, expand_default as SuiExpandIcon, filter_default as SuiFilterIcon, setting_default as SuiSettingIcon, triangle_down_default as SuiTriangleDownIcon, warning_default as SuiWarningIcon, Switch, Textarea, Tooltip2 as Tooltip, TooltipArrow, TooltipContent2 as TooltipContent, TooltipProvider2 as TooltipProvider, TooltipTrigger2 as TooltipTrigger, trash_default as TrashIcon, truncated_default as Truncated, truncatedMouseEnterDiv_default as TruncatedMouseEnterDiv, ui_exports as UI, user_alone_default as UserAloneIcon, user_friend_default as UserFriendIcon, user_default as UserIcon, VirtualizedCommand_default as VirtualizedCommand, booleanToSelectValue, buildPrefixMap, buttonVariants, cn, compareAlphanumeric, debounce, defaultOperatorShortcuts, defaultOperators, formatISODate, getDialogAlertControls, inputVariants, isDefined, isEmptyObject, isValidParentheses, mapTokensToOutput, parseFormula, parseFormulaToToken, resetVisibleTableState, selectValueToBoolean, spinnerVariants, splitOperators, stripNullishObject, throttle, tokenizeFormulaString, useControllableState_default as useControllableState, useDraftGuardStore, useFormField, useGridSettingsStore_default as useGridSettingsStore, useHover_default as useHover, useIntersectionObserver_default as useIntersectionObserver, useIsomorphicLayoutEffect, useMediaQuery_default as useMediaQuery, usePreventPageLeave_default as usePreventPageLeave, usePreventPageLeaveStore_default as usePreventPageLeaveStore, useSafeBlocker, useScreenSize_default as useScreenSize, useSidebar, useTruncated_default as useTruncated, validateTokenPrefixes };
|
|
11840
11921
|
//# sourceMappingURL=index.mjs.map
|
|
11841
11922
|
//# sourceMappingURL=index.mjs.map
|