@vef-framework/shared 1.0.5

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.
@@ -0,0 +1,372 @@
1
+ import { type ReactNode } from "react";
2
+ import type { Except } from "./lib";
3
+ import type { Handler, MaybePromise, Provider } from "./types";
4
+ export declare const successIcon: import("react").FunctionComponentElement<Omit<import("@ant-design/icons/lib/components/Icon").IconComponentProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
5
+ export declare const infoIcon: import("react").FunctionComponentElement<Omit<import("@ant-design/icons/lib/components/Icon").IconComponentProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
6
+ export declare const warningIcon: import("react").FunctionComponentElement<Omit<import("@ant-design/icons/lib/components/Icon").IconComponentProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
7
+ export declare const errorIcon: import("react").FunctionComponentElement<Omit<import("@ant-design/icons/lib/components/Icon").IconComponentProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
8
+ /**
9
+ * Shows a success message.
10
+ *
11
+ * @param content - The content of the message.
12
+ */
13
+ export declare function showSuccessMessage(content: ReactNode): void;
14
+ /**
15
+ * Shows an info message.
16
+ *
17
+ * @param content - The content of the message.
18
+ */
19
+ export declare function showInfoMessage(content: ReactNode): void;
20
+ /**
21
+ * Shows a warning message.
22
+ *
23
+ * @param content - The content of the message.
24
+ */
25
+ export declare function showWarningMessage(content: ReactNode): void;
26
+ /**
27
+ * Shows an error message.
28
+ *
29
+ * @param content - The content of the message.
30
+ */
31
+ export declare function showErrorMessage(content: ReactNode): void;
32
+ /**
33
+ * Shows a loading message.
34
+ *
35
+ * @param content - The content of the message.
36
+ * @returns A handler function to close the message.
37
+ */
38
+ export declare function showLoadingMessage(content: ReactNode): () => void;
39
+ /**
40
+ * The default title of the notification, alert and confirmation.
41
+ */
42
+ export declare const defaultMessageTitle = "\u63D0\u793A";
43
+ /**
44
+ * Shows a success notification.
45
+ *
46
+ * @param content - The content of the notification.
47
+ */
48
+ export declare function showSuccessNotification(content: ReactNode): void;
49
+ /**
50
+ * Shows a success notification.
51
+ *
52
+ * @param title - The title of the notification.
53
+ * @param content - The content of the notification.
54
+ */
55
+ export declare function showSuccessNotification(title: ReactNode, content: ReactNode): void;
56
+ /**
57
+ * Shows a success notification.
58
+ *
59
+ * @param title - The title of the notification.
60
+ * @param content - The content of the notification.
61
+ * @param buttons - The buttons of the notification.
62
+ */
63
+ export declare function showSuccessNotification(title: ReactNode, content: ReactNode, buttons: ReactNode): void;
64
+ /**
65
+ * Shows an info notification.
66
+ *
67
+ * @param content - The content of the notification.
68
+ */
69
+ export declare function showInfoNotification(content: ReactNode): void;
70
+ /**
71
+ * Shows an info notification.
72
+ *
73
+ * @param title - The title of the notification.
74
+ * @param content - The content of the notification.
75
+ */
76
+ export declare function showInfoNotification(title: ReactNode, content: ReactNode): void;
77
+ /**
78
+ * Shows an info notification.
79
+ *
80
+ * @param title - The title of the notification.
81
+ * @param content - The content of the notification.
82
+ * @param buttons - The buttons of the notification.
83
+ */
84
+ export declare function showInfoNotification(title: ReactNode, content: ReactNode, buttons: ReactNode): void;
85
+ /**
86
+ * Shows a warning notification.
87
+ *
88
+ * @param content - The content of the notification.
89
+ */
90
+ export declare function showWarningNotification(content: ReactNode): void;
91
+ /**
92
+ * Shows a warning notification.
93
+ *
94
+ * @param title - The title of the notification.
95
+ * @param content - The content of the notification.
96
+ */
97
+ export declare function showWarningNotification(title: ReactNode, content: ReactNode): void;
98
+ /**
99
+ * Shows a warning notification.
100
+ *
101
+ * @param title - The title of the notification.
102
+ * @param content - The content of the notification.
103
+ * @param buttons - The buttons of the notification.
104
+ */
105
+ export declare function showWarningNotification(title: ReactNode, content: ReactNode, buttons: ReactNode): void;
106
+ /**
107
+ * Shows an error notification.
108
+ *
109
+ * @param content - The content of the notification.
110
+ */
111
+ export declare function showErrorNotification(content: ReactNode): void;
112
+ /**
113
+ * Shows an error notification.
114
+ *
115
+ * @param title - The title of the notification.
116
+ * @param content - The content of the notification.
117
+ */
118
+ export declare function showErrorNotification(title: ReactNode, content: ReactNode): void;
119
+ /**
120
+ * Shows an error notification.
121
+ *
122
+ * @param title - The title of the notification.
123
+ * @param content - The content of the notification.
124
+ * @param buttons - The buttons of the notification.
125
+ */
126
+ export declare function showErrorNotification(title: ReactNode, content: ReactNode, buttons: ReactNode): void;
127
+ /**
128
+ * The options for the confirmation dialog.
129
+ */
130
+ export interface ConfirmationOptions {
131
+ /**
132
+ * The text of the OK button.
133
+ */
134
+ okText?: string;
135
+ /**
136
+ * The text of the cancel button.
137
+ */
138
+ cancelText?: string;
139
+ /**
140
+ * The callback function when the cancel button is clicked.
141
+ */
142
+ onCancel?: Handler;
143
+ /**
144
+ * The callback function after the confirmation dialog is opened.
145
+ */
146
+ onAfterOpen?: Handler;
147
+ /**
148
+ * The callback function after the confirmation dialog is closed.
149
+ */
150
+ onAfterClose?: Handler;
151
+ }
152
+ /**
153
+ * Shows a confirmation dialog.
154
+ *
155
+ * @param content - The content of the confirmation.
156
+ * @param onOk - The callback function when the OK button is clicked.
157
+ * @returns A handler function to close the confirmation dialog.
158
+ */
159
+ export declare function showConfirmation(content: ReactNode, onOk: Provider<MaybePromise<void>>): Handler;
160
+ /**
161
+ * Shows a confirmation dialog.
162
+ *
163
+ * @param title - The title of the confirmation.
164
+ * @param content - The content of the confirmation.
165
+ * @param onOk - The callback function when the OK button is clicked.
166
+ * @returns A handler function to close the confirmation dialog.
167
+ */
168
+ export declare function showConfirmation(title: ReactNode, content: ReactNode, onOk: Provider<MaybePromise<void>>): Handler;
169
+ /**
170
+ * Shows a confirmation dialog.
171
+ *
172
+ * @param title - The title of the confirmation.
173
+ * @param content - The content of the confirmation.
174
+ * @param onOk - The callback function when the OK button is clicked.
175
+ * @param options - The options of the confirmation.
176
+ * @param options.okText - The text of the OK button.
177
+ * @param options.cancelText - The text of the cancel button.
178
+ * @param options.onCancel - The callback function when the cancel button is clicked.
179
+ * @param options.onAfterOpen - The callback function after the confirmation dialog is opened.
180
+ * @param options.onAfterClose - The callback function after the confirmation dialog is closed.
181
+ * @returns A handler function to close the confirmation dialog.
182
+ */
183
+ export declare function showConfirmation(title: ReactNode, content: ReactNode, onOk: Provider<MaybePromise<void>>, options: ConfirmationOptions): Handler;
184
+ /**
185
+ * The options for the success alert.
186
+ */
187
+ export interface AlertOptions extends Except<ConfirmationOptions, "cancelText"> {
188
+ }
189
+ /**
190
+ * Shows a success alert.
191
+ *
192
+ * @param content - The content of the alert.
193
+ * @returns A handler function to close the alert.
194
+ */
195
+ export declare function showSuccessAlert(content: ReactNode): Handler;
196
+ /**
197
+ * Shows a success alert.
198
+ *
199
+ * @param content - The content of the alert.
200
+ * @param onOk - The callback function when the OK button is clicked.
201
+ * @returns A handler function to close the alert.
202
+ */
203
+ export declare function showSuccessAlert(content: ReactNode, onOk: Provider<MaybePromise<void>>): Handler;
204
+ /**
205
+ * Shows a success alert.
206
+ *
207
+ * @param title - The title of the alert.
208
+ * @param content - The content of the alert.
209
+ * @returns A handler function to close the alert.
210
+ */
211
+ export declare function showSuccessAlert(title: ReactNode, content: ReactNode): Handler;
212
+ /**
213
+ * Shows a success alert.
214
+ *
215
+ * @param title - The title of the alert.
216
+ * @param content - The content of the alert.
217
+ * @param onOk - The callback function when the OK button is clicked.
218
+ * @returns A handler function to close the alert.
219
+ */
220
+ export declare function showSuccessAlert(title: ReactNode, content: ReactNode, onOk: Provider<MaybePromise<void>>): Handler;
221
+ /**
222
+ * Shows a success alert.
223
+ *
224
+ * @param title - The title of the alert.
225
+ * @param content - The content of the alert.
226
+ * @param onOk - The callback function when the OK button is clicked.
227
+ * @param options - The options of the alert.
228
+ * @param options.okText - The text of the OK button.
229
+ * @param options.onCancel - The callback function when the cancel button is clicked.
230
+ * @param options.onAfterOpen - The callback function after the alert is opened.
231
+ * @param options.onAfterClose - The callback function after the alert is closed.
232
+ * @returns A handler function to close the alert.
233
+ */
234
+ export declare function showSuccessAlert(title: ReactNode, content: ReactNode, onOk: Provider<MaybePromise<void>>, options: AlertOptions): Handler;
235
+ /**
236
+ * Shows an info alert.
237
+ *
238
+ * @param content - The content of the alert.
239
+ * @returns A handler function to close the alert.
240
+ */
241
+ export declare function showInfoAlert(content: ReactNode): Handler;
242
+ /**
243
+ * Shows an info alert.
244
+ *
245
+ * @param content - The content of the alert.
246
+ * @param onOk - The callback function when the OK button is clicked.
247
+ * @returns A handler function to close the alert.
248
+ */
249
+ export declare function showInfoAlert(content: ReactNode, onOk: Provider<MaybePromise<void>>): Handler;
250
+ /**
251
+ * Shows an info alert.
252
+ *
253
+ * @param title - The title of the alert.
254
+ * @param content - The content of the alert.
255
+ * @returns A handler function to close the alert.
256
+ */
257
+ export declare function showInfoAlert(title: ReactNode, content: ReactNode): Handler;
258
+ /**
259
+ * Shows an info alert.
260
+ *
261
+ * @param title - The title of the alert.
262
+ * @param content - The content of the alert.
263
+ * @param onOk - The callback function when the OK button is clicked.
264
+ * @returns A handler function to close the alert.
265
+ */
266
+ export declare function showInfoAlert(title: ReactNode, content: ReactNode, onOk: Provider<MaybePromise<void>>): Handler;
267
+ /**
268
+ * Shows an info alert.
269
+ *
270
+ * @param title - The title of the alert.
271
+ * @param content - The content of the alert.
272
+ * @param onOk - The callback function when the OK button is clicked.
273
+ * @param options - The options of the alert.
274
+ * @param options.okText - The text of the OK button.
275
+ * @param options.onCancel - The callback function when the cancel button is clicked.
276
+ * @param options.onAfterOpen - The callback function after the alert is opened.
277
+ * @param options.onAfterClose - The callback function after the alert is closed.
278
+ * @returns A handler function to close the alert.
279
+ */
280
+ export declare function showInfoAlert(title: ReactNode, content: ReactNode, onOk: Provider<MaybePromise<void>>, options: AlertOptions): Handler;
281
+ /**
282
+ * Shows a warning alert.
283
+ *
284
+ * @param content - The content of the alert.
285
+ * @returns A handler function to close the alert.
286
+ */
287
+ export declare function showWarningAlert(content: ReactNode): Handler;
288
+ /**
289
+ * Shows a warning alert.
290
+ *
291
+ * @param content - The content of the alert.
292
+ * @param onOk - The callback function when the OK button is clicked.
293
+ * @returns A handler function to close the alert.
294
+ */
295
+ export declare function showWarningAlert(content: ReactNode, onOk: Provider<MaybePromise<void>>): Handler;
296
+ /**
297
+ * Shows a warning alert.
298
+ *
299
+ * @param title - The title of the alert.
300
+ * @param content - The content of the alert.
301
+ * @returns A handler function to close the alert.
302
+ */
303
+ export declare function showWarningAlert(title: ReactNode, content: ReactNode): Handler;
304
+ /**
305
+ * Shows a warning alert.
306
+ *
307
+ * @param title - The title of the alert.
308
+ * @param content - The content of the alert.
309
+ * @param onOk - The callback function when the OK button is clicked.
310
+ * @returns A handler function to close the alert.
311
+ */
312
+ export declare function showWarningAlert(title: ReactNode, content: ReactNode, onOk: Provider<MaybePromise<void>>): Handler;
313
+ /**
314
+ * Shows a warning alert.
315
+ *
316
+ * @param title - The title of the alert.
317
+ * @param content - The content of the alert.
318
+ * @param onOk - The callback function when the OK button is clicked.
319
+ * @param options - The options of the alert.
320
+ * @param options.okText - The text of the OK button.
321
+ * @param options.onCancel - The callback function when the cancel button is clicked.
322
+ * @param options.onAfterOpen - The callback function after the alert is opened.
323
+ * @param options.onAfterClose - The callback function after the alert is closed.
324
+ * @returns A handler function to close the alert.
325
+ */
326
+ export declare function showWarningAlert(title: ReactNode, content: ReactNode, onOk: Provider<MaybePromise<void>>, options: AlertOptions): Handler;
327
+ /**
328
+ * Shows an error alert.
329
+ *
330
+ * @param content - The content of the alert.
331
+ * @returns A handler function to close the alert.
332
+ */
333
+ export declare function showErrorAlert(content: ReactNode): Handler;
334
+ /**
335
+ * Shows an error alert.
336
+ *
337
+ * @param content - The content of the alert.
338
+ * @param onOk - The callback function when the OK button is clicked.
339
+ * @returns A handler function to close the alert.
340
+ */
341
+ export declare function showErrorAlert(content: ReactNode, onOk: Provider<MaybePromise<void>>): Handler;
342
+ /**
343
+ * Shows an error alert.
344
+ *
345
+ * @param title - The title of the alert.
346
+ * @param content - The content of the alert.
347
+ * @returns A handler function to close the alert.
348
+ */
349
+ export declare function showErrorAlert(title: ReactNode, content: ReactNode): Handler;
350
+ /**
351
+ * Shows an error alert.
352
+ *
353
+ * @param title - The title of the alert.
354
+ * @param content - The content of the alert.
355
+ * @param onOk - The callback function when the OK button is clicked.
356
+ * @returns A handler function to close the alert.
357
+ */
358
+ export declare function showErrorAlert(title: ReactNode, content: ReactNode, onOk: Provider<MaybePromise<void>>): Handler;
359
+ /**
360
+ * Shows an error alert.
361
+ *
362
+ * @param title - The title of the alert.
363
+ * @param content - The content of the alert.
364
+ * @param onOk - The callback function when the OK button is clicked.
365
+ * @param options - The options of the alert.
366
+ * @param options.okText - The text of the OK button.
367
+ * @param options.onCancel - The callback function when the cancel button is clicked.
368
+ * @param options.onAfterOpen - The callback function after the alert is opened.
369
+ * @param options.onAfterClose - The callback function after the alert is closed.
370
+ * @returns A handler function to close the alert.
371
+ */
372
+ export declare function showErrorAlert(title: ReactNode, content: ReactNode, onOk: Provider<MaybePromise<void>>, options: AlertOptions): Handler;
@@ -0,0 +1,3 @@
1
+ /*! VefFramework version: 1.0.5, build time: 2024-12-10T10:24:47.065Z, made by Venus. */
2
+ import n,{CheckOutlined as o}from"@ant-design/icons";import{Modal as t,message as e,notification as r}from"antd";import{createElement as i}from"react";import{VefIconTickCircle as c,VefIconInfoCircle as s,VefIconAlertTriangle as a,VefIconAlertCircle as f}from"./icons.js";import"./lib.js";import{isFunction as u}from"radashi";const{confirm:l,info:p,success:m,warning:g,error:w}=t,d=i(n,{component:c}),h=i(n,{component:s}),v=i(n,{component:a}),y=i(n,{component:f}),E=i(n,{className:"vef-notification-notice-icon vef-notification-notice-icon-success",component:c}),b=i(n,{className:"vef-notification-notice-icon vef-notification-notice-icon-info",component:s}),q=i(n,{className:"vef-notification-notice-icon vef-notification-notice-icon-warning",component:a}),C=i(n,{className:"vef-notification-notice-icon vef-notification-notice-icon-error",component:f});function x(n){e.open({type:"success",content:n,duration:2,icon:d})}function A(n){e.open({type:"info",content:n,duration:3,icon:h})}function N(n){e.open({type:"warning",content:n,duration:3,icon:v})}function k(n){e.open({type:"error",content:n,duration:4,icon:y})}function O(n){const o=e.open({type:"loading",content:n,duration:0});return()=>o()}const T="提示";function j(n,o,t){const e=arguments.length;if(e<1)throw new Error("showSuccessNotification requires at least one argument");const i=e>1?n:T,c=e>1?o:n,s=3===e?t:void 0;r.open({type:"success",message:i,description:c,duration:4,closable:!0,btn:s,icon:E})}function B(n,o,t){const e=arguments.length;if(e<1)throw new Error("showInfoNotification requires at least one argument");const i=e>1?n:T,c=e>1?o:n,s=3===e?t:void 0;r.open({type:"info",message:i,description:c,duration:5,closable:!0,btn:s,icon:b})}function I(n,o,t){const e=arguments.length;if(e<1)throw new Error("showWarningNotification requires at least one argument");const i=e>1?n:T,c=e>1?o:n,s=3===e?t:void 0;r.open({type:"warning",message:i,description:c,duration:5,closable:!0,btn:s,icon:q})}function P(n,o,t){const e=arguments.length;if(e<1)throw new Error("showErrorNotification requires at least one argument");const i=e>1?n:T,c=e>1?o:n,s=3===e?t:void 0;r.open({type:"error",message:i,description:c,duration:6,closable:!0,btn:s,icon:C})}const S={color:"default",variant:"text"},W={icon:i(o)};function z(n,o,t,e){const r=arguments.length;if(r<2)throw new Error("showConfirmation requires at least two arguments");const i=r>2?n:"提示",c=2===r?n:o,s=2===r?o:t,{okText:a,cancelText:f,onCancel:p,onAfterOpen:m,onAfterClose:g}=e??{},{destroy:w}=l({title:i,content:c,cancelButtonProps:S,okButtonProps:W,centered:!0,icon:v,onOk:s,okText:a,cancelText:f,onCancel:p,afterOpenChange:u(m)||u(g)?n=>{n?m?.():g?.()}:void 0});return w}const D={success:m,info:p,warning:g,error:w},F={success:d,info:h,warning:v,error:y},G="👍🏻 好的,知道了";function H(n,o,t=T,e,r){const{okText:i=G,onCancel:c,onAfterOpen:s,onAfterClose:a}=r??{},{destroy:f}=D[n]({title:t,content:o,icon:F[n],centered:!0,onOk:e,okText:i,onCancel:c,afterOpenChange:u(s)||u(a)?n=>{n?s?.():a?.()}:void 0});return f}function J(n,o,t,e){const r=arguments.length;if(r<1)throw new Error("showSuccessAlert requires at least one argument");const i=1===r||u(o)?void 0:n;return H("success",1===r||u(o)?n:o,i,2===r||u(o)?o:t,e)}function K(n,o,t,e){const r=arguments.length;if(r<1)throw new Error("showInfoAlert requires at least one argument");const i=1===r||u(o)?void 0:n;return H("info",1===r||u(o)?n:o,i,2===r||u(o)?o:t,e)}function L(n,o,t,e){const r=arguments.length;if(r<1)throw new Error("showWarningAlert requires at least one argument");const i=1===r||u(o)?void 0:n;return H("warning",1===r||u(o)?n:o,i,2===r||u(o)?o:t,e)}function M(n,o,t,e){const r=arguments.length;if(r<1)throw new Error("showErrorAlert requires at least one argument");const i=1===r||u(o)?void 0:n;return H("error",1===r||u(o)?n:o,i,2===r||u(o)?o:t,e)}export{T as defaultMessageTitle,y as errorIcon,h as infoIcon,z as showConfirmation,M as showErrorAlert,k as showErrorMessage,P as showErrorNotification,K as showInfoAlert,A as showInfoMessage,B as showInfoNotification,O as showLoadingMessage,J as showSuccessAlert,x as showSuccessMessage,j as showSuccessNotification,L as showWarningAlert,N as showWarningMessage,I as showWarningNotification,d as successIcon,v as warningIcon};
3
+ /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
package/dist/path.d.ts ADDED
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Extracts the base name from a path
3
+ *
4
+ * @param path The path
5
+ * @param keepExt Whether to keep the extension
6
+ * @returns The base name
7
+ */
8
+ export declare function extractBaseName(path: string, keepExt?: boolean): string;
9
+ /**
10
+ * Extracts the extension name from a path
11
+ *
12
+ * @param path The path
13
+ * @returns The extension name
14
+ */
15
+ export declare function extractExtName(path: string): string;
16
+ /**
17
+ * Extracts the dir name from a path
18
+ *
19
+ * @param path The path
20
+ * @returns The dir name
21
+ */
22
+ export declare function extractDirName(path: string): string;
23
+ /**
24
+ * Joins paths
25
+ *
26
+ * @param paths The paths
27
+ * @returns The joined path
28
+ */
29
+ export declare function joinPaths(...paths: string[]): string;
30
+ /**
31
+ * Checks if a path is absolute
32
+ *
33
+ * @param path The path
34
+ * @returns Whether the path is absolute
35
+ */
36
+ export declare function isAbsolutePath(path: string): boolean;
37
+ /**
38
+ * Normalizes a path
39
+ *
40
+ * @param path The path
41
+ * @returns The normalized path
42
+ */
43
+ export declare function normalizePath(path: string): string;
package/dist/path.js ADDED
@@ -0,0 +1,3 @@
1
+ /*! VefFramework version: 1.0.5, build time: 2024-12-10T10:24:47.065Z, made by Venus. */
2
+ import{extname as n,basename as r,dirname as t,join as o,isAbsolute as u,normalize as i}from"path-browserify";function e(t,o=!0){const u=o?n(t):void 0;return r(t,u)}function f(r){return n(r)}function c(n){return t(n)}function p(...n){return o(...n)}function m(n){return u(n)}function s(n){return i(n)}export{e as extractBaseName,c as extractDirName,f as extractExtName,m as isAbsolutePath,p as joinPaths,s as normalizePath};
3
+ /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Parse the pinyin of the text.
3
+ *
4
+ * @param text The text to parse.
5
+ * @returns The pinyin of the text.
6
+ */
7
+ export declare function parsePinyin(text: string): string[];
8
+ /**
9
+ * Parse the first letter of the pinyin of the text.
10
+ *
11
+ * @param text The text to parse.
12
+ * @returns The first letter of the pinyin of the text.
13
+ */
14
+ export declare function parsePinyinFirstLetter(text: string): string[];
package/dist/pinyin.js ADDED
@@ -0,0 +1,3 @@
1
+ /*! VefFramework version: 1.0.5, build time: 2024-12-10T10:24:47.065Z, made by Venus. */
2
+ import{pinyin as n}from"pinyin-pro";function e(e){return n(e,{pattern:"pinyin",toneType:"none",type:"array",mode:"normal",nonZh:"consecutive"})}function o(e){return n(e,{pattern:"first",toneType:"none",type:"array",mode:"normal",nonZh:"consecutive"})}export{e as parsePinyin,o as parsePinyinFirstLetter};
3
+ /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Encrypts a value using RSA
3
+ *
4
+ * @param value - The value to encrypt
5
+ * @param publicKey - The public key to use for encryption
6
+ * @returns The encrypted value
7
+ */
8
+ export declare function encryptRsa(value: string, publicKey: string): string;
9
+ /**
10
+ * Decrypts a value using RSA
11
+ *
12
+ * @param value - The value to decrypt
13
+ * @param privateKey - The private key to use for decryption
14
+ * @returns The decrypted value
15
+ */
16
+ export declare function decryptRsa(value: string, privateKey: string): string;
@@ -0,0 +1,3 @@
1
+ /*! VefFramework version: 1.0.5, build time: 2024-12-10T10:24:47.065Z, made by Venus. */
2
+ import t from"jsencrypt";function e(e,r){const n=new t;n.setPublicKey(r);const o=n.encrypt(e);if(!o)throw new Error(`Failed to encrypt value [${e}] using RSA`);return o}function r(e,r){const n=new t;n.setPrivateKey(r);const o=n.decrypt(e);if(!o)throw new Error(`Failed to decrypt value [${e}] using RSA`);return o}export{r as decryptRsa,e as encryptRsa};
3
+ /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
@@ -0,0 +1,25 @@
1
+ import type { StoreApi } from "zustand";
2
+ import { type FC } from "react";
3
+ import type { ChildrenProps, Mapper, MaybeNull, MaybeUndefined } from "./types";
4
+ /**
5
+ * The props of the store provider
6
+ */
7
+ export interface StoreProviderProps<T> extends ChildrenProps {
8
+ /**
9
+ * The initial state of the store
10
+ */
11
+ initialState?: T;
12
+ }
13
+ /**
14
+ * Create a store used only in a component
15
+ *
16
+ * @param name The store name
17
+ * @param storeCreator The store creator
18
+ * @returns The store context and provider
19
+ */
20
+ export declare function createComponentStore<S, T extends Partial<S>>(name: string, storeCreator: Mapper<MaybeUndefined<T>, StoreApi<S>>): {
21
+ StoreContext: import("react").Context<MaybeNull<StoreApi<S>>>;
22
+ StoreProvider: FC<StoreProviderProps<T>>;
23
+ useStore: <T_1>(selector: Mapper<S, T_1>) => T_1;
24
+ useStoreApi: () => StoreApi<S>;
25
+ };
package/dist/store.js ADDED
@@ -0,0 +1,3 @@
1
+ /*! VefFramework version: 1.0.5, build time: 2024-12-10T10:24:47.065Z, made by Venus. */
2
+ import{createContext as r,useState as t,createElement as o,useContext as e}from"react";import{useStoreWithEqualityFn as i}from"zustand/traditional";import"./lib.js";import n from"react-fast-compare";function a(a,s){const u=r(null),c=()=>{const r=e(u);if(!r)throw new Error(`${a}Store can be used only inside ${a}StoreProvider`);return r};return{StoreContext:u,StoreProvider:({initialState:r,children:e})=>{const[i]=t((()=>s(r)));return o(u.Provider,{value:i},e)},useStore:r=>i(c(),r,n),useStoreApi:c}}export{a as createComponentStore};
3
+ /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
@@ -0,0 +1,21 @@
1
+ declare const breakpointWidths: {
2
+ xs: number;
3
+ sm: number;
4
+ md: number;
5
+ lg: number;
6
+ xl: number;
7
+ xxl: number;
8
+ };
9
+ export declare const breakpoints: readonly ["xs", "sm", "md", "lg", "xl", "xxl"];
10
+ export type Breakpoint = keyof typeof breakpointWidths;
11
+ type BreakpointMediaQuery = {
12
+ [key in Breakpoint]: string;
13
+ };
14
+ export declare const bmq: BreakpointMediaQuery;
15
+ export declare const styles: {
16
+ flexCenter: import("@emotion/react").SerializedStyles;
17
+ fullHeight: import("@emotion/react").SerializedStyles;
18
+ fullWidth: import("@emotion/react").SerializedStyles;
19
+ scrollbar: import("@emotion/react").SerializedStyles;
20
+ };
21
+ export {};
package/dist/styles.js ADDED
@@ -0,0 +1,3 @@
1
+ /*! VefFramework version: 1.0.5, build time: 2024-12-10T10:24:47.065Z, made by Venus. */
2
+ import{css as t}from"@emotion/react";const l={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400},e=["xs","sm","md","lg","xl","xxl"],r=Object.keys(l).reduce(((t,e)=>(t[e]=`@media (min-width: ${l[e]}px)`,t)),{}),s={flexCenter:t({display:"flex",justifyContent:"center",alignItems:"center"}),fullHeight:t({height:"100%"}),fullWidth:t({width:"100%"}),scrollbar:t({scrollbarWidth:"thin",scrollbarColor:"rgba(0, 0, 0, 0.3) transparent",scrollbarGutter:"stable"})};export{r as bmq,e as breakpoints,s as styles};
3
+ /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Gets the current date
3
+ *
4
+ * @returns The current date
5
+ */
6
+ export declare function getNowDate(): Date;
7
+ /**
8
+ * Gets the current date string
9
+ *
10
+ * @returns The current date string
11
+ */
12
+ export declare function getNowDateString(): string;
13
+ /**
14
+ * Gets the today date string
15
+ *
16
+ * @returns The today date string
17
+ */
18
+ export declare function getTodayString(): string;
@@ -0,0 +1,3 @@
1
+ /*! VefFramework version: 1.0.5, build time: 2024-12-10T10:24:47.065Z, made by Venus. */
2
+ import{tz as n}from"@date-fns/tz";import{format as t}from"date-fns";import{zhCN as a}from"date-fns/locale";function o(){return new Date}function r(){return t(o(),"yyyy-MM-dd",{locale:a,in:n("Asia/Shanghai")})}function e(){return t(o(),"PPPPpp",{locale:a,in:n("Asia/Shanghai")})}export{o as getNowDate,r as getNowDateString,e as getTodayString};
3
+ /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */