cnhis-design-vue 3.1.43-release.3 → 3.1.44-beta.0

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 (50) hide show
  1. package/README.md +87 -87
  2. package/es/components/base-search/index.d.ts +1 -0
  3. package/es/components/base-search/src/index.vue.d.ts +1 -0
  4. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  5. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  6. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  7. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  8. package/es/components/fabric-chart/src/utils/index.d.ts +6823 -0
  9. package/es/components/form-render/src/components/renderer/formItem.d.ts +2 -0
  10. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  11. package/es/components/form-render/src/hooks/useNuiThemeOverrides.js +1 -1
  12. package/es/components/iho-select-label/index.d.ts +352 -0
  13. package/es/components/iho-select-label/index.js +1 -0
  14. package/es/components/iho-select-label/src/LabelFormContent.vue.d.ts +141 -0
  15. package/es/components/iho-select-label/src/LabelFormContent.vue.js +1 -0
  16. package/es/components/iho-select-label/src/SelectLabel.vue.d.ts +213 -0
  17. package/es/components/iho-select-label/src/SelectLabel.vue.js +1 -0
  18. package/es/components/iho-select-label/src/components/label-classify.vue.d.ts +63 -0
  19. package/es/components/iho-select-label/src/components/label-classify.vue.js +1 -0
  20. package/es/components/iho-select-label/src/types/index.d.ts +11 -0
  21. package/es/components/iho-select-label/src/types/index.js +1 -0
  22. package/es/components/iho-select-label/style/iho-select-label-iconfont.ttf +0 -0
  23. package/es/components/iho-select-label/style/index.css +1 -0
  24. package/es/components/iho-table/src/plugins/keyboardEventPlugin/index.js +1 -1
  25. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +15 -12
  26. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.js +1 -1
  27. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useAutoFocus.js +1 -1
  28. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +1 -1
  29. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.js +1 -1
  30. package/es/components/iho-table/src/plugins/rowDragPlugin/index.js +1 -1
  31. package/es/components/iho-table/src/plugins/virtualTreePlugin/index.js +1 -1
  32. package/es/components/index.css +1 -1
  33. package/es/components/index.d.ts +3 -1
  34. package/es/components/index.js +1 -1
  35. package/es/components/quick-search/index.d.ts +1 -0
  36. package/es/components/quick-search/src/index.vue.d.ts +1 -0
  37. package/es/components/scale-view/src/ScaleView.vue.js +1 -1
  38. package/es/components/select-label/src/LabelFormContent.vue.js +1 -1
  39. package/es/components/select-person/src/SearchMultiple.vue.d.ts +0 -6
  40. package/es/components/table-filter/src/components/render-widget/components/Select.vue.d.ts +1 -1
  41. package/es/components/table-filter/src/components/render-widget/components/Select.vue.js +1 -1
  42. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +1 -1
  43. package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
  44. package/es/components/table-filter/src/hooks/useRenderWidget.d.ts +1 -0
  45. package/es/components/table-filter/src/hooks/useRenderWidget.js +1 -1
  46. package/es/env.d.ts +25 -25
  47. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
  48. package/es/shared/package.json.js +1 -1
  49. package/es/shared/utils/tapable/index.d.ts +139 -0
  50. package/package.json +2 -2
