cnhis-design-vue 3.1.53-beta.2 → 3.1.53-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/es/components/annotation-edit/src/AnnotationEdit.js +1 -1
  2. package/es/components/body-select/index.d.ts +9 -4
  3. package/es/components/body-select/src/config/index.js +1 -1
  4. package/es/components/body-select/src/hooks/renderCanvas.d.ts +1 -1
  5. package/es/components/body-select/src/hooks/renderCanvas.js +1 -1
  6. package/es/components/body-select/src/index.vue.d.ts +9 -4
  7. package/es/components/body-select/src/index.vue2.js +1 -1
  8. package/es/components/callback/src/components/render/popupMaps.d.ts +25 -1
  9. package/es/components/card-reader-sdk/src/cardReaderSDK.js +1 -1
  10. package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
  11. package/es/components/form-config/index.d.ts +74 -2
  12. package/es/components/form-config/src/FormConfig.vue.d.ts +74 -2
  13. package/es/components/form-config/src/FormConfig.vue2.js +1 -1
  14. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +25 -1
  15. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +37 -1
  16. package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -1
  17. package/es/components/form-render/index.d.ts +25 -1
  18. package/es/components/form-render/index.js +1 -1
  19. package/es/components/form-render/src/FormRender.vue.d.ts +25 -1
  20. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  21. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +25 -1
  22. package/es/components/form-render/src/components/renderer/combination.js +1 -1
  23. package/es/components/form-render/src/components/renderer/levelSearchCascader/index.js +1 -1
  24. package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
  25. package/es/components/form-render/src/components/renderer/select.d.ts +1 -1
  26. package/es/components/form-render/src/components/renderer/select.js +1 -1
  27. package/es/components/form-render/src/hooks/index.js +1 -1
  28. package/es/components/form-render/src/hooks/useFieldListAdaptor.d.ts +2 -2
  29. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  30. package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +8 -0
  31. package/es/components/form-render/src/hooks/useFormContext.js +1 -1
  32. package/es/components/form-render/src/hooks/useFormRenderLifeCycle.d.ts +9 -1
  33. package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +0 -1
  34. package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
  35. package/es/components/form-render/src/types/index.d.ts +5 -1
  36. package/es/components/form-render/src/utils/schema.js +1 -1
  37. package/es/components/guide/src/renderer.js +1 -1
  38. package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
  39. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue2.js +1 -1
  40. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +4 -1
  41. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
  42. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
  43. package/es/components/index.js +1 -1
  44. package/es/components/info-header/index.d.ts +70 -2
  45. package/es/components/info-header/src/InfoHeader.vue.d.ts +70 -2
  46. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +4 -0
  47. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +4 -0
  48. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +29 -1
  49. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +25 -1
  50. package/es/components/keyboard/src/Keyboard.vue2.js +1 -1
  51. package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -1
  52. package/es/components/shortcut-setter/index.d.ts +25 -1
  53. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +25 -1
  54. package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
  55. package/es/components/time-picker/src/TimePicker.vue2.js +1 -1
  56. package/es/shared/hooks/index.d.ts +1 -0
  57. package/es/shared/hooks/index.js +1 -1
  58. package/es/shared/hooks/selectHooks/index.d.ts +4 -0
  59. package/es/shared/hooks/selectHooks/index.js +1 -0
  60. package/es/shared/hooks/selectHooks/useOptionFiltered.d.ts +10 -0
  61. package/es/shared/hooks/selectHooks/useOptionFiltered.js +1 -0
  62. package/es/shared/hooks/selectHooks/useSearchContent.d.ts +6 -0
  63. package/es/shared/hooks/selectHooks/useSearchContent.js +1 -0
  64. package/es/shared/hooks/selectHooks/useSelectAllowModify.d.ts +23 -0
  65. package/es/shared/hooks/selectHooks/useSelectAllowModify.js +1 -0
  66. package/es/shared/hooks/selectHooks/useSelectRenders.d.ts +19 -0
  67. package/es/shared/hooks/selectHooks/useSelectRenders.js +1 -0
  68. package/es/shared/hooks/useFormRequest/index.js +1 -1
  69. package/es/shared/hooks/useLevelSearchCascader.js +1 -1
  70. package/es/shared/package.json.js +1 -1
  71. package/package.json +2 -2
@@ -265,6 +265,10 @@ declare const _default: import("vue").DefineComponent<{
265
265
  uuid: string;
266
266
  lifeCycle: Partial<{
267
267
  onSetup(): void;
268
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
269
+ field: import("@formily/core").GeneralField;
270
+ oldValue: unknown;
271
+ }): any;
268
272
  beforeRequest(fieldKey: string, params?: import("../../../../../../es/shared/types").AnyObject | undefined, payload?: import("../../../../../../es/shared/types").AnyObject | undefined): void | import("../../../../../../es/shared/types").UndefinedAble<import("../../../../../../es/shared/types").AnyObject>;
269
273
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../../../../es/shared/types").AnyObject | undefined): import("../../../../../../es/shared/types").AnyObject[];
270
274
  afterOptionInit(fieldKey: string, options: import("../../../../../../es/shared/types").AnyObject[], payload?: import("../../../../../../es/shared/types").AnyObject | undefined): void;
@@ -2238,6 +2242,10 @@ declare const _default: import("vue").DefineComponent<{
2238
2242
  lifeCycle: {
2239
2243
  type: import("vue").PropType<Partial<{
2240
2244
  onSetup(): void;
2245
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
2246
+ field: import("@formily/core").GeneralField;
2247
+ oldValue: unknown;
2248
+ }): any;
2241
2249
  beforeRequest(fieldKey: string, params?: import("../../../../../../es/shared/types").AnyObject | undefined, payload?: import("../../../../../../es/shared/types").AnyObject | undefined): void | import("../../../../../../es/shared/types").UndefinedAble<import("../../../../../../es/shared/types").AnyObject>;
2242
2250
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../../../../es/shared/types").AnyObject | undefined): import("../../../../../../es/shared/types").AnyObject[];
2243
2251
  afterOptionInit(fieldKey: string, options: import("../../../../../../es/shared/types").AnyObject[], payload?: import("../../../../../../es/shared/types").AnyObject | undefined): void;
@@ -2383,6 +2391,10 @@ declare const _default: import("vue").DefineComponent<{
2383
2391
  lifeCycle: {
2384
2392
  type: import("vue").PropType<Partial<{
2385
2393
  onSetup(): void;
2394
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
2395
+ field: import("@formily/core").GeneralField;
2396
+ oldValue: unknown;
2397
+ }): any;
2386
2398
  beforeRequest(fieldKey: string, params?: import("../../../../../../es/shared/types").AnyObject | undefined, payload?: import("../../../../../../es/shared/types").AnyObject | undefined): void | import("../../../../../../es/shared/types").UndefinedAble<import("../../../../../../es/shared/types").AnyObject>;
2387
2399
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../../../../es/shared/types").AnyObject | undefined): import("../../../../../../es/shared/types").AnyObject[];
2388
2400
  afterOptionInit(fieldKey: string, options: import("../../../../../../es/shared/types").AnyObject[], payload?: import("../../../../../../es/shared/types").AnyObject | undefined): void;
@@ -2452,13 +2464,21 @@ declare const _default: import("vue").DefineComponent<{
2452
2464
  title: string;
2453
2465
  }[]>;
2454
2466
  onScroll: (scrollEvent: Event) => void;
2455
- callLifeCycle: <T extends "onSetup" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
2467
+ callLifeCycle: <T extends "onSetup" | "beforeSetValue" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
2456
2468
  onSetup(): void;
2469
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
2470
+ field: import("@formily/core").GeneralField;
2471
+ oldValue: unknown;
2472
+ }): any;
2457
2473
  beforeRequest(fieldKey: string, params?: import("../../../../../../es/shared/types").AnyObject | undefined, payload?: import("../../../../../../es/shared/types").AnyObject | undefined): void | import("../../../../../../es/shared/types").UndefinedAble<import("../../../../../../es/shared/types").AnyObject>;
2458
2474
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../../../../es/shared/types").AnyObject | undefined): import("../../../../../../es/shared/types").AnyObject[];
2459
2475
  afterOptionInit(fieldKey: string, options: import("../../../../../../es/shared/types").AnyObject[], payload?: import("../../../../../../es/shared/types").AnyObject | undefined): void;
2460
2476
  }>>[T]> | undefined) => import("../../../../../../es/shared/types").UndefinedAble<ReturnType<Required<Partial<{
2461
2477
  onSetup(): void;
2478
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
2479
+ field: import("@formily/core").GeneralField;
2480
+ oldValue: unknown;
2481
+ }): any;
2462
2482
  beforeRequest(fieldKey: string, params?: import("../../../../../../es/shared/types").AnyObject | undefined, payload?: import("../../../../../../es/shared/types").AnyObject | undefined): void | import("../../../../../../es/shared/types").UndefinedAble<import("../../../../../../es/shared/types").AnyObject>;
2463
2483
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../../../../es/shared/types").AnyObject | undefined): import("../../../../../../es/shared/types").AnyObject[];
2464
2484
  afterOptionInit(fieldKey: string, options: import("../../../../../../es/shared/types").AnyObject[], payload?: import("../../../../../../es/shared/types").AnyObject | undefined): void;
@@ -2551,6 +2571,10 @@ declare const _default: import("vue").DefineComponent<{
2551
2571
  uuid: string;
2552
2572
  lifeCycle: Partial<{
2553
2573
  onSetup(): void;
2574
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
2575
+ field: import("@formily/core").GeneralField;
2576
+ oldValue: unknown;
2577
+ }): any;
2554
2578
  beforeRequest(fieldKey: string, params?: import("../../../../../../es/shared/types").AnyObject | undefined, payload?: import("../../../../../../es/shared/types").AnyObject | undefined): void | import("../../../../../../es/shared/types").UndefinedAble<import("../../../../../../es/shared/types").AnyObject>;
2555
2579
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../../../../es/shared/types").AnyObject | undefined): import("../../../../../../es/shared/types").AnyObject[];
2556
2580
  afterOptionInit(fieldKey: string, options: import("../../../../../../es/shared/types").AnyObject[], payload?: import("../../../../../../es/shared/types").AnyObject | undefined): void;
@@ -2958,6 +2982,10 @@ declare const _default: import("vue").DefineComponent<{
2958
2982
  lifeCycle: {
2959
2983
  type: import("vue").PropType<Partial<{
2960
2984
  onSetup(): void;
2985
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
2986
+ field: import("@formily/core").GeneralField;
2987
+ oldValue: unknown;
2988
+ }): any;
2961
2989
  beforeRequest(fieldKey: string, params?: import("../../../../../../es/shared/types").AnyObject | undefined, payload?: import("../../../../../../es/shared/types").AnyObject | undefined): void | import("../../../../../../es/shared/types").UndefinedAble<import("../../../../../../es/shared/types").AnyObject>;
2962
2990
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../../../../es/shared/types").AnyObject | undefined): import("../../../../../../es/shared/types").AnyObject[];
2963
2991
  afterOptionInit(fieldKey: string, options: import("../../../../../../es/shared/types").AnyObject[], payload?: import("../../../../../../es/shared/types").AnyObject | undefined): void;
@@ -164,6 +164,10 @@ declare const _default: import("vue").DefineComponent<{
164
164
  lifeCycle: {
165
165
  type: import("vue").PropType<Partial<{
166
166
  onSetup(): void;
167
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
168
+ field: import("@formily/core").GeneralField;
169
+ oldValue: unknown;
170
+ }): any;
167
171
  beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined, payload?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
168
172
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../..").AnyObject | undefined): import("../../../..").AnyObject[];
169
173
  afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[], payload?: import("../../../..").AnyObject | undefined): void;
@@ -309,6 +313,10 @@ declare const _default: import("vue").DefineComponent<{
309
313
  lifeCycle: {
310
314
  type: import("vue").PropType<Partial<{
311
315
  onSetup(): void;
316
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
317
+ field: import("@formily/core").GeneralField;
318
+ oldValue: unknown;
319
+ }): any;
312
320
  beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined, payload?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
313
321
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../..").AnyObject | undefined): import("../../../..").AnyObject[];
314
322
  afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[], payload?: import("../../../..").AnyObject | undefined): void;
@@ -378,13 +386,21 @@ declare const _default: import("vue").DefineComponent<{
378
386
  title: string;
379
387
  }[]>;
380
388
  onScroll: (scrollEvent: Event) => void;
381
- callLifeCycle: <T extends "onSetup" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
389
+ callLifeCycle: <T extends "onSetup" | "beforeSetValue" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
382
390
  onSetup(): void;
391
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
392
+ field: import("@formily/core").GeneralField;
393
+ oldValue: unknown;
394
+ }): any;
383
395
  beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined, payload?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
