cnhis-design-vue 3.1.41-beta.3 → 3.1.41-beta.31
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/button-print/index.d.ts +3 -2
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +3 -2
- package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
- package/es/components/button-print/src/api.d.ts +3 -0
- package/es/components/button-print/src/api.js +1 -0
- package/es/components/button-print/src/utils/print.d.ts +1 -1
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/date-picker/index.d.ts +20 -0
- package/es/components/date-picker/index.js +1 -0
- package/es/components/date-picker/src/DatePicker.vue.d.ts +20 -0
- package/es/components/date-picker/src/DatePicker.vue.js +1 -0
- package/es/components/fabric-chart/src/hooks/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/useBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/useDraw.d.ts +1 -0
- package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
- package/es/components/fabric-chart/src/hooks/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/useTop.js +1 -1
- package/es/components/field-set/index.d.ts +8 -0
- package/es/components/field-set/src/FieldSet.vue.d.ts +5 -0
- package/es/components/field-set/src/FieldSet.vue.js +1 -1
- package/es/components/field-set/style/index.css +1 -1
- package/es/components/form-config/index.d.ts +6762 -46
- package/es/components/form-config/src/FormConfig.vue.d.ts +6903 -186
- package/es/components/form-config/src/FormConfig.vue.js +1 -1
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +2 -2
- package/es/components/form-config/src/components/FormConfigCreator.vue.js +1 -1
- package/es/components/form-config/src/components/FormConfigDragDisplay.vue.d.ts +4 -4
- package/es/components/form-config/src/components/FormConfigDragDisplay.vue.js +1 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3415 -60
- package/es/components/form-config/src/components/FormConfigEdit.vue.js +1 -1
- package/es/components/form-config/src/components/FormConfigMaterialItem.d.ts +2 -2
- package/es/components/form-config/src/components/FormConfigMaterialItem.js +1 -1
- package/es/components/form-config/src/components/renderer/CloseButton.vue.d.ts +3 -3
- package/es/components/form-config/src/components/renderer/CloseButton.vue.js +1 -1
- package/es/components/form-config/src/components/renderer/ComplexNode.vue.d.ts +10 -10
- package/es/components/form-config/src/components/renderer/ComplexNode.vue.js +1 -1
- package/es/components/form-config/src/components/renderer/DefaultNode.vue.d.ts +6 -6
- package/es/components/form-config/src/components/renderer/DefaultNode.vue.js +1 -1
- package/es/components/form-config/src/hooks/useConfigurationField.d.ts +2 -3
- package/es/components/form-config/src/hooks/useConfigurationField.js +1 -1
- package/es/components/form-config/src/hooks/useDataNormalize.d.ts +4 -2
- package/es/components/form-config/src/hooks/useDataNormalize.js +1 -1
- package/es/components/form-config/src/hooks/usePresetRenderer.d.ts +1 -1
- package/es/components/form-config/src/hooks/useSortalbeConfig.js +1 -1
- package/es/components/form-config/src/types/index.d.ts +9 -2
- package/es/components/form-config/src/utils/index.d.ts +4 -1
- package/es/components/form-config/src/utils/index.js +1 -1
- package/es/components/form-config/style/index.css +1 -1
- package/es/components/form-render/index.d.ts +2 -2
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/FormRender.vue.d.ts +1 -1
- package/es/components/form-render/src/FormRender.vue.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +22 -21
- package/es/components/form-render/src/FormRenderWrapper.vue.js +1 -1
- package/es/components/form-render/src/components/renderer/formItem.js +1 -1
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
- package/es/components/form-render/src/constants/index.d.ts +0 -12
- package/es/components/form-render/src/constants/index.js +1 -1
- package/es/components/form-render/src/hooks/useComplexOptions.d.ts +2 -6
- package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.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/hooks/useFormField.d.ts +1 -0
- package/es/components/form-render/src/hooks/useFormField.js +1 -1
- package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
- package/es/components/form-render/src/hooks/useLowCodeReactions.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +4 -0
- package/es/components/form-render/src/types/index.d.ts +5 -3
- package/es/components/form-render/src/utils/dom.d.ts +2 -1
- package/es/components/form-render/src/utils/dom.js +1 -1
- package/es/components/iho-table/index.d.ts +5 -5
- package/es/components/iho-table/index.js +1 -1
- package/es/components/iho-table/src/IhoTable.vue.d.ts +5 -5
- package/es/components/iho-table/src/IhoTable.vue.js +1 -1
- package/es/components/iho-table/src/constants/index.d.ts +2 -2
- package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +1 -1
- package/es/components/iho-table/src/plugins/defaultConfigPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/{filterPlugin → filterRenderPlugin}/filter.vue.d.ts +15 -74
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.js +1 -0
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -0
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +20 -7
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +102 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.js +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/{timeRendererPlugin.d.ts → timeRendererPlugin/index.d.ts} +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/index.js +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/colorRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/defaultRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/labelRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/pictureRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/virtualTreePlugin/index.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +20 -11
- 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 +3 -1
- package/es/components/index.js +1 -1
- package/es/components/info-header/index.d.ts +289 -155
- package/es/components/info-header/src/InfoHeader.vue.d.ts +293 -160
- package/es/components/info-header/src/InfoHeader.vue.js +1 -1
- package/es/components/info-header/src/components/index.d.ts +3 -0
- package/es/components/info-header/src/components/index.js +1 -0
- package/es/components/info-header/src/components/infoDescription/HiddenContent.vue.js +1 -0
- package/es/components/info-header/src/components/infoDescription/InfoEllipsis.vue.js +1 -0
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +266 -0
- package/es/components/info-header/src/components/infoDescription/index.vue.js +1 -0
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +38 -0
- package/es/components/info-header/src/components/patientInfo/index.vue.js +1 -0
- package/es/components/info-header/src/types/index.d.ts +29 -0
- package/es/components/recommend-search/index.d.ts +10 -10
- package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +10 -10
- package/es/components/recommend-search/src/components/BaseSearch.vue.d.ts +2 -2
- package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +4 -4
- package/es/components/recommend-search/src/components/RecommendSelect.vue.d.ts +4 -4
- package/es/components/scale-view/index.d.ts +1 -2
- package/es/components/scale-view/src/ScaleView.vue.d.ts +1 -5
- package/es/components/scale-view/src/ScaleView.vue.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.d.ts +1 -0
- package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
- package/es/components/scale-view/src/utils/judge-types.js +1 -1
- package/es/components/scale-view/style/index.css +1 -1
- package/es/components/shortcut-setter/index.d.ts +4 -3
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +4 -3
- package/es/components/steps-wheel/index.d.ts +1 -1
- package/es/components/steps-wheel/src/StepsWheel.vue.d.ts +1 -1
- package/es/components/table-filter/index.d.ts +963 -8064
- package/es/components/table-filter/index.js +1 -1
- package/es/components/table-filter/src/base-search-com/BaseSearch.vue.d.ts +57 -3397
- package/es/components/table-filter/src/base-search-com/BaseSearch.vue.js +1 -1
- package/es/components/table-filter/src/classification/Classification-com.vue.d.ts +404 -2969
- package/es/components/table-filter/src/classification/Classification-com.vue.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +2 -2
- package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.d.ts +1 -42
- package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +20 -49
- package/es/components/table-filter/src/components/classify-filter/index.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/index.vue.d.ts +2 -1
- package/es/components/table-filter/src/components/render-widget/index.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +1 -1
- package/es/components/table-filter/src/components/search-filter/index.vue.d.ts +372 -0
- package/es/components/table-filter/src/components/search-filter/index.vue.js +1 -0
- package/es/components/table-filter/src/components/set-classification/index.vue.d.ts +717 -0
- package/es/components/table-filter/src/components/set-classification/index.vue.js +1 -0
- package/es/components/table-filter/src/components/table-modal/{TableModal.vue.d.ts → index.vue.d.ts} +0 -42
- package/es/components/table-filter/src/components/table-modal/index.vue.js +1 -0
- package/es/components/table-filter/src/hooks/export.js +1 -1
- package/es/components/table-filter/src/hooks/useAdvanced.d.ts +2 -2
- package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
- package/es/components/table-filter/src/hooks/useMixins.d.ts +1 -1
- package/es/components/table-filter/src/hooks/useMixins.js +1 -1
- package/es/components/table-filter/src/quick-search/QuickSearch.vue.d.ts +50 -1291
- package/es/components/table-filter/src/quick-search/QuickSearch.vue.js +1 -1
- package/es/components/table-filter/src/types/index.d.ts +10 -176
- package/es/components/table-filter/style/iconfont.ttf +0 -0
- package/es/components/table-filter/style/index.css +1 -1
- package/es/components/time-picker/index.d.ts +18 -0
- package/es/components/time-picker/index.js +1 -0
- package/es/components/time-picker/src/TimePicker.vue.d.ts +18 -0
- package/es/components/time-picker/src/TimePicker.vue.js +1 -0
- package/es/env.d.ts +24 -24
- package/es/shared/components/TextOverTooltip/TextOverTooltip.vue.d.ts +1 -1
- package/es/shared/components/no-data/NoData.vue.d.ts +5 -0
- package/es/shared/components/no-data/NoData.vue.js +1 -1
- package/es/shared/utils/index.d.ts +16 -0
- package/es/shared/utils/index.js +1 -1
- 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/callback/src/components/form.d.ts +0 -0
- package/es/components/callback/src/components/page.d.ts +0 -0
- package/es/components/callback/src/components/table.d.ts +0 -0
- package/es/components/callback/src/types/index.d.ts +0 -0
- package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
- package/es/components/iho-table/src/plugins/filterPlugin/filter.vue.js +0 -1
- package/es/components/iho-table/src/plugins/filterPlugin/index.d.ts +0 -1
- package/es/components/iho-table/src/plugins/filterPlugin/index.js +0 -1
- package/es/components/iho-table/src/plugins/filterPlugin/types.d.ts +0 -7
- package/es/components/iho-table/src/plugins/filterPlugin/types.js +0 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin.js +0 -1
- package/es/components/info-header/src/HiddenContent.vue.js +0 -1
- package/es/components/info-header/src/InfoEllipsis.vue.js +0 -1
- package/es/components/table-filter/src/classification/search-class-name.vue.d.ts +0 -90
- package/es/components/table-filter/src/classification/search-class-name.vue.js +0 -1
- package/es/components/table-filter/src/classification/search-professional-model.vue.d.ts +0 -1472
- package/es/components/table-filter/src/classification/search-professional-model.vue.js +0 -1
- package/es/components/table-filter/src/components/age-com/index.vue.d.ts +0 -119
- package/es/components/table-filter/src/components/age-com/index.vue.js +0 -1
- package/es/components/table-filter/src/components/button-group/ButtonGroup.vue.d.ts +0 -199
- package/es/components/table-filter/src/components/button-group/ButtonGroup.vue.js +0 -1
- package/es/components/table-filter/src/components/button-icon/getBtnIcon.d.ts +0 -2
- package/es/components/table-filter/src/components/button-icon/getBtnIcon.js +0 -1
- package/es/components/table-filter/src/components/c-tree-select/tree-select.vue.d.ts +0 -90
- package/es/components/table-filter/src/components/c-tree-select/tree-select.vue.js +0 -1
- package/es/components/table-filter/src/components/multi-select/multi-select.vue.d.ts +0 -113
- package/es/components/table-filter/src/components/multi-select/multi-select.vue.js +0 -1
- package/es/components/table-filter/src/components/out-quick-search/out-quick-search.vue.d.ts +0 -266
- package/es/components/table-filter/src/components/out-quick-search/out-quick-search.vue.js +0 -1
- package/es/components/table-filter/src/components/range-age/index.vue.d.ts +0 -248
- package/es/components/table-filter/src/components/range-age/index.vue.js +0 -1
- package/es/components/table-filter/src/components/search-condition/SearchCondition.vue.d.ts +0 -789
- package/es/components/table-filter/src/components/search-condition/SearchCondition.vue.js +0 -1
- package/es/components/table-filter/src/components/search-condition/fieldTypeList.d.ts +0 -18
- package/es/components/table-filter/src/components/search-condition/fieldTypeList.js +0 -1
- package/es/components/table-filter/src/components/search-filter/SearchFilter.vue.d.ts +0 -1244
- package/es/components/table-filter/src/components/search-filter/SearchFilter.vue.js +0 -1
- package/es/components/table-filter/src/components/search-modal/set-classification.vue.d.ts +0 -1651
- package/es/components/table-filter/src/components/search-modal/set-classification.vue.js +0 -1
- package/es/components/table-filter/src/components/table-modal/TableModal.vue.js +0 -1
- package/es/components/table-filter/src/const/dataOptions.d.ts +0 -36
- package/es/components/table-filter/src/const/dataOptions.js +0 -1
- package/es/components/table-filter/src/directive/preventReClick.d.ts +0 -4
- package/es/components/table-filter/src/directive/preventReClick.js +0 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/tapable/index.d.ts +0 -139
- package/es/components/info-header/src/{HiddenContent.vue.d.ts → components/infoDescription/HiddenContent.vue.d.ts} +2 -2
- package/es/components/info-header/src/{InfoEllipsis.vue.d.ts → components/infoDescription/InfoEllipsis.vue.d.ts} +1 -1
- /package/es/components/{callback → info-header}/src/types/index.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,provide as t,computed as a,ref as o,watch as l,resolveComponent as s,openBlock as n,createElementBlock as i,unref as r,createBlock as u,resolveDynamicComponent as d,createVNode as f,mergeProps as c,createSlots as p,renderList as
|
|
1
|
+
import{defineComponent as e,provide as t,computed as a,ref as o,watch as l,resolveComponent as s,openBlock as n,createElementBlock as i,unref as r,createBlock as u,resolveDynamicComponent as d,createVNode as f,mergeProps as c,createSlots as p,renderList as v,withCtx as m,createCommentVNode as b,renderSlot as g}from"vue";import{uuidGenerator as x}from"../../../shared/utils/index.js";import{useDebounceFn as h}from"@vueuse/core";import{promiseTimeout as k}from"@vueuse/shared";import{isFunction as y}from"lodash-es";import{VxeTableEventNameList as C,InjectionIhoTableEmits as j,InjectionIhoTableAnnotation as D,InjectionIhoTableUUID as _,InjectionIhoTableInstance as $,InjectionIhoTableConfig as H,InjectionIhoTableFieldList as A,InjectionIhoTableHandler as L}from"./constants/index.js";import{createTableHooks as T,applyTableConfigHooks as w,applyTableFieldHooks as R,createTableEventHandlers as E,createDomInsertComponent as F,createDataTransfer as I}from"./hooks/tapHooks/index.js";import{provideIhoTableEventListener as O}from"./hooks/tapHooks/useEventHooks.js";import{eventName2EventListener as S}from"./utils/index.js";import q from"../../../_virtual/plugin-vue_export-helper.js";const z=["id"];var B=q(e({__name:"IhoTable",props:{tableConfig:{type:Object,default:()=>({})},fieldList:{type:Array,default:()=>[]},tableData:{type:Array,default:()=>[]},annotation:{type:Object}},emits:["formChange","settingClick","formClick","keyboard",...C],setup(e,{expose:C,emit:q}){var B,G;const J=e,K=O(),M=function(e,...t){q(e,...t);const a=r(U)[S(e)];y(a)&&a(...t),K.trigger(e,...t)};t(j,M);const N=T();t(D,a((()=>J.annotation)));const P=x();t(_,P);const Q=o();t($,Q);const U=o({uuid:null!=(G=null==(B=J.tableConfig)?void 0:B.uuid)?G:P});t(H,U);const V=h(W,10);function W(){U.value=w(N,J.tableConfig),U.value.uuid=P}const X=o([]);t(A,X);const Y=h(Z,10);function Z(){X.value=R(N,J.fieldList,U.value,{$table:Q,emits:M})}const ee=I(N,U,Q),te=o([]),ae=h(oe,10);async function oe(){var e;te.value=await ee(J.tableData),null==(e=Q.value)||e.recalculate(!0)}const le={updateTableDataRef:ae,updateConfigRef:V,updateFieldListRef:Y};t(L,le);const se=E({hooks:N,config:U,$table:Q,context:le,emits:M}),ne=a((()=>({...U.value,...se})));l((()=>J.tableConfig),(()=>{V(),Y(),ae()}),{deep:!0}),l((()=>J.fieldList),(()=>{Y(),ae()}),{deep:!0}),l([()=>J.tableData,()=>{var e;return null==(e=J.tableData)?void 0:e.length}],(async()=>{var e,t;(null==(e=U.value.treeConfig)?void 0:e.expandAll)&&(await k(11),null==(t=Q.value)||t.setAllTreeExpand(!0))})),l((()=>[...J.tableData]),ae),W(),Z(),oe();const{header:ie,footer:re}=F(N);return C({$table:Q,async loadData(e){var t;null==(t=Q.value)||t.loadData(await ee(e))},setSort:(e,t)=>({field:e,value:t}),setFilter:(e,t)=>({field:e,value:t}),...N.exposeHooks.expose.call({},U,{$table:Q,emits:M})}),N.setupHooks.setup.call(U,X),(e,t)=>{const a=s("vxe-grid");return n(),i("section",{class:"iho-table",id:r(P)},[(n(),u(d(r(ie)))),f(a,c({ref_key:"$table",ref:Q},r(ne),{columns:X.value,data:te.value}),p({_:2},[v(e.$slots,((t,a)=>({name:a,fn:m((()=>[b(" 实际上所有的vxe-grid插槽都支持 "),g(e.$slots,a)]))})))]),1040,["columns","data"]),(n(),u(d(r(re))))],8,z)}}}),[["__file","IhoTable.vue"]]);export{B as default};
|
|
@@ -38,7 +38,7 @@ export declare enum WIDGET_TYPE {
|
|
|
38
38
|
SEQUENCE = "SEQUENCE"
|
|
39
39
|
}
|
|
40
40
|
export declare const VxeEventListenerNameList: Readonly<(keyof VxeTableEventProps)[]>;
|
|
41
|
-
export declare const VxeTableEventNameList: ("toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "
|
|
41
|
+
export declare const VxeTableEventNameList: ("toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd")[];
|
|
42
42
|
export declare const IhoTableRowGroupSequence: readonly ["firstRowGroup", "secondRowGroup", "thirdRowGroup", "fourthRowGroup", "fifthRowGroup", "sixthRowGroup", "seventhRowGroup", "eighthRowGroup", "ninthRowGroup", "tenthRowGroup"];
|
|
43
43
|
export declare const HIGHEST_PRIORITY: number;
|
|
44
44
|
export declare const LOWEST_PRIORITY: number;
|
|
@@ -69,7 +69,7 @@ export declare enum IHO_TABLE_FIXED_STATUS {
|
|
|
69
69
|
right = 2
|
|
70
70
|
}
|
|
71
71
|
export declare const IhoTableCustomEventNameTuple: readonly ["formChange", "settingClick", "formClick", "keyboard"];
|
|
72
|
-
export declare const IhoTableEventNameTuple: readonly ["formChange", "settingClick", "formClick", "keyboard", ...("toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "
|
|
72
|
+
export declare const IhoTableEventNameTuple: readonly ["formChange", "settingClick", "formClick", "keyboard", ...("toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd")[]];
|
|
73
73
|
export declare const InjectionIhoTableConfig: InjectionKey<Ref<IhoTableConfig>>;
|
|
74
74
|
export declare const InjectionIhoTableFieldList: InjectionKey<Ref<IhoTableFieldItem[]>>;
|
|
75
75
|
export declare const InjectionIhoTableEmits: InjectionKey<IhoTableEmits>;
|
|
@@ -243,7 +243,7 @@ export declare function useEventHooks(): {
|
|
|
243
243
|
create: () => EventHooks;
|
|
244
244
|
};
|
|
245
245
|
export declare class IhoTableEventListener {
|
|
246
|
-
eventMap: Map<"toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "
|
|
246
|
+
eventMap: Map<"toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "formClick" | "keyboard" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd", Set<Func<any[], any>>>;
|
|
247
247
|
addEventListener<T extends IhoTableEventNameUnion>(key: T, handler: (...payload: IhoTableEmitPayload<T>) => void): void;
|
|
248
248
|
trigger<T extends IhoTableEventNameUnion>(key: T, ...payload: IhoTableEmitPayload<T>): void;
|
|
249
249
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mergeWith as e,isObject as o}from"lodash-es";import{HIGHEST_PRIORITY as i,IHO_TABLE_TREE_TYPE as t}from"../../constants/index.js";import{defineTablePlugin as s}from"../../hooks/useTablePlugin.js";import{IhoTableStatusHelper as n}from"../../utils/index.js";function r(){const r="defaultTablePlugin";return s({name:r,apply(s){s.configHooks.config.tap({name:r,stage:i},(o=>{const i=e({height:"100%",border:!0,showSeq:!0,columnConfig:{resizable:!0},rowConfig:{height:36,isHover:!0,isCurrent:!0,keyField:"theUniqueKey"},showOverflow:"tooltip",editConfig:{trigger:"click",mode:"cell"}},o);return(n.isPositive(o.isBatchSelect)||o.selectType)&&(i.selectType=o.selectType||"checkbox"),i})),s.configHooks.treeConfig.tap({name:r,stage:i},((e,o)=>o.isTree===t.TRANSFORM_TREE_TYPE?Object.assign({transform:!0,expandAll:!0,lazy:!0,reserve:!0},e):e)),s.configHooks.mouseConfig.tap({name:r,stage:i},((e,i)=>o(i.keyboardConfig)?Object.assign({selected:!!i.keyboardConfig.isEdit},e):e))}})}export{r as defaultConfigPlugin};
|
|
1
|
+
import{mergeWith as e,isObject as o}from"lodash-es";import{HIGHEST_PRIORITY as i,IHO_TABLE_TREE_TYPE as t}from"../../constants/index.js";import{defineTablePlugin as s}from"../../hooks/useTablePlugin.js";import{IhoTableStatusHelper as n}from"../../utils/index.js";function r(){const r="defaultTablePlugin";return s({name:r,apply(s){s.configHooks.config.tap({name:r,stage:i},(o=>{const i=e({height:"100%",border:!0,showSeq:!0,columnConfig:{resizable:!0},rowConfig:{height:36,isHover:!0,isCurrent:!0,keyField:"theUniqueKey"},showOverflow:"tooltip",editConfig:{trigger:"click",mode:"cell"}},o);return(n.isPositive(o.isBatchSelect)||o.selectType)&&(i.selectType=o.selectType||"checkbox"),i})),s.configHooks.treeConfig.tap({name:r,stage:i},((e,o)=>o.isTree===t.TRANSFORM_TREE_TYPE?Object.assign({transform:!0,expandAll:!0,lazy:!0,reserve:!0,children:"childrenList",parentField:"parentId",rowField:"__parentId",hasChild:"hasChild"},e):e)),s.configHooks.mouseConfig.tap({name:r,stage:i},((e,i)=>o(i.keyboardConfig)?Object.assign({selected:!!i.keyboardConfig.isEdit},e):e))}})}export{r as defaultConfigPlugin};
|
package/es/components/iho-table/src/plugins/{filterPlugin → filterRenderPlugin}/filter.vue.d.ts
RENAMED
|
@@ -1,62 +1,28 @@
|
|
|
1
|
-
import { AnyObject } from '../../../../../../es/shared/types';
|
|
2
1
|
import { CSSProperties, PropType, ref } from 'vue';
|
|
3
|
-
import { VxeColumnPropTypes, VxeTablePropTypes } from 'vxe-table';
|
|
2
|
+
import { VxeColumnPropTypes, VxeTableConstructor, VxeTableDefines, VxeTableMethods, VxeTablePrivateMethods, VxeTablePropTypes } from 'vxe-table';
|
|
4
3
|
declare const _default: import("vue").DefineComponent<{
|
|
5
4
|
payload: {
|
|
6
|
-
type: PropType<VxeColumnPropTypes.
|
|
5
|
+
type: PropType<VxeColumnPropTypes.FilterSlotParams>;
|
|
7
6
|
required: true;
|
|
8
7
|
};
|
|
9
|
-
sortable: {
|
|
10
|
-
type: BooleanConstructor;
|
|
11
|
-
};
|
|
12
|
-
options: {
|
|
13
|
-
type: PropType<AnyObject[]>;
|
|
14
|
-
default: () => never[];
|
|
15
|
-
};
|
|
16
|
-
checked: {
|
|
17
|
-
type: PropType<string[]>;
|
|
18
|
-
required: true;
|
|
19
|
-
};
|
|
20
|
-
sortStatus: {
|
|
21
|
-
type: PropType<VxeTablePropTypes.SortOrder>;
|
|
22
|
-
};
|
|
23
8
|
}, {
|
|
24
9
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
25
10
|
payload: {
|
|
26
|
-
type: PropType<VxeColumnPropTypes.
|
|
27
|
-
required: true;
|
|
28
|
-
};
|
|
29
|
-
sortable: {
|
|
30
|
-
type: BooleanConstructor;
|
|
31
|
-
};
|
|
32
|
-
options: {
|
|
33
|
-
type: PropType<AnyObject[]>;
|
|
34
|
-
default: () => never[];
|
|
35
|
-
};
|
|
36
|
-
checked: {
|
|
37
|
-
type: PropType<string[]>;
|
|
11
|
+
type: PropType<VxeColumnPropTypes.FilterSlotParams>;
|
|
38
12
|
required: true;
|
|
39
13
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}>>;
|
|
47
|
-
emits: (event: "update:checked" | "update:sortStatus", ...args: any[]) => void;
|
|
48
|
-
uuid: string;
|
|
49
|
-
configRef: import("vue").Ref<import("../../types").IhoTableConfig>;
|
|
50
|
-
checkedRef: import("vue").Ref<string[]> | import("vue").WritableComputedRef<string[]>;
|
|
51
|
-
sortStatusRef: import("vue").Ref<VxeTablePropTypes.SortOrder | undefined> | import("vue").WritableComputedRef<VxeTablePropTypes.SortOrder | undefined>;
|
|
14
|
+
}>> & {}>>;
|
|
15
|
+
sortable: import("vue").ComputedRef<any>;
|
|
16
|
+
optionsRef: import("vue").ComputedRef<VxeTableDefines.FilterOption[] & VxeColumnPropTypes.Filter[]>;
|
|
17
|
+
checkedRef: import("vue").WritableComputedRef<string[]>;
|
|
18
|
+
$table: (VxeTableConstructor & VxeTablePrivateMethods & VxeTableMethods) | undefined;
|
|
19
|
+
sortStatusRef: import("vue").WritableComputedRef<"desc" | "asc" | null>;
|
|
52
20
|
checkedCacheRef: import("vue").Ref<string[]>;
|
|
53
|
-
filterVisible: import("vue").Ref<boolean>;
|
|
54
21
|
searchFilterText: import("vue").Ref<string>;
|
|
55
|
-
toggleFilterVisible: () => void;
|
|
56
22
|
close: () => void;
|
|
57
23
|
OPTION_ITEM_HEIGHT: number;
|
|
58
24
|
VIEW_CAPACITY: number;
|
|
59
|
-
list: import("vue").Ref<import("@vueuse/core").UseVirtualListItem<
|
|
25
|
+
list: import("vue").Ref<import("@vueuse/core").UseVirtualListItem<VxeTableDefines.FilterOption>[]>;
|
|
60
26
|
containerProps: {
|
|
61
27
|
ref: import("vue").Ref<any>;
|
|
62
28
|
onScroll: () => void;
|
|
@@ -73,15 +39,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
73
39
|
checkAll: import("vue").WritableComputedRef<boolean>;
|
|
74
40
|
containerStyleWithHeight: import("vue").ComputedRef<CSSProperties>;
|
|
75
41
|
confirmFilter: () => void;
|
|
42
|
+
reset: () => void;
|
|
76
43
|
sortStatusList: {
|
|
77
44
|
status: VxeTablePropTypes.SortOrder;
|
|
78
45
|
text: string;
|
|
79
46
|
}[];
|
|
80
47
|
setSort: (value: VxeTablePropTypes.SortOrder) => void;
|
|
81
|
-
|
|
82
|
-
editable: import("vue").ComputedRef<boolean | undefined>;
|
|
83
|
-
wrapperStyle: import("vue").ComputedRef<CSSProperties>;
|
|
84
|
-
FunnelSharp: 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<{}>>, {}>;
|
|
48
|
+
CheckmarkOutline: 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<{}>>, {}>;
|
|
85
49
|
NButton: any;
|
|
86
50
|
NButtonGroup: any;
|
|
87
51
|
NCheckbox: any;
|
|
@@ -135,35 +99,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
135
99
|
readonly disabled: boolean | undefined;
|
|
136
100
|
readonly defaultValue: (string | number)[] | null;
|
|
137
101
|
}>;
|
|
138
|
-
NEllipsis: any;
|
|
139
|
-
NIcon: any;
|
|
140
102
|
NInput: any;
|
|
141
|
-
NPopover: any;
|
|
142
103
|
ref: typeof ref;
|
|
143
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
104
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
144
105
|
payload: {
|
|
145
|
-
type: PropType<VxeColumnPropTypes.
|
|
146
|
-
required: true;
|
|
147
|
-
};
|
|
148
|
-
sortable: {
|
|
149
|
-
type: BooleanConstructor;
|
|
150
|
-
};
|
|
151
|
-
options: {
|
|
152
|
-
type: PropType<AnyObject[]>;
|
|
153
|
-
default: () => never[];
|
|
154
|
-
};
|
|
155
|
-
checked: {
|
|
156
|
-
type: PropType<string[]>;
|
|
106
|
+
type: PropType<VxeColumnPropTypes.FilterSlotParams>;
|
|
157
107
|
required: true;
|
|
158
108
|
};
|
|
159
|
-
|
|
160
|
-
type: PropType<VxeTablePropTypes.SortOrder>;
|
|
161
|
-
};
|
|
162
|
-
}>> & {
|
|
163
|
-
"onUpdate:checked"?: ((...args: any[]) => any) | undefined;
|
|
164
|
-
"onUpdate:sortStatus"?: ((...args: any[]) => any) | undefined;
|
|
165
|
-
}, {
|
|
166
|
-
options: AnyObject[];
|
|
167
|
-
sortable: boolean;
|
|
168
|
-
}>;
|
|
109
|
+
}>>, {}>;
|
|
169
110
|
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,computed as l,inject as t,ref as a,onDeactivated as u,openBlock as o,createElementBlock as n,unref as i,Fragment as r,renderList as s,createElementVNode as v,normalizeClass as c,createBlock as d,createCommentVNode as p,createTextVNode as f,toDisplayString as m,createVNode as h,isRef as _,withCtx as y,normalizeStyle as g}from"vue";import{widthAppend as b}from"../../../../../shared/utils/index.js";import{CheckmarkOutline as k}from"@vicons/ionicons5";import{useVirtualList as C}from"@vueuse/core";import{NInput as x,NCheckbox as S,NCheckboxGroup as $,NButtonGroup as E,NButton as j}from"naive-ui";import w from"../../../../../_virtual/plugin-vue_export-helper.js";const A={class:"iho-table__filterWrapper"},I={key:0},L=["onClick"],U={class:"iho-table__filterListItem"},B={class:"iho-table__filterFooter"};var F=w(e({__name:"filter",props:{payload:{type:Object,required:!0}},setup(e){const w=e,F=l((()=>{var e,l,t;return null==(t=null==(l=null==(e=w.payload)?void 0:e.column.editRender)?void 0:l.props)?void 0:t.sortable})),O=l((()=>{var e,l,t;return null!=(t=null==(l=null==(e=w.payload)?void 0:e.column)?void 0:l.filters)?t:[]})),P=l({get:()=>O.value.reduce(((e,l)=>(l.checked&&e.push(l.value),e)),[]),set(e){if(w.payload)return O.value.forEach((l=>{w.payload.$panel.changeOption(null,e.includes(l.value),l)})),w.payload.$panel.confirmFilter(new CustomEvent("click"))}}),W=t("$xetable"),Z=l({get(){if(!W)return null;const e=W.getSortColumns().find((e=>{var l;return e.column===(null==(l=w.payload)?void 0:l.column)}));return e?e.order:null},set(e){W&&w.payload&&w.payload.$panel&&W.triggerSortEvent(new CustomEvent("click"),w.payload.column,e)}}),q=a([...P.value]),z=a("");function D(){W&&(W.reactData.filterStore.visible=!1)}u(D);const{list:H,containerProps:R,wrapperProps:G}=C(l((()=>z.value?O.value.filter((e=>`${e.label}`.includes(z.value))):O.value)),{itemHeight:32,overscan:3}),J=l((()=>!!q.value.length&&q.value.length!==O.value.length)),K=l({get:()=>q.value.length===O.value.length&&0!==O.value.length,set:e=>{q.value=e?O.value.map((e=>e.value)):[]}}),M=l((()=>({...R.style,height:b(320)})));function N(){P.value=q.value,D()}function Q(){q.value=[]}const T=[{status:"asc",text:"升序 A to Z"},{status:"desc",text:"降序 Z to A"}];return(e,l)=>(o(),n("section",A,[i(F)?(o(),n("div",I,[(o(),n(r,null,s(T,(e=>v("div",{key:e.status,class:c(["iho-table__filterButton",{"iho-table__filterButton--active":i(Z)===e.status}]),onClick:l=>{return t=e.status,Z.value=t,void D();var t}},[i(Z)===e.status?(o(),d(i(k),{key:0,class:"iho-table__sortActiveIcon"})):p("v-if",!0),f(" "+m(e.text),1)],10,L))),64))])):p("v-if",!0),i(O).length>5?(o(),d(i(x),{key:1,value:z.value,"onUpdate:value":l[0]||(l[0]=e=>z.value=e)},null,8,["value"])):p("v-if",!0),v("div",U,[h(i(S),{label:"全选",checked:i(K),"onUpdate:checked":l[1]||(l[1]=e=>_(K)?K.value=e:null),indeterminate:i(J)},null,8,["checked","indeterminate"])]),h(i($),{value:q.value,"onUpdate:value":l[3]||(l[3]=e=>q.value=e)},{default:y((()=>[v("section",{ref:i(R).ref,style:g(i(M)),onScroll:l[2]||(l[2]=(...e)=>i(R).onScroll&&i(R).onScroll(...e)),class:"iho-table__filterListWrapper"},[v("section",{style:g(i(G).style)},[(o(!0),n(r,null,s(i(H),(e=>(o(),n("div",{class:"iho-table__filterListItem",key:e.data.value},[h(i(S),{value:e.data.value,label:e.data.label},null,8,["value","label"])])))),128))],4)],36)])),_:1},8,["value"]),v("footer",B,[v("section",null,m(`已选择${q.value.length}项`),1),h(i(E),{size:"small"},{default:y((()=>[h(i(j),{onClick:Q},{default:y((()=>[f("清空")])),_:1}),h(i(j),{onClick:D},{default:y((()=>[f("取消")])),_:1}),h(i(j),{type:"primary",onClick:N},{default:y((()=>[f("确定")])),_:1})])),_:1})])]))}}),[["__file","filter.vue"]]);export{F as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function filterRenderPlugin(): import("../../../../../../es/components/iho-table").TablePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createVNode as e,nextTick as r}from"vue";import{jsonParse as t,traverse as l,arrayed as i}from"../../../../../shared/utils/index.js";import{isObject as n,first as o,isArray as s}from"lodash-es";import"../../../index.js";import{IHO_TABLE_NUMBER_STATUS as u}from"../../constants/index.js";import{IhoTableRenderHelper as a,IhoTableUtils as d}from"../../utils/index.js";import f from"./filter.vue.js";import{defineTablePlugin as p}from"../../hooks/useTablePlugin.js";function c(){const c="filterRenderPlugin";return p({name:c,vxe(r){r.renderer.mixin({filterRenderPlugin:{showFilterFooter:!1,renderFilter:(r,t)=>e(f,{payload:t},null)}})},apply(e){let f=[];e.fieldHooks.field.tap(c,(e=>{var r,l,i,f,p,c;const v=null==(r=e.editRender)?void 0:r.props;if(!n(v))return e;const m=t(v.fieldSetting||"");if(!a.hasFilter(m))return e;e.editRender={...e.editRender,props:{...null==(l=e.editRender)?void 0:l.props,sortable:e.sortable}},e.filterRender={name:"filterRenderPlugin"};let h=null!=(p=null==(f=null==(i=m.mapping)?void 0:i.mappingFiled)?void 0:f.reduce(((e,r)=>{const t=o(r.value);return n(t)&&e.push({label:t.key,value:t.value,data:t.value}),e}),[]))?p:[];return function(e){const r=["SEARCH","SELECT","RADIO","CHECKBOX"];return(e.notParticipatingSearch||"")!==u.POSITIVE&&r.includes(d.getCellType(e))&&s(e.options)&&e.options.length}(v)&&(h=null!=(c=v.options)?c:[]),e.filters=h,e.sortable?e.headerClassName=({$table:e,column:r})=>{const t=["iho-table__hideSortIcon"];return e.isSort(r)&&t.push("is--filter-active"),t}:e.headerClassName="iho-table__hideSortIcon",e})),e.fieldHooks.fieldList.tap(c,(e=>f=e)),e.fieldHooks.fieldEnd.tapPromise(c,(async(e,{$table:t})=>{var i;try{if(await r(),!t.value)return;const o=null!=(i=t.value.getColumns())?i:[],s=[];if(l(f,(e=>{o.find((r=>r.field===e.field))||s.push(e)})),!s.length)return;setTimeout((()=>{var r,l;if(null==(r=e.sortConfig)?void 0:r.multiple){const e=null!=(l=t.value.getColumns())?l:[],r=s.concat(e).reduce(((e,r)=>{var t;const l=null==(t=r.editRender)?void 0:t.props;return n(l)&&v(l.isOrder)&&e.push({field:r.field,order:l.isOrder}),e}),[]);t.value.sort(r)}else s.reverse().some((e=>{var r;const l=null==(r=e.editRender)?void 0:r.props;if(n(l)&&v(l.isOrder))return e&&t.value.sort(e.field,l.isOrder),!0}))}),100)}finally{f=[]}})),e.exposeHooks.expose.tap(c,((e,r,{$table:t})=>(Object.assign(e,{setSort(e,r){t.value&&t.value.sort(e,r)},setFilter(e,r){if(!t.value)return;const l=t.value.getColumnByField(e);if(!l||!s(l.filters))return;const n=i(r);l.filters.forEach((e=>{e.checked=n.includes(e.value)})),t.value.updateData()}}),e)))}})}function v(e){return["asc","desc",null].includes(e)}export{c as filterRenderPlugin};
|
|
@@ -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"./filterRenderPlugin/index.js";import*as n from"./keyboardEventPlugin/index.js";import*as d from"./lowCodeFieldAdaptorPlugin/index.js";import*as s from"./rendererPlugins/editableWidgets/dateRendererPlugin/index.js";import*as t from"./rendererPlugins/editableWidgets/inputRendererPlugin.js";import*as l from"./rendererPlugins/editableWidgets/numberRendererPlugin.js";import*as g from"./rendererPlugins/editableWidgets/selectRendererPlugin/index.js";import*as u from"./rendererPlugins/editableWidgets/separateRendererPlugin/index.js";import*as o from"./rendererPlugins/editableWidgets/timeRendererPlugin/index.js";import*as P from"./rendererPlugins/widgets/checkRendererPlugin.js";import*as a from"./rendererPlugins/widgets/colorRendererPlugin.js";import*as m from"./rendererPlugins/widgets/defaultRendererPlugin.js";import*as x from"./rendererPlugins/widgets/labelRendererPlugin.js";import*as p from"./rendererPlugins/widgets/pictureRendererPlugin.js";import*as f from"./rendererPlugins/widgets/seqRendererPlugin.js";import*as R from"./rowClickPlugin/index.js";import*as j from"./rowGroupSettingPlugin/index.js";import*as b from"./virtualTreePlugin/index.js";import{separateMetaModule as w}from"../../../../shared/utils/index.js";var c=w(Object.assign({"./anchorPlugin/index.tsx":e,"./defaultConfigPlugin/index.ts":r,"./filterRenderPlugin/index.tsx":i,"./keyboardEventPlugin/index.ts":n,"./lowCodeFieldAdaptorPlugin/index.tsx":d,"./rendererPlugins/editableWidgets/dateRendererPlugin/index.tsx":s,"./rendererPlugins/editableWidgets/inputRendererPlugin.tsx":t,"./rendererPlugins/editableWidgets/numberRendererPlugin.tsx":l,"./rendererPlugins/editableWidgets/selectRendererPlugin/index.tsx":g,"./rendererPlugins/editableWidgets/separateRendererPlugin/index.tsx":u,"./rendererPlugins/editableWidgets/timeRendererPlugin/index.tsx":o,"./rendererPlugins/widgets/checkRendererPlugin.tsx":P,"./rendererPlugins/widgets/colorRendererPlugin.tsx":a,"./rendererPlugins/widgets/defaultRendererPlugin.tsx":m,"./rendererPlugins/widgets/labelRendererPlugin.tsx":x,"./rendererPlugins/widgets/pictureRendererPlugin.tsx":p,"./rendererPlugins/widgets/seqRendererPlugin.tsx":f,"./rowClickPlugin/index.ts":R,"./rowGroupSettingPlugin/index.ts":j,"./virtualTreePlugin/index.ts":b}));export{c as default};
|
|
@@ -45,8 +45,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
45
45
|
emit: (event: "update:value", ...args: any[]) => void;
|
|
46
46
|
formRef: import("vue").Ref<HTMLElement | null>;
|
|
47
47
|
isShow: import("vue").Ref<boolean>;
|
|
48
|
-
formattedValue:
|
|
49
|
-
onConfirm: (value:
|
|
48
|
+
formattedValue: any;
|
|
49
|
+
onConfirm: (value: any) => void;
|
|
50
50
|
isStartDate: any;
|
|
51
51
|
isEndDate: any;
|
|
52
52
|
connectField: string;
|
|
@@ -58,8 +58,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
58
58
|
isSecondDisabled: (second: number) => boolean;
|
|
59
59
|
};
|
|
60
60
|
customDateDisabledDecorator: (customDateDisabled?: Func) => ((ts: number) => any) | null;
|
|
61
|
-
getFormatDate: (str: string) => string;
|
|
62
|
-
onBlur: () => void;
|
|
63
61
|
formatConfig: import("vue").ComputedRef<{
|
|
64
62
|
valueFormat: string;
|
|
65
63
|
format: string;
|
|
@@ -68,9 +66,24 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
68
66
|
};
|
|
69
67
|
}>;
|
|
70
68
|
dateConfig: AnyObject;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
DatePicker: import("../../../../../../../../es/shared/types").SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
70
|
+
attrs: {
|
|
71
|
+
[x: string]: unknown;
|
|
72
|
+
};
|
|
73
|
+
emits: (event: "update:formattedValue", ...args: any[]) => void;
|
|
74
|
+
datePickerRef: import("vue").Ref<null>;
|
|
75
|
+
__formattedValue: import("vue").Ref<any>;
|
|
76
|
+
keyupValue: import("vue").Ref<string>;
|
|
77
|
+
inputIndex: number;
|
|
78
|
+
placeholder: string;
|
|
79
|
+
formatRef: import("vue").ComputedRef<unknown>;
|
|
80
|
+
updateFormattedValue: (value: any) => void;
|
|
81
|
+
onBlur: () => void;
|
|
82
|
+
onKeyUp: (event: AnyObject) => any;
|
|
83
|
+
NDatePicker: any;
|
|
84
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:formattedValue"[], "update:formattedValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
|
|
85
|
+
"onUpdate:formattedValue"?: ((...args: any[]) => any) | undefined;
|
|
86
|
+
}, {}>>;
|
|
74
87
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
75
88
|
value: {
|
|
76
89
|
type: StringConstructor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as t,ref as r,computed as
|
|
1
|
+
import{defineComponent as e,useAttrs as t,ref as r,computed as o,watch as i,openBlock as a,createBlock as s,unref as u,mergeProps as l,isRef as n}from"vue";import{generateTimeFormat as m}from"../../../../../../../shared/utils/index.js";import{isFunction as d}from"lodash-es";import{useIhoTableFormEvent as p}from"../../../../utils/index.js";import{useAutoFocus as c}from"../hooks/useAutoFocus.js";import f from"../../../../../../date-picker/index.js";import w from"../../../../../../../_virtual/plugin-vue_export-helper.js";var v=w(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:w}){const v=e,D=t(),{emitFormChangeWithParams:g}=p(v),{formRef:h,isShow:y}=c(),b=r(v.value),j=e=>{b.value=e;const t=v.value;w("update:value",e),g({oldValue:t})},{isStartDate:S=!1,isEndDate:T=!1}=D,$=D.connectField||"",_=(e,t)=>S&&$?e>t:!(!T||!$)&&e<t,x=e=>{const t=new Date(v.row[$]),r=new Date(e),o=t.getHours(),i=t.getMinutes(),a=t.getSeconds(),s=(e,t,r,o)=>!(T&&r>o)&&(!(S&&r<o)&&_(e,t));return{isHourDisabled:t=>{if(!v.row[$])return!1;const i=new Date(`${v.row[$].split(" ")[0]} 00:00:00`).getTime(),a=r.getMinutes(),u=r.getSeconds();return s(t,o,e-60*t*60*1e3-60*a*1e3-1e3*u,i)},isMinuteDisabled:t=>{if(!v.row[$])return!1;const a=new Date(`${v.row[$].split(" ")[0]} ${o}:00:00`).getTime(),u=r.getSeconds();return s(t,i,e-60*t*1e3-1e3*u,a)},isSecondDisabled:t=>{if(!v.row[$])return!1;const r=new Date(`${v.row[$].split(" ")[0]} ${o}:${i}:00`).getTime();return s(t,a,e-1e3*t,r)}}};function F(e){return d(e)?t=>e(t,v.row):null}const M=o((()=>{const e=D.valueFormat||"yyyy-MM-dd HH:mm:ss";return{valueFormat:e,format:e,timePickerProps:{format:m(e)}}})),k={type:D.type||"datetime",clearable:!0,placeholder:D.placeholder||"请选择",...D,...M.value,isDateDisabled:F(D.isDateDisabled)||(e=>!!v.row[$]&&_(e,T?new Date(`${v.row[$].split(" ")[0]} 00:00:00`).getTime():new Date(v.row[$]).getTime()))};return k.type.includes("time")&&(k.isTimeDisabled=F(D.isTimeDisabled)||x),i((()=>v.value),(e=>{b.value=e})),(e,t)=>(a(),s(u(f),l({ref_key:"formRef",ref:h,show:u(y),"onUpdate:show":t[0]||(t[0]=e=>n(y)?y.value=e:null),"formatted-value":b.value},u(k),{"onUpdate:formattedValue":j}),null,16,["show","formatted-value"]))}}),[["__file","editDate.vue"]]);export{v as default};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { VxeTableDefines } from 'vxe-table';
|
|
3
|
+
import { AnyObject } from '../../../../../../../../es/shared/types';
|
|
4
|
+
declare const _default: import("vue").DefineComponent<{
|
|
5
|
+
formattedValue: {
|
|
6
|
+
type: StringConstructor;
|
|
7
|
+
default: undefined;
|
|
8
|
+
};
|
|
9
|
+
column: {
|
|
10
|
+
type: PropType<VxeTableDefines.ColumnInfo>;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
row: {
|
|
14
|
+
type: PropType<AnyObject>;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
rowIndex: {
|
|
18
|
+
type: NumberConstructor;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
}, {
|
|
22
|
+
attr: AnyObject;
|
|
23
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
24
|
+
formattedValue: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
default: undefined;
|
|
27
|
+
};
|
|
28
|
+
column: {
|
|
29
|
+
type: PropType<VxeTableDefines.ColumnInfo>;
|
|
30
|
+
required: true;
|
|
31
|
+
};
|
|
32
|
+
row: {
|
|
33
|
+
type: PropType<AnyObject>;
|
|
34
|
+
required: true;
|
|
35
|
+
};
|
|
36
|
+
rowIndex: {
|
|
37
|
+
type: NumberConstructor;
|
|
38
|
+
required: true;
|
|
39
|
+
};
|
|
40
|
+
}>> & {
|
|
41
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
42
|
+
"onUpdate:formattedValue"?: ((...args: any[]) => any) | undefined;
|
|
43
|
+
}>>;
|
|
44
|
+
emitFormChangeWithParams: (params?: AnyObject) => void;
|
|
45
|
+
emit: (event: "click" | "update:formattedValue", ...args: any[]) => void;
|
|
46
|
+
formRef: import("vue").Ref<HTMLElement | null>;
|
|
47
|
+
isShow: import("vue").Ref<boolean>;
|
|
48
|
+
__formattedValue: import("vue").Ref<string | undefined>;
|
|
49
|
+
oldValue: string | undefined;
|
|
50
|
+
placeholder: any;
|
|
51
|
+
valueFormat: any;
|
|
52
|
+
shortcutOptions: any;
|
|
53
|
+
timeConfig: AnyObject;
|
|
54
|
+
clickShortcutOption: (item: string) => void;
|
|
55
|
+
onUpdateFormattedValue: (value: string) => void;
|
|
56
|
+
onBlur: () => void;
|
|
57
|
+
onKeyUp: (event: AnyObject) => void;
|
|
58
|
+
NInput: any;
|
|
59
|
+
NPopover: any;
|
|
60
|
+
NSpace: any;
|
|
61
|
+
NButton: any;
|
|
62
|
+
NScrollbar: any;
|
|
63
|
+
TimePicker: import("../../../../../../../../es/shared/types").SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
64
|
+
attrs: {
|
|
65
|
+
[x: string]: unknown;
|
|
66
|
+
};
|
|
67
|
+
emits: (event: "update:formattedValue", ...args: any[]) => void;
|
|
68
|
+
timePickerRef: import("vue").Ref<null>;
|
|
69
|
+
__formattedValue: import("vue").Ref<any>;
|
|
70
|
+
keyupValue: import("vue").Ref<string>;
|
|
71
|
+
formatRef: import("vue").ComputedRef<string>;
|
|
72
|
+
updateFormattedValue: (value: any) => void;
|
|
73
|
+
onBlur: () => void;
|
|
74
|
+
onKeyUp: (event: AnyObject) => any;
|
|
75
|
+
NTimePicker: any;
|
|
76
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:formattedValue"[], "update:formattedValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
|
|
77
|
+
"onUpdate:formattedValue"?: ((...args: any[]) => any) | undefined;
|
|
78
|
+
}, {}>>;
|
|
79
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "update:formattedValue")[], "click" | "update:formattedValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
80
|
+
formattedValue: {
|
|
81
|
+
type: StringConstructor;
|
|
82
|
+
default: undefined;
|
|
83
|
+
};
|
|
84
|
+
column: {
|
|
85
|
+
type: PropType<VxeTableDefines.ColumnInfo>;
|
|
86
|
+
required: true;
|
|
87
|
+
};
|
|
88
|
+
row: {
|
|
89
|
+
type: PropType<AnyObject>;
|
|
90
|
+
required: true;
|
|
91
|
+
};
|
|
92
|
+
rowIndex: {
|
|
93
|
+
type: NumberConstructor;
|
|
94
|
+
required: true;
|
|
95
|
+
};
|
|
96
|
+
}>> & {
|
|
97
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
98
|
+
"onUpdate:formattedValue"?: ((...args: any[]) => any) | undefined;
|
|
99
|
+
}, {
|
|
100
|
+
formattedValue: string;
|
|
101
|
+
}>;
|
|
102
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,useAttrs as t,ref as a,openBlock as o,createBlock as l,unref as r,mergeProps as u,withCtx as i,createVNode as m,isRef as n,createElementBlock as d,Fragment as f,renderList as s,createTextVNode as c,toDisplayString as p,createCommentVNode as v}from"vue";import{NPopover as _,NInput as h,NSpace as y,NScrollbar as k,NButton as V}from"naive-ui";import{useIhoTableFormEvent as w}from"../../../../utils/index.js";import{useAutoFocus as b}from"../hooks/useAutoFocus.js";import g from"../../../../../../time-picker/index.js";import{parse as C,isValid as j,format as F}from"date-fns";import x from"../../../../../../../_virtual/plugin-vue_export-helper.js";var H=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 H=e,q=t(),{emitFormChangeWithParams:O}=w(H),{formRef:A,isShow:M}=b(),R=a(H.formattedValue);let S=H.formattedValue;const{placeholder:T="请选择",valueFormat:U="HH:mm",shortcutOptions:z=[]}=q,B={placeholder:T,valueFormat:U,format:U||"yyyy-MM-dd HH:mm:ss"};function D(e){R.value=e,S!==e&&(x("update:formattedValue",e),O({oldValue:S}),S=e)}function I(){const e=C(H.formattedValue||"",B.valueFormat.replace(/:/,""),new Date);if(j(e)){D(F(e,B.valueFormat))}}function K(e){var t;const{keyCode:a=0}=e;13==a&&(null==(t=A.value)||t.blur(),M.value=!1)}return(t,a)=>(o(),l(r(_),u({show:r(M),trigger:"click",showArrow:!1,placement:"bottom-start",style:{padding:"0"}},t.$attrs,{onClickoutside:a[3]||(a[3]=()=>M.value=!1)}),{trigger:i((()=>[m(r(h),{ref_key:"formRef",ref:A,clearable:"",value:e.formattedValue,"onUpdate:value":a[0]||(a[0]=e=>n(formattedValue)?formattedValue.value=e:null),onClick:a[1]||(a[1]=()=>M.value=!0),onBlur:I,onKeyup:K},null,8,["value"])])),default:i((()=>[m(r(y),null,{default:i((()=>[m(r(g),u({show:"","formatted-value":R.value},r(B),{class:"iho-table__time-picker",to:!1,"onUpdate:formattedValue":D,onConfirm:a[2]||(a[2]=()=>M.value=!1)}),null,16,["formatted-value"]),m(r(k),{class:"iho-table__scrollbar"},{default:i((()=>[r(z).length?(o(),l(r(y),{key:0,vertical:"",wrap:!1},{default:i((()=>[(o(!0),d(f,null,s(r(z),(e=>(o(),l(r(V),{size:"tiny",key:e,onClick:t=>function(e){D(e),M.value=!1}(e)},{default:i((()=>[c(p(e),1)])),_:2},1032,["onClick"])))),128))])),_:1})):v("v-if",!0)])),_:1})])),_:1})])),_:1},16,["show"]))}}),[["__file","editTime.vue"]]);export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function timeRendererPlugin(): import("
|
|
1
|
+
export declare function timeRendererPlugin(): import("../../../../../../../../es/components/iho-table").TablePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createVNode as e,mergeProps as r}from"vue";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as o}from"../../../../constants/index.js";import{createIhoTableClearActivedInterceptor as t,IhoTableRenderHelper as n}from"../../../../utils/index.js";import i from"./editTime.vue.js";import{defineTablePlugin as d}from"../../../../hooks/useTablePlugin.js";function l(){return d({name:"timeRendererPlugin",vxe(d){d.interceptor.add("event.clearActived",t(o.TIME,(e=>e.classList.contains("n-popover")))),d.renderer.add(o.TIME,{renderCell:n.createDefaultRenderCell(),renderEdit:n.createRenderEdit((({fieldItem:o,emitFormClick:t,row:n,column:d,$rowIndex:l})=>[e(i,r({formattedValue:n[d.field],"onUpdate:formattedValue":e=>n[d.field]=e,column:d,row:n,"row-index":l},o.componentProps,{onClick:t}),null)]))})}})}export{l as timeRendererPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createVNode as e}from"vue";import"../../../../index.js";import{WIDGET_TYPE as r}from"../../../constants/index.js";import{getRowHeight as n}from"../../../utils/index.js";import{defineTablePlugin as o}from"../../../hooks/useTablePlugin.js";function l(){const l={blue:"blue",sky:"skyblue",azure:"azure",palegreen:"palegreen",yellow:"yellow",darkorange:"darkorange",magenta:"magenta",purple:"purple",maroon:"maroon",orange:"orange",green:"green",red:"red",grey:"grey"};return o({name:"
|
|
1
|
+
import{createVNode as e}from"vue";import"../../../../index.js";import{WIDGET_TYPE as r}from"../../../constants/index.js";import{getRowHeight as n}from"../../../utils/index.js";import{defineTablePlugin as o}from"../../../hooks/useTablePlugin.js";function l(){const l={blue:"blue",sky:"skyblue",azure:"azure",palegreen:"palegreen",yellow:"yellow",darkorange:"darkorange",magenta:"magenta",purple:"purple",maroon:"maroon",orange:"orange",green:"green",red:"red",grey:"grey"};return o({name:"colorRendererPlugin",vxe(o){o.renderer.add(r.COLOR,{renderCell(r,{row:o,column:a}){const t=o[a.field];if(!t)return[];const[u,i]=t.split("-");return[e("div",{style:{background:l[i]||u,height:n()-8+"px"}},null)]}})}})}export{l as colorRendererPlugin};
|
package/es/components/iho-table/src/plugins/rendererPlugins/widgets/defaultRendererPlugin.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createVNode as
|
|
1
|
+
import{createVNode as n}from"vue";import{isMatchLowCodeCondition as r}from"../../../../../../shared/utils/index.js";import{isString as o,isObject as e,isArray as t}from"lodash-es";import"../../../../index.js";import{WIDGET_TYPE as i}from"../../../constants/index.js";import{IhoTableWarn as c}from"../../../utils/index.js";import{defineTablePlugin as l}from"../../../hooks/useTablePlugin.js";function d(){return l({name:"defaultRendererPlugin",vxe(l){l.renderer.add(i.DEFAULT,{renderCell(i,{row:l,column:d}){const u=l[d.field],s=function(n){return o(n)&&!!n.match(/^###\{[^{}]+}$/)}(u)?function(r){const o=t(r);return[n("div",{style:{color:o.background||o.icon}},[e(o.icon),o.change_text])];function e(r){return r?r.match(/#[\da-f]{6}|[\da-f]{3}/i)?n("i",{class:"icon-dot",style:{"--table-icon-color":r,"--table-icon-shadow":r}},null):n("i",{class:o.icon},null):null}function t(n){try{return JSON.parse(n.replace(/^###/,""))}catch(r){return c(`invalid json-content ${n}`),{}}}}(u):[u];return function(o,e,i,c){if(!t(o)||!o.length)return c;const l=o.find((n=>n.condition&&n.condition.find((n=>{const o=e[n.field_key||i.field];return r(o,n)}))));return l?n("div",{style:{color:l.color},class:l.icon},[c]):c}(function(n){var r,o,t;const i=null==(r=n.editRender)?void 0:r.props;if(!e(i))return;return null!=(t=i.colorAndIcon)?t:null==(o=i.settingObj)?void 0:o.colorAndIcon}(d),l,d,s)}}),l.renderer.add(i.STATUS,l.renderer.get(i.DEFAULT))}})}export{d as defaultRendererPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createVNode as e}from"vue";import{isArray as
|
|
1
|
+
import{createVNode as e}from"vue";import{jsonParse as r}from"../../../../../../shared/utils/index.js";import{isArray as l,isString as o}from"lodash-es";import"../../../../index.js";import{WIDGET_TYPE as t}from"../../../constants/index.js";import{defineTablePlugin as n}from"../../../hooks/useTablePlugin.js";function i(){return n({name:"labelRendererPlugin",vxe(n){n.renderer.add(t.LABEL,{renderCell(t,{row:n,column:i}){try{if(!n[i.field])return[];const t=r(n[i.field]),s=l(t.labels)?t.labels:(a=t.labelStr,o(a)?a.split(",").map((e=>({labelName:e}))):[]);return e("section",{style:{display:"flex"}},[s.map((function(r){return e("div",{style:{backgroundColor:r.color||"#5585f5",color:"white",flex:"1"}},[r.labelName])}))])}catch(e){return[]}var a}})}})}export{i as labelRendererPlugin};
|
package/es/components/iho-table/src/plugins/rendererPlugins/widgets/pictureRendererPlugin.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,watch as r,onBeforeUnmount as t,createVNode as n}from"vue";import{arrayed as
|
|
1
|
+
import{defineComponent as e,watch as r,onBeforeUnmount as t,createVNode as n}from"vue";import{jsonParse as i,arrayed as o}from"../../../../../../shared/utils/index.js";import"../../../../index.js";import{WIDGET_TYPE as s}from"../../../constants/index.js";import{getRowHeight as l,IhoTableWarn as u}from"../../../utils/index.js";import d from"viewerjs";import"viewerjs/dist/viewer.css";import{defineTablePlugin as m}from"../../../hooks/useTablePlugin.js";function a(){return m({name:"pictureRendererPlugin",vxe(e){function r(e){return{renderCell(r,{row:t,column:s}){try{if(!t[s.field])return[];const r=i(t[s.field]),u=l()-16;return[n("section",{style:"display:flex;justify-content:center"},[n(p,{style:{width:u+"px",height:u+"px",...e},images:o(r).map((e=>e.url))},null)])]}catch(e){return u(`invalid ${r.name} value of field(${s.field}): ${t[s.field]}`),[]}}}}e.renderer.add(s.PICTURE,r({})),e.renderer.add(s.HEADPORTRAIT,r({"border-radius":"50%"}))}})}const p=e({name:"ViewerImage",props:{images:{type:Array,default:()=>[]},options:{type:Object,default:()=>({})}},setup(e){let i=null;function o(){if(i)return i.show();const r=document.createElement("section");e.images.map((e=>r.appendChild(function(e){const r=new Image;return r.src=e,r}(e)))),i=new d(r,e.options).show()}return r([()=>e.images,()=>e.options],(()=>{null==i||i.destroy(),i=null}),{deep:!0}),t((()=>null==i?void 0:i.destroy())),()=>n("img",{style:"cursor:pointer",alt:"",src:e.images[0],onClick:o},null)}});export{a as pictureRendererPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{traverse as e,uuidGenerator as t,DMZ as r}from"../../../../../shared/utils/index.js";import{isArray as n,isFunction as o}from"lodash-es";import{onBeforeUnmount as i}from"vue";import"../../../index.js";import{defineTablePlugin as s}from"../../hooks/useTablePlugin.js";function a(){const a="virtualTreePlugin",d=new Map;return s({name:a,apply(s){s.dataHooks.data.tap(a,((r,o,i)=>{if(!o.treeConfig)return;const{transform:s,rowField:a="__parentId",parentField:d="parentId",children:l="childrenList"}=o.treeConfig;function u(e){e[a]=e[a]||e.theUniqueKey||t()}s&&(u(r),n(r[l])&&e(r[l],((e,t,r)=>{r&&(e[d]=r[a]),i.insertAfter(e),u(e)}),l,r))})),s.fieldHooks.fieldList.tap(a,((e,t)=>{const{transform:n}=t.treeConfig||r;if(n&&t.uuid){const r=e.filter((e=>!1!==e.visible));let n=r.findIndex((e=>e.treeNode));~n||r.some(((e,t)=>{if(!e.type)return n=t,e.treeNode=!0}));const o=r.length-n-r.filter((e=>"right"===e.fixed)).length;d.set(t.uuid,{index:n,colspan:o})}return e})),s.configHooks.treeConfig.tap(a,((e,t)=>{if(!e)return e;const{transform:r,parentField:n="parentId",rowField:i="__parentId"}=e;if(!r)return e;if(Object.assign(e,{parentField:n,rowField:i}),r&&!o(t.spanMethod)){const e=Object.freeze({rowspan:0,colspan:0}),r=Object.freeze({rowspan:1,colspan:1});t.spanMethod=({row:o,column:i,$columnIndex:
|
|
1
|
+
import{traverse as e,uuidGenerator as t,DMZ as r}from"../../../../../shared/utils/index.js";import{isArray as n,isFunction as o}from"lodash-es";import{onBeforeUnmount as i}from"vue";import"../../../index.js";import{defineTablePlugin as s}from"../../hooks/useTablePlugin.js";function a(){const a="virtualTreePlugin",d=new Map;return s({name:a,apply(s){s.dataHooks.data.tap(a,((r,o,i)=>{if(!o.treeConfig)return;const{transform:s,rowField:a="__parentId",parentField:d="parentId",children:l="childrenList"}=o.treeConfig;function u(e){e[a]=e[a]||e.theUniqueKey||t()}s&&(u(r),n(r[l])&&e(r[l],((e,t,r)=>{r&&(e[d]=r[a]),i.insertAfter(e),u(e)}),l,r))})),s.fieldHooks.fieldList.tap(a,((e,t)=>{const{transform:n}=t.treeConfig||r;if(n&&t.uuid){const r=e.filter((e=>!1!==e.visible));let n=r.findIndex((e=>e.treeNode));~n||r.some(((e,t)=>{if(!e.type)return n=t,e.treeNode=!0}));const o=r.length-n-r.filter((e=>"right"===e.fixed)).length;d.set(t.uuid,{index:n,colspan:o})}return e})),s.configHooks.treeConfig.tap(a,((e,t)=>{if(!e)return e;const{transform:r,parentField:n="parentId",rowField:i="__parentId",hasChild:s="hasChild"}=e;if(!r)return e;if(Object.assign(e,{parentField:n,rowField:i}),r&&!o(t.spanMethod)){const e=Object.freeze({rowspan:0,colspan:0}),r=Object.freeze({rowspan:1,colspan:1});t.spanMethod=({row:o,column:i,$columnIndex:a})=>{const l=d.get(t.uuid);if(!l)return r;const u=Reflect.has(o,s)?!o[s]:o[n];return i.treeNode?u?r:{rowspan:1,colspan:l.colspan}:u||"right"===i.fixed||a<l.index?r:e}}return e})),s.setupHooks.setup.tap(a,(e=>{i((()=>{var t;(null==(t=e.value)?void 0:t.uuid)&&d.delete(e.value.uuid)}))}))}})}export{a as virtualTreePlugin};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AnyObject, MaybeString, TupleToUnion } from '../../../../../es/shared/types';
|
|
2
|
-
import {
|
|
1
|
+
import { AnyObject, ArrayAble, MaybeString, TupleToUnion } from '../../../../../es/shared/types';
|
|
2
|
+
import { LOW_CODE_VALUE_RELATION } from '../../../../../es/shared/utils';
|
|
3
|
+
import { VxeTableProps, VxeTableDefines, VxeTableInstance, VxeColumnPropTypes, VxeTablePropTypes } from 'vxe-table';
|
|
3
4
|
import { VxeTableListeners } from 'vxe-table/types/table';
|
|
4
5
|
import { IHO_TABLE_STRING_STATUS, IhoTableEventNameTuple, IhoTableRowGroupSequence } from '../../../../../es/components/iho-table/src/constants';
|
|
5
|
-
import { FilterState } from '../../../../../es/components/iho-table/src/plugins/filterPlugin/types';
|
|
6
6
|
export * from './pluginType';
|
|
7
7
|
export interface IhoTableRowGroupItem {
|
|
8
8
|
groupName?: string;
|
|
@@ -38,15 +38,23 @@ export declare namespace IhoTableLowCodeField {
|
|
|
38
38
|
mapping?: {
|
|
39
39
|
type: string;
|
|
40
40
|
mappingFiled: Array<{
|
|
41
|
-
value: Array<
|
|
42
|
-
options: AnyObject[];
|
|
43
|
-
}>;
|
|
41
|
+
value: Array<Record<'key' | 'value', string>>;
|
|
44
42
|
}>;
|
|
45
43
|
};
|
|
46
44
|
};
|
|
45
|
+
type ColorAndIconItem = {
|
|
46
|
+
condition?: {
|
|
47
|
+
con: LOW_CODE_VALUE_RELATION & string;
|
|
48
|
+
value: unknown;
|
|
49
|
+
field_key?: string;
|
|
50
|
+
}[];
|
|
51
|
+
color?: string;
|
|
52
|
+
icon?: string;
|
|
53
|
+
};
|
|
47
54
|
type SettingObj = Partial<{
|
|
48
55
|
attr: string;
|
|
49
56
|
isHide: MaybeString<0 | 1>;
|
|
57
|
+
colorAndIcon: ColorAndIconItem[];
|
|
50
58
|
[K: string]: unknown;
|
|
51
59
|
}>;
|
|
52
60
|
}
|
|
@@ -62,11 +70,13 @@ export declare type LowCodeTableFieldItem = {
|
|
|
62
70
|
treeNode: boolean;
|
|
63
71
|
isShow: MaybeString<0 | 1>;
|
|
64
72
|
isSort: MaybeString<0 | 1>;
|
|
73
|
+
isOrder: MaybeString<0> | VxeTablePropTypes.SortOrder;
|
|
65
74
|
formType: string;
|
|
66
75
|
fieldSetting: string;
|
|
67
76
|
componentProps: AnyObject;
|
|
68
77
|
options: {
|
|
69
78
|
label?: string;
|
|
79
|
+
key?: string;
|
|
70
80
|
value: string;
|
|
71
81
|
disabled?: boolean;
|
|
72
82
|
}[];
|
|
@@ -75,15 +85,12 @@ export declare type LowCodeTableFieldItem = {
|
|
|
75
85
|
headerSlotFn: NonNullable<IhoTableFieldItem['slots']>['header'];
|
|
76
86
|
editSlotFn: NonNullable<IhoTableFieldItem['slots']>['edit'];
|
|
77
87
|
footerSlotFn: NonNullable<IhoTableFieldItem['slots']>['footer'];
|
|
78
|
-
filterDefaultValue: Partial<{
|
|
79
|
-
checked: string[];
|
|
80
|
-
sortStatus: null | 'asc' | 'desc';
|
|
81
|
-
}>;
|
|
82
88
|
/**
|
|
83
89
|
* 即将被废弃,请使用表格外层的beforeEditMethod属性
|
|
84
90
|
* @deprecated
|
|
85
91
|
*/
|
|
86
92
|
checkEditStatus: (payload: VxeTableDefines.CellRenderBodyParams) => boolean | void;
|
|
93
|
+
colorAndIcon: IhoTableLowCodeField.ColorAndIconItem[];
|
|
87
94
|
}> & Partial<VxeTableDefines.ColumnInfo>;
|
|
88
95
|
export declare type IhoTableFormChangePayload = {
|
|
89
96
|
column: IhoTableFieldItem;
|
|
@@ -109,5 +116,7 @@ export declare type IhoTableAnchorItem = {
|
|
|
109
116
|
};
|
|
110
117
|
export declare type IhoTableExpose = {
|
|
111
118
|
$table: VxeTableInstance;
|
|
112
|
-
|
|
119
|
+
loadData(data: AnyObject[]): void;
|
|
120
|
+
setSort(field: string, value: 'asc' | 'desc' | null): void;
|
|
121
|
+
setFilter(field: string, value: ArrayAble<string>): void;
|
|
113
122
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{inject as e,
|
|
1
|
+
import{inject as e,unref as n,toRaw as t,createVNode as r}from"vue";import{jsonParse as o,findAncestor as i}from"../../../../shared/utils/index.js";import{promiseTimeout as u}from"@vueuse/shared";import{isNumber as l,cloneDeep as c,isString as a,isObject as d}from"lodash-es";import{InjectionIhoTableEmits as s,InjectionIhoTableConfig as f,IHO_TABLE_STRING_STATUS as m,IHO_TABLE_NUMBER_STATUS as v}from"../constants/index.js";function p(e){return console.warn(`[IhoTable]: ${e}`)}const I=Object.freeze({getCellType(e){var n;return((null==(n=e.settingObj)?void 0:n.attr)||e.formType||"DEFAULT").toUpperCase()}});function h(){var n,t,r;const o=e(f);return o||p("this function(getRowHeight) only can be used in setup environment"),null!=(r=null==(t=null==(n=null==o?void 0:o.value)?void 0:n.rowConfig)?void 0:t.height)?r:32}function g(e){const n=e.slice(2);return`${n[0].toLowerCase()}${n.slice(1)}`}function E(e){return`on${e[0].toUpperCase()}${e.slice(1)}`}async function C(e,t){return r()||await u(0),r()||function(){const n=+e.colWidth;return l(n)?n:64}();function r(){var r,o;return null==(o=null==(r=n(t))?void 0:r.getColumnByField(e.field))?void 0:o.renderWidth}}function w(n){const r=e(s);function o(){var e;return{value:n.row[n.column.field],row:n.row,column:{...n.column,...null==(e=n.column.editRender)?void 0:e.props},index:n.rowIndex>-1?n.rowIndex:n.$rowIndex}}function i(e={}){r("formChange",{...o(),...c(t(e))})}function u(e={}){r("formClick",{...o(),...c(t(e))})}return{emitFormChange:function(){i()},emitFormClick:function(){u()},emitFormChangeWithParams:i,emitFormClickWithParams:u}}const T=Object.freeze({createDefaultRenderCell:function(){return function(e,{row:n,column:t}){return[r("span",null,[n[t.field]])]}},createRenderEdit:function(e){return function({props:n},t){return e({...t,fieldItem:n||{},...w(t)})}},isEditableColumn(e,n){var t;return!1!==(null==(t=e.editConfig)?void 0:t.showIcon)&&n.editRender&&!1!==n.editRender.enabled},hasFilter(e){return a(e)&&(e=o(e||"")),d(e)&&((n=e).notParticipatingSearch!==m.POSITIVE&&"manual"===(null==(t=n.mapping)?void 0:t.type));var n,t}}),P=Object.freeze({isPositive:e=>e===v.POSITIVE||e===m.POSITIVE,isNegative:e=>e===v.NEGATIVE||e===m.NEGATIVE,notPositive:e=>e!==v.POSITIVE&&e!==m.POSITIVE,notNegative:e=>e!==v.NEGATIVE&&e!==m.NEGATIVE}),O=(e,n)=>({$event:t,column:r})=>{var o;if((null==(o=r.editRender)?void 0:o.name)!==e)return!0;const u=null==t?void 0:t.target;return!d(u)||!i(u,n)};export{T as IhoTableRenderHelper,P as IhoTableStatusHelper,I as IhoTableUtils,p as IhoTableWarn,O as createIhoTableClearActivedInterceptor,g as eventListener2EventName,E as eventName2EventListener,C as getColumnRenderWidth,h as getRowHeight,w as useIhoTableFormEvent};
|