@@ -0,0 +1,213 @@
1
+ import { PropType } from 'vue';
2
+ import { ICategoryLabelItemType, ISelectLabelItemType } from '../../../../es/components/iho-select-label/src/types';
3
+ declare const _default: import("vue").DefineComponent<{
4
+ selectedList: {
5
+ type: PropType<ISelectLabelItemType[]>;
6
+ default: () => never[];
7
+ };
8
+ categoryList: {
9
+ type: PropType<ICategoryLabelItemType[]>;
10
+ default: () => never[];
11
+ };
12
+ explicit: {
13
+ type: BooleanConstructor;
14
+ default: boolean;
15
+ };
16
+ }, {
17
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
18
+ selectedList: {
19
+ type: PropType<ISelectLabelItemType[]>;
20
+ default: () => never[];
21
+ };
22
+ categoryList: {
23
+ type: PropType<ICategoryLabelItemType[]>;
24
+ default: () => never[];
25
+ };
26
+ explicit: {
27
+ type: BooleanConstructor;
28
+ default: boolean;
29
+ };
30
+ }>> & {
31
+ onOnChange?: ((...args: any[]) => any) | undefined;
32
+ }>>;
33
+ emit: (event: "onChange", ...args: any[]) => void;
34
+ labelFormContentRef: any;
35
+ outSelectedList: import("vue").Ref<ISelectLabelItemType[] | undefined>;
36
+ state: {
37
+ labelVisible: boolean;
38
+ isChangeWindow: boolean;
39
+ modalWidth: string;
40
+ modalHeight: string;
41
+ maxHeight: string;
42
+ };
43
+ closeTag: (selectItem: ISelectLabelItemType) => void;
44
+ handleEditLabel: () => void;
45
+ handleLabelCancel: () => void;
46
+ changeModalWindow: () => void;
47
+ handleSaveLabel: () => void;
48
+ explicitOnChange: () => void;
49
+ NTag: any;
50
+ NIcon: any;
51
+ NModal: any;
52
+ NSpace: any;
53
+ NTooltip: any;
54
+ AddCircleOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
55
+ labelFormContent: import("vue").DefineComponent<{
56
+ selectedList: {
57
+ type: PropType<ISelectLabelItemType[]>;
58
+ default: () => never[];
59
+ };
60
+ categoryList: {
61
+ type: PropType<ICategoryLabelItemType[]>;
62
+ default: () => never[];
63
+ };
64
+ isChangeWindow: {
65
+ type: BooleanConstructor;
66
+ default: boolean;
67
+ };
68
+ explicit: {
69
+ type: BooleanConstructor;
70
+ default: boolean;
71
+ };
72
+ }, {
73
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
74
+ selectedList: {
75
+ type: PropType<ISelectLabelItemType[]>;
76
+ default: () => never[];
77
+ };
78
+ categoryList: {
79
+ type: PropType<ICategoryLabelItemType[]>;
80
+ default: () => never[];
81
+ };
82
+ isChangeWindow: {
83
+ type: BooleanConstructor;
84
+ default: boolean;
85
+ };
86
+ explicit: {
87
+ type: BooleanConstructor;
88
+ default: boolean;
89
+ };
90
+ }>> & {
91
+ onExplicitOnChange?: ((...args: any[]) => any) | undefined;
92
+ }>>;
93
+ emit: (event: "explicitOnChange", ...args: any[]) => void;
94
+ curSelectedList: import("vue").Ref<ISelectLabelItemType[] | undefined>;
95
+ labelFormContent: any;
96
+ anchorGetContainer: () => any;
97
+ handleAnchorClick: (e: Event) => void;
98
+ handleLabelForm: (cb: Function) => void;
99
+ handleLabelChange: (isSelect: boolean, labelItem: any, categoryItem?: any) => void;
100
+ NAnchor: any;
101
+ NAnchorLink: import("vue").DefineComponent<{
102
+ readonly title: StringConstructor;
103
+ readonly href: StringConstructor;
104
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
105
+ readonly title: StringConstructor;
106
+ readonly href: StringConstructor;
107
+ }>>, {}>;
108
+ labelClassify: import("vue").DefineComponent<{
109
+ categoryItem: {
110
+ type: PropType<ICategoryLabelItemType>;
111
+ default: () => {};
112
+ };
113
+ selectedList: {
114
+ type: PropType<ISelectLabelItemType[]>;
115
+ default: () => never[];
116
+ };
117
+ handleLabelChange: {
118
+ type: FunctionConstructor;
119
+ default: () => {};
120
+ };
121
+ }, {
122
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
123
+ categoryItem: {
124
+ type: PropType<ICategoryLabelItemType>;
125
+ default: () => {};
126
+ };
127
+ selectedList: {
128
+ type: PropType<ISelectLabelItemType[]>;
129
+ default: () => never[];
130
+ };
131
+ handleLabelChange: {
132
+ type: FunctionConstructor;
133
+ default: () => {};
134
+ };
135
+ }>> & {}>>;
136
+ labelList: import("vue").Ref<{
137
+ labelCode: string;
138
+ labelShowText: string;
139
+ backgroundColor: string;
140
+ }[]>;
141
+ showCheck: (label: import("../../../../es/components/iho-select-label/src/types").IhoTabLabelItemType) => boolean;
142
+ onHandleLabelChange: (isSelect?: boolean | undefined, item?: import("../../../../es/components/iho-select-label/src/types").IhoTabLabelItemType | undefined, categoryItem?: ICategoryLabelItemType | undefined) => void;
143
+ formatStyle: (item: any) => {
144
+ background?: undefined;
145
+ } | {
146
+ background: any;
147
+ };
148
+ NTag: any;
149
+ NTooltip: any;
150
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
151
+ categoryItem: {
152
+ type: PropType<ICategoryLabelItemType>;
153
+ default: () => {};
154
+ };
155
+ selectedList: {
156
+ type: PropType<ISelectLabelItemType[]>;
157
+ default: () => never[];
158
+ };
159
+ handleLabelChange: {
160
+ type: FunctionConstructor;
161
+ default: () => {};
162
+ };
163
+ }>>, {
164
+ selectedList: ISelectLabelItemType[];
165
+ handleLabelChange: Function;
166
+ categoryItem: ICategoryLabelItemType;
167
+ }>;
168
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "explicitOnChange"[], "explicitOnChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
169
+ selectedList: {
170
+ type: PropType<ISelectLabelItemType[]>;
171
+ default: () => never[];
172
+ };
173
+ categoryList: {
174
+ type: PropType<ICategoryLabelItemType[]>;
175
+ default: () => never[];
176
+ };
177
+ isChangeWindow: {
178
+ type: BooleanConstructor;
179
+ default: boolean;
180
+ };
181
+ explicit: {
182
+ type: BooleanConstructor;
183
+ default: boolean;
184
+ };
185
+ }>> & {
186
+ onExplicitOnChange?: ((...args: any[]) => any) | undefined;
187
+ }, {
188
+ selectedList: ISelectLabelItemType[];
189
+ explicit: boolean;
190
+ isChangeWindow: boolean;
191
+ categoryList: ICategoryLabelItemType[];
192
+ }>;
193
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "onChange"[], "onChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
194
+ selectedList: {
195
+ type: PropType<ISelectLabelItemType[]>;
196
+ default: () => never[];
197
+ };
198
+ categoryList: {
199
+ type: PropType<ICategoryLabelItemType[]>;
200
+ default: () => never[];
201
+ };
202
+ explicit: {
203
+ type: BooleanConstructor;
204
+ default: boolean;
205
+ };
206
+ }>> & {
207
+ onOnChange?: ((...args: any[]) => any) | undefined;
208
+ }, {
209
+ selectedList: ISelectLabelItemType[];
210
+ explicit: boolean;
211
+ categoryList: ICategoryLabelItemType[];
212
+ }>;
213
+ export default _default;
@@ -0,0 +1 @@
1
+ import{defineComponent as e,ref as l,reactive as i,watch as a,openBlock as t,createElementBlock as o,Fragment as n,createElementVNode as s,createBlock as d,unref as c,withCtx as r,renderList as p,createVNode as h,toDisplayString as m,createTextVNode as g,createCommentVNode as u,normalizeClass as x,normalizeStyle as b}from"vue";import{NSpace as f,NTag as C,NTooltip as y,NIcon as v,NModal as w}from"naive-ui";import{AddCircleOutline as L}from"@vicons/ionicons5";import W from"./LabelFormContent.vue.js";import _ from"../../../_virtual/plugin-vue_export-helper.js";const k={class:"c-iho-select-label"},H={key:1,class:"outexplicit"},z=s("span",null,"选择标签",-1),S={class:"svg-wrap"};var V=_(e({__name:"SelectLabel",props:{selectedList:{type:Array,default:()=>[]},categoryList:{type:Array,default:()=>[]},explicit:{type:Boolean,default:!1}},emits:["onChange"],setup(e,{emit:_}){const V=e,A=l(null),F=l(),I=i({labelVisible:!1,isChangeWindow:!1,modalWidth:"763px",modalHeight:"404px",maxHeight:"404px"}),O=()=>{V.explicit||(I.labelVisible=!0)},N=()=>{V.explicit||(I.modalWidth="763px",I.modalHeight="404px",I.maxHeight="404px",I.isChangeWindow=!1,I.labelVisible=!1)},j=()=>{I.isChangeWindow=!I.isChangeWindow;let e=document.body.clientHeight;I.modalWidth="763px"===I.modalWidth?"100%":"763px",I.modalHeight="404px"===I.modalHeight?e-110+"px":"404px",I.maxHeight="auto"===I.modalHeight?"404px":"none"},E=()=>{var e;null==(e=A.value)||e.handleLabelForm((e=>{_("onChange",[...e]),F.value=e,N()}))},J=()=>{E()};return a((()=>V.selectedList),(e=>{if(e){let l=Array.isArray(e)?e:[];F.value=JSON.parse(JSON.stringify(l))}}),{immediate:!0,deep:!0}),(l,i)=>(t(),o(n,null,[s("div",k,[e.explicit?u("v-if",!0):(t(),d(c(f),{key:0,align:"center"},{default:r((()=>[(t(!0),o(n,null,p(F.value,(e=>(t(),d(c(C),{bordered:!1,key:`${e.classifyId}-${e.labelCode}`,class:"select-label-active",size:"small",closable:"",onClose:l=>(e=>{const l=F.value||[],i=l.findIndex((l=>l.classifyId==e.classifyId&&l.labelCode==e.labelCode));i>-1&&l.splice(i,1),F.value=l,_("onChange",[...l])})(e)},{default:r((()=>[h(c(y),{placement:"top-start"},{trigger:r((()=>[s("span",null,m(e.labelShowText),1)])),default:r((()=>[s("span",null,m(e.labelShowText),1)])),_:2},1024)])),_:2},1032,["onClose"])))),128)),e.explicit?u("v-if",!0):(t(),o("span",{key:0,class:"form-add-icon form-add-icon-label",onClick:O},[h(c(v),{class:"add-icon",component:c(L)},null,8,["component"]),g(" 新增 ")]))])),_:1})),e.explicit?(t(),o("div",H,[h(W,{ref_key:"labelFormContentRef",ref:A,categoryList:e.categoryList,selectedList:e.selectedList,isChangeWindow:I.isChangeWindow,explicit:e.explicit,onExplicitOnChange:J},null,8,["categoryList","selectedList","isChangeWindow","explicit"])])):u("v-if",!0)]),u(" 弹窗 "),h(c(w),{preset:"dialog",class:x(["label-form-modal-wrap modal-wrap standard-modal standard-modal-white",{"modal-screen":I.isChangeWindow}]),show:I.labelVisible,"onUpdate:show":i[0]||(i[0]=e=>I.labelVisible=e),onPositiveClick:E,onNegativeClick:N,onClose:N,"mask-closable":!1,"close-on-esc":!1,"show-icon":!1,"negative-text":"取消","positive-text":"确定",style:b({width:I.modalWidth})},{header:r((()=>[z,s("div",S,[s("i",{onClick:j,class:x(["iconfont-select-label",I.isChangeWindow?"icon-iho-select-label-menzhenyishengzhanxitongtubiaozuixiaohua2":"icon-iho-select-label-menzhenyishengzhanxitongtubiaozuidahua"])},null,2)])])),default:r((()=>[h(W,{ref_key:"labelFormContentRef",ref:A,categoryList:e.categoryList,selectedList:F.value,isChangeWindow:I.isChangeWindow,explicit:e.explicit,onExplicitOnChange:J},null,8,["categoryList","selectedList","isChangeWindow","explicit"])])),_:1},8,["show","class","style"])],64))}}),[["__file","SelectLabel.vue"]]);export{V as default};
@@ -0,0 +1,63 @@
1
+ import { PropType } from 'vue';
2
+ import { ICategoryLabelItemType, ISelectLabelItemType, IhoTabLabelItemType } from '../../../../../es/components/iho-select-label/src/types';
3
+ declare const _default: import("vue").DefineComponent<{
4
+ categoryItem: {
5
+ type: PropType<ICategoryLabelItemType>;
6
+ default: () => {};
7
+ };
8
+ selectedList: {
9
+ type: PropType<ISelectLabelItemType[]>;
10
+ default: () => never[];
11
+ };
12
+ handleLabelChange: {
13
+ type: FunctionConstructor;
14
+ default: () => {};
15
+ };
16
+ }, {
17
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
18
+ categoryItem: {
19
+ type: PropType<ICategoryLabelItemType>;
20
+ default: () => {};
21
+ };
22
+ selectedList: {
23
+ type: PropType<ISelectLabelItemType[]>;
24
+ default: () => never[];
25
+ };
26
+ handleLabelChange: {
27
+ type: FunctionConstructor;
28
+ default: () => {};
29
+ };
30
+ }>> & {}>>;
31
+ labelList: import("vue").Ref<{
32
+ labelCode: string;
33
+ labelShowText: string;
34
+ backgroundColor: string;
35
+ }[]>;
36
+ showCheck: (label: IhoTabLabelItemType) => boolean;
37
+ onHandleLabelChange: (isSelect?: boolean, item?: IhoTabLabelItemType, categoryItem?: ICategoryLabelItemType) => void;
38
+ formatStyle: (item: any) => {
39
+ background?: undefined;
40
+ } | {
41
+ background: any;
42
+ };
43
+ NTag: any;
44
+ NTooltip: any;
45
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
46
+ categoryItem: {
47
+ type: PropType<ICategoryLabelItemType>;
48
+ default: () => {};
49
+ };
50
+ selectedList: {
51
+ type: PropType<ISelectLabelItemType[]>;
52
+ default: () => never[];
53
+ };
54
+ handleLabelChange: {
55
+ type: FunctionConstructor;
56
+ default: () => {};
57
+ };
58
+ }>>, {
59
+ selectedList: ISelectLabelItemType[];
60
+ handleLabelChange: Function;
61
+ categoryItem: ICategoryLabelItemType;
62
+ }>;
63
+ export default _default;
@@ -0,0 +1 @@
1
+ import{defineComponent as e,ref as l,openBlock as a,createElementBlock as t,unref as s,Fragment as c,renderList as d,createBlock as n,normalizeStyle as o,withCtx as r,createVNode as i,createElementVNode as u,toDisplayString as p}from"vue";import{NTag as b,NTooltip as y}from"naive-ui";import f from"../../../../_virtual/plugin-vue_export-helper.js";const h={class:"edit-content"},g={key:0,class:"label-disable-wrap"},m=[u("p",{class:"label-disable-title"},"无可选标签",-1),u("p",{class:"label-disable-desc"},"请联系管理员进行标签管理设置",-1)],v={key:1,class:"label-content"};var k=f(e({__name:"label-classify",props:{categoryItem:{type:Object,default:()=>({})},selectedList:{type:Array,default:()=>[]},handleLabelChange:{type:Function,default:()=>({})}},setup(e){var f;const k=e;let _=l((null==(f=k.categoryItem)?void 0:f.labelList)||[]);const I=e=>k.selectedList.findIndex((l=>l.classifyId===k.categoryItem.classifyId&&l.labelCode===e.labelCode))>-1;function C(e){return I(e)?{}:{background:e.backgroundColor}}return(l,f)=>(a(),t("div",h,[s(_)&&0!==s(_).length?(a(),t("div",v,[(a(!0),t(c,null,d(s(_),(l=>(a(),n(s(b),{checkable:"",checked:I(l),"onUpdate:checked":a=>((e,l,a)=>{k.handleLabelChange(e,l,a)})(a,l,e.categoryItem),key:l.labelCode,style:o(C(l))},{default:r((()=>[i(s(y),{placement:"top-start"},{trigger:r((()=>[u("span",null,p(l.labelShowText),1)])),default:r((()=>[u("span",null,p(l.labelShowText),1)])),_:2},1024)])),_:2},1032,["checked","onUpdate:checked","style"])))),128))])):(a(),t("div",g,m))]))}}),[["__file","label-classify.vue"]]);export{k as default};
@@ -0,0 +1,11 @@
1
+ export declare type ICategoryLabelItemType = {
2
+ classifyId: string;
3
+ classifyName: string;
4
+ labelList: IhoTabLabelItemType[];
5
+ };
6
+ export declare type IhoTabLabelItemType = {
7
+ labelCode: string;
8
+ labelShowText: string;
9
+ backgroundColor: string;
10
+ };
11
+ export declare type ISelectLabelItemType = Pick<ICategoryLabelItemType, 'classifyId' | 'classifyName'> & Pick<IhoTabLabelItemType, 'labelCode' | 'labelShowText' | 'backgroundColor'>;
@@ -0,0 +1 @@
1
+ @font-face{font-family:iho-select-label-iconfont;src:url(iho-select-label-iconfont.ttf) format("truetype")}.iconfont-select-label{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:iho-select-label-iconfont!important;font-size:14px;font-style:normal}.icon-iho-select-label-menzhenyishengzhanxitongtubiaozuixiaohua2:before{content:"\e778"}.icon-iho-select-label-menzhenyishengzhanxitongtubiaozuidahua:before{content:"\e779"}.c-iho-select-label .form-add-icon-label{align-items:center;color:#2d7aff;cursor:pointer;display:inline-flex;vertical-align:middle}.c-iho-select-label .n-tag{border:1px solid #e0e0e6;margin:0 8px 0 0;max-width:108px}.c-iho-select-label .n-tag .n-base-icon{color:#fff}.c-iho-select-label .n-tag .n-tag__content{align-items:center;display:inline-block;line-height:20px;max-width:80px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.c-iho-select-label .n-tag.select-label-active{background:var(--n-color-checked);border-color:var(--n-color-checked);color:var(--n-text-color-checked)}.c-iho-label-form-content{border-bottom:1px solid #e8e8e8;border-top:1px solid #e8e8e8;height:100%;width:100%}.c-iho-label-form-content .label-wrap{display:flex;height:100%;width:100%}.c-iho-label-form-content .label-wrap .left-label-wrap{border-right:1px solid #e8e8e8;max-height:404px;width:140px}.c-iho-label-form-content .label-wrap .left-label-wrap.total-left-label-wrap{height:calc(100vh - 109px);max-height:calc(100vh - 109px)}.c-iho-label-form-content .label-wrap .left-label-wrap.explicit-label-wrap{height:auto;overflow:hidden;overflow-y:auto;width:100%}.c-iho-label-form-content .label-wrap .left-label-wrap .n-anchor.n-anchor--block .n-anchor-link{font-size:14px;padding:10px 8px}.c-iho-label-form-content .label-wrap .left-label-wrap .n-anchor.n-anchor--block .n-anchor-link.n-anchor-link--active{background-color:#f2f2f2}.c-iho-label-form-content .label-wrap .right-label-wrap{flex:1;max-height:404px;overflow-y:auto}.c-iho-label-form-content .label-wrap .right-label-wrap.total-right-label-wrap{max-height:calc(100vh - 109px)}.c-iho-label-form-content .edit-label-type{font-size:12px;margin-left:4px}.c-iho-label-form-content .edit-label-content{margin-top:10px;padding:0 14px}.c-iho-label-form-content .edit-label-content .edit-content{margin-top:8px;width:100%}.c-iho-label-form-content .edit-label-content .edit-content .n-tag{border:1px solid #e0e0e6;margin:0 8px 8px 0;max-width:108px;text-align:center}.c-iho-label-form-content .edit-label-content .edit-content .n-tag .n-tag__content{align-items:center;display:inline-flex}.c-iho-label-form-content .edit-label-content .edit-content .n-tag .n-tag__content span{display:inline-block;height:100%;line-height:30px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:80px}.c-iho-label-form-content .edit-label-content .edit-content .n-tag.n-tag--checked{background:var(--n-color-checked);border-color:var(--n-color-checked);color:var(--n-text-color-checked)}.n-dialog__title .svg-wrap{margin:0 0 0 auto}.n-dialog__title .svg-wrap i{cursor:pointer;font-size:16px}
@@ -1 +1 @@
1
- import{promiseTimeout as e}from"@vueuse/shared";import"../../../index.js";import{useSessionStorage as n}from"@vueuse/core";import{isEqual as o,isFunction as t}from"lodash-es";import{selectOptionsMap as l}from"../rendererPlugins/editableWidgets/hooks/useSelectOption.js";import{IhoTableUtils as i}from"../../utils/index.js";import{EDITABLE_WIDGET_TYPE as r}from"../../constants/index.js";import{defineTablePlugin as u}from"../../hooks/useTablePlugin.js";function d(){const d="keyboardEventPlugin",s=n("ihoTableClipData",null);return u({name:d,apply(n){function u(e,n,u,d,c){var p,f;if(!(null==(p=null==u?void 0:u.keyboardConfig)?void 0:p.isClip))return;const{row:v,column:m}=n.getSelectedCell()||n.getEditRecord()||{};if(!v||!m||!a(m)&&s.value===v[m.field])return;const g=u.uuid&&a(m)&&l.get(u.uuid)[m.field],b=v[m.field];if("copy"===e){const e=(null==(f=(g||[]).filter((e=>b.includes(e.value))))?void 0:f.map((e=>e.label)).join(","))||b;s.value=e}else{if(!function(e){var n;const o=null==(n=e.editRender)?void 0:n.props;return o&&Object.keys(r).includes(i.getCellType(o))}(m)||v.$__SEPARATE||!function(e,n,o,l){var i,r;const{beforeEditMethod:u}=n.editConfig||{},d={rowIndex:null!=(i=e.getRowIndex(o))?i:0,columnIndex:null!=(r=e.getColumnIndex(l))?r:0};return!u||t(u)&&u({row:o,column:l,...d,$table:e,$grid:void 0})}(n,u,v,m))return;let e=s.value||"";if(function(e){var n,o;const t=null==(n=e.editRender)?void 0:n.props;return a(e)&&(null==(o=t.componentProps)?void 0:o.multiple)}(m)){const n=(g||[]).filter((n=>e.split(",").includes(n.label))).map((e=>e.value));if(!(null==n?void 0:n.length)||o(b,n))return;e=n}else{const n=(g||[]).find((n=>n.label===e));if(g&&(!n||b===n.value))return;n&&(e=n.value)}v[m.field]=e,d("formChange",{column:m,row:v,oldValue:b,value:e,index:n.getRowIndex(v)}),function(e){var n;const o=null==(n=e.editRender)?void 0:n.props;return o&&"SEPARATE"===i.getCellType(o)}(m)&&(null==c||c())}}function a(e){var n;const o=null==(n=e.editRender)?void 0:n.props;return o&&"SELECT"===i.getCellType(o)}n.eventHooks.onCopy.tap(d,(({$table:e},n,{emits:o})=>u("copy",e,n,o))),n.eventHooks.onPaste.tap(d,(({$table:e},n,{emits:o,updateTableDataRef:t})=>u("paste",e,n,o,t))),n.eventHooks.onKeydown.tap(d,(async({$event:n,$table:o},t,{emits:l})=>{await e(0);const{row:i,column:r}=o.getSelectedCell()||o.getEditRecord()||{};if(!i||!r)return;l("keyboard",{key:n.key,index:o.getRowIndex(i),value:i[r.field],row:i,column:r})}))}})}export{d as keyboardEventPlugin};
1
+ import{unref as e}from"vue";import{promiseTimeout as n}from"@vueuse/shared";import"../../../index.js";import{useSessionStorage as t}from"@vueuse/core";import{isString as o,trim as i,isEmpty as r,isEqual as l,isFunction as u}from"lodash-es";import{selectOptionsMap as d}from"../rendererPlugins/editableWidgets/hooks/useSelectOption.js";import{IhoTableUtils as a}from"../../utils/index.js";import{EDITABLE_WIDGET_TYPE as s}from"../../constants/index.js";import{parse as c,isValid as p,compareDesc as f}from"date-fns";import{defineTablePlugin as m}from"../../hooks/useTablePlugin.js";function v(){const v="keyboardEventPlugin",g=t("ihoTableClipData","");return m({name:v,apply(t){function m(n,t,m,v,w){var b,y;if(!(null==(b=null==m?void 0:m.keyboardConfig)?void 0:b.isClip))return;const{row:C,column:R}=t.getSelectedCell()||t.getEditRecord()||{};if(!C||!R||!E(R,s.SELECT)&&e(g)===C[R.field])return;const x=m.uuid&&E(R,s.SELECT)&&d.get(m.uuid)[R.field],T=C[R.field];if("copy"===n){const e=(null==(y=(x||[]).filter((e=>T.includes(e.value))))?void 0:y.map((e=>e.label)).join(","))||T;g.value=e}else{if(o(e(g))&&(g.value=i(e(g)||"")),!e(g)||!function(e){var n;const t=null==(n=e.editRender)?void 0:n.props;return t&&Object.keys(s).includes(a.getCellType(t))}(R)||C.$__SEPARATE||!function(e,n,t,o){var i,r;const{beforeEditMethod:l}=n.editConfig||{},d={rowIndex:null!=(i=e.getRowIndex(t))?i:0,columnIndex:null!=(r=e.getColumnIndex(o))?r:0};return!l||u(l)&&l({row:t,column:o,...d,$table:e,$grid:void 0})}(t,m,C,R))return;if(E(R,s.DATE)&&function(n,t){var i;const r=null==(i=n.editRender)?void 0:i.props,l=e(g)||"";return!p(new Date(l))||o(r.connectField)&&t[r.connectField]&&(r.isStartDate&&f(new Date(l),new Date(t[r.connectField]))<0||r.isEndDate&&f(new Date(l),new Date(t[r.connectField]))>0)}(R,C))return;if(E(R,s.NUMBER)&&!/^-?\d*\.?\d+$/.test((e(g)||"").toString()))return;if(E(R,s.TIME)&&function(n){var t,o;const i=e(g)||"",r=null==(t=n.editRender)?void 0:t.props,l=c(i,(null==(o=null==r?void 0:r.componentProps)?void 0:o.valueFormat)||"HH:mm",new Date);return!p(l)}(R))return;let n=e(g)||"";if(x&&!r(x)){const e=x.filter((e=>n.split(",").includes(e.label))).map((e=>e.value));if(r(e))return;if(function(e){var n,t;const o=null==(n=e.editRender)?void 0:n.props;return E(e,s.SELECT)&&(null==(t=o.componentProps)?void 0:t.multiple)}(R)){if(l(T,e))return;n=e}else{if(e.includes(T))return;n=e[0]}}C[R.field]=n,v("formChange",{column:R,row:C,oldValue:T,value:n,index:t.getRowIndex(C)}),E(R,s.SEPARATE)&&(null==w||w())}}function E(e,n){var t;const o=null==(t=e.editRender)?void 0:t.props;return o&&a.getCellType(o)===n}t.eventHooks.onCopy.tap(v,(({$table:e},n,{emits:t})=>m("copy",e,n,t))),t.eventHooks.onPaste.tap(v,(({$table:e},n,{emits:t,updateTableDataRef:o})=>m("paste",e,n,t,o))),t.eventHooks.onKeydown.tap(v,(async({$event:e,$table:t},o,{emits:i})=>{await n(0);const{row:r,column:l}=t.getSelectedCell()||t.getEditRecord()||{};if(!r||!l)return;i("keyboard",{key:e.key,index:t.getRowIndex(r),value:r[l.field],row:r,column:l})}))}})}export{v as keyboardEventPlugin};
@@ -1,7 +1,6 @@
1
- import { Func } from '../../../../../../../../es/shared/types';
1
+ import { Func, AnyObject } from '../../../../../../../../es/shared/types';
2
2
  import { type PropType } from 'vue';
3
3
  import { VxeTableDefines } from 'vxe-table';
4
- import { AnyObject } from '../../../../../../../../es/shared/types';
5
4
  declare const _default: import("vue").DefineComponent<{
6
5
  value: {
7
6
  type: StringConstructor;
@@ -44,8 +43,14 @@ declare const _default: import("vue").DefineComponent<{
44
43
  emitFormChangeWithParams: (params?: AnyObject) => void;
45
44
  emit: (event: "update:value", ...args: any[]) => void;
46
45
  formRef: import("vue").Ref<any>;
47
- formattedValue: any;
48
- onConfirm: (value: any) => void;
46
+ formattedValue: import("vue").WritableComputedRef<string | undefined>;
47
+ formatConfig: import("vue").ComputedRef<{
48
+ valueFormat: string;
49
+ format: string;
50
+ timePickerProps: {
51
+ format: string | undefined;
52
+ };
53
+ }>;
49
54
  isStartDate: any;
50
55
  isEndDate: any;
51
56
  connectField: string;
@@ -56,15 +61,13 @@ declare const _default: import("vue").DefineComponent<{
56
61
  isMinuteDisabled: (minute: number) => boolean;
57
62
  isSecondDisabled: (second: number) => boolean;
58
63
  };
59
- customDateDisabledDecorator: (customDateDisabled?: Func) => ((ts: number) => any) | null;
60
- formatConfig: import("vue").ComputedRef<{
61
- valueFormat: string;
62
- format: string;
63
- timePickerProps: {
64
- format: string | undefined;
65
- };
66
- }>;
67
64
  dateConfig: AnyObject;
65
+ customDateDisabledDecorator: (customDateDisabled?: Func) => ((ts: number) => any) | null;
66
+ getDetailTime: (date: Date) => {
67
+ h: number;
68
+ m: number;
69
+ s: number;
70
+ };
68
71
  DatePicker: import("../../../../../../../../es/shared/types").SFCWithInstall<import("vue").DefineComponent<{
69
72
  updateUnchangedValue: {
70
73
  type: BooleanConstructor;
@@ -1 +1 @@
1
- import{defineComponent as e,useAttrs as t,ref as r,computed as i,watch as a,onMounted as l,openBlock as o,createBlock as u,unref as n,mergeProps as s}from"vue";import{generateTimeFormat as d}from"../../../../../../../shared/utils/index.js";import{isFunction as m}from"lodash-es";import{useIhoTableFormEvent as p}from"../../../../utils/index.js";import c from"../../../../../../date-picker/index.js";import v from"../../../../../../../_virtual/plugin-vue_export-helper.js";var f=v(e({__name:"editDate",props:{value:{type:String,default:void 0},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0}},emits:["update:value"],setup(e,{emit:v}){const f=e,w=t(),{emitFormChangeWithParams:D}=p(f),g=r(),y=r(f.value),b=e=>{y.value=e;const t=f.value;t!==e&&(v("update:value",e),D({oldValue:t}))},{isStartDate:$=!1,isEndDate:h=!1}=w,S=w.connectField||"",T=(e,t)=>$&&S?e>t:!(!h||!S)&&e<t,_=e=>{const t=new Date(f.row[S]),r=new Date(e),i=t.getHours(),a=t.getMinutes(),l=t.getSeconds(),o=(e,t,r,i)=>!(h&&r>i)&&(!($&&r<i)&&T(e,t));return{isHourDisabled:t=>{if(!f.row[S])return!1;const a=new Date(`${f.row[S].split(" ")[0]} 00:00:00`).getTime(),l=r.getMinutes(),u=r.getSeconds();return o(t,i,e-60*t*60*1e3-60*l*1e3-1e3*u,a)},isMinuteDisabled:t=>{if(!f.row[S])return!1;const l=new Date(`${f.row[S].split(" ")[0]} ${i}:00:00`).getTime(),u=r.getSeconds();return o(t,a,e-60*t*1e3-1e3*u,l)},isSecondDisabled:t=>{if(!f.row[S])return!1;const r=new Date(`${f.row[S].split(" ")[0]} ${i}:${a}:00`).getTime();return o(t,l,e-1e3*t,r)}}};function j(e){return m(e)?t=>e(t,f.row):null}const x=i((()=>{const e=w.valueFormat||"yyyy-MM-dd HH:mm:ss";return{valueFormat:e,format:e,timePickerProps:{format:d(e)}}})),M={type:w.type||"datetime",clearable:!0,placeholder:w.placeholder||"请选择",...w,...x.value,isDateDisabled:j(w.isDateDisabled)||(e=>!!f.row[S]&&T(e,h?new Date(`${f.row[S].split(" ")[0]} 00:00:00`).getTime():new Date(f.row[S]).getTime()))};return M.type.includes("time")&&(M.isTimeDisabled=j(w.isTimeDisabled)||_),a((()=>f.value),(e=>{y.value=e})),l((()=>{var e,t,r,i,a,l,o;return null==(o=null==(a=null==(r=null==(t=null==(e=g.value)?void 0:e.$datePicker)?void 0:t.inputInstRef)?void 0:(i=r.$el).querySelector)?void 0:(l=a.call(i,"input")).select)?void 0:o.call(l)})),(e,t)=>(o(),u(n(c),s({ref_key:"formRef",ref:g,"formatted-value":y.value},n(M),{"onUpdate:formattedValue":b}),null,16,["formatted-value"]))}}),[["__file","editDate.vue"]]);export{f as default};
1
+ import{defineComponent as e,useAttrs as t,ref as r,computed as i,onMounted as l,openBlock as a,createBlock as o,unref as u,mergeProps as n,isRef as s}from"vue";import{generateTimeFormat as d}from"../../../../../../../shared/utils/index.js";import{isFunction as m}from"lodash-es";import{useIhoTableFormEvent as p}from"../../../../utils/index.js";import c from"../../../../../../date-picker/index.js";import v from"../../../../../../../_virtual/plugin-vue_export-helper.js";var f=v(e({__name:"editDate",props:{value:{type:String,default:void 0},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0}},emits:["update:value"],setup(e,{emit:v}){const f=e,w=t(),{emitFormChangeWithParams:D}=p(f),y=r(),g=i({get:()=>f.value,set(e){const t=f.value;t!==e&&(v("update:value",e),D({oldValue:t}))}}),b=i((()=>{const e=w.valueFormat||"yyyy-MM-dd HH:mm:ss";return{valueFormat:e,format:e,timePickerProps:{format:d(e)}}})),{isStartDate:h=!1,isEndDate:$=!1}=w,T=w.connectField||"",_=(e,t)=>h&&T?e>t:!(!$||!T)&&e<t,j=e=>{const t=new Date(f.row[T]),r=new Date(e),{h:i,m:l,s:a}=k(t),o=(e,t,r,i)=>!($&&r>i)&&(!(h&&r<i)&&_(e,t));return{isHourDisabled:t=>{if(!f.row[T])return!1;const l=new Date(`${f.row[T].split(" ")[0]} 00:00:00`).getTime(),{m:a,s:u}=k(r);return o(t,i,e-60*t*60*1e3-60*a*1e3-1e3*u,l)},isMinuteDisabled:t=>{if(!f.row[T])return!1;const a=new Date(`${f.row[T].split(" ")[0]} ${i}:00:00`).getTime(),{s:u}=k(r);return o(t,l,e-60*t*1e3-1e3*u,a)},isSecondDisabled:t=>{if(!f.row[T])return!1;const r=new Date(`${f.row[T].split(" ")[0]} ${i}:${l}:00`).getTime();return o(t,a,e-1e3*t,r)}}},x={type:w.type||"datetime",clearable:!0,placeholder:w.placeholder||"请选择",...w,...b.value,isDateDisabled:S(w.isDateDisabled)||(e=>!!f.row[T]&&_(e,$?new Date(`${f.row[T].split(" ")[0]} 00:00:00`).getTime():new Date(f.row[T]).getTime()))};function S(e){return m(e)?t=>e(t,f.row):null}function k(e){return{h:e.getHours(),m:e.getMinutes(),s:e.getSeconds()}}return x.type.includes("time")&&(x.isTimeDisabled=S(w.isTimeDisabled)||j),l((()=>{var e,t,r,i,l,a,o;return null==(o=null==(l=null==(r=null==(t=null==(e=y.value)?void 0:e.$datePicker)?void 0:t.inputInstRef)?void 0:(i=r.$el).querySelector)?void 0:(a=l.call(i,"input")).select)?void 0:o.call(a)})),(e,t)=>(a(),o(u(c),n({ref_key:"formRef",ref:y},u(x),{"formatted-value":u(g),"onUpdate:formatted-value":t[0]||(t[0]=e=>s(g)?g.value=e:null)}),null,16,["formatted-value"]))}}),[["__file","editDate.vue"]]);export{f as default};
@@ -1 +1 @@
1
- import{ref as o,onMounted as e}from"vue";const u=()=>{const u=o(null);const n=o(!1);return e((()=>{var o;null==(o=u.value)||o.focus(),n.value=!0})),{formRef:u,setRef:function(o){u.value=o},isShow:n}};export{u as useAutoFocus};
1
+ import{checkInSetupEnv as o}from"../../../../../../../shared/utils/index.js";import{inject as e,ref as n,onMounted as t}from"vue";import{InjectionIhoTableConfig as r}from"../../../../constants/index.js";const s=()=>{o();const s=e(r,n({})),u=n(null);const i=n(!1);return t((()=>{var o,e;"row"!==(null==(o=s.value.editConfig)?void 0:o.mode)&&(null==(e=u.value)||e.focus(),i.value=!0)})),{formRef:u,setRef:function(o){u.value=o},isShow:i}};export{s as useAutoFocus};
@@ -46,7 +46,7 @@ declare const _default: import("vue").DefineComponent<{
46
46
  formRef: import("vue").Ref<HTMLElement | null>;
47
47
  isShow: import("vue").Ref<boolean>;
48
48
  timePickerRef: import("vue").Ref<any>;
49
- formattedValue: import("vue").Ref<any>;
49
+ inputValue: import("vue").Ref<any>;
50
50
  __formattedValue: import("vue").Ref<any>;
51
51
  oldValue: string | undefined;
52
52
  placeholder: any;
@@ -1 +1 @@
1
- import{defineComponent as e,useAttrs as l,ref as t,watch as a,nextTick as o,openBlock as r,createBlock as u,unref as i,mergeProps as n,withCtx as m,createVNode as c,createElementBlock as v,Fragment as d,renderList as f,createTextVNode as s,toDisplayString as p,createCommentVNode as _}from"vue";import{NPopover as k,NInput as h,NSpace as y,NScrollbar as w,NButton as g}from"naive-ui";import{useIhoTableFormEvent as b}from"../../../../utils/index.js";import{useAutoFocus as V}from"../hooks/useAutoFocus.js";import C from"../../../../../../time-picker/index.js";import{parse as F,isValid as j,format as q}from"date-fns";import x from"../../../../../../../_virtual/plugin-vue_export-helper.js";var R=x(e({__name:"editTime",props:{formattedValue:{type:String,default:void 0},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0}},emits:["update:formattedValue","click"],setup(e,{emit:x}){const R=e,S=l(),{emitFormChangeWithParams:A}=b(R),{formRef:I,isShow:O}=V(),P=t(),$=t(),E=t();let H=R.formattedValue;const{placeholder:T="请选择",valueFormat:U="HH:mm",shortcutOptions:z=[]}=S,D={placeholder:T,valueFormat:U,format:U};function K(e){E.value=e,H!==e&&(x("update:formattedValue",e),A({oldValue:H}),H=e)}function N(){[D.valueFormat.replace(/:/,""),D.valueFormat].some((e=>{const l=F($.value||"",e,new Date);if(j(l)){return K(q(l,D.valueFormat)),!0}}))}function W(e){var l;const{key:t}=e;"Enter"===t&&(null==(l=I.value)||l.blur(),O.value=!1)}return a((()=>R.formattedValue),(e=>{$.value=e,E.value=e}),{immediate:!0}),a((()=>O.value),(async e=>{var l,t,a,r,u;e&&(await o(),null==(u=null==(r=null==(a=null==(t=null==(l=P.value)?void 0:l.$timePicker)?void 0:t.panelInstRef)?void 0:a.$el)?void 0:r.querySelectorAll(".n-time-picker-col"))||u.forEach((e=>{var l,t;return null==(t=null==(l=null==e?void 0:e.querySelector)?void 0:l.call(e,".n-time-picker-col__item--active"))?void 0:t.scrollIntoView()})))})),(e,l)=>(r(),u(i(k),n({show:i(O),trigger:"click",showArrow:!1,placement:"bottom-start",style:{padding:"0"}},e.$attrs,{onClickoutside:l[3]||(l[3]=()=>O.value=!1)}),{trigger:m((()=>[c(i(h),{ref_key:"formRef",ref:I,clearable:"",value:$.value,"onUpdate:value":l[0]||(l[0]=e=>$.value=e),onClick:l[1]||(l[1]=()=>O.value=!0),onChange:N,onKeydown:W},null,8,["value"])])),default:m((()=>[c(i(y),null,{default:m((()=>[c(i(C),n({ref_key:"timePickerRef",ref:P,show:"","formatted-value":E.value},i(D),{class:"iho-table__time-picker",to:!1,"onUpdate:formattedValue":K,onConfirm:l[2]||(l[2]=()=>O.value=!1)}),null,16,["formatted-value"]),c(i(w),{class:"iho-table__scrollbar"},{default:m((()=>[i(z).length?(r(),u(i(y),{key:0,vertical:"",wrap:!1},{default:m((()=>[(r(!0),v(d,null,f(i(z),(e=>(r(),u(i(g),{size:"tiny",key:e,onClick:l=>function(e){K(e),O.value=!1}(e)},{default:m((()=>[s(p(e),1)])),_:2},1032,["onClick"])))),128))])),_:1})):_("v-if",!0)])),_:1})])),_:1})])),_:1},16,["show"]))}}),[["__file","editTime.vue"]]);export{R as default};
1
+ import{defineComponent as e,useAttrs as l,ref as t,watch as a,nextTick as o,openBlock as r,createBlock as u,unref as i,mergeProps as n,withCtx as m,createVNode as c,createElementBlock as v,Fragment as d,renderList as f,createTextVNode as s,toDisplayString as p,createCommentVNode as _}from"vue";import{NPopover as k,NInput as h,NSpace as y,NScrollbar as w,NButton as g}from"naive-ui";import{useIhoTableFormEvent as b}from"../../../../utils/index.js";import{useAutoFocus as V}from"../hooks/useAutoFocus.js";import C from"../../../../../../time-picker/index.js";import{parse as F,isValid as j,format as q}from"date-fns";import x from"../../../../../../../_virtual/plugin-vue_export-helper.js";var R=x(e({__name:"editTime",props:{formattedValue:{type:String,default:void 0},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0}},emits:["update:formattedValue","click"],setup(e,{emit:x}){const R=e,S=l(),{emitFormChangeWithParams:A}=b(R),{formRef:I,isShow:O}=V(),P=t(),$=t(),E=t();let H=R.formattedValue;const{placeholder:T="请选择",valueFormat:U="HH:mm",shortcutOptions:z=[]}=S,D={placeholder:T,valueFormat:U,format:U};function K(e){E.value=e,H!==e&&(x("update:formattedValue",e),A({oldValue:H}),H=e)}function N(){[D.valueFormat.replace(/:/,""),D.valueFormat].some((e=>{const l=F(($.value||"").trim(),e,new Date);if(j(l)){return K(q(l,D.valueFormat)),!0}}))}function W(e){var l;const{key:t}=e;"Enter"===t&&(null==(l=I.value)||l.blur(),O.value=!1)}return a((()=>R.formattedValue),(e=>{$.value=e,E.value=e}),{immediate:!0}),a((()=>O.value),(async e=>{var l,t,a,r,u;e&&(await o(),null==(u=null==(r=null==(a=null==(t=null==(l=P.value)?void 0:l.$timePicker)?void 0:t.panelInstRef)?void 0:a.$el)?void 0:r.querySelectorAll(".n-time-picker-col"))||u.forEach((e=>{var l,t;return null==(t=null==(l=null==e?void 0:e.querySelector)?void 0:l.call(e,".n-time-picker-col__item--active"))?void 0:t.scrollIntoView()})))})),(e,l)=>(r(),u(i(k),n({show:i(O),trigger:"click",showArrow:!1,placement:"bottom-start",style:{padding:"0"}},e.$attrs,{onClickoutside:l[3]||(l[3]=()=>O.value=!1)}),{trigger:m((()=>[c(i(h),{ref_key:"formRef",ref:I,clearable:"",value:$.value,"onUpdate:value":l[0]||(l[0]=e=>$.value=e),onClick:l[1]||(l[1]=()=>O.value=!0),onChange:N,onKeydown:W},null,8,["value"])])),default:m((()=>[c(i(y),null,{default:m((()=>[c(i(C),n({ref_key:"timePickerRef",ref:P,show:"","formatted-value":E.value},i(D),{class:"iho-table__time-picker",to:!1,"onUpdate:formattedValue":K,onConfirm:l[2]||(l[2]=()=>O.value=!1)}),null,16,["formatted-value"]),c(i(w),{class:"iho-table__scrollbar"},{default:m((()=>[i(z).length?(r(),u(i(y),{key:0,vertical:"",wrap:!1},{default:m((()=>[(r(!0),v(d,null,f(i(z),(e=>(r(),u(i(g),{size:"tiny",key:e,onClick:l=>function(e){K(e),O.value=!1}(e)},{default:m((()=>[s(p(e),1)])),_:2},1032,["onClick"])))),128))])),_:1})):_("v-if",!0)])),_:1})])),_:1})])),_:1},16,["show"]))}}),[["__file","editTime.vue"]]);export{R as default};
@@ -1 +1 @@
1
- import{promiseTimeout as e}from"@vueuse/shared";import{isFunction as l,cloneDeep as n}from"lodash-es";import{nextTick as o,onBeforeUnmount as t}from"vue";import"../../../index.js";import i from"sortablejs";import d from"xe-utils";import{defineTablePlugin as r}from"../../hooks/useTablePlugin.js";function a(){const n="rowDragPlugin",d=new Map;return r({name:n,apply(r){r.fieldHooks.fieldEnd.tapPromise(n,(async(n,{$table:t,emits:r})=>{const{uuid:a}=n,s=n.sortableConfig||{};a&&s.enable&&!d.get(a)&&(await o(),async function n(o=0){if(o>2)return;const c=function(){var e,l,n,o,i,d,r,a,u,s;const c=null==(o=null==(n=null==(l=null==(e=t.value)?void 0:e.$el)?void 0:l.querySelector)?void 0:n.call(l,".vxe-table--body"))?void 0:o.scrollWidth,v=(null==(r=null==(d=null==(i=t.value)?void 0:i.$el)?void 0:d.querySelector)?void 0:r.call(d,".vxe-table.is--scroll-x"))?".fixed-left--wrapper>.vxe-table--body tbody":".body--wrapper>.vxe-table--body tbody";return c?null==(s=null==(u=null==(a=t.value)?void 0:a.$el)?void 0:u.querySelector)?void 0:s.call(u,v):null}();if(c){const e=i.create(c,{handle:".col--seq",...s,onEnd:e=>{var n,o,i,d,a,c,v;const{oldIndex:f=0,newIndex:x=0}=e,p={oldIndex:f,newIndex:x},{virtualY:b}=(null==(n=t.value)?void 0:n.getScroll())||{};if(b){const e=(null==(d=null==(i=null==(o=t.value)?void 0:o.getTableData())?void 0:i.tableData)?void 0:d[f])||{},l=null!=(v=null!=(c=e.__currentIndex)?c:null==(a=t.value)?void 0:a.getVTRowIndex(e))?v:0,n=l+(x-f);e.__currentIndex=n,p.oldIndex=l,p.newIndex=n}const m={...e,...p,...u(e,p,t.value)};r("rowDrag",m),l(s.onEnd)&&s.onEnd(m)}});return d.set(a,e)}await e(100),n(++o)}())})),r.setupHooks.setup.tap(n,(e=>{t((()=>{var l;const n=null==(l=e.value)?void 0:l.uuid;n&&d.has(n)&&d.delete(n)}))}))}})}function u(e,l,o){var t;const i=null==(t=null==o?void 0:o.getTableData())?void 0:t.fullData,r=o.treeConfig&&o.treeConfig.transform?function(e,l){var o,t,i,r,a;const{oldIndex:u=0,newIndex:s=0}=e,c={children:"childrenList"},{fullData:v,tableData:f}=l.getTableData(),x=null==f?void 0:f[u],p=null==f?void 0:f[s-1],b=n(v),m=d.findTree(b,(e=>e.__id===x.__id),c);if(p){const e=null==(t=null==(o=l.$el)?void 0:o.querySelector)?void 0:t.call(o,".body--wrapper>.vxe-table--body tbody"),n=null==(r=null==(i=l.$el)?void 0:i.querySelector)?void 0:r.call(i,".fixed-left--wrapper>.vxe-table--body tbody"),v=d.findTree(b,(e=>e.__id===p.__id),c);if(d.findTree(x[c.children],(e=>e.__id===p.__id),c)){const l=e.children[u],o=e.children[s];return e.insertBefore(o,l),null==(a=null==n?void 0:n.insertBefore)||a.call(n,n.children[s],n.children[u]),console.log("不允许自己给自己拖动"),b}const f=m.items.splice(m.index,1)[0];l.isTreeExpandByRow(p)?p[c.children].splice(0,0,f):v.items.splice(v.index+(m.index<v.index?0:1),0,f)}else{const e=m.items.splice(m.index,1)[0];b.unshift(e)}return b}(e,o):function(e,l){var o;const{oldIndex:t=0,newIndex:i=0}=e,d=n((null==(o=null==l?void 0:l.getTableData())?void 0:o.fullData)||[]),r=d.splice(t,1)[0];return d.splice(i,0,r),d}(l,o);return{oldData:i,newData:r}}export{a as rowDragPlugin};
1
+ import{promiseTimeout as e}from"@vueuse/shared";import{isFunction as l,cloneDeep as n}from"lodash-es";import{nextTick as o,onBeforeUnmount as t}from"vue";import"../../../index.js";import i from"sortablejs";import d from"xe-utils";import{defineTablePlugin as r}from"../../hooks/useTablePlugin.js";function a(){const n="rowDragPlugin",d=new Map;return r({name:n,apply(r){r.fieldHooks.fieldEnd.tapPromise(n,(async(n,{$table:t,emits:r})=>{const{uuid:a}=n,s=n.sortableConfig||{};a&&s.enable&&!d.get(a)&&(await o(),async function n(o=0){if(o>2)return;const c=function(){var e,l,n,o,i,d,r,a,u,s;const c=null==(o=null==(n=null==(l=null==(e=t.value)?void 0:e.$el)?void 0:l.querySelector)?void 0:n.call(l,".vxe-table--body"))?void 0:o.scrollWidth,v=(null==(r=null==(d=null==(i=t.value)?void 0:i.$el)?void 0:d.querySelector)?void 0:r.call(d,".vxe-table.is--scroll-x"))?".fixed-left--wrapper>.vxe-table--body tbody":".body--wrapper>.vxe-table--body tbody";return c?null==(s=null==(u=null==(a=t.value)?void 0:a.$el)?void 0:u.querySelector)?void 0:s.call(u,v):null}();if(c){const e=i.create(c,{handle:".col--seq",...s,onEnd:e=>{var n,o,i,d,a,c,v;const{oldIndex:f=0,newIndex:x=0}=e,p={oldIndex:f,newIndex:x},{virtualY:b}=(null==(n=t.value)?void 0:n.getScroll())||{};if(b){const e=(null==(d=null==(i=null==(o=t.value)?void 0:o.getTableData())?void 0:i.tableData)?void 0:d[f])||{},l=null!=(v=null!=(c=e.__currentIndex)?c:null==(a=t.value)?void 0:a.getVTRowIndex(e))?v:0,n=l+(x-f);e.__currentIndex=n,p.oldIndex=l,p.newIndex=n}const y={...e,...p,...u(e,p,t.value)};r("rowDrag",y),l(s.onEnd)&&s.onEnd(y)}});return d.set(a,e)}await e(100),n(++o)}())})),r.setupHooks.setup.tap(n,(e=>{t((()=>{var l,n;const o=null==(l=e.value)?void 0:l.uuid;o&&d.has(o)&&(null==(n=d.get(o))||n.destroy(),d.delete(o))}))}))}})}function u(e,l,o){var t;const i=null==(t=null==o?void 0:o.getTableData())?void 0:t.fullData,r=o.treeConfig&&o.treeConfig.transform?function(e,l){var o,t,i,r,a;const{oldIndex:u=0,newIndex:s=0}=e,c={children:"childrenList"},{fullData:v,tableData:f}=l.getTableData(),x=null==f?void 0:f[u],p=null==f?void 0:f[s-1],b=n(v),y=d.findTree(b,(e=>e.__id===x.__id),c);if(p){const e=null==(t=null==(o=l.$el)?void 0:o.querySelector)?void 0:t.call(o,".body--wrapper>.vxe-table--body tbody"),n=null==(r=null==(i=l.$el)?void 0:i.querySelector)?void 0:r.call(i,".fixed-left--wrapper>.vxe-table--body tbody"),v=d.findTree(b,(e=>e.__id===p.__id),c);if(d.findTree(x[c.children],(e=>e.__id===p.__id),c)){const l=e.children[u],o=e.children[s];return e.insertBefore(o,l),null==(a=null==n?void 0:n.insertBefore)||a.call(n,n.children[s],n.children[u]),console.log("不允许自己给自己拖动"),b}const f=y.items.splice(y.index,1)[0];l.isTreeExpandByRow(p)?p[c.children].splice(0,0,f):v.items.splice(v.index+(y.index<v.index?0:1),0,f)}else{const e=y.items.splice(y.index,1)[0];b.unshift(e)}return b}(e,o):function(e,l){var o;const{oldIndex:t=0,newIndex:i=0}=e,d=n((null==(o=null==l?void 0:l.getTableData())?void 0:o.fullData)||[]),r=d.splice(t,1)[0];return d.splice(i,0,r),d}(l,o);return{oldData:i,newData:r}}export{a as rowDragPlugin};
@@ -1 +1 @@
1
- import{traverse as e,uuidGenerator as t,DMZ as r}from"../../../../../shared/utils/index.js";import{isArray as n,isFunction as i}from"lodash-es";import{onBeforeUnmount as o}from"vue";import"../../../index.js";import{HIGHEST_PRIORITY as s,IHO_TABLE_TREE_TYPE as a}from"../../constants/index.js";import{isTransformTreeType as d}from"../../utils/index.js";import{defineTablePlugin as l}from"../../hooks/useTablePlugin.js";function f(){const f="virtualTreePlugin",u=new Map;return l({name:f,apply(l){l.configHooks.treeConfig.tap({name:f,stage:s},((e,t)=>d(t)?Object.assign({transform:!0,expandAll:!0,reserve:!0,children:"childrenList",rowField:"__id"},e):e)),l.dataHooks.data.tap(f,((r,i,o)=>{if(!i.treeConfig)return;const{transform:s,rowField:a="__id",parentField:l="parentId",children:f="childrenList"}=i.treeConfig;function u(e){e[a]=e[a]||e.theUniqueKey||t()}d(i)&&s&&(u(r),n(r[f])&&e(r[f],((e,t,r)=>{r&&(e[l]=r[a]),o.insertAfter(e),u(e)}),f,r))})),l.fieldHooks.fieldList.tap(f,((e,t)=>{if(!t.treeConfig)return e;const{transform:n}=t.treeConfig||r;if(!d(t)||!n||!t.uuid)return e;const i=e.filter((e=>!1!==e.visible));let o=i.findIndex((e=>e.treeNode));~o||i.some(((e,t)=>{if(!e.type)return o=t,e.treeNode=!0}));const s=i.length-o-i.filter((e=>"right"===e.fixed)).length;return u.set(t.uuid,{index:o,colspan:s}),e})),l.configHooks.treeConfig.tap(f,((e,t)=>{if(!e)return e;const{transform:r,parentField:n="parentId",hasChild:o="hasChild"}=e;if(i(t.spanMethod)||!r||`${t.isTree}`!==a.TRANSFORM_WITH_SPAN_METHOD)return e;const s=Object.freeze({rowspan:0,colspan:0}),d=Object.freeze({rowspan:1,colspan:1});return t.spanMethod=({row:e,column:r,$columnIndex:i})=>{const a=u.get(t.uuid);if(!a)return d;const l=Reflect.has(e,o)?!e[o]:e[n];return r.treeNode?l?d:{rowspan:1,colspan:a.colspan}:l||"right"===r.fixed||i<a.index?d:s},e})),l.setupHooks.setup.tap(f,(e=>{o((()=>{var t;(null==(t=e.value)?void 0:t.uuid)&&u.delete(e.value.uuid)}))}))}})}export{f as virtualTreePlugin};
1
+ import{traverse as e,uuidGenerator as t,DMZ as r}from"../../../../../shared/utils/index.js";import{isArray as n,isFunction as i,isEmpty as o}from"lodash-es";import{onBeforeUnmount as s}from"vue";import"../../../index.js";import{HIGHEST_PRIORITY as d,IHO_TABLE_TREE_TYPE as a}from"../../constants/index.js";import{isTransformTreeType as l}from"../../utils/index.js";import{defineTablePlugin as f}from"../../hooks/useTablePlugin.js";function u(){const u="virtualTreePlugin",p=new Map;return f({name:u,apply(f){f.configHooks.treeConfig.tap({name:u,stage:d},((e,t)=>l(t)?Object.assign({transform:!0,expandAll:!0,reserve:!0,children:"childrenList",rowField:"__id"},e):e)),f.dataHooks.data.tap(u,((r,i,o)=>{if(!i.treeConfig)return;const{transform:s,rowField:d="__id",parentField:a="parentId",children:f="childrenList"}=i.treeConfig;function u(e){e[d]=e[d]||e.theUniqueKey||t()}l(i)&&s&&(u(r),n(r[f])&&e(r[f],((e,t,r)=>{r&&(e[a]=r[d]),o.insertAfter(e),u(e)}),f,r))})),f.fieldHooks.fieldList.tap(u,((e,t)=>{if(!t.treeConfig)return e;const{transform:n}=t.treeConfig||r;if(!l(t)||!n||!t.uuid)return e;const i=e.filter((e=>!1!==e.visible));let o=i.findIndex((e=>e.treeNode));~o||i.some(((e,t)=>{if(!e.type)return o=t,e.treeNode=!0}));const s=i.length-o-i.filter((e=>"right"===e.fixed)).length;return p.set(t.uuid,{index:o,colspan:s}),e})),f.configHooks.treeConfig.tap(u,((e,t)=>{if(!e)return e;const{transform:r,parentField:n="parentId",hasChild:s="hasChild",children:d="childrenList"}=e;if(i(t.spanMethod)||!r||`${t.isTree}`!==a.TRANSFORM_WITH_SPAN_METHOD)return e;const l=Object.freeze({rowspan:0,colspan:0});return t.spanMethod=({row:e,column:r,$columnIndex:i})=>{const a=p.get(t.uuid);if(a&&(Reflect.has(e,s)?e[s]:!e[n])&&!o(e[d]))return r.treeNode?{rowspan:1,colspan:a.colspan}:"right"!==r.fixed&&i>=a.index?l:void 0},e})),f.setupHooks.setup.tap(u,(e=>{s((()=>{var t;(null==(t=e.value)?void 0:t.uuid)&&p.delete(e.value.uuid)}))}))}})}export{u as virtualTreePlugin};