cnhis-design-vue 3.1.42-release.4 → 3.1.42-release.6
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.
- package/README.md +87 -87
- package/es/components/big-table/src/BigTable.vue2.js +1 -1
- package/es/components/big-table/src/components/edit-form/edit-select-table.d.ts +1 -1
- package/es/components/big-table/src/components/edit-form/edit-select.js +1 -1
- package/es/components/big-table/src/hooks/useEvent.js +1 -1
- package/es/components/big-table/src/hooks/useFormat.js +1 -1
- package/es/components/big-table/src/hooks/useNestTable.js +1 -1
- package/es/components/big-table/src/hooks/useTableParse.js +1 -1
- package/es/components/big-table/src/utils.d.ts +11 -1
- package/es/components/big-table/src/utils.js +1 -1
- package/es/components/button-print/index.d.ts +28 -3
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +28 -4
- package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/form-config/index.d.ts +48 -7
- package/es/components/form-config/src/FormConfig.vue.d.ts +48 -7
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +14 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +26 -4
- package/es/components/form-config/src/constants/index.d.ts +8 -1
- package/es/components/form-config/src/constants/index.js +1 -1
- package/es/components/form-config/src/hooks/useConfigurationField.js +1 -1
- package/es/components/form-render/index.d.ts +14 -1
- package/es/components/form-render/src/FormRender.vue.d.ts +14 -1
- package/es/components/form-render/src/FormRender.vue.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +14 -1
- package/es/components/form-render/src/components/renderer/date.d.ts +4 -0
- package/es/components/form-render/src/components/renderer/date.js +1 -1
- package/es/components/form-render/src/components/renderer/searchCascade.d.ts +18 -0
- package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
- package/es/components/form-render/src/hooks/useBusinessBinding.d.ts +1 -0
- package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
- package/es/components/form-render/src/hooks/useFormEvent.d.ts +1 -1
- package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +8 -1
- package/es/components/form-render/src/types/index.d.ts +2 -2
- package/es/components/form-render/style/index.css +1 -1
- package/es/components/iho-table/index.d.ts +17 -3
- package/es/components/iho-table/src/IhoTable.vue.d.ts +17 -3
- package/es/components/iho-table/src/IhoTable.vue.js +1 -1
- package/es/components/iho-table/src/constants/index.d.ts +3 -2
- package/es/components/iho-table/src/constants/index.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +2 -2
- package/es/components/iho-table/src/hooks/tapHooks/useConfigHooks.d.ts +19 -19
- package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +60 -237
- package/es/components/iho-table/src/hooks/tapHooks/useExposeHooks.d.ts +1 -4
- package/es/components/iho-table/src/hooks/tapHooks/useFieldHooks.d.ts +4 -16
- package/es/components/iho-table/src/hooks/tapHooks/useSetupHooks.d.ts +2 -2
- package/es/components/iho-table/src/hooks/tapHooks/useSetupHooks.js +1 -1
- package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +1 -1
- package/es/components/iho-table/src/plugins/anchorPlugin/useAnchor.js +1 -1
- package/es/components/iho-table/src/plugins/defaultConfigPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +48 -0
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.js +1 -0
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/index.js +1 -0
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/highLightSetPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +25 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.d.ts +2 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/seqRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rowDragPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/rowDragPlugin/index.js +1 -0
- package/es/components/iho-table/src/plugins/varialbleHeightPlugin/index.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +21 -2
- package/es/components/iho-table/src/types/pluginType.d.ts +13 -26
- package/es/components/iho-table/src/utils/index.d.ts +5 -3
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/iho-table/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +1 -0
- package/es/components/info-header/index.d.ts +29 -2
- package/es/components/info-header/src/InfoHeader.vue.d.ts +29 -2
- package/es/components/info-header/src/InfoHeader.vue.js +1 -1
- package/es/components/info-header/src/components/infoDescription/HiddenContent.vue.js +1 -1
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +14 -1
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +15 -1
- package/es/components/info-header/src/components/patientInfo/index.vue.js +1 -1
- package/es/components/info-header/style/index.css +1 -1
- package/es/components/scale-view/index.d.ts +9 -130
- package/es/components/scale-view/index.js +1 -1
- package/es/components/scale-view/src/ScaleView.vue.d.ts +8 -130
- package/es/components/scale-view/src/ScaleView.vue.js +1 -1
- package/es/components/scale-view/src/components/AnswerParse.vue.d.ts +1 -43
- package/es/components/scale-view/src/components/AnswerParse.vue.js +1 -1
- package/es/components/scale-view/src/components/EvaluateCountdown.vue.d.ts +0 -42
- package/es/components/scale-view/src/components/EvaluateCountdown.vue.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-address.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-checkbox.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-datetime.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-map.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-sign.js +1 -1
- package/es/components/scale-view/src/components/formitem/standard-modal.d.ts +4 -4
- package/es/components/scale-view/src/components/formitem/standard-modal.js +1 -1
- package/es/components/scale-view/src/components/formitem/text-over-tooltip/TextOverTooltip.vue.d.ts +1 -1
- package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-init.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-submit.d.ts +5 -1
- package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-validate.js +1 -1
- package/es/components/scale-view/src/hooks/use-evaluate.js +1 -1
- package/es/components/scale-view/src/hooks/use-event.js +1 -1
- package/es/components/scale-view/src/types/index.d.ts +7 -0
- package/es/components/scale-view/src/types/index.js +1 -0
- package/es/components/scale-view/style/index.css +1 -1
- package/es/components/scale-view/style/scale-view-iconfont.ttf +0 -0
- package/es/components/search-cascader/index.d.ts +12 -1
- package/es/components/search-cascader/src/SearchCascader.vue.d.ts +12 -1
- package/es/components/search-cascader/src/SearchCascader.vue.js +1 -1
- package/es/components/search-cascader/src/components/SearchMenu.d.ts +8 -1
- package/es/components/search-cascader/src/components/SearchMenu.js +1 -1
- package/es/components/search-cascader/src/constants/index.d.ts +1 -0
- package/es/components/search-cascader/src/constants/index.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue.js +1 -1
- package/es/components/select-label/src/SelectLabel.vue2.js +1 -1
- package/es/components/select-person/index.d.ts +57 -9
- package/es/components/select-person/src/SearchMultiple.vue.d.ts +125 -0
- package/es/components/select-person/src/SelectPerson.vue.d.ts +43 -7
- package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
- package/es/components/select-person/src/utils/index.js +1 -1
- package/es/components/select-person/style/index.css +1 -1
- package/es/components/shortcut-setter/index.d.ts +18 -2
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +18 -2
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue.js +1 -1
- package/es/env.d.ts +25 -24
- package/es/shared/components/TextOverTooltip/TextOverTooltip.vue.d.ts +1 -1
- package/es/shared/components/TextOverTooltip/TextOverTooltip.vue.js +1 -1
- package/es/shared/package.json.js +1 -0
- package/es/shared/utils/anime.d.ts +1 -1
- package/es/shared/utils/anime.js +1 -1
- package/es/shared/utils/index.d.ts +3 -14
- package/es/shared/utils/index.js +1 -1
- package/es/shared/utils/vexutils.d.ts +2 -2
- package/es/shared/utils/vexutils.js +1 -1
- package/es/shared/utils/vexutilsExpand.d.ts +254 -0
- package/es/shared/utils/vexutilsExpand.js +1 -0
- package/package.json +2 -2
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/tapable/index.d.ts +0 -139
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mergeWith as e,isObject as o}from"lodash-es";import{HIGHEST_PRIORITY as i}from"../../constants/index.js";import{defineTablePlugin as t}from"../../hooks/useTablePlugin.js";import{IhoTableStatusHelper as s}from"../../utils/index.js";function n(){const n="defaultTablePlugin";return t({name:n,apply(t){t.configHooks.config.tap({name:n,stage:i},(o=>{const i=e({border:!0,showSeq:!0,columnConfig:{resizable:!0},rowConfig:{height:36,useKey:!0,isHover:!0,isCurrent:!0,keyField:"theUniqueKey"},showOverflow:"tooltip",editConfig:{trigger:"click",mode:"cell"}},o,{height:o.height?"auto":void 0});return(s.isPositive(o.isBatchSelect)||o.selectType)&&(i.selectType=o.selectType||"checkbox"),i})),t.configHooks.mouseConfig.tap({name:n,stage:i},((e,i)=>o(i.keyboardConfig)?Object.assign({selected:!!i.keyboardConfig.isEdit},e):e))}})}export{n as defaultConfigPlugin};
|
|
1
|
+
import{mergeWith as e,isObject as o}from"lodash-es";import{HIGHEST_PRIORITY as i}from"../../constants/index.js";import{defineTablePlugin as t}from"../../hooks/useTablePlugin.js";import{IhoTableStatusHelper as s}from"../../utils/index.js";function n(){const n="defaultTablePlugin";return t({name:n,vxe(e){e.setup({zIndex:3e3})},apply(t){t.configHooks.config.tap({name:n,stage:i},(o=>{const i=e({border:!0,showSeq:!0,columnConfig:{resizable:!0},rowConfig:{height:36,useKey:!0,isHover:!0,isCurrent:!0,keyField:"theUniqueKey"},showOverflow:"tooltip",editConfig:{trigger:"click",mode:"cell"}},o,{height:o.height?"auto":void 0});return(s.isPositive(o.isBatchSelect)||o.selectType)&&(i.selectType=o.selectType||"checkbox"),i})),t.configHooks.mouseConfig.tap({name:n,stage:i},((e,i)=>o(i.keyboardConfig)?Object.assign({selected:!!i.keyboardConfig.isEdit},e):e))}})}export{n as defaultConfigPlugin};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { VxeColumnPropTypes } from 'vxe-table';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
payload: {
|
|
5
|
+
type: PropType<VxeColumnPropTypes.FilterSlotParams>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
}, {
|
|
9
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
10
|
+
payload: {
|
|
11
|
+
type: PropType<VxeColumnPropTypes.FilterSlotParams>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
}>> & {}>>;
|
|
15
|
+
optionRef: {
|
|
16
|
+
label: string | number;
|
|
17
|
+
value: any;
|
|
18
|
+
data: any;
|
|
19
|
+
resetValue: any;
|
|
20
|
+
checked: boolean;
|
|
21
|
+
_checked: boolean;
|
|
22
|
+
};
|
|
23
|
+
shortcuts: {
|
|
24
|
+
近一周: () => number[];
|
|
25
|
+
近一个月: () => number[];
|
|
26
|
+
};
|
|
27
|
+
onConfirm: (value: [number, number], formattedValue: [string, string] | null) => void;
|
|
28
|
+
CDatePicker: import("../../../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
29
|
+
attrs: {
|
|
30
|
+
[x: string]: unknown;
|
|
31
|
+
};
|
|
32
|
+
datePickerRef: import("vue").Ref<import("../../../../../shared/types").AnyObject | null>;
|
|
33
|
+
panelInstRef: import("vue").Ref<null>;
|
|
34
|
+
isDateTime: import("vue").ComputedRef<boolean>;
|
|
35
|
+
formatRef: import("vue").ComputedRef<string>;
|
|
36
|
+
panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
|
|
37
|
+
focus: () => any;
|
|
38
|
+
blur: () => any;
|
|
39
|
+
onUpdateShow: (show: boolean) => void;
|
|
40
|
+
NDatePicker: any;
|
|
41
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
42
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
43
|
+
payload: {
|
|
44
|
+
type: PropType<VxeColumnPropTypes.FilterSlotParams>;
|
|
45
|
+
required: true;
|
|
46
|
+
};
|
|
47
|
+
}>>, {}>;
|
|
48
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,reactive as t,openBlock as a,createBlock as l,unref as o}from"vue";import r from"../../../../date-picker/index.js";import{subDays as n,subMonths as i}from"date-fns";import p from"../../../../../_virtual/plugin-vue_export-helper.js";var u=p(e({__name:"filter",props:{payload:{type:Object,required:!0}},setup(e){var p,u,d;const m=e,v=t((null==(d=null==(u=null==(p=m.payload)?void 0:p.column)?void 0:u.filters)?void 0:d[0])||{data:void 0}),f=t({"近一周":()=>[n(new Date,7).getTime(),(new Date).getTime()],"近一个月":()=>[i(new Date,1).getTime(),(new Date).getTime()]});function s(e,t){var a;v.value=t,(null==(a=m.payload)?void 0:a.$panel)&&(m.payload.$panel.changeOption(null,!!t,v),m.payload.$panel.confirmFilter(new CustomEvent("click")))}return(e,t)=>(a(),l(o(r),{type:"datetimerange",panel:"",clearable:"","formatted-value":v.data,"onUpdate:formatted-value":t[0]||(t[0]=e=>v.data=e),shortcuts:f,onConfirm:s},null,8,["formatted-value","shortcuts"]))}}),[["__file","filter.vue"]]);export{u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function filterDaterangeRenderPlugin(): import("../../../../../../es/components/iho-table").TablePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createVNode as e}from"vue";import"../../../index.js";import t from"./filter.vue.js";import{isValid as i,compareDesc as r}from"date-fns";import{isObject as n,isArray as o}from"@vue/shared";import{defineTablePlugin as l}from"../../hooks/useTablePlugin.js";function a(){const a="filterDaterangeRenderPlugin";return l({name:a,vxe(i){i.renderer.mixin({filterDaterangeRenderPlugin:{showFilterFooter:!1,renderFilter:(i,r)=>e(t,{payload:r,key:r.column.field},null)}})},apply(e){e.fieldHooks.field.tap(a,((e,t,l,{$table:a})=>{var f,d,s,u;const c=null==(f=e.editRender)?void 0:f.props;if(!n(c))return e;if(!(null==(d=null==c?void 0:c.filterSetting)?void 0:d.daterange))return e;e.filterRender={name:"filterDaterangeRenderPlugin"};const m=null==(s=a.value)?void 0:s.getColumnByField(e.field),h={};return m&&o(m.filters)&&Object.assign(h,{...(null==(u=m.filters)?void 0:u[0])||{}}),e.filters=[{data:void 0,...h}],e.filterMethod||(e.filterMethod=function({option:e,row:t,column:n}){const{data:o}=e,l=t[n.field];return!!i(new Date(l))&&(r(new Date(l),new Date(o[0]))<=0&&r(new Date(l),new Date(o[1]))>=0)}),e.sortable?e.headerClassName=({$table:e,column:t})=>{const i=["iho-table__hideSortIcon"];return e.isSort(t)&&i.push("is--filter-active"),i}:e.headerClassName="iho-table__hideSortIcon",l.filterConfig={iconMatch:"iho-table--iconfont iho-table-icon-filter",iconNone:"iho-table--iconfont iho-table-icon-filter",...l.filterConfig},e}))}})}export{a as filterDaterangeRenderPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createVNode as e,nextTick as l}from"vue";import{jsonParse as
|
|
1
|
+
import{createVNode as e,nextTick as l}from"vue";import{jsonParse as r,traverse as t,arrayed as i}from"../../../../../shared/utils/index.js";import{isObject as o}from"@vue/shared";import{isArray as n,first as s,isString as u}from"lodash-es";import"../../../index.js";import{IhoTableRenderHelper as a,isCompatibleColumn as d,parseRichContent as f}from"../../utils/index.js";import c from"./filter.vue.js";import{defineTablePlugin as p}from"../../hooks/useTablePlugin.js";function v(){const v="filterRenderPlugin";return p({name:v,vxe(l){l.renderer.mixin({filterRenderPlugin:{showFilterFooter:!1,renderFilter:(l,r)=>e(c,{payload:r,key:r.column.field},null)}})},apply(e){let c=[];e.fieldHooks.field.tap(v,((e,l,t,{$table:i})=>{var c,p,v,h,m,b,g,k;const C=null==(c=e.editRender)?void 0:c.props;if(!o(C))return e;const R=r(C.fieldSetting||"");if(!a.hasFilter(C))return e;e.editRender={...e.editRender,props:{...null==(p=e.editRender)?void 0:p.props,sortable:e.sortable}},e.filterRender={name:"filterRenderPlugin"};const x=null==(v=i.value)?void 0:v.getColumnByField(e.field),y={};x&&n(x.filters)&&x.filters.forEach((e=>{e&&(y[`${e.label}_${e.value}`]=e.checked)}));let F=null!=(b=null==(m=null==(h=R.mapping)?void 0:h.mappingFiled)?void 0:m.reduce(((e,l)=>{const r=s(l.value);return o(r)&&e.push({label:r.key,value:r.value,data:r.value}),e}),[]))?b:[];if(d(C)&&(F=null!=(g=C.options)?g:[]),e.filters=F.reduce(((e,l)=>(o(l)&&e.push({...l,checked:!!y[`${l.label}_${l.value}`]}),e)),[]),!e.filterMethod){const l=null==(k=t.treeConfig)?void 0:k.children;e.filterMethod=function({option:e,column:r,row:t}){if(l&&n(t[l])&&t[l].length)return!1;const i=t[r.field];if(!u(i))return!1;if(i===e.value||i===e.label)return!0;const{value:o,change_text:s}=f(i);return s===e.label||o===e.value}}return e.sortable?e.headerClassName=({$table:e,column:l})=>{const r=["iho-table__hideSortIcon"];return e.isSort(l)&&r.push("is--filter-active"),r}:e.headerClassName="iho-table__hideSortIcon",t.filterConfig={iconMatch:"iho-table--iconfont iho-table-icon-filter",iconNone:"iho-table--iconfont iho-table-icon-filter",...t.filterConfig},e})),e.fieldHooks.fieldList.tap(v,(e=>c=e)),e.fieldHooks.fieldEnd.tapPromise(v,(async(e,{$table:r})=>{var i;try{if(await l(),!r.value)return;const n=null!=(i=r.value.getColumns())?i:[],s=[];if(t(c,(e=>{n.find((l=>l.field===e.field))||s.push(e)})),!s.length)return;setTimeout((()=>{var l,t;if(null==(l=e.sortConfig)?void 0:l.multiple){const e=null!=(t=r.value.getColumns())?t:[],l=s.concat(e).reduce(((e,l)=>{var r;const t=null==(r=l.editRender)?void 0:r.props;return o(t)&&h(t.isOrder)&&e.push({field:l.field,order:t.isOrder}),e}),[]);r.value.sort(l)}else s.reverse().some((e=>{var l;const t=null==(l=e.editRender)?void 0:l.props;if(o(t)&&h(t.isOrder))return e&&r.value.sort(e.field,t.isOrder),!0}))}),100)}finally{c=[]}})),e.exposeHooks.expose.tap(v,((e,l,{$table:r})=>(Object.assign(e,{setSort(e,l){r.value&&r.value.sort(e,l)},setFilter(e,l){if(!r.value)return;const t=r.value.getColumnByField(e);if(!t||!n(t.filters))return;const o=i(l);t.filters.forEach((e=>{e.checked=o.includes(e.value)})),r.value.updateData()}}),e)))}})}function h(e){return["asc","desc",null].includes(e)}export{v as filterRenderPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hex2rgba as o}from"../../../../shared/utils/index.js";import{isFunction as r}from"lodash-es";import"../../index.js";import{useUUIDMap as
|
|
1
|
+
import{hex2rgba as o}from"../../../../shared/utils/index.js";import{isFunction as r,isString as t,isObject as n}from"lodash-es";import"../../index.js";import{useUUIDMap as e}from"../utils/index.js";import{defineTablePlugin as s}from"../hooks/useTablePlugin.js";function u(){const u="highLightSetPlugin",{getItemFromUUID:i,removeItemFromUUID:l,setItemFromUUID:a}=e((()=>!1));return s({name:u,apply(e){e.dataHooks.data.tapPromise(u,(async(o,r)=>{r.uuid&&(o.rowColor||o.fontColor)&&a(r.uuid,!0)})),e.dataHooks.dataEnd.tap(u,(e=>{if(!e.uuid||!i(e.uuid))return;const s=e.rowStyle;e.rowStyle=function(t){if(t.row.rowColor||t.row.fontColor){const[n,e,u,i]=o(t.row.rowColor||"",.2),l={"--row-background-color":`rgba(${n}, ${e}, ${u}, ${i})`,color:t.row.fontColor};return r(s)?Object.assign(l,s(t)):l}return r(s)?s(t):null};const u=e.rowClassName;e.rowClassName=function(o){if(o.row.rowColor){const e="row--custom";if(t(u))return`${e} ${u}`;if(r(u)){const r=u(o);return n(r)?Object.assign({"row--custom":!0},r):t(r)?`${e} ${r}`:null}return e}return r(u)?u(o):t(u)?u:null},l(e.uuid)}))}})}export{u as highLightSetPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"./anchorPlugin/index.js";import*as r from"./defaultConfigPlugin/index.js";import*as i from"./
|
|
1
|
+
import*as e from"./anchorPlugin/index.js";import*as r from"./defaultConfigPlugin/index.js";import*as i from"./filterDaterangeRenderPlugin/index.js";import*as n from"./filterRenderPlugin/index.js";import*as d from"./highLightSetPlugin.js";import*as s from"./keyboardEventPlugin/index.js";import*as t from"./lowCodeFieldAdaptorPlugin/index.js";import*as l from"./maxCheckSizePlugin.js";import*as g from"./rendererPlugins/editableWidgets/dateRendererPlugin/index.js";import*as u from"./rendererPlugins/editableWidgets/inputRendererPlugin.js";import*as o from"./rendererPlugins/editableWidgets/numberRendererPlugin.js";import*as a from"./rendererPlugins/editableWidgets/selectRendererPlugin/index.js";import*as P from"./rendererPlugins/editableWidgets/separateRendererPlugin/index.js";import*as m from"./rendererPlugins/editableWidgets/timeRendererPlugin/index.js";import*as x from"./rendererPlugins/widgets/checkRendererPlugin.js";import*as f from"./rendererPlugins/widgets/colorRendererPlugin.js";import*as p from"./rendererPlugins/widgets/defaultRendererPlugin.js";import*as R from"./rendererPlugins/widgets/labelRendererPlugin.js";import*as j from"./rendererPlugins/widgets/pictureRendererPlugin.js";import*as b from"./rendererPlugins/widgets/seqRendererPlugin.js";import*as w from"./rowClickPlugin/index.js";import*as c from"./rowDragPlugin/index.js";import*as h from"./rowGroupSettingPlugin/index.js";import*as W from"./varialbleHeightPlugin/index.js";import*as k from"./virtualTreePlugin/index.js";import{separateMetaModule as C}from"../../../../shared/utils/index.js";var v=C(Object.assign({"./anchorPlugin/index.tsx":e,"./defaultConfigPlugin/index.ts":r,"./filterDaterangeRenderPlugin/index.tsx":i,"./filterRenderPlugin/index.tsx":n,"./highLightSetPlugin.tsx":d,"./keyboardEventPlugin/index.ts":s,"./lowCodeFieldAdaptorPlugin/index.tsx":t,"./maxCheckSizePlugin.ts":l,"./rendererPlugins/editableWidgets/dateRendererPlugin/index.tsx":g,"./rendererPlugins/editableWidgets/inputRendererPlugin.tsx":u,"./rendererPlugins/editableWidgets/numberRendererPlugin.tsx":o,"./rendererPlugins/editableWidgets/selectRendererPlugin/index.tsx":a,"./rendererPlugins/editableWidgets/separateRendererPlugin/index.tsx":P,"./rendererPlugins/editableWidgets/timeRendererPlugin/index.tsx":m,"./rendererPlugins/widgets/checkRendererPlugin.tsx":x,"./rendererPlugins/widgets/colorRendererPlugin.tsx":f,"./rendererPlugins/widgets/defaultRendererPlugin.tsx":p,"./rendererPlugins/widgets/labelRendererPlugin.tsx":R,"./rendererPlugins/widgets/pictureRendererPlugin.tsx":j,"./rendererPlugins/widgets/seqRendererPlugin.tsx":b,"./rowClickPlugin/index.ts":w,"./rowDragPlugin/index.ts":c,"./rowGroupSettingPlugin/index.ts":h,"./varialbleHeightPlugin/index.tsx":W,"./virtualTreePlugin/index.ts":k}));export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toRaw as e,h as t,inject as
|
|
1
|
+
import{toRaw as e,h as t,inject as l,createVNode as i}from"vue";import{arrayed as o,widthAppend as s}from"../../../../../shared/utils/index.js";import{isObject as n,isFunction as d,cloneDeep as a,isString as r}from"lodash-es";import{NEllipsis as u}from"naive-ui";import f from"../../../../annotation-edit/index.js";import{HIGHEST_PRIORITY as m,IHO_TABLE_FIXED_STATUS as c,LOWEST_PRIORITY as p,WIDGET_TYPE as h,InjectionIhoTableAnnotation as v,InjectionIhoTableConfig as b}from"../../constants/index.js";import{defineTablePlugin as g}from"../../hooks/useTablePlugin.js";import{IhoTableStatusHelper as R,IhoTableUtils as j,IhoTableRenderHelper as x}from"../../utils/index.js";import{getDefaultValue as P}from"../rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js";function F(){const F="lowCodeFieldAdaptorPlugin";return g({name:F,apply(g){g.fieldHooks.field.tap({name:F,stage:m},((m,p,g)=>{const F=m,S={className:F.bold?"iho-table__boldCell":"",field:F.columnName,showOverflow:"tooltip",visible:R.notNegative(F.isShow),minWidth:F.colWidth,sortable:R.isPositive(F.isSort),fixed:c[F.isFixed],...F,title:F.alias||F.title};return function(e,a){const m={default:a.slotFn,header:a.headerSlotFn,edit:a.editSlotFn,footer:a.footerSlotFn,...a.slots};if(d(a.checkEditStatus)){const{default:e}=m;d(e)&&(m.default=l=>a.checkEditStatus(l)?e(l):[t("span",null,P(l.row,l.column.editRender.props))])}const c=m.header;m.header=e=>function(e,t,a){const m=l(v),c=l(b),p=e.column||{},h=n(null==m?void 0:m.value)&&!1!==t.annotation,g=x.isEditableColumn(c.value,p),R=p.sortable||x.hasFilter(t)||x.hasDateFiler(t),j=r(a)?a:d(a)?a(e):null;let P=!1;if(c.value){const e=c.value.editRules&&c.value.editRules[p.field];e&&(P=o(e).some((e=>e.required)))}return i("section",{class:"iho-table__headerWrapper"},[i("section",{style:{width:s(Math.max(0,p.renderWidth-20-(P?14:0)-(h?18:0)-(R?23:0)-(g?22:0)))}},[null!=j?j:i(u,{style:{maxWidth:"100%"}},{default:()=>p.title})]),h?i(f,{modelValue:m.value[p.field],"onUpdate:modelValue":e=>m.value[p.field]=e},null):null])}(e,a,c),e.slots=m}(S,F),function(t,l,i){var o,s;const r=a(e(l));r.componentProps={size:"mini"===i.size?"small":i.size,...r.componentProps},t.editRender={autofocus:"input",name:j.getCellType(l),props:r},t.editRender.enabled=!Reflect.get(h,t.editRender.name),d(null==(o=t.slots)?void 0:o.default)&&(t.editRender.enabled=t.editRender.enabled&&d(null==(s=t.slots)?void 0:s.edit));if(!n(l.settingObj))return;Reflect.has(l.settingObj,"isHide")&&(t.visible=t.visible&&R.notPositive(l.settingObj.isHide))}(S,F,g),S})),g.fieldHooks.field.tap({name:F+"After",stage:p},(e=>(n(e.slots)&&Object.entries(e.slots).forEach((([t,l])=>{null==l&&Reflect.deleteProperty(e.slots,t)})),e)))}})}export{F as lowCodeFieldAdaptorPlugin};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
2
|
import { VxeTableDefines } from 'vxe-table';
|
|
3
3
|
import { AnyObject } from '../../../../../../../../es/shared/types';
|
|
4
|
+
import { IhoTableLowCodeField } from '../../../../../../../../es/components/iho-table';
|
|
4
5
|
declare const _default: import("vue").DefineComponent<{
|
|
5
6
|
value: {
|
|
6
7
|
type: PropType<string | number | (string | number)[]>;
|
|
7
|
-
default: undefined;
|
|
8
8
|
};
|
|
9
9
|
column: {
|
|
10
10
|
type: PropType<VxeTableDefines.ColumnInfo>;
|
|
@@ -18,10 +18,20 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
18
18
|
type: NumberConstructor;
|
|
19
19
|
required: true;
|
|
20
20
|
};
|
|
21
|
+
options: {
|
|
22
|
+
type: PropType<AnyObject[]>;
|
|
23
|
+
default: () => never[];
|
|
24
|
+
};
|
|
25
|
+
queryOptions: {
|
|
26
|
+
type: PropType<IhoTableLowCodeField.QueryOptions>;
|
|
27
|
+
};
|
|
28
|
+
placeholder: {
|
|
29
|
+
type: StringConstructor;
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
21
32
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
33
|
value: {
|
|
23
34
|
type: PropType<string | number | (string | number)[]>;
|
|
24
|
-
default: undefined;
|
|
25
35
|
};
|
|
26
36
|
column: {
|
|
27
37
|
type: PropType<VxeTableDefines.ColumnInfo>;
|
|
@@ -35,9 +45,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
35
45
|
type: NumberConstructor;
|
|
36
46
|
required: true;
|
|
37
47
|
};
|
|
48
|
+
options: {
|
|
49
|
+
type: PropType<AnyObject[]>;
|
|
50
|
+
default: () => never[];
|
|
51
|
+
};
|
|
52
|
+
queryOptions: {
|
|
53
|
+
type: PropType<IhoTableLowCodeField.QueryOptions>;
|
|
54
|
+
};
|
|
55
|
+
placeholder: {
|
|
56
|
+
type: StringConstructor;
|
|
57
|
+
default: string;
|
|
58
|
+
};
|
|
38
59
|
}>> & {
|
|
39
60
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
40
61
|
}, {
|
|
41
|
-
|
|
62
|
+
options: AnyObject[];
|
|
63
|
+
placeholder: string;
|
|
42
64
|
}>;
|
|
43
65
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,reactive as o,watch as t,createVNode as
|
|
1
|
+
import{defineComponent as e,reactive as o,watch as t,createVNode as r,mergeProps as n}from"vue";import{NSelect as l}from"naive-ui";import{useIhoTableFormEvent as a}from"../../../../utils/index.js";import{useAutoFocus as u}from"../hooks/useAutoFocus.js";import{useDebounceFn as i}from"@vueuse/core";import{isFunction as s,isArray as p}from"lodash-es";var c=e({name:"EditSelect",props:{value:{type:[Array,String,Number]},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0},options:{type:Array,default:()=>[]},queryOptions:{type:Function},placeholder:{type:String,default:"请选择"}},emits:["update:value"],setup(e,{emit:c}){const{isShow:d,setRef:m,formRef:f}=u(),{emitFormChangeWithParams:y}=a(e),h=o({options:e.options,loading:!1,remote:!1,onSearch:null}),v=i((async function(o=""){h.loading=!0;try{if(!s(e.queryOptions))return;h.options=await e.queryOptions({keyword:o,row:e.row,column:e.column,rowIndex:e.rowIndex})}catch(o){console.log(`获取${e.column.field}_options错误`)}finally{h.loading=!1}}),400);function w(o){const t=e.value;c("update:value",o),y({oldValue:t})}function b(e){var o,t;"Tab"===e.key&&f.value&&(null==(t=(o=f.value).handleKeydown)||t.call(o,{...e,key:"Enter",preventDefault:e.preventDefault.bind(e)}))}t((()=>e.options),(e=>{if(p(e)&&e.length)return h.options=e,h.remote=!1,void(h.onSearch=null);h.remote=!0,h.onSearch=v,h.onSearch()}),{immediate:!0});const g=()=>({class:"iho-table__selectOption"}),S={class:"iho-table__selectMenu"};return()=>r(l,n({ref:m,show:d.value,"onUpdate:show":e=>d.value=e,placeholder:e.placeholder},h,{value:e.value,clearable:!0,filterable:!0,nodeProps:g,menuProps:S,onUpdateValue:w,onKeydown:b}),null)}});export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,inject as
|
|
1
|
+
import{reactive as e,inject as t,createVNode as o,mergeProps as i,onBeforeUnmount as n}from"vue";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as l,InjectionIhoTableUUID as r}from"../../../../constants/index.js";import{createIhoTableClearActivedInterceptor as s,IhoTableRenderHelper as d,IhoTableUtils as u}from"../../../../utils/index.js";import p from"./editSelect.js";import{getDefaultValue as a}from"./selectUtils.js";import{defineTablePlugin as c}from"../../../../hooks/useTablePlugin.js";function f(){const f="selectRendererPlugin",m=e(new Map),v=e(new Map);return c({name:f,vxe(e){e.interceptor.add("event.clearActived",s(l.SELECT,(e=>e.classList.contains("iho-table__selectMenu")))),e.renderer.add(l.SELECT,{renderCell({props:e},{row:i,column:n}){const l=t(r),s=m.get(l)[n.field]||[];return[o("span",null,[a(i,e,s)])]},renderEdit:d.createRenderEdit((({fieldItem:e,emitFormClick:n,row:l,column:s,$rowIndex:d})=>{const u=t(r),a=m.get(u)[s.field]||[];return[o(p,i({queryOptions:e.queryOptions,options:a},e.componentProps,{column:s,row:l,"row-index":d,value:l[s.field],"onUpdate:value":e=>l[s.field]=e,onClick:n}),null)]}))})},apply(e){e.fieldHooks.fieldList.tap(f,((e,{uuid:t})=>(t&&(v.set(t,e),m.set(t,{})),e))),e.fieldHooks.fieldEnd.tapPromise(f,(async({uuid:e})=>{if(!e)return;const t=v.get(e),o=m.get(e);t.forEach((async e=>{var t,i;const n=null==(t=e.editRender)?void 0:t.props;if(e.field&&n&&"SELECT"===u.getCellType(n)){if(o[e.field])return;let t=n.options||[];if(n.queryOptions)try{const o={column:e,isFullData:!0};t=await(null==(i=n.queryOptions)?void 0:i.call(n,o))}catch(e){console.log(`获取${n.field}_options错误`)}o[e.field]=t}}))})),e.setupHooks.setup.tap(f,(e=>{n((()=>{e.value.uuid&&(v.delete(e.value.uuid),m.delete(e.value.uuid))}))}))}})}export{f as selectRendererPlugin};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { AnyObject } from '../../../../../../../../es/shared/types';
|
|
1
2
|
import { LowCodeTableFieldItem } from '../../../../../../../../es/components/iho-table/src/types';
|
|
2
|
-
export declare function getDefaultValue(row: any, item: LowCodeTableFieldItem | any, options?:
|
|
3
|
+
export declare function getDefaultValue(row: any, item: LowCodeTableFieldItem | any, options?: AnyObject[]): any;
|
|
@@ -45,6 +45,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
45
45
|
emit: (event: "click" | "update:formattedValue", ...args: any[]) => void;
|
|
46
46
|
formRef: import("vue").Ref<HTMLElement | null>;
|
|
47
47
|
isShow: import("vue").Ref<boolean>;
|
|
48
|
+
timePickerRef: import("vue").Ref<any>;
|
|
48
49
|
__formattedValue: import("vue").Ref<string | undefined>;
|
|
49
50
|
oldValue: string | undefined;
|
|
50
51
|
placeholder: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as t,ref as a,openBlock as
|
|
1
|
+
import{defineComponent as e,useAttrs as t,ref as l,watch as a,nextTick as o,openBlock as r,createBlock as u,unref as i,mergeProps as n,withCtx as m,createVNode as f,isRef as d,createElementBlock as c,Fragment as v,renderList as s,createTextVNode as p,toDisplayString as _,createCommentVNode as k}from"vue";import{NPopover as h,NInput as y,NSpace as w,NScrollbar as V,NButton as b}from"naive-ui";import{useIhoTableFormEvent as g}from"../../../../utils/index.js";import{useAutoFocus as j}from"../hooks/useAutoFocus.js";import C from"../../../../../../time-picker/index.js";import{parse as F,isValid as q,format as x}from"date-fns";import R from"../../../../../../../_virtual/plugin-vue_export-helper.js";var S=R(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:R}){const S=e,A=t(),{emitFormChangeWithParams:I}=g(S),{formRef:O,isShow:P}=j(),$=l(),E=l(S.formattedValue);let H=S.formattedValue;const{placeholder:T="请选择",valueFormat:U="HH:mm",shortcutOptions:z=[]}=A,B={placeholder:T,valueFormat:U,format:U};function D(e){E.value=e,H!==e&&(R("update:formattedValue",e),I({oldValue:H}),H=e)}function K(){const e=F(S.formattedValue||"",B.valueFormat.replace(/:/,""),new Date);if(q(e)){D(x(e,B.valueFormat))}}function N(e){var t;const{key:l}=e;"Enter"===l&&(null==(t=O.value)||t.blur(),P.value=!1)}return a((()=>P.value),(async e=>{var t,l,a,r,u;e&&(await o(),null==(u=null==(r=null==(a=null==(l=null==(t=$.value)?void 0:t.$timePicker)?void 0:l.panelInstRef)?void 0:a.$el)?void 0:r.querySelectorAll(".n-time-picker-col"))||u.forEach((e=>{var t,l;return null==(l=null==(t=null==e?void 0:e.querySelector)?void 0:t.call(e,".n-time-picker-col__item--active"))?void 0:l.scrollIntoView()})))})),(t,l)=>(r(),u(i(h),n({show:i(P),trigger:"click",showArrow:!1,placement:"bottom-start",style:{padding:"0"}},t.$attrs,{onClickoutside:l[3]||(l[3]=()=>P.value=!1)}),{trigger:m((()=>[f(i(y),{ref_key:"formRef",ref:O,clearable:"",value:e.formattedValue,"onUpdate:value":l[0]||(l[0]=e=>d(formattedValue)?formattedValue.value=e:null),onClick:l[1]||(l[1]=()=>P.value=!0),onBlur:K,onKeyup:N},null,8,["value"])])),default:m((()=>[f(i(w),null,{default:m((()=>[f(i(C),n({ref_key:"timePickerRef",ref:$,show:"","formatted-value":E.value},i(B),{class:"iho-table__time-picker",to:!1,"onUpdate:formattedValue":D,onConfirm:l[2]||(l[2]=()=>P.value=!1)}),null,16,["formatted-value"]),f(i(V),{class:"iho-table__scrollbar"},{default:m((()=>[i(z).length?(r(),u(i(w),{key:0,vertical:"",wrap:!1},{default:m((()=>[(r(!0),c(v,null,s(i(z),(e=>(r(),u(i(b),{size:"tiny",key:e,onClick:t=>function(e){D(e),P.value=!1}(e)},{default:m((()=>[p(_(e),1)])),_:2},1032,["onClick"])))),128))])),_:1})):k("v-if",!0)])),_:1})])),_:1})])),_:1},16,["show"]))}}),[["__file","editTime.vue"]]);export{S as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{inject as o,createVNode as e}from"vue";import{SettingsSharp as n}from"@vicons/ionicons5";import{isFunction as i}from"lodash-es";import{NIcon as t}from"naive-ui";import"../../../../index.js";import{InjectionIhoTableEmits as r}from"../../../constants/index.js";import{IhoTableStatusHelper as s}from"../../../utils/index.js";import{defineTablePlugin as l}from"../../../hooks/useTablePlugin.js";function f(){const f="seqRendererPlugin";return l({name:f,apply(l){l.fieldHooks.field.tap({name:f,before:"checkRendererPlugin"},((l,{index:m,insertBefore:
|
|
1
|
+
import{inject as o,createVNode as e}from"vue";import{SettingsSharp as n}from"@vicons/ionicons5";import{isFunction as i}from"lodash-es";import{NIcon as t}from"naive-ui";import"../../../../index.js";import{InjectionIhoTableEmits as r}from"../../../constants/index.js";import{IhoTableStatusHelper as s}from"../../../utils/index.js";import{defineTablePlugin as l}from"../../../hooks/useTablePlugin.js";function f(){const f="seqRendererPlugin";return l({name:f,apply(l){l.fieldHooks.field.tap({name:f,before:"checkRendererPlugin"},((l,{index:m,insertBefore:c},u)=>{var a,d;if(0===m&&u.showSeq){const l={align:"center",fixed:"left",width:50,type:"seq",field:f,annotation:!1,slots:{header(){if(s.isPositive(u.hideSettingBtn))return[];const i=o(r);return[e(t,{style:{cursor:"pointer"},size:"14",color:"#777",component:n,onClick:function(){i&&i("settingClick")}},null)]}}};i(null==(a=u.columnConfig)?void 0:a.seqSlotFn)&&(l.slots||(l.slots={}),l.slots.default=u.columnConfig.seqSlotFn),(null==(d=u.sortableConfig)?void 0:d.enable)&&(l.className="col--drag"),c(l)}return l}))}})}export{f as seqRendererPlugin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function rowDragPlugin(): import("../../../../../../es/components/iho-table").TablePlugin;
|
|
@@ -0,0 +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 +1 @@
|
|
|
1
|
-
import{defineComponent as e,inject as t,ref as o,computed as l,provide as
|
|
1
|
+
import{defineComponent as e,inject as t,ref as o,computed as l,provide as n,watch as r,onMounted as a,createVNode as s,h as i,unref as u,onBeforeUnmount as d,shallowReactive as c}from"vue";import{widthAppend as p,traverse as f}from"../../../../../shared/utils/index.js";import{doAnimation as m}from"../../../../../shared/utils/anime.js";import{useThrottleFn as h}from"@vueuse/core";import{promiseTimeout as g}from"@vueuse/shared";import{isFunction as v,isNumber as x,last as I,omit as b}from"lodash-es";import"../../../index.js";import{InjectionIhoTableUUID as w,WIDGET_TYPE as y}from"../../constants/index.js";import{useUUIDMap as T}from"../../utils/index.js";import{defineTablePlugin as R}from"../../hooks/useTablePlugin.js";class H{constructor(){this.records={},this.maxRecords=c(new Map)}set(e,t,o){if(this.records[e]||(this.records[e]={}),this.records[e][t]===o)return;this.records[e][t]=o;const l=Math.max(...Object.values(this.records[e]),0);this.maxRecords.get(e)!==l&&this.maxRecords.set(e,l)}getMax(e){return this.maxRecords.get(e)||0}}const{getItemFromUUID:D,removeItemFromUUID:M}=T((()=>new H),!0),{getItemFromUUID:S,removeItemFromUUID:U,setItemFromUUID:C}=T((()=>null)),{getItemFromUUID:$,removeItemFromUUID:E,setItemFromUUID:k}=T((()=>{})),F=e({props:{payload:{type:Object,required:!0}},setup(e){const u=t(w),d=t("$xetable"),c=o(),f=D(u),m=l((()=>e.payload.row[e.payload.column.field]));function h(){const{row:t,column:o}=e.payload,l=d.getRowSeq(t);if(!f||null==l||!c.value)return;const n=c.value.clientHeight;f.set(l,o.field,n)}n("updateCellHeight",h),r([()=>e.payload.rowIndex,()=>e.payload.column.field,m,()=>e.payload.column.renderWidth],(async()=>{await g(0),h()})),a((()=>{d&&!S(u)&&C(u,d),h()}));const I=l((()=>{var t,o,l,n;const r=null!=(o=null==(t=e.payload.column.editRender)?void 0:t.props)?o:{},a=null!=(n=null==(l=r.slots)?void 0:l.default)?n:r.slotFn;return v(a)?a:()=>m.value})),b=l((()=>{if(e.payload.column.treeNode)return"";const t=e.payload.column.renderWidth;return x(t)&&t>0?p(t-20-2):""}));return()=>s("div",{ref:c,style:{padding:"7px 0",width:b.value,overflow:"hidden"}},[i(I.value,e.payload)])}});function j(e,t,{scrollTop:o=0}){var l,n;const{uuid:r,rowConfig:a={}}=t;if(!r)return;const s=D(r),{oSize:i=0,gt:d=100}=null!=(l=$(r))?l:{},{internalData:c,reactData:p}=e,{scrollYStore:f,elemStore:m,afterFullData:h,fullDataRowIdData:g}=c;if(d>h.length)return;const x=null!=(n=a.height)?n:36,b=m["main-body-wrapper"],w=b?u(b):null;let y=w?Math.max(8,Math.ceil(w.clientHeight/x)+2+i):8;const T=[0];let R=0;if(o&&h.find(((t,l)=>{const n=e.getRowSeq(t),r=(I(T)||0)+Math.max(x,s.getMax(n));if(T.push(r),r>o)return R=Math.max(0,l-i),y+=Math.min(R,i),!0})),R>0&&v(t.spanMethod)){const{spanMethod:o}=t,l={rowspan:1,colspan:1};for(;R>0;){if(!e.getColumns().some(((e,t)=>{const{rowspan:n,colspan:r}=o({column:e,columnIndex:t,$columnIndex:t,row:h[R],rowIndex:R,$rowIndex:R,_rowIndex:R,isHidden:!e.visible,fixed:e.fixed,type:e.type,visibleData:h})||l;if(0===n&&0===r)return R--,!0})))break}}const H=`${T[R]}px`,M=`${h.reduce(((t,o)=>{const l=e.getRowSeq(o);return t+Math.max(x,s.getMax(l))}),0)}px`;["main","left","right"].forEach((e=>{const t=m[`${e}-body-table`],l=t?u(t):null;l&&(l.style.marginTop=H,l.scrollTop=o),["header","body","footer"].forEach((t=>{const o=m[`${e}-${t}-ySpace`],l=o?u(o):null;l&&(l.style.height=M)}))}));const S=Math.min(h.length,R+y);if(f.startIndex===R&&f.endIndex===S)return;f.startIndex=R,f.endIndex=S;const U=h.slice(f.startIndex,f.endIndex);U.forEach(((t,o)=>{const l=e.getRowid(t),n=g[l];n&&(n.$index=o)})),p.tableData.length=0,p.tableData.push(...U)}const L=h(j,300);function Y(){const e="variableHeightRendererPlugin";return R({name:e,vxe(e){e.renderer.add(y.VARIABLE_HEIGHT,{renderCell:(e,t)=>s(F,{payload:t},null)})},apply(t){function o(e){const t=S(e.uuid);if(!t)return;e.scrollY={enabled:!1},t.reactData.scrollYLoad=!1;const o=function(e){const t=e.internalData.elemStore["main-body-wrapper"];return t?u(t):null}(t);o&&j(t,e,{scrollTop:o.scrollTop})}function l(e){if(!e.uuid)return;const t=$(e.uuid);t&&(e.scrollY=t),setTimeout((()=>o(e)),300)}t.dataHooks.dataStart.tap(e,l),t.eventHooks.onFilterChange.tap(e,((e,t)=>l(t))),t.eventHooks.onSortChange.tap(e,((e,t)=>l(t))),t.eventHooks.onToggleTreeExpand.tap(e,((e,t)=>l(t))),t.eventHooks.onResizableChange.tap(e,(async({column:e},t)=>{if(!e.editRender||!e.editRender.props)return;e.editRender.props.variableHeight&&l(t)})),t.eventHooks.onScroll.tap(e,h(((e,t)=>{if(e.isX)return;const{uuid:o}=t;if(!o)return;const l=S(o);l&&j(l,t,e)}),100,!0,!0)),t.fieldHooks.field.tap(e,(e=>{if(Reflect.get(e,"variableHeight")){const t=e.slots;e.slots=b(t,["default"]),e.editRender={...e.editRender,name:y.VARIABLE_HEIGHT};const o=e.className,l="variable-height";e.className=o?function(e){return v(o)?[o(e),l]:[o,l]}:l}return e})),t.fieldHooks.fieldList.tap(e,((e,t,{$table:l})=>(t.uuid&&f(e,((n,r)=>{var a,s,i;if((null==(a=n.editRender)?void 0:a.name)===y.VARIABLE_HEIGHT){const n=null!=(i=null==(s=t.rowConfig)?void 0:s.height)?i:36,a=D(t.uuid),d=t.cellStyle;if(t.cellStyle=function(e){const t={};if(e.column.fixed&&Reflect.get(e,"fixed")&&l.value){const o=Math.max(n,a.getMax(l.value.getRowSeq(e.row)));t.height=`${o}px`}return Object.assign(t,d?v(d)?d(e):d:null)},t.sortableConfig&&t.sortableConfig.enable){const e=t.sortableConfig.onEnd;t.sortableConfig.onEnd=function(o){const l=S(t.uuid);if(l){const{internalData:{elemStore:e}}=l,o=e["main-table-body"];o&&u(o)&&j(l,t,{scrollTop:u(o).scrollTop})}v(e)&&e(o)}}t.showOverflow="tooltip",f(e,(e=>{e.showOverflow="tooltip"})),t.scrollY={...t.scrollY,mode:"default"},t.onWheel=function(e){let t=null,o=0,l=!0;return function(n){if(!e.uuid)return;const r=S(e.uuid);if(!r)return;const{internalData:a}=r,{isHover:s}=e.rowConfig||{},{deltaX:i,deltaY:d}=n,{refTableLeftBody:c,refTableRightBody:p,refTableBody:f}=r.getRefMaps(),h=d,g=i,v=h<0,x=u(f),I=x?x.$el:null;if(!I)return;if(v?I.scrollTop<=0:I.scrollTop>=I.scrollHeight-I.clientHeight)return;const b=I.scrollTop+h,w=I.scrollLeft+g;if(b===a.lastScrollTop)return;n.preventDefault(),a.lastScrollTop=b,a.lastScrollLeft=w,a.lastScrollTime=Date.now(),s&&r.clearHoverRow();const y=c.value,T=p.value,R=y?y.$el:null,H=T?T.$el:null,D=Math.min(100,Math.abs(Math.floor(h/2)));l&&(o=I.scrollTop,l=!1),o+=D*(v?-1:1),t&&t(),t=m(I.scrollTop,o,400,(e=>{I.scrollTop=e,R&&(R.scrollTop=e),H&&(H.scrollTop=e)}),"easeOutCubic",(()=>{o=I.scrollTop,l=!0})),L(r,e,I)}}(t),setTimeout((()=>{k(t.uuid,t.scrollY),o(t)}),300),r()}})),e))),t.setupHooks.setup.tap(e,(e=>{d((()=>{e.value.uuid&&(M(e.value.uuid),U(e.value.uuid),E(e.value.uuid))}))}))}})}export{Y as variableHeightRendererPlugin};
|
|
@@ -3,6 +3,7 @@ import { LOW_CODE_VALUE_RELATION } from '../../../../../es/shared/utils';
|
|
|
3
3
|
import { VxeTableProps, VxeTableDefines, VxeTableInstance, VxeColumnPropTypes, VxeTablePropTypes } from 'vxe-table';
|
|
4
4
|
import { VxeTableListeners } from 'vxe-table/types/table';
|
|
5
5
|
import { IHO_TABLE_STRING_STATUS, IhoTableEventNameTuple, IhoTableRowGroupSequence } from '../../../../../es/components/iho-table/src/constants';
|
|
6
|
+
import Sortable from 'sortablejs';
|
|
6
7
|
export * from './pluginType';
|
|
7
8
|
export interface IhoTableRowGroupItem {
|
|
8
9
|
groupName?: string;
|
|
@@ -27,6 +28,11 @@ export declare type IhoTableConfig = VxeTableProps & Partial<{
|
|
|
27
28
|
slots: VxeColumnPropTypes.Slots;
|
|
28
29
|
maxCheckSize: number;
|
|
29
30
|
}>;
|
|
31
|
+
sortableConfig: Partial<{
|
|
32
|
+
enable: boolean;
|
|
33
|
+
usePreset: boolean;
|
|
34
|
+
[K: string]: any;
|
|
35
|
+
}>;
|
|
30
36
|
[K: string]: unknown;
|
|
31
37
|
}>;
|
|
32
38
|
export declare type IhoTableFieldItem = {
|
|
@@ -45,9 +51,12 @@ export declare namespace IhoTableLowCodeField {
|
|
|
45
51
|
}>;
|
|
46
52
|
};
|
|
47
53
|
}>;
|
|
54
|
+
type FilterSetting = Partial<{
|
|
55
|
+
daterange: boolean;
|
|
56
|
+
}>;
|
|
48
57
|
type ColorAndIconItem = {
|
|
49
58
|
condition?: {
|
|
50
|
-
con: LOW_CODE_VALUE_RELATION
|
|
59
|
+
con: LOW_CODE_VALUE_RELATION;
|
|
51
60
|
value: unknown;
|
|
52
61
|
field_key?: string;
|
|
53
62
|
}[];
|
|
@@ -60,6 +69,13 @@ export declare namespace IhoTableLowCodeField {
|
|
|
60
69
|
colorAndIcon: ColorAndIconItem[];
|
|
61
70
|
[K: string]: unknown;
|
|
62
71
|
}>;
|
|
72
|
+
type QueryOptions = (payload: {
|
|
73
|
+
keyword?: string;
|
|
74
|
+
row?: AnyObject;
|
|
75
|
+
column: VxeTableDefines.ColumnInfo;
|
|
76
|
+
rowIndex?: number;
|
|
77
|
+
isFullData?: boolean;
|
|
78
|
+
}) => Promise<AnyObject[]>;
|
|
63
79
|
}
|
|
64
80
|
export declare type LowCodeTableFieldItem = {
|
|
65
81
|
columnName: string;
|
|
@@ -77,6 +93,7 @@ export declare type LowCodeTableFieldItem = {
|
|
|
77
93
|
formType: string;
|
|
78
94
|
fieldSetting: string;
|
|
79
95
|
filterCapacity: number;
|
|
96
|
+
notParticipatingSearch: 0 | 1;
|
|
80
97
|
componentProps: AnyObject;
|
|
81
98
|
options: {
|
|
82
99
|
label?: string;
|
|
@@ -84,6 +101,7 @@ export declare type LowCodeTableFieldItem = {
|
|
|
84
101
|
value: string;
|
|
85
102
|
disabled?: boolean;
|
|
86
103
|
}[];
|
|
104
|
+
queryOptions: IhoTableLowCodeField.QueryOptions;
|
|
87
105
|
annotation: boolean;
|
|
88
106
|
slotFn: NonNullable<IhoTableFieldItem['slots']>['default'];
|
|
89
107
|
headerSlotFn: NonNullable<IhoTableFieldItem['slots']>['header'];
|
|
@@ -96,6 +114,7 @@ export declare type LowCodeTableFieldItem = {
|
|
|
96
114
|
checkEditStatus: (payload: VxeTableDefines.CellRenderBodyParams) => boolean | void;
|
|
97
115
|
colorAndIcon: IhoTableLowCodeField.ColorAndIconItem[];
|
|
98
116
|
variableHeight: boolean;
|
|
117
|
+
filterSetting: IhoTableLowCodeField.FilterSetting;
|
|
99
118
|
}> & Partial<VxeTableDefines.ColumnInfo>;
|
|
100
119
|
export declare type IhoTableFormChangePayload = {
|
|
101
120
|
column: IhoTableFieldItem;
|
|
@@ -113,7 +132,7 @@ export declare type IhoTableEventNameUnion = TupleToUnion<typeof IhoTableEventNa
|
|
|
113
132
|
export declare type IHoTableKeyboardPayload = IhoTableFormChangePayload & {
|
|
114
133
|
key: string;
|
|
115
134
|
};
|
|
116
|
-
export declare type IhoTableEmitPayload<T extends typeof IhoTableEventNameTuple[number]> = T extends 'formChange' | 'formClick' ? [IhoTableFormChangePayload] : T extends 'keyboard' ? [IHoTableKeyboardPayload] : T extends 'settingClick' ? [] : T extends keyof VxeTableListeners ? Parameters<NonNullable<VxeTableListeners[T]>> : [];
|
|
135
|
+
export declare type IhoTableEmitPayload<T extends typeof IhoTableEventNameTuple[number]> = T extends 'formChange' | 'formClick' ? [IhoTableFormChangePayload] : T extends 'keyboard' ? [IHoTableKeyboardPayload] : T extends 'settingClick' ? [] : T extends 'rowDrag' ? [Sortable.SortableEvent] : T extends keyof VxeTableListeners ? Parameters<NonNullable<VxeTableListeners[T]>> : [];
|
|
117
136
|
export declare type IhoTableAnchorItem = {
|
|
118
137
|
field: string;
|
|
119
138
|
title: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AnyObject, ArrayAble, Func, Nullable
|
|
1
|
+
import { AnyObject, ArrayAble, Func, Nullable } from '../../../../../es/shared/types';
|
|
2
2
|
import { AsyncParallelHook, AsyncSeriesHook, SyncHook, SyncWaterfallHook } from '../../../../../es/shared/utils/tapable';
|
|
3
3
|
import { MaybeRef } from '@vueuse/core';
|
|
4
4
|
import { Ref, VNode } from 'vue';
|
|
5
|
-
import { VxeGlobalCommands, VxeGlobalFormats, VxeGlobalHooks, VxeGlobalMenus, VxeGlobalRenderer, VxeTableInstance } from 'vxe-table';
|
|
5
|
+
import { VxeGlobalCommands, VxeGlobalFormats, VxeGlobalHooks, VxeGlobalMenus, VxeGlobalRenderer, VxeTableInstance, VXETableSetupOptions } from 'vxe-table';
|
|
6
6
|
import { VxeTableEventProps, VxeTableEvents } from 'vxe-table/types/table';
|
|
7
7
|
import { VxeGlobalInterceptor } from 'vxe-table/types/v-x-e-table';
|
|
8
8
|
import { IhoTableConfig, IhoTableEmits, IhoTableFieldItem, IhoTableHandler } from '.';
|
|
@@ -13,12 +13,17 @@ export declare type IhoTableInstance = {
|
|
|
13
13
|
formats: VxeGlobalFormats;
|
|
14
14
|
menus: VxeGlobalMenus;
|
|
15
15
|
hooks: VxeGlobalHooks;
|
|
16
|
+
setup: (option: VXETableSetupOptions) => void;
|
|
16
17
|
};
|
|
17
18
|
export declare type TablePlugin = {
|
|
18
19
|
name: string;
|
|
19
20
|
vxe?(vxeTable: IhoTableInstance): void;
|
|
20
21
|
apply?(hooks: TableHooks): void;
|
|
21
22
|
};
|
|
23
|
+
export declare type IhoTableHandlerContext<isRef extends boolean = true> = {
|
|
24
|
+
$table: isRef extends true ? Ref<Nullable<VxeTableInstance>> : Nullable<VxeTableInstance>;
|
|
25
|
+
emits: IhoTableEmits;
|
|
26
|
+
};
|
|
22
27
|
export declare type TableHooks = Readonly<{
|
|
23
28
|
configHooks: AbstractConfigHooks;
|
|
24
29
|
fieldHooks: AbstractFieldHooks;
|
|
@@ -29,12 +34,9 @@ export declare type TableHooks = Readonly<{
|
|
|
29
34
|
exposeHooks: AbstractExposeHooks;
|
|
30
35
|
}>;
|
|
31
36
|
export declare type WithTableConfig<T = []> = T extends any[] ? [...T, IhoTableConfig] : [T, IhoTableConfig];
|
|
32
|
-
|
|
33
|
-
$table: Ref<UndefinedAble<VxeTableInstance>>;
|
|
34
|
-
};
|
|
35
|
-
declare type ConfigHookType<T> = SyncWaterfallHook<[...WithTableConfig<[T]>, ConfigHookContext]>;
|
|
37
|
+
declare type ConfigHookType<T> = SyncWaterfallHook<[...WithTableConfig<[T]>, IhoTableHandlerContext]>;
|
|
36
38
|
export declare abstract class AbstractConfigHooks {
|
|
37
|
-
abstract readonly config: SyncWaterfallHook<[IhoTableConfig,
|
|
39
|
+
abstract readonly config: SyncWaterfallHook<[IhoTableConfig, IhoTableHandlerContext]>;
|
|
38
40
|
abstract readonly rowConfig: ConfigHookType<IhoTableConfig['rowConfig']>;
|
|
39
41
|
abstract readonly editConfig: ConfigHookType<IhoTableConfig['editConfig']>;
|
|
40
42
|
abstract readonly columnConfig: ConfigHookType<IhoTableConfig['columnConfig']>;
|
|
@@ -59,26 +61,14 @@ export interface FieldHookContext {
|
|
|
59
61
|
insertBefore(field: ArrayAble<IhoTableFieldItem>): void;
|
|
60
62
|
insertAfter(field: ArrayAble<IhoTableFieldItem>): void;
|
|
61
63
|
}
|
|
62
|
-
export declare type WithFieldHookContext<T = []> = [
|
|
63
|
-
...WithTableConfig<T>,
|
|
64
|
-
{
|
|
65
|
-
$table: Ref<Nullable<VxeTableInstance>>;
|
|
66
|
-
emits: IhoTableEmits;
|
|
67
|
-
}
|
|
68
|
-
];
|
|
64
|
+
export declare type WithFieldHookContext<T = []> = [...WithTableConfig<T>, IhoTableHandlerContext];
|
|
69
65
|
export declare abstract class AbstractFieldHooks {
|
|
70
66
|
abstract readonly fieldStart: AsyncParallelHook<WithFieldHookContext>;
|
|
71
67
|
abstract readonly field: SyncWaterfallHook<WithFieldHookContext<[IhoTableFieldItem, FieldHookContext]>>;
|
|
72
68
|
abstract readonly fieldList: SyncWaterfallHook<WithFieldHookContext<[IhoTableFieldItem[]]>>;
|
|
73
69
|
abstract readonly fieldEnd: AsyncParallelHook<WithFieldHookContext>;
|
|
74
70
|
}
|
|
75
|
-
export declare type WithIhoEventContext<T> = [
|
|
76
|
-
...WithTableConfig<T>,
|
|
77
|
-
IhoTableHandler & {
|
|
78
|
-
$table: Nullable<VxeTableInstance>;
|
|
79
|
-
emits: IhoTableEmits;
|
|
80
|
-
}
|
|
81
|
-
];
|
|
71
|
+
export declare type WithIhoEventContext<T> = [...WithTableConfig<T>, IhoTableHandler & IhoTableHandlerContext<false>];
|
|
82
72
|
declare type EventHookType<T extends Func> = AsyncParallelHook<WithIhoEventContext<Parameters<T>>>;
|
|
83
73
|
declare type VxeEventTypes = Required<{
|
|
84
74
|
readonly [K in keyof VxeTableEventProps]: EventHookType<NonNullable<VxeTableEventProps[K]>>;
|
|
@@ -158,7 +148,7 @@ export declare abstract class AbstractDataHooks {
|
|
|
158
148
|
abstract readonly dataEnd: AsyncParallelHook<WithTableConfig>;
|
|
159
149
|
}
|
|
160
150
|
export declare abstract class AbstractSetupHooks {
|
|
161
|
-
abstract readonly setup: SyncHook<[Ref<IhoTableConfig>, Ref<IhoTableFieldItem[]
|
|
151
|
+
abstract readonly setup: SyncHook<[Ref<IhoTableConfig>, Ref<IhoTableFieldItem[]>, IhoTableHandlerContext]>;
|
|
162
152
|
}
|
|
163
153
|
export declare abstract class AbstractDomInsertHooks {
|
|
164
154
|
abstract readonly header: SyncWaterfallHook<[VNode[]]>;
|
|
@@ -167,10 +157,7 @@ export declare abstract class AbstractDomInsertHooks {
|
|
|
167
157
|
export declare type WithExposeHookConfig<T = []> = [
|
|
168
158
|
...(T extends any[] ? T : [T]),
|
|
169
159
|
Ref<IhoTableConfig>,
|
|
170
|
-
|
|
171
|
-
$table: Ref<Nullable<VxeTableInstance>>;
|
|
172
|
-
emits: IhoTableEmits;
|
|
173
|
-
}
|
|
160
|
+
IhoTableHandlerContext
|
|
174
161
|
];
|
|
175
162
|
export declare abstract class AbstractExposeHooks {
|
|
176
163
|
abstract readonly expose: SyncWaterfallHook<WithExposeHookConfig<Record<string, Func>>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyObject, Nullable } from '../../../../../es/shared/types';
|
|
1
|
+
import { AnyObject, ArrayAble, Nullable } from '../../../../../es/shared/types';
|
|
2
2
|
import { MaybeRef } from '@vueuse/core';
|
|
3
3
|
import { VxeTableDefines, VxeTableInstance } from 'vxe-table';
|
|
4
4
|
import { VxeGlobalRendererHandles } from 'vxe-table/types/v-x-e-table/renderer';
|
|
@@ -35,7 +35,8 @@ export declare const IhoTableRenderHelper: Readonly<{
|
|
|
35
35
|
createDefaultRenderCell: typeof createDefaultRenderCell;
|
|
36
36
|
createRenderEdit: typeof createRenderEdit;
|
|
37
37
|
isEditableColumn(config: IhoTableConfig, column: IhoTableFieldItem): boolean | undefined;
|
|
38
|
-
hasFilter(
|
|
38
|
+
hasFilter(lowCodeField: LowCodeTableFieldItem): boolean;
|
|
39
|
+
hasDateFiler(lowCodeField: LowCodeTableFieldItem): boolean | undefined;
|
|
39
40
|
}>;
|
|
40
41
|
export declare const IhoTableStatusHelper: Readonly<{
|
|
41
42
|
isPositive(value: string | number | undefined | null): boolean;
|
|
@@ -43,7 +44,7 @@ export declare const IhoTableStatusHelper: Readonly<{
|
|
|
43
44
|
notPositive(value: string | number | undefined | null): boolean;
|
|
44
45
|
notNegative(value: string | number | undefined | null): boolean;
|
|
45
46
|
}>;
|
|
46
|
-
export declare const createIhoTableClearActivedInterceptor: (type: EDITABLE_WIDGET_TYPE
|
|
47
|
+
export declare const createIhoTableClearActivedInterceptor: (type: ArrayAble<EDITABLE_WIDGET_TYPE>, solution: (ele: HTMLElement) => boolean) => ({ $event, column }: {
|
|
47
48
|
$event: Event;
|
|
48
49
|
column: VxeTableDefines.ColumnInfo;
|
|
49
50
|
}) => boolean;
|
|
@@ -51,4 +52,5 @@ export declare function isTransformTreeType(config: IhoTableConfig): boolean;
|
|
|
51
52
|
export declare function isRichContent(content: string): content is string;
|
|
52
53
|
export declare function parseRichContent(richContent: string): any;
|
|
53
54
|
export declare function parseMergeField(row: AnyObject, column: VxeTableDefines.ColumnInfo): any;
|
|
55
|
+
export declare function isCompatibleColumn(field: LowCodeTableFieldItem): number | false;
|
|
54
56
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,inject as n,unref as t,toRaw as r,createVNode as
|
|
1
|
+
import{reactive as e,inject as n,unref as t,toRaw as r,createVNode as i}from"vue";import{jsonParse as o,arrayed as u,findAncestor as l}from"../../../../shared/utils/index.js";import{promiseTimeout as c}from"@vueuse/shared";import{isNumber as a,cloneDeep as d,isString as s,isObject as f,isArray as m}from"lodash-es";import{InjectionIhoTableEmits as p,InjectionIhoTableConfig as v,IHO_TABLE_STRING_STATUS as g,IHO_TABLE_NUMBER_STATUS as E,IHO_TABLE_TREE_TYPE as I}from"../constants/index.js";function h(e){return console.warn(`[IhoTable]: ${e}`)}const T=Object.freeze({getCellType(e){var n;return((null==(n=e.settingObj)?void 0:n.attr)||e.formType||"DEFAULT").toUpperCase()}});function C(){var e,t,r;const i=n(v);return i||h("this function(getRowHeight) only can be used in setup environment"),null!=(r=null==(t=null==(e=null==i?void 0:i.value)?void 0:e.rowConfig)?void 0:t.height)?r:32}function R(e){const n=e.slice(2);return`${n[0].toLowerCase()}${n.slice(1)}`}function S(e){return`on${e[0].toUpperCase()}${e.slice(1)}`}function w(n,t=!0){const r=t?e(new Map):new Map;return{getItemFromUUID:function(e){return r.set(e,r.get(e)||n()).get(e)},setItemFromUUID:function(e,n){r.set(e,n)},removeItemFromUUID:function(e){r.delete(e)}}}async function O(e,n){return r()||await c(0),r()||function(){const n=+e.colWidth;return a(n)?n:64}();function r(){var r,i;return null==(i=null==(r=t(n))?void 0:r.getColumnByField(e.field))?void 0:i.renderWidth}}function F(e){const t=n(p);function i(){var n;return{value:e.row[e.column.field],row:e.row,column:{...e.column,...null==(n=e.column.editRender)?void 0:n.props},index:e.rowIndex>-1?e.rowIndex:e.$rowIndex}}function o(e={}){t("formChange",{...i(),...d(r(e))})}function u(e={}){t("formClick",{...i(),...d(r(e))})}return{emitFormChange:function(){o()},emitFormClick:function(){u()},emitFormChangeWithParams:o,emitFormClickWithParams:u}}const P=Object.freeze({createDefaultRenderCell:function(){return function(e,{row:n,column:t}){return[i("span",null,[n[t.field]])]}},createRenderEdit:function(e){return function({props:n},t){return e({...t,fieldItem:n||{},...F(t)})}},isEditableColumn(e,n){var t;return!1!==(null==(t=e.editConfig)?void 0:t.showIcon)&&n.editRender&&!1!==n.editRender.enabled},hasFilter(e){if(y(e))return!0;let n=e.fieldSetting;return s(n)&&(n=o(n||"")),f(n)&&((t=n).notParticipatingSearch!==g.POSITIVE&&"manual"===(null==(r=t.mapping)?void 0:r.type));var t,r},hasDateFiler(e){var n;return null==(n=null==e?void 0:e.filterSetting)?void 0:n.daterange}}),A=Object.freeze({isPositive:e=>e===E.POSITIVE||e===g.POSITIVE,isNegative:e=>e===E.NEGATIVE||e===g.NEGATIVE,notPositive:e=>e!==E.POSITIVE&&e!==g.POSITIVE,notNegative:e=>e!==E.NEGATIVE&&e!==g.NEGATIVE}),N=(e,n)=>({$event:t,column:r})=>{var i;if(!u(e).includes(null==(i=r.editRender)?void 0:i.name))return!0;const o=null==t?void 0:t.target;return!f(o)||!l(o,n)};function V(e){return[I.TRANSFORM_WITH_SPAN_METHOD,I.TRANSFORM_TREE_TYPE].includes(`${e.isTree}`)}function $(e){return s(e)&&!!e.match(/^###\{[^{}]+}$/)}function x(e){try{return JSON.parse(e.replace(/^###/,""))}catch(e){return{}}}function U(e,n){if(e.$__SEPARATE||!n.editRender||!n.editRender.props)return e[n.field];const{fieldSetting:t}=n.editRender.props;if(!s(t))return e[n.field];const{mergedFeildExpression:r}=o(t);return r&&s(r)?r.replace(/#{(.+?)}/g,(function(n,t){let r=t?e[t.trim()]:null;$(r)&&(r=x(r).change_text);return r||(null==r?"--":r)})):e[n.field]}const b=["SEARCH","SELECT","RADIO","CHECKBOX"];function y(e){return e.notParticipatingSearch===E.NEGATIVE&&b.includes(T.getCellType(e))&&m(e.options)&&e.options.length}export{P as IhoTableRenderHelper,A as IhoTableStatusHelper,T as IhoTableUtils,h as IhoTableWarn,N as createIhoTableClearActivedInterceptor,R as eventListener2EventName,S as eventName2EventListener,O as getColumnRenderWidth,C as getRowHeight,y as isCompatibleColumn,$ as isRichContent,V as isTransformTreeType,U as parseMergeField,x as parseRichContent,F as useIhoTableFormEvent,w as useUUIDMap};
|