@vef-framework/shared 1.0.101 → 1.0.103

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/lib/message.cjs CHANGED
@@ -1,305 +1 @@
1
- /*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.461Z, made by Venus. */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const Icon = require('@ant-design/icons');
7
- const antd = require('antd');
8
- const react = require('react');
9
- const icons = require('./icons.cjs');
10
- require('./lib.cjs');
11
- const radashi = require('radashi');
12
-
13
- const {
14
- confirm,
15
- info,
16
- success,
17
- warning,
18
- error
19
- } = antd.Modal;
20
- const checkIcon = react.createElement(Icon, {
21
- component: icons.IconCheck
22
- });
23
- const successIcon = react.createElement(Icon, {
24
- component: icons.IconTickCircle
25
- });
26
- const infoIcon = react.createElement(Icon, {
27
- component: icons.IconInfoCircle
28
- });
29
- const warningIcon = react.createElement(Icon, {
30
- component: icons.IconAlertTriangle
31
- });
32
- const errorIcon = react.createElement(Icon, {
33
- component: icons.IconAlertCircle
34
- });
35
- const notificationSuccessIcon = react.createElement(Icon, {
36
- className: "vef-notification-notice-icon vef-notification-notice-icon-success",
37
- component: icons.IconTickCircle
38
- });
39
- const notificationInfoIcon = react.createElement(Icon, {
40
- className: "vef-notification-notice-icon vef-notification-notice-icon-info",
41
- component: icons.IconInfoCircle
42
- });
43
- const notificationWarningIcon = react.createElement(Icon, {
44
- className: "vef-notification-notice-icon vef-notification-notice-icon-warning",
45
- component: icons.IconAlertTriangle
46
- });
47
- const notificationErrorIcon = react.createElement(Icon, {
48
- className: "vef-notification-notice-icon vef-notification-notice-icon-error",
49
- component: icons.IconAlertCircle
50
- });
51
- function showSuccessMessage(content) {
52
- antd.message.open({
53
- type: "success",
54
- content,
55
- duration: 2,
56
- icon: successIcon
57
- });
58
- }
59
- function showInfoMessage(content) {
60
- antd.message.open({
61
- type: "info",
62
- content,
63
- duration: 3,
64
- icon: infoIcon
65
- });
66
- }
67
- function showWarningMessage(content) {
68
- antd.message.open({
69
- type: "warning",
70
- content,
71
- duration: 3,
72
- icon: warningIcon
73
- });
74
- }
75
- function showErrorMessage(content) {
76
- antd.message.open({
77
- type: "error",
78
- content,
79
- duration: 4,
80
- icon: errorIcon
81
- });
82
- }
83
- function showLoadingMessage(content) {
84
- const close = antd.message.open({
85
- type: "loading",
86
- content,
87
- duration: 0
88
- });
89
- return () => close();
90
- }
91
- const defaultMessageTitle = "提示";
92
- function showSuccessNotification(titleOrContent, content, buttons) {
93
- const argsLength = arguments.length;
94
- if (argsLength < 1) {
95
- throw new Error("showSuccessNotification requires at least one argument");
96
- }
97
- const titleToUse = argsLength > 1 ? titleOrContent : defaultMessageTitle;
98
- const contentToUse = argsLength > 1 ? content : titleOrContent;
99
- const buttonsToUse = argsLength === 3 ? buttons : void 0;
100
- antd.notification.open({
101
- type: "success",
102
- message: titleToUse,
103
- description: contentToUse,
104
- duration: 4,
105
- closable: true,
106
- btn: buttonsToUse,
107
- icon: notificationSuccessIcon
108
- });
109
- }
110
- function showInfoNotification(titleOrContent, content, buttons) {
111
- const argsLength = arguments.length;
112
- if (argsLength < 1) {
113
- throw new Error("showInfoNotification requires at least one argument");
114
- }
115
- const titleToUse = argsLength > 1 ? titleOrContent : defaultMessageTitle;
116
- const contentToUse = argsLength > 1 ? content : titleOrContent;
117
- const buttonsToUse = argsLength === 3 ? buttons : void 0;
118
- antd.notification.open({
119
- type: "info",
120
- message: titleToUse,
121
- description: contentToUse,
122
- duration: 5,
123
- closable: true,
124
- btn: buttonsToUse,
125
- icon: notificationInfoIcon
126
- });
127
- }
128
- function showWarningNotification(titleOrContent, content, buttons) {
129
- const argsLength = arguments.length;
130
- if (argsLength < 1) {
131
- throw new Error("showWarningNotification requires at least one argument");
132
- }
133
- const titleToUse = argsLength > 1 ? titleOrContent : defaultMessageTitle;
134
- const contentToUse = argsLength > 1 ? content : titleOrContent;
135
- const buttonsToUse = argsLength === 3 ? buttons : void 0;
136
- antd.notification.open({
137
- type: "warning",
138
- message: titleToUse,
139
- description: contentToUse,
140
- duration: 6,
141
- closable: true,
142
- btn: buttonsToUse,
143
- icon: notificationWarningIcon
144
- });
145
- }
146
- function showErrorNotification(titleOrContent, content, buttons) {
147
- const argsLength = arguments.length;
148
- if (argsLength < 1) {
149
- throw new Error("showErrorNotification requires at least one argument");
150
- }
151
- const titleToUse = argsLength > 1 ? titleOrContent : defaultMessageTitle;
152
- const contentToUse = argsLength > 1 ? content : titleOrContent;
153
- const buttonsToUse = argsLength === 3 ? buttons : void 0;
154
- antd.notification.open({
155
- type: "error",
156
- message: titleToUse,
157
- description: contentToUse,
158
- duration: 10,
159
- closable: true,
160
- btn: buttonsToUse,
161
- icon: notificationErrorIcon
162
- });
163
- }
164
- const cancelButtonProps = {
165
- color: "default",
166
- variant: "text"
167
- };
168
- const okButtonProps = {
169
- icon: checkIcon
170
- };
171
- function showConfirmation(title, content, onOk, options) {
172
- const argsLength = arguments.length;
173
- if (argsLength < 2) {
174
- throw new Error("showConfirmation requires at least two arguments");
175
- }
176
- const titleToUse = argsLength > 2 ? title : "提示";
177
- const contentToUse = argsLength === 2 ? title : content;
178
- const onOkToUse = argsLength === 2 ? content : onOk;
179
- const {
180
- okText,
181
- cancelText,
182
- onCancel,
183
- onAfterOpen,
184
- onAfterClose
185
- } = options ?? {};
186
- const { destroy } = confirm({
187
- title: titleToUse,
188
- content: contentToUse,
189
- cancelButtonProps,
190
- okButtonProps,
191
- centered: true,
192
- onOk: onOkToUse,
193
- okText,
194
- cancelText,
195
- onCancel,
196
- afterOpenChange: radashi.isFunction(onAfterOpen) || radashi.isFunction(onAfterClose) ? (open) => {
197
- if (open) {
198
- onAfterOpen?.();
199
- } else {
200
- onAfterClose?.();
201
- }
202
- } : void 0
203
- });
204
- return destroy;
205
- }
206
- const alertFnMap = {
207
- success,
208
- info,
209
- warning,
210
- error
211
- };
212
- const alertIconMap = {
213
- success: successIcon,
214
- info: infoIcon,
215
- warning: warningIcon,
216
- error: errorIcon
217
- };
218
- const defaultOkText = "👍🏻 好的,知道了";
219
- function showAlert(type, content, title = defaultMessageTitle, onOk, options) {
220
- const {
221
- okText = defaultOkText,
222
- onCancel,
223
- onAfterOpen,
224
- onAfterClose
225
- } = options ?? {};
226
- const { destroy } = alertFnMap[type]({
227
- title,
228
- content,
229
- icon: alertIconMap[type],
230
- centered: true,
231
- onOk,
232
- okText,
233
- onCancel,
234
- afterOpenChange: radashi.isFunction(onAfterOpen) || radashi.isFunction(onAfterClose) ? (open) => {
235
- if (open) {
236
- onAfterOpen?.();
237
- } else {
238
- onAfterClose?.();
239
- }
240
- } : void 0
241
- });
242
- return destroy;
243
- }
244
- function showSuccessAlert(title, content, onOk, options) {
245
- const argsLength = arguments.length;
246
- if (argsLength < 1) {
247
- throw new Error("showSuccessAlert requires at least one argument");
248
- }
249
- const titleToUse = argsLength === 1 || radashi.isFunction(content) ? void 0 : title;
250
- const contentToUse = argsLength === 1 || radashi.isFunction(content) ? title : content;
251
- const onOkToUse = argsLength === 2 || radashi.isFunction(content) ? content : onOk;
252
- return showAlert("success", contentToUse, titleToUse, onOkToUse, options);
253
- }
254
- function showInfoAlert(title, content, onOk, options) {
255
- const argsLength = arguments.length;
256
- if (argsLength < 1) {
257
- throw new Error("showInfoAlert requires at least one argument");
258
- }
259
- const titleToUse = argsLength === 1 || radashi.isFunction(content) ? void 0 : title;
260
- const contentToUse = argsLength === 1 || radashi.isFunction(content) ? title : content;
261
- const onOkToUse = argsLength === 2 || radashi.isFunction(content) ? content : onOk;
262
- return showAlert("info", contentToUse, titleToUse, onOkToUse, options);
263
- }
264
- function showWarningAlert(title, content, onOk, options) {
265
- const argsLength = arguments.length;
266
- if (argsLength < 1) {
267
- throw new Error("showWarningAlert requires at least one argument");
268
- }
269
- const titleToUse = argsLength === 1 || radashi.isFunction(content) ? void 0 : title;
270
- const contentToUse = argsLength === 1 || radashi.isFunction(content) ? title : content;
271
- const onOkToUse = argsLength === 2 || radashi.isFunction(content) ? content : onOk;
272
- return showAlert("warning", contentToUse, titleToUse, onOkToUse, options);
273
- }
274
- function showErrorAlert(title, content, onOk, options) {
275
- const argsLength = arguments.length;
276
- if (argsLength < 1) {
277
- throw new Error("showErrorAlert requires at least one argument");
278
- }
279
- const titleToUse = argsLength === 1 || radashi.isFunction(content) ? void 0 : title;
280
- const contentToUse = argsLength === 1 || radashi.isFunction(content) ? title : content;
281
- const onOkToUse = argsLength === 2 || radashi.isFunction(content) ? content : onOk;
282
- return showAlert("error", contentToUse, titleToUse, onOkToUse, options);
283
- }
284
-
285
- exports.checkIcon = checkIcon;
286
- exports.defaultMessageTitle = defaultMessageTitle;
287
- exports.errorIcon = errorIcon;
288
- exports.infoIcon = infoIcon;
289
- exports.showConfirmation = showConfirmation;
290
- exports.showErrorAlert = showErrorAlert;
291
- exports.showErrorMessage = showErrorMessage;
292
- exports.showErrorNotification = showErrorNotification;
293
- exports.showInfoAlert = showInfoAlert;
294
- exports.showInfoMessage = showInfoMessage;
295
- exports.showInfoNotification = showInfoNotification;
296
- exports.showLoadingMessage = showLoadingMessage;
297
- exports.showSuccessAlert = showSuccessAlert;
298
- exports.showSuccessMessage = showSuccessMessage;
299
- exports.showSuccessNotification = showSuccessNotification;
300
- exports.showWarningAlert = showWarningAlert;
301
- exports.showWarningMessage = showWarningMessage;
302
- exports.showWarningNotification = showWarningNotification;
303
- exports.successIcon = successIcon;
304
- exports.warningIcon = warningIcon;
305
- /*! 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 */
1
+ "use strict";/*! VefFramework version: 1.0.103, build time: 2025-03-07T17:03:51.264Z, made by Venus. */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Icon=require("@ant-design/icons"),antd=require("antd"),react=require("react"),icons=require("./icons.cjs");require("./lib.cjs");const radashi=require("radashi"),{confirm,info,success,warning,error}=antd.Modal,checkIcon=react.createElement(Icon,{component:icons.IconCheck}),successIcon=react.createElement(Icon,{component:icons.IconTickCircle}),infoIcon=react.createElement(Icon,{component:icons.IconInfoCircle}),warningIcon=react.createElement(Icon,{component:icons.IconAlertTriangle}),errorIcon=react.createElement(Icon,{component:icons.IconAlertCircle}),notificationSuccessIcon=react.createElement(Icon,{className:"vef-notification-notice-icon vef-notification-notice-icon-success",component:icons.IconTickCircle}),notificationInfoIcon=react.createElement(Icon,{className:"vef-notification-notice-icon vef-notification-notice-icon-info",component:icons.IconInfoCircle}),notificationWarningIcon=react.createElement(Icon,{className:"vef-notification-notice-icon vef-notification-notice-icon-warning",component:icons.IconAlertTriangle}),notificationErrorIcon=react.createElement(Icon,{className:"vef-notification-notice-icon vef-notification-notice-icon-error",component:icons.IconAlertCircle});function showSuccessMessage(content){antd.message.open({type:"success",content,duration:2,icon:successIcon})}function showInfoMessage(content){antd.message.open({type:"info",content,duration:3,icon:infoIcon})}function showWarningMessage(content){antd.message.open({type:"warning",content,duration:3,icon:warningIcon})}function showErrorMessage(content){antd.message.open({type:"error",content,duration:4,icon:errorIcon})}function showLoadingMessage(content){const close=antd.message.open({type:"loading",content,duration:0});return()=>close()}const defaultMessageTitle="提示";function showSuccessNotification(titleOrContent,content,buttons){const argsLength=arguments.length;if(argsLength<1)throw new Error("showSuccessNotification requires at least one argument");const titleToUse=argsLength>1?titleOrContent:defaultMessageTitle,contentToUse=argsLength>1?content:titleOrContent,buttonsToUse=argsLength===3?buttons:void 0;antd.notification.open({type:"success",message:titleToUse,description:contentToUse,duration:4,closable:!0,btn:buttonsToUse,icon:notificationSuccessIcon})}function showInfoNotification(titleOrContent,content,buttons){const argsLength=arguments.length;if(argsLength<1)throw new Error("showInfoNotification requires at least one argument");const titleToUse=argsLength>1?titleOrContent:defaultMessageTitle,contentToUse=argsLength>1?content:titleOrContent,buttonsToUse=argsLength===3?buttons:void 0;antd.notification.open({type:"info",message:titleToUse,description:contentToUse,duration:5,closable:!0,btn:buttonsToUse,icon:notificationInfoIcon})}function showWarningNotification(titleOrContent,content,buttons){const argsLength=arguments.length;if(argsLength<1)throw new Error("showWarningNotification requires at least one argument");const titleToUse=argsLength>1?titleOrContent:defaultMessageTitle,contentToUse=argsLength>1?content:titleOrContent,buttonsToUse=argsLength===3?buttons:void 0;antd.notification.open({type:"warning",message:titleToUse,description:contentToUse,duration:6,closable:!0,btn:buttonsToUse,icon:notificationWarningIcon})}function showErrorNotification(titleOrContent,content,buttons){const argsLength=arguments.length;if(argsLength<1)throw new Error("showErrorNotification requires at least one argument");const titleToUse=argsLength>1?titleOrContent:defaultMessageTitle,contentToUse=argsLength>1?content:titleOrContent,buttonsToUse=argsLength===3?buttons:void 0;antd.notification.open({type:"error",message:titleToUse,description:contentToUse,duration:10,closable:!0,btn:buttonsToUse,icon:notificationErrorIcon})}const cancelButtonProps={color:"default",variant:"text"},okButtonProps={icon:checkIcon};function showConfirmation(title,content,onOk,options){const argsLength=arguments.length;if(argsLength<2)throw new Error("showConfirmation requires at least two arguments");const titleToUse=argsLength>2?title:"提示",contentToUse=argsLength===2?title:content,onOkToUse=argsLength===2?content:onOk,{okText,cancelText,onCancel,onAfterOpen,onAfterClose}=options??{},{destroy}=confirm({title:titleToUse,content:contentToUse,cancelButtonProps,okButtonProps,centered:!0,onOk:onOkToUse,okText,cancelText,onCancel,afterOpenChange:radashi.isFunction(onAfterOpen)||radashi.isFunction(onAfterClose)?open=>{open?onAfterOpen?.():onAfterClose?.()}:void 0});return destroy}const alertFnMap={success,info,warning,error},alertIconMap={success:successIcon,info:infoIcon,warning:warningIcon,error:errorIcon},defaultOkText="👍🏻 好的,知道了";function showAlert(type,content,title=defaultMessageTitle,onOk,options){const{okText=defaultOkText,onCancel,onAfterOpen,onAfterClose}=options??{},{destroy}=alertFnMap[type]({title,content,icon:alertIconMap[type],centered:!0,onOk,okText,onCancel,afterOpenChange:radashi.isFunction(onAfterOpen)||radashi.isFunction(onAfterClose)?open=>{open?onAfterOpen?.():onAfterClose?.()}:void 0});return destroy}function showSuccessAlert(title,content,onOk,options){const argsLength=arguments.length;if(argsLength<1)throw new Error("showSuccessAlert requires at least one argument");const titleToUse=argsLength===1||radashi.isFunction(content)?void 0:title,contentToUse=argsLength===1||radashi.isFunction(content)?title:content,onOkToUse=argsLength===2||radashi.isFunction(content)?content:onOk;return showAlert("success",contentToUse,titleToUse,onOkToUse,options)}function showInfoAlert(title,content,onOk,options){const argsLength=arguments.length;if(argsLength<1)throw new Error("showInfoAlert requires at least one argument");const titleToUse=argsLength===1||radashi.isFunction(content)?void 0:title,contentToUse=argsLength===1||radashi.isFunction(content)?title:content,onOkToUse=argsLength===2||radashi.isFunction(content)?content:onOk;return showAlert("info",contentToUse,titleToUse,onOkToUse,options)}function showWarningAlert(title,content,onOk,options){const argsLength=arguments.length;if(argsLength<1)throw new Error("showWarningAlert requires at least one argument");const titleToUse=argsLength===1||radashi.isFunction(content)?void 0:title,contentToUse=argsLength===1||radashi.isFunction(content)?title:content,onOkToUse=argsLength===2||radashi.isFunction(content)?content:onOk;return showAlert("warning",contentToUse,titleToUse,onOkToUse,options)}function showErrorAlert(title,content,onOk,options){const argsLength=arguments.length;if(argsLength<1)throw new Error("showErrorAlert requires at least one argument");const titleToUse=argsLength===1||radashi.isFunction(content)?void 0:title,contentToUse=argsLength===1||radashi.isFunction(content)?title:content,onOkToUse=argsLength===2||radashi.isFunction(content)?content:onOk;return showAlert("error",contentToUse,titleToUse,onOkToUse,options)}exports.checkIcon=checkIcon,exports.defaultMessageTitle=defaultMessageTitle,exports.errorIcon=errorIcon,exports.infoIcon=infoIcon,exports.showConfirmation=showConfirmation,exports.showErrorAlert=showErrorAlert,exports.showErrorMessage=showErrorMessage,exports.showErrorNotification=showErrorNotification,exports.showInfoAlert=showInfoAlert,exports.showInfoMessage=showInfoMessage,exports.showInfoNotification=showInfoNotification,exports.showLoadingMessage=showLoadingMessage,exports.showSuccessAlert=showSuccessAlert,exports.showSuccessMessage=showSuccessMessage,exports.showSuccessNotification=showSuccessNotification,exports.showWarningAlert=showWarningAlert,exports.showWarningMessage=showWarningMessage,exports.showWarningNotification=showWarningNotification,exports.successIcon=successIcon,exports.warningIcon=warningIcon;/*! 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/lib/path.cjs CHANGED
@@ -1,42 +1 @@
1
- /*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.461Z, made by Venus. */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const path = require('path-browserify');
7
-
8
- const {
9
- basename,
10
- dirname,
11
- extname,
12
- isAbsolute,
13
- join,
14
- normalize
15
- } = path;
16
- function extractBaseName(path2, keepExt = true) {
17
- const ext = keepExt ? void 0 : extname(path2);
18
- return basename(path2, ext);
19
- }
20
- function extractExtName(path2) {
21
- return extname(path2);
22
- }
23
- function extractDirName(path2) {
24
- return dirname(path2);
25
- }
26
- function joinPaths(...paths) {
27
- return join(...paths);
28
- }
29
- function isAbsolutePath(path2) {
30
- return isAbsolute(path2);
31
- }
32
- function normalizePath(path2) {
33
- return normalize(path2);
34
- }
35
-
36
- exports.extractBaseName = extractBaseName;
37
- exports.extractDirName = extractDirName;
38
- exports.extractExtName = extractExtName;
39
- exports.isAbsolutePath = isAbsolutePath;
40
- exports.joinPaths = joinPaths;
41
- exports.normalizePath = normalizePath;
42
- /*! 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 */
1
+ "use strict";/*! VefFramework version: 1.0.103, build time: 2025-03-07T17:03:51.264Z, made by Venus. */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const path=require("path-browserify"),{basename,dirname,extname,isAbsolute,join,normalize}=path;function extractBaseName(path2,keepExt=!0){const ext=keepExt?void 0:extname(path2);return basename(path2,ext)}function extractExtName(path2){return extname(path2)}function extractDirName(path2){return dirname(path2)}function joinPaths(...paths){return join(...paths)}function isAbsolutePath(path2){return isAbsolute(path2)}function normalizePath(path2){return normalize(path2)}exports.extractBaseName=extractBaseName,exports.extractDirName=extractDirName,exports.extractExtName=extractExtName,exports.isAbsolutePath=isAbsolutePath,exports.joinPaths=joinPaths,exports.normalizePath=normalizePath;/*! 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/lib/pinyin.cjs CHANGED
@@ -1,35 +1 @@
1
- /*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.461Z, made by Venus. */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const pinyinPro = require('pinyin-pro');
7
-
8
- function parsePinyin(text) {
9
- return pinyinPro.pinyin(
10
- text,
11
- {
12
- pattern: "pinyin",
13
- toneType: "none",
14
- type: "array",
15
- mode: "normal",
16
- nonZh: "consecutive"
17
- }
18
- );
19
- }
20
- function parsePinyinFirstLetter(text) {
21
- return pinyinPro.pinyin(
22
- text,
23
- {
24
- pattern: "first",
25
- toneType: "none",
26
- type: "array",
27
- mode: "normal",
28
- nonZh: "consecutive"
29
- }
30
- );
31
- }
32
-
33
- exports.parsePinyin = parsePinyin;
34
- exports.parsePinyinFirstLetter = parsePinyinFirstLetter;
35
- /*! 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 */
1
+ "use strict";/*! VefFramework version: 1.0.103, build time: 2025-03-07T17:03:51.264Z, made by Venus. */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const pinyinPro=require("pinyin-pro");function parsePinyin(text){return pinyinPro.pinyin(text,{pattern:"pinyin",toneType:"none",type:"array",mode:"normal",nonZh:"consecutive"})}function parsePinyinFirstLetter(text){return pinyinPro.pinyin(text,{pattern:"first",toneType:"none",type:"array",mode:"normal",nonZh:"consecutive"})}exports.parsePinyin=parsePinyin,exports.parsePinyinFirstLetter=parsePinyinFirstLetter;/*! 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/lib/security.cjs CHANGED
@@ -1,29 +1 @@
1
- /*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.461Z, made by Venus. */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const JSEncrypt = require('jsencrypt');
7
-
8
- function encryptRsa(value, publicKey) {
9
- const rsa = new JSEncrypt();
10
- rsa.setPublicKey(publicKey);
11
- const encrypted = rsa.encrypt(value);
12
- if (!encrypted) {
13
- throw new Error(`Failed to encrypt value [${value}] using RSA`);
14
- }
15
- return encrypted;
16
- }
17
- function decryptRsa(value, privateKey) {
18
- const rsa = new JSEncrypt();
19
- rsa.setPrivateKey(privateKey);
20
- const decrypted = rsa.decrypt(value);
21
- if (!decrypted) {
22
- throw new Error(`Failed to decrypt value [${value}] using RSA`);
23
- }
24
- return decrypted;
25
- }
26
-
27
- exports.decryptRsa = decryptRsa;
28
- exports.encryptRsa = encryptRsa;
29
- /*! 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 */
1
+ "use strict";/*! VefFramework version: 1.0.103, build time: 2025-03-07T17:03:51.264Z, made by Venus. */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const JSEncrypt=require("jsencrypt");function encryptRsa(value,publicKey){const rsa=new JSEncrypt;rsa.setPublicKey(publicKey);const encrypted=rsa.encrypt(value);if(!encrypted)throw new Error(`Failed to encrypt value [${value}] using RSA`);return encrypted}function decryptRsa(value,privateKey){const rsa=new JSEncrypt;rsa.setPrivateKey(privateKey);const decrypted=rsa.decrypt(value);if(!decrypted)throw new Error(`Failed to decrypt value [${value}] using RSA`);return decrypted}exports.decryptRsa=decryptRsa,exports.encryptRsa=encryptRsa;/*! 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/lib/store.cjs CHANGED
@@ -1,107 +1 @@
1
- /*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.461Z, made by Venus. */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const react = require('react');
7
- const middleware = require('zustand/middleware');
8
- const traditional = require('zustand/traditional');
9
- const vanilla = require('zustand/vanilla');
10
- require('./lib.cjs');
11
- const utils = require('./utils.cjs');
12
- const radashi = require('radashi');
13
- const shallow = require('zustand/shallow');
14
-
15
- function createStorageProxy(storage) {
16
- const delegate = middleware.createJSONStorage(() => storage === "local" ? localStorage : sessionStorage);
17
- return {
18
- getItem: delegate.getItem,
19
- setItem(name, value) {
20
- if (radashi.isNullish(value.state)) {
21
- return;
22
- }
23
- delegate.setItem(name, value);
24
- },
25
- removeItem: delegate.removeItem
26
- };
27
- }
28
- function createStore(stateCreator, persistenceOptions) {
29
- const name = persistenceOptions?.name ?? "UNKNOWN";
30
- const storage = persistenceOptions?.storage ?? "local";
31
- const selector = persistenceOptions ? persistenceOptions.selector : () => null;
32
- const storageInstance = createStorageProxy(storage);
33
- return traditional.createWithEqualityFn(
34
- middleware.persist(
35
- middleware.subscribeWithSelector(stateCreator),
36
- {
37
- name: `__VEF_STORE__${utils.constantCase(name)}__`,
38
- storage: storageInstance,
39
- version: 1,
40
- partialize: selector
41
- }
42
- ),
43
- shallow.shallow
44
- );
45
- }
46
- function createUnboundStore(stateCreator) {
47
- return vanilla.createStore(
48
- middleware.subscribeWithSelector(stateCreator)
49
- );
50
- }
51
- function useUnboundStore(store, selector, equalityFn) {
52
- return traditional.useStoreWithEqualityFn(
53
- store,
54
- selector,
55
- equalityFn ?? shallow.shallow
56
- );
57
- }
58
- function createComponentStore(name, getStateCreator) {
59
- const StoreContext = react.createContext(null);
60
- const StoreProvider = ({ initialState, children }) => {
61
- const [store] = react.useState(() => {
62
- const creator = getStateCreator(initialState);
63
- return createUnboundStore(creator);
64
- });
65
- const isMounted = react.useRef(false);
66
- react.useEffect(() => () => {
67
- isMounted.current = false;
68
- }, []);
69
- react.useEffect(() => {
70
- if (!isMounted.current) {
71
- isMounted.current = true;
72
- }
73
- if (initialState) {
74
- store.setState({
75
- ...initialState
76
- });
77
- }
78
- }, [initialState, store]);
79
- return react.createElement(
80
- StoreContext.Provider,
81
- { value: store },
82
- children
83
- );
84
- };
85
- const useStoreApi = () => {
86
- const store = react.useContext(StoreContext);
87
- if (!store) {
88
- throw new Error(`${name}Store can be used only inside ${name}StoreProvider`);
89
- }
90
- return store;
91
- };
92
- const useStore = (selector) => useUnboundStore(
93
- useStoreApi(),
94
- selector
95
- );
96
- return {
97
- StoreProvider,
98
- useStore,
99
- useStoreApi
100
- };
101
- }
102
-
103
- exports.createComponentStore = createComponentStore;
104
- exports.createStore = createStore;
105
- exports.createUnboundStore = createUnboundStore;
106
- exports.useUnboundStore = useUnboundStore;
107
- /*! 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 */
1
+ "use strict";/*! VefFramework version: 1.0.103, build time: 2025-03-07T17:03:51.264Z, made by Venus. */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const react=require("react"),middleware=require("zustand/middleware"),traditional=require("zustand/traditional"),vanilla=require("zustand/vanilla");require("./lib.cjs");const utils=require("./utils.cjs"),radashi=require("radashi"),shallow=require("zustand/shallow");function createStorageProxy(storage){const delegate=middleware.createJSONStorage(()=>storage==="local"?localStorage:sessionStorage);return{getItem:delegate.getItem,setItem(name,value){radashi.isNullish(value.state)||delegate.setItem(name,value)},removeItem:delegate.removeItem}}function createStore(stateCreator,persistenceOptions){const name=persistenceOptions?.name??"UNKNOWN",storage=persistenceOptions?.storage??"local",selector=persistenceOptions?persistenceOptions.selector:()=>null,storageInstance=createStorageProxy(storage);return traditional.createWithEqualityFn(middleware.persist(middleware.subscribeWithSelector(stateCreator),{name:`__VEF_STORE__${utils.constantCase(name)}__`,storage:storageInstance,version:1,partialize:selector}),shallow.shallow)}function createUnboundStore(stateCreator){return vanilla.createStore(middleware.subscribeWithSelector(stateCreator))}function useUnboundStore(store,selector,equalityFn){return traditional.useStoreWithEqualityFn(store,selector,equalityFn??shallow.shallow)}function createComponentStore(name,getStateCreator){const StoreContext=react.createContext(null),StoreProvider=({initialState,children})=>{const[store]=react.useState(()=>{const creator=getStateCreator(initialState);return createUnboundStore(creator)}),isMounted=react.useRef(!1);return react.useEffect(()=>()=>{isMounted.current=!1},[]),react.useEffect(()=>{isMounted.current||(isMounted.current=!0),initialState&&store.setState({...initialState})},[initialState,store]),react.createElement(StoreContext.Provider,{value:store},children)},useStoreApi=()=>{const store=react.useContext(StoreContext);if(!store)throw new Error(`${name}Store can be used only inside ${name}StoreProvider`);return store};return{StoreProvider,useStore:selector=>useUnboundStore(useStoreApi(),selector),useStoreApi}}exports.createComponentStore=createComponentStore,exports.createStore=createStore,exports.createUnboundStore=createUnboundStore,exports.useUnboundStore=useUnboundStore;/*! 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/lib/styles.cjs CHANGED
@@ -1,57 +1 @@
1
- /*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.461Z, made by Venus. */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const react = require('@emotion/react');
7
-
8
- const breakpointWidths = {
9
- xs: 0,
10
- sm: 576,
11
- md: 768,
12
- lg: 992,
13
- xl: 1200,
14
- xxl: 1400
15
- };
16
- const breakpoints = [
17
- "xs",
18
- "sm",
19
- "md",
20
- "lg",
21
- "xl",
22
- "xxl"
23
- ];
24
- const bmq = Object.keys(breakpointWidths).reduce(
25
- (acc, label) => {
26
- acc[label] = `@media (min-width: ${breakpointWidths[label]}px)`;
27
- return acc;
28
- },
29
- {}
30
- );
31
- const styles = {
32
- // Flex center style
33
- flexCenter: react.css({
34
- display: "flex",
35
- justifyContent: "center",
36
- alignItems: "center"
37
- }),
38
- // Full height style
39
- fullHeight: react.css({
40
- height: "100%"
41
- }),
42
- // Full width style
43
- fullWidth: react.css({
44
- width: "100%"
45
- }),
46
- // Scrollbar style
47
- scrollbar: react.css({
48
- scrollbarWidth: "thin",
49
- scrollbarColor: "rgba(0, 0, 0, 0.3) transparent",
50
- scrollbarGutter: "stable"
51
- })
52
- };
53
-
54
- exports.bmq = bmq;
55
- exports.breakpoints = breakpoints;
56
- exports.styles = styles;
57
- /*! 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 */
1
+ "use strict";/*! VefFramework version: 1.0.103, build time: 2025-03-07T17:03:51.264Z, made by Venus. */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const react=require("@emotion/react"),breakpointWidths={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400},breakpoints=["xs","sm","md","lg","xl","xxl"],bmq=Object.keys(breakpointWidths).reduce((acc,label)=>(acc[label]=`@media (min-width: ${breakpointWidths[label]}px)`,acc),{}),styles={flexCenter:react.css({display:"flex",justifyContent:"center",alignItems:"center"}),fullHeight:react.css({height:"100%"}),fullWidth:react.css({width:"100%"}),scrollbar:react.css({scrollbarWidth:"thin",scrollbarColor:"rgba(0, 0, 0, 0.3) transparent",scrollbarGutter:"stable"})};exports.bmq=bmq,exports.breakpoints=breakpoints,exports.styles=styles;/*! 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/lib/temporal.cjs CHANGED
@@ -1,29 +1 @@
1
- /*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.461Z, made by Venus. */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const tz = require('@date-fns/tz');
7
- const dateFns = require('date-fns');
8
- const locale = require('date-fns/locale');
9
-
10
- function getNowDate() {
11
- return /* @__PURE__ */ new Date();
12
- }
13
- function getNowDateString() {
14
- return dateFns.format(getNowDate(), "yyyy-MM-dd", {
15
- locale: locale.zhCN,
16
- in: tz.tz("Asia/Shanghai")
17
- });
18
- }
19
- function getTodayString() {
20
- return dateFns.format(getNowDate(), "PPPPpp", {
21
- locale: locale.zhCN,
22
- in: tz.tz("Asia/Shanghai")
23
- });
24
- }
25
-
26
- exports.getNowDate = getNowDate;
27
- exports.getNowDateString = getNowDateString;
28
- exports.getTodayString = getTodayString;
29
- /*! 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 */
1
+ "use strict";/*! VefFramework version: 1.0.103, build time: 2025-03-07T17:03:51.264Z, made by Venus. */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const tz=require("@date-fns/tz"),dateFns=require("date-fns"),locale=require("date-fns/locale");function getNowDate(){return new Date}function getNowDateString(){return dateFns.format(getNowDate(),"yyyy-MM-dd",{locale:locale.zhCN,in:tz.tz("Asia/Shanghai")})}function getTodayString(){return dateFns.format(getNowDate(),"PPPPpp",{locale:locale.zhCN,in:tz.tz("Asia/Shanghai")})}exports.getNowDate=getNowDate,exports.getNowDateString=getNowDateString,exports.getTodayString=getTodayString;/*! 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 */