@vef-framework/shared 1.0.135 → 2.0.1

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 (164) hide show
  1. package/README +15 -0
  2. package/dist/cjs/color/color-ops.cjs +76 -0
  3. package/dist/cjs/color/index.cjs +24 -0
  4. package/dist/cjs/color/name.cjs +49 -0
  5. package/dist/cjs/color/palette.cjs +126 -0
  6. package/dist/cjs/constants/color-names.cjs +1580 -0
  7. package/dist/cjs/constants/color-palettes.cjs +372 -0
  8. package/dist/cjs/constants/index.cjs +14 -0
  9. package/dist/cjs/index.cjs +339 -0
  10. package/dist/cjs/types/color.cjs +3 -0
  11. package/dist/cjs/types/common.cjs +3 -0
  12. package/dist/cjs/types/deep-keys.cjs +3 -0
  13. package/dist/cjs/types/index.cjs +7 -0
  14. package/dist/cjs/utils/chrono.cjs +139 -0
  15. package/dist/cjs/utils/equal.cjs +175 -0
  16. package/dist/cjs/utils/error.cjs +60 -0
  17. package/dist/cjs/utils/event.cjs +62 -0
  18. package/dist/cjs/utils/format.cjs +31 -0
  19. package/dist/cjs/utils/function.cjs +49 -0
  20. package/dist/cjs/utils/id.cjs +38 -0
  21. package/dist/cjs/utils/index.cjs +86 -0
  22. package/dist/cjs/utils/key.cjs +34 -0
  23. package/dist/cjs/utils/lib.cjs +234 -0
  24. package/dist/cjs/utils/object.cjs +20 -0
  25. package/dist/cjs/utils/path.cjs +63 -0
  26. package/dist/cjs/utils/pinyin.cjs +53 -0
  27. package/dist/cjs/utils/security.cjs +44 -0
  28. package/dist/cjs/utils/string.cjs +13 -0
  29. package/dist/cjs/utils/task.cjs +17 -0
  30. package/dist/cjs/utils/tree.cjs +262 -0
  31. package/dist/cjs/utils/zod.cjs +14 -0
  32. package/dist/es/color/color-ops.js +62 -0
  33. package/dist/es/color/index.js +4 -0
  34. package/dist/es/color/name.js +45 -0
  35. package/dist/es/color/palette.js +122 -0
  36. package/dist/es/constants/color-names.js +1575 -0
  37. package/dist/es/constants/color-palettes.js +367 -0
  38. package/dist/es/constants/index.js +3 -0
  39. package/dist/es/index.js +30 -0
  40. package/dist/es/types/color.js +1 -0
  41. package/dist/es/types/common.js +1 -0
  42. package/dist/es/types/deep-keys.js +1 -0
  43. package/dist/es/types/index.js +4 -0
  44. package/dist/es/utils/chrono.js +121 -0
  45. package/dist/es/utils/equal.js +170 -0
  46. package/dist/es/utils/error.js +33 -0
  47. package/dist/es/utils/event.js +57 -0
  48. package/dist/es/utils/format.js +26 -0
  49. package/dist/es/utils/function.js +41 -0
  50. package/dist/es/utils/id.js +34 -0
  51. package/dist/es/utils/index.js +18 -0
  52. package/dist/es/utils/key.js +30 -0
  53. package/dist/es/utils/lib.js +10 -0
  54. package/dist/es/utils/object.js +16 -0
  55. package/dist/es/utils/path.js +49 -0
  56. package/dist/es/utils/pinyin.js +47 -0
  57. package/dist/es/utils/security.js +39 -0
  58. package/dist/es/utils/string.js +9 -0
  59. package/dist/es/utils/task.js +13 -0
  60. package/dist/es/utils/tree.js +252 -0
  61. package/dist/es/utils/zod.js +6 -0
  62. package/dist/types/color/color-ops.d.ts +84 -0
  63. package/dist/types/color/index.d.ts +3 -0
  64. package/dist/types/color/name.d.ts +7 -0
  65. package/dist/types/color/palette.d.ts +8 -0
  66. package/dist/types/constants/color-names.d.ts +11 -0
  67. package/dist/types/constants/color-palettes.d.ts +823 -0
  68. package/dist/types/constants/index.d.ts +2 -0
  69. package/dist/types/index.d.ts +4 -0
  70. package/dist/types/types/color.d.ts +73 -0
  71. package/dist/types/types/common.d.ts +25 -0
  72. package/dist/types/types/deep-keys.d.ts +9 -0
  73. package/dist/types/types/index.d.ts +3 -0
  74. package/dist/types/utils/chrono.d.ts +162 -0
  75. package/dist/types/utils/equal.d.ts +16 -0
  76. package/dist/types/utils/error.d.ts +38 -0
  77. package/dist/types/utils/event.d.ts +68 -0
  78. package/dist/types/utils/format.d.ts +33 -0
  79. package/dist/types/utils/function.d.ts +59 -0
  80. package/{types → dist/types/utils}/id.d.ts +2 -2
  81. package/dist/types/utils/index.d.ts +17 -0
  82. package/dist/types/utils/key.d.ts +7 -0
  83. package/dist/types/utils/lib.d.ts +5 -0
  84. package/dist/types/utils/object.d.ts +9 -0
  85. package/dist/types/utils/path.d.ts +76 -0
  86. package/dist/types/utils/pinyin.d.ts +41 -0
  87. package/dist/types/utils/security.d.ts +18 -0
  88. package/dist/types/utils/string.d.ts +7 -0
  89. package/dist/types/utils/task.d.ts +6 -0
  90. package/dist/types/utils/tree.d.ts +208 -0
  91. package/dist/types/utils/zod.d.ts +1 -0
  92. package/package.json +58 -57
  93. package/README.md +0 -25
  94. package/cjs/color.cjs +0 -2
  95. package/cjs/constants.cjs +0 -2
  96. package/cjs/context.cjs +0 -2
  97. package/cjs/dom.cjs +0 -2
  98. package/cjs/error.cjs +0 -2
  99. package/cjs/event.cjs +0 -2
  100. package/cjs/expression.cjs +0 -2
  101. package/cjs/function.cjs +0 -2
  102. package/cjs/id.cjs +0 -2
  103. package/cjs/index.cjs +0 -2
  104. package/cjs/json.cjs +0 -2
  105. package/cjs/module.cjs +0 -2
  106. package/cjs/path.cjs +0 -2
  107. package/cjs/pinyin.cjs +0 -2
  108. package/cjs/security.cjs +0 -2
  109. package/cjs/store.cjs +0 -2
  110. package/cjs/styles.cjs +0 -2
  111. package/cjs/temporal.cjs +0 -2
  112. package/cjs/theme-variables.cjs +0 -2
  113. package/cjs/types.cjs +0 -2
  114. package/cjs/utils.cjs +0 -2
  115. package/cjs/validation.cjs +0 -2
  116. package/cjs/yaml.cjs +0 -2
  117. package/cjs/zod.cjs +0 -2
  118. package/esm/color.js +0 -2
  119. package/esm/constants.js +0 -2
  120. package/esm/context.js +0 -2
  121. package/esm/dom.js +0 -2
  122. package/esm/error.js +0 -2
  123. package/esm/event.js +0 -2
  124. package/esm/expression.js +0 -2
  125. package/esm/function.js +0 -2
  126. package/esm/id.js +0 -2
  127. package/esm/index.js +0 -2
  128. package/esm/json.js +0 -2
  129. package/esm/module.js +0 -2
  130. package/esm/path.js +0 -2
  131. package/esm/pinyin.js +0 -2
  132. package/esm/security.js +0 -2
  133. package/esm/store.js +0 -2
  134. package/esm/styles.js +0 -2
  135. package/esm/temporal.js +0 -2
  136. package/esm/theme-variables.js +0 -2
  137. package/esm/types.js +0 -2
  138. package/esm/utils.js +0 -2
  139. package/esm/validation.js +0 -2
  140. package/esm/yaml.js +0 -2
  141. package/esm/zod.js +0 -2
  142. package/types/color.d.ts +0 -7
  143. package/types/constants.d.ts +0 -28
  144. package/types/context.d.ts +0 -21
  145. package/types/dom.d.ts +0 -9
  146. package/types/error.d.ts +0 -16
  147. package/types/event.d.ts +0 -6
  148. package/types/expression.d.ts +0 -23
  149. package/types/function.d.ts +0 -8
  150. package/types/index.d.ts +0 -23
  151. package/types/json.d.ts +0 -7
  152. package/types/module.d.ts +0 -7
  153. package/types/path.d.ts +0 -43
  154. package/types/pinyin.d.ts +0 -14
  155. package/types/security.d.ts +0 -16
  156. package/types/store.d.ts +0 -78
  157. package/types/styles.d.ts +0 -21
  158. package/types/temporal.d.ts +0 -18
  159. package/types/theme-variables.d.ts +0 -348
  160. package/types/types.d.ts +0 -905
  161. package/types/utils.d.ts +0 -77
  162. package/types/validation.d.ts +0 -38
  163. package/types/yaml.d.ts +0 -7
  164. package/types/zod.d.ts +0 -6
