@goplusvn/core 0.1.1 → 0.1.3

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.
Files changed (223) hide show
  1. package/package.json +31 -175
  2. package/dist/audit/index.d.mts +0 -115
  3. package/dist/audit/index.d.ts +0 -115
  4. package/dist/audit/index.js +0 -204
  5. package/dist/audit/index.js.map +0 -1
  6. package/dist/audit/index.mjs +0 -200
  7. package/dist/audit/index.mjs.map +0 -1
  8. package/dist/auth/index.d.mts +0 -86
  9. package/dist/auth/index.d.ts +0 -86
  10. package/dist/auth/index.js +0 -210
  11. package/dist/auth/index.js.map +0 -1
  12. package/dist/auth/index.mjs +0 -198
  13. package/dist/auth/index.mjs.map +0 -1
  14. package/dist/button-1dWvP9Ib.d.mts +0 -30
  15. package/dist/button-1dWvP9Ib.d.ts +0 -30
  16. package/dist/calendar-2QzdEo1z.d.mts +0 -20
  17. package/dist/calendar-2QzdEo1z.d.ts +0 -20
  18. package/dist/code-generation/index.d.mts +0 -30
  19. package/dist/code-generation/index.d.ts +0 -30
  20. package/dist/code-generation/index.js +0 -31
  21. package/dist/code-generation/index.js.map +0 -1
  22. package/dist/code-generation/index.mjs +0 -28
  23. package/dist/code-generation/index.mjs.map +0 -1
  24. package/dist/configs/index.d.mts +0 -175
  25. package/dist/configs/index.d.ts +0 -175
  26. package/dist/configs/index.js +0 -254
  27. package/dist/configs/index.js.map +0 -1
  28. package/dist/configs/index.mjs +0 -233
  29. package/dist/configs/index.mjs.map +0 -1
  30. package/dist/crud/index.d.mts +0 -646
  31. package/dist/crud/index.d.ts +0 -646
  32. package/dist/crud/index.js +0 -11772
  33. package/dist/crud/index.js.map +0 -1
  34. package/dist/crud/index.mjs +0 -11665
  35. package/dist/crud/index.mjs.map +0 -1
  36. package/dist/crud/server.d.mts +0 -20
  37. package/dist/crud/server.d.ts +0 -20
  38. package/dist/crud/server.js +0 -123
  39. package/dist/crud/server.js.map +0 -1
  40. package/dist/crud/server.mjs +0 -120
  41. package/dist/crud/server.mjs.map +0 -1
  42. package/dist/data-table-skeleton-12NA8Mjx.d.mts +0 -39
  43. package/dist/data-table-skeleton-12NA8Mjx.d.ts +0 -39
  44. package/dist/dialog-bKfjZMTd.d.mts +0 -22
  45. package/dist/dialog-bKfjZMTd.d.ts +0 -22
  46. package/dist/dynamic-icon-DrGIiu2N.d.mts +0 -10
  47. package/dist/dynamic-icon-DrGIiu2N.d.ts +0 -10
  48. package/dist/home/index.d.mts +0 -269
  49. package/dist/home/index.d.ts +0 -269
  50. package/dist/home/index.js +0 -1678
  51. package/dist/home/index.js.map +0 -1
  52. package/dist/home/index.mjs +0 -1635
  53. package/dist/home/index.mjs.map +0 -1
  54. package/dist/hooks/index.d.mts +0 -7
  55. package/dist/hooks/index.d.ts +0 -7
  56. package/dist/hooks/index.js +0 -8316
  57. package/dist/hooks/index.js.map +0 -1
  58. package/dist/hooks/index.mjs +0 -8255
  59. package/dist/hooks/index.mjs.map +0 -1
  60. package/dist/index-50hpiPrV.d.ts +0 -116
  61. package/dist/index-B9zQVEVi.d.mts +0 -116
  62. package/dist/index.d.mts +0 -5
  63. package/dist/index.d.ts +0 -5
  64. package/dist/index.js +0 -123
  65. package/dist/index.js.map +0 -1
  66. package/dist/index.mjs +0 -118
  67. package/dist/index.mjs.map +0 -1
  68. package/dist/infrastructure/index.d.mts +0 -423
  69. package/dist/infrastructure/index.d.ts +0 -423
  70. package/dist/infrastructure/index.js +0 -633
  71. package/dist/infrastructure/index.js.map +0 -1
  72. package/dist/infrastructure/index.mjs +0 -619
  73. package/dist/infrastructure/index.mjs.map +0 -1
  74. package/dist/label-DWTEkNPo.d.ts +0 -226
  75. package/dist/label-LPpdcoBx.d.mts +0 -226
  76. package/dist/layout/index.d.mts +0 -48
  77. package/dist/layout/index.d.ts +0 -48
  78. package/dist/layout/index.js +0 -117
  79. package/dist/layout/index.js.map +0 -1
  80. package/dist/layout/index.mjs +0 -90
  81. package/dist/layout/index.mjs.map +0 -1
  82. package/dist/navigation/index.d.mts +0 -16
  83. package/dist/navigation/index.d.ts +0 -16
  84. package/dist/navigation/index.js +0 -53
  85. package/dist/navigation/index.js.map +0 -1
  86. package/dist/navigation/index.mjs +0 -50
  87. package/dist/navigation/index.mjs.map +0 -1
  88. package/dist/notification/index.d.mts +0 -105
  89. package/dist/notification/index.d.ts +0 -105
  90. package/dist/notification/index.js +0 -278
  91. package/dist/notification/index.js.map +0 -1
  92. package/dist/notification/index.mjs +0 -274
  93. package/dist/notification/index.mjs.map +0 -1
  94. package/dist/organization/index.d.mts +0 -99
  95. package/dist/organization/index.d.ts +0 -99
  96. package/dist/organization/index.js +0 -360
  97. package/dist/organization/index.js.map +0 -1
  98. package/dist/organization/index.mjs +0 -352
  99. package/dist/organization/index.mjs.map +0 -1
  100. package/dist/plugin/index.d.mts +0 -83
  101. package/dist/plugin/index.d.ts +0 -83
  102. package/dist/plugin/index.js +0 -86
  103. package/dist/plugin/index.js.map +0 -1
  104. package/dist/plugin/index.mjs +0 -84
  105. package/dist/plugin/index.mjs.map +0 -1
  106. package/dist/providers/index.d.mts +0 -25
  107. package/dist/providers/index.d.ts +0 -25
  108. package/dist/providers/index.js +0 -84
  109. package/dist/providers/index.js.map +0 -1
  110. package/dist/providers/index.mjs +0 -77
  111. package/dist/providers/index.mjs.map +0 -1
  112. package/dist/rbac/index.d.mts +0 -226
  113. package/dist/rbac/index.d.ts +0 -226
  114. package/dist/rbac/index.js +0 -4784
  115. package/dist/rbac/index.js.map +0 -1
  116. package/dist/rbac/index.mjs +0 -4722
  117. package/dist/rbac/index.mjs.map +0 -1
  118. package/dist/rbac/permissions.d.mts +0 -26
  119. package/dist/rbac/permissions.d.ts +0 -26
  120. package/dist/rbac/permissions.js +0 -94
  121. package/dist/rbac/permissions.js.map +0 -1
  122. package/dist/rbac/permissions.mjs +0 -90
  123. package/dist/rbac/permissions.mjs.map +0 -1
  124. package/dist/rbac/server.d.mts +0 -1
  125. package/dist/rbac/server.d.ts +0 -1
  126. package/dist/rbac/server.js +0 -128
  127. package/dist/rbac/server.js.map +0 -1
  128. package/dist/rbac/server.mjs +0 -124
  129. package/dist/rbac/server.mjs.map +0 -1
  130. package/dist/schemas/index.d.mts +0 -1257
  131. package/dist/schemas/index.d.ts +0 -1257
  132. package/dist/schemas/index.js +0 -572
  133. package/dist/schemas/index.js.map +0 -1
  134. package/dist/schemas/index.mjs +0 -523
  135. package/dist/schemas/index.mjs.map +0 -1
  136. package/dist/server-QuYCTa89.d.mts +0 -83
  137. package/dist/server-QuYCTa89.d.ts +0 -83
  138. package/dist/sonner-C74GlRDQ.d.mts +0 -71
  139. package/dist/sonner-C74GlRDQ.d.ts +0 -71
  140. package/dist/status-BOXZgIqX.d.mts +0 -12
  141. package/dist/status-BOXZgIqX.d.ts +0 -12
  142. package/dist/system/index.d.mts +0 -77
  143. package/dist/system/index.d.ts +0 -77
  144. package/dist/system/index.js +0 -102
  145. package/dist/system/index.js.map +0 -1
  146. package/dist/system/index.mjs +0 -100
  147. package/dist/system/index.mjs.map +0 -1
  148. package/dist/tabs-C6FfBwPY.d.mts +0 -18
  149. package/dist/tabs-C6FfBwPY.d.ts +0 -18
  150. package/dist/tenant-provider-B8eC_Wpb.d.mts +0 -27
  151. package/dist/tenant-provider-B8eC_Wpb.d.ts +0 -27
  152. package/dist/types/index.d.mts +0 -469
  153. package/dist/types/index.d.ts +0 -469
  154. package/dist/types/index.js +0 -25
  155. package/dist/types/index.js.map +0 -1
  156. package/dist/types/index.mjs +0 -21
  157. package/dist/types/index.mjs.map +0 -1
  158. package/dist/ui/auth.d.mts +0 -39
  159. package/dist/ui/auth.d.ts +0 -39
  160. package/dist/ui/auth.js +0 -4941
  161. package/dist/ui/auth.js.map +0 -1
  162. package/dist/ui/auth.mjs +0 -4896
  163. package/dist/ui/auth.mjs.map +0 -1
  164. package/dist/ui/crud.d.mts +0 -2
  165. package/dist/ui/crud.d.ts +0 -2
  166. package/dist/ui/crud.js +0 -4
  167. package/dist/ui/crud.js.map +0 -1
  168. package/dist/ui/crud.mjs +0 -3
  169. package/dist/ui/crud.mjs.map +0 -1
  170. package/dist/ui/data-display.d.mts +0 -596
  171. package/dist/ui/data-display.d.ts +0 -596
  172. package/dist/ui/data-display.js +0 -5307
  173. package/dist/ui/data-display.js.map +0 -1
  174. package/dist/ui/data-display.mjs +0 -5212
  175. package/dist/ui/data-display.mjs.map +0 -1
  176. package/dist/ui/feedback.d.mts +0 -55
  177. package/dist/ui/feedback.d.ts +0 -55
  178. package/dist/ui/feedback.js +0 -2608
  179. package/dist/ui/feedback.js.map +0 -1
  180. package/dist/ui/feedback.mjs +0 -2526
  181. package/dist/ui/feedback.mjs.map +0 -1
  182. package/dist/ui/forms.d.mts +0 -309
  183. package/dist/ui/forms.d.ts +0 -309
  184. package/dist/ui/forms.js +0 -4656
  185. package/dist/ui/forms.js.map +0 -1
  186. package/dist/ui/forms.mjs +0 -4571
  187. package/dist/ui/forms.mjs.map +0 -1
  188. package/dist/ui/index.d.mts +0 -331
  189. package/dist/ui/index.d.ts +0 -331
  190. package/dist/ui/index.js +0 -16953
  191. package/dist/ui/index.js.map +0 -1
  192. package/dist/ui/index.mjs +0 -16598
  193. package/dist/ui/index.mjs.map +0 -1
  194. package/dist/ui/primitives/client.d.mts +0 -61
  195. package/dist/ui/primitives/client.d.ts +0 -61
  196. package/dist/ui/primitives/client.js +0 -3408
  197. package/dist/ui/primitives/client.js.map +0 -1
  198. package/dist/ui/primitives/client.mjs +0 -3256
  199. package/dist/ui/primitives/client.mjs.map +0 -1
  200. package/dist/ui/primitives.d.mts +0 -113
  201. package/dist/ui/primitives.d.ts +0 -113
  202. package/dist/ui/primitives.js +0 -3356
  203. package/dist/ui/primitives.js.map +0 -1
  204. package/dist/ui/primitives.mjs +0 -3227
  205. package/dist/ui/primitives.mjs.map +0 -1
  206. package/dist/user/index.d.mts +0 -228
  207. package/dist/user/index.d.ts +0 -228
  208. package/dist/user/index.js +0 -4306
  209. package/dist/user/index.js.map +0 -1
  210. package/dist/user/index.mjs +0 -4260
  211. package/dist/user/index.mjs.map +0 -1
  212. package/dist/utils/index.d.mts +0 -205
  213. package/dist/utils/index.d.ts +0 -205
  214. package/dist/utils/index.js +0 -574
  215. package/dist/utils/index.js.map +0 -1
  216. package/dist/utils/index.mjs +0 -514
  217. package/dist/utils/index.mjs.map +0 -1
  218. package/dist/workflow/index.d.mts +0 -40
  219. package/dist/workflow/index.d.ts +0 -40
  220. package/dist/workflow/index.js +0 -3710
  221. package/dist/workflow/index.js.map +0 -1
  222. package/dist/workflow/index.mjs +0 -3677
  223. package/dist/workflow/index.mjs.map +0 -1
