@vef-framework/components 1.0.130 → 1.0.132

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 (148) hide show
  1. package/cjs/helpers/icons.cjs +2 -0
  2. package/cjs/helpers/index.cjs +2 -0
  3. package/cjs/helpers/message.cjs +2 -0
  4. package/cjs/index.cjs +1 -1
  5. package/cjs/internal/base.css.cjs +10 -6
  6. package/cjs/vef-access-denied/index.cjs +1 -27
  7. package/cjs/vef-button/index.cjs +1 -1
  8. package/cjs/vef-chart-container/index.cjs +3 -54
  9. package/cjs/vef-chart-legend-content/index.cjs +1 -16
  10. package/cjs/vef-chart-tooltip-content/index.cjs +1 -42
  11. package/cjs/vef-checkbox/index.cjs +1 -3
  12. package/cjs/vef-config-provider/global-style.cjs +2 -1
  13. package/cjs/vef-config-provider/index.cjs +1 -5
  14. package/cjs/vef-crud-page/components/crud-footer.cjs +1 -7
  15. package/cjs/vef-crud-page/hooks/use-operation-buttons.cjs +1 -1
  16. package/cjs/vef-crud-page/store.cjs +1 -1
  17. package/cjs/vef-drawer/index.cjs +1 -8
  18. package/cjs/vef-error/index.cjs +1 -28
  19. package/cjs/vef-filter/components/action-buttons.cjs +1 -19
  20. package/cjs/vef-filter/components/advanced-filter.cjs +1 -9
  21. package/cjs/vef-filter/components/basic-filter.cjs +1 -19
  22. package/cjs/vef-filter/hooks/use-action-handlers.cjs +1 -1
  23. package/cjs/vef-filter/hooks/use-label-config.cjs +1 -1
  24. package/cjs/vef-filter/index.cjs +1 -8
  25. package/cjs/vef-form/components/form-actions.cjs +1 -3
  26. package/cjs/vef-form/components/form-content.cjs +1 -4
  27. package/cjs/vef-form/components/form-group.cjs +1 -11
  28. package/cjs/vef-form/hooks/use-action-handlers.cjs +1 -1
  29. package/cjs/vef-form/hooks/use-label-width.cjs +1 -1
  30. package/cjs/vef-form/index.cjs +1 -3
  31. package/cjs/vef-grid/index.cjs +1 -1
  32. package/cjs/vef-icon/index.cjs +1 -1
  33. package/cjs/vef-icon-select/index.cjs +2 -28
  34. package/cjs/vef-intellisense-code-editor/styles.cjs +1 -20
  35. package/cjs/vef-layout/common-styles.cjs +1 -4
  36. package/cjs/vef-layout/components/header-action-icons.cjs +1 -15
  37. package/cjs/vef-layout/components/header.cjs +1 -12
  38. package/cjs/vef-layout/components/menu-groups.cjs +1 -32
  39. package/cjs/vef-layout/components/sider.cjs +1 -49
  40. package/cjs/vef-layout/components/title.cjs +1 -36
  41. package/cjs/vef-layout/components/user-avatar.cjs +1 -16
  42. package/cjs/vef-layout/index.cjs +1 -5
  43. package/cjs/vef-loading-placeholder/index.cjs +1 -7
  44. package/cjs/vef-login/index.cjs +1 -54
  45. package/cjs/vef-menu/index.cjs +1 -6
  46. package/cjs/vef-modal/index.cjs +1 -4
  47. package/cjs/vef-not-found/index.cjs +1 -28
  48. package/cjs/vef-page/index.cjs +1 -58
  49. package/cjs/vef-pie-chart/index.cjs +1 -8
  50. package/cjs/vef-popconfirm/index.cjs +1 -1
  51. package/cjs/vef-radio/index.cjs +1 -3
  52. package/cjs/vef-responsive-container/index.cjs +1 -5
  53. package/cjs/vef-responsive-item/index.cjs +1 -3
  54. package/cjs/vef-scroll-area/index.cjs +1 -11
  55. package/cjs/vef-select/components/option.cjs +1 -9
  56. package/cjs/vef-select/hooks/use-render-label.cjs +1 -1
  57. package/cjs/vef-sortable-list/components/overlay-item.cjs +1 -5
  58. package/cjs/vef-sortable-list/components/sortable-item.cjs +1 -5
  59. package/cjs/vef-table/components/columns-settings.cjs +1 -52
  60. package/cjs/vef-table/components/operation-buttons.cjs +1 -10
  61. package/cjs/vef-table/components/table-footer.cjs +1 -17
  62. package/cjs/vef-table/index.cjs +1 -54
  63. package/cjs/vef-title/index.cjs +1 -13
  64. package/cjs/vef-virtual-grid/index.cjs +1 -12
  65. package/cjs/vef-virtual-list/index.cjs +1 -18
  66. package/esm/helpers/icons.js +2 -0
  67. package/esm/helpers/index.js +2 -0
  68. package/esm/helpers/message.js +2 -0
  69. package/esm/index.js +1 -1
  70. package/esm/internal/base.css.js +10 -6
  71. package/esm/vef-access-denied/index.js +1 -27
  72. package/esm/vef-approval-flow-editor/components/node-content.js +1 -1
  73. package/esm/vef-approval-flow-editor/components/node-selector.js +2 -2
  74. package/esm/vef-approval-flow-editor/components/node-toolbar.js +1 -1
  75. package/esm/vef-button/index.js +1 -1
  76. package/esm/vef-chart-container/index.js +2 -53
  77. package/esm/vef-chart-legend-content/index.js +1 -16
  78. package/esm/vef-chart-tooltip-content/index.js +1 -42
  79. package/esm/vef-checkbox/index.js +1 -3
  80. package/esm/vef-config-provider/global-style.js +2 -1
  81. package/esm/vef-config-provider/index.js +1 -5
  82. package/esm/vef-crud-page/components/crud-footer.js +1 -7
  83. package/esm/vef-crud-page/hooks/use-action-buttons.js +1 -1
  84. package/esm/vef-crud-page/hooks/use-operation-buttons.js +1 -1
  85. package/esm/vef-crud-page/store.js +1 -1
  86. package/esm/vef-drawer/index.js +1 -8
  87. package/esm/vef-dynamic-icon/index.js +1 -1
  88. package/esm/vef-error/index.js +1 -28
  89. package/esm/vef-filter/components/action-buttons.js +1 -19
  90. package/esm/vef-filter/components/advanced-filter.js +1 -9
  91. package/esm/vef-filter/components/basic-filter.js +1 -19
  92. package/esm/vef-filter/hooks/use-action-handlers.js +1 -1
  93. package/esm/vef-filter/hooks/use-label-config.js +1 -1
  94. package/esm/vef-filter/index.js +1 -8
  95. package/esm/vef-form/components/form-actions.js +1 -3
  96. package/esm/vef-form/components/form-content.js +1 -4
  97. package/esm/vef-form/components/form-group.js +1 -11
  98. package/esm/vef-form/hooks/use-action-handlers.js +1 -1
  99. package/esm/vef-form/hooks/use-label-width.js +1 -1
  100. package/esm/vef-form/index.js +1 -3
  101. package/esm/vef-generic-select/index.js +1 -1
  102. package/esm/vef-grid/index.js +1 -1
  103. package/esm/vef-icon/index.js +1 -1
  104. package/esm/vef-icon-select/index.js +2 -28
  105. package/esm/vef-intellisense-code-editor/styles.js +1 -20
  106. package/esm/vef-layout/common-styles.js +1 -4
  107. package/esm/vef-layout/components/font-size.js +1 -1
  108. package/esm/vef-layout/components/fullscreen.js +1 -1
  109. package/esm/vef-layout/components/header-action-icons.js +1 -15
  110. package/esm/vef-layout/components/header.js +1 -12
  111. package/esm/vef-layout/components/menu-groups.js +1 -32
  112. package/esm/vef-layout/components/sider.js +1 -49
  113. package/esm/vef-layout/components/title.js +1 -36
  114. package/esm/vef-layout/components/user-avatar.js +1 -16
  115. package/esm/vef-layout/index.js +1 -5
  116. package/esm/vef-loading-placeholder/index.js +1 -7
  117. package/esm/vef-login/index.js +1 -54
  118. package/esm/vef-menu/index.js +1 -6
  119. package/esm/vef-modal/index.js +1 -4
  120. package/esm/vef-not-found/index.js +1 -28
  121. package/esm/vef-page/index.js +1 -58
  122. package/esm/vef-pie-chart/index.js +1 -8
  123. package/esm/vef-popconfirm/index.js +1 -1
  124. package/esm/vef-radio/index.js +1 -3
  125. package/esm/vef-responsive-container/index.js +1 -5
  126. package/esm/vef-responsive-item/index.js +1 -3
  127. package/esm/vef-scroll-area/index.js +1 -11
  128. package/esm/vef-select/components/option.js +1 -9
  129. package/esm/vef-sortable-list/components/overlay-item.js +1 -5
  130. package/esm/vef-sortable-list/components/sortable-item.js +1 -5
  131. package/esm/vef-table/components/columns-settings.js +1 -52
  132. package/esm/vef-table/components/operation-buttons.js +1 -10
  133. package/esm/vef-table/components/settings-icon.js +1 -1
  134. package/esm/vef-table/components/table-footer.js +1 -17
  135. package/esm/vef-table/hooks/use-helper-columns.js +1 -1
  136. package/esm/vef-table/index.js +1 -54
  137. package/esm/vef-title/index.js +1 -13
  138. package/esm/vef-virtual-grid/index.js +1 -12
  139. package/esm/vef-virtual-list/index.js +1 -18
  140. package/package.json +18 -18
  141. package/types/helpers/icons.d.ts +7 -0
  142. package/types/helpers/index.d.ts +2 -0
  143. package/types/helpers/message.d.ts +372 -0
  144. package/types/index.d.ts +1 -0
  145. package/types/vef-dynamic-icon/props.d.ts +1 -1
  146. package/types/vef-icon/props.d.ts +2 -3
  147. package/types/vef-scroll-area/components/scrollbar.d.ts +2 -1
  148. package/types/vef-scroll-area/props.d.ts +4 -4