package/esm/constants.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- const e=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","gold","lime"],r=["primary","info","success","warning","error"],c=[...e,...r],o="creation",n="update",a="audit",t=[o,n,a];export{a as auditFormScene,c as colorTypes,o as creationFormScene,e as defaultColorTypes,t as presetFormScenes,r as semanticColorTypes,n as updateFormScene};
package/esm/context.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- import{useRef as c}from"react";import{createContext as s,useContext as i,useContextSelector as m}from"use-context-selector";import"./utils.js";import{isNullish as l}from"radashi";import{shallow as x}from"zustand/shallow";function f(n){const e=s(n);return{ContextProvider:e.Provider,useContextSelector:u=>{const t=c();return m(e,o=>{if(l(o))return;const r=u(o);return t.current&&x(r,t.current)?t.current:(t.current=r,r)})},useContext:()=>i(e)}}export{f as createSelectableContext};
package/esm/dom.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- function c(t,e,i=!1){if(e){const o=t.querySelector(e);if(!o)return 0;t=o}const r=t.offsetHeight;if(!i)return r;const n=t.computedStyleMap(),u=n.get("margin-top").value,g=n.get("margin-bottom").value;return r+u+g}export{c as getElementHeight};
package/esm/error.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- var a=Object.defineProperty,o=(r,e,t)=>e in r?a(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,s=(r,e,t)=>o(r,typeof e!="symbol"?e+"":e,t);class c extends Error{constructor(e,t){super(t),s(this,"code"),Object.defineProperty(this,"code",{value:e,writable:!1,configurable:!1,enumerable:!0})}}export{c as VefError};
package/esm/event.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- import t from"mitt";function r(){return t()}export{r as createEventEmitter};
package/esm/expression.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- import"./utils.js";import{isObject as o,isString as c,isFunction as u}from"radashi";const e=new WeakMap;function s(n){return o(n)&&"expression"in n&&c(n.expression)}function p(n){return u(n)||s(n)}function f(n,...r){const i=e.get(n);if(i)return i;const t=new Function(...r);return e.set(n,t),t}export{f as compileDynamicFn,s as isExpression,p as isFunctionOrExpression};
package/esm/function.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- function e(...r){return(...t)=>{for(const n of r)n&&n(...t)}}export{e as mergeFns};
package/esm/id.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- import{customAlphabet as t}from"nanoid";const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",o=18,r=t(e,o);function n(){return r()}export{n as generateId};
package/esm/index.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- import{isValidColor as a}from"./color.js";import{auditFormScene as s,colorTypes as n,creationFormScene as m,defaultColorTypes as p,presetFormScenes as l,semanticColorTypes as c,updateFormScene as x}from"./constants.js";import{createSelectableContext as u}from"./context.js";import{getElementHeight as S}from"./dom.js";import{VefError as y}from"./error.js";import{createEventEmitter as F}from"./event.js";import{compileDynamicFn as E,isExpression as C,isFunctionOrExpression as P}from"./expression.js";import{mergeFns as D}from"./function.js";import{generateId as M}from"./id.js";import{isJsonSchemaValid as w}from"./json.js";import{unwrapModule as q}from"./module.js";import{extractBaseName as A,extractDirName as R,extractExtName as T,isAbsolutePath as V,joinPaths as j,normalizePath as O}from"./path.js";import{parsePinyin as B,parsePinyinFirstLetter as L}from"./pinyin.js";import{decryptRsa as H,encryptRsa as J}from"./security.js";import{createComponentStore as Z,createStore as G,createUnboundStore as K,useUnboundStore as Q}from"./store.js";import{bmq as _,breakpoints as $,styles as ee}from"./styles.js";import{getNowDate as oe,getNowDateString as re,getTodayString as ae}from"./temporal.js";import{themeVariables as se}from"./theme-variables.js";import"./types.js";import{buildRouteParentMenusMappings as me,constantCase as pe,difference as le,getStringLength as ce,invokeMaybeAsyncFn as xe,isAsyncFunction as fe,isInternalFunction as ue}from"./utils.js";import*as e from"./validation.js";import{loadYaml as Se}from"./yaml.js";import{initZod as ye}from"./zod.js";import{assign as Fe,camel as he,capitalize as Ee,clone as Ce,cloneDeep as Pe,cluster as ke,dash as De,debounce as Ne,get as Me,isArray as ve,isBoolean as we,isDate as Ie,isEmpty as qe,isError as ze,isFloat as Ae,isFunction as Re,isInt as Te,isIntString as Ve,isMap as je,isNullish as Oe,isNumber as Ue,isObject as Be,isPlainObject as Le,isPrimitive as We,isPromise as He,isRegExp as Je,isSet as Ye,isString as Ze,isSymbol as Ge,isUndefined as Ke,isWeakMap as Qe,isWeakSet as Xe,max as _e,memo as $e,min as et,noop as tt,omit as ot,once as rt,pascal as at,pick as it,set as st,similarity as nt,snake as mt,sum as pt,template as lt,throttle as ct,toFloat as xt,toInt as ft,trim as ut,unique as dt}from"radashi";import{default as gt}from"react-fast-compare";import{shallow as bt}from"zustand/shallow";import{z as ht}from"zod";export{y as VefError,Fe as assign,s as auditFormScene,_ as bmq,$ as breakpoints,me as buildRouteParentMenusMappings,he as camelCase,Ee as capitalize,Ce as clone,Pe as cloneDeep,ke as cluster,n as colorTypes,E as compileDynamicFn,pe as constantCase,Z as createComponentStore,F as createEventEmitter,u as createSelectableContext,G as createStore,K as createUnboundStore,m as creationFormScene,De as dashCase,Ne as debounce,H as decryptRsa,p as defaultColorTypes,le as difference,J as encryptRsa,A as extractBaseName,R as extractDirName,T as extractExtName,M as generateId,Me as get,S as getElementHeight,oe as getNowDate,re as getNowDateString,ce as getStringLength,ae as getTodayString,ye as initZod,xe as invokeMaybeAsyncFn,V as isAbsolutePath,ve as isArray,fe as isAsyncFunction,we as isBoolean,Ie as isDate,gt as isDeepEqual,qe as isEmpty,ze as isError,C as isExpression,Ae as isFloat,Re as isFunction,P as isFunctionOrExpression,Te as isInt,Ve as isIntString,ue as isInternalFunction,w as isJsonSchemaValid,je as isMap,Oe as isNullish,Ue as isNumber,Be as isObject,Le as isPlainObject,We as isPrimitive,He as isPromise,Je as isRegExp,Ye as isSet,bt as isShallowEqual,Ze as isString,Ge as isSymbol,Ke as isUndefined,a as isValidColor,Qe as isWeakMap,Xe as isWeakSet,j as joinPaths,Se as loadYaml,_e as max,$e as memoize,D as mergeFns,et as min,tt as noop,O as normalizePath,ot as omit,rt as once,B as parsePinyin,L as parsePinyinFirstLetter,at as pascalCase,it as pick,l as presetFormScenes,c as semanticColorTypes,st as set,nt as similarity,mt as snakeCase,ee as styles,pt as sum,lt as template,se as themeVariables,ct as throttle,xt as toFloat,ft as toInt,ut as trim,dt as unique,q as unwrapModule,x as updateFormScene,Q as useUnboundStore,e as validator,ht as z};
package/esm/json.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- import o from"ajv";import s from"ajv-formats";const r=new o({allErrors:!0,verbose:!0,useDefaults:!0});s(r);function t(e){return r.validateSchema(JSON.parse(e))}export{t as isJsonSchemaValid};
package/esm/module.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- const u="__esModule",n="default";function e(t){return Reflect.has(t,u)?e(Reflect.get(t,n)):t}export{e as unwrapModule};
package/esm/path.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- import o from"path-browserify";const{basename:i,dirname:a,extname:n,isAbsolute:u,join:c,normalize:s}=o;function m(t,e=!0){const r=e?void 0:n(t);return i(t,r)}function f(t){return n(t)}function x(t){return a(t)}function l(...t){return c(...t)}function b(t){return u(t)}function h(t){return s(t)}export{m as extractBaseName,x as extractDirName,f as extractExtName,b as isAbsolutePath,l as joinPaths,h as normalizePath};
package/esm/pinyin.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- import{pinyin as e}from"pinyin-pro";function r(n){return e(n,{pattern:"pinyin",toneType:"none",type:"array",mode:"normal",nonZh:"consecutive",surname:"head"})}function t(n){return e(n,{pattern:"first",toneType:"none",type:"array",mode:"normal",nonZh:"consecutive"})}export{r as parsePinyin,t as parsePinyinFirstLetter};
package/esm/security.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- import c from"jsencrypt";function o(t,n){const e=new c;e.setPublicKey(n);const r=e.encrypt(t);if(!r)throw new Error(`Failed to encrypt value [${t}] using RSA`);return r}function i(t,n){const e=new c;e.setPrivateKey(n);const r=e.decrypt(t);if(!r)throw new Error(`Failed to decrypt value [${t}] using RSA`);return r}export{i as decryptRsa,o as encryptRsa};
package/esm/store.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- import{createContext as d,useState as v,useRef as g,createElement as h,useEffect as u,useContext as E}from"react";import{createJSONStorage as _,persist as I,subscribeWithSelector as c}from"zustand/middleware";import{createWithEqualityFn as b,useStoreWithEqualityFn as N}from"zustand/traditional";import{createStore as C}from"zustand/vanilla";import{constantCase as W}from"./utils.js";import{isNullish as $}from"radashi";import{shallow as m}from"zustand/shallow";function w(r){const e=_(()=>r==="local"?localStorage:sessionStorage);return{getItem:e.getItem,setItem(o,n){$(n.state)||e.setItem(o,n)},removeItem:e.removeItem}}function x(r,e){const o=e?.name??"UNKNOWN",n=e?.storage??"local",s=e?e.selector:()=>null,t=w(n);return b(I(c(r),{name:`__VEF_STORE__${W(o)}__`,storage:t,version:1,partialize:s}),m)}function l(r){return C(c(r))}function S(r,e,o){return N(r,e,o??m)}function y(r,e){const o=d(null),n=({initialState:t,children:f})=>{const[i]=v(()=>{const p=e(t);return l(p)}),a=g(!1);return u(()=>()=>{a.current=!1},[]),u(()=>{a.current||(a.current=!0),t&&i.setState({...t})},[t,i]),h(o.Provider,{value:i},f)},s=()=>{const t=E(o);if(!t)throw new Error(`${r}Store can be used only inside ${r}StoreProvider`);return t};return{StoreProvider:n,useStore:t=>S(s(),t),useStoreApi:s}}export{y as createComponentStore,x as createStore,l as createUnboundStore,S as useUnboundStore};
package/esm/styles.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- import{css as t}from"@emotion/react";const e={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400},r=["xs","sm","md","lg","xl","xxl"],i=Object.keys(e).reduce((l,s)=>(l[s]=`@media (min-width: ${e[s]}px)`,l),{}),n={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{i as bmq,r as breakpoints,n as styles};
package/esm/temporal.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- import{tz as r}from"@date-fns/tz";import{format as n}from"date-fns";import{zhCN as o}from"date-fns/locale";function t(){return new Date}function i(){return n(t(),"yyyy-MM-dd",{locale:o,in:r("Asia/Shanghai")})}function e(){return n(t(),"PPPPpp",{locale:o,in:r("Asia/Shanghai")})}export{t as getNowDate,i as getNowDateString,e as getTodayString};
@@ -1,2 +0,0 @@
1
- "use strict";
2
- const e={colorChart1:"hsl(221.2 83.2% 53.3%)",colorChart2:"hsl(216 92% 60%)",colorChart3:"hsl(212 95% 68%)",colorChart4:"hsl(210 98% 78%)",colorChart5:"hsl(212 97% 87%)",blue:"var(--vef-blue)",purple:"var(--vef-purple)",cyan:"var(--vef-cyan)",green:"var(--vef-green)",magenta:"var(--vef-magenta)",pink:"var(--vef-pink)",red:"var(--vef-red)",orange:"var(--vef-orange)",yellow:"var(--vef-yellow)",volcano:"var(--vef-volcano)",geekblue:"var(--vef-geekblue)",gold:"var(--vef-gold)",lime:"var(--vef-lime)",colorPrimary:"var(--vef-color-primary)",colorSuccess:"var(--vef-color-success)",colorWarning:"var(--vef-color-warning)",colorError:"var(--vef-color-error)",colorInfo:"var(--vef-color-info)",colorLink:"var(--vef-color-link)",colorTextBase:"var(--vef-color-text-base)",colorBgBase:"var(--vef-color-bg-base)",fontFamily:"var(--vef-font-family)",fontFamilyCode:"var(--vef-font-family-code)",fontSize:"var(--vef-font-size)",lineWidth:"var(--vef-line-width)",lineType:"var(--vef-line-type)",motionEaseOutCirc:"var(--vef-motion-ease-out-circ)",motionEaseInOutCirc:"var(--vef-motion-ease-in-out-circ)",motionEaseOut:"var(--vef-motion-ease-out)",motionEaseInOut:"var(--vef-motion-ease-in-out)",motionEaseOutBack:"var(--vef-motion-ease-out-back)",motionEaseInBack:"var(--vef-motion-ease-in-back)",motionEaseInQuint:"var(--vef-motion-ease-in-quint)",motionEaseOutQuint:"var(--vef-motion-ease-out-quint)",borderRadius:"var(--vef-border-radius)",sizePopupArrow:"var(--vef-size-popup-arrow)",controlHeight:"var(--vef-control-height)",zIndexBase:"var(--vef-z-index-base)",zIndexPopupBase:"var(--vef-z-index-popup-base)",opacityImage:"var(--vef-opacity-image)",colorBgLayout:"var(--vef-color-bg-layout)",colorBgSpotlight:"var(--vef-color-bg-spotlight)",blue1:"var(--vef-blue-1)",blue2:"var(--vef-blue-2)",blue3:"var(--vef-blue-3)",blue4:"var(--vef-blue-4)",blue5:"var(--vef-blue-5)",blue6:"var(--vef-blue-6)",blue7:"var(--vef-blue-7)",blue8:"var(--vef-blue-8)",blue9:"var(--vef-blue-9)",blue10:"var(--vef-blue-10)",purple1:"var(--vef-purple-1)",purple2:"var(--vef-purple-2)",purple3:"var(--vef-purple-3)",purple4:"var(--vef-purple-4)",purple5:"var(--vef-purple-5)",purple6:"var(--vef-purple-6)",purple7:"var(--vef-purple-7)",purple8:"var(--vef-purple-8)",purple9:"var(--vef-purple-9)",purple10:"var(--vef-purple-10)",cyan1:"var(--vef-cyan-1)",cyan2:"var(--vef-cyan-2)",cyan3:"var(--vef-cyan-3)",cyan4:"var(--vef-cyan-4)",cyan5:"var(--vef-cyan-5)",cyan6:"var(--vef-cyan-6)",cyan7:"var(--vef-cyan-7)",cyan8:"var(--vef-cyan-8)",cyan9:"var(--vef-cyan-9)",cyan10:"var(--vef-cyan-10)",green1:"var(--vef-green-1)",green2:"var(--vef-green-2)",green3:"var(--vef-green-3)",green4:"var(--vef-green-4)",green5:"var(--vef-green-5)",green6:"var(--vef-green-6)",green7:"var(--vef-green-7)",green8:"var(--vef-green-8)",green9:"var(--vef-green-9)",green10:"var(--vef-green-10)",magenta1:"var(--vef-magenta-1)",magenta2:"var(--vef-magenta-2)",magenta3:"var(--vef-magenta-3)",magenta4:"var(--vef-magenta-4)",magenta5:"var(--vef-magenta-5)",magenta6:"var(--vef-magenta-6)",magenta7:"var(--vef-magenta-7)",magenta8:"var(--vef-magenta-8)",magenta9:"var(--vef-magenta-9)",magenta10:"var(--vef-magenta-10)",pink1:"var(--vef-pink-1)",pink2:"var(--vef-pink-2)",pink3:"var(--vef-pink-3)",pink4:"var(--vef-pink-4)",pink5:"var(--vef-pink-5)",pink6:"var(--vef-pink-6)",pink7:"var(--vef-pink-7)",pink8:"var(--vef-pink-8)",pink9:"var(--vef-pink-9)",pink10:"var(--vef-pink-10)",red1:"var(--vef-red-1)",red2:"var(--vef-red-2)",red3:"var(--vef-red-3)",red4:"var(--vef-red-4)",red5:"var(--vef-red-5)",red6:"var(--vef-red-6)",red7:"var(--vef-red-7)",red8:"var(--vef-red-8)",red9:"var(--vef-red-9)",red10:"var(--vef-red-10)",orange1:"var(--vef-orange-1)",orange2:"var(--vef-orange-2)",orange3:"var(--vef-orange-3)",orange4:"var(--vef-orange-4)",orange5:"var(--vef-orange-5)",orange6:"var(--vef-orange-6)",orange7:"var(--vef-orange-7)",orange8:"var(--vef-orange-8)",orange9:"var(--vef-orange-9)",orange10:"var(--vef-orange-10)",yellow1:"var(--vef-yellow-1)",yellow2:"var(--vef-yellow-2)",yellow3:"var(--vef-yellow-3)",yellow4:"var(--vef-yellow-4)",yellow5:"var(--vef-yellow-5)",yellow6:"var(--vef-yellow-6)",yellow7:"var(--vef-yellow-7)",yellow8:"var(--vef-yellow-8)",yellow9:"var(--vef-yellow-9)",yellow10:"var(--vef-yellow-10)",volcano1:"var(--vef-volcano-1)",volcano2:"var(--vef-volcano-2)",volcano3:"var(--vef-volcano-3)",volcano4:"var(--vef-volcano-4)",volcano5:"var(--vef-volcano-5)",volcano6:"var(--vef-volcano-6)",volcano7:"var(--vef-volcano-7)",volcano8:"var(--vef-volcano-8)",volcano9:"var(--vef-volcano-9)",volcano10:"var(--vef-volcano-10)",geekblue1:"var(--vef-geekblue-1)",geekblue2:"var(--vef-geekblue-2)",geekblue3:"var(--vef-geekblue-3)",geekblue4:"var(--vef-geekblue-4)",geekblue5:"var(--vef-geekblue-5)",geekblue6:"var(--vef-geekblue-6)",geekblue7:"var(--vef-geekblue-7)",geekblue8:"var(--vef-geekblue-8)",geekblue9:"var(--vef-geekblue-9)",geekblue10:"var(--vef-geekblue-10)",gold1:"var(--vef-gold-1)",gold2:"var(--vef-gold-2)",gold3:"var(--vef-gold-3)",gold4:"var(--vef-gold-4)",gold5:"var(--vef-gold-5)",gold6:"var(--vef-gold-6)",gold7:"var(--vef-gold-7)",gold8:"var(--vef-gold-8)",gold9:"var(--vef-gold-9)",gold10:"var(--vef-gold-10)",lime1:"var(--vef-lime-1)",lime2:"var(--vef-lime-2)",lime3:"var(--vef-lime-3)",lime4:"var(--vef-lime-4)",lime5:"var(--vef-lime-5)",lime6:"var(--vef-lime-6)",lime7:"var(--vef-lime-7)",lime8:"var(--vef-lime-8)",lime9:"var(--vef-lime-9)",lime10:"var(--vef-lime-10)",colorText:"var(--vef-color-text)",colorTextSecondary:"var(--vef-color-text-secondary)",colorTextTertiary:"var(--vef-color-text-tertiary)",colorTextQuaternary:"var(--vef-color-text-quaternary)",colorTextSlate:"#64748b",colorFill:"var(--vef-color-fill)",colorFillSecondary:"var(--vef-color-fill-secondary)",colorFillTertiary:"var(--vef-color-fill-tertiary)",colorFillQuaternary:"var(--vef-color-fill-quaternary)",colorBgSolid:"var(--vef-color-bg-solid)",colorBgSolidHover:"var(--vef-color-bg-solid-hover)",colorBgSolidActive:"var(--vef-color-bg-solid-active)",colorBgContainer:"var(--vef-color-bg-container)",colorBgElevated:"var(--vef-color-bg-elevated)",colorBgBlur:"var(--vef-color-bg-blur)",colorBorder:"var(--vef-color-border)",colorBorderSecondary:"var(--vef-color-border-secondary)",colorPrimaryBg:"var(--vef-color-primary-bg)",colorPrimaryBgHover:"var(--vef-color-primary-bg-hover)",colorPrimaryBorder:"var(--vef-color-primary-border)",colorPrimaryBorderHover:"var(--vef-color-primary-border-hover)",colorPrimaryHover:"var(--vef-color-primary-hover)",colorPrimaryActive:"var(--vef-color-primary-active)",colorPrimaryTextHover:"var(--vef-color-primary-text-hover)",colorPrimaryText:"var(--vef-color-primary-text)",colorPrimaryTextActive:"var(--vef-color-primary-text-active)",colorSuccessBg:"var(--vef-color-success-bg)",colorSuccessBgHover:"var(--vef-color-success-bg-hover)",colorSuccessBorder:"var(--vef-color-success-border)",colorSuccessBorderHover:"var(--vef-color-success-border-hover)",colorSuccessHover:"var(--vef-color-success-hover)",colorSuccessActive:"var(--vef-color-success-active)",colorSuccessTextHover:"var(--vef-color-success-text-hover)",colorSuccessText:"var(--vef-color-success-text)",colorSuccessTextActive:"var(--vef-color-success-text-active)",colorErrorBg:"var(--vef-color-error-bg)",colorErrorBgHover:"var(--vef-color-error-bg-hover)",colorErrorBgFilledHover:"var(--vef-color-error-bg-filled-hover)",colorErrorBgActive:"var(--vef-color-error-bg-active)",colorErrorBorder:"var(--vef-color-error-border)",colorErrorBorderHover:"var(--vef-color-error-border-hover)",colorErrorHover:"var(--vef-color-error-hover)",colorErrorActive:"var(--vef-color-error-active)",colorErrorTextHover:"var(--vef-color-error-text-hover)",colorErrorText:"var(--vef-color-error-text)",colorErrorTextActive:"var(--vef-color-error-text-active)",colorWarningBg:"var(--vef-color-warning-bg)",colorWarningBgHover:"var(--vef-color-warning-bg-hover)",colorWarningBorder:"var(--vef-color-warning-border)",colorWarningBorderHover:"var(--vef-color-warning-border-hover)",colorWarningHover:"var(--vef-color-warning-hover)",colorWarningActive:"var(--vef-color-warning-active)",colorWarningTextHover:"var(--vef-color-warning-text-hover)",colorWarningText:"var(--vef-color-warning-text)",colorWarningTextActive:"var(--vef-color-warning-text-active)",colorInfoBg:"var(--vef-color-info-bg)",colorInfoBgHover:"var(--vef-color-info-bg-hover)",colorInfoBorder:"var(--vef-color-info-border)",colorInfoBorderHover:"var(--vef-color-info-border-hover)",colorInfoHover:"var(--vef-color-info-hover)",colorInfoActive:"var(--vef-color-info-active)",colorInfoTextHover:"var(--vef-color-info-text-hover)",colorInfoText:"var(--vef-color-info-text)",colorInfoTextActive:"var(--vef-color-info-text-active)",colorLinkHover:"var(--vef-color-link-hover)",colorLinkActive:"var(--vef-color-link-active)",colorBgMask:"var(--vef-color-bg-mask)",colorWhite:"var(--vef-color-white)",fontSizeSm:"var(--vef-font-size-sm)",fontSizeLg:"var(--vef-font-size-lg)",fontSizeXl:"var(--vef-font-size-xl)",fontSizeHeading1:"var(--vef-font-size-heading-1)",fontSizeHeading2:"var(--vef-font-size-heading-2)",fontSizeHeading3:"var(--vef-font-size-heading-3)",fontSizeHeading4:"var(--vef-font-size-heading-4)",fontSizeHeading5:"var(--vef-font-size-heading-5)",lineHeight:"var(--vef-line-height)",lineHeightLg:"var(--vef-line-height-lg)",lineHeightSm:"var(--vef-line-height-sm)",fontHeight:"var(--vef-font-height)",fontHeightLg:"var(--vef-font-height-lg)",fontHeightSm:"var(--vef-font-height-sm)",lineHeightHeading1:"var(--vef-line-height-heading-1)",lineHeightHeading2:"var(--vef-line-height-heading-2)",lineHeightHeading3:"var(--vef-line-height-heading-3)",lineHeightHeading4:"var(--vef-line-height-heading-4)",lineHeightHeading5:"var(--vef-line-height-heading-5)",controlHeightSm:"var(--vef-control-height-sm)",controlHeightXs:"var(--vef-control-height-xs)",controlHeightLg:"var(--vef-control-height-lg)",motionDurationFast:"var(--vef-motion-duration-fast)",motionDurationMid:"var(--vef-motion-duration-mid)",motionDurationSlow:"var(--vef-motion-duration-slow)",lineWidthBold:"var(--vef-line-width-bold)",borderRadiusXs:"var(--vef-border-radius-xs)",borderRadiusSm:"var(--vef-border-radius-sm)",borderRadiusLg:"var(--vef-border-radius-lg)",borderRadiusOuter:"var(--vef-border-radius-outer)",colorFillContent:"var(--vef-color-fill-content)",colorFillContentHover:"var(--vef-color-fill-content-hover)",colorFillAlt:"var(--vef-color-fill-alter)",colorBgContainerDisabled:"var(--vef-color-bg-container-disabled)",colorBorderBg:"var(--vef-color-border-bg)",colorSplit:"var(--vef-color-split)",colorTextPlaceholder:"var(--vef-color-text-placeholder)",colorTextDisabled:"var(--vef-color-text-disabled)",colorTextHeading:"var(--vef-color-text-heading)",colorTextLabel:"var(--vef-color-text-label)",colorTextDescription:"var(--vef-color-text-description)",colorTextLightSolid:"var(--vef-color-text-light-solid)",colorHighlight:"var(--vef-color-highlight)",colorBgTextHover:"var(--vef-color-bg-text-hover)",colorBgTextActive:"var(--vef-color-bg-text-active)",colorIcon:"var(--vef-color-icon)",colorIconHover:"var(--vef-color-icon-hover)",colorErrorOutline:"var(--vef-color-error-outline)",colorWarningOutline:"var(--vef-color-warning-outline)",fontSizeIcon:"var(--vef-font-size-icon)",lineWidthFocus:"var(--vef-line-width-focus)",controlOutlineWidth:"var(--vef-control-outline-width)",controlInteractiveSize:"var(--vef-control-interactive-size)",controlItemBgHover:"var(--vef-control-item-bg-hover)",controlItemBgActive:"var(--vef-control-item-bg-active)",controlItemBgActiveHover:"var(--vef-control-item-bg-active-hover)",controlItemBgActiveDisabled:"var(--vef-control-item-bg-active-disabled)",controlTmpOutline:"var(--vef-control-tmp-outline)",controlOutline:"var(--vef-control-outline)",fontWeightStrong:"var(--vef-font-weight-strong)",opacityLoading:"var(--vef-opacity-loading)",linkDecoration:"var(--vef-link-decoration)",linkHoverDecoration:"var(--vef-link-hover-decoration)",linkFocusDecoration:"var(--vef-link-focus-decoration)",controlPaddingHorizontal:"var(--vef-control-padding-horizontal)",controlPaddingHorizontalSm:"var(--vef-control-padding-horizontal-sm)",paddingXxs:"var(--vef-padding-xxs)",paddingXs:"var(--vef-padding-xs)",paddingSm:"var(--vef-padding-sm)",padding:"var(--vef-padding)",paddingMd:"var(--vef-padding-md)",paddingLg:"var(--vef-padding-lg)",paddingXl:"var(--vef-padding-xl)",paddingContentHorizontalLg:"var(--vef-padding-content-horizontal-lg)",paddingContentVerticalLg:"var(--vef-padding-content-vertical-lg)",paddingContentHorizontal:"var(--vef-padding-content-horizontal)",paddingContentVertical:"var(--vef-padding-content-vertical)",paddingContentHorizontalSm:"var(--vef-padding-content-horizontal-sm)",paddingContentVerticalSm:"var(--vef-padding-content-vertical-sm)",marginXxs:"var(--vef-margin-xxs)",marginXs:"var(--vef-margin-xs)",marginSm:"var(--vef-margin-sm)",margin:"var(--vef-margin)",marginMd:"var(--vef-margin-md)",marginLg:"var(--vef-margin-lg)",marginXl:"var(--vef-margin-xl)",marginXxl:"var(--vef-margin-xxl)",boxShadow:"var(--vef-box-shadow)",boxShadowSecondary:"var(--vef-box-shadow-secondary)",boxShadowTertiary:"var(--vef-box-shadow-tertiary)",boxShadowPopoverArrow:"var(--vef-box-shadow-popover-arrow)",boxShadowCard:"var(--vef-box-shadow-card)",boxShadowDrawerRight:"var(--vef-box-shadow-drawer-right)",boxShadowDrawerLeft:"var(--vef-box-shadow-drawer-left)",boxShadowDrawerUp:"var(--vef-box-shadow-drawer-up)",boxShadowDrawerDown:"var(--vef-box-shadow-drawer-down)",boxShadowTabsOverflowLeft:"var(--vef-box-shadow-tabs-overflow-left)",boxShadowTabsOverflowRight:"var(--vef-box-shadow-tabs-overflow-right)",boxShadowTabsOverflowTop:"var(--vef-box-shadow-tabs-overflow-top)",boxShadowTabsOverflowBottom:"var(--vef-box-shadow-tabs-overflow-bottom)",boxShadowElevated:"0 0 1px rgb(0 0 0 / 30%), 0 4px 14px rgb(0 0 0 / 10%)"};export{e as themeVariables};
package/esm/types.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- "use strict";
package/esm/utils.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- import{isFunction as u,snake as l,isNumber as p}from"radashi";import{assign as S,camel as x,capitalize as M,clone as C,cloneDeep as j,cluster as w,dash as A,debounce as E,get as I,isArray as P,isBoolean as R,isDate as v,isEmpty as O,isError as q,isFloat as D,isFunction as N,isInt as W,isIntString as z,isMap as U,isNullish as B,isNumber as L,isObject as $,isPlainObject as G,isPrimitive as H,isPromise as J,isRegExp as K,isSet as Q,isString as T,isSymbol as V,isUndefined as X,isWeakMap as Y,isWeakSet as Z,max as _,memo as ee,min as ne,noop as te,omit as ie,once as se,pascal as ae,pick as re,set as oe,similarity as ce,snake as ue,sum as le,template as pe,throttle as me,toFloat as fe,toInt as ye,trim as de,unique as he}from"radashi";import{default as ge}from"react-fast-compare";import{shallow as Fe}from"zustand/shallow";function r(e){return u(e)?e.constructor.name==="AsyncFunction"||Object.prototype.toString.call(e)==="[object AsyncFunction]"||e.toString().startsWith("async "):!1}async function m(e,{beforeInvoke:i,onSuccess:n,onFinally:s},...a){if(r(e))try{i?.();const t=await e(...a);return n?.(t),t}finally{s?.()}else{const t=e(...a);if(t instanceof Promise)try{i?.();const o=await t;return n?.(o),o}finally{s?.()}else return t}}function f(e,i){return Object.keys(i).filter(n=>e[n]!==i[n]).reduce((n,s)=>(n[s]=i[s],n),{})}function y(e){return l(e).toUpperCase()}function d(e){return!!(r(e)&&Reflect.has(e,"name")&&Reflect.has(e,"key")&&Reflect.get(e,"name")==="apiFn")}function h(e){return p(e)?`${e}px`:e}function b(e){return new Map(c(e))}function c(e,i=[]){return e.flatMap(n=>{if(n.type==="item")return[[n.key,[n,i]]];if(n.type==="submenu"||n.type==="group"){const{children:s,...a}=n;return[[a.key,[{...a,children:[]},i]],...c(s,[...i,{...a,children:s.filter(t=>t.type!=="divider").map(t=>t.type==="item"?{...t}:{...t,children:[]})}])]}return[]})}export{S as assign,b as buildRouteParentMenusMappings,x as camelCase,M as capitalize,C as clone,j as cloneDeep,w as cluster,y as constantCase,A as dashCase,E as debounce,f as difference,I as get,h as getStringLength,m as invokeMaybeAsyncFn,P as isArray,r as isAsyncFunction,R as isBoolean,v as isDate,ge as isDeepEqual,O as isEmpty,q as isError,D as isFloat,N as isFunction,W as isInt,z as isIntString,d as isInternalFunction,U as isMap,B as isNullish,L as isNumber,$ as isObject,G as isPlainObject,H as isPrimitive,J as isPromise,K as isRegExp,Q as isSet,Fe as isShallowEqual,T as isString,V as isSymbol,X as isUndefined,Y as isWeakMap,Z as isWeakSet,_ as max,ee as memoize,ne as min,te as noop,ie as omit,se as once,ae as pascalCase,re as pick,oe as set,ce as similarity,ue as snakeCase,le as sum,pe as template,me as throttle,fe as toFloat,ye as toInt,de as trim,he as unique};
package/esm/validation.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- import n from"validator";function s(i){return n.isAlpha(i)}function u(i){return n.isAlphanumeric(i)}function c(i){return n.isAscii(i)}function l(i){return n.isNumeric(i)}function f(i){return n.isDecimal(i)}function a(i,r){return n.isFloat(i,r)}function m(i){return n.isBoolean(i,{loose:!1})}function e(i){return n.isDate(i,{format:"YYYY-MM-DD",strictMode:!0})}function p(i){return n.isEmpty(i)}function _(i){return n.isEmpty(i,{ignore_whitespace:!0})}function h(i){return n.isIdentityCard(i,"zh-CN")}function d(i,r){return n.isAfter(i,r)}function g(i,r){return n.isBefore(i,r)}function q(i){return n.isEmail(i)}function I(i){return n.isHexColor(i)}function w(i,r){return n.isIn(i,r)}function C(i,r){return n.isInt(i,r)}function L(i,r){return n.isIP(i,r)}function P(i,r){return n.isIPRange(i,r)}function y(i){return n.isJSON(i)}function A(i){return n.isJWT(i)}function D(i){return n.isLatLong(i)}function N(i,r){return n.isLength(i,r)}function S(i){return n.isMimeType(i)}function U(i){return n.isMobilePhone(i,"zh-CN")}function M(i){return n.isPort(i)}function E(i){return n.isPostalCode(i,"CN")}function T(i){return n.isSemVer(i)}function B(i){return n.isSlug(i)}function b(i){return n.isStrongPassword(i,{minLength:8,minLowercase:1,minUppercase:1,minNumbers:1,minSymbols:1})}function o(i,r){return n.isTime(i,r)}function J(i){return n.isURL(i,{protocols:["http","https"],require_tld:!0,require_protocol:!0,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!0})}function R(i){return n.isURL(i,{protocols:[],require_tld:!1,require_protocol:!1,require_host:!1,require_port:!1,require_valid_protocol:!1,allow_underscores:!0,allow_fragments:!1,allow_query_components:!1,allow_protocol_relative_urls:!1})}function Y(i,r){return n.isUUID(i,r)}function v(i){const[r,t]=i.split(" ",2);return e(r)&&o(t)}function x(i,r,t){return n.matches(i,r,t)}const F=/^[\u4E00-\u9FA5]+\d*$/;function z(i){return F.test(i)}export{d as isAfter,s as isAlpha,u as isAlphanumeric,c as isAscii,g as isBefore,_ as isBlank,m as isBoolean,z as isChineseName,e as isDate,v as isDateTime,f as isDecimal,q as isEmail,p as isEmpty,a as isFloat,I as isHexColor,h as isIdentityCard,w as isIn,C as isInt,L as isIp,P as isIpRange,y as isJson,A as isJwt,D as isLatLong,N as isLength,S as isMimeType,U as isMobilePhone,l as isNumeric,M as isPort,E as isPostalCode,T as isSemVer,B as isSlug,b as isStrongPassword,o as isTime,R as isUri,J as isUrl,Y as isUuid,x as matches};
package/esm/yaml.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- import{load as r}from"js-yaml";function t(o){return r(o)}export{t as loadYaml};
package/esm/zod.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- import r from"i18next";import{z as o}from"zod";import{z as a}from"zod";import{zodI18nMap as t}from"zod-i18n-map";import i from"zod-i18n-map/locales/zh-CN/zod.json";function m(){r.init({lng:"zh-CN",fallbackLng:!1,resources:{"zh-CN":{zod:i}}}),o.setErrorMap(t)}export{m as initZod,a as z};
package/types/color.d.ts DELETED
@@ -1,7 +0,0 @@
1
- /**
2
- * Check if the color is valid.
3
- *
4
- * @param color - The color to check.
5
- * @returns Whether the color is valid.
6
- */
7
- export declare function isValidColor(color: string): boolean;
@@ -1,28 +0,0 @@
1
- /**
2
- * The default color types
3
- */
4
- export declare const defaultColorTypes: readonly ["blue", "purple", "cyan", "green", "magenta", "pink", "red", "orange", "yellow", "volcano", "geekblue", "gold", "lime"];
5
- /**
6
- * The semantic color types
7
- */
8
- export declare const semanticColorTypes: readonly ["primary", "info", "success", "warning", "error"];
9
- /**
10
- * The color types
11
- */
12
- export declare const colorTypes: ("blue" | "purple" | "cyan" | "green" | "magenta" | "pink" | "red" | "orange" | "yellow" | "volcano" | "geekblue" | "gold" | "lime" | "primary" | "info" | "success" | "warning" | "error")[];
13
- /**
14
- * The creation form scene
15
- */
16
- export declare const creationFormScene = "creation";
17
- /**
18
- * The update form scene
19
- */
20
- export declare const updateFormScene = "update";
21
- /**
22
- * The audit form scene
23
- */
24
- export declare const auditFormScene = "audit";
25
- /**
26
- * The preset form scenes
27
- */
28
- export declare const presetFormScenes: readonly ["creation", "update", "audit"];
@@ -1,21 +0,0 @@
1
- import type { Context } from "use-context-selector";
2
- import type { Mapper, Provider } from "./types";
3
- /**
4
- * Create a context that can be selected with a selector.
5
- *
6
- * @param defaultValue - The default value of the context.
7
- */
8
- export declare function createSelectableContext<T>(defaultValue: T): {
9
- /**
10
- * The provider of the context.
11
- */
12
- ContextProvider: Context<T>["Provider"];
13
- /**
14
- * The selector of the context.
15
- */
16
- useContextSelector: <R>(selector: Mapper<T, R>) => R;
17
- /**
18
- * The hook of the context.
19
- */
20
- useContext: Provider<T>;
21
- };
package/types/dom.d.ts DELETED
@@ -1,9 +0,0 @@
1
- /**
2
- * Get the height of an element
3
- *
4
- * @param element The parent element
5
- * @param selector The selector of the child element
6
- * @param includeMargin Whether to include the margin of the child element
7
- * @returns The height of the target element
8
- */
9
- export declare function getElementHeight(element: HTMLElement, selector?: string, includeMargin?: boolean): number;
package/types/error.d.ts DELETED
@@ -1,16 +0,0 @@
1
- /**
2
- * The error of Vef framework.
3
- */
4
- export declare class VefError extends Error {
5
- /**
6
- * The code of the error.
7
- */
8
- readonly code: number;
9
- /**
10
- * Constructs a new VefError.
11
- *
12
- * @param code - The code of the error.
13
- * @param message - The message of the error.
14
- */
15
- constructor(code: number, message: string);
16
- }
package/types/event.d.ts DELETED
@@ -1,6 +0,0 @@
1
- /**
2
- * Creates an event emitter.
3
- *
4
- * @returns An event emitter.
5
- */
6
- export declare function createEventEmitter<E extends Record<symbol, unknown>>(): import("mitt").Emitter<E>;
@@ -1,23 +0,0 @@
1
- import type { BiMapper, Expression, ObjectValue } from "./types";
2
- /**
3
- * Check if the value is an expression.
4
- *
5
- * @param value - The value.
6
- * @returns Whether the value is an expression.
7
- */
8
- export declare function isExpression(value: unknown): value is Expression;
9
- /**
10
- * Check if the value is a function or an expression.
11
- *
12
- * @param value - The value.
13
- * @returns Whether the value is a function or an expression.
14
- */
15
- export declare function isFunctionOrExpression(value: unknown): value is BiMapper<ObjectValue, string, unknown> | Expression;
16
- /**
17
- * Compile the dynamic function.
18
- *
19
- * @param key - The key.
20
- * @param args - The arguments.
21
- * @returns The dynamic function.
22
- */
23
- export declare function compileDynamicFn(key: object, ...args: string[]): Function;
@@ -1,8 +0,0 @@
1
- import type { AnyFunction, MaybeUndefined } from "./types";
2
- /**
3
- * Merge multiple functions into a single function.
4
- *
5
- * @param fns - The functions to merge
6
- * @returns The merged function
7
- */
8
- export declare function mergeFns<T extends AnyFunction>(...fns: Array<MaybeUndefined<T>>): T;
package/types/index.d.ts DELETED
@@ -1,23 +0,0 @@
1
- export * from "./color";
2
- export * from "./constants";
3
- export * from "./context";
4
- export * from "./dom";
5
- export * from "./error";
6
- export * from "./event";
7
- export * from "./expression";
8
- export * from "./function";
9
- export * from "./id";
10
- export * from "./json";
11
- export * from "./module";
12
- export * from "./path";
13
- export * from "./pinyin";
14
- export * from "./security";
15
- export * from "./store";
16
- export * from "./styles";
17
- export * from "./temporal";
18
- export * from "./theme-variables";
19
- export * from "./types";
20
- export * from "./utils";
21
- export * as validator from "./validation";
22
- export * from "./yaml";
23
- export * from "./zod";
package/types/json.d.ts DELETED
@@ -1,7 +0,0 @@
1
- /**
2
- * Check if a JSON schema is valid.
3
- *
4
- * @param schema - The JSON schema to check.
5
- * @returns `true` if the schema is valid, `false` otherwise.
6
- */
7
- export declare function isJsonSchemaValid(schema: string): boolean;
package/types/module.d.ts DELETED
@@ -1,7 +0,0 @@
1
- /**
2
- * Unwrap the module.
3
- *
4
- * @param module - The module to unwrap.
5
- * @returns The unwrapped module.
6
- */
7
- export declare function unwrapModule(module: object): object;
package/types/path.d.ts DELETED
@@ -1,43 +0,0 @@
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/types/pinyin.d.ts DELETED
@@ -1,14 +0,0 @@
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[];
@@ -1,16 +0,0 @@
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;
package/types/store.d.ts DELETED
@@ -1,78 +0,0 @@
1
- import type { FC } from "react";
2
- import type { Mutate, StateCreator, StoreApi } from "zustand";
3
- import type { BiMapper, ChildrenProps, Mapper, MaybeNull } from "./types";
4
- export type ExtractState<S> = S extends {
5
- getState: () => infer T;
6
- } ? T : never;
7
- export type ReadonlyStoreApi<T> = Pick<StoreApi<T>, "getState" | "getInitialState" | "subscribe">;
8
- /**
9
- * The type of the bound store
10
- */
11
- export type BoundStoreApi<T> = {
12
- <U>(selector: Mapper<T, U>, equalityFn?: BiMapper<U, U, boolean>): U;
13
- } & Mutate<StoreApi<T>, [["zustand/persist", unknown], ["zustand/subscribeWithSelector", never]]>;
14
- /**
15
- * The type of the unbound store
16
- */
17
- export type UnboundStoreApi<T> = Mutate<StoreApi<T>, [["zustand/subscribeWithSelector", never]]>;
18
- /**
19
- * The options for the persistence
20
- */
21
- export interface PersistenceOptions<T, S = T> {
22
- /**
23
- * The unique name of the store
24
- */
25
- name: string;
26
- /**
27
- * The storage type of the store
28
- */
29
- storage?: "local" | "session";
30
- /**
31
- * The selector of the store
32
- */
33
- selector?: Mapper<T, S>;
34
- }
35
- /**
36
- * Create a store with equality function
37
- *
38
- * @param stateCreator The store creator
39
- * @returns The store with equality function
40
- */
41
- export declare function createStore<T, Persisted = T>(stateCreator: StateCreator<T>, persistenceOptions?: PersistenceOptions<T, Persisted>): BoundStoreApi<T>;
42
- /**
43
- * Create an unbound store
44
- *
45
- * @param stateCreator The store creator
46
- * @returns The unbound store
47
- */
48
- export declare function createUnboundStore<T>(stateCreator: StateCreator<T>): UnboundStoreApi<T>;
49
- /**
50
- * Use the store with equality function
51
- *
52
- * @param store The store
53
- * @param selector The state selector
54
- * @param equalityFn The equality function
55
- * @returns The selected state
56
- */
57
- export declare function useUnboundStore<S extends ReadonlyStoreApi<unknown>, T>(store: S, selector: Mapper<ExtractState<S>, T>, equalityFn?: BiMapper<T, T, boolean>): T;
58
- /**
59
- * The props of the store provider
60
- */
61
- export interface StoreProviderProps<T> extends ChildrenProps {
62
- /**
63
- * The initial state of the store
64
- */
65
- initialState: T;
66
- }
67
- /**
68
- * Create a store used only in a component
69
- *
70
- * @param name The store name
71
- * @param getStateCreator The store creator
72
- * @returns The store context and provider
73
- */
74
- export declare function createComponentStore<T, P extends MaybeNull<Partial<T>> = null>(name: string, getStateCreator: Mapper<P, StateCreator<T>>): {
75
- StoreProvider: FC<StoreProviderProps<P>>;
76
- useStore: <State extends T, U>(selector: Mapper<State, U>) => U;
77
- useStoreApi: <State extends T>() => UnboundStoreApi<State>;
78
- };
package/types/styles.d.ts DELETED
@@ -1,21 +0,0 @@
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 {};
@@ -1,18 +0,0 @@
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;