@vef-framework/shared 1.0.121 → 1.0.123

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 (100) hide show
  1. package/cjs/color.cjs +11 -0
  2. package/cjs/constants.cjs +39 -0
  3. package/cjs/context.cjs +36 -0
  4. package/cjs/dom.cjs +23 -0
  5. package/cjs/error.cjs +30 -0
  6. package/cjs/event.cjs +11 -0
  7. package/cjs/expression.cjs +27 -0
  8. package/cjs/function.cjs +16 -0
  9. package/cjs/icons.cjs +136 -0
  10. package/cjs/id.cjs +14 -0
  11. package/cjs/index.cjs +317 -0
  12. package/cjs/json.cjs +18 -0
  13. package/cjs/lib.cjs +232 -0
  14. package/cjs/message.cjs +303 -0
  15. package/cjs/path.cjs +40 -0
  16. package/cjs/pinyin.cjs +33 -0
  17. package/cjs/security.cjs +27 -0
  18. package/cjs/store.cjs +105 -0
  19. package/cjs/styles.cjs +55 -0
  20. package/cjs/temporal.cjs +27 -0
  21. package/cjs/theme-variables.cjs +354 -0
  22. package/cjs/types.cjs +4 -0
  23. package/cjs/utils.cjs +117 -0
  24. package/cjs/validation.cjs +189 -0
  25. package/cjs/yaml.cjs +11 -0
  26. package/esm/color.js +9 -0
  27. package/esm/constants.js +31 -0
  28. package/esm/context.js +34 -0
  29. package/esm/dom.js +21 -0
  30. package/esm/error.js +28 -0
  31. package/esm/event.js +9 -0
  32. package/esm/expression.js +23 -0
  33. package/esm/function.js +14 -0
  34. package/esm/icons.js +129 -0
  35. package/esm/id.js +12 -0
  36. package/esm/index.js +32 -0
  37. package/esm/json.js +16 -0
  38. package/esm/lib.js +21 -0
  39. package/esm/message.js +282 -0
  40. package/esm/path.js +33 -0
  41. package/esm/pinyin.js +30 -0
  42. package/esm/security.js +24 -0
  43. package/esm/store.js +100 -0
  44. package/esm/styles.js +51 -0
  45. package/esm/temporal.js +23 -0
  46. package/esm/theme-variables.js +352 -0
  47. package/esm/types.js +2 -0
  48. package/esm/utils.js +109 -0
  49. package/esm/validation.js +151 -0
  50. package/esm/yaml.js +9 -0
  51. package/package.json +11 -10
  52. package/es/color.js +0 -1
  53. package/es/constants.js +0 -1
  54. package/es/context.js +0 -1
  55. package/es/dom.js +0 -1
  56. package/es/error.js +0 -1
  57. package/es/event.js +0 -1
  58. package/es/expression.js +0 -1
  59. package/es/function.js +0 -1
  60. package/es/icons.js +0 -1
  61. package/es/id.js +0 -1
  62. package/es/index.js +0 -1
  63. package/es/json.js +0 -1
  64. package/es/lib.js +0 -1
  65. package/es/message.js +0 -1
  66. package/es/path.js +0 -1
  67. package/es/pinyin.js +0 -1
  68. package/es/security.js +0 -1
  69. package/es/store.js +0 -1
  70. package/es/styles.js +0 -1
  71. package/es/temporal.js +0 -1
  72. package/es/theme-variables.js +0 -1
  73. package/es/utils.js +0 -1
  74. package/es/validation.js +0 -1
  75. package/es/yaml.js +0 -1
  76. package/lib/color.cjs +0 -1
  77. package/lib/constants.cjs +0 -1
  78. package/lib/context.cjs +0 -1
  79. package/lib/dom.cjs +0 -1
  80. package/lib/error.cjs +0 -1
  81. package/lib/event.cjs +0 -1
  82. package/lib/expression.cjs +0 -1
  83. package/lib/function.cjs +0 -1
  84. package/lib/icons.cjs +0 -1
  85. package/lib/id.cjs +0 -1
  86. package/lib/index.cjs +0 -1
  87. package/lib/json.cjs +0 -1
  88. package/lib/lib.cjs +0 -1
  89. package/lib/message.cjs +0 -1
  90. package/lib/path.cjs +0 -1
  91. package/lib/pinyin.cjs +0 -1
  92. package/lib/security.cjs +0 -1
  93. package/lib/store.cjs +0 -1
  94. package/lib/styles.cjs +0 -1
  95. package/lib/temporal.cjs +0 -1
  96. package/lib/theme-variables.cjs +0 -1
  97. package/lib/types.cjs +0 -1
  98. package/lib/utils.cjs +0 -1
  99. package/lib/validation.cjs +0 -1
  100. package/lib/yaml.cjs +0 -1