@@ -1,205 +0,0 @@
1
- import { ClassValue } from 'clsx';
2
- import { NavigationType, DynamicIconNameType, LocaleType, FormatStyleType } from '../types/index.mjs';
3
- export { S as STATUS_ACTIVE, a as STATUS_COLORS, b as STATUS_INACTIVE, c as STATUS_OPTIONS, d as STATUS_VALUES, e as booleanToStatus, s as statusToBoolean } from '../status-BOXZgIqX.mjs';
4
- import 'lucide-react';
5
- import 'react';
6
- import 'zod';
7
-
8
- /**
9
- * Merge Tailwind CSS classes with clsx
10
- */
11
- declare function cn(...inputs: ClassValue[]): string;
12
- /**
13
- * Get initials from full name
14
- */
15
- declare function getInitials(fullName: string): string;
16
- /**
17
- * Slugify string
18
- */
19
- declare function slugify(text: string): string;
20
- /**
21
- * Convert camelCase to Title Case
22
- */
23
- declare function camelCaseToTitleCase(camelCaseStr: string): string;
24
- /**
25
- * Convert Title Case to camelCase
26
- */
27
- declare function titleCaseToCamelCase(titleCaseStr: string): string;
28
- declare const isEven: (num: number) => boolean;
29
- declare const isNonNegative: (num: number) => boolean;
30
- /**
31
- * Đọc số tiền thành chữ tiếng Việt
32
- * Dùng chung cho tất cả các phiếu in (hợp đồng, phiếu thu, phiếu chi, phiếu nhập/xuất kho, v.v.)
33
- * @param amount - Số tiền (VND)
34
- * @returns Chuỗi đọc bằng chữ, VD: "Bảy mươi hai triệu một trăm năm mươi chín nghìn tám trăm hai mươi đồng"
35
- */
36
- declare function readMoney(amount: number): string;
37
- /**
38
- * Format currency with locale
39
- */
40
- declare function formatCurrency(value: number, locales?: LocaleType, currency?: string): string;
41
- /**
42
- * Format number with locale
43
- */
44
- declare function formatNumber(value: number, options?: {
45
- locale?: string;
46
- minimumFractionDigits?: number;
47
- maximumFractionDigits?: number;
48
- }): string;
49
- /**
50
- * Format percent
51
- */
52
- declare function formatPercent(value: number, locales?: LocaleType): string;
53
- /**
54
- * Format number to compact (e.g., 1K, 1M)
55
- */
56
- declare function formatNumberToCompact(value: number, locales?: LocaleType): string;
57
- /**
58
- * Format file size
59
- */
60
- declare function formatFileSize(bytes: number, decimals?: number): string;
61
- /**
62
- * Format unread count
63
- */
64
- declare function formatUnreadCount(unreadCount: number): string | number;
65
- /**
66
- * Format date with Vietnamese locale (Asia/Ho_Chi_Minh timezone)
67
- */
68
- declare function formatDate(date: Date | string, options?: {
69
- locale?: string;
70
- format?: "short" | "medium" | "long" | "full";
71
- }): string;
72
- /**
73
- * Format datetime with Vietnamese locale (Asia/Ho_Chi_Minh timezone)
74
- */
75
- declare function formatDateTime(date: Date | string, options?: {
76
- locale?: string;
77
- }): string;
78
- /**
79
- * Format relative date (Today, Yesterday, or date) - Asia/Ho_Chi_Minh timezone
80
- */
81
- declare function formatRelativeDate(value?: string | number | Date): string;
82
- /**
83
- * Check if date is before today (Asia/Ho_Chi_Minh timezone)
84
- */
85
- declare function isBeforeToday(date: Date): boolean;
86
- /**
87
- * Ensure path has prefix
88
- */
89
- declare function ensureWithPrefix(value: string, prefix: string): string;
90
- /**
91
- * Ensure path has suffix
92
- */
93
- declare function ensureWithSuffix(value: string, suffix: string): string;
94
- /**
95
- * Ensure path without prefix
96
- */
97
- declare function ensureWithoutPrefix(value: string, prefix: string): string;
98
- /**
99
- * Ensure path without suffix
100
- */
101
- declare function ensureWithoutSuffix(value: string, suffix: string): string;
102
- /**
103
- * Check if pathname is active
104
- */
105
- declare function isActivePathname(basePathname: string, currentPathname: string, exactMatch?: boolean): boolean;
106
- /**
107
- * Wait/sleep function
108
- */
109
- declare function wait(ms?: number): Promise<void>;
110
- /**
111
- * Debounce function
112
- */
113
- declare function debounce<T extends (...args: unknown[]) => unknown>(func: T, wait: number): (...args: Parameters<T>) => void;
114
- /**
115
- * Deep clone object
116
- */
117
- declare function deepClone<T>(obj: T): T;
118
- /**
119
- * Check if value is empty
120
- */
121
- declare function isEmpty(value: unknown): boolean;
122
- /**
123
- * Generate a random ID
124
- */
125
- declare function generateId(prefix?: string): string;
126
- /**
127
- * Get dictionary value safely
128
- */
129
- declare function getDictionaryValue(key: string, section: Record<string, unknown>, fallback?: string): string;
130
- /**
131
- * Format overview card value based on style
132
- */
133
- declare function formatOverviewCardValue(value: number, formatStyle: FormatStyleType): string | number;
134
- /**
135
- * Get credit card brand name from number
136
- */
137
- declare function getCreditCardBrandName(number: string): string;
138
- /**
139
- * Convert rem to pixels
140
- */
141
- declare function remToPx(rem: number): number;
142
- /**
143
- * Check if string is a valid URL
144
- */
145
- declare function isUrl(text: string): boolean;
146
- /**
147
- * Rating to percentage string
148
- */
149
- declare function ratingToPercentage(rating: number, maxRating: number, fractionDigits?: number): string;
150
- /**
151
- * Ensure redirect pathname with query params
152
- */
153
- declare function ensureRedirectPathname(basePathname: string, redirectPathname: string): string;
154
- /**
155
- * Get discounted price
156
- */
157
- declare function getDiscountedPrice(price: number, discountRate: number, isAnnual?: boolean): number;
158
- /**
159
- * Convert time string to Date
160
- */
161
- declare function timeToDate(timeString: string, baseDate?: Date): Date;
162
- /**
163
- * Format file type
164
- */
165
- declare function formatFileType(type: string): string;
166
- /**
167
- * Format date with time (Asia/Ho_Chi_Minh timezone)
168
- */
169
- declare function formatDateWithTime(value: string | number | Date): string;
170
- /**
171
- * Format date short (MMM dd) - Asia/Ho_Chi_Minh timezone
172
- */
173
- declare function formatDateShort(value: string | number | Date): string;
174
- /**
175
- * Format time (Asia/Ho_Chi_Minh timezone)
176
- */
177
- declare function formatTime(value: string | number | Date): string;
178
- /**
179
- * Format duration from milliseconds
180
- */
181
- declare function formatDuration(value: string | number | Date): string;
182
- /**
183
- * Format distance to now
184
- */
185
- declare function formatDistance(value: string | number | Date): string;
186
-
187
- declare function isPathnameMissingLocale(pathname: string): boolean;
188
- declare function getLocaleFromPathname(pathname: string): string | undefined;
189
- declare function ensureLocalizedPathname(pathname: string, locale: string): string;
190
- declare function relocalizePathname(pathname: string, locale: string): string;
191
- declare class Logger {
192
- private log;
193
- info(message: string, context?: Record<string, unknown>): void;
194
- warn(message: string, context?: Record<string, unknown>): void;
195
- error(message: string, error?: unknown, context?: Record<string, unknown>): void;
196
- debug(message: string, context?: Record<string, unknown>): void;
197
- }
198
- declare const logger: Logger;
199
-
200
- declare function shouldExcludeFromTabs(pathname: string): boolean;
201
- declare function normalizePathname(pathname: string): string;
202
- declare function findRouteTitle(pathname: string, navigations: NavigationType[]): string | null;
203
- declare function findRouteIcon(pathname: string, navigations: NavigationType[]): DynamicIconNameType | null;
204
-
205
- export { camelCaseToTitleCase, cn, debounce, deepClone, ensureLocalizedPathname, ensureRedirectPathname, ensureWithPrefix, ensureWithSuffix, ensureWithoutPrefix, ensureWithoutSuffix, findRouteIcon, findRouteTitle, formatCurrency, formatDate, formatDateShort, formatDateTime, formatDateWithTime, formatDistance, formatDuration, formatFileSize, formatFileType, formatNumber, formatNumberToCompact, formatOverviewCardValue, formatPercent, formatRelativeDate, formatTime, formatUnreadCount, generateId, getCreditCardBrandName, getDictionaryValue, getDiscountedPrice, getInitials, getLocaleFromPathname, isActivePathname, isBeforeToday, isEmpty, isEven, isNonNegative, isPathnameMissingLocale, isUrl, logger, normalizePathname, ratingToPercentage, readMoney, relocalizePathname, remToPx, shouldExcludeFromTabs, slugify, timeToDate, titleCaseToCamelCase, wait };
@@ -1,205 +0,0 @@
1
- import { ClassValue } from 'clsx';
2
- import { NavigationType, DynamicIconNameType, LocaleType, FormatStyleType } from '../types/index.js';
3
- export { S as STATUS_ACTIVE, a as STATUS_COLORS, b as STATUS_INACTIVE, c as STATUS_OPTIONS, d as STATUS_VALUES, e as booleanToStatus, s as statusToBoolean } from '../status-BOXZgIqX.js';
4
- import 'lucide-react';
5
- import 'react';
6
- import 'zod';
7
-
8
- /**
9
- * Merge Tailwind CSS classes with clsx
10
- */
11
- declare function cn(...inputs: ClassValue[]): string;
12
- /**
13
- * Get initials from full name
14
- */
15
- declare function getInitials(fullName: string): string;
16
- /**
17
- * Slugify string
18
- */
19
- declare function slugify(text: string): string;
20
- /**
21
- * Convert camelCase to Title Case
22
- */
23
- declare function camelCaseToTitleCase(camelCaseStr: string): string;
24
- /**
25
- * Convert Title Case to camelCase
26
- */
27
- declare function titleCaseToCamelCase(titleCaseStr: string): string;
28
- declare const isEven: (num: number) => boolean;
29
- declare const isNonNegative: (num: number) => boolean;
30
- /**
31
- * Đọc số tiền thành chữ tiếng Việt
32
- * Dùng chung cho tất cả các phiếu in (hợp đồng, phiếu thu, phiếu chi, phiếu nhập/xuất kho, v.v.)
33
- * @param amount - Số tiền (VND)
34
- * @returns Chuỗi đọc bằng chữ, VD: "Bảy mươi hai triệu một trăm năm mươi chín nghìn tám trăm hai mươi đồng"
35
- */
36
- declare function readMoney(amount: number): string;
37
- /**
38
- * Format currency with locale
39
- */
40
- declare function formatCurrency(value: number, locales?: LocaleType, currency?: string): string;
41
- /**
42
- * Format number with locale
43
- */
44
- declare function formatNumber(value: number, options?: {
45
- locale?: string;
46
- minimumFractionDigits?: number;
47
- maximumFractionDigits?: number;
48
- }): string;
49
- /**
50
- * Format percent
51
- */
52
- declare function formatPercent(value: number, locales?: LocaleType): string;
53
- /**
54
- * Format number to compact (e.g., 1K, 1M)
55
- */
56
- declare function formatNumberToCompact(value: number, locales?: LocaleType): string;
57
- /**
58
- * Format file size
59
- */
60
- declare function formatFileSize(bytes: number, decimals?: number): string;
61
- /**
62
- * Format unread count
63
- */
64
- declare function formatUnreadCount(unreadCount: number): string | number;
65
- /**
66
- * Format date with Vietnamese locale (Asia/Ho_Chi_Minh timezone)
67
- */
68
- declare function formatDate(date: Date | string, options?: {
69
- locale?: string;
70
- format?: "short" | "medium" | "long" | "full";
71
- }): string;
72
- /**
73
- * Format datetime with Vietnamese locale (Asia/Ho_Chi_Minh timezone)
74
- */
75
- declare function formatDateTime(date: Date | string, options?: {
76
- locale?: string;
77
- }): string;
78
- /**
79
- * Format relative date (Today, Yesterday, or date) - Asia/Ho_Chi_Minh timezone
80
- */
81
- declare function formatRelativeDate(value?: string | number | Date): string;
82
- /**
83
- * Check if date is before today (Asia/Ho_Chi_Minh timezone)
84
- */
85
- declare function isBeforeToday(date: Date): boolean;
86
- /**
87
- * Ensure path has prefix
88
- */
89
- declare function ensureWithPrefix(value: string, prefix: string): string;
90
- /**
91
- * Ensure path has suffix
92
- */
93
- declare function ensureWithSuffix(value: string, suffix: string): string;
94
- /**
95
- * Ensure path without prefix
96
- */
97
- declare function ensureWithoutPrefix(value: string, prefix: string): string;
98
- /**
99
- * Ensure path without suffix
100
- */
101
- declare function ensureWithoutSuffix(value: string, suffix: string): string;
102
- /**
103
- * Check if pathname is active
104
- */
105
- declare function isActivePathname(basePathname: string, currentPathname: string, exactMatch?: boolean): boolean;
106
- /**
107
- * Wait/sleep function
108
- */
109
- declare function wait(ms?: number): Promise<void>;
110
- /**
111
- * Debounce function
112
- */
113
- declare function debounce<T extends (...args: unknown[]) => unknown>(func: T, wait: number): (...args: Parameters<T>) => void;
114
- /**
115
- * Deep clone object
116
- */
117
- declare function deepClone<T>(obj: T): T;
118
- /**
119
- * Check if value is empty
120
- */
121
- declare function isEmpty(value: unknown): boolean;
122
- /**
123
- * Generate a random ID
124
- */
125
- declare function generateId(prefix?: string): string;
126
- /**
127
- * Get dictionary value safely
128
- */
129
- declare function getDictionaryValue(key: string, section: Record<string, unknown>, fallback?: string): string;
130
- /**
131
- * Format overview card value based on style
132
- */
133
- declare function formatOverviewCardValue(value: number, formatStyle: FormatStyleType): string | number;
134
- /**
135
- * Get credit card brand name from number
136
- */
137
- declare function getCreditCardBrandName(number: string): string;
138
- /**
139
- * Convert rem to pixels
140
- */
141
- declare function remToPx(rem: number): number;
142
- /**
143
- * Check if string is a valid URL
144
- */
145
- declare function isUrl(text: string): boolean;
146
- /**
147
- * Rating to percentage string
148
- */
149
- declare function ratingToPercentage(rating: number, maxRating: number, fractionDigits?: number): string;
150
- /**
151
- * Ensure redirect pathname with query params
152
- */
153
- declare function ensureRedirectPathname(basePathname: string, redirectPathname: string): string;
154
- /**
155
- * Get discounted price
156
- */
157
- declare function getDiscountedPrice(price: number, discountRate: number, isAnnual?: boolean): number;
158
- /**
159
- * Convert time string to Date
160
- */
161
- declare function timeToDate(timeString: string, baseDate?: Date): Date;
162
- /**
163
- * Format file type
164
- */
165
- declare function formatFileType(type: string): string;
166
- /**
167
- * Format date with time (Asia/Ho_Chi_Minh timezone)
168
- */
169
- declare function formatDateWithTime(value: string | number | Date): string;
170
- /**
171
- * Format date short (MMM dd) - Asia/Ho_Chi_Minh timezone
172
- */
173
- declare function formatDateShort(value: string | number | Date): string;
174
- /**
175
- * Format time (Asia/Ho_Chi_Minh timezone)
176
- */
177
- declare function formatTime(value: string | number | Date): string;
178
- /**
179
- * Format duration from milliseconds
180
- */
181
- declare function formatDuration(value: string | number | Date): string;
182
- /**
183
- * Format distance to now
184
- */
185
- declare function formatDistance(value: string | number | Date): string;
186
-
187
- declare function isPathnameMissingLocale(pathname: string): boolean;
188
- declare function getLocaleFromPathname(pathname: string): string | undefined;
189
- declare function ensureLocalizedPathname(pathname: string, locale: string): string;
190
- declare function relocalizePathname(pathname: string, locale: string): string;
191
- declare class Logger {
192
- private log;
193
- info(message: string, context?: Record<string, unknown>): void;
194
- warn(message: string, context?: Record<string, unknown>): void;
195
- error(message: string, error?: unknown, context?: Record<string, unknown>): void;
196
- debug(message: string, context?: Record<string, unknown>): void;
197
- }
198
- declare const logger: Logger;
199
-
200
- declare function shouldExcludeFromTabs(pathname: string): boolean;
201
- declare function normalizePathname(pathname: string): string;
202
- declare function findRouteTitle(pathname: string, navigations: NavigationType[]): string | null;
203
- declare function findRouteIcon(pathname: string, navigations: NavigationType[]): DynamicIconNameType | null;
204
-
205
- export { camelCaseToTitleCase, cn, debounce, deepClone, ensureLocalizedPathname, ensureRedirectPathname, ensureWithPrefix, ensureWithSuffix, ensureWithoutPrefix, ensureWithoutSuffix, findRouteIcon, findRouteTitle, formatCurrency, formatDate, formatDateShort, formatDateTime, formatDateWithTime, formatDistance, formatDuration, formatFileSize, formatFileType, formatNumber, formatNumberToCompact, formatOverviewCardValue, formatPercent, formatRelativeDate, formatTime, formatUnreadCount, generateId, getCreditCardBrandName, getDictionaryValue, getDiscountedPrice, getInitials, getLocaleFromPathname, isActivePathname, isBeforeToday, isEmpty, isEven, isNonNegative, isPathnameMissingLocale, isUrl, logger, normalizePathname, ratingToPercentage, readMoney, relocalizePathname, remToPx, shouldExcludeFromTabs, slugify, timeToDate, titleCaseToCamelCase, wait };