384
396
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../..").AnyObject | undefined): import("../../../..").AnyObject[];
385
397
  afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[], payload?: import("../../../..").AnyObject | undefined): void;
386
398
  }>>[T]> | undefined) => import("../../../..").UndefinedAble<ReturnType<Required<Partial<{
387
399
  onSetup(): void;
400
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
401
+ field: import("@formily/core").GeneralField;
402
+ oldValue: unknown;
403
+ }): any;
388
404
  beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined, payload?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
389
405
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../..").AnyObject | undefined): import("../../../..").AnyObject[];
390
406
  afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[], payload?: import("../../../..").AnyObject | undefined): void;
@@ -477,6 +493,10 @@ declare const _default: import("vue").DefineComponent<{
477
493
  uuid: string;
478
494
  lifeCycle: Partial<{
479
495
  onSetup(): void;
496
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
497
+ field: import("@formily/core").GeneralField;
498
+ oldValue: unknown;
499
+ }): any;
480
500
  beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined, payload?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
481
501
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../..").AnyObject | undefined): import("../../../..").AnyObject[];
482
502
  afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[], payload?: import("../../../..").AnyObject | undefined): void;
@@ -884,6 +904,10 @@ declare const _default: import("vue").DefineComponent<{
884
904
  lifeCycle: {
885
905
  type: import("vue").PropType<Partial<{
886
906
  onSetup(): void;
907
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
908
+ field: import("@formily/core").GeneralField;
909
+ oldValue: unknown;
910
+ }): any;
887
911
  beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined, payload?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
888
912
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../..").AnyObject | undefined): import("../../../..").AnyObject[];
889
913
  afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[], payload?: import("../../../..").AnyObject | undefined): void;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as l,provide as t,computed as o,unref as a,openBlock as n,createBlock as u,normalizeStyle as i,withCtx as s,createVNode as r,mergeProps as d,createElementBlock as f,normalizeClass as p,createElementVNode as c,Fragment as m,renderList as v,createCommentVNode as y,createTextVNode as g,toDisplayString as h}from"vue";import{NPopover as k,NInputNumber as w,NSpace as V,NIcon as b}from"naive-ui";import{Close as x,GitCompareOutline as O,ArrowUndoSharp as S}from"@vicons/ionicons5";import j from"./components/NumberPanel.vue.js";import{useDraggable as C}from"@vueuse/core";import{useTheme as _}from"../../../shared/hooks/useTheme.js";import"date-fns";import"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import{defaultCssVars as I}from"./constants/index.js";const D=c("span",null,"键盘",-1),N={class:"keys"},K=["onClick"];var R=e({__name:"Keyboard",props:{mode:{type:String,default:"english"},drag:{type:Boolean,default:!1},positionInitialValue:{type:Object,default:()=>({x:0,y:0})},defaultValue:{type:Number},value:{type:Number},panel:{type:Boolean,default:!0},moveOffset:{type:Object,default:()=>({x:0,y:0})}},emits:["change","keydown"],setup(e,{expose:R,emit:U}){const B=e,E="QWERTYUIOPASDFGHJKLZXCVBNM.",F=["Switch"," ","Undo","Enter"],J=E.split("").concat(F),M=E.split(".")[0].split("").sort().concat(["."],F),P=_(I,"Keyboard");let Q=l(Date.now());t("toSelectInputContent",Q);const T=o((()=>"english"===B.mode)),$=o((()=>({mode:B.mode,defaultValue:B.defaultValue,value:B.value,positionInitialValue:B.positionInitialValue,moveOffset:B.moveOffset,drag:B.drag,onChange:q}))),A=o((()=>`${JSON.stringify(P.value).replace(/\{|\}|\"/g,"").replace(/,/g,";")};${(null==Y?void 0:Y.value)||""}`)),G=l(J.slice()),H=l(),L=l(),W=l(),X=l(),Y=function(){B.defaultValue&&(X.value=B.defaultValue);if(T.value&&B.drag){const{x:e,y:l,style:t}=C(L,{initialValue:B.positionInitialValue,preventDefault:!0,handle:W,onMove:(e,l)=>{var t,o,a,n;e.x+=null!=(o=null==(t=B.moveOffset)?void 0:t.x)?o:0,e.y+=null!=(n=null==(a=B.moveOffset)?void 0:a.y)?n:0}});return t}}();function Z(e){"Switch"!==e?U("keydown",e):G.value="Q"===G.value[0]?M.slice():J.slice()}function q(e){var l;null==(l=H.value)||l.setShow(!1),X.value=e,U("change",e)}return R({select:function(){Q.value=Date.now()}}),(l,t)=>a(T)||e.panel?!a(T)&&e.panel?(n(),u(j,d({key:1},a($),{style:a(P)}),null,16,["style"])):(n(),f("div",{key:2,class:p(["c-keyboard-english",{isFixed:e.drag}]),ref_key:"englishKeyboardRef",ref:L,style:i(a(A))},[r(a(V),{"wrap-item":!1,align:"center",justify:"space-between",ref_key:"keyboardDragRef",ref:W,style:i({cursor:e.drag?"move":"default"})},{default:s((()=>[D,r(a(b),{onClick:t[1]||(t[1]=e=>Z("close")),component:a(x)},null,8,["component"])])),_:1},8,["style"]),c("div",N,[(n(!0),f(m,null,v(G.value,((e,l)=>(n(),f("span",{key:e,class:p(["key"+l]),onClick:l=>Z(e)},["Switch"===e?(n(),u(a(b),{key:0,component:a(O)},null,8,["component"])):y("v-if",!0),"Undo"===e?(n(),u(a(b),{key:1,component:a(S)},null,8,["component"])):y("v-if",!0),g(" "+h(F.includes(e)&&"Enter"!==e?""===e?"空格":"":e),1)],10,K)))),128))])],6)):(n(),u(a(k),{key:0,ref_key:"popoverRef",ref:H,trigger:"click","show-arrow":!1,placement:"bottom-start",style:i([{padding:"0"},a(P)]),"display-directive":"show"},{trigger:s((()=>[r(a(w),{value:X.value,"onUpdate:value":t[0]||(t[0]=e=>X.value=e),"show-button":!1},null,8,["value"])])),default:s((()=>[r(j,{mode:e.mode,defaultValue:e.defaultValue,onChange:q},null,8,["mode","defaultValue"])])),_:1},8,["style"]))}});export{R as default};