@@ -0,0 +1,189 @@
1
+ "use strict";
2
+ 'use strict';
3
+
4
+ var validator = require('validator');
5
+
6
+ "use strict";
7
+ function isAlpha(value) {
8
+ return validator.isAlpha(value);
9
+ }
10
+ function isAlphanumeric(value) {
11
+ return validator.isAlphanumeric(value);
12
+ }
13
+ function isAscii(value) {
14
+ return validator.isAscii(value);
15
+ }
16
+ function isNumeric(value) {
17
+ return validator.isNumeric(value);
18
+ }
19
+ function isDecimal(value) {
20
+ return validator.isDecimal(value);
21
+ }
22
+ function isFloat(value, options) {
23
+ return validator.isFloat(value, options);
24
+ }
25
+ function isBoolean(value) {
26
+ return validator.isBoolean(value, {
27
+ loose: false
28
+ });
29
+ }
30
+ function isDate(value) {
31
+ return validator.isDate(value, {
32
+ format: "YYYY-MM-DD",
33
+ strictMode: true
34
+ });
35
+ }
36
+ function isEmpty(value) {
37
+ return validator.isEmpty(value);
38
+ }
39
+ function isBlank(value) {
40
+ return validator.isEmpty(value, {
41
+ ignore_whitespace: true
42
+ });
43
+ }
44
+ function isIdentityCard(value) {
45
+ return validator.isIdentityCard(value, "zh-CN");
46
+ }
47
+ function isAfter(value, date) {
48
+ return validator.isAfter(value, date);
49
+ }
50
+ function isBefore(value, date) {
51
+ return validator.isBefore(value, date);
52
+ }
53
+ function isEmail(value) {
54
+ return validator.isEmail(value);
55
+ }
56
+ function isHexColor(value) {
57
+ return validator.isHexColor(value);
58
+ }
59
+ function isIn(value, values) {
60
+ return validator.isIn(value, values);
61
+ }
62
+ function isInt(value, options) {
63
+ return validator.isInt(value, options);
64
+ }
65
+ function isIp(value, version) {
66
+ return validator.isIP(value, version);
67
+ }
68
+ function isIpRange(value, version) {
69
+ return validator.isIPRange(value, version);
70
+ }
71
+ function isJson(value) {
72
+ return validator.isJSON(value);
73
+ }
74
+ function isJwt(value) {
75
+ return validator.isJWT(value);
76
+ }
77
+ function isLatLong(value) {
78
+ return validator.isLatLong(value);
79
+ }
80
+ function isLength(value, options) {
81
+ return validator.isLength(value, options);
82
+ }
83
+ function isMimeType(value) {
84
+ return validator.isMimeType(value);
85
+ }
86
+ function isMobilePhone(value) {
87
+ return validator.isMobilePhone(value, "zh-CN");
88
+ }
89
+ function isPort(value) {
90
+ return validator.isPort(value);
91
+ }
92
+ function isPostalCode(value) {
93
+ return validator.isPostalCode(value, "CN");
94
+ }
95
+ function isSemVer(value) {
96
+ return validator.isSemVer(value);
97
+ }
98
+ function isSlug(value) {
99
+ return validator.isSlug(value);
100
+ }
101
+ function isStrongPassword(value) {
102
+ return validator.isStrongPassword(value, {
103
+ minLength: 8,
104
+ minLowercase: 1,
105
+ minUppercase: 1,
106
+ minNumbers: 1,
107
+ minSymbols: 1
108
+ });
109
+ }
110
+ function isTime(value, options) {
111
+ return validator.isTime(value, options);
112
+ }
113
+ function isUrl(value) {
114
+ return validator.isURL(value, {
115
+ protocols: ["http", "https"],
116
+ require_tld: true,
117
+ require_protocol: true,
118
+ require_host: true,
119
+ require_port: false,
120
+ require_valid_protocol: true,
121
+ allow_underscores: true
122
+ });
123
+ }
124
+ function isUri(value) {
125
+ return validator.isURL(value, {
126
+ protocols: [],
127
+ require_tld: false,
128
+ require_protocol: false,
129
+ require_host: false,
130
+ require_port: false,
131
+ require_valid_protocol: false,
132
+ allow_underscores: true,
133
+ allow_fragments: false,
134
+ allow_query_components: false,
135
+ allow_protocol_relative_urls: false
136
+ });
137
+ }
138
+ function isUuid(value, version) {
139
+ return validator.isUUID(value, version);
140
+ }
141
+ function isDateTime(value) {
142
+ const [date, time] = value.split(" ", 2);
143
+ return isDate(date) && isTime(time);
144
+ }
145
+ function matches(value, pattern, modifiers) {
146
+ return validator.matches(value, pattern, modifiers);
147
+ }
148
+ const chineseNameRegExp = /^[\u4E00-\u9FA5]+\d*$/;
149
+ function isChineseName(value) {
150
+ return chineseNameRegExp.test(value);
151
+ }
152
+
153
+ exports.isAfter = isAfter;
154
+ exports.isAlpha = isAlpha;
155
+ exports.isAlphanumeric = isAlphanumeric;
156
+ exports.isAscii = isAscii;
157
+ exports.isBefore = isBefore;
158
+ exports.isBlank = isBlank;
159
+ exports.isBoolean = isBoolean;
160
+ exports.isChineseName = isChineseName;
161
+ exports.isDate = isDate;
162
+ exports.isDateTime = isDateTime;
163
+ exports.isDecimal = isDecimal;
164
+ exports.isEmail = isEmail;
165
+ exports.isEmpty = isEmpty;
166
+ exports.isFloat = isFloat;
167
+ exports.isHexColor = isHexColor;
168
+ exports.isIdentityCard = isIdentityCard;
169
+ exports.isIn = isIn;
170
+ exports.isInt = isInt;
171
+ exports.isIp = isIp;
172
+ exports.isIpRange = isIpRange;
173
+ exports.isJson = isJson;
174
+ exports.isJwt = isJwt;
175
+ exports.isLatLong = isLatLong;
176
+ exports.isLength = isLength;
177
+ exports.isMimeType = isMimeType;
178
+ exports.isMobilePhone = isMobilePhone;
179
+ exports.isNumeric = isNumeric;
180
+ exports.isPort = isPort;
181
+ exports.isPostalCode = isPostalCode;
182
+ exports.isSemVer = isSemVer;
183
+ exports.isSlug = isSlug;
184
+ exports.isStrongPassword = isStrongPassword;
185
+ exports.isTime = isTime;
186
+ exports.isUri = isUri;
187
+ exports.isUrl = isUrl;
188
+ exports.isUuid = isUuid;
189
+ exports.matches = matches;
package/cjs/yaml.cjs ADDED
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ 'use strict';
3
+
4
+ var jsYaml = require('js-yaml');
5
+
6
+ "use strict";
7
+ function loadYaml(content) {
8
+ return jsYaml.load(content);
9
+ }
10
+
11
+ exports.loadYaml = loadYaml;
package/esm/color.js ADDED
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ import { colord } from 'colord';
3
+
4
+ "use strict";
5
+ function isValidColor(color) {
6
+ return colord(color).isValid();
7
+ }
8
+
9
+ export { isValidColor };
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ "use strict";
3
+ const defaultColorTypes = [
4
+ "blue",
5
+ "purple",
6
+ "cyan",
7
+ "green",
8
+ "magenta",
9
+ "pink",
10
+ "red",
11
+ "orange",
12
+ "yellow",
13
+ "volcano",
14
+ "geekblue",
15
+ "gold",
16
+ "lime"
17
+ ];
18
+ const semanticColorTypes = [
19
+ "primary",
20
+ "info",
21
+ "success",
22
+ "warning",
23
+ "error"
24
+ ];
25
+ const colorTypes = [...defaultColorTypes, ...semanticColorTypes];
26
+ const creationFormScene = "creation";
27
+ const updateFormScene = "update";
28
+ const auditFormScene = "audit";
29
+ const presetFormScenes = [creationFormScene, updateFormScene, auditFormScene];
30
+
31
+ export { auditFormScene, colorTypes, creationFormScene, defaultColorTypes, presetFormScenes, semanticColorTypes, updateFormScene };
package/esm/context.js ADDED
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ import { useRef } from 'react';
3
+ import { createContext, useContextSelector, useContext } from 'use-context-selector';
4
+ import './lib.js';
5
+ import { isNullish } from 'radashi';
6
+ import { shallow } from 'zustand/shallow';
7
+
8
+ "use strict";
9
+ function createSelectableContext(defaultValue) {
10
+ const context = createContext(defaultValue);
11
+ const ContextProvider = context.Provider;
12
+ const useContextSelector$1 = (selector) => {
13
+ const lastSelectedValueRef = useRef();
14
+ return useContextSelector(context, (value) => {
15
+ if (isNullish(value)) {
16
+ return;
17
+ }
18
+ const selectedValue = selector(value);
19
+ if (lastSelectedValueRef.current && shallow(selectedValue, lastSelectedValueRef.current)) {
20
+ return lastSelectedValueRef.current;
21
+ }
22
+ lastSelectedValueRef.current = selectedValue;
23
+ return selectedValue;
24
+ });
25
+ };
26
+ const useContext$1 = () => useContext(context);
27
+ return {
28
+ ContextProvider,
29
+ useContextSelector: useContextSelector$1,
30
+ useContext: useContext$1
31
+ };
32
+ }
33
+
34
+ export { createSelectableContext };
package/esm/dom.js ADDED
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ "use strict";
3
+ function getElementHeight(element, selector, includeMargin = false) {
4
+ if (selector) {
5
+ const subElement = element.querySelector(selector);
6
+ if (!subElement) {
7
+ return 0;
8
+ }
9
+ element = subElement;
10
+ }
11
+ const height = element.offsetHeight;
12
+ if (!includeMargin) {
13
+ return height;
14
+ }
15
+ const styleMap = element.computedStyleMap();
16
+ const marginTop = styleMap.get("margin-top").value;
17
+ const marginBottom = styleMap.get("margin-bottom").value;
18
+ return height + marginTop + marginBottom;
19
+ }
20
+
21
+ export { getElementHeight };
package/esm/error.js ADDED
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
6
+ class VefError extends Error {
7
+ /**
8
+ * Constructs a new VefError.
9
+ *
10
+ * @param code - The code of the error.
11
+ * @param message - The message of the error.
12
+ */
13
+ constructor(code, message) {
14
+ super(message);
15
+ /**
16
+ * The code of the error.
17
+ */
18
+ __publicField(this, "code");
19
+ Object.defineProperty(this, "code", {
20
+ value: code,
21
+ writable: false,
22
+ configurable: false,
23
+ enumerable: true
24
+ });
25
+ }
26
+ }
27
+
28
+ export { VefError };
package/esm/event.js ADDED
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ import mitt from 'mitt';
3
+
4
+ "use strict";
5
+ function createEventEmitter() {
6
+ return mitt();
7
+ }
8
+
9
+ export { createEventEmitter };
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ import './lib.js';
3
+ import { isObject, isString, isFunction } from 'radashi';
4
+
5
+ "use strict";
6
+ const dynamicFnCache = /* @__PURE__ */ new WeakMap();
7
+ function isExpression(value) {
8
+ return isObject(value) && "expression" in value && isString(value.expression);
9
+ }
10
+ function isFunctionOrExpression(value) {
11
+ return isFunction(value) || isExpression(value);
12
+ }
13
+ function compileDynamicFn(key, ...args) {
14
+ const fn = dynamicFnCache.get(key);
15
+ if (fn) {
16
+ return fn;
17
+ }
18
+ const newFn = new Function(...args);
19
+ dynamicFnCache.set(key, newFn);
20
+ return newFn;
21
+ }
22
+
23
+ export { compileDynamicFn, isExpression, isFunctionOrExpression };
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ "use strict";
3
+ function mergeFns(...fns) {
4
+ const fn = (...args) => {
5
+ for (const fn2 of fns) {
6
+ if (fn2) {
7
+ fn2(...args);
8
+ }
9
+ }
10
+ };
11
+ return fn;
12
+ }
13
+
14
+ export { mergeFns };
package/esm/icons.js ADDED
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+ import { jsx } from '@emotion/react/jsx-runtime';
3
+
4
+ "use strict";
5
+ function IconTick(props) {
6
+ return /* @__PURE__ */ jsx(
7
+ "svg",
8
+ {
9
+ "aria-hidden": true,
10
+ fill: "none",
11
+ focusable: false,
12
+ viewBox: "0 0 24 24",
13
+ xmlns: "http://www.w3.org/2000/svg",
14
+ ...props,
15
+ children: /* @__PURE__ */ jsx(
16
+ "path",
17
+ {
18
+ clipRule: "evenodd",
19
+ d: "M21.35 4.27c.68.47.86 1.4.38 2.08l-10 14.5a1.5 1.5 0 0 1-2.33.17l-6.5-7a1.5 1.5 0 0 1 2.2-2.04l5.23 5.63 8.94-12.96a1.5 1.5 0 0 1 2.08-.38Z",
20
+ fill: "currentColor",
21
+ fillRule: "evenodd"
22
+ }
23
+ )
24
+ }
25
+ );
26
+ }
27
+ function IconTickCircle(props) {
28
+ return /* @__PURE__ */ jsx(
29
+ "svg",
30
+ {
31
+ "aria-hidden": true,
32
+ fill: "none",
33
+ focusable: false,
34
+ viewBox: "0 0 24 24",
35
+ xmlns: "http://www.w3.org/2000/svg",
36
+ ...props,
37
+ children: /* @__PURE__ */ jsx(
38
+ "path",
39
+ {
40
+ clipRule: "evenodd",
41
+ d: "M12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22Zm5.88-13.18-6.2 7.6a1.5 1.5 0 0 1-2.37 0l-3.5-4a1.5 1.5 0 1 1 2.37-1.84l2.3 2.46L15.5 8a1.5 1.5 0 1 1 2.38 1.82Z",
42
+ fill: "currentColor",
43
+ fillRule: "evenodd"
44
+ }
45
+ )
46
+ }
47
+ );
48
+ }
49
+ function IconInfoCircle(props) {
50
+ return /* @__PURE__ */ jsx(
51
+ "svg",
52
+ {
53
+ "aria-hidden": true,
54
+ fill: "none",
55
+ focusable: false,
56
+ viewBox: "0 0 24 24",
57
+ xmlns: "http://www.w3.org/2000/svg",
58
+ ...props,
59
+ children: /* @__PURE__ */ jsx(
60
+ "path",
61
+ {
62
+ clipRule: "evenodd",
63
+ d: "M12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22Zm2-16a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-5 3.75c0-.41.34-.75.75-.75h2.75a1 1 0 0 1 1 1v5.5h.75a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5h.75v-5h-.75a.75.75 0 0 1-.75-.75Z",
64
+ fill: "currentColor",
65
+ fillRule: "evenodd"
66
+ }
67
+ )
68
+ }
69
+ );
70
+ }
71
+ function IconAlertCircle(props) {
72
+ return /* @__PURE__ */ jsx(
73
+ "svg",
74
+ {
75
+ "aria-hidden": true,
76
+ fill: "none",
77
+ focusable: false,
78
+ viewBox: "0 0 24 24",
79
+ xmlns: "http://www.w3.org/2000/svg",
80
+ ...props,
81
+ children: /* @__PURE__ */ jsx(
82
+ "path",
83
+ {
84
+ clipRule: "evenodd",
85
+ d: "M23 12a11 11 0 1 1-22 0 11 11 0 0 1 22 0Zm-9.5 5.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0ZM12 5a1.9 1.9 0 0 0-1.89 2l.3 5.5a1.59 1.59 0 0 0 3.17 0l.3-5.5c.07-1.09-.8-2-1.88-2Z",
86
+ fill: "currentColor",
87
+ fillRule: "evenodd"
88
+ }
89
+ )
90
+ }
91
+ );
92
+ }
93
+ function IconAlertTriangle(props) {
94
+ return /* @__PURE__ */ jsx(
95
+ "svg",
96
+ {
97
+ "aria-hidden": true,
98
+ fill: "none",
99
+ focusable: false,
100
+ viewBox: "0 0 24 24",
101
+ xmlns: "http://www.w3.org/2000/svg",
102
+ ...props,
103
+ children: /* @__PURE__ */ jsx(
104
+ "path",
105
+ {
106
+ clipRule: "evenodd",
107
+ d: "m10.23 2.4-8.7 16.67A2 2 0 0 0 3.3 22h17.4a2 2 0 0 0 1.77-2.93L13.77 2.4a2 2 0 0 0-3.54 0ZM13.14 14a1.15 1.15 0 0 1-2.28 0l-.58-4.03a1.73 1.73 0 1 1 3.44 0l-.58 4.03Zm.36 4.49a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z",
108
+ fill: "currentColor",
109
+ fillRule: "evenodd"
110
+ }
111
+ )
112
+ }
113
+ );
114
+ }
115
+ function IconCheck(props) {
116
+ return /* @__PURE__ */ jsx(
117
+ "svg",
118
+ {
119
+ "aria-hidden": true,
120
+ focusable: false,
121
+ viewBox: "0 0 24 24",
122
+ xmlns: "http://www.w3.org/2000/svg",
123
+ ...props,
124
+ children: /* @__PURE__ */ jsx("path", { d: "M20 6L9 17l-5-5", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2 })
125
+ }
126
+ );
127
+ }
128
+
129
+ export { IconAlertCircle, IconAlertTriangle, IconCheck, IconInfoCircle, IconTick, IconTickCircle };
package/esm/id.js ADDED
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ import { customAlphabet } from 'nanoid';
3
+
4
+ "use strict";
5
+ const alphabets = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
6
+ const length = 18;
7
+ const nanoId = customAlphabet(alphabets, length);
8
+ function generateId() {
9
+ return nanoId();
10
+ }
11
+
12
+ export { generateId };
package/esm/index.js ADDED
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ export { isValidColor } from './color.js';
3
+ export { auditFormScene, colorTypes, creationFormScene, defaultColorTypes, presetFormScenes, semanticColorTypes, updateFormScene } from './constants.js';
4
+ export { createSelectableContext } from './context.js';
5
+ export { getElementHeight } from './dom.js';
6
+ export { VefError } from './error.js';
7
+ export { createEventEmitter } from './event.js';
8
+ export { compileDynamicFn, isExpression, isFunctionOrExpression } from './expression.js';
9
+ export { mergeFns } from './function.js';
10
+ export { IconAlertCircle, IconAlertTriangle, IconCheck, IconInfoCircle, IconTick, IconTickCircle } from './icons.js';
11
+ export { generateId } from './id.js';
12
+ export { isJsonSchemaValid } from './json.js';
13
+ import './lib.js';
14
+ export { checkIcon, defaultMessageTitle, errorIcon, infoIcon, showConfirmation, showErrorAlert, showErrorMessage, showErrorNotification, showInfoAlert, showInfoMessage, showInfoNotification, showLoadingMessage, showSuccessAlert, showSuccessMessage, showSuccessNotification, showWarningAlert, showWarningMessage, showWarningNotification, successIcon, warningIcon } from './message.js';
15
+ export { extractBaseName, extractDirName, extractExtName, isAbsolutePath, joinPaths, normalizePath } from './path.js';
16
+ export { parsePinyin, parsePinyinFirstLetter } from './pinyin.js';
17
+ export { decryptRsa, encryptRsa } from './security.js';
18
+ export { createComponentStore, createStore, createUnboundStore, useUnboundStore } from './store.js';
19
+ export { bmq, breakpoints, styles } from './styles.js';
20
+ export { getNowDate, getNowDateString, getTodayString } from './temporal.js';
21
+ export { themeVariables } from './theme-variables.js';
22
+ import './types.js';
23
+ export { buildRouteParentMenusMappings, constantCase, difference, getStringLength, invokeMaybeAsyncFn, isAsyncFunction, isInternalFunction } from './utils.js';
24
+ import * as validation from './validation.js';
25
+ export { validation as validator };
26
+ export { loadYaml } from './yaml.js';
27
+ export { default as isDeepEqual } from 'react-fast-compare';
28
+ export { shallow as isShallowEqual } from 'zustand/shallow';
29
+ export { z } from 'zod';
30
+ export { assign, camel as camelCase, capitalize, clone, cloneDeep, cluster, dash as dashCase, debounce, get, isArray, isBoolean, isDate, isEmpty, isError, isFloat, isFunction, isInt, isIntString, isMap, isNullish, isNumber, isObject, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isUndefined, isWeakMap, isWeakSet, max, memo as memoize, min, noop, omit, once, pascal as pascalCase, pick, set, similarity, snake as snakeCase, sum, template, throttle, toFloat, toInt, trim, unique } from 'radashi';
31
+
32
+ "use strict";
package/esm/json.js ADDED
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ import Ajv from 'ajv';
3
+ import addFormats from 'ajv-formats';
4
+
5
+ "use strict";
6
+ const ajv = new Ajv({
7
+ allErrors: true,
8
+ verbose: true,
9
+ useDefaults: true
10
+ });
11
+ addFormats(ajv);
12
+ function isJsonSchemaValid(schema) {
13
+ return ajv.validateSchema(JSON.parse(schema));
14
+ }
15
+
16
+ export { isJsonSchemaValid };
package/esm/lib.js ADDED
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ import i18next from 'i18next';
3
+ export { assign, camel as camelCase, capitalize, clone, cloneDeep, cluster, dash as dashCase, debounce, get, isArray, isBoolean, isDate, isEmpty, isError, isFloat, isFunction, isInt, isIntString, isMap, isNullish, isNumber, isObject, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isUndefined, isWeakMap, isWeakSet, max, memo as memoize, min, noop, omit, once, pascal as pascalCase, pick, set, similarity, snake as snakeCase, sum, template, throttle, toFloat, toInt, trim, unique } from 'radashi';
4
+ import { z } from 'zod';
5
+ export { z } from 'zod';
6
+ import { zodI18nMap } from 'zod-i18n-map';
7
+ import translation from 'zod-i18n-map/locales/zh-CN/zod.json';
8
+ export { default as isDeepEqual } from 'react-fast-compare';
9
+ export { shallow as isShallowEqual } from 'zustand/shallow';
10
+
11
+ "use strict";
12
+ i18next.init({
13
+ lng: "zh-CN",
14
+ fallbackLng: false,
15
+ resources: {
16
+ "zh-CN": {
17
+ zod: translation
18
+ }
19
+ }
20
+ });
21
+ z.setErrorMap(zodI18nMap);