@@ -13,7 +13,7 @@ var n=`/* this will be exported as base.css and can be used for a basic styling
13
13
  --xy-attribution-background-color-default: rgba(255, 255, 255, 0.5);
14
14
 
15
15
  --xy-minimap-background-color-default: #fff;
16
- --xy-minimap-mask-background-color-default: rgb(240, 240, 240, 0.6);
16
+ --xy-minimap-mask-background-color-default: rgba(240, 240, 240, 0.6);
17
17
  --xy-minimap-mask-stroke-color-default: transparent;
18
18
  --xy-minimap-mask-stroke-width-default: 1;
19
19
  --xy-minimap-node-background-color-default: #e2e2e2;
@@ -45,7 +45,7 @@ var n=`/* this will be exported as base.css and can be used for a basic styling
45
45
  --xy-attribution-background-color-default: rgba(150, 150, 150, 0.25);
46
46
 
47
47
  --xy-minimap-background-color-default: #141414;
48
- --xy-minimap-mask-background-color-default: rgb(60, 60, 60, 0.6);
48
+ --xy-minimap-mask-background-color-default: rgba(60, 60, 60, 0.6);
49
49
  --xy-minimap-mask-stroke-color-default: transparent;
50
50
  --xy-minimap-mask-stroke-width-default: 1;
51
51
  --xy-minimap-node-background-color-default: #2b2b2b;
@@ -247,16 +247,20 @@ svg.react-flow__connectionline {
247
247
  .react-flow__panel.bottom {
248
248
  bottom: 0;
249
249
  }
250
+ .react-flow__panel.top.center, .react-flow__panel.bottom.center {
251
+ left: 50%;
252
+ transform: translateX(-50%);
253
+ }
250
254
  .react-flow__panel.left {
251
255
  left: 0;
252
256
  }
253
257
  .react-flow__panel.right {
254
258
  right: 0;
255
259
  }
256
- .react-flow__panel.center {
257
- left: 50%;
258
- transform: translateX(-50%);
259
- }
260
+ .react-flow__panel.left.center, .react-flow__panel.right.center {
261
+ top: 50%;
262
+ transform: translateY(-50%);
263
+ }
260
264
  .react-flow__attribution {
261
265
  font-size: 10px;
262
266
  background: var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));
@@ -1,28 +1,2 @@
1
1
  "use strict";
2
- import{jsx as e,jsxs as o}from"@emotion/react/jsx-runtime";import{css as t}from"@emotion/react";import{styles as c,themeVariables as i}from"@vef-framework/shared";import{ArrowLeftIcon as l}from"lucide-react";import a from"../vef-button/index.js";import m from"../vef-icon/index.js";import d from"./access-denied-icon.js";const p=t`
3
- height: 100%;
4
- ${c.flexCenter}
5
- `,f=t`
6
- width: 40%;
7
- position: relative;
8
- top: -60px;
9
- display: flex;
10
- flex-direction: column;
11
- align-items: center;
12
- justify-content: center;
13
- row-gap: ${i.margin};
14
- > svg {
15
- width: 70%;
16
- }
17
-
18
- > span {
19
- font-size: ${i.fontSizeLg};
20
- font-weight: 500;
21
- color: ${i.colorTextTertiary};
22
- }
23
-
24
- span.vef-access-denied-uri {
25
- padding-left: ${i.paddingSm};
26
- color: ${i.colorWarningText};
27
- }
28
- `;function g({uri:r,title:n="抱歉,您没有权限访问该页面~~~",onNavigateHome:s}){return e("div",{css:p,children:o("div",{css:f,children:[e(d,{}),e("span",{children:n}),r&&o("span",{children:["路径:",e("span",{className:"vef-access-denied-uri",children:r})]}),e(a,{color:"primary",size:"large",icon:e(m,{children:e(l,{})}),onClick:s,children:"回到首页"})]})})}export{g as default};
2
+ import{jsx as e,jsxs as o}from"@emotion/react/jsx-runtime";import{css as t}from"@emotion/react";import{styles as c,themeVariables as i}from"@vef-framework/shared";import{ArrowLeftIcon as l}from"lucide-react";import a from"../vef-button/index.js";import p from"../vef-icon/index.js";import m from"./access-denied-icon.js";const d=t({height:"100%"},c.flexCenter),f=t({width:"40%",position:"relative",top:"-60px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",rowGap:i.margin,"> svg":{width:"100px",height:"100px"},"> span":{fontSize:i.fontSizeLg,fontWeight:500,color:i.colorTextTertiary},"> span.vef-access-denied-uri":{paddingLeft:i.paddingSm,color:i.colorWarningText}});function h({uri:r,title:n="抱歉,您没有权限访问该页面~~~",onNavigateHome:s}){return e("div",{css:d,children:o("div",{css:f,children:[e(m,{}),e("span",{children:n}),r&&o("span",{children:["路径:",e("span",{className:"vef-access-denied-uri",children:r})]}),e(a,{color:"primary",size:"large",icon:e(p,{children:e(l,{})}),onClick:s,children:"回到首页"})]})})}export{h as default};
@@ -14,4 +14,4 @@ import{jsxs as i,Fragment as l,jsx as e}from"@emotion/react/jsx-runtime";import{
14
14
  padding: ${o.paddingXxs};
15
15
  `,y=r`
16
16
  font-size: ${o.fontSizeLg};
17
- `;function C({icon:t,iconColor:n,selected:s,children:m}){const d=f(p()).data.node,c=a().get(n);return i(l,{children:[e(h,{}),e(b,{}),e(u,{selected:s}),i("div",{css:x,children:[e("div",{css:$,style:{backgroundColor:c},children:e(g,{children:t})}),e("h3",{css:y,children:d.getLabel()})]}),m]})}export{C as default};
17
+ `;function C({icon:t,iconColor:n,selected:s,children:d}){const m=f(p()).data.node,c=a().get(n);return i(l,{children:[e(h,{}),e(b,{}),e(u,{selected:s}),i("div",{css:x,children:[e("div",{css:$,style:{backgroundColor:c},children:e(g,{children:t})}),e("h3",{css:y,children:m.getLabel()})]}),d]})}export{C as default};
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- import{jsx as r}from"@emotion/react/jsx-runtime";import{css as i}from"@emotion/react";import{themeVariables as o}from"@vef-framework/shared";import{PlusIcon as m}from"lucide-react";import c from"../../vef-icon/index.js";import s from"../../vef-popover/index.js";import d from"./selector-content.js";const l=i`
2
+ import{jsx as r}from"@emotion/react/jsx-runtime";import{css as i}from"@emotion/react";import{themeVariables as o}from"@vef-framework/shared";import{PlusIcon as c}from"lucide-react";import m from"../../vef-icon/index.js";import s from"../../vef-popover/index.js";import d from"./selector-content.js";const l=i`
3
3
  cursor: pointer;
4
4
  transform-origin: center;
5
5
  background-color: ${o.colorPrimary};
@@ -10,4 +10,4 @@ import{jsx as r}from"@emotion/react/jsx-runtime";import{css as i}from"@emotion/r
10
10
  display: flex;
11
11
  align-items: center;
12
12
  justify-content: center;
13
- `,p={"--vef-popover-inner-content-padding":"6px"};function f({selectorContentPosition:e,items:t,onAddNode:n}){return r(s,{content:r(d,{items:t,onAddNode:n}),contentStyle:p,placement:e,children:r("div",{css:l,children:r(c,{children:r(m,{})})})})}export{f as default};
13
+ `,p={"--vef-popover-inner-content-padding":"6px"};function f({selectorContentPosition:e,items:t,onAddNode:n}){return r(s,{content:r(d,{items:t,onAddNode:n}),contentStyle:p,placement:e,children:r("div",{css:l,children:r(m,{children:r(c,{})})})})}export{f as default};
@@ -1,2 +1,2 @@
1
1
  "use strict";
2
- import{jsx as o}from"@emotion/react/jsx-runtime";import{NodeToolbar as i,Position as t}from"@xyflow/react";import{Trash2Icon as e}from"lucide-react";import s from"../../vef-button/index.js";import n from"../../vef-icon/index.js";function m({selected:r}){return o(i,{align:"end",isVisible:r,offset:4,position:t.Top,children:o(s,{color:"error",size:"small",tip:"删除",variant:"solid",icon:o(n,{children:o(e,{})})})})}export{m as default};
2
+ import{jsx as o}from"@emotion/react/jsx-runtime";import{NodeToolbar as i,Position as t}from"@xyflow/react";import{Trash2Icon as e}from"lucide-react";import s from"../../vef-button/index.js";import n from"../../vef-icon/index.js";function l({selected:r}){return o(i,{align:"end",isVisible:r,offset:4,position:t.Top,children:o(s,{color:"error",size:"small",tip:"删除",variant:"solid",icon:o(n,{children:o(e,{})})})})}export{l as default};
@@ -1,2 +1,2 @@
1
1
  "use strict";
2
- import{jsx as l}from"@emotion/react/jsx-runtime";import{useContextDisabled as w}from"@vef-framework/hooks";import{isNullish as p,invokeMaybeAsyncFn as k,defaultMessageTitle as y,showConfirmation as O,omit as v}from"@vef-framework/shared";import{forwardRef as x,useState as F,useMemo as M,memo as I}from"react";import N from"../vef-popconfirm/index.js";import P from"../vef-tooltip/index.js";import V from"./components/base-button.js";const j=x(({tip:c,onClick:t,disabled:q=!1,loading:r,...n},s)=>{const[g,e]=F(!1),a=M(()=>{if(n.requireConfirmation){const{onConfirmationOk:o}=n;return p(r)?async()=>{await k(o,{beforeInvoke:()=>{e(!0)},onFinally:()=>{e(!1)}})}:o}},[n.requireConfirmation,n.onConfirmationOk]),T=M(()=>{if(!n.requireConfirmation)return t&&p(r)?async i=>{await k(t,{beforeInvoke:()=>{e(!0)},onFinally:()=>{e(!1)}},i)}:t;const{confirmationMode:o="simple",confirmationTitle:m=y,confirmationContent:f,onConfirmationCancel:h}=n;return o==="simple"?i=>{i.stopPropagation()}:i=>{i.stopPropagation(),O(m,f,a,{onCancel:h})}},[r,t,a,n.requireConfirmation,n.confirmationMode,n.confirmationTitle,n.confirmationContent,n.onConfirmationCancel]),C=w()||q,d=l(V,{ref:s,disabled:C,loading:r??g,onClick:T,...v(n,["requireConfirmation","confirmationMode","confirmationTitle","confirmationContent","onConfirmationOk","onConfirmationCancel"])}),u=c?l(P,{content:c,children:d}):d;if(n.requireConfirmation&&n.confirmationMode==="simple"){const{confirmationTitle:o=y,confirmationContent:m,onConfirmationCancel:f}=n;return l(N,{ref:s,content:m,disabled:C,title:o,onCancel:f,onOk:a,children:u})}return u}),b=I(j);b.displayName="VefButton";export{b as default};
2
+ import{jsx as l}from"@emotion/react/jsx-runtime";import{useContextDisabled as w}from"@vef-framework/hooks";import{isNullish as u,invokeMaybeAsyncFn as k,omit as O}from"@vef-framework/shared";import{forwardRef as v,useState as x,useMemo as y,memo as F}from"react";import"../helpers/index.js";import I from"../vef-popconfirm/index.js";import N from"../vef-tooltip/index.js";import P from"./components/base-button.js";import{defaultMessageTitle as M,showConfirmation as V}from"../helpers/message.js";const j=v(({tip:c,onClick:t,disabled:q=!1,loading:r,...n},s)=>{const[g,e]=x(!1),a=y(()=>{if(n.requireConfirmation){const{onConfirmationOk:o}=n;return u(r)?async()=>{await k(o,{beforeInvoke:()=>{e(!0)},onFinally:()=>{e(!1)}})}:o}},[n.requireConfirmation,n.onConfirmationOk]),T=y(()=>{if(!n.requireConfirmation)return t&&u(r)?async i=>{await k(t,{beforeInvoke:()=>{e(!0)},onFinally:()=>{e(!1)}},i)}:t;const{confirmationMode:o="simple",confirmationTitle:m=M,confirmationContent:f,onConfirmationCancel:h}=n;return o==="simple"?i=>{i.stopPropagation()}:i=>{i.stopPropagation(),V(m,f,a,{onCancel:h})}},[r,t,a,n.requireConfirmation,n.confirmationMode,n.confirmationTitle,n.confirmationContent,n.onConfirmationCancel]),C=w()||q,d=l(P,{ref:s,disabled:C,loading:r??g,onClick:T,...O(n,["requireConfirmation","confirmationMode","confirmationTitle","confirmationContent","onConfirmationOk","onConfirmationCancel"])}),p=c?l(N,{content:c,children:d}):d;if(n.requireConfirmation&&n.confirmationMode==="simple"){const{confirmationTitle:o=M,confirmationContent:m,onConfirmationCancel:f}=n;return l(I,{ref:s,content:m,disabled:C,title:o,onCancel:f,onOk:a,children:p})}return p}),b=F(j);b.displayName="VefButton";export{b as default};
@@ -1,58 +1,7 @@
1
1
  "use strict";
2
- import{jsx as c,jsxs as g}from"@emotion/react/jsx-runtime";import{css as k}from"@emotion/react";import{themeVariables as e,isString as $}from"@vef-framework/shared";import{forwardRef as x,useId as y}from"react";import{ResponsiveContainer as C}from"recharts";import{ChartContainerContextProvider as v}from"./hooks/use-chart-container-context.js";const S=k`
3
- display: flex;
4
- justify-content: center;
5
-
6
- & .recharts-cartesian-axis-tick text {
7
- fill: ${e.colorTextDescription};
8
- }
9
-
10
- & .recharts-cartesian-grid line[stroke='#ccc'] {
11
- stroke: color-mix(in srgb, ${e.colorBorder} 50%, transparent);
12
- }
13
-
14
- & .recharts-curve.recharts-tooltip-cursor {
15
- stroke: ${e.colorBorderSecondary};
16
- }
17
-
18
- & .recharts-dot[stroke='#fff'] {
19
- stroke: transparent;
20
- }
21
-
22
- & .recharts-layer {
23
- outline: none;
24
- }
25
-
26
- & .recharts-polar-grid[stroke='#ccc'] {
27
- stroke: ${e.colorBorderSecondary};
28
- }
29
-
30
- & .recharts-radial-bar-background-sector {
31
- fill: ${e.colorFillContent};
32
- }
33
-
34
- & .recharts-rectangle.recharts-tooltip-cursor {
35
- fill: ${e.colorFillContent};
36
- }
37
-
38
- & .recharts-reference-line[stroke='#ccc'] {
39
- stroke: ${e.colorBorderSecondary};
40
- }
41
-
42
- & .recharts-sector[stroke='#fff'] {
43
- stroke: transparent;
44
- }
45
-
46
- & .recharts-sector {
47
- outline: none;
48
- }
49
-
50
- & .recharts-surface {
51
- outline: none;
52
- }
53
- `;function b({id:s,config:i}){const o=Object.entries(i).map(([r,{color:t}])=>[r,t]).filter(([,r])=>$(r));return o.length?c("style",{dangerouslySetInnerHTML:{__html:`
2
+ import{jsx as c,jsxs as g}from"@emotion/react/jsx-runtime";import{css as k}from"@emotion/react";import{themeVariables as e,isString as x}from"@vef-framework/shared";import{forwardRef as y,useId as C}from"react";import{ResponsiveContainer as b}from"recharts";import{ChartContainerContextProvider as v}from"./hooks/use-chart-container-context.js";const S=k({display:"flex",justifyContent:"center","& .recharts-cartesian-axis-tick text":{fill:e.colorTextDescription},"& .recharts-cartesian-grid line[stroke='#ccc']":{stroke:`color-mix(in srgb, ${e.colorBorder} 50%, transparent)`},"& .recharts-curve.recharts-tooltip-cursor":{stroke:e.colorBorderSecondary},"& .recharts-dot[stroke='#fff']":{stroke:"transparent"},"& .recharts-layer":{outline:"none"},"& .recharts-polar-grid[stroke='#ccc']":{stroke:e.colorBorderSecondary},"& .recharts-radial-bar-background-sector":{fill:e.colorFillContent},"& .recharts-rectangle.recharts-tooltip-cursor":{fill:e.colorFillContent},"& .recharts-reference-line[stroke='#ccc']":{stroke:e.colorBorderSecondary},"& .recharts-sector[stroke='#fff']":{stroke:"transparent"},"& .recharts-sector":{outline:"none"},"& .recharts-surface":{outline:"none"}});function j({id:s,config:i}){const o=Object.entries(i).map(([r,{color:t}])=>[r,t]).filter(([,r])=>x(r));return o.length?c("style",{dangerouslySetInnerHTML:{__html:`
54
3
  [data-chart="${s}"] {
55
4
  ${o.map(([r,t])=>`--vef-color-${r}: ${t};`).join(`
56
5
  `)}
57
6
  }
58
- `}}):null}const a=x(({id:s,className:i,children:o,config:r,aspect:t=16/9,width:l="100%",height:h,minWidth:d,minHeight:f,...m},p)=>{const u=y(),n=`${s||u.replace(/:/g,"")}-chart`;return c(v,{value:{config:r},children:g("div",{ref:p,className:i,css:S,"data-chart":n,...m,children:[c(b,{config:r,id:n}),c(C,{aspect:t,height:h,minHeight:f,minWidth:d,width:l,children:o})]})})});a.displayName="VefChartContainer";export{a as default};
7
+ `}}):null}const a=y(({id:s,className:i,children:o,config:r,aspect:t=16/9,width:l="100%",height:h,minWidth:d,minHeight:f,...m},p)=>{const u=C(),n=`${s||u.replace(/:/g,"")}-chart`;return c(v,{value:{config:r},children:g("div",{ref:p,className:i,css:S,"data-chart":n,...m,children:[c(j,{config:r,id:n}),c(b,{aspect:t,height:h,minHeight:f,minWidth:d,width:l,children:o})]})})});a.displayName="VefChartContainer";export{a as default};
@@ -1,17 +1,2 @@
1
1
  "use strict";
2
- import{jsx as s,jsxs as c}from"@emotion/react/jsx-runtime";import{css as o}from"@emotion/react";import{styles as f,themeVariables as r}from"@vef-framework/shared";import{forwardRef as g}from"react";import"../internal/index.js";import{useChartContainerContextSelector as p}from"../vef-chart-container/hooks/use-chart-container-context.js";import{getPayloadConfigFromPayload as u}from"../internal/chart.js";const h=o`
3
- ${f.flexCenter}
4
- gap: ${r.margin};
5
- padding-top: ${r.marginSm};
6
- `,C=o`
7
- display: flex;
8
- align-items: center;
9
- gap: ${r.marginXs};
10
- color: ${r.colorTextLabel};
11
- `,y=o`
12
- flex: none;
13
- width: 0.75rem;
14
- height: 0.75rem;
15
- border-radius: ${r.borderRadiusXs};
16
- background-color: var(--vef-indicator-color);
17
- `,a=g(({className:i,payload:t},l)=>{const n=p(e=>e.config);return t?.length?s("div",{ref:l,className:i,css:h,children:t.map(e=>{const d=`${e.dataKey||"value"}`,m=u(e,d,n);return c("div",{css:C,children:[s("div",{css:y,style:{"--vef-indicator-color":e.color}}),m?.label]},e.value)})}):null});a.displayName="VefChartLegendContent";export{a as VefChartLegendContent,a as default};
2
+ import{jsx as s,jsxs as c}from"@emotion/react/jsx-runtime";import{css as o}from"@emotion/react";import{styles as f,themeVariables as r}from"@vef-framework/shared";import{forwardRef as g}from"react";import"../internal/index.js";import{useChartContainerContextSelector as p}from"../vef-chart-container/hooks/use-chart-container-context.js";import{getPayloadConfigFromPayload as u}from"../internal/chart.js";const C=o(f.flexCenter,{gap:r.margin,paddingTop:r.marginSm}),h=o({display:"flex",alignItems:"center",gap:r.marginXs,color:r.colorTextLabel}),y=o({flex:"none",width:"0.75rem",height:"0.75rem",borderRadius:r.borderRadiusXs,backgroundColor:"var(--vef-indicator-color)"}),a=g(({className:l,payload:t},n)=>{const i=p(e=>e.config);return t?.length?s("div",{ref:n,className:l,css:C,children:t.map(e=>{const d=`${e.dataKey||"value"}`,m=u(e,d,i);return c("div",{css:h,children:[s("div",{css:y,style:{"--vef-indicator-color":e.color}}),m?.label]},e.value)})}):null});a.displayName="VefChartLegendContent";export{a as VefChartLegendContent,a as default};
@@ -1,43 +1,2 @@
1
1
  "use strict";
2
- import{jsx as l,jsxs as m,Fragment as S}from"@emotion/react/jsx-runtime";import{css as a}from"@emotion/react";import{themeVariables as r,isString as F,isFunction as h,isNullish as N}from"@vef-framework/shared";import{forwardRef as X,useMemo as K}from"react";import"../internal/index.js";import{useChartContainerContextSelector as L}from"../vef-chart-container/hooks/use-chart-container-context.js";import{getPayloadConfigFromPayload as b}from"../internal/chart.js";const R=a`
3
- display: grid;
4
- min-width: 10rem;
5
- align-items: start;
6
- gap: ${r.marginXs};
7
- border-radius: ${r.borderRadius};
8
- border: ${r.lineWidth} ${r.lineType} ${r.colorBorderSecondary};
9
- background: ${r.colorBgContainer};
10
- padding: ${r.paddingXs} ${r.paddingSm};
11
- box-shadow: ${r.boxShadowSecondary};
12
- color: ${r.colorTextLabel}
13
- `,j=a`
14
- display: grid;
15
- gap: ${r.marginXs};
16
- `,B=a`
17
- font-weight: 500;
18
- `,P=a`
19
- display: flex;
20
- width: 100%;
21
- flex-wrap: wrap;
22
- align-items: center;
23
- gap: ${r.marginXs};
24
- `,T=a`
25
- height: 0.75rem;
26
- width: 0.75rem;
27
- flex: none;
28
- border-radius: ${r.borderRadiusXs};
29
- border-color: var(--vef-indicator-color);
30
- background-color: var(--vef-indicator-color);
31
- `,k=a`
32
- display: flex;
33
- flex: 1;
34
- justify-content: space-between;
35
- align-items: center;
36
- gap: ${r.marginXs};
37
- line-height: 1;
38
- `,D=a`
39
- color: ${r.colorTextDescription};
40
- `,M=a`
41
- font-weight: 500;
42
- font-family: ${r.fontFamilyCode};
43
- `,W=X(({active:v,payload:i,className:y,label:n,labelFormatter:t,labelClassName:g,formatter:p,valueFormatter:f,color:$,hideLabel:u=!1},x)=>{const s=L(e=>e.config),w=K(()=>{if(u||!i?.length)return null;const[e]=i,d=`${e.dataKey||e.name||"value"}`,c=b(e,d,s),o=F(n)?n:c?.label;return o?l("div",{className:g,css:B,children:h(t)?t(o,i):o}):null},[u,i,s,n,g,t]);return!v||!i?.length?null:m("div",{ref:x,className:y,css:R,children:[w,l("div",{css:j,children:i.map((e,d)=>{const c=`${e.name||e.dataKey||"value"}`,o=b(e,c,s),C=$||e.payload.fill||e.color;return l("div",{css:P,children:p&&!N(e?.value)&&e.name?p(e.value,e.name,e,d,e.payload):m(S,{children:[l("div",{css:T,style:{"--vef-indicator-color":C}}),m("div",{css:k,children:[l("span",{css:D,children:o?.label||e.name}),e.value&&l("span",{css:M,children:h(f)?f(e.value):e.value.toLocaleString()})]})]})},e.dataKey)})})]})});export{W as default};
2
+ import{jsx as i,jsxs as m,Fragment as F}from"@emotion/react/jsx-runtime";import{css as a}from"@emotion/react";import{themeVariables as r,isString as $,isFunction as h,isNullish as R}from"@vef-framework/shared";import{forwardRef as X,useMemo as N}from"react";import"../internal/index.js";import{useChartContainerContextSelector as W}from"../vef-chart-container/hooks/use-chart-container-context.js";import{getPayloadConfigFromPayload as v}from"../internal/chart.js";const I=a({display:"grid",minWidth:"10rem",alignItems:"start",gap:r.marginXs,borderRadius:r.borderRadius,border:`${r.lineWidth} ${r.lineType} ${r.colorBorderSecondary}`,background:r.colorBgContainer,padding:`${r.paddingXs} ${r.paddingSm}`,boxShadow:r.boxShadowSecondary,color:r.colorTextLabel}),K=a({display:"grid",gap:r.marginXs}),L=a({fontWeight:500}),j=a({display:"flex",width:"100%",flexWrap:"wrap",alignItems:"center",gap:r.marginXs}),k=a({height:"0.75rem",width:"0.75rem",flex:"none",borderRadius:r.borderRadiusXs,borderColor:"var(--vef-indicator-color)",backgroundColor:"var(--vef-indicator-color)"}),B=a({display:"flex",flex:1,justifyContent:"space-between",alignItems:"center",gap:r.marginXs,lineHeight:1}),P=a({color:r.colorTextDescription}),T=a({fontWeight:500,fontFamily:r.fontFamilyCode}),D=X(({active:b,payload:l,className:y,label:n,labelFormatter:t,labelClassName:g,formatter:p,valueFormatter:f,color:x,hideLabel:u=!1},C)=>{const s=W(e=>e.config),w=N(()=>{if(u||!l?.length)return null;const[e]=l,d=`${e.dataKey||e.name||"value"}`,c=v(e,d,s),o=$(n)?n:c?.label;return o?i("div",{className:g,css:L,children:h(t)?t(o,l):o}):null},[u,l,s,n,g,t]);return!b||!l?.length?null:m("div",{ref:C,className:y,css:I,children:[w,i("div",{css:K,children:l.map((e,d)=>{const c=`${e.name||e.dataKey||"value"}`,o=v(e,c,s),S=x||e.payload.fill||e.color;return i("div",{css:j,children:p&&!R(e?.value)&&e.name?p(e.value,e.name,e,d,e.payload):m(F,{children:[i("div",{css:k,style:{"--vef-indicator-color":S}}),m("div",{css:B,children:[i("span",{css:P,children:o?.label||e.name}),e.value&&i("span",{css:T,children:h(f)?f(e.value):e.value.toLocaleString()})]})]})},e.dataKey)})})]})});export{D as default};
@@ -1,4 +1,2 @@
1
1
  "use strict";
2
- import{jsx as e}from"@emotion/react/jsx-runtime";import{css as M}from"@emotion/react";import{themeVariables as N,isFunction as p}from"@vef-framework/shared";import{Checkbox as l}from"antd";import{useMemo as h,memo as O,forwardRef as R}from"react";import $ from"../vef-loading-placeholder/index.js";import j from"../vef-tooltip/index.js";import{useCheckboxInstance as w}from"./hooks/use-checkbox-instance.js";import{useDataOptions as z}from"./hooks/use-data-options.js";const{Group:D}=l,E=e("div",{css:M`
3
- height: ${N.controlHeight}
4
- `,children:e($,{})});function F({defaultValue:v,value:n,disabled:C,renderCheckboxes:t,onChange:r,...g},x){const{optionsMap:m,normalizedOptions:a,isLoading:s}=z({value:n,onChange:r,...g}),k=w(x,a),V=h(()=>{if(p(r))return o=>{r(o,o.map(d=>m.get(d)))}},[r,m]),y=h(()=>{if(s)return;const o=a.map(d=>{const{value:i,label:u,disabled:c,description:f}=d;return f?e(j,{content:f,children:e(l,{disabled:c,value:i,children:u})},i):e(l,{disabled:c,value:i,children:u},i)});return p(t)?t(o):o},[s,a,t]);return s?E:e(D,{ref:k,defaultValue:v,disabled:C,onChange:V,...n===void 0?{}:{value:n},children:y})}const b=O(R(F));b.displayName="VefCheckbox";export{b as default};
2
+ import{jsx as e}from"@emotion/react/jsx-runtime";import{themeVariables as D,isFunction as p}from"@vef-framework/shared";import{Checkbox as l}from"antd";import{useMemo as h,memo as M,forwardRef as N}from"react";import O from"../vef-loading-placeholder/index.js";import R from"../vef-tooltip/index.js";import{useCheckboxInstance as j}from"./hooks/use-checkbox-instance.js";import{useDataOptions as w}from"./hooks/use-data-options.js";const{Group:z}=l,F=e("div",{css:{height:D.controlHeight},children:e(O,{})});function G({defaultValue:v,value:t,disabled:C,renderCheckboxes:n,onChange:r,...g},x){const{optionsMap:m,normalizedOptions:a,isLoading:s}=w({value:t,onChange:r,...g}),k=j(x,a),V=h(()=>{if(p(r))return o=>{r(o,o.map(d=>m.get(d)))}},[r,m]),y=h(()=>{if(s)return;const o=a.map(d=>{const{value:i,label:u,disabled:c,description:f}=d;return f?e(R,{content:f,children:e(l,{disabled:c,value:i,children:u})},i):e(l,{disabled:c,value:i,children:u},i)});return p(n)?n(o):o},[s,a,n]);return s?F:e(z,{ref:k,defaultValue:v,disabled:C,onChange:V,...t===void 0?{}:{value:t},children:y})}const b=M(N(G));b.displayName="VefCheckbox";export{b as default};
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  import{css as o}from"@emotion/react";import{themeVariables as e}from"@vef-framework/shared";import r from"../internal/modern-normalize.css.js";const t=o`
3
3
  ${r}
4
-
4
+
5
5
  html, body, #root, .vef-app {
6
6
  height: 100%;
7
+ overflow: hidden;
7
8
  }
8
9
 
9
10
  h1,
@@ -1,6 +1,2 @@
1
1
  "use strict";
2
- import{jsx as o,jsxs as g}from"@emotion/react/jsx-runtime";import C from"@emotion/cache";import{CacheProvider as y,Global as A,css as v}from"@emotion/react";import{AuthContextProvider as x,ApiContextProvider as P}from"@vef-framework/core";import{ConfigProvider as m,App as l}from"antd";import{useLayoutEffect as k}from"react";import{ErrorBoundary as D}from"react-error-boundary";import S from"../vef-error/index.js";import{globalStyle as E,nprogressStyle as F}from"./global-style.js";import{useUiConfig as R}from"./hooks/use-ui-config.js";import{useConfigStore as T,ConfigStoreProvider as U}from"./store.js";function b({children:t}){const i=T(e=>e),r=R(i);k(()=>{const{messageFoldThreshold:e,messageDuration:d,notificationFoldThreshold:p,notificationDuration:u,...h}=r;m.config({holderRender:f=>o(m,{...h,children:o(l,{component:"div",message:{maxCount:e,duration:d},notification:{maxCount:p,duration:u,showProgress:!0,pauseOnHover:!0,placement:"topRight",stack:{threshold:3}},children:f})})}),document.documentElement.style.setProperty("--vef-color-primary",r.theme?.token?.colorPrimary??null)},[r]);const{messageFoldThreshold:n,messageDuration:s,notificationDuration:a,...c}=r;return o(m,{...c,children:o(l,{component:"div",message:{maxCount:n,duration:s},notification:{maxCount:n,duration:a,showProgress:!0,pauseOnHover:!0,placement:"topRight",stack:{threshold:3}},children:t})})}function w({error:t,resetErrorBoundary:i}){return o(S,{error:t,reset:i})}const $=C({key:"vef"});function j({apiClient:t,dataDictionaryApi:i,loginApi:r,logoutApi:n,fetchAuthenticatedUserApi:s,permissionChecker:a,children:c,...e}){return o(x,{permissionChecker:a,children:o(P,{client:t,dataDictionaryApi:i,fetchAuthenticatedUserApi:s,loginApi:r,logoutApi:n,children:o(U,{initialState:e,children:g(y,{value:$,children:[o(A,{styles:[E,F,v`
3
- :root {
4
- font-size: ${(e.fontSize??"medium")==="medium"?"14px":"16px"};
5
- }
6
- `]}),o(b,{children:o(D,{FallbackComponent:w,children:c})})]})})})})}export{j as default};
2
+ import{jsx as o,jsxs as g}from"@emotion/react/jsx-runtime";import C from"@emotion/cache";import{CacheProvider as y,Global as A,css as v}from"@emotion/react";import{AuthContextProvider as x,ApiContextProvider as P}from"@vef-framework/core";import{ConfigProvider as m,App as l}from"antd";import{useLayoutEffect as k}from"react";import{ErrorBoundary as S}from"react-error-boundary";import D from"../vef-error/index.js";import{globalStyle as E,nprogressStyle as F}from"./global-style.js";import{useUiConfig as R}from"./hooks/use-ui-config.js";import{useConfigStore as T,ConfigStoreProvider as U}from"./store.js";function b({children:t}){const i=T(e=>e),r=R(i);k(()=>{const{messageFoldThreshold:e,messageDuration:d,notificationFoldThreshold:p,notificationDuration:u,...h}=r;m.config({holderRender:f=>o(m,{...h,children:o(l,{component:"div",message:{maxCount:e,duration:d},notification:{maxCount:p,duration:u,showProgress:!0,pauseOnHover:!0,placement:"topRight",stack:{threshold:3}},children:f})})}),document.documentElement.style.setProperty("--vef-color-primary",r.theme?.token?.colorPrimary??null)},[r]);const{messageFoldThreshold:n,messageDuration:s,notificationDuration:a,...c}=r;return o(m,{...c,children:o(l,{component:"div",message:{maxCount:n,duration:s},notification:{maxCount:n,duration:a,showProgress:!0,pauseOnHover:!0,placement:"topRight",stack:{threshold:3}},children:t})})}function w({error:t,resetErrorBoundary:i}){return o(D,{error:t,reset:i})}const j=C({key:"vef"});function z({apiClient:t,dataDictionaryApi:i,loginApi:r,logoutApi:n,fetchAuthenticatedUserApi:s,permissionChecker:a,children:c,...e}){return o(x,{permissionChecker:a,children:o(P,{client:t,dataDictionaryApi:i,fetchAuthenticatedUserApi:s,loginApi:r,logoutApi:n,children:o(U,{initialState:e,children:g(y,{value:j,children:[o(A,{styles:[E,F,v({":root":{fontSize:(e.fontSize??"medium")==="medium"?"14px":"16px"}})]}),o(b,{children:o(S,{FallbackComponent:w,children:c})})]})})})})}export{z as default};
@@ -1,8 +1,2 @@
1
1
  "use strict";
2
- import{jsx as e,jsxs as i,Fragment as v}from"@emotion/react/jsx-runtime";import{css as S}from"@emotion/react";import{useApiContext as I}from"@vef-framework/core";import{DisabledContextProvider as j}from"@vef-framework/hooks";import{themeVariables as w,isNullish as D,showSuccessMessage as R,isFunction as K}from"@vef-framework/shared";import{Trash2Icon as P}from"lucide-react";import{useMemo as n,useCallback as V,memo as _}from"react";import $ from"../../vef-action-buttons/index.js";import q from"../../vef-button/index.js";import z from"../../vef-divider/index.js";import B from"../../vef-flex/index.js";import H from"../../vef-icon/index.js";import b from"../../vef-text/index.js";import{useCrudContext as N}from"../hooks/use-crud-context.js";import{useCrudStore as T}from"../store.js";const E=S`
3
- height: 100%;
4
- display: flex;
5
- justify-content: space-between;
6
- align-items: center;
7
- padding: ${w.padding};
8
- `;function G({tableApi:g,tableApiParams:m,batchDeletionApi:r,batchActionButtons:s,selectionSummary:c}){const{useApiMutation:y,stubMutationApi:C}=I(),a=y(r??C),[l,d,p]=T(t=>[t.selectedInfo,t.confirmedFilterValues,t.setSelectedInfo]),{selectedKeys:u,selectedRecords:o}=l,x=n(()=>D(r)?s??[]:[...s??[],{key:"_batchDeletion",label:"批量删除",icon:e(H,{children:e(P,{})}),color:"error",permissions:[r.key],requireConfirmation:!0,confirmationMode:"detailed",onClick:async({refetch:t})=>{const{message:F}=await a.mutate(o);R(F),t()}}],[s,r,a,o]),f=N(),A=n(()=>({...f,...l}),[f,l]),M=g.useIsFetching(n(()=>({...m,...d}),[m,d])),k=V(()=>{p({selectedKeys:[],selectedRecords:[]})},[p]),h=n(()=>{if(K(c))return c(o)},[o,c]);return u.length===0?null:i("div",{css:E,children:[i(b,{color:"secondary",children:["已选择"," ",e(b,{bold:!0,color:"primary",children:u.length})," ","项",h&&i(v,{children:[e(z,{orientation:"vertical"}),h]})]}),e(j,{value:M,children:i(B,{align:"center",gap:"medium",children:[e(q,{color:"primary",variant:"text",onClick:k,children:"取消选择"}),e($,{buttons:x,context:A,useFlexContainer:!1})]})})]})}const J=_(G);export{J as default};
2
+ import{jsx as e,jsxs as i,Fragment as v}from"@emotion/react/jsx-runtime";import{css as I}from"@emotion/react";import{useApiContext as S}from"@vef-framework/core";import{DisabledContextProvider as j}from"@vef-framework/hooks";import{themeVariables as w,isNullish as D,isFunction as R}from"@vef-framework/shared";import{Trash2Icon as K}from"lucide-react";import{useMemo as n,useCallback as P,memo as V}from"react";import"../../helpers/index.js";import _ from"../../vef-action-buttons/index.js";import $ from"../../vef-button/index.js";import q from"../../vef-divider/index.js";import z from"../../vef-flex/index.js";import B from"../../vef-icon/index.js";import b from"../../vef-text/index.js";import{useCrudContext as E}from"../hooks/use-crud-context.js";import{useCrudStore as H}from"../store.js";import{showSuccessMessage as N}from"../../helpers/message.js";const T=I({height:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",padding:w.padding});function G({tableApi:g,tableApiParams:l,batchDeletionApi:r,batchActionButtons:s,selectionSummary:m}){const{useApiMutation:C,stubMutationApi:y}=S(),a=C(r??y),[c,d,p]=H(t=>[t.selectedInfo,t.confirmedFilterValues,t.setSelectedInfo]),{selectedKeys:u,selectedRecords:o}=c,x=n(()=>D(r)?s??[]:[...s??[],{key:"_batchDeletion",label:"批量删除",icon:e(B,{children:e(K,{})}),color:"error",permissions:[r.key],requireConfirmation:!0,confirmationMode:"detailed",onClick:async({refetch:t})=>{const{message:F}=await a.mutate(o);N(F),t()}}],[s,r,a,o]),f=E(),A=n(()=>({...f,...c}),[f,c]),M=g.useIsFetching(n(()=>({...l,...d}),[l,d])),k=P(()=>{p({selectedKeys:[],selectedRecords:[]})},[p]),h=n(()=>{if(R(m))return m(o)},[o,m]);return u.length===0?null:i("div",{css:T,children:[i(b,{color:"secondary",children:["已选择"," ",e(b,{bold:!0,color:"primary",children:u.length})," ","项",h&&i(v,{children:[e(q,{orientation:"vertical"}),h]})]}),e(j,{value:M,children:i(z,{align:"center",gap:"medium",children:[e($,{color:"primary",variant:"text",onClick:k,children:"取消选择"}),e(_,{buttons:x,context:A,useFlexContainer:!1})]})})]})}const J=V(G);export{J as default};
@@ -1,2 +1,2 @@
1
1
  "use strict";
2
- import{jsx as c}from"@emotion/react/jsx-runtime";import{creationFormScene as o}from"@vef-framework/shared";import{PlusIcon as n}from"lucide-react";import{useMemo as f}from"react";import p from"../../vef-icon/index.js";import{useCrudStore as u}from"../store.js";function l(e){const t=u(r=>r.formApiKeys),m=Reflect.has(t,o),i=Reflect.get(t,o);return f(()=>m?[...e??[],{label:"创建",key:`_${o}`,icon:c(p,{children:c(n,{})}),color:"primary",permissions:[i],onClick:({openForm:r,refetch:s})=>r({scene:o,title:"创建",onSubmitSuccess:()=>{s()}})}]:e??[],[m,e,i])}export{l as useActionButtons};
2
+ import{jsx as c}from"@emotion/react/jsx-runtime";import{creationFormScene as o}from"@vef-framework/shared";import{PlusIcon as n}from"lucide-react";import{useMemo as p}from"react";import f from"../../vef-icon/index.js";import{useCrudStore as u}from"../store.js";function l(e){const t=u(r=>r.formApiKeys),m=Reflect.has(t,o),i=Reflect.get(t,o);return p(()=>m?[...e??[],{label:"创建",key:`_${o}`,icon:c(f,{children:c(n,{})}),color:"primary",permissions:[i],onClick:({openForm:r,refetch:s})=>r({scene:o,title:"创建",onSubmitSuccess:()=>{s()}})}]:e??[],[m,e,i])}export{l as useActionButtons};
@@ -1,2 +1,2 @@
1
1
  "use strict";
2
- import{jsx as o}from"@emotion/react/jsx-runtime";import{useApiContext as d}from"@vef-framework/core";import{updateFormScene as u,showSuccessMessage as h}from"@vef-framework/shared";import{PencilIcon as y,TrashIcon as C}from"lucide-react";import{useMemo as M}from"react";import a from"../../vef-icon/index.js";import{useCrudStore as S}from"../store.js";function b(r,s){const{useApiMutation:p,stubMutationApi:l}=d(),c=p(r??l),f=S(e=>e.formApiKeys),m=Reflect.has(f,u);return M(()=>{const e=[...s??[]];return m&&e.push({key:"_update",label:"编辑",icon:o(a,{children:o(y,{})}),color:"primary",onClick:({record:t,openForm:i,refetch:n})=>{i({scene:u,title:"编辑",initialValues:t,onSubmitSuccess:()=>{n()}})}}),r&&e.push({key:"_deletion",label:"删除",icon:o(a,{children:o(C,{})}),color:"error",requireConfirmation:!0,confirmationMode:"simple",onClick:async({record:t,refetch:i})=>{const{message:n}=await c.mutate(t);h(n),i()}}),e},[r,c,s,m])}export{b as useOperationButtons};
2
+ import{jsx as e}from"@emotion/react/jsx-runtime";import{useApiContext as d}from"@vef-framework/core";import{updateFormScene as u}from"@vef-framework/shared";import{PencilIcon as h,TrashIcon as y}from"lucide-react";import{useMemo as C}from"react";import"../../helpers/index.js";import p from"../../vef-icon/index.js";import{useCrudStore as M}from"../store.js";import{showSuccessMessage as S}from"../../helpers/message.js";function b(r,n){const{useApiMutation:a,stubMutationApi:l}=d(),c=a(r??l),f=M(o=>o.formApiKeys),m=Reflect.has(f,u);return C(()=>{const o=[...n??[]];return m&&o.push({key:"_update",label:"编辑",icon:e(p,{children:e(h,{})}),color:"primary",onClick:({record:t,openForm:i,refetch:s})=>{i({scene:u,title:"编辑",initialValues:t,onSubmitSuccess:()=>{s()}})}}),r&&o.push({key:"_deletion",label:"删除",icon:e(p,{children:e(y,{})}),color:"error",requireConfirmation:!0,confirmationMode:"simple",onClick:async({record:t,refetch:i})=>{const{message:s}=await c.mutate(t);S(s),i()}}),o},[r,c,n,m])}export{b as useOperationButtons};
@@ -1,2 +1,2 @@
1
1
  "use strict";
2
- import{createComponentStore as C,creationFormScene as K,isNullish as B,isFunction as t,mergeFns as L,showSuccessMessage as H,showSuccessAlert as E,invokeMaybeAsyncFn as T}from"@vef-framework/shared";const{StoreProvider:D,useStore:M,useStoreApi:P}=C("Crud",({filterValueAsDefaultKeys:u,formApiKeys:f,onFormOpen:p,onBeforeSubmit:V,onSubmitSuccess:b})=>(r,I)=>({onFormOpen:p,onBeforeSubmit:V,onSubmitSuccess:b,currentFormInfo:{scene:K,title:"创建",width:"medium"},currentFormEventHandlers:{},currentFormInitialValues:{},isFormOpen:!1,openForm:async({initialValues:s,width:g,onBeforeSubmit:c,onSubmitSuccess:l,showSuccessTip:y=!0,successTipType:w="message",...a})=>{const{filterValues:m,onFormOpen:i,closeForm:A,onBeforeSubmit:F,onSubmitSuccess:d,setIsFormLoading:h}=I(),S={...u.reduce((e,n)=>{const o=m[n];return B(o)||(e[n]=o),e},{}),...s},v=t(c)||t(F)?async(e,n)=>{const o=await c?.(e,n);return await F?.(o??e,n)??o}:void 0,O=t(l)||t(d)?L(({message:e})=>{y&&(w==="message"?H(e):E(e)),A()},l,d):void 0;r({isFormOpen:!0,currentFormInfo:{...a,width:g??"medium"},currentFormEventHandlers:{onBeforeSubmit:v,onSubmitSuccess:O},isFormLoading:!!i}),i?await T(i,{onSuccess:e=>{r({currentFormInitialValues:e})},onFinally:()=>{h(!1)}},S,m,a.scene):r({currentFormInitialValues:S})},closeForm:()=>{r({isFormOpen:!1,currentFormInitialValues:{},currentFormEventHandlers:{}})},isFormLoading:!1,setIsFormLoading:s=>{r({isFormLoading:s})},filterValueAsDefaultKeys:u,filterValues:{},setFilterValues:s=>{r({filterValues:s})},confirmedFilterValues:null,setConfirmedFilterValues:s=>{r({confirmedFilterValues:s})},selectedInfo:{selectedKeys:[],selectedRecords:[]},setSelectedInfo:s=>{r({selectedInfo:s})},formApiKeys:f,tableInstanceRef:{current:null}}));export{D as CrudStoreProvider,M as useCrudStore,P as useCrudStoreApi};
2
+ import{createComponentStore as C,creationFormScene as K,isNullish as B,isFunction as t,mergeFns as L,invokeMaybeAsyncFn as H}from"@vef-framework/shared";import"../helpers/index.js";import{showSuccessMessage as E,showSuccessAlert as T}from"../helpers/message.js";const{StoreProvider:D,useStore:M,useStoreApi:P}=C("Crud",({filterValueAsDefaultKeys:u,formApiKeys:f,onFormOpen:p,onBeforeSubmit:V,onSubmitSuccess:b})=>(s,I)=>({onFormOpen:p,onBeforeSubmit:V,onSubmitSuccess:b,currentFormInfo:{scene:K,title:"创建",width:"medium"},currentFormEventHandlers:{},currentFormInitialValues:{},isFormOpen:!1,openForm:async({initialValues:r,width:g,onBeforeSubmit:c,onSubmitSuccess:l,showSuccessTip:y=!0,successTipType:w="message",...m})=>{const{filterValues:a,onFormOpen:i,closeForm:A,onBeforeSubmit:F,onSubmitSuccess:d,setIsFormLoading:h}=I(),S={...u.reduce((e,o)=>{const n=a[o];return B(n)||(e[o]=n),e},{}),...r},v=t(c)||t(F)?async(e,o)=>{const n=await c?.(e,o);return await F?.(n??e,o)??n}:void 0,O=t(l)||t(d)?L(({message:e})=>{y&&(w==="message"?E(e):T(e)),A()},l,d):void 0;s({isFormOpen:!0,currentFormInfo:{...m,width:g??"medium"},currentFormEventHandlers:{onBeforeSubmit:v,onSubmitSuccess:O},isFormLoading:!!i}),i?await H(i,{onSuccess:e=>{s({currentFormInitialValues:e})},onFinally:()=>{h(!1)}},S,a,m.scene):s({currentFormInitialValues:S})},closeForm:()=>{s({isFormOpen:!1,currentFormInitialValues:{},currentFormEventHandlers:{}})},isFormLoading:!1,setIsFormLoading:r=>{s({isFormLoading:r})},filterValueAsDefaultKeys:u,filterValues:{},setFilterValues:r=>{s({filterValues:r})},confirmedFilterValues:null,setConfirmedFilterValues:r=>{s({confirmedFilterValues:r})},selectedInfo:{selectedKeys:[],selectedRecords:[]},setSelectedInfo:r=>{s({selectedInfo:r})},formApiKeys:f,tableInstanceRef:{current:null}}));export{D as CrudStoreProvider,M as useCrudStore,P as useCrudStoreApi};
@@ -1,9 +1,2 @@
1
1
  "use strict";
2
- import{jsx as r,jsxs as N,Fragment as Y}from"@emotion/react/jsx-runtime";import{css as Z}from"@emotion/react";import{themeVariables as G,isFunction as x}from"@vef-framework/shared";import{Drawer as H}from"antd";import{useMemo as y,useState as B,useLayoutEffect as J,useCallback as D,memo as K}from"react";import Q from"./components/cancel-action-button.js";import R from"./components/ok-action-button.js";import{DrawerContextProvider as U}from"./context.js";import{default as de}from"./components/action-button-wrapper.js";const X=Z`
3
- .vef-drawer-footer {
4
- display: flex;
5
- gap: ${G.padding};
6
- justify-content: flex-end;
7
- align-items: center;
8
- }
9
- `,i={narrow:"25",half:"50",wide:"75",full:"100"};function _({title:A,open:a,closable:j=!0,closeOnEscPress:v=!0,closeOnMaskClick:E=!1,destroyOnClose:S=!1,placement:s="right",expansionSize:e,extra:I,showCancelButton:h=!0,cancelButtonText:g="取消",okButtonText:w="提交",actions:l,loading:c,cancelOnClose:O=!0,onClose:k,onCancel:n,onOk:F,onAfterOpen:d,onAfterClose:f,children:L}){const M=y(()=>e==="small"?{size:"default"}:e==="medium"?{size:"large"}:s==="left"||s==="right"?{width:i[e]?`${i[e]}vw`:e}:{height:i[e]?`${i[e]}vh`:e},[e,s]),[m,u]=B({isFullyOpened:!1,isFullyClosed:!1}),[p,P]=B(!1),T=y(()=>({isDisabled:p,setIsDisabled:P,...m}),[p,m]),b=c||p;J(()=>{a&&m.isFullyClosed&&u(o=>({...o,isFullyClosed:!1}))},[a]);const V=y(()=>{const o=r(Q,{text:g,onClick:n},"cancelActionButton"),t=r(R,{text:w,onClick:F},"okActionButton");return x(l)?l([o,t]):l||(h?N(Y,{children:[o,t]}):t)},[l,g,w,n,F,h]),W=D(()=>{b||(O&&n?.(),k?.())},[O,b,n,k]),$=D(o=>{const t=x(d),q=x(f);o?(t&&d(),u(C=>({...C,isFullyOpened:!0}))):(q&&f(),u(C=>({...C,isFullyClosed:!0})))},[d,f]);return r(U,{value:T,children:r(H,{afterOpenChange:$,closable:j,css:X,destroyOnClose:S,extra:I,footer:!c&&V,keyboard:v,loading:c,maskClosable:E,open:a,placement:s,title:A,zIndex:20,onClose:W,...M,children:L})})}const z=K(_);z.displayName="VefDrawer";export{de as VefDrawerActionButtonWrapper,z as default};
2
+ import{jsx as r,jsxs as N,Fragment as Y}from"@emotion/react/jsx-runtime";import{css as Z}from"@emotion/react";import{themeVariables as G,isFunction as x}from"@vef-framework/shared";import{Drawer as H}from"antd";import{useMemo as y,useState as B,useLayoutEffect as J,useCallback as D,memo as K}from"react";import Q from"./components/cancel-action-button.js";import R from"./components/ok-action-button.js";import{DrawerContextProvider as U}from"./context.js";import{default as de}from"./components/action-button-wrapper.js";const X=Z({".vef-drawer-footer":{display:"flex",gap:G.padding,justifyContent:"flex-end",alignItems:"center"}}),i={narrow:"25",half:"50",wide:"75",full:"100"};function _({title:A,open:a,closable:j=!0,closeOnEscPress:v=!0,closeOnMaskClick:E=!1,destroyOnClose:I=!1,placement:l="right",expansionSize:e,extra:L,showCancelButton:h=!0,cancelButtonText:g="取消",okButtonText:w="提交",actions:s,loading:c,cancelOnClose:O=!0,onClose:k,onCancel:n,onOk:F,onAfterOpen:d,onAfterClose:f,children:M}){const P=y(()=>e==="small"?{size:"default"}:e==="medium"?{size:"large"}:l==="left"||l==="right"?{width:i[e]?`${i[e]}vw`:e}:{height:i[e]?`${i[e]}vh`:e},[e,l]),[m,u]=B({isFullyOpened:!1,isFullyClosed:!1}),[p,S]=B(!1),T=y(()=>({isDisabled:p,setIsDisabled:S,...m}),[p,m]),b=c||p;J(()=>{a&&m.isFullyClosed&&u(o=>({...o,isFullyClosed:!1}))},[a]);const V=y(()=>{const o=r(Q,{text:g,onClick:n},"cancelActionButton"),t=r(R,{text:w,onClick:F},"okActionButton");return x(s)?s([o,t]):s||(h?N(Y,{children:[o,t]}):t)},[s,g,w,n,F,h]),W=D(()=>{b||(O&&n?.(),k?.())},[O,b,n,k]),$=D(o=>{const t=x(d),q=x(f);o?(t&&d(),u(C=>({...C,isFullyOpened:!0}))):(q&&f(),u(C=>({...C,isFullyClosed:!0})))},[d,f]);return r(U,{value:T,children:r(H,{afterOpenChange:$,closable:j,css:X,destroyOnClose:I,extra:L,footer:!c&&V,keyboard:v,loading:c,maskClosable:E,open:a,placement:l,title:A,zIndex:20,onClose:W,...P,children:M})})}const z=K(_);z.displayName="VefDrawer";export{de as VefDrawerActionButtonWrapper,z as default};
@@ -1,2 +1,2 @@
1
1
  "use strict";
2
- import{jsx as r}from"@emotion/react/jsx-runtime";import{useThemeTokens as a}from"@vef-framework/hooks";import l from"lucide-react/dynamicIconImports";import{forwardRef as c,lazy as f,Suspense as h}from"react";import d from"../vef-icon/index.js";function p(){const{colorFillContent:e}=a();return r("svg",{"aria-label":"Loading icon",height:"1em",role:"img",viewBox:"0 0 100 100",width:"1em",xmlns:"http://www.w3.org/2000/svg",children:r("rect",{fill:e,height:"100",rx:"20",width:"100"})})}const w=r(p,{}),t=new Map,i=c(({name:e,...o},n)=>{if(!t.has(e)){const s=f(l[e]);t.set(e,s)}const m=t.get(e);return r(d,{ref:n,...o,children:r(h,{fallback:w,children:r(m,{})})})});i.displayName="VefDynamicIcon";export{i as default};
2
+ import{jsx as r}from"@emotion/react/jsx-runtime";import{useThemeTokens as a}from"@vef-framework/hooks";import l from"lucide-react/dynamicIconImports";import{forwardRef as c,lazy as f,Suspense as h}from"react";import p from"../vef-icon/index.js";function d(){const{colorFillContent:e}=a();return r("svg",{"aria-label":"Loading icon",height:"1em",role:"img",viewBox:"0 0 100 100",width:"1em",xmlns:"http://www.w3.org/2000/svg",children:r("rect",{fill:e,height:"100",rx:"20",width:"100"})})}const w=r(d,{}),t=new Map,i=c(({name:e,...o},n)=>{if(!t.has(e)){const s=f(l[e]);t.set(e,s)}const m=t.get(e);return r(p,{ref:n,...o,children:r(h,{fallback:w,children:r(m,{})})})});i.displayName="VefDynamicIcon";export{i as default};
@@ -1,29 +1,2 @@
1
1
  "use strict";
2
- import{jsx as r,jsxs as o,Fragment as c}from"@emotion/react/jsx-runtime";import{css as t}from"@emotion/react";import{styles as l,themeVariables as e}from"@vef-framework/shared";import{RefreshCwIcon as m}from"lucide-react";import a from"../vef-button/index.js";import p from"../vef-icon/index.js";import d from"./error-icon.js";const f=t`
3
- height: 100%;
4
- ${l.flexCenter}
5
- `,h=t`
6
- width: 40%;
7
- position: relative;
8
- top: -60px;
9
- display: flex;
10
- flex-direction: column;
11
- align-items: center;
12
- justify-content: center;
13
- row-gap: ${e.margin};
14
-
15
- > svg {
16
- width: 70%;
17
- }
18
-
19
- > span {
20
- font-size: ${e.fontSizeLg};
21
- font-weight: 500;
22
- color: ${e.colorTextTertiary};
23
-
24
- > span {
25
- padding-left: ${e.paddingSm};
26
- color: ${e.colorErrorText};
27
- }
28
- }
29
- `;function g({error:n,reset:s,componentStack:i}){return r("div",{css:f,children:o("div",{css:h,children:[r(d,{}),o("span",{children:["发生错误:",r("span",{children:n.message}),i&&o(c,{children:["组件堆栈:",r("span",{children:i})]})]}),r(a,{color:"primary",size:"large",icon:r(p,{children:r(m,{})}),onClick:s,children:"重试一下"})]})})}export{g as default};
2
+ import{jsx as r,jsxs as o,Fragment as c}from"@emotion/react/jsx-runtime";import{css as t}from"@emotion/react";import{styles as l,themeVariables as e}from"@vef-framework/shared";import{RefreshCwIcon as m}from"lucide-react";import p from"../vef-button/index.js";import a from"../vef-icon/index.js";import d from"./error-icon.js";const f=t(l.flexCenter,{height:"100%"}),h=t({width:"40%",position:"relative",top:"-60px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",rowGap:e.margin,"> svg":{width:"70%"},"> span":{fontSize:e.fontSizeLg,fontWeight:500,color:e.colorTextTertiary,"> span":{paddingLeft:e.paddingSm,color:e.colorErrorText}}});function g({error:n,reset:s,componentStack:i}){return r("div",{css:f,children:o("div",{css:h,children:[r(d,{}),o("span",{children:["发生错误:",r("span",{children:n.message}),i&&o(c,{children:["组件堆栈:",r("span",{children:i})]})]}),r(p,{color:"primary",size:"large",icon:r(a,{children:r(m,{})}),onClick:s,children:"重试一下"})]})})}export{g as default};
@@ -1,20 +1,2 @@
1
1
  "use strict";
2
- import{jsx as i,jsxs as r}from"@emotion/react/jsx-runtime";import{css as k}from"@emotion/react";import{useThemeTokens as B}from"@vef-framework/hooks";import{themeVariables as a,omit as m}from"@vef-framework/shared";import{SearchIcon as C,ChevronDownIcon as w}from"lucide-react";import{motion as l}from"motion/react";import c from"../../vef-button/index.js";import F from"../../vef-flex/index.js";import p from"../../vef-icon/index.js";import{useFilterContextSelector as S}from"../hooks/use-filter-context.js";import{useFilterStore as V}from"../store.js";const $=k`
3
- &.vef-btn {
4
- --vef-button-padding-inline: 0;
5
-
6
- gap: 0;
7
- }
8
-
9
- .vef-collapse-button-text {
10
- position: relative;
11
- width: calc(${a.fontSize} * 2 + 4px);
12
- height: calc(${a.controlHeight} - 4px);
13
- text-align: center;
14
- line-height: calc(${a.controlHeight} - 4px);
15
-
16
- > span {
17
- position: absolute;
18
- }
19
- }
20
- `,A={text:"搜索",icon:i(p,{children:i(C,{})})},H={text:"重置"};function I(){const[d,e,h]=V(t=>[t.isLoading,t.isAdvancedFilterVisible,t.setIsAdvancedFilterVisible]),[f,u,x,g,b,v]=S(t=>[t.externalLoading,t.confirmationButton,t.resetButton,t.showCollapseButton,t.handleReset,t.extraActionButtons]),{controlHeight:y}=B(),s=(y-4)/2,o=u??A,n=x??H;return r(F,{align:"center",gap:"medium",children:[g&&r(c,{color:"primary",css:$,variant:"link",onClick:()=>h(!e),children:[r("span",{className:"vef-collapse-button-text",children:[i(l.span,{initial:!1,animate:{opacity:e?1:0,y:e?0:-s},children:"收起"}),i(l.span,{initial:!1,animate:{opacity:e?0:1,y:e?s:0},children:"展开"})]}),i(l.span,{initial:!1,animate:{rotate:e?-180:0,transition:{bounce:0}},children:i(p,{size:"large",children:i(w,{})})})]}),n&&i(c,{color:"default",variant:"filled",onClick:b,...m(n,["text"]),children:n.text}),o&&i(c,{color:"primary",icon:o.icon,loading:f||d,type:"submit",...m(o,["text"]),children:o.text}),v]})}export{I as default};
2
+ import{jsx as i,jsxs as r}from"@emotion/react/jsx-runtime";import{css as k}from"@emotion/react";import{useThemeTokens as B}from"@vef-framework/hooks";import{themeVariables as a,omit as m}from"@vef-framework/shared";import{SearchIcon as C,ChevronDownIcon as H}from"lucide-react";import{motion as l}from"motion/react";import c from"../../vef-button/index.js";import w from"../../vef-flex/index.js";import p from"../../vef-icon/index.js";import{useFilterContextSelector as A}from"../hooks/use-filter-context.js";import{useFilterStore as F}from"../store.js";const S=k({"&.vef-btn":{"--vef-button-padding-inline":"0",gap:0},".vef-collapse-button-text":{position:"relative",width:`calc(${a.fontSize} * 2 + 4px)`,height:`calc(${a.controlHeight} - 4px)`,textAlign:"center",lineHeight:`calc(${a.controlHeight} - 4px)`,"> span":{position:"absolute"}}}),V={text:"搜索",icon:i(p,{children:i(C,{})})},$={text:"重置"};function I(){const[d,e,h]=F(t=>[t.isLoading,t.isAdvancedFilterVisible,t.setIsAdvancedFilterVisible]),[f,u,x,g,b,v]=A(t=>[t.externalLoading,t.confirmationButton,t.resetButton,t.showCollapseButton,t.handleReset,t.extraActionButtons]),{controlHeight:y}=B(),s=(y-4)/2,o=u??V,n=x??$;return r(w,{align:"center",gap:"medium",children:[g&&r(c,{color:"primary",css:S,variant:"link",onClick:()=>h(!e),children:[r("span",{className:"vef-collapse-button-text",children:[i(l.span,{initial:!1,animate:{opacity:e?1:0,y:e?0:-s},children:"收起"}),i(l.span,{initial:!1,animate:{opacity:e?0:1,y:e?s:0},children:"展开"})]}),i(l.span,{initial:!1,animate:{rotate:e?-180:0,transition:{bounce:0}},children:i(p,{size:"large",children:i(H,{})})})]}),n&&i(c,{color:"default",variant:"filled",onClick:b,...m(n,["text"]),children:n.text}),o&&i(c,{color:"primary",icon:o.icon,loading:f||d,type:"submit",...m(o,["text"]),children:o.text}),v]})}export{I as default};
@@ -1,10 +1,2 @@
1
1
  "use strict";
2
- import{jsx as r}from"@emotion/react/jsx-runtime";import{css as t}from"@emotion/react";import{themeVariables as o}from"@vef-framework/shared";import{motion as h}from"motion/react";import u from"../../vef-responsive-container/index.js";import g from"../../vef-responsive-item/index.js";import{useFilterContextSelector as $}from"../hooks/use-filter-context.js";import{useLabelConfig as y}from"../hooks/use-label-config.js";import x from"./filter-item.js";const a=200,A=t`
3
- overflow: hidden;
4
- `,C=t`
5
- margin-top: ${o.margin};
6
- background-color: ${o.colorFillAlt};
7
- padding: ${o.padding};
8
- border-radius: ${o.borderRadiusLg};
9
- border: ${o.lineWidth} ${o.lineType} ${o.colorBorderSecondary};
10
- `,W={opacity:1,height:"auto",transition:{ease:"easeInOut",duration:.2}},l={opacity:0,height:0};function v({items:n}){const[e,m,s]=$(i=>[i.labelPosition,i.labelAlign,i.labelWidth]),{labelWidthToUse:d,labelCol:p}=y(e,s),c=e==="top"?a:a+(d??80);return r(h.div,{animate:W,css:A,exit:l,initial:l,children:r(u,{baseItemWidth:c,css:C,gap:"large",children:n.map(i=>{const{name:b,span:f}=i;return r(g,{span:f??1,children:r(x,{item:i,labelAlign:m,labelCol:p,layout:e==="top"?"vertical":"horizontal"})},b)})})})}export{v as default};
2
+ import{jsx as r}from"@emotion/react/jsx-runtime";import{css as t}from"@emotion/react";import{themeVariables as o}from"@vef-framework/shared";import{motion as h}from"motion/react";import u from"../../vef-responsive-container/index.js";import g from"../../vef-responsive-item/index.js";import{useFilterContextSelector as C}from"../hooks/use-filter-context.js";import{useLabelConfig as y}from"../hooks/use-label-config.js";import x from"./filter-item.js";const a=200,A=t({overflow:"hidden"}),W=t({marginTop:o.margin,backgroundColor:o.colorFillAlt,padding:o.padding,borderRadius:o.borderRadiusLg,border:`${o.lineWidth} ${o.lineType} ${o.colorBorderSecondary}`}),v={opacity:1,height:"auto",transition:{ease:"easeInOut",duration:.2}},l={opacity:0,height:0};function F({items:n}){const[e,m,s]=C(i=>[i.labelPosition,i.labelAlign,i.labelWidth]),{labelWidthToUse:d,labelCol:p}=y(e,s),c=e==="top"?a:a+(d??80);return r(h.div,{animate:v,css:A,exit:l,initial:l,children:r(u,{baseItemWidth:c,css:W,gap:"large",children:n.map(i=>{const{name:b,span:f}=i;return r(g,{span:f??1,children:r(x,{item:i,labelAlign:m,labelCol:p,layout:e==="top"?"vertical":"horizontal"})},b)})})})}export{F as default};
@@ -1,20 +1,2 @@
1
1
  "use strict";
2
- import{jsxs as s,Fragment as c,jsx as i}from"@emotion/react/jsx-runtime";import{css as o}from"@emotion/react";import{themeVariables as m}from"@vef-framework/shared";import{Form as l}from"antd";import p from"clsx";import d from"./action-buttons.js";import v from"./filter-item.js";const x=o`
3
- &.vef-filter-basic-items-with-prefix {
4
- display: grid;
5
- grid-template-columns: max-content 1fr;
6
- align-items: center;
7
- gap: ${m.margin};
8
- }
9
-
10
- .vef-filter-basic-items-prefix {
11
- }
12
-
13
- &.vef-filter-basic-items-content, .vef-filter-basic-items-content {
14
- display: flex;
15
- flex-wrap: wrap;
16
- align-items: center;
17
- justify-content: flex-end;
18
- gap: ${m.margin};
19
- }
20
- `;function b({items:f,prefix:e}){const n=p({"vef-filter-basic-items-with-prefix":!!e,"vef-filter-basic-items-content":!e}),t=s(c,{children:[f.map(r=>{const{name:a}=r;return i(v,{item:r},a)}),i(l.Item,{children:i(d,{})})]});return s("div",{className:n,css:x,children:[e&&i("div",{className:"vef-filter-basic-items-prefix",children:e}),e?i("div",{className:"vef-filter-basic-items-content",children:t}):t]})}export{b as default};
2
+ import{jsxs as s,Fragment as c,jsx as i}from"@emotion/react/jsx-runtime";import{css as o}from"@emotion/react";import{themeVariables as m}from"@vef-framework/shared";import{Form as l}from"antd";import p from"clsx";import d from"./action-buttons.js";import v from"./filter-item.js";const x=o({"&.vef-filter-basic-items-with-prefix":{display:"grid",gridTemplateColumns:"max-content 1fr",alignItems:"center",gap:m.margin},".vef-filter-basic-items-prefix":{},"&.vef-filter-basic-items-content, .vef-filter-basic-items-content":{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"flex-end",gap:m.margin}});function b({items:f,prefix:e}){const n=p({"vef-filter-basic-items-with-prefix":!!e,"vef-filter-basic-items-content":!e}),t=s(c,{children:[f.map(r=>{const{name:a}=r;return i(v,{item:r},a)}),i(l.Item,{children:i(d,{})})]});return s("div",{className:n,css:x,children:[e&&i("div",{className:"vef-filter-basic-items-prefix",children:e}),e?i("div",{className:"vef-filter-basic-items-content",children:t}):t]})}export{b as default};
@@ -1,2 +1,2 @@
1
1
  "use strict";
2
- import{isFunction as d,omit as F,showWarningMessage as R}from"@vef-framework/shared";import{useCallback as h,useMemo as b}from"react";import{useFilterStore as w}from"../store.js";function S({onBeforeConfirm:s,onConfirm:n,onReset:a}){const[l,t,m,u,f,c,o]=w(e=>[e.form,e.eventBus,e.getValues,e.initialValues,e.invokeValueChangeHandlers,e.virtualFieldNames,e.setIsLoading]),g=h(()=>{const e=m();l.resetFields(),f(),t.emitChange(u),a?.(e)},[t,l,m,u,f,a]),p=b(()=>{if(d(n))return async e=>{o(!0);let i=e;try{d(s)&&(i=await s(i));const r=F(i,c);await n(r),t.emitSubmitResult(!0)}catch(r){throw t.emitSubmitResult(!1),r}finally{o(!1)}}},[s,n,t,o,c]),C=h(({errorFields:e})=>{t.emitSubmitResult(!1),e.length>0&&R(e.flatMap(i=>i.errors).join(", "))},[t]);return{handleReset:g,handleConfirm:p,handleConfirmFailed:C}}export{S as useActionHandlers};
2
+ import{isFunction as d,omit as F}from"@vef-framework/shared";import{useCallback as h,useMemo as R}from"react";import"../../helpers/index.js";import{useFilterStore as b}from"../store.js";import{showWarningMessage as w}from"../../helpers/message.js";function S({onBeforeConfirm:r,onConfirm:o,onReset:a}){const[l,t,m,u,f,c,s]=b(e=>[e.form,e.eventBus,e.getValues,e.initialValues,e.invokeValueChangeHandlers,e.virtualFieldNames,e.setIsLoading]),p=h(()=>{const e=m();l.resetFields(),f(),t.emitChange(u),a?.(e)},[t,l,m,u,f,a]),g=R(()=>{if(d(o))return async e=>{s(!0);let i=e;try{d(r)&&(i=await r(i));const n=F(i,c);await o(n),t.emitSubmitResult(!0)}catch(n){throw t.emitSubmitResult(!1),n}finally{s(!1)}}},[r,o,t,s,c]),C=h(({errorFields:e})=>{t.emitSubmitResult(!1),e.length>0&&w(e.flatMap(i=>i.errors).join(", "))},[t]);return{handleReset:p,handleConfirm:g,handleConfirmFailed:C}}export{S as useActionHandlers};
@@ -1,2 +1,2 @@
1
1
  "use strict";
2
- import{showWarningMessage as r}from"@vef-framework/shared";import{useMemo as i}from"react";function n(o,e){const t=i(()=>{if(!(o==="top"||!e))return(e<60||e>120)&&r("The labelWidth of VefFilter component must be between 60 and 120, otherwise it will be 60 or 120."),Math.min(Math.max(e,60),120)},[o,e]);return{labelCol:i(()=>{if(t)return{flex:`0 0 ${t}px`}},[t]),labelWidthToUse:t}}export{n as useLabelConfig};
2
+ import{useMemo as i}from"react";import"../../helpers/index.js";import{showWarningMessage as r}from"../../helpers/message.js";function n(o,e){const t=i(()=>{if(!(o==="top"||!e))return(e<60||e>120)&&r("The labelWidth of VefFilter component must be between 60 and 120, otherwise it will be 60 or 120."),Math.min(Math.max(e,60),120)},[o,e]);return{labelCol:i(()=>{if(t)return{flex:`0 0 ${t}px`}},[t]),labelWidthToUse:t}}export{n as useLabelConfig};
@@ -1,9 +1,2 @@
1
1
  "use strict";
2
- import{jsx as t,jsxs as E}from"@emotion/react/jsx-runtime";import{css as U}from"@emotion/react";import{useContextDisabled as W,DisabledContextProvider as k,useSingleton as q,useUnmount as M}from"@vef-framework/hooks";import{isDeepEqual as O,omit as g}from"@vef-framework/shared";import{Form as v}from"antd";import{AnimatePresence as T}from"motion/react";import{useMemo as C,forwardRef as b,memo as $}from"react";import"../internal/index.js";import G from"./components/advanced-filter.js";import J from"./components/basic-filter.js";import{FilterEventBus as K}from"./event.js";import{useActionHandlers as Q}from"./hooks/use-action-handlers.js";import{FilterContextProvider as X}from"./hooks/use-filter-context.js";import{useFilterInitialization as Y}from"./hooks/use-filter-initialization.js";import{useFilterInstance as Z}from"./hooks/use-filter-instance.js";import{useFilterItems as _}from"./hooks/use-filter-items.js";import{useFilterValuesChange as ee}from"./hooks/use-filter-values-change.js";import{useFilterStore as ie,FilterStoreProvider as te}from"./store.js";import{convertBasicSizeToUiSize as oe}from"../internal/utils.js";const{useForm:ne}=v,re=U`
3
- display: block;
4
- flex-wrap: unset;
5
-
6
- .vef-form-item {
7
- margin-inline-end: 0;
8
- }
9
- `;function ae({schema:o,labelPosition:e="top",labelAlign:n="right",labelWidth:r,disabled:a=!1,loading:i=!1,size:l,variant:s,prefix:m,confirmationButton:u,resetButton:p,extraActionButtons:h,onBeforeConfirm:x,onConfirm:A,onReset:I,onChange:P},R){const[S,w,z,N]=ie(f=>[f.form,f.initialValues,f.isLoading,f.isAdvancedFilterVisible]),{handleReset:c,handleConfirm:y,handleConfirmFailed:D}=Q({onBeforeConfirm:x,onConfirm:A,onReset:I}),{basicItems:j,advancedItems:d}=_(o),H=C(()=>({labelPosition:e,labelAlign:n,labelWidth:r,confirmationButton:u,externalLoading:i,showCollapseButton:d.length>0,handleReset:c,resetButton:p,extraActionButtons:h}),[d.length,u,h,c,n,e,r,i,p]),{handleValuesChange:L}=ee(P);Z(R,c);const F=W()||a||i||z;return t(v,{colon:!1,css:re,disabled:F,form:S,initialValues:w,layout:"inline",size:oe(l),variant:s,onFinish:y,onFinishFailed:D,onValuesChange:L,children:t(k,{value:F,children:E(X,{value:H,children:[t(J,{items:j,prefix:m}),t(T,{children:N&&d.length>0&&t(G,{items:d})})]})})})}const B=b(ae);B.displayName="VefFilterBase";function le({initialValues:o,...e},n){const{schema:r}=e,[a]=ne(),i=q(()=>new K);M(()=>{i.clear()});const{mergedInitialValues:l,valueChangeHandlers:s,virtualFieldNames:m}=Y(r,o),u=C(()=>({eventBus:i,form:a,initialValues:l,valueChangeHandlers:s,virtualFieldNames:m}),[i,a,l,s,m]);return t(te,{initialState:u,children:t(B,{ref:n,...e})})}const V=$(b(le),(o,e)=>O(g(o,["initialValues","schema"]),g(e,["initialValues","schema"])));V.displayName="VefFilter";export{V as default};
2
+ import{jsx as t,jsxs as L}from"@emotion/react/jsx-runtime";import{css as W}from"@emotion/react";import{useContextDisabled as U,DisabledContextProvider as $,useSingleton as k,useUnmount as q}from"@vef-framework/hooks";import{isDeepEqual as M,omit as g}from"@vef-framework/shared";import{Form as v}from"antd";import{AnimatePresence as O}from"motion/react";import{useMemo as C,forwardRef as b,memo as T}from"react";import"../internal/index.js";import G from"./components/advanced-filter.js";import J from"./components/basic-filter.js";import{FilterEventBus as K}from"./event.js";import{useActionHandlers as Q}from"./hooks/use-action-handlers.js";import{FilterContextProvider as X}from"./hooks/use-filter-context.js";import{useFilterInitialization as Y}from"./hooks/use-filter-initialization.js";import{useFilterInstance as Z}from"./hooks/use-filter-instance.js";import{useFilterItems as _}from"./hooks/use-filter-items.js";import{useFilterValuesChange as ee}from"./hooks/use-filter-values-change.js";import{useFilterStore as ie,FilterStoreProvider as te}from"./store.js";import{convertBasicSizeToUiSize as oe}from"../internal/utils.js";const{useForm:ne}=v,re=W({display:"block",flexWrap:"unset",".vef-form-item":{marginInlineEnd:0}});function ae({schema:o,labelPosition:e="top",labelAlign:n="right",labelWidth:r,disabled:a=!1,loading:i=!1,size:l,variant:s,prefix:m,confirmationButton:u,resetButton:p,extraActionButtons:h,onBeforeConfirm:V,onConfirm:A,onReset:I,onChange:P},R){const[S,z,N,w]=ie(f=>[f.form,f.initialValues,f.isLoading,f.isAdvancedFilterVisible]),{handleReset:c,handleConfirm:y,handleConfirmFailed:D}=Q({onBeforeConfirm:V,onConfirm:A,onReset:I}),{basicItems:j,advancedItems:d}=_(o),E=C(()=>({labelPosition:e,labelAlign:n,labelWidth:r,confirmationButton:u,externalLoading:i,showCollapseButton:d.length>0,handleReset:c,resetButton:p,extraActionButtons:h}),[d.length,u,h,c,n,e,r,i,p]),{handleValuesChange:H}=ee(P);Z(R,c);const F=U()||a||i||N;return t(v,{colon:!1,css:re,disabled:F,form:S,initialValues:z,layout:"inline",size:oe(l),variant:s,onFinish:y,onFinishFailed:D,onValuesChange:H,children:t($,{value:F,children:L(X,{value:E,children:[t(J,{items:j,prefix:m}),t(O,{children:w&&d.length>0&&t(G,{items:d})})]})})})}const B=b(ae);B.displayName="VefFilterBase";function le({initialValues:o,...e},n){const{schema:r}=e,[a]=ne(),i=k(()=>new K);q(()=>{i.clear()});const{mergedInitialValues:l,valueChangeHandlers:s,virtualFieldNames:m}=Y(r,o),u=C(()=>({eventBus:i,form:a,initialValues:l,valueChangeHandlers:s,virtualFieldNames:m}),[i,a,l,s,m]);return t(te,{initialState:u,children:t(B,{ref:n,...e})})}const x=T(b(le),(o,e)=>M(g(o,["initialValues","schema"]),g(e,["initialValues","schema"])));x.displayName="VefFilter";export{x as default};
@@ -1,4 +1,2 @@
1
1
  "use strict";
2
- import{jsx as i,jsxs as a}from"@emotion/react/jsx-runtime";import{CheckOutlined as d}from"@ant-design/icons";import{css as p}from"@emotion/react";import{themeVariables as f,omit as e}from"@vef-framework/shared";import{Form as u}from"antd";import{memo as x}from"react";import m from"../../vef-button/index.js";import h from"../../vef-flex/index.js";import{useFormStore as g}from"../store.js";const{Item:y}=u,b={text:"提交",icon:i(d,{})},j={text:"重置"},B=p`
3
- padding: ${f.padding} 0;
4
- `;function F({submissionButton:t=b,resetButton:o=j,handleReset:n}){const[c,l]=g(r=>[r.isLoading,r.showActionButtons]);return!l||!t&&!o?null:i(y,{children:a(h,{css:B,gap:"medium",justify:"flex-end",children:[o&&i(m,{color:"default",variant:"filled",onClick:n,...e(o,["text"]),children:o.text}),t&&i(m,{color:"primary",loading:c,type:"submit",...e(t,["text"]),children:t.text})]})})}const s=x(F);s.displayName="VefFormActions";export{s as default};
2
+ import{jsx as i,jsxs as a}from"@emotion/react/jsx-runtime";import{CheckOutlined as d}from"@ant-design/icons";import{css as p}from"@emotion/react";import{themeVariables as f,omit as e}from"@vef-framework/shared";import{Form as u}from"antd";import{memo as x}from"react";import m from"../../vef-button/index.js";import h from"../../vef-flex/index.js";import{useFormStore as g}from"../store.js";const{Item:y}=u,b={text:"提交",icon:i(d,{})},j={text:"重置"},B=p({padding:f.padding});function F({submissionButton:t=b,resetButton:o=j,handleReset:n}){const[c,l]=g(r=>[r.isLoading,r.showActionButtons]);return!l||!t&&!o?null:i(y,{children:a(h,{css:B,gap:"medium",justify:"flex-end",children:[o&&i(m,{color:"default",variant:"filled",onClick:n,...e(o,["text"]),children:o.text}),t&&i(m,{color:"primary",loading:c,type:"submit",...e(t,["text"]),children:t.text})]})})}const s=x(F);s.displayName="VefFormActions";export{s as default};
@@ -1,5 +1,2 @@
1
1
  "use strict";
2
- import{jsx as o,jsxs as V,Fragment as C}from"@emotion/react/jsx-runtime";import{css as S}from"@emotion/react";import{debounce as x,styles as j,isDeepEqual as B,omit as $}from"@vef-framework/shared";import{useMemo as y,useRef as F,useState as I,useCallback as R,useEffect as E,memo as M}from"react";import O from"../../vef-empty-placeholder/index.js";import T from"../../vef-flex/index.js";import b from"../../vef-scroll-area/index.js";import w from"../../vef-tabs/index.js";import{useComputedValues as q}from"../hooks/use-computed-values.js";import{useFormStore as A}from"../store.js";import m from"./form-group.js";const D=S`
3
- flex: auto;
4
- min-height: 0;
5
- `;function H({schema:i,showTabs:s,height:c}){const r=q([...i.map(({key:e,title:t})=>({key:`title-${e}`,rawValue:t})),...i.map(({key:e,show:t})=>({key:`show-${e}`,rawValue:t,defaultValue:!0})),...i.map(({key:e,disabled:t})=>({key:`disabled-${e}`,rawValue:t,defaultValue:!1}))],!0),a=y(()=>i.filter(({key:e})=>r[`show-${e}`]),[r,i]),n=F({}),[k,u]=I(a[0]?.key??0),g=R(e=>{n.current[e]?.scrollIntoView({behavior:"smooth",block:"start",inline:"start"}),u(e)},[]),d=y(()=>s!=="navigation"?void 0:x({delay:60},e=>{const{top:t}=e.target.getBoundingClientRect();for(const[l,h]of Object.entries(n.current))if(h){const{top:v}=h.getBoundingClientRect();v-t<=60&&u(l)}}),[s]),[f]=A(e=>[e.setShowActionButtons]);if(E(()=>{f(a.length>0)},[f,a.length]),a.length===0)return o(O,{description:"空表单"});if(s==="switch"){const e=i.map(({key:t,rows:l})=>({key:`${t}`,label:r[`title-${t}`],destroyInactiveTabPane:!1,children:o(m,{disabled:r[`disabled-${t}`],rows:l})}));return o(w,{items:e})}if(s==="navigation")return V(T,{vertical:!0,css:c==="full"?j.fullHeight:void 0,children:[o(w,{activeKey:`${k}`,items:i.map(({key:e})=>({key:`${e}`,label:r[`title-${e}`]})),onChange:g}),o(b,{css:D,onScroll:d,children:i.map(({key:e,rows:t})=>o(m,{ref:l=>{n.current[e]=l},disabled:r[`disabled-${e}`],rows:t,title:r[`title-${e}`]},e))})]});const p=i.map(({key:e,rows:t})=>o(m,{disabled:r[`disabled-${e}`],rows:t,title:r[`title-${e}`]},e));return c==="full"?o(b,{onScroll:d,children:p}):o(C,{children:p})}const K=M(H,(i,s)=>B($(i,["schema"]),$(s,["schema"])));export{K as default};
2
+ import{jsx as o,jsxs as V,Fragment as C}from"@emotion/react/jsx-runtime";import{css as S}from"@emotion/react";import{debounce as x,styles as j,isDeepEqual as B,omit as $}from"@vef-framework/shared";import{useMemo as y,useRef as F,useState as I,useCallback as R,useEffect as E,memo as H}from"react";import M from"../../vef-empty-placeholder/index.js";import O from"../../vef-flex/index.js";import b from"../../vef-scroll-area/index.js";import w from"../../vef-tabs/index.js";import{useComputedValues as T}from"../hooks/use-computed-values.js";import{useFormStore as q}from"../store.js";import m from"./form-group.js";const A=S({flex:"auto",minHeight:0});function D({schema:i,showTabs:s,height:c}){const r=T([...i.map(({key:e,title:t})=>({key:`title-${e}`,rawValue:t})),...i.map(({key:e,show:t})=>({key:`show-${e}`,rawValue:t,defaultValue:!0})),...i.map(({key:e,disabled:t})=>({key:`disabled-${e}`,rawValue:t,defaultValue:!1}))],!0),a=y(()=>i.filter(({key:e})=>r[`show-${e}`]),[r,i]),n=F({}),[k,u]=I(a[0]?.key??0),g=R(e=>{n.current[e]?.scrollIntoView({behavior:"smooth",block:"start",inline:"start"}),u(e)},[]),d=y(()=>s!=="navigation"?void 0:x({delay:60},e=>{const{top:t}=e.target.getBoundingClientRect();for(const[l,h]of Object.entries(n.current))if(h){const{top:v}=h.getBoundingClientRect();v-t<=60&&u(l)}}),[s]),[f]=q(e=>[e.setShowActionButtons]);if(E(()=>{f(a.length>0)},[f,a.length]),a.length===0)return o(M,{description:"空表单"});if(s==="switch"){const e=i.map(({key:t,rows:l})=>({key:`${t}`,label:r[`title-${t}`],destroyInactiveTabPane:!1,children:o(m,{disabled:r[`disabled-${t}`],rows:l})}));return o(w,{items:e})}if(s==="navigation")return V(O,{vertical:!0,css:c==="full"?j.fullHeight:void 0,children:[o(w,{activeKey:`${k}`,items:i.map(({key:e})=>({key:`${e}`,label:r[`title-${e}`]})),onChange:g}),o(b,{css:A,onScroll:d,children:i.map(({key:e,rows:t})=>o(m,{ref:l=>{n.current[e]=l},disabled:r[`disabled-${e}`],rows:t,title:r[`title-${e}`]},e))})]});const p=i.map(({key:e,rows:t})=>o(m,{disabled:r[`disabled-${e}`],rows:t,title:r[`title-${e}`]},e));return c==="full"?o(b,{onScroll:d,children:p}):o(C,{children:p})}const K=H(D,(i,s)=>B($(i,["schema"]),$(s,["schema"])));export{K as default};
@@ -1,12 +1,2 @@
1
1
  "use strict";
2
- import{jsxs as f,jsx as m}from"@emotion/react/jsx-runtime";import{css as u}from"@emotion/react";import{themeVariables as c,isDeepEqual as h,omit as l}from"@vef-framework/shared";import{useMemo as w,memo as b,forwardRef as y}from"react";import g from"../../vef-empty-placeholder/index.js";import V from"../../vef-title/index.js";import{useComputedValues as k}from"../hooks/use-computed-values.js";import v from"./form-row.js";const x=u`
3
- margin-bottom: ${c.margin};
4
-
5
- &:last-child {
6
- margin-bottom: 0;
7
- }
8
-
9
- .vef-form-group-content {
10
- padding: 0 2px;
11
- }
12
- `;function $({title:r,disabled:t,rows:s},n){const a=k([...s.map(({key:o,show:e})=>({key:`show-${o}`,rawValue:e,defaultValue:!0})),...s.map(({key:o,disabled:e})=>({key:`disabled-${o}`,rawValue:e,defaultValue:t}))],!0),i=w(()=>s.filter(({key:o})=>a[`show-${o}`]),[a,s]);return f("div",{ref:n,css:x,children:[r&&m(V,{showBottomLine:!0,showLeftBar:!0,level:4,children:r}),m("div",{className:"vef-form-group-content",children:i.length===0?m(g,{description:"空表单组"}):i.map(({key:o,autoExpand:e,columns:p})=>m(v,{autoExpand:e,columns:p,disabled:a[`disabled-${o}`],rowKey:o},o))})]})}const d=b(y($),(r,t)=>h(l(r,["rows"]),l(t,["rows"])));d.displayName="VefFormGroup";export{d as default};
2
+ import{jsxs as f,jsx as m}from"@emotion/react/jsx-runtime";import{css as u}from"@emotion/react";import{themeVariables as c,isDeepEqual as h,omit as l}from"@vef-framework/shared";import{useMemo as w,memo as y,forwardRef as g}from"react";import V from"../../vef-empty-placeholder/index.js";import b from"../../vef-title/index.js";import{useComputedValues as k}from"../hooks/use-computed-values.js";import v from"./form-row.js";const x=u({marginBottom:c.margin,"&:last-child":{marginBottom:0},".vef-form-group-content":{padding:"0 2px"}});function $({title:r,disabled:t,rows:s},n){const a=k([...s.map(({key:o,show:e})=>({key:`show-${o}`,rawValue:e,defaultValue:!0})),...s.map(({key:o,disabled:e})=>({key:`disabled-${o}`,rawValue:e,defaultValue:t}))],!0),i=w(()=>s.filter(({key:o})=>a[`show-${o}`]),[a,s]);return f("div",{ref:n,css:x,children:[r&&m(b,{showBottomLine:!0,showLeftBar:!0,level:4,children:r}),m("div",{className:"vef-form-group-content",children:i.length===0?m(V,{description:"空表单组"}):i.map(({key:o,autoExpand:e,columns:p})=>m(v,{autoExpand:e,columns:p,disabled:a[`disabled-${o}`],rowKey:o},o))})]})}const d=y(g($),(r,t)=>h(l(r,["rows"]),l(t,["rows"])));d.displayName="VefFormGroup";export{d as default};
@@ -1,2 +1,2 @@
1
1
  "use strict";
2
- import{useApiContext as L}from"@vef-framework/core";import{isFunction as r,VefError as V,showLoadingMessage as A,omit as M,showSuccessMessage as N}from"@vef-framework/shared";import{useCallback as v,useMemo as j}from"react";import{useFormStore as q}from"../store.js";function I({submitApi:m,submitTip:o="提交中...",onBeforeSubmit:a,onSubmit:c,onSubmitSuccess:d,onSubmitFailure:p,onReset:f}){const[h,e,s,l,b,w,F,g]=q(t=>[t.form,t.scene,t.eventBus,t.setIsLoading,t.virtualFieldNames,t.getValues,t.initialValues,t.invokeValueChangeHandlers]),{useApiMutation:y,stubMutationApi:C}=L(),{mutate:R}=y(m??C);if(!r(c)&&!m)throw new V(-1,"'onSubmit' or 'submitApi' prop is required for VefForm component");const k=v(()=>{const t=w();h.resetFields(),g(),s.emitChange(F),f?.(t,e)},[h,w,f,e,g,F,s]),H=j(()=>r(c)?(m&&console.warn("'submitApi' prop is ignored when 'onSubmit' prop is provided in VefForm component"),async t=>{l(!0);let i=t,n=null;try{const u=r(o)?o(t,e):o;n=A(u),r(a)&&(i=await a(i,e));const S=M(i,b);await c(S,e),s.emitSubmitResult(!0)}catch(u){throw s.emitSubmitResult(!1),u}finally{l(!1),n?.()}}):async t=>{l(!0);let i=t,n=null;try{const u=r(o)?o(t,e):o;n=A(u),r(a)&&(i=await a(t,e));const S=M(i,b),B=await R(S);(d??(({message:E})=>{N(E)}))(B,i,e),s.emitSubmitResult(!0)}catch(u){s.emitSubmitResult(!1),p?.(u,i,e)}finally{l(!1),n?.()}},[c,m,l,o,e,a,b,s,R,d,p]),x=v(({values:t,errorFields:i})=>{s.emitSubmitResult(!1),p?.(new V(-1,i.flatMap(n=>n.errors).join(", ")),t,e)},[s,p,e]);return{handleReset:k,handleSubmit:H,handleSubmitFailed:x}}export{I as useActionHandlers};
2
+ import{useApiContext as L}from"@vef-framework/core";import{isFunction as a,VefError as V,omit as A}from"@vef-framework/shared";import{useCallback as M,useMemo as N}from"react";import"../../helpers/index.js";import{useFormStore as j}from"../store.js";import{showLoadingMessage as v,showSuccessMessage as q}from"../../helpers/message.js";function I({submitApi:l,submitTip:s="提交中...",onBeforeSubmit:r,onSubmit:c,onSubmitSuccess:d,onSubmitFailure:p,onReset:f}){const[h,e,o,m,b,w,F,g]=j(t=>[t.form,t.scene,t.eventBus,t.setIsLoading,t.virtualFieldNames,t.getValues,t.initialValues,t.invokeValueChangeHandlers]),{useApiMutation:y,stubMutationApi:C}=L(),{mutate:R}=y(l??C);if(!a(c)&&!l)throw new V(-1,"'onSubmit' or 'submitApi' prop is required for VefForm component");const k=M(()=>{const t=w();h.resetFields(),g(),o.emitChange(F),f?.(t,e)},[h,w,f,e,g,F,o]),H=N(()=>a(c)?(l&&console.warn("'submitApi' prop is ignored when 'onSubmit' prop is provided in VefForm component"),async t=>{m(!0);let i=t,n=null;try{const u=a(s)?s(t,e):s;n=v(u),a(r)&&(i=await r(i,e));const S=A(i,b);await c(S,e),o.emitSubmitResult(!0)}catch(u){throw o.emitSubmitResult(!1),u}finally{m(!1),n?.()}}):async t=>{m(!0);let i=t,n=null;try{const u=a(s)?s(t,e):s;n=v(u),a(r)&&(i=await r(t,e));const S=A(i,b),B=await R(S);(d??(({message:E})=>{q(E)}))(B,i,e),o.emitSubmitResult(!0)}catch(u){o.emitSubmitResult(!1),p?.(u,i,e)}finally{m(!1),n?.()}},[c,l,m,s,e,r,b,o,R,d,p]),x=M(({values:t,errorFields:i})=>{o.emitSubmitResult(!1),p?.(new V(-1,i.flatMap(n=>n.errors).join(", ")),t,e)},[o,p,e]);return{handleReset:k,handleSubmit:H,handleSubmitFailed:x}}export{I as useActionHandlers};