1
+ import{defineComponent as e,ref as t,provide as l,computed as o,unref as a,openBlock as n,createBlock as u,normalizeStyle as s,withCtx as i,createVNode as r,mergeProps as d,createElementBlock as p,normalizeClass as c,createElementVNode as f,Fragment as m,renderList as v,createCommentVNode as y,createTextVNode as h,toDisplayString as g}from"vue";import{NPopover as k,NInputNumber as w,NSpace as V,NIcon as b}from"naive-ui";import{Close as x,GitCompareOutline as O,ArrowUndoSharp as S}from"@vicons/ionicons5";import j from"./components/NumberPanel.vue.js";import{useDraggable as C}from"@vueuse/core";import{useTheme as _}from"../../../shared/hooks/useTheme.js";import"date-fns";import"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import{defaultCssVars as I}from"./constants/index.js";const D=f("span",null,"键盘",-1),N={class:"keys"},K=["onClick"];var R=e({__name:"Keyboard",props:{mode:{type:String,default:"english"},drag:{type:Boolean,default:!1},positionInitialValue:{type:Object,default:()=>({x:0,y:0})},defaultValue:{type:Number},value:{type:Number},panel:{type:Boolean,default:!0},moveOffset:{type:Object,default:()=>({x:0,y:0})}},emits:["change","keydown"],setup(e,{expose:R,emit:U}){const B=e,E="QWERTYUIOPASDFGHJKLZXCVBNM.",F=["Switch"," ","Undo","Enter"],H=E.split("").concat(F),J=E.split(".")[0].split("").sort().concat(["."],F),M=_(I,"Keyboard");let P=t(Date.now());l("toSelectInputContent",P);const Q=o((()=>"english"===B.mode)),T=o((()=>({mode:B.mode,defaultValue:B.defaultValue,value:B.value,positionInitialValue:B.positionInitialValue,moveOffset:B.moveOffset,drag:B.drag,onChange:q}))),$=o((()=>`${JSON.stringify(M.value).replace(/\{|\}|\"/g,"").replace(/,/g,";")};${(null==Y?void 0:Y.value)||""}`)),A=t(H.slice()),G=t(),L=t(),W=t(),X=t(),Y=function(){B.defaultValue&&(X.value=B.defaultValue);if(Q.value&&B.drag){const{x:e,y:t,style:l}=C(L,{initialValue:B.positionInitialValue,preventDefault:!0,handle:W,onMove:(e,t)=>{var l,o,a,n;e.x+=null!=(o=null==(l=B.moveOffset)?void 0:l.x)?o:0,e.y+=null!=(n=null==(a=B.moveOffset)?void 0:a.y)?n:0}});return l}}();function Z(e){"Switch"!==e?U("keydown",e):A.value="Q"===A.value[0]?J.slice():H.slice()}function q(e){var t;null==(t=G.value)||t.setShow(!1),X.value=e,U("change",e)}return R({select:function(){P.value=Date.now()}}),(t,l)=>a(Q)||e.panel?!a(Q)&&e.panel?(n(),u(j,d({key:1},a(T),{style:a(M)}),null,16,["style"])):(n(),p("div",{key:2,class:c(["c-keyboard-english",{isFixed:e.drag}]),ref_key:"englishKeyboardRef",ref:L,style:s(a($))},[r(a(V),{"wrap-item":!1,align:"center",justify:"space-between",ref_key:"keyboardDragRef",ref:W,style:s({cursor:e.drag?"move":"default"})},{default:i((()=>[D,r(a(b),{onClick:l[1]||(l[1]=e=>Z("close")),component:a(x)},null,8,["component"])])),_:1},8,["style"]),f("div",N,[(n(!0),p(m,null,v(A.value,((e,t)=>(n(),p("span",{key:e,class:c(["key"+t]),onClick:t=>Z(e)},["Switch"===e?(n(),u(a(b),{key:0,component:a(O)},null,8,["component"])):y("v-if",!0),"Undo"===e?(n(),u(a(b),{key:1,component:a(S)},null,8,["component"])):y("v-if",!0),h(" "+g(F.includes(e)&&"Enter"!==e?""===e?"空格":"":e),1)],10,K)))),128))])],6)):(n(),u(a(k),{key:0,ref_key:"popoverRef",ref:G,trigger:"click","show-arrow":!1,placement:"bottom-start",style:s([{padding:"0"},a(M)]),"display-directive":"show"},{trigger:i((()=>[r(a(w),{value:X.value,"onUpdate:value":l[0]||(l[0]=e=>X.value=e),"show-button":!1},null,8,["value"])])),default:i((()=>[r(j,{mode:e.mode,defaultValue:e.defaultValue,onChange:q},null,8,["mode","defaultValue"])])),_:1},8,["style"]))}});export{R as default};
@@ -1 +1 @@
1
- import{defineComponent as e,computed as a,provide as l,ref as t,nextTick as o,watch as r,openBlock as u,createBlock as n,unref as s,mergeProps as i,isRef as d,withCtx as c,createElementVNode as v,createVNode as p,createCommentVNode as f,normalizeStyle as y,renderSlot as h}from"vue";import{useTheme as m}from"../../../shared/hooks/useTheme.js";import{useEventBus as b,useVModel as g,onClickOutside as k,useDebounceFn as w}from"@vueuse/core";import"date-fns";import{isArray as S,isString as K,isObject as C,isFunction as P}from"lodash-es";import{isPromise as _,NOOP as j}from"@vue/shared";import{uuidGenerator as N}from"../../../shared/utils/index.js";import{NPopover as x,NInput as A}from"naive-ui";import U from"./components/ClearIcon.vue.js";import{InjectionSearchCascaderCheckAbleLevel as W,InjectionKeyboardEventBus as B,InjectionSearchCascaderLoadingNode as F,InjectionSearchCascaderValue as I}from"./constants/index.js";import{SearchMenu as L}from"./components/SearchMenu.js";const T=["id"];var V=e({__name:"SearchCascader",props:{value:{type:[String,Array]},show:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},childKey:{type:String,default:"children"},placeholder:{type:String,default:"请选择"},editPlaceholder:{type:String,default:"请输入关键字进行搜索"},options:{type:Array,default:()=>[]},search:{type:Function},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},checkAbleLevel:{type:[Number,String],default:"last"},beforeSetValue:{type:Function},menuWidth:{type:[Number,String],default:150},disabled:Boolean,inputProps:{type:Object},popperProps:{type:Object}},emits:["update:value","focus","update:show"],setup(e,{expose:V,emit:E}){const O=e,R=m();const $=a((()=>O.clearable&&(S(O.value)?O.value.length:!!O.value)));function M(){!function(e){if(!P(O.beforeSetValue))return E("update:value",e);const a=O.beforeSetValue(e);_(a)?a.then((e=>E("update:value",e)),j):E("update:value",a)}([])}function q(e){var a;"INPUT"===(null==(a=e.target)?void 0:a.tagName)&&ee()}const z=e=>{var a;"INPUT"!==(null==(a=e.target)?void 0:a.tagName)||"Enter"!==e.code||J.value?G.emit(e.key,e):ee()},D=a((()=>({"--menu-width":O.menuWidth}))),G=b("cascaderKeydown"),H=N(),J=g(O,"show",E);l(W,a((()=>O.checkAbleLevel))),l(B,G);const Q=t(""),X=a((()=>K(O.value)&&O.value?O.value:S(O.value)&&O.value.length?O.value.map((e=>C(e)?e[O.labelKey]:e)).join(" / "):O.editPlaceholder)),Y=a({get:()=>J.value?Q.value:K(O.value)?O.value:S(O.value)?O.value.reduce(((e,a,l)=>0===l?a[O.labelKey]:e+" / "+a[O.labelKey]),""):"",set(e){Q.value=e,ne(void 0,e)}});function Z(e){E("focus",e)}function ee(){J.value||O.disabled||(J.value=!0,Q.value="",ne())}async function ae(){var e;J.value=!1,null==(e=le.value)||e.blur()}const le=t();k(le,(e=>{var a;if(!J.value)return;const l=e;if(!l.target)return ae();!function(e){let a=!1,l=e;for(;l;){if(l.id===H){a=!0;break}l=l.parentElement}return a}(l.target)?ae():null==(a=le.value)||a.focus()}));const te=t(),oe=t(),re=t(),ue=t(null);l(F,ue),l(I,a((()=>O.value)));const ne=w((async(e,a)=>{var l;const{type:t,node:r}=e||{};try{if("update"===t)return void(P(O.search)&&O.search({...r,isLeaf:!0}));ue.value=r;const e=await(P(O.search)&&O.search(r,a));oe.value=C(e)||S(e)?e:r}finally{ue.value=null,await o(),null==(l=te.value)||l.syncPosition()}}),400),se=e=>{re.value=e};return r((()=>O.show),(e=>{e&&(re.value={})})),V({getWidth(){var e;if(!le.value)return 0;const a=null==(e=le.value)?void 0:e.$el;return a?a.clientWidth:void 0},setCursor(e){re.value=e}}),(a,l)=>(u(),n(s(x),i({class:"search-cascader",trigger:"manual",show:s(J),"onUpdate:show":l[1]||(l[1]=e=>d(J)?J.value=e:null),"show-arrow":!1,placement:"bottom-start",style:s(D),disabled:e.disabled,width:e.options.length?void 0:"trigger",ref_key:"popoverRef",ref:te},e.popperProps),{trigger:c((()=>[v("div",null,[p(s(A),i({disabled:e.disabled,class:{"search-cascader__input":!e.disabled},placeholder:s(J)?s(X):e.placeholder,clearable:!1,value:s(Y),"onUpdate:value":l[0]||(l[0]=e=>d(Y)?Y.value=e:null),ref_key:"inputRef",ref:le,onFocus:Z,onClick:q,onKeydown:z},e.inputProps),{suffix:c((()=>[s($)?(u(),n(U,{key:0,onClick:M})):f("v-if",!0)])),_:1},16,["disabled","class","placeholder","value"])])])),default:c((()=>[v("section",{id:s(H)},[p(s(L),{style:y(s(R)),"label-key":e.labelKey,"value-key":e.valueKey,options:e.options,onNodeClick:s(ne),onChangeCursor:se,"current-node":oe.value,"cursor-node":re.value},{empty:c((()=>[h(a.$slots,"empty")])),_:3},8,["style","label-key","value-key","options","onNodeClick","current-node","cursor-node"])],8,T)])),_:3},16,["show","style","disabled","width"]))}});export{V as default};
1
+ import{defineComponent as e,computed as a,provide as t,ref as l,nextTick as o,watch as r,openBlock as u,createBlock as n,unref as s,mergeProps as i,isRef as d,withCtx as c,createElementVNode as v,createVNode as p,createCommentVNode as f,normalizeStyle as h,renderSlot as y}from"vue";import{useTheme as m}from"../../../shared/hooks/useTheme.js";import{useEventBus as b,useVModel as g,onClickOutside as k,useDebounceFn as w}from"@vueuse/core";import"date-fns";import{isArray as S,isString as C,isObject as K,isFunction as j}from"lodash-es";import{isPromise as P,NOOP as _}from"@vue/shared";import{uuidGenerator as N}from"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NPopover as x,NInput as A}from"naive-ui";import U from"./components/ClearIcon.vue.js";import{InjectionSearchCascaderCheckAbleLevel as W,InjectionKeyboardEventBus as B,InjectionSearchCascaderLoadingNode as F,InjectionSearchCascaderValue as I}from"./constants/index.js";import{SearchMenu as L}from"./components/SearchMenu.js";const T={style:{width:"100%"}},V=["id"];var E=e({__name:"SearchCascader",props:{value:{type:[String,Array]},show:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},childKey:{type:String,default:"children"},placeholder:{type:String,default:"请选择"},editPlaceholder:{type:String,default:"请输入关键字进行搜索"},options:{type:Array,default:()=>[]},search:{type:Function},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},checkAbleLevel:{type:[Number,String],default:"last"},beforeSetValue:{type:Function},menuWidth:{type:[Number,String],default:150},disabled:Boolean,inputProps:{type:Object},popperProps:{type:Object}},emits:["update:value","focus","update:show"],setup(e,{expose:E,emit:O}){const R=e,$=m();const H=a((()=>R.clearable&&(S(R.value)?R.value.length:!!R.value)));function M(){!function(e){if(!j(R.beforeSetValue))return O("update:value",e);const a=R.beforeSetValue(e);P(a)?a.then((e=>O("update:value",e)),_):O("update:value",a)}([])}function q(e){var a;"INPUT"===(null==(a=e.target)?void 0:a.tagName)&&ae()}const z=e=>{var a;"INPUT"!==(null==(a=e.target)?void 0:a.tagName)||"Enter"!==e.code||Q.value?G.emit(e.key,e):ae()},D=a((()=>({"--menu-width":R.menuWidth}))),G=b("cascaderKeydown"),J=N(),Q=g(R,"show",O);t(W,a((()=>R.checkAbleLevel))),t(B,G);const X=l(""),Y=a((()=>C(R.value)&&R.value?R.value:S(R.value)&&R.value.length?R.value.map((e=>K(e)?e[R.labelKey]:e)).join(" / "):R.editPlaceholder)),Z=a({get:()=>Q.value?X.value:C(R.value)?R.value:S(R.value)?R.value.reduce(((e,a,t)=>0===t?a[R.labelKey]:e+" / "+a[R.labelKey]),""):"",set(e){X.value=e,se(void 0,e)}});function ee(e){O("focus",e)}function ae(){Q.value||R.disabled||(Q.value=!0,X.value="",se())}async function te(){var e;Q.value=!1,null==(e=le.value)||e.blur()}const le=l();k(le,(e=>{var a;if(!Q.value)return;const t=e;if(!t.target)return te();!function(e){let a=!1,t=e;for(;t;){if(t.id===J){a=!0;break}t=t.parentElement}return a}(t.target)?te():null==(a=le.value)||a.focus()}));const oe=l(),re=l(),ue=l(),ne=l(null);t(F,ne),t(I,a((()=>R.value)));const se=w((async(e,a)=>{var t;const{type:l,node:r}=e||{};try{if("update"===l)return void(j(R.search)&&R.search({...r,isLeaf:!0}));ne.value=r;const e=await(j(R.search)&&R.search(r,a));re.value=K(e)||S(e)?e:r}finally{ne.value=null,await o(),null==(t=oe.value)||t.syncPosition()}}),400),ie=e=>{ue.value=e};return r((()=>R.show),(e=>{e&&(ue.value={})})),E({getWidth(){var e;if(!le.value)return 0;const a=null==(e=le.value)?void 0:e.$el;return a?a.clientWidth:void 0},setCursor(e){ue.value=e}}),(a,t)=>(u(),n(s(x),i({class:"search-cascader",trigger:"manual",show:s(Q),"onUpdate:show":t[1]||(t[1]=e=>d(Q)?Q.value=e:null),"show-arrow":!1,placement:"bottom-start",style:s(D),disabled:e.disabled,width:e.options.length?void 0:"trigger",ref_key:"popoverRef",ref:oe},e.popperProps),{trigger:c((()=>[v("div",T,[p(s(A),i({disabled:e.disabled,class:{"search-cascader__input":!e.disabled},placeholder:s(Q)?s(Y):e.placeholder,clearable:!1,value:s(Z),"onUpdate:value":t[0]||(t[0]=e=>d(Z)?Z.value=e:null),ref_key:"inputRef",ref:le,onFocus:ee,onClick:q,onKeydown:z},e.inputProps),{suffix:c((()=>[s(H)?(u(),n(U,{key:0,onClick:M})):f("v-if",!0)])),_:1},16,["disabled","class","placeholder","value"])])])),default:c((()=>[v("section",{id:s(J)},[p(s(L),{style:h(s($)),"label-key":e.labelKey,"value-key":e.valueKey,options:e.options,onNodeClick:s(se),onChangeCursor:ie,"current-node":re.value,"cursor-node":ue.value},{empty:c((()=>[y(a.$slots,"empty")])),_:3},8,["style","label-key","value-key","options","onNodeClick","current-node","cursor-node"])],8,V)])),_:3},16,["show","style","disabled","width"]))}});export{E as default};
@@ -1887,6 +1887,10 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
1887
1887
  lifeCycle: {
1888
1888
  type: import("vue").PropType<Partial<{
1889
1889
  onSetup(): void;
1890
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
1891
+ field: import("@formily/core").GeneralField;
1892
+ oldValue: unknown;
1893
+ }): any;
1890
1894
  beforeRequest(fieldKey: string, params?: import("../../../es/shared/types").AnyObject | undefined, payload?: import("../../../es/shared/types").AnyObject | undefined): void | import("../../../es/shared/types").UndefinedAble<import("../../../es/shared/types").AnyObject>;
1891
1895
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../es/shared/types").AnyObject | undefined): import("../../../es/shared/types").AnyObject[];
1892
1896
  afterOptionInit(fieldKey: string, options: import("../../../es/shared/types").AnyObject[], payload?: import("../../../es/shared/types").AnyObject | undefined): void;
@@ -2032,6 +2036,10 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
2032
2036
  lifeCycle: {
2033
2037
  type: import("vue").PropType<Partial<{
2034
2038
  onSetup(): void;
2039
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
2040
+ field: import("@formily/core").GeneralField;
2041
+ oldValue: unknown;
2042
+ }): any;
2035
2043
  beforeRequest(fieldKey: string, params?: import("../../../es/shared/types").AnyObject | undefined, payload?: import("../../../es/shared/types").AnyObject | undefined): void | import("../../../es/shared/types").UndefinedAble<import("../../../es/shared/types").AnyObject>;
2036
2044
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../es/shared/types").AnyObject | undefined): import("../../../es/shared/types").AnyObject[];
2037
2045
  afterOptionInit(fieldKey: string, options: import("../../../es/shared/types").AnyObject[], payload?: import("../../../es/shared/types").AnyObject | undefined): void;
@@ -2101,13 +2109,21 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
2101
2109
  title: string;
2102
2110
  }[]>;
2103
2111
  onScroll: (scrollEvent: Event) => void;
2104
- callLifeCycle: <T extends "onSetup" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
2112
+ callLifeCycle: <T extends "onSetup" | "beforeSetValue" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
2105
2113
  onSetup(): void;
2114
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
2115
+ field: import("@formily/core").GeneralField;
2116
+ oldValue: unknown;
2117
+ }): any;
2106
2118
  beforeRequest(fieldKey: string, params?: import("../../../es/shared/types").AnyObject | undefined, payload?: import("../../../es/shared/types").AnyObject | undefined): void | import("../../../es/shared/types").UndefinedAble<import("../../../es/shared/types").AnyObject>;
2107
2119
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../es/shared/types").AnyObject | undefined): import("../../../es/shared/types").AnyObject[];
2108
2120
  afterOptionInit(fieldKey: string, options: import("../../../es/shared/types").AnyObject[], payload?: import("../../../es/shared/types").AnyObject | undefined): void;
2109
2121
  }>>[T]> | undefined) => import("../../../es/shared/types").UndefinedAble<ReturnType<Required<Partial<{
2110
2122
  onSetup(): void;
2123
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
2124
+ field: import("@formily/core").GeneralField;
2125
+ oldValue: unknown;
2126
+ }): any;
2111
2127
  beforeRequest(fieldKey: string, params?: import("../../../es/shared/types").AnyObject | undefined, payload?: import("../../../es/shared/types").AnyObject | undefined): void | import("../../../es/shared/types").UndefinedAble<import("../../../es/shared/types").AnyObject>;
2112
2128
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../es/shared/types").AnyObject | undefined): import("../../../es/shared/types").AnyObject[];
2113
2129
  afterOptionInit(fieldKey: string, options: import("../../../es/shared/types").AnyObject[], payload?: import("../../../es/shared/types").AnyObject | undefined): void;
@@ -2200,6 +2216,10 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
2200
2216
  uuid: string;
2201
2217
  lifeCycle: Partial<{
2202
2218
  onSetup(): void;
2219
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
2220
+ field: import("@formily/core").GeneralField;
2221
+ oldValue: unknown;
2222
+ }): any;
2203
2223
  beforeRequest(fieldKey: string, params?: import("../../../es/shared/types").AnyObject | undefined, payload?: import("../../../es/shared/types").AnyObject | undefined): void | import("../../../es/shared/types").UndefinedAble<import("../../../es/shared/types").AnyObject>;
2204
2224
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../es/shared/types").AnyObject | undefined): import("../../../es/shared/types").AnyObject[];
2205
2225
  afterOptionInit(fieldKey: string, options: import("../../../es/shared/types").AnyObject[], payload?: import("../../../es/shared/types").AnyObject | undefined): void;
@@ -2607,6 +2627,10 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
2607
2627
  lifeCycle: {
2608
2628
  type: import("vue").PropType<Partial<{
2609
2629
  onSetup(): void;
2630
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
2631
+ field: import("@formily/core").GeneralField;
2632
+ oldValue: unknown;
2633
+ }): any;
2610
2634
  beforeRequest(fieldKey: string, params?: import("../../../es/shared/types").AnyObject | undefined, payload?: import("../../../es/shared/types").AnyObject | undefined): void | import("../../../es/shared/types").UndefinedAble<import("../../../es/shared/types").AnyObject>;
2611
2635
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../es/shared/types").AnyObject | undefined): import("../../../es/shared/types").AnyObject[];
2612
2636
  afterOptionInit(fieldKey: string, options: import("../../../es/shared/types").AnyObject[], payload?: import("../../../es/shared/types").AnyObject | undefined): void;
@@ -1889,6 +1889,10 @@ declare const _default: import("vue").DefineComponent<{
1889
1889
  lifeCycle: {
1890
1890
  type: import("vue").PropType<Partial<{
1891
1891
  onSetup(): void;
1892
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
1893
+ field: import("@formily/core").GeneralField;
1894
+ oldValue: unknown;
1895
+ }): any;
1892
1896
  beforeRequest(fieldKey: string, params?: import("../../../../es/shared/types").AnyObject | undefined, payload?: import("../../../../es/shared/types").AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<import("../../../../es/shared/types").AnyObject>;
1893
1897
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../../es/shared/types").AnyObject | undefined): import("../../../../es/shared/types").AnyObject[];
1894
1898
  afterOptionInit(fieldKey: string, options: import("../../../../es/shared/types").AnyObject[], payload?: import("../../../../es/shared/types").AnyObject | undefined): void;
@@ -2034,6 +2038,10 @@ declare const _default: import("vue").DefineComponent<{
2034
2038
  lifeCycle: {
2035
2039
  type: import("vue").PropType<Partial<{
2036
2040
  onSetup(): void;
2041
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
2042
+ field: import("@formily/core").GeneralField;
2043
+ oldValue: unknown;
2044
+ }): any;
2037
2045
  beforeRequest(fieldKey: string, params?: import("../../../../es/shared/types").AnyObject | undefined, payload?: import("../../../../es/shared/types").AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<import("../../../../es/shared/types").AnyObject>;
2038
2046
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../../es/shared/types").AnyObject | undefined): import("../../../../es/shared/types").AnyObject[];
2039
2047
  afterOptionInit(fieldKey: string, options: import("../../../../es/shared/types").AnyObject[], payload?: import("../../../../es/shared/types").AnyObject | undefined): void;
@@ -2103,13 +2111,21 @@ declare const _default: import("vue").DefineComponent<{
2103
2111
  title: string;
2104
2112
  }[]>;
2105
2113
  onScroll: (scrollEvent: Event) => void;
2106
- callLifeCycle: <T extends "onSetup" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
2114
+ callLifeCycle: <T extends "onSetup" | "beforeSetValue" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
2107
2115
  onSetup(): void;
2116
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
2117
+ field: import("@formily/core").GeneralField;
2118
+ oldValue: unknown;
2119
+ }): any;
2108
2120
  beforeRequest(fieldKey: string, params?: import("../../../../es/shared/types").AnyObject | undefined, payload?: import("../../../../es/shared/types").AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<import("../../../../es/shared/types").AnyObject>;
2109
2121
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../../es/shared/types").AnyObject | undefined): import("../../../../es/shared/types").AnyObject[];
2110
2122
  afterOptionInit(fieldKey: string, options: import("../../../../es/shared/types").AnyObject[], payload?: import("../../../../es/shared/types").AnyObject | undefined): void;
2111
2123
  }>>[T]> | undefined) => import("../../../../es/shared/types").UndefinedAble<ReturnType<Required<Partial<{
2112
2124
  onSetup(): void;
2125
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
2126
+ field: import("@formily/core").GeneralField;
2127
+ oldValue: unknown;
2128
+ }): any;
2113
2129
  beforeRequest(fieldKey: string, params?: import("../../../../es/shared/types").AnyObject | undefined, payload?: import("../../../../es/shared/types").AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<import("../../../../es/shared/types").AnyObject>;
2114
2130
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../../es/shared/types").AnyObject | undefined): import("../../../../es/shared/types").AnyObject[];
2115
2131
  afterOptionInit(fieldKey: string, options: import("../../../../es/shared/types").AnyObject[], payload?: import("../../../../es/shared/types").AnyObject | undefined): void;
@@ -2202,6 +2218,10 @@ declare const _default: import("vue").DefineComponent<{
2202
2218
  uuid: string;
2203
2219
  lifeCycle: Partial<{
2204
2220
  onSetup(): void;
2221
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
2222
+ field: import("@formily/core").GeneralField;
2223
+ oldValue: unknown;
2224
+ }): any;
2205
2225
  beforeRequest(fieldKey: string, params?: import("../../../../es/shared/types").AnyObject | undefined, payload?: import("../../../../es/shared/types").AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<import("../../../../es/shared/types").AnyObject>;
2206
2226
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../../es/shared/types").AnyObject | undefined): import("../../../../es/shared/types").AnyObject[];
2207
2227
  afterOptionInit(fieldKey: string, options: import("../../../../es/shared/types").AnyObject[], payload?: import("../../../../es/shared/types").AnyObject | undefined): void;
@@ -2609,6 +2629,10 @@ declare const _default: import("vue").DefineComponent<{
2609
2629
  lifeCycle: {
2610
2630
  type: import("vue").PropType<Partial<{
2611
2631
  onSetup(): void;
2632
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
2633
+ field: import("@formily/core").GeneralField;
2634
+ oldValue: unknown;
2635
+ }): any;
2612
2636
  beforeRequest(fieldKey: string, params?: import("../../../../es/shared/types").AnyObject | undefined, payload?: import("../../../../es/shared/types").AnyObject | undefined): void | import("../../../../es/shared/types").UndefinedAble<import("../../../../es/shared/types").AnyObject>;
2613
2637
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../../es/shared/types").AnyObject | undefined): import("../../../../es/shared/types").AnyObject[];
2614
2638
  afterOptionInit(fieldKey: string, options: import("../../../../es/shared/types").AnyObject[], payload?: import("../../../../es/shared/types").AnyObject | undefined): void;
@@ -1 +1 @@
1
- import{defineComponent as e,computed as t,toRefs as l,ref as o,watch as n,openBlock as s,createElementBlock as r,normalizeStyle as i,unref as a,normalizeClass as d,createElementVNode as c,Fragment as p,renderList as u,createCommentVNode as f,withDirectives as m,renderSlot as h,toDisplayString as g,vShow as v,createBlock as x,withCtx as y,createVNode as I}from"vue";import{NTooltip as b,NEmpty as w}from"naive-ui";import{useTheme as S}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import{defaultCssVars as k}from"./constants/index.js";const B={class:"stepBox"},j=["title"],N=["onMouseenter","onMouseleave"],M=["onMouseenter","onMouseleave"],R=["title"],T=["title"],O=["title"],C={key:0,style:{height:"48px"}},_={key:1},L={key:1};var $=e({__name:"StepsWheel",props:{stepInfo:{type:Object,default:()=>({list:[],cols:6})},currentStep:{type:Number,default:1},toolTipShow:{type:Boolean,default:!0},lastNodeRender:{type:Boolean,default:!1},nextNodeRender:{type:Boolean,default:!1},lastNodeColor:{type:Object,default:()=>({})},singleNodeRender:{type:Object,default:()=>({})},noDataMsg:{type:String,default:"暂无节点数据"},placement:{type:String,default:"center"}},setup(e){const $=e;let V=S(k,"StepsWheel");const D=t((()=>Math.ceil(q.value.length/$.stepInfo.cols))),W=t((()=>$.lastNodeRender)),{noDataMsg:E,nextNodeRender:P}=l($),F=o(null),A=t((()=>{var e;let t=72;if(null==(e=null==F?void 0:F.value)?void 0:e.length){let e=F.value[0],l=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle;t=isNaN(parseInt(l["min-width"]))?72:parseInt(l["min-width"])}return`${20+$.stepInfo.cols*t}px`})),q=o([]),z=o([]),G=e=>{e.tipVisible=!0},H=e=>{e.tipVisible=!1},J=e=>{if(z.value.length){if(e.rowIndex===z.value.length)return!0;if(e.rowIndex<z.value.length)return z.value[e.rowIndex].some((e=>null==e?void 0:e.title))}return!1},K=e=>{const{list:t=[]}=$.stepInfo;return e.rowIndex%2==0&&"frist"==e.nodeType&&e.nodeIndex!==t.length},Q=e=>{const{list:t=[]}=$.stepInfo;return e.rowIndex%2!=0&&"last"==e.nodeType&&e.nodeIndex!==t.length},U=(e,t)=>{let l=e.length,o=l%t==0?l/t:Math.floor(l/t+1),n=[];for(let l=0;l<o;l++){let o=e.slice(l*t,l*t+t);n.push(o)}return n},X=e=>{const{cols:t}=$.stepInfo;let l=U(q.value,t),o=l[l.length-1].filter((e=>e));return D.value%2==0?e!=o[o.length-1].nodeIndex-(t-2*o[o.length-1].sort):e!=o[o.length-1].nodeIndex-1},Y=e=>{const{cols:t}=$.stepInfo;let l=U(q.value,t),o=l[l.length-1].filter((e=>e));return D.value%2==0?W.value&&e==o[0].nodeIndex-(t-2*o[0].sort):W.value&&e==o[o.length-1].nodeIndex-1},Z=(e,t)=>{const{cols:l}=$.stepInfo;let o=U(q.value,l),n=o[o.length-1].filter((e=>e));return D.value%2==0?"circle"===t?W.value&&e==n[0].nodeIndex-(l-2*n[0].sort)-l:W.value&&e==n[0].nodeIndex-(l-2*n[0].sort):"circle"===t?W.value&&e==n[n.length-1].nodeIndex-1-l:W.value&&e==n[n.length-1].nodeIndex-2},ee=(e,t,l)=>{var o,n;if((null==(o=$.singleNodeRender)?void 0:o.field)&&(null==(n=$.singleNodeRender)?void 0:n.details)&&"[object Object]"===Object.prototype.toString.call($.singleNodeRender.details)&&Object.keys($.singleNodeRender.details).length){const{details:o,field:n}=$.singleNodeRender;if(o[e[n]]&&"[object Object]"===Object.prototype.toString.call(o[e[n]])&&Object.keys(o[e[n]]).length){let s={};switch(l){case"title":s={color:o[e[n]].color,background:o[e[n]].background};break;case"icon":s={background:o[e[n]].nodeLineColor};break;case"line":s={"border-bottom":`1px solid ${o[e[n]].nodeLineColor}`},$.nextNodeRender?e.rowIndex%2==0&&(s={"border-bottom":`1px solid ${o[q.value[t+1][n]].nodeLineColor}`}):s={};break;case"circle":$.nextNodeRender&&(s={border:`1px solid ${o[e[n]].nodeLineColor}`})}return s}}let s={color:"var(--c-primary-color)",background:"#f1f5fe"};if("icon"===l){if(s={background:"var(--c-primary-color)"},$.currentStep>=e.nodeIndex)return s}else if("circle"===l){if(s={border:"1px solid var(--c-primary-color)"},$.nextNodeRender){if($.currentStep>=e.nodeIndex)return s}else if($.currentStep>e.nodeIndex)return s}else if("line"===l){if(s={"border-bottom":"1px solid var(--c-primary-color)"},((e,t)=>P.value?e.rowIndex%2==0?$.currentStep>=t+($.stepInfo.cols-2*e.sort)-1:$.currentStep>=t+1:e.rowIndex%2==0?$.currentStep>=t+($.stepInfo.cols-2*e.sort):$.currentStep>=t+2)(e,t))return s}else if("title"===l&&$.currentStep>=e.nodeIndex)return s;return{}};return n((()=>$.stepInfo),(e=>{var t;(null==(t=null==e?void 0:e.list)?void 0:t.length)&&((e,t)=>{let l=e.length+1,o=Math.ceil(e.length/t),n=!0,s=[];for(var r=0;r<o;r++)s[r]=new Array(t),s[r].fill(null);let i=0,a=0;for(let o=1;o<l;o++)s[i][a]=Object.assign(e[o-1],{nodeIndex:o,rowIndex:i+1}),n?o%t!=0?a++:(n=!n,i++):o%t!=0?a--:(n=!n,i++);let d=[];s.map((e=>{e.map(((e,t)=>{e&&(e.sort=t,!e.hasOwnProperty("tipVisible")&&(e.tipVisible=!1))})),e[0]&&(e[0].nodeType="frist"),e[e.length-1]&&(e[e.length-1].nodeType="last"),d=[...d,...e]})),q.value=d,z.value=s})(e.list,e.cols)}),{immediate:!0,deep:!0}),n((()=>$.lastNodeColor),(e=>{if(e&&"[object Object]"===Object.prototype.toString.call(e)&&Object.keys(e).length){const t=Object.assign({},k,{"--c-success-color":e.color||"#5dc055","--c-success-title-color":e.background||"#fff"});V=S(t,"StepsWheel")}}),{immediate:!0,deep:!0}),(t,l)=>(s(),r("div",{class:"step-wheel-box",style:i({minWidth:a(A),...a(V)})},[q.value.length?(s(),r("div",{key:0,class:d(["stepOut",{placementLeft:"left"===e.placement,placementRight:"right"===e.placement}])},[c("ul",B,[(s(!0),r(p,null,u(q.value,((l,o)=>(s(),r("li",{ref_for:!0,ref_key:"stepItemRef",ref:F,key:(null==l?void 0:l.stepId)||o,class:d(["stepItem",{[`stepItem_${o+1}`]:!0,[`${null==l?void 0:l.stepId}`]:!!(null==l?void 0:l.stepId)}])},[l?(s(),r(p,{key:0},[f(" 步骤头部信息 "),m(c("div",{class:d(["stepTopBox",{finished:Y(o),stepTopBox_right:"right"===e.placement,stepTopBox_left:"left"===e.placement}]),style:i({...ee(l,o,"title")})},[h(t.$slots,"stepTopBox",{stepItem:l},(()=>[c("span",{title:l.title},g(l.title),9,j)]))],6),[[v,l.title]]),f(" 步骤条的节点,此处为圆圈 "),e.toolTipShow&&l.tipShow?(s(),x(a(b),{key:0,placement:"top",delay:0,"show-arrow":!0,show:l.tipVisible,trigger:"manual",style:i({opacity:"0.88"}),onMouseenter:e=>G(l),onMouseleave:e=>H(l)},{trigger:y((()=>[c("div",{class:d(["icon",{finished:Y(o)}]),style:i({...ee(l,o,"icon")}),onMouseenter:e=>G(l),onMouseleave:e=>H(l)},null,46,N)])),default:y((()=>[h(t.$slots,"nodeTipBox",{stepItem:l,stepId:l.stepId})])),_:2},1032,["show","style","onMouseenter","onMouseleave"])):(s(),r("div",{key:1,class:d(["icon",{finished:Y(o)}]),style:i({...ee(l,o,"icon")})},null,6)),f(" 步骤条连接线,动态显示 "),"last"!==l.nodeType?m((s(),r("div",{key:2,class:d(["line",{finished:Z(o)}]),style:i({...ee(l,o,"line")})},null,6)),[[v,X(o)]]):f("v-if",!0),f(" 步骤条弯曲连线,动态渲染 "),K(l)||Q(l)?(s(),r("div",{key:3,class:d({lineCircleFinished:Z(o,"circle"),lineCircleRight:Q(l),lineCircleLeft:K(l),lineCirclePlacementRight:Q(l)&&"right"===e.placement,lineCirclePlacementLeft:K(l)&&"left"===e.placement}),style:i({...ee(l,o,"circle")})},null,6)):f("v-if",!0),f(" 步骤底部信息 "),c("div",{class:d(["stepBottomBox",{stepBottomBox_right:"right"===e.placement,stepBottomBox_left:"left"===e.placement}]),onMouseenter:e=>G(l),onMouseleave:e=>H(l)},[h(t.$slots,"stepBottomBox",{stepItem:l},(()=>[f(" 步骤名称 "),m(c("p",{class:d(["stepLabel",{labelFinsh:Y(o),stepLabel_right:"right"===e.placement,stepLabel_left:"left"===e.placement}]),title:l.label},g(l.label),11,R),[[v,l.label]]),c("div",{class:d({stepBottomCustomBox:!0,alignItemsEnd:"left"===e.placement,alignItemsStart:"right"===e.placement})},[h(t.$slots,"stepBottomCustomBox",{stepItem:l},(()=>[c("div",{class:d({stepBottomDefaultBox:!0,alignItemsEnd:"left"===e.placement,alignItemsStart:"right"===e.placement}),style:{width:"100%",display:"flex",flexDirection:"column"}},[m(c("p",{class:"stepExtra",title:l.person},g(l.person),9,T),[[v,l.person]]),f(" 步骤时间 "),m(c("p",{class:"statusTime",title:l.statusTime},g(l.statusTime),9,O),[[v,l.statusTime]])],2)]))],2)])),J(l)?(s(),r("div",C)):f("v-if",!0)],42,M)],64)):(s(),r("div",_,[f("null元素占位")]))],2)))),128))])],2)):(s(),r("div",L,[I(a(w),{description:a(E)},null,8,["description"])]))],4))}});export{$ as default};
1
+ import{defineComponent as e,computed as t,toRefs as l,ref as o,watch as n,openBlock as s,createElementBlock as r,normalizeStyle as i,unref as a,normalizeClass as d,createElementVNode as c,Fragment as p,renderList as u,createCommentVNode as f,withDirectives as m,renderSlot as h,toDisplayString as v,vShow as g,createBlock as x,withCtx as y,createVNode as I}from"vue";import{NTooltip as b,NEmpty as w}from"naive-ui";import{useTheme as k}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{defaultCssVars as S}from"./constants/index.js";const B={class:"stepBox"},j=["title"],N=["onMouseenter","onMouseleave"],M=["onMouseenter","onMouseleave"],R=["title"],T=["title"],C=["title"],O={key:0,style:{height:"48px"}},_={key:1},L={key:1};var $=e({__name:"StepsWheel",props:{stepInfo:{type:Object,default:()=>({list:[],cols:6})},currentStep:{type:Number,default:1},toolTipShow:{type:Boolean,default:!0},lastNodeRender:{type:Boolean,default:!1},nextNodeRender:{type:Boolean,default:!1},lastNodeColor:{type:Object,default:()=>({})},singleNodeRender:{type:Object,default:()=>({})},noDataMsg:{type:String,default:"暂无节点数据"},placement:{type:String,default:"center"}},setup(e){const $=e;let V=k(S,"StepsWheel");const D=t((()=>Math.ceil(H.value.length/$.stepInfo.cols))),W=t((()=>$.lastNodeRender)),{noDataMsg:E,nextNodeRender:P}=l($),F=o(null),A=t((()=>{var e;let t=72;if(null==(e=null==F?void 0:F.value)?void 0:e.length){let e=F.value[0],l=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle;t=isNaN(parseInt(l["min-width"]))?72:parseInt(l["min-width"])}return`${20+$.stepInfo.cols*t}px`})),H=o([]),q=o([]),z=e=>{e.tipVisible=!0},G=e=>{e.tipVisible=!1},J=e=>{if(q.value.length){if(e.rowIndex===q.value.length)return!0;if(e.rowIndex<q.value.length)return q.value[e.rowIndex].some((e=>null==e?void 0:e.title))}return!1},K=e=>{const{list:t=[]}=$.stepInfo;return e.rowIndex%2==0&&"frist"==e.nodeType&&e.nodeIndex!==t.length},Q=e=>{const{list:t=[]}=$.stepInfo;return e.rowIndex%2!=0&&"last"==e.nodeType&&e.nodeIndex!==t.length},U=(e,t)=>{let l=e.length,o=l%t==0?l/t:Math.floor(l/t+1),n=[];for(let l=0;l<o;l++){let o=e.slice(l*t,l*t+t);n.push(o)}return n},X=e=>{const{cols:t}=$.stepInfo;let l=U(H.value,t),o=l[l.length-1].filter((e=>e));return D.value%2==0?e!=o[o.length-1].nodeIndex-(t-2*o[o.length-1].sort):e!=o[o.length-1].nodeIndex-1},Y=e=>{const{cols:t}=$.stepInfo;let l=U(H.value,t),o=l[l.length-1].filter((e=>e));return D.value%2==0?W.value&&e==o[0].nodeIndex-(t-2*o[0].sort):W.value&&e==o[o.length-1].nodeIndex-1},Z=(e,t)=>{const{cols:l}=$.stepInfo;let o=U(H.value,l),n=o[o.length-1].filter((e=>e));return D.value%2==0?"circle"===t?W.value&&e==n[0].nodeIndex-(l-2*n[0].sort)-l:W.value&&e==n[0].nodeIndex-(l-2*n[0].sort):"circle"===t?W.value&&e==n[n.length-1].nodeIndex-1-l:W.value&&e==n[n.length-1].nodeIndex-2},ee=(e,t,l)=>{var o,n;if((null==(o=$.singleNodeRender)?void 0:o.field)&&(null==(n=$.singleNodeRender)?void 0:n.details)&&"[object Object]"===Object.prototype.toString.call($.singleNodeRender.details)&&Object.keys($.singleNodeRender.details).length){const{details:o,field:n}=$.singleNodeRender;if(o[e[n]]&&"[object Object]"===Object.prototype.toString.call(o[e[n]])&&Object.keys(o[e[n]]).length){let s={};switch(l){case"title":s={color:o[e[n]].color,background:o[e[n]].background};break;case"icon":s={background:o[e[n]].nodeLineColor};break;case"line":s={"border-bottom":`1px solid ${o[e[n]].nodeLineColor}`},$.nextNodeRender?e.rowIndex%2==0&&(s={"border-bottom":`1px solid ${o[H.value[t+1][n]].nodeLineColor}`}):s={};break;case"circle":$.nextNodeRender&&(s={border:`1px solid ${o[e[n]].nodeLineColor}`})}return s}}let s={color:"var(--c-primary-color)",background:"#f1f5fe"};if("icon"===l){if(s={background:"var(--c-primary-color)"},$.currentStep>=e.nodeIndex)return s}else if("circle"===l){if(s={border:"1px solid var(--c-primary-color)"},$.nextNodeRender){if($.currentStep>=e.nodeIndex)return s}else if($.currentStep>e.nodeIndex)return s}else if("line"===l){if(s={"border-bottom":"1px solid var(--c-primary-color)"},((e,t)=>P.value?e.rowIndex%2==0?$.currentStep>=t+($.stepInfo.cols-2*e.sort)-1:$.currentStep>=t+1:e.rowIndex%2==0?$.currentStep>=t+($.stepInfo.cols-2*e.sort):$.currentStep>=t+2)(e,t))return s}else if("title"===l&&$.currentStep>=e.nodeIndex)return s;return{}};return n((()=>$.stepInfo),(e=>{var t;(null==(t=null==e?void 0:e.list)?void 0:t.length)&&((e,t)=>{let l=e.length+1,o=Math.ceil(e.length/t),n=!0,s=[];for(var r=0;r<o;r++)s[r]=new Array(t),s[r].fill(null);let i=0,a=0;for(let o=1;o<l;o++)s[i][a]=Object.assign(e[o-1],{nodeIndex:o,rowIndex:i+1}),n?o%t!=0?a++:(n=!n,i++):o%t!=0?a--:(n=!n,i++);let d=[];s.map((e=>{e.map(((e,t)=>{e&&(e.sort=t,!e.hasOwnProperty("tipVisible")&&(e.tipVisible=!1))})),e[0]&&(e[0].nodeType="frist"),e[e.length-1]&&(e[e.length-1].nodeType="last"),d=[...d,...e]})),H.value=d,q.value=s})(e.list,e.cols)}),{immediate:!0,deep:!0}),n((()=>$.lastNodeColor),(e=>{if(e&&"[object Object]"===Object.prototype.toString.call(e)&&Object.keys(e).length){const t=Object.assign({},S,{"--c-success-color":e.color||"#5dc055","--c-success-title-color":e.background||"#fff"});V=k(t,"StepsWheel")}}),{immediate:!0,deep:!0}),(t,l)=>(s(),r("div",{class:"step-wheel-box",style:i({minWidth:a(A),...a(V)})},[H.value.length?(s(),r("div",{key:0,class:d(["stepOut",{placementLeft:"left"===e.placement,placementRight:"right"===e.placement}])},[c("ul",B,[(s(!0),r(p,null,u(H.value,((l,o)=>(s(),r("li",{ref_for:!0,ref_key:"stepItemRef",ref:F,key:(null==l?void 0:l.stepId)||o,class:d(["stepItem",{[`stepItem_${o+1}`]:!0,[`${null==l?void 0:l.stepId}`]:!!(null==l?void 0:l.stepId)}])},[l?(s(),r(p,{key:0},[f(" 步骤头部信息 "),m(c("div",{class:d(["stepTopBox",{finished:Y(o),stepTopBox_right:"right"===e.placement,stepTopBox_left:"left"===e.placement}]),style:i({...ee(l,o,"title")})},[h(t.$slots,"stepTopBox",{stepItem:l},(()=>[c("span",{title:l.title},v(l.title),9,j)]))],6),[[g,l.title]]),f(" 步骤条的节点,此处为圆圈 "),e.toolTipShow&&l.tipShow?(s(),x(a(b),{key:0,placement:"top",delay:0,"show-arrow":!0,show:l.tipVisible,trigger:"manual",style:i({opacity:"0.88"}),onMouseenter:e=>z(l),onMouseleave:e=>G(l)},{trigger:y((()=>[c("div",{class:d(["icon",{finished:Y(o)}]),style:i({...ee(l,o,"icon")}),onMouseenter:e=>z(l),onMouseleave:e=>G(l)},null,46,N)])),default:y((()=>[h(t.$slots,"nodeTipBox",{stepItem:l,stepId:l.stepId})])),_:2},1032,["show","style","onMouseenter","onMouseleave"])):(s(),r("div",{key:1,class:d(["icon",{finished:Y(o)}]),style:i({...ee(l,o,"icon")})},null,6)),f(" 步骤条连接线,动态显示 "),"last"!==l.nodeType?m((s(),r("div",{key:2,class:d(["line",{finished:Z(o)}]),style:i({...ee(l,o,"line")})},null,6)),[[g,X(o)]]):f("v-if",!0),f(" 步骤条弯曲连线,动态渲染 "),K(l)||Q(l)?(s(),r("div",{key:3,class:d({lineCircleFinished:Z(o,"circle"),lineCircleRight:Q(l),lineCircleLeft:K(l),lineCirclePlacementRight:Q(l)&&"right"===e.placement,lineCirclePlacementLeft:K(l)&&"left"===e.placement}),style:i({...ee(l,o,"circle")})},null,6)):f("v-if",!0),f(" 步骤底部信息 "),c("div",{class:d(["stepBottomBox",{stepBottomBox_right:"right"===e.placement,stepBottomBox_left:"left"===e.placement}]),onMouseenter:e=>z(l),onMouseleave:e=>G(l)},[h(t.$slots,"stepBottomBox",{stepItem:l},(()=>[f(" 步骤名称 "),m(c("p",{class:d(["stepLabel",{labelFinsh:Y(o),stepLabel_right:"right"===e.placement,stepLabel_left:"left"===e.placement}]),title:l.label},v(l.label),11,R),[[g,l.label]]),c("div",{class:d({stepBottomCustomBox:!0,alignItemsEnd:"left"===e.placement,alignItemsStart:"right"===e.placement})},[h(t.$slots,"stepBottomCustomBox",{stepItem:l},(()=>[c("div",{class:d({stepBottomDefaultBox:!0,alignItemsEnd:"left"===e.placement,alignItemsStart:"right"===e.placement}),style:{width:"100%",display:"flex",flexDirection:"column"}},[m(c("p",{class:"stepExtra",title:l.person},v(l.person),9,T),[[g,l.person]]),f(" 步骤时间 "),m(c("p",{class:"statusTime",title:l.statusTime},v(l.statusTime),9,C),[[g,l.statusTime]])],2)]))],2)])),J(l)?(s(),r("div",O)):f("v-if",!0)],42,M)],64)):(s(),r("div",_,[f("null元素占位")]))],2)))),128))])],2)):(s(),r("div",L,[I(a(w),{description:a(E)},null,8,["description"])]))],4))}});export{$ as default};
@@ -1 +1 @@
1
- import{defineComponent as e,useAttrs as r,ref as t,computed as s,openBlock as o,createBlock as m,unref as i,createSlots as a,renderList as f,withCtx as u,renderSlot as l}from"vue";import{NTimePicker as p}from"naive-ui";import"../../../shared/utils/index.js";import"lodash-es";import{useDateTime as n}from"../../../shared/hooks/useDateTime.js";import"@vue/shared";var c=e({__name:"TimePicker",setup(e,{expose:c}){const d=r(),h=t(null),k=s((()=>Reflect.get(d,"format")?d.format:"HH:mm:ss")),{focus:v,blur:_}=n(h,{formatRef:k,attrs:d});return c({$timePicker:h,focus:v,blur:_}),(e,r)=>(o(),m(i(p),{ref_key:"timePickerRef",ref:h},a({_:2},[f(e.$slots,((r,t)=>({name:t,fn:u((()=>[l(e.$slots,t)]))})))]),1536))}});export{c as default};
1
+ import{defineComponent as e,useAttrs as o,ref as r,computed as s,openBlock as t,createBlock as i,unref as m,createSlots as a,renderList as u,withCtx as f,renderSlot as n}from"vue";import{NTimePicker as p}from"naive-ui";import"../../../shared/utils/index.js";import"lodash-es";import{useDateTime as c}from"../../../shared/hooks/useDateTime.js";import"@vue/shared";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";var l=e({__name:"TimePicker",setup(e,{expose:l}){const h=o(),d=r(null),k=s((()=>Reflect.get(h,"format")?h.format:"HH:mm:ss")),{focus:v,blur:_}=c(d,{formatRef:k,attrs:h});return l({$timePicker:d,focus:v,blur:_}),(e,o)=>(t(),i(m(p),{ref_key:"timePickerRef",ref:d},a({_:2},[u(e.$slots,((o,r)=>({name:r,fn:f((()=>[n(e.$slots,r)]))})))]),1536))}});export{l as default};
@@ -3,3 +3,4 @@ export * from './useDateTime';
3
3
  export * from './useAsyncQueue';
4
4
  export * from './useFormRequest';
5
5
  export * from './useLevelSearchCascader';
6
+ export * from './selectHooks';
@@ -1 +1 @@
1
- export{useTheme}from"./useTheme.js";export{useDateTime}from"./useDateTime.js";export{AsyncQueue,ENTRY_STATE}from"./useAsyncQueue/index.js";export{presetRequestHandler,useFormAsyncQueue,useFormRequest}from"./useFormRequest/index.js";export{useLevelSearchCascader}from"./useLevelSearchCascader.js";
1
+ export{useTheme}from"./useTheme.js";export{useDateTime}from"./useDateTime.js";export{AsyncQueue,ENTRY_STATE}from"./useAsyncQueue/index.js";export{presetRequestHandler,useFormAsyncQueue,useFormRequest}from"./useFormRequest/index.js";export{useLevelSearchCascader}from"./useLevelSearchCascader.js";export{useSelectAllowModify}from"./selectHooks/useSelectAllowModify.js";export{useOptionFiltered}from"./selectHooks/useOptionFiltered.js";export{searchContentMatcher,useSearchContent}from"./selectHooks/useSearchContent.js";export{useSelectRenders}from"./selectHooks/useSelectRenders.js";
@@ -0,0 +1,4 @@
1
+ export * from './useSelectAllowModify';
2
+ export * from './useOptionFiltered';
3
+ export * from './useSearchContent';
4
+ export * from './useSelectRenders';
@@ -0,0 +1 @@
1
+ export{useSelectAllowModify}from"./useSelectAllowModify.js";export{useOptionFiltered}from"./useOptionFiltered.js";export{searchContentMatcher,useSearchContent}from"./useSearchContent.js";export{useSelectRenders}from"./useSelectRenders.js";
@@ -0,0 +1,10 @@
1
+ import { AnyObject } from '../../../../es/shared/types';
2
+ import { Ref } from 'vue';
3
+ export declare function useOptionFiltered(props: {
4
+ options?: AnyObject[] | undefined;
5
+ }, labelKey: Ref<string>, searchKey?: Ref<string[] | undefined>): {
6
+ searchContent: Ref<string | undefined>;
7
+ remoteOptions: Ref<AnyObject[] | null>;
8
+ filterOptions: import("vue").ComputedRef<AnyObject[]>;
9
+ fullOptions: import("vue").ComputedRef<AnyObject[]>;
10
+ };
@@ -0,0 +1 @@
1
+ import"../../utils/index.js";import"lodash-es";import"naive-ui";import{ref as o,computed as e}from"vue";import"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import{useSearchContent as t}from"./useSearchContent.js";import"@vicons/ionicons5";function i(i,r,n){const{searchContent:s,optionSearchFilter:u}=t(),p=o(null),a=e((()=>p.value?u(p.value,r.value,null==n?void 0:n.value):Array.isArray(i.options)?u(i.options,r.value):[])),l=e((()=>p.value||i.options||[]));return{searchContent:s,remoteOptions:p,filterOptions:a,fullOptions:l}}export{i as useOptionFiltered};
@@ -0,0 +1,6 @@
1
+ import { AnyObject } from '../../../../es/shared/types';
2
+ export declare const searchContentMatcher: (searchContent: string, label: string) => RegExpMatchArray | null;
3
+ export declare function useSearchContent(): {
4
+ searchContent: import("vue").Ref<string | undefined>;
5
+ optionSearchFilter: (options: AnyObject[], labelKey: string, searchKeys?: string[]) => AnyObject[];
6
+ };
@@ -0,0 +1 @@
1
+ import{keywordMatcher as e}from"../../utils/index.js";import{useMemoize as t}from"@vueuse/core";import{identity as r,isArray as n,isString as o}from"lodash-es";import{ref as u}from"vue";const i=(()=>{const e=t((e=>new RegExp(`(.*)${e.split("").map((e=>`(${function(e){return e.match(/[()\[\]{}$^\/]/)?"\\"+e:e}(e)})`)).join("(.*)")}(.*)`)),{getKey:r});return(t,r)=>r.match(e(t))})();function c(){const t=u();return{searchContent:t,optionSearchFilter:function(r,u,c){if(!t.value)return r;const s=n(c)?c.filter((e=>e&&o(e))):[];return r.filter((r=>function(r,n,u){if(!t.value)return!0;const c=r?r[n]:"";return!!o(c)&&(!!i(t.value,c)||!!e(t.value,r.keyword)||!!u.length&&u.some((e=>o(r[e])&&r[e].includes(t.value))))}(r,u,s)))}}}export{i as searchContentMatcher,c as useSearchContent};
@@ -0,0 +1,23 @@
1
+ import { AnyObject, ArrayAble } from '../../../../es/shared/types';
2
+ import { Ref } from 'vue';
3
+ export declare function useSelectAllowModify(props: Partial<{
4
+ allowCreate: boolean;
5
+ allowModify: boolean;
6
+ multiple: boolean;
7
+ cursorPlacement: 'start' | 'end';
8
+ shouldSave: boolean;
9
+ }>, { searchContent, labelKey, valueKey, valueRef, fullOptions }: {
10
+ searchContent: Ref;
11
+ labelKey: Ref<string>;
12
+ valueKey: Ref<string>;
13
+ valueRef: Ref;
14
+ fullOptions: Ref<AnyObject[]>;
15
+ }): {
16
+ modifyAbleRef: import("vue").ComputedRef<boolean | undefined>;
17
+ modifyEvent: {
18
+ focus: (event: FocusEvent) => Promise<void>;
19
+ blur: (event: Event) => null | undefined;
20
+ updateValue: (value: any, option?: ArrayAble<AnyObject>) => Promise<void>;
21
+ };
22
+ getOptionsWithCreated: (options: AnyObject[]) => AnyObject[];
23
+ };
@@ -0,0 +1 @@
1
+ import{promiseTimeout as e}from"@vueuse/shared";import{isArray as l,isObject as a}from"lodash-es";import{computed as u,nextTick as t}from"vue";function v(v,{searchContent:o,labelKey:n,valueKey:i,valueRef:r,fullOptions:s}){let f=null;const c=u((()=>(v.multiple&&v.allowModify&&console.warn("多选模式下不支持allowModify"),!v.multiple&&v.allowModify)));return{modifyAbleRef:c,modifyEvent:{focus:async l=>{var a,u;c.value&&(f=l.target,f&&r.value&&(await t(),f.value=null!=(u=null==(a=s.value.find((e=>e[i.value]===r.value)))?void 0:a[n.value])?u:r.value,f.dispatchEvent(new CustomEvent("input")),"start"===v.cursorPlacement&&(await e(0),f.setSelectionRange(0,0))))},blur:function(e){if(c.value&&(f=e.target,f)){if(!f.value)return r.value=null;o.value=f.value,r.value=f.value}},updateValue:async function(e,u){!u||l(u)?r.value=e:u&&(r.value=u[v.allowModify?n.value:i.value]),f&&a(u)&&c.value&&(f.focus(),await t(),f.value=u[n.value]||"",f.dispatchEvent(new CustomEvent("input")),"start"===v.cursorPlacement&&f.setSelectionRange(0,0))}},getOptionsWithCreated:function(e){return v.allowCreate&&o.value&&!e.some((e=>e[n.value]===o.value))?[...e,{[n.value]:o.value,[i.value]:o.value,created:!0,shouldSave:v.shouldSave}]:e}}}export{v as useSelectAllowModify};
@@ -0,0 +1,19 @@
1
+ import { AnyObject } from '../../../../es/shared/types';
2
+ import { SelectOption } from 'naive-ui';
3
+ import { Ref } from 'vue';
4
+ export declare function useSelectRenders(props: {
5
+ multiple: boolean;
6
+ deletable: boolean;
7
+ }, { labelKey, showKey, searchContent }: {
8
+ searchContent: Ref;
9
+ labelKey: Ref<string>;
10
+ showKey: Ref<string | undefined>;
11
+ }): {
12
+ renderLabel: (option: AnyObject) => string | JSX.Element;
13
+ renderSelectAll: (onSelectAll: (checked: boolean) => void) => JSX.Element[];
14
+ renderTag: ({ option, handleClose }: {
15
+ option: SelectOption;
16
+ handleClose: Function;
17
+ }) => unknown;
18
+ titleRef: Ref<string>;
19
+ };
@@ -0,0 +1 @@
1
+ import{ref as e,createVNode as t,createTextVNode as n}from"vue";import"../../utils/index.js";import{isString as l}from"lodash-es";import{NTooltip as o,NIcon as r,NButton as a,NTag as i}from"naive-ui";import"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import{searchContentMatcher as u}from"./useSearchContent.js";import{HelpCircleSharp as s}from"@vicons/ionicons5";function c(c,{labelKey:p,showKey:m,searchContent:d}){const f=e("");return{renderLabel:function(e){const n=e[p.value];if(!n||!l(n))return"";const a=d.value?u(d.value,n):null,i=a?t("section",null,[a.map(((e,n)=>0!==n&&e?t("span",{style:{color:n%2==0?"var(--n-option-text-color-active)":""}},[e]):null))]):n;return e.desc?t("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[i,e.desc?t(o,null,{trigger:()=>t(r,{component:s},null),default:()=>e.desc}):null]):i},renderSelectAll:function(e){return[t(a,{quaternary:!0,type:"primary",size:"tiny",onClick:()=>e(!0)},{default:()=>[n("全选")]}),t(a,{quaternary:!0,type:"primary",size:"tiny",onClick:()=>e(!1)},{default:()=>[n("清空")]})]},renderTag:function({option:e,handleClose:n}){var l;const o=null!=(l=m.value&&e[m.value])?l:e[p.value];return c.multiple?(f.value="",c.deletable?t(i,{closable:!0,onClose:e=>{e.stopPropagation(),n()}},{default:()=>t("span",{title:o},[o])}):`${o} ;`):(f.value=o,o)},titleRef:f}}export{c as useSelectRenders};
@@ -1 +1 @@
1
- import{isObject as e}from"@vue/shared";import{uuidGenerator as t}from"../../utils/index.js";import{unref as r}from"vue";import{cloneDeep as n,isFunction as o}from"lodash-es";import"naive-ui";import"@vueuse/core";import"date-fns";import{AsyncQueue as s}from"../useAsyncQueue/index.js";let u=null;const a={method:"post",url:"",primaryKeyUrl:""},c={url:{get:"/fdp-api/fdp/aiRec/search",post:"/fdp-api/fdp/aiRec/sendBehaviorData",delete:"/fdp-api/fdp/aiRec/delete"},getRecommendIds:()=>({})};function i(){return{getHttpInstance:function(){return u},registGlobHttpInstance:function(e){u=e},registGlobRecommendInfo:function(e){Object.assign(c,e)},registGlobSearchInfo:function(e){Object.assign(a,e)},getSearchRequestInfo:function(){return{...a}},getRecommendRequestInfo:function(){return n(c)}}}function f(e,n){const{getHttpInstance:u}=i();return{create:function(a=3,c){return new s({name:"FormRenderAsyncQueue",uniqueData:n.value,parallelism:a,async processor({key:t,method:n="post",cache:s,params:a,url:i,payload:f},l,p){var m,d;const h=null!=(m=r(e))?m:u();if(!h)return console.log("before use http feature, you should regist http instance by useFormRequest.registGlobHttpInstance()"),l(),void p();try{c&&o(c.beforeRequest)&&(a=null!=(d=c.beforeRequest(t,a,f))?d:{});let e=await h[n](i,a);c&&o(c.afterRequest)&&(e=c.afterRequest(t,e,f)),l(void 0,Array.isArray(e)?e:[]),!s&&p()}catch(e){l(new Error(`Request error => ${e}`)),p()}},getKey:({url:e,method:r="post",cache:n,params:o})=>n?e+r+JSON.stringify(o||{}):t()})}}}function l(t){if(!e(t))throw t;return r=t,Reflect.has(r,"map")&&Reflect.has(r,"result")?function(e){const{result:t,map:r}=e;if("SUCCESS"!==t)throw e;return r.rows}(t):function(e){return Reflect.has(e,"result")&&Reflect.has(e,"obj")}(t)?function(t){const{obj:r,result:n}=t;if("SUCCESS"!==n||!e(r))throw t;return Object.entries(r).reduce(((e,[t,r])=>(r.forEach((r=>e.push({...r,type:t}))),e)),[])}(t):function(e){return Reflect.has(e,"data")&&Reflect.has(e,"success")}(t)?function(e){const{data:t,success:r}=e;if(!r)throw e;return t}(t):[];var r}export{l as presetRequestHandler,f as useFormAsyncQueue,i as useFormRequest};
1
+ import{isObject as e}from"@vue/shared";import{uuidGenerator as t}from"../../utils/index.js";import{unref as r}from"vue";import{cloneDeep as n,isFunction as o}from"lodash-es";import"naive-ui";import"@vueuse/core";import"date-fns";import{AsyncQueue as s}from"../useAsyncQueue/index.js";import"@vueuse/shared";import"../selectHooks/useSearchContent.js";import"@vicons/ionicons5";let u=null;const c={method:"post",url:"",primaryKeyUrl:""},a={url:{get:"/fdp-api/fdp/aiRec/search",post:"/fdp-api/fdp/aiRec/sendBehaviorData",delete:"/fdp-api/fdp/aiRec/delete"},getRecommendIds:()=>({})};function i(){return{getHttpInstance:function(){return u},registGlobHttpInstance:function(e){u=e},registGlobRecommendInfo:function(e){Object.assign(a,e)},registGlobSearchInfo:function(e){Object.assign(c,e)},getSearchRequestInfo:function(){return{...c}},getRecommendRequestInfo:function(){return n(a)}}}function f(e,n){const{getHttpInstance:u}=i();return{create:function(c=3,a){return new s({name:"FormRenderAsyncQueue",uniqueData:n.value,parallelism:c,async processor({key:t,method:n="post",cache:s,params:c,url:i,payload:f},p,l){var m,d;const h=null!=(m=r(e))?m:u();if(!h)return console.log("before use http feature, you should regist http instance by useFormRequest.registGlobHttpInstance()"),p(),void l();try{a&&o(a.beforeRequest)&&(c=null!=(d=a.beforeRequest(t,c,f))?d:{});let e=await h[n](i,c);a&&o(a.afterRequest)&&(e=a.afterRequest(t,e,f)),p(void 0,Array.isArray(e)?e:[]),!s&&l()}catch(e){p(new Error(`Request error => ${e}`)),l()}},getKey:({url:e,method:r="post",cache:n,params:o})=>n?e+r+JSON.stringify(o||{}):t()})}}}function p(t){if(!e(t))throw t;return r=t,Reflect.has(r,"map")&&Reflect.has(r,"result")?function(e){const{result:t,map:r}=e;if("SUCCESS"!==t)throw e;return r.rows}(t):function(e){return Reflect.has(e,"result")&&Reflect.has(e,"obj")}(t)?function(t){const{obj:r,result:n}=t;if("SUCCESS"!==n||!e(r))throw t;return Object.entries(r).reduce(((e,[t,r])=>(r.forEach((r=>e.push({...r,type:t}))),e)),[])}(t):function(e){return Reflect.has(e,"data")&&Reflect.has(e,"success")}(t)?function(e){const{data:t,success:r}=e;if(!r)throw e;return t}(t):[];var r}export{p as presetRequestHandler,f as useFormAsyncQueue,i as useFormRequest};
@@ -1 +1 @@
1
- import"../utils/index.js";import{isEqual as e,noop as r,isString as t,isNumber as n,isEmpty as a,isFunction as o,cloneDeep as i,omit as l,isArray as u}from"lodash-es";import"naive-ui";import{computed as s,ref as c,watch as d,unref as v}from"vue";import"@vueuse/core";import"date-fns";import{useFormRequest as p}from"./useFormRequest/index.js";function h(h,y,{asyncQueue:f,fieldKey:m,getRequestPayload:k=r}){const g=s({get:()=>h.value,set(r){e(r,h.value)||y("update:value",r)}}),w=c(!1),b=c([]),O=s((()=>{var e,r,t;return null!=(t=null==(r=null==(e=h.wordbook)?void 0:e.show_key)?void 0:r[0])?t:h.labelField})),_=s((()=>{var e,r;return null!=(r=null==(e=h.wordbook)?void 0:e.value_key)?r:h.valueField})),L=s((()=>{var e,r;return null==(r=null==(e=h.wordbook)?void 0:e.render_key)?void 0:r[0]})),j=s((()=>{var e;return(null==(e=h.wordbook)?void 0:e.level_num)||1/0})),C=function(e,r,t){return{transformListToChildren(e){if(!e.length)return[];const r=[(e=i(e))[0]];let t=e[0];for(let r=1;r<e.length;r++){const n=e[r];n&&(t.children=[n],n.parent=t,t=n)}return[e,r]},getNodeDepth(e){let r=1,t=e.parent;for(;t;)r++,t=t.parent;return r},enrichChildOption(e,r,t){return{...e,parent:r,isLeaf:this.getNodeDepth(r)+1>=t}},enrichKeywordOption:(e,n)=>(e.__keyword=!!n,e.isLeaf=!!n,n&&t.value&&e[t.value]&&(e[r.value]=e[t.value]),e),sortOptionWithIdList:(r,t)=>t.map((t=>r.find((r=>r[e.value]===t)))),generateOptionWithIdList(r,t,n){let a=r[0];return{options:t.reduce(((e,t,i)=>{const l=o(r,t);return 0===i?(a=l,[l]):(Object.assign(l,{parent:a,isLeaf:i+1>=n}),a.children=[l],a=l,e)}),[]),lastOption:a};function o(r,t){return r.find((r=>r[e.value]===t))}},parseLinkFromString2List:e=>e.split("_").filter((e=>e)),isClickNodeCheckbox:e=>e&&!e.__keyword&&e.isLeaf,createConfigObject:(r,t,n)=>t?r.conObj||[]:n?[{con:"EQ",is_compare_field:!1,field_key:r.level_key,value:n[e.value]}]:r.conObjFirstLevel||[],createOptionValue(e){const r=[];let t=e;for(;t;)r.unshift(l(t,["parent","isLeaf","__keyword","children"])),t=t.parent;return r},shouldInitOptionList:(r,t,n)=>u(r)&&!a(r)&&r.every((r=>r[e.value]))&&!t&&!n}}(_,O,L),{getSearchRequestInfo:K}=p(),I=c(150),R=c();async function x(e,r,i=!0){var l,u;if(I.value=r&&(null==(l=R.value)?void 0:l.getWidth())||150,C.shouldInitOptionList(g.value,e,r)){const[e,r]=C.transformListToChildren(g.value),t=e[Math.max(0,e.length-2)];if(g.value.length>1){b.value=r;const t=e[Math.max(0,e.length-2)];return await x(t,void 0,!1),t}if(null==(u=b.value)?void 0:u.length)return t}try{return C.isClickNodeCheckbox(e)?s(e):e?e.__keyword?async function(){var r;if(!t(e.id_link))return Promise.reject();const o=C.parseLinkFromString2List(e.id_link);n(j.value)&&j.value!==1/0&&o.splice(j.value);const i=await async function(e){if(!K().primaryKeyUrl)return[];try{return await f.addAsync(r(h.wordbook,h.autograph,e,v(m)))}catch(e){t(e)&&console.error(e)}function r(e,r,t,n){const a=K();return{key:n,params:{autograph:r,tableId:e.id,primaryKeyValue:t.join(","),page:1},...a,url:a.primaryKeyUrl,cache:h.requestCache,payload:{field:{},labelKey:O.value,valueKey:_.value}}}}(o);if(!i)return Promise.reject();const{lastOption:l,options:u}=C.generateOptionWithIdList(i,o,j.value);if(u.length<j.value&&(await x(l),a(l.children)))return g.value=C.sortOptionWithIdList(i,o),w.value=!1,Promise.reject();return b.value=u,null==(r=R.value)||r.setCursor(l),l}():async function(){const r=await f.addAsync(c(h.wordbook,h.autograph,e,v(m)));if(!r.length)return i?s(e):Promise.reject();e.children=r.map((r=>C.enrichChildOption(r,e,j.value)))}():async function(){var t;const n=await f.addAsync(c(h.wordbook,h.autograph,e,v(m)));b.value=n.map((e=>C.enrichKeywordOption(e,r))),r&&(null==(t=R.value)||t.setCursor(b.value[0]))}()}catch(e){t(e)&&console.error(e)}function s(e){return g.value=C.createOptionValue(e),w.value=!1,Promise.reject()}function c(e,n,a,i){const l={autograph:()=>n,wordbookId:"id",wordbookType:"type",fieldKeys:()=>e.search_key?JSON.stringify(e.search_key):void 0,conObj:()=>JSON.stringify(C.createConfigObject(e,r,a)),primaryKey:"primary_key",levelKey:"level_key",keyword:()=>r,page:()=>1},u=Object.entries(l).reduce(((r,[n,a])=>(r[n]=t(a)?e[a]:o(a)?a():void 0,r)),{});return{...K(),params:u,key:i,cache:h.requestCache,payload:{...k(),labelKey:O.value,valueKey:_.value}}}}return d((()=>h.wordbook),((r,t)=>{e(r,t)||(b.value=[],r&&(g.value||!h.lazyRequest)&&x())}),{immediate:!0}),{valueRef:g,labelKey:O,valueKey:_,optionsRef:b,showRef:w,fetchData:x,menuWidth:I,searchCascaderRef:R}}export{h as useLevelSearchCascader};
1
+ import"../utils/index.js";import{isEqual as e,noop as r,isString as t,isNumber as n,isEmpty as o,isFunction as a,cloneDeep as i,omit as l,isArray as u}from"lodash-es";import"naive-ui";import{computed as s,ref as c,watch as d,unref as v}from"vue";import"@vueuse/core";import"date-fns";import{useFormRequest as p}from"./useFormRequest/index.js";import"@vueuse/shared";import"./selectHooks/useSearchContent.js";import"@vicons/ionicons5";function h(h,y,{asyncQueue:f,fieldKey:m,getRequestPayload:k=r}){const g=s({get:()=>h.value,set(r){e(r,h.value)||y("update:value",r)}}),w=c(!1),b=c([]),O=s((()=>{var e,r,t;return null!=(t=null==(r=null==(e=h.wordbook)?void 0:e.show_key)?void 0:r[0])?t:h.labelField})),_=s((()=>{var e,r;return null!=(r=null==(e=h.wordbook)?void 0:e.value_key)?r:h.valueField})),L=s((()=>{var e,r;return null==(r=null==(e=h.wordbook)?void 0:e.render_key)?void 0:r[0]})),j=s((()=>{var e;return(null==(e=h.wordbook)?void 0:e.level_num)||1/0})),C=function(e,r,t){return{transformListToChildren(e){if(!e.length)return[];const r=[(e=i(e))[0]];let t=e[0];for(let r=1;r<e.length;r++){const n=e[r];n&&(t.children=[n],n.parent=t,t=n)}return[e,r]},getNodeDepth(e){let r=1,t=e.parent;for(;t;)r++,t=t.parent;return r},enrichChildOption(e,r,t){return{...e,parent:r,isLeaf:this.getNodeDepth(r)+1>=t}},enrichKeywordOption:(e,n)=>(e.__keyword=!!n,e.isLeaf=!!n,n&&t.value&&e[t.value]&&(e[r.value]=e[t.value]),e),sortOptionWithIdList:(r,t)=>t.map((t=>r.find((r=>r[e.value]===t)))),generateOptionWithIdList(r,t,n){let o=r[0];return{options:t.reduce(((e,t,i)=>{const l=a(r,t);return 0===i?(o=l,[l]):(Object.assign(l,{parent:o,isLeaf:i+1>=n}),o.children=[l],o=l,e)}),[]),lastOption:o};function a(r,t){return r.find((r=>r[e.value]===t))}},parseLinkFromString2List:e=>e.split("_").filter((e=>e)),isClickNodeCheckbox:e=>e&&!e.__keyword&&e.isLeaf,createConfigObject:(r,t,n)=>t?r.conObj||[]:n?[{con:"EQ",is_compare_field:!1,field_key:r.level_key,value:n[e.value]}]:r.conObjFirstLevel||[],createOptionValue(e){const r=[];let t=e;for(;t;)r.unshift(l(t,["parent","isLeaf","__keyword","children"])),t=t.parent;return r},shouldInitOptionList:(r,t,n)=>u(r)&&!o(r)&&r.every((r=>r[e.value]))&&!t&&!n}}(_,O,L),{getSearchRequestInfo:K}=p(),I=c(150),R=c();async function x(e,r,i=!0){var l,u;if(I.value=r&&(null==(l=R.value)?void 0:l.getWidth())||150,C.shouldInitOptionList(g.value,e,r)){const[e,r]=C.transformListToChildren(g.value),t=e[Math.max(0,e.length-2)];if(g.value.length>1){b.value=r;const t=e[Math.max(0,e.length-2)];return await x(t,void 0,!1),t}if(null==(u=b.value)?void 0:u.length)return t}try{return C.isClickNodeCheckbox(e)?s(e):e?e.__keyword?async function(){var r;if(!t(e.id_link))return Promise.reject();const a=C.parseLinkFromString2List(e.id_link);n(j.value)&&j.value!==1/0&&a.splice(j.value);const i=await async function(e){if(!K().primaryKeyUrl)return[];try{return await f.addAsync(r(h.wordbook,h.autograph,e,v(m)))}catch(e){t(e)&&console.error(e)}function r(e,r,t,n){const o=K();return{key:n,params:{autograph:r,tableId:e.id,primaryKeyValue:t.join(","),page:1},...o,url:o.primaryKeyUrl,cache:h.requestCache,payload:{field:{},labelKey:O.value,valueKey:_.value}}}}(a);if(!i)return Promise.reject();const{lastOption:l,options:u}=C.generateOptionWithIdList(i,a,j.value);if(u.length<j.value&&(await x(l),o(l.children)))return g.value=C.sortOptionWithIdList(i,a),w.value=!1,Promise.reject();return b.value=u,null==(r=R.value)||r.setCursor(l),l}():async function(){const r=await f.addAsync(c(h.wordbook,h.autograph,e,v(m)));if(!r.length)return i?s(e):Promise.reject();e.children=r.map((r=>C.enrichChildOption(r,e,j.value)))}():async function(){var t;const n=await f.addAsync(c(h.wordbook,h.autograph,e,v(m)));b.value=n.map((e=>C.enrichKeywordOption(e,r))),r&&(null==(t=R.value)||t.setCursor(b.value[0]))}()}catch(e){t(e)&&console.error(e)}function s(e){return g.value=C.createOptionValue(e),w.value=!1,Promise.reject()}function c(e,n,o,i){const l={autograph:()=>n,wordbookId:"id",wordbookType:"type",fieldKeys:()=>e.search_key?JSON.stringify(e.search_key):void 0,conObj:()=>JSON.stringify(C.createConfigObject(e,r,o)),primaryKey:"primary_key",levelKey:"level_key",keyword:()=>r,page:()=>1},u=Object.entries(l).reduce(((r,[n,o])=>(r[n]=t(o)?e[o]:a(o)?o():void 0,r)),{});return{...K(),params:u,key:i,cache:h.requestCache,payload:{...k(),labelKey:O.value,valueKey:_.value}}}}return d((()=>h.wordbook),((r,t)=>{e(r,t)||(b.value=[],r&&(g.value||!h.lazyRequest)&&x())}),{immediate:!0}),{valueRef:g,labelKey:O,valueKey:_,optionsRef:b,showRef:w,fetchData:x,menuWidth:I,searchCascaderRef:R}}export{h as useLevelSearchCascader};
@@ -1 +1 @@
1
- var e="@cnhis-design-vue/shared",i="3.1.53-beta.2",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.1.53-beta.2",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
1
+ var e="@cnhis-design-vue/shared",i="3.1.53-beta.5",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.1.53-beta.5",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};