cnhis-design-vue 3.1.51-release.3 → 3.1.51-release.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/annotation-edit/src/type.d.ts +1 -1
- package/es/components/base-search/index.d.ts +3 -0
- package/es/components/base-search/src/index.vue.d.ts +3 -0
- package/es/components/base-search/src/index.vue2.js +1 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +3 -3
- package/es/components/card-reader-sdk/src/cardReaderSDK.js +1 -1
- package/es/components/fabric-chart/index.d.ts +5 -6
- package/es/components/fabric-chart/src/FabricChart.vue.d.ts +5 -6
- package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
- package/es/components/fabric-chart/src/components/PopupMenu.js +1 -1
- package/es/components/fabric-chart/src/components/PopupTip.vue.d.ts +0 -6
- package/es/components/fabric-chart/src/components/PopupTip.vue2.js +1 -1
- package/es/components/fabric-chart/style/index.css +1 -1
- package/es/components/field-set/index.d.ts +33 -0
- package/es/components/field-set/src/FieldSet.vue.d.ts +33 -0
- package/es/components/field-set/src/FieldSet.vue2.js +1 -1
- package/es/components/field-set/src/components/Row.vue.d.ts +2 -1
- package/es/components/field-set/src/components/Row.vue2.js +1 -1
- package/es/components/field-set/src/types/index.d.ts +1 -0
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/components/renderer/levelSearchCascader.js +1 -1
- package/es/components/form-render/src/types/index.d.ts +1 -0
- package/es/components/iho-table/index.d.ts +3 -3
- package/es/components/iho-table/src/IhoTable.vue.d.ts +4 -3
- package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
- package/es/components/iho-table/src/constants/index.d.ts +7 -6
- package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +1 -1
- package/es/components/iho-table/src/plugins/defaultValuePlugin.d.ts +1 -0
- package/es/components/iho-table/src/plugins/defaultValuePlugin.js +1 -0
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.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/separateRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +15 -0
- package/es/components/iho-table/src/utils/index.d.ts +1 -1
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +1 -0
- package/es/components/index.js +1 -1
- package/es/components/quick-search/index.d.ts +3 -0
- package/es/components/quick-search/src/index.vue.d.ts +3 -0
- package/es/components/quick-search/src/index.vue2.js +1 -1
- package/es/components/slider-tree/index.d.ts +20 -87
- package/es/components/slider-tree/index.js +1 -1
- package/es/components/slider-tree/src/index.vue.d.ts +19 -87
- package/es/components/slider-tree/src/index.vue2.js +1 -1
- package/es/components/slider-tree/src/utils/index.d.ts +13 -1
- package/es/components/slider-tree/src/utils/index.js +1 -1
- package/es/components/slider-tree/src/utils/tool.d.ts +1 -0
- package/es/components/slider-tree/src/utils/tool.js +1 -0
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/index.js +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AnyObject } from '../../../../es/shared/types';
|
|
2
2
|
import { PropType } from 'vue';
|
|
3
3
|
import { VxeTableInstance } from 'vxe-table';
|
|
4
|
+
import { AnnotationItem } from '../../../../es/components/annotation-edit/src/type';
|
|
4
5
|
import { IhoTableConfig, IhoTableHandler, LowCodeTableFieldItem } from '../../../../es/components/iho-table/src/types';
|
|
5
6
|
declare const _default: import("vue").DefineComponent<{
|
|
6
7
|
tableConfig: {
|
|
@@ -16,7 +17,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
16
17
|
default: () => never[];
|
|
17
18
|
};
|
|
18
19
|
annotation: {
|
|
19
|
-
type: PropType<
|
|
20
|
+
type: PropType<Record<string, AnnotationItem>>;
|
|
20
21
|
};
|
|
21
22
|
}, {
|
|
22
23
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -33,7 +34,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
33
34
|
default: () => never[];
|
|
34
35
|
};
|
|
35
36
|
annotation: {
|
|
36
|
-
type: PropType<
|
|
37
|
+
type: PropType<Record<string, AnnotationItem>>;
|
|
37
38
|
};
|
|
38
39
|
}>> & {
|
|
39
40
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -4654,7 +4655,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
4654
4655
|
default: () => never[];
|
|
4655
4656
|
};
|
|
4656
4657
|
annotation: {
|
|
4657
|
-
type: PropType<
|
|
4658
|
+
type: PropType<Record<string, AnnotationItem>>;
|
|
4658
4659
|
};
|
|
4659
4660
|
}>> & {
|
|
4660
4661
|
onFormChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,provide as a,ref as o,
|
|
1
|
+
import{defineComponent as e,computed as t,provide as a,ref as o,toRaw as l,watch as n,resolveComponent as r,openBlock as s,createElementBlock as i,unref as u,normalizeStyle as d,createBlock as c,resolveDynamicComponent as f,createElementVNode as v,createVNode as m,mergeProps as p,createSlots as b,renderList as g,withCtx as h,createCommentVNode as x,renderSlot as k,normalizeProps as y,guardReactiveProps as D}from"vue";import{useTheme as C}from"../../../shared/hooks/useTheme.js";import{useDebounceFn as $}from"@vueuse/core";import"date-fns";import{isString as j,isEqualWith as w,isFunction as I,pick as H}from"lodash-es";import{widthAppend as T,uuidGenerator as _}from"../../../shared/utils/index.js";import{promiseTimeout as A}from"@vueuse/shared";import{VxeTableEventNameList as L,InjectionIhoTableEmits as R,InjectionIhoTableAnnotation as S,InjectionIhoTableUUID as E,InjectionIhoTableInstance as F,InjectionIhoTableConfig as O,InjectionIhoTableFieldList as B,InjectionIhoTableHandler as W}from"./constants/index.js";import{createTableHooks as q,applyTableConfigHooks as z,applyTableFieldHooks as G,createTableEventHandlers as J,createDomInsertComponent as K,createDataTransfer as M}from"./hooks/tapHooks/index.js";import{provideIhoTableEventListener as N}from"./hooks/tapHooks/useEventHooks.js";import{eventName2EventListener as P}from"./utils/index.js";const Q=["id"];var U=e({__name:"IhoTable",props:{tableConfig:{type:Object,default:()=>({})},fieldList:{type:Array,default:()=>[]},tableData:{type:Array,default:()=>[]},annotation:{type:Object}},emits:["formChange","settingClick","formClick","keyboard","rowDrag",...L],setup(e,{expose:L,emit:U}){var V,X;const Y=e,Z=C({"--c-border-color":"#e2e2e2","--c-head-bg-color":"#f2f2f2","--c-hover-color":"#f7f7f7"}),ee=t((()=>{var e,t;const a=null!=(t=null==(e=Y.tableConfig)?void 0:e.height)?t:"100%";return{height:"auto"===a?"100%":j(a)&&(a.includes("calc")||a.endsWith("%"))?a:T(a)}})),te=N(),ae=function(e,...t){U(e,...t);const a=u(re)[P(e)];I(a)&&a(...t),te.trigger(e,...t)};a(R,ae);const oe=q();a(S,t((()=>Y.annotation)));const le=_();a(E,le);const ne=o();a(F,ne);const re=o({uuid:null!=(X=null==(V=Y.tableConfig)?void 0:V.uuid)?X:le});a(O,re);const se=$(ie,10);function ie(){re.value=z(oe,Y.tableConfig,{$table:ne,emits:ae}),re.value.uuid=le}const ue=o([]);a(B,ue);const de=$(ce,10);function ce(){const e=G(oe,Y.fieldList,re.value,{$table:ne,emits:ae});w(e,l(ue.value),((e,t)=>{if(I(e)&&I(t))return e.toString()===t.toString()}))||(ue.value=e)}const fe=M(oe,re,ne),ve=o([]);async function me(){var e,t;const a=await fe(Y.tableData),o=null==(e=ne.value)?void 0:e.getTableData().fullData;if(o){let e=0;if(!(o.some((t=>{var o;if(!(null==(o=ne.value)?void 0:o.isInsertByRow(t))){if(t!==a[e])return!0;e++}}))||e!==a.length))return}ve.value=a,null==(t=ne.value)||t.recalculate(!0)}const pe={updateTableDataRef:$(me,10),updateConfigRef:se,updateFieldListRef:de};a(W,pe);const be=J({hooks:oe,config:re,$table:ne,context:pe,emits:ae}),ge=t((()=>({...re.value,...be})));let he=!1,xe=!1,ke=!1;const ye=$((()=>{he&&ie(),xe&&ce(),ke&&me(),he=!1,xe=!1,ke=!1}),10);n((()=>Y.tableConfig),(()=>{he=!0,xe=!0,ke=!0,ye()}),{deep:!0}),n((()=>Y.fieldList),(()=>{xe=!0,ke=!0,ye()}),{deep:!0}),n([()=>[...Y.tableData],()=>{var e;return null==(e=Y.tableData)?void 0:e.length}],(()=>{ke=!0,ye()})),n([()=>Y.tableData,()=>{var e;return null==(e=Y.tableData)?void 0:e.length}],(async()=>{var e,t;(null==(e=re.value.treeConfig)?void 0:e.expandAll)&&(await A(11),null==(t=ne.value)||t.setAllTreeExpand(!0))})),ie(),ce(),me();const{header:De,footer:Ce}=K(oe);function $e(e){return H(e,["row","rowIndex","$rowIndex","column","columnIndex","$columnIndex","_columnIndex","checked","disabled","indeterminate"])}return L({$table:ne,async loadData(e){var t;null==(t=ne.value)||t.loadData(await fe(e))},setSort:(e,t)=>({field:e,value:t}),setFilter:(e,t)=>({field:e,value:t}),reload(){var e,t;null==(e=ne.value)||e.loadColumn([]),null==(t=ne.value)||t.loadData([]),ie(),ce(),me()},...oe.exposeHooks.expose.call({},re,{$table:ne,emits:ae})}),oe.setupHooks.setup.call(re,ue,{$table:ne,emits:ae}),(e,t)=>{const a=r("vxe-grid");return s(),i("section",{class:"iho-table",id:u(le),style:d(u(Z))},[(s(),c(f(u(De)))),v("section",{style:d(u(ee))},[m(a,p({ref_key:"$table",ref:ne},u(ge),{columns:ue.value,data:ve.value}),b({_:2},[g(e.$slots,((t,a)=>({name:a,fn:h((t=>[x(" 实际上所有的vxe-grid插槽都支持 "),k(e.$slots,a,y(D($e(t))))]))})))]),1040,["columns","data"])],4),(s(),c(f(u(Ce))))],12,Q)}}});export{U as default};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Nullable, UndefinedAble } from '../../../../../es/shared/types';
|
|
2
2
|
import { ComputedRef, InjectionKey, Ref } from 'vue';
|
|
3
3
|
import { VxeTableInstance } from 'vxe-table';
|
|
4
|
-
import {
|
|
4
|
+
import { AnnotationItem } from '../../../../../es/components/annotation-edit/src/type';
|
|
5
|
+
import { IhoTableConfig, IhoTableEmits, IhoTableFieldItem, IhoTableHandler } from '../../../../../es/components/iho-table';
|
|
5
6
|
import { IhoTableEventListener } from '../../../../../es/components/iho-table/src/hooks/tapHooks/useEventHooks';
|
|
6
7
|
export declare enum WIDGET_TYPE {
|
|
7
8
|
DEFAULT = "DEFAULT",
|
|
@@ -37,8 +38,8 @@ export declare enum WIDGET_TYPE {
|
|
|
37
38
|
BANK_CARD = "BANK_CARD",
|
|
38
39
|
SEQUENCE = "SEQUENCE"
|
|
39
40
|
}
|
|
40
|
-
export declare const VxeEventListenerNameList:
|
|
41
|
-
export declare const VxeTableEventNameList:
|
|
41
|
+
export declare const VxeEventListenerNameList: readonly ["onKeydownStart", "onKeydown", "onKeydownEnd", "onPaste", "onCopy", "onCut", "onCurrentChange", "onRadioChange", "onCheckboxChange", "onCheckboxAll", "onCheckboxRangeStart", "onCheckboxRangeChange", "onCheckboxRangeEnd", "onCellClick", "onCellDblclick", "onCellMenu", "onCellMouseenter", "onCellMouseleave", "onHeaderCellClick", "onHeaderCellDblclick", "onHeaderCellMenu", "onFooterCellClick", "onFooterCellDblclick", "onFooterCellMenu", "onSortChange", "onFilterChange", "onFilterVisible", "onResizableChange", "onToggleRowExpand", "onToggleTreeExpand", "onMenuClick", "onEditClosed", "onEditActived", "onEditDisabled", "onValidError", "onScroll", "onCustom", "onOpenFnr", "onFnrChange", "onFnrFind", "onFnrFindAll", "onFnrReplace", "onFnrReplaceAll", "onCellAreaCopy", "onCellAreaCut", "onCellAreaPaste", "onCellAreaMerge", "onClearCellAreaMerge", "onHeaderCellAreaSelection", "onCellAreaSelectionStart", "onCellAreaSelectionDrag", "onCellAreaSelectionEnd", "onCellAreaExtensionStart", "onCellAreaExtensionDrag", "onCellAreaExtensionEnd", "onCellAreaArrowsStart", "onCellAreaArrowsEnd", "onActiveCellChangeStart", "onActiveCellChangeEnd", "onPageChange"];
|
|
42
|
+
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", "pageChange"];
|
|
42
43
|
export declare const IhoTableRowGroupSequence: readonly ["firstRowGroup", "secondRowGroup", "thirdRowGroup", "fourthRowGroup", "fifthRowGroup", "sixthRowGroup", "seventhRowGroup", "eighthRowGroup", "ninthRowGroup", "tenthRowGroup"];
|
|
43
44
|
export declare const HIGHEST_PRIORITY: number;
|
|
44
45
|
export declare const LOWEST_PRIORITY: number;
|
|
@@ -71,11 +72,11 @@ export declare enum IHO_TABLE_FIXED_STATUS {
|
|
|
71
72
|
right = 2
|
|
72
73
|
}
|
|
73
74
|
export declare const IhoTableCustomEventNameTuple: readonly ["formChange", "settingClick", "formClick", "keyboard", "rowDrag"];
|
|
74
|
-
export declare const IhoTableEventNameTuple: readonly ["formChange", "settingClick", "formClick", "keyboard", "rowDrag",
|
|
75
|
+
export declare const IhoTableEventNameTuple: readonly ["formChange", "settingClick", "formClick", "keyboard", "rowDrag", "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", "pageChange"];
|
|
75
76
|
export declare const InjectionIhoTableConfig: InjectionKey<Ref<IhoTableConfig>>;
|
|
76
77
|
export declare const InjectionIhoTableFieldList: InjectionKey<Ref<IhoTableFieldItem[]>>;
|
|
77
78
|
export declare const InjectionIhoTableEmits: InjectionKey<IhoTableEmits>;
|
|
78
|
-
export declare const InjectionIhoTableAnnotation: InjectionKey<ComputedRef<Nullable<
|
|
79
|
+
export declare const InjectionIhoTableAnnotation: InjectionKey<ComputedRef<Nullable<Record<string, AnnotationItem>>>>;
|
|
79
80
|
export declare const InjectionIhoTableUUID: InjectionKey<string>;
|
|
80
81
|
export declare const InjectionIhoTableInstance: InjectionKey<Ref<UndefinedAble<VxeTableInstance>>>;
|
|
81
82
|
export declare const InjectionIhoTableHandler: InjectionKey<IhoTableHandler>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cloneDeep as e,isString as t,isFunction as n,pick as o,isArray as a,isNumber as i}from"lodash-es";import{isObject as r}from"@vue/shared";const s=Symbol("remove property");function l(){return{formConfigLikeAdaptor:function(l){const p={};return r(l)?{fieldList:function(l){const m=new Map([["NONE",0],["LEFT",1],["RIGHT",2]]),u=new Map([["0",0],["1",1]]),c=new Map([...["RADIO","RADIO_BLOCK","CHECKBOX","CHECKBOX_BLOCK","SELECT","SEARCH","SEARCH_MORE","SWITCH_COMPONENT"].map((e=>[e,"select"])),...["DATE"].map((e=>[e,"date"])),...["INPUT"].map((e=>[e,"input"])),...["DIGITAL"].map((e=>[e,"number"]))]),d=(e,t)=>{if(!r(e))return;const n={label:e.describe,...e};t.options=a(t.options)?[...t.options,n]:[n]},f=(e,n)=>{0!==e&&"0"!==e&&e&&(t(e)||i(e))&&(
|
|
1
|
+
import{cloneDeep as e,isString as t,isFunction as n,pick as o,isArray as a,isNumber as i}from"lodash-es";import{isObject as r}from"@vue/shared";const s=Symbol("remove property");function l(){return{formConfigLikeAdaptor:function(l){const p={};return r(l)?{fieldList:function(l){const m=new Map([["NONE",0],["LEFT",1],["RIGHT",2]]),u=new Map([["0",0],["1",1]]),c=new Map([...["RADIO","RADIO_BLOCK","CHECKBOX","CHECKBOX_BLOCK","SELECT","SEARCH","SEARCH_MORE","SWITCH_COMPONENT"].map((e=>[e,"select"])),...["DATE"].map((e=>[e,"date"])),...["INPUT"].map((e=>[e,"input"])),...["DIGITAL"].map((e=>[e,"number"]))]),d=(e,t)=>{if(!r(e))return;const n={label:e.describe,...e};t.options=a(t.options)?[...t.options,n]:[n]},f=(e,n)=>{0!==e&&"0"!==e&&e&&(t(e)||i(e))&&(n.componentProps={maxTagCount:+e,...n.componentProps})},_=new Map([["multi_select_value",f],["is_null",(e,t,n,o)=>{"1"!==e&&"0"===e&&(o[n.val_key]=[{required:!0,message:"必填"}])}],["validate",(e,t)=>{if(!r(e))return;t.componentProps={...Object.entries({maxlength:"max_length",minlength:"min_length",max:"max_value",min:"min_value",precision:"decimal_length"}).reduce(((t,[n,o])=>(t[n]=e[o],t)),{}),...t.componentProps}}],["dateValidate",(e,t)=>{r(e)&&(t.isDateDisabled=(t,n)=>{if(!r(n))return;const{startDate:o,endDate:a}=e;let i=!1;return o&&(i=new Date(n[o]).getTime()>t),a&&(i=i||new Date(n[a]).getTime()<t),i})}],["default_val","defaultValue"],["date_format","valueFormat"],...["open","close"].map((e=>[e,d])),["is_edit",{property:"isEdit",valueMap:u}],["free_entry",(e,t,n)=>{t.componentProps={...t.componentProps,allowCreate:"1"===e||1===e,shouldSave:"1"===n.save_free_entry||1===n.save_free_entry}}],["html_type",(e,n,o)=>{var a;if(!t(e))return;if("DATE"===e)return void(n.formType=t(o.date_format)&&o.date_format.startsWith("HH:mm")?"time":"date");n.formType=null!=(a=c.get(e))?a:e;const i="SEARCH"!==e&&("SEARCH_MORE"===e||("SELECT"===e?"0"===o.multi_select:null));i&&(n.componentProps={multiple:i,...n.componentProps})}],["option",{property:"options",fieldMap:new Map([["text","label"]])}],...["alias","name"].map((e=>[e,(e,t,n)=>{var o;t.title=`${null!=(o=n.alias)?o:n.name}${n.suffix?`(${n.suffix})`:""}`}]))]),v=new Map([["sum","isSum"],["show","isShow"],["elementId","columnName"],["columnWidth","colWidth"],["fixedWayEnum",{property:"isFixed",valueMap:m}],["multi_select_value",f],["setting",{fieldMap:_,assign:!0}]]);return l.map((e=>E(e,p,v)));function E(i,l,p){if(!p)return e(i);const m={};return Object.entries(i).forEach((([e,o])=>{const a=p.get(e);return a?a!==s?t(a)?m[a]=o:n(a)?a(o,m,i,l):void(r(a)&&(a.assign?Object.assign(m,u(o,a)):m[a.property||e]=u(o,a))):void 0:m[e]=o})),m.componentProps=Object.assign({},m.componentProps,o(m,["options","isDateDisabled"])),m;function u(e,t){var o,i;return!r(t)||n(t)?e:a(e)?e.map((e=>u(e,t))):r(e)?E(e,l,t.fieldMap):null!=(i=null==(o=t.valueMap)?void 0:o.get(e))?i:e}}}(l.fieldList),editRules:p}:{fieldList:[],editRules:p}}}}export{l as useColumnConfigAdaptor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function defaultValuePlugin(): import("../../../../../es/components/iho-table").TablePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{format as e}from"date-fns";import"../../index.js";import{EDITABLE_WIDGET_TYPE as t}from"../constants/index.js";import{getLowCodeFieldFromField as a}from"../utils/index.js";import{defineTablePlugin as n}from"../hooks/useTablePlugin.js";function o(){const o="defaultValuePlugin",l=new Map([[[t.TIME],({defaultValue:t,valueFormat:a="HH:mm"})=>"current"===t?e(Date.now(),a):t],[[t.DATE],({defaultValue:t,valueFormat:a="yyyy-MM-dd HH:mm:ss"})=>"current"===t?e(Date.now(),a):t]]);return n({name:o,apply(e){let t=[];e.fieldHooks.fieldList.tap(o,(e=>(t=e,e))),e.dataHooks.data.tap(o,(e=>{t.length&&t.forEach((t=>{var n;const o=a(t);if(null==(null==o?void 0:o.defaultValue))return;const d=null==(n=t.editRender)?void 0:n.name,[,u]=[...l.entries()].find((([e])=>e.includes(d)))||[];e[t.field]=u?u(o):o.defaultValue}))})),e.dataHooks.dataEnd.tap(o,(()=>{t=[]}))}})}export{o as defaultValuePlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"./anchorPlugin/index.js";import*as r from"./bindEventSettingPlugin/index.js";import*as i from"./defaultConfigPlugin/index.js";import*as n from"./filterDaterangeRenderPlugin/index.js";import*as
|
|
1
|
+
import*as e from"./anchorPlugin/index.js";import*as r from"./bindEventSettingPlugin/index.js";import*as i from"./defaultConfigPlugin/index.js";import*as n from"./defaultValuePlugin.js";import*as s from"./filterDaterangeRenderPlugin/index.js";import*as t from"./filterRenderPlugin/index.js";import*as d from"./filterVisibleEventPlugin.js";import*as l from"./highLightSetPlugin.js";import*as g from"./keyboardEventPlugin/index.js";import*as u from"./lowCodeFieldAdaptorPlugin/index.js";import*as o from"./maxCheckSizePlugin.js";import*as a from"./operationalFormPlugin/index.js";import*as P from"./rendererPlugins/editableWidgets/dateRendererPlugin/index.js";import*as m from"./rendererPlugins/editableWidgets/inputRendererPlugin.js";import*as x from"./rendererPlugins/editableWidgets/numberRendererPlugin.js";import*as f from"./rendererPlugins/editableWidgets/radioRendererPlugin.js";import*as p from"./rendererPlugins/editableWidgets/selectRendererPlugin/index.js";import*as j from"./rendererPlugins/editableWidgets/separateRendererPlugin/index.js";import*as R from"./rendererPlugins/editableWidgets/timeRendererPlugin/index.js";import*as b from"./rendererPlugins/widgets/checkRendererPlugin.js";import*as w from"./rendererPlugins/widgets/colorRendererPlugin.js";import*as c from"./rendererPlugins/widgets/defaultRendererPlugin.js";import*as h from"./rendererPlugins/widgets/htmlRendererPlugin.js";import*as W from"./rendererPlugins/widgets/labelRendererPlugin.js";import*as v from"./rendererPlugins/widgets/pictureRendererPlugin.js";import*as k from"./rendererPlugins/widgets/seqRendererPlugin.js";import*as C from"./rowClickPlugin/index.js";import*as S from"./rowDragPlugin/index.js";import*as E from"./rowGroupSettingPlugin/index.js";import*as D from"./varialbleHeightPlugin/index.js";import*as F from"./virtualTreePlugin/index.js";import{separateMetaModule as V}from"../../../../shared/utils/index.js";var q=V(Object.assign({"./anchorPlugin/index.tsx":e,"./bindEventSettingPlugin/index.ts":r,"./defaultConfigPlugin/index.ts":i,"./defaultValuePlugin.ts":n,"./filterDaterangeRenderPlugin/index.tsx":s,"./filterRenderPlugin/index.tsx":t,"./filterVisibleEventPlugin.ts":d,"./highLightSetPlugin.tsx":l,"./keyboardEventPlugin/index.ts":g,"./lowCodeFieldAdaptorPlugin/index.tsx":u,"./maxCheckSizePlugin.ts":o,"./operationalFormPlugin/index.ts":a,"./rendererPlugins/editableWidgets/dateRendererPlugin/index.tsx":P,"./rendererPlugins/editableWidgets/inputRendererPlugin.tsx":m,"./rendererPlugins/editableWidgets/numberRendererPlugin.tsx":x,"./rendererPlugins/editableWidgets/radioRendererPlugin.tsx":f,"./rendererPlugins/editableWidgets/selectRendererPlugin/index.tsx":p,"./rendererPlugins/editableWidgets/separateRendererPlugin/index.tsx":j,"./rendererPlugins/editableWidgets/timeRendererPlugin/index.tsx":R,"./rendererPlugins/widgets/checkRendererPlugin.tsx":b,"./rendererPlugins/widgets/colorRendererPlugin.tsx":w,"./rendererPlugins/widgets/defaultRendererPlugin.tsx":c,"./rendererPlugins/widgets/htmlRendererPlugin.tsx":h,"./rendererPlugins/widgets/labelRendererPlugin.tsx":W,"./rendererPlugins/widgets/pictureRendererPlugin.tsx":v,"./rendererPlugins/widgets/seqRendererPlugin.tsx":k,"./rowClickPlugin/index.ts":C,"./rowDragPlugin/index.ts":S,"./rowGroupSettingPlugin/index.ts":E,"./varialbleHeightPlugin/index.tsx":D,"./virtualTreePlugin/index.ts":F}));export{q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createVNode as e,mergeProps as t}from"vue";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as
|
|
1
|
+
import{createVNode as e,mergeProps as t}from"vue";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as r}from"../../../../constants/index.js";import{createIhoTableClearActivedInterceptor as n,IhoTableRenderHelper as o}from"../../../../utils/index.js";import i from"./editDate.vue.js";import{defineTablePlugin as d}from"../../../../hooks/useTablePlugin.js";function a(){return d({name:"dateRendererPlugin",vxe(d){d.interceptor.add("event.clearActived",n(r.DATE,(e=>e.classList.contains("n-date-panel")))),d.renderer.add(r.DATE,{renderCell:o.createDefaultRenderCell(),renderEdit:o.createRenderEdit((({fieldItem:r,emitFormClick:n,row:o,column:d,$rowIndex:a})=>[e(i,t({value:o[d.field],"onUpdate:value":e=>o[d.field]=e,isStartDate:r.isStartDate,isEndDate:r.isEndDate,connectField:r.connectField,valueFormat:r.valueFormat},r.componentProps,{column:d,row:o,"row-index":a,onClick:n}),null)]))})}})}export{a as dateRendererPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,inject as o,createVNode as t,mergeProps as n,onBeforeUnmount as l}from"vue";import{arrayed as i}from"../../../../../../../shared/utils/index.js";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as r,InjectionIhoTableUUID as s}from"../../../../constants/index.js";import{useAutoFocus as d}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as u,getTitle as c,IhoTableRenderHelper as a,IhoTableUtils as p}from"../../../../utils/index.js";import f from"./editSelect.js";import{getDefaultValue as m,isConnectField as v,getArray as E}from"./selectUtils.js";import{getSelectOptions as g,selectOptionsMap as w}from"../hooks/useSelectOption.js";import{cloneDeep as C,isEqual as b}from"lodash-es";import{defineTablePlugin as h}from"../../../../hooks/useTablePlugin.js";function x(){const x="selectRendererPlugin",k=e(new Map);return h({name:x,vxe(e){e.interceptor.add("event.clearActived",u(r.SELECT,(e=>e.classList.contains("iho-table__selectMenu")))),e.renderer.add(r.SELECT,{renderCell({props:e},{row:n,column:l,$table:r}){var d;const u=o(s),a=g(u,l.field,n,r),p=m(n,e,a),f=i(p).join(","),v=e&&(!0===(E=e.variableHeight)||"1"===E||(null==(d=e.componentProps)?void 0:d.indexedText));var E;return[t("span",{title:c(l,f)},[v?i(p).filter((e=>null!=e)).map(((e,o)=>[o+1,".",e,";",t("br",null,null)])):f])]},renderEdit:a.createRenderEdit((({fieldItem:e,emitFormClick:l,row:i,column:r,$rowIndex:d,$table:u})=>{const c=o(s),a=g(c,r.field,i,u);return[t(f,n({queryOptions:e.queryOptions},e.componentProps,{options:a,column:r,row:i,"row-index":d,value:i[r.field],"onUpdate:value":e=>i[r.field]=e,onClick:l}),null)]}))})},apply(e){async function o(e,o={}){var t,n,l;const i=null==(t=e.editRender)?void 0:t.props;if(!i)return[];let r=E(i.options)||E(null==(n=i.componentProps)?void 0:n.options)||[];if(i.queryOptions)try{const t={column:e,isFullData:!0,...o};r=await(null==(l=i.queryOptions)?void 0:l.call(i,t))}catch(e){console.log(`获取${i.field}_options错误`)}return r}d(e).bindAutoFocusConfig(x,r.SELECT,".n-base-selection-input"),e.fieldHooks.fieldList.tap(x,((e,{uuid:o})=>(o&&(w.get(o)||w.set(o,{}),k.set(o,C(e))),e))),e.dataHooks.data.tap(x,((e,{uuid:t},n)=>{if(!t)return;const l=k.get(t);if(!l||!l.length)return;const i=w.get(t);l.forEach((async t=>{var n;const r=null==(n=t.editRender)?void 0:n.props;if(t.field&&r&&"SELECT"===p.getCellType(r)){if(null==r?void 0:r.connectField){const n=r.connectField.split(","),s=e[r.columnName];n.forEach((async n=>{const d=null==l?void 0:l.find((e=>e.field===n));if(!d)return;const u=s?`${n}__${r.columnName}-${s}`:n;i[u]||(i[u]=[],i[u]=await o(d,{row:e,connectColumn:t}))}))}i[t.field]||v(l,t.field)||(i[t.field]=[],i[t.field]=await o(t,{row:e}))}}))})),e.setupHooks.setup.tap(x,(e=>{l((()=>{var o;const t=null==(o=e.value)?void 0:o.uuid;t&&(w.delete(t),k.delete(t))}))})),e.eventHooks.onCellDblclick.tap(x,(({$table:e},o,{emits:t})=>{var n;const{column:l,row:i}=e.reactData.editStore.actived
|
|
1
|
+
import{reactive as e,inject as o,createVNode as t,mergeProps as n,onBeforeUnmount as l}from"vue";import{arrayed as i}from"../../../../../../../shared/utils/index.js";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as r,InjectionIhoTableUUID as s}from"../../../../constants/index.js";import{useAutoFocus as d}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as u,getTitle as c,IhoTableRenderHelper as a,IhoTableUtils as p}from"../../../../utils/index.js";import f from"./editSelect.js";import{getDefaultValue as m,isConnectField as v,getArray as E}from"./selectUtils.js";import{getSelectOptions as g,selectOptionsMap as w}from"../hooks/useSelectOption.js";import{cloneDeep as C,isEqual as b}from"lodash-es";import{defineTablePlugin as h}from"../../../../hooks/useTablePlugin.js";function x(){const x="selectRendererPlugin",k=e(new Map);return h({name:x,vxe(e){e.interceptor.add("event.clearActived",u(r.SELECT,(e=>e.classList.contains("iho-table__selectMenu")))),e.renderer.add(r.SELECT,{renderCell({props:e},{row:n,column:l,$table:r}){var d;const u=o(s),a=g(u,l.field,n,r),p=m(n,e,a),f=i(p).join(","),v=e&&(!0===(E=e.variableHeight)||"1"===E||(null==(d=e.componentProps)?void 0:d.indexedText));var E;return[t("span",{title:c(l,f)},[v?i(p).filter((e=>null!=e)).map(((e,o)=>[o+1,".",e,";",t("br",null,null)])):f])]},renderEdit:a.createRenderEdit((({fieldItem:e,emitFormClick:l,row:i,column:r,$rowIndex:d,$table:u})=>{const c=o(s),a=g(c,r.field,i,u);return[t(f,n({queryOptions:e.queryOptions},e.componentProps,{options:a,column:r,row:i,"row-index":d,value:i[r.field],"onUpdate:value":e=>i[r.field]=e,onClick:l}),null)]}))})},apply(e){async function o(e,o={}){var t,n,l;const i=null==(t=e.editRender)?void 0:t.props;if(!i)return[];let r=E(i.options)||E(null==(n=i.componentProps)?void 0:n.options)||[];if(i.queryOptions)try{const t={column:e,isFullData:!0,...o};r=await(null==(l=i.queryOptions)?void 0:l.call(i,t))}catch(e){console.log(`获取${i.field}_options错误`)}return r}d(e).bindAutoFocusConfig(x,r.SELECT,".n-base-selection-input"),e.fieldHooks.fieldList.tap(x,((e,{uuid:o})=>(o&&(w.get(o)||w.set(o,{}),k.set(o,C(e))),e))),e.dataHooks.data.tap(x,((e,{uuid:t},n)=>{if(!t)return;const l=k.get(t);if(!l||!l.length)return;const i=w.get(t);l.forEach((async t=>{var n;const r=null==(n=t.editRender)?void 0:n.props;if(t.field&&r&&"SELECT"===p.getCellType(r)){if(null==r?void 0:r.connectField){const n=r.connectField.split(","),s=e[r.columnName];n.forEach((async n=>{const d=null==l?void 0:l.find((e=>e.field===n));if(!d)return;const u=s?`${n}__${r.columnName}-${s}`:n;i[u]||(i[u]=[],i[u]=await o(d,{row:e,connectColumn:t}))}))}i[t.field]||v(l,t.field)||(i[t.field]=[],i[t.field]=await o(t,{row:e}))}}))})),e.setupHooks.setup.tap(x,(e=>{l((()=>{var o;const t=null==(o=e.value)?void 0:o.uuid;t&&(w.delete(t),k.delete(t))}))})),e.eventHooks.onCellDblclick.tap(x,(({$table:e},o,{emits:t})=>{var n;const{column:l,row:i}=e.reactData.editStore.actived;if(!l||!i)return;const s=null==(n=l.editRender)?void 0:n.props,{cellDblclickSelectable:d=!1,multiple:u=!1,valueField:c="value"}=s.componentProps||{};if(!d||!function(e){return e&&p.getCellType(e)===r.SELECT}(s))return;const a=o.uuid&&g(o.uuid,l.field,i,e);if(1!==(null==a?void 0:a.length))return;const f=u?[a[0][c]]:a[0][c],m=i[l.field];e.clearEdit(),b(f,m)||(i[l.field]=f,t("formChange",{column:l,row:i,oldValue:m,value:f,index:e.getRowIndex(i),$table:e,option:a[0]}))}))}})}export{x as selectRendererPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,inject as t,createVNode as a,toRaw as o,h as r,onBeforeUnmount as n}from"vue";import{traverse as i,arrayed as
|
|
1
|
+
import{reactive as e,inject as t,createVNode as a,toRaw as o,h as r,onBeforeUnmount as n}from"vue";import{traverse as i,arrayed as u}from"../../../../../../../shared/utils/index.js";import{isFunction as l,isObject as s,isArray as d,compact as p,range as c,uniq as f,flatten as _}from"lodash-es";import{NInput as m}from"naive-ui";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as E,InjectionIhoTableUUID as A,InjectionIhoTableHandler as h}from"../../../../constants/index.js";import{useAutoFocus as v}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as R,getLowCodeFieldFromField as g,IhoTableRenderHelper as T,getRowHeight as D,getColumnRenderWidth as w,parseMergeField as b}from"../../../../utils/index.js";import P from"./editSeparate.vue.js";import{contentSeparate as $,getLengthDiffArray as x,getColumnInfoMaxLength as C,generateSeparateRowData as S,isSeparateColumn as k}from"./separateUtils.js";import{getSeparateInfo as H,setSeparateInfo as j,deleteSeparateInfo as M}from"../../../../utils/separateMap.js";import{defineTablePlugin as O}from"../../../../hooks/useTablePlugin.js";function I(){const I="separateRendererPlugins",F=e(new Map);return O({name:I,vxe(e){e.interceptor.add("event.clearActived",R(E.SEPARATE,(e=>e.classList.contains("v-binder-follower-content")))),e.renderer.add(E.SEPARATE,{renderCell(e,{column:o,row:r}){var n,i;const u=t(A),l=null!=(i=null==(n=H(u,r))?void 0:n.separateData)?i:{},s=g(o),d=(null==s?void 0:s.separateFormatter)?s.separateFormatter(l[o.field]):l[o.field];return a("section",{class:"iho-table__ellipsis",title:d},[d])},renderEdit:T.createRenderEdit((({fieldItem:e,column:n,row:i,emitFormClick:u})=>{var d,p;const c=t(A),f=H(c,i),_=D(),E={};let v=null!=(p=null==(d=e.componentProps)?void 0:d.separateSlot)?p:e.separateSlot;return v&&(v=o(v),E.menu=l(v)?v:s(v)?e=>r(v,e):void 0),e.separateRowEdit?function(){if(!f)return[];if(f.ihoTableHandler=t(h),f.separateData["__"+n.field]=f.separateData["__"+n.field]||f.separateData[n.field],E.menu){const e=E.menu;return a(e,{column:n,col:n,row:i,value:f.separateData["__"+n.field],"onUpdate:value":e=>f.separateData["__"+n.field]=e},null)}return a(m,{value:f.separateData["__"+n.field],"onUpdate:value":e=>f.separateData["__"+n.field]=e},null)}():[a(P,{value:i[n.field],"onUpdate:value":e=>i[n.field]=e,"row-index":null==f?void 0:f.index,height:_,column:n,row:i,"display-content":null==(R=null==f?void 0:f.separateData)?void 0:R[n.field],onClick:u},E)];var R}))})},apply(e){function t(e){return(...t)=>{var a;return!(null==(a=t[0].row)?void 0:a.$__SEPARATE)&&(!l(e)||e(...t))}}v(e).bindAutoFocusConfig(I,E.SEPARATE,".iho-table__separateText"),e.eventHooks.onEditClosed.tap(I,(({row:e,column:t,$table:a},o,{emits:r})=>{if(!e.$__uuid)return;const n=g(t);if(!n||!n.separateRowEdit)return;const i=H(e.$__uuid,e);if(!i)return;const{separateData:u,originalData:l,ihoTableHandler:s,index:p}=i,{field:c}=t;if(u["__"+c]&&u["__"+c]!==u[c]&&d(l.$__SEPARATE_DATA)){const e=l.$__SEPARATE_DATA.map((e=>{var t;return null!=(t=e["__"+c])?t:e[c]})),o=l[c];l[c]=d(l[c])?e:e.join(""),r("formChange",{value:l[c],oldValue:o,row:l,column:t,index:p,$table:a}),null==s||s.updateTableDataRef()}})),e.fieldHooks.fieldList.tap(I,((e,{uuid:t})=>(t&&F.set(t,e.reduce(((e,t)=>(i(t,(t=>{k(t)&&(e.push(o(t)),t.showOverflow="ellipsis")})),e)),[])),e))),e.dataHooks.data.tapPromise(I,(async(e,t,{insertAfter:a,index:o,$table:r})=>{var n;if(!t.uuid)return;const i=F.get(t.uuid);if(!i||!i.length)return;const l=[];for(const t of i){if(!t.field)continue;const a=await w(t,e,o,r),i={field:t.field,column:t,data:$(b(e,t),t,a,null==(n=g(t))?void 0:n.separateDeep)};l.push(i)}function s(e){return l.find((t=>t.field===e))}l.forEach((e=>{const{column:t}=e,a=g(t);if(!a)return;if(!a.separateDeep||!a.separateBinder)return;const o=p(u(a.separateBinder).map(s));if(!o.length)return;const r=o.concat(e),n=Math.max(...r.map((e=>e.data.length)));c(n).forEach((e=>{const t=r.map((t=>({item:t.data[e],data:t.data}))),a=t.map((({item:e})=>n(e)));if(1===f(a).length)return;const o=Math.max(...a);function n(e){return d(e)?e.length:1}t.forEach((({item:t,data:a})=>{const r=n(t);r!==o&&(d(t)?t.push(...x(o,r)):a[e]=c(o).map(((e,a)=>0===a?t:"")))}))}))})),l.forEach((e=>{e.data=_(e.data)})),c(C(l)).forEach(((r,n,i)=>{var u;const s=S(l,n),d={index:o,originalData:e,separateData:s,separateIndex:n,separateLength:i.length,isOriginRow:0===n,isLastRow:n===i.length-1};if(0===n)return e.$__SEPARATE_DATA=[s],e.$__SEPARATE_ROW_CACHE=e.$__SEPARATE_ROW_CACHE||[],e.$__uuid=t.uuid,void j(t.uuid,e,d);const p=null!=(u=e.$__SEPARATE_ROW_CACHE[n-1])?u:e.$__SEPARATE_ROW_CACHE[n-1]={$__SEPARATE:!0,$__uuid:t.uuid,$__SEPARATE_INDEX:n};p.$__ORIGIN_INDEX=o,j(t.uuid,p,d),e.$__SEPARATE_DATA.push(s),a(p)}))})),e.eventHooks.onResizableChange.tap(I,(async({column:e},t,a)=>{k(e)&&a.updateTableDataRef()})),e.configHooks.editConfig.tap(I,((e={},t)=>{const a=e.beforeEditMethod;return e.beforeEditMethod=(...e)=>{var o;if(!t.uuid)return c();const r=F.get(t.uuid);if(!r||!r.length)return c();const{row:n,column:i}=e[0],u=H(t.uuid,n);if(!u)return c();const s=null==(o=i.editRender)?void 0:o.props;if(!s||s.separateRowEdit)return c();const{isOriginRow:d,isLastRow:p}=u;return("bottom"===s.separatePlacement?p:d)&&c();function c(){return!l(a)||a(...e)}},e})),e.configHooks.checkboxConfig.tap(I,((e={},a)=>(e.checkMethod=t(e.checkMethod),e.visibleMethod=t(e.visibleMethod),e))),e.setupHooks.setup.tap(I,(e=>{n((()=>{e.value.uuid&&(F.delete(e.value.uuid),M(e.value.uuid))}))}))}})}export{I as separateRendererPlugins};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createVNode as e,mergeProps as o}from"vue";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as t}from"../../../../constants/index.js";import{useAutoFocus as r}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as n,IhoTableRenderHelper as i}from"../../../../utils/index.js";import d from"./editTime.vue.js";import{defineTablePlugin as l}from"../../../../hooks/useTablePlugin.js";function m(){const m="timeRendererPlugin";return l({name:m,vxe(r){r.interceptor.add("event.clearActived",n(t.TIME,(e=>e.classList.contains("n-popover")))),r.renderer.add(t.TIME,{renderCell:i.createDefaultRenderCell(),renderEdit:i.createRenderEdit((({fieldItem:t,emitFormClick:r,row:n,column:i,$rowIndex:l})=>[e(d,o({formattedValue:n[i.field],"onUpdate:formattedValue":e=>n[i.field]=e,column:i,row:n,"row-index":l},t.componentProps,{onClick:r}),null)]))})},apply(e){r(e).bindAutoFocusConfig(m,t.TIME,".n-input__input-el",{after:e=>(Reflect.set(e.editRender,"autoselect",!0),e)})}})}export{m as timeRendererPlugin};
|
|
1
|
+
import{createVNode as e,mergeProps as o}from"vue";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as t}from"../../../../constants/index.js";import{useAutoFocus as r}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as n,IhoTableRenderHelper as i}from"../../../../utils/index.js";import d from"./editTime.vue.js";import{defineTablePlugin as l}from"../../../../hooks/useTablePlugin.js";function m(){const m="timeRendererPlugin";return l({name:m,vxe(r){r.interceptor.add("event.clearActived",n(t.TIME,(e=>e.classList.contains("n-popover")))),r.renderer.add(t.TIME,{renderCell:i.createDefaultRenderCell(),renderEdit:i.createRenderEdit((({fieldItem:t,emitFormClick:r,row:n,column:i,$rowIndex:l})=>[e(d,o({formattedValue:n[i.field],"onUpdate:formattedValue":e=>n[i.field]=e,column:i,row:n,"row-index":l,valueFormat:t.valueFormat},t.componentProps,{onClick:r}),null)]))})},apply(e){r(e).bindAutoFocusConfig(m,t.TIME,".n-input__input-el",{after:e=>(Reflect.set(e.editRender,"autoselect",!0),e)})}})}export{m as timeRendererPlugin};
|
|
@@ -2,6 +2,7 @@ import { AnyObject, ArrayAble, BindEventSettingItem, FormOperationalConfig, Func
|
|
|
2
2
|
import { VxeTableProps, VxeTableDefines, VxeTableInstance, VxeColumnPropTypes, VxeTablePropTypes, VxeTableConstructor } from 'vxe-table';
|
|
3
3
|
import { VxePagerEventProps } from 'vxe-table/types/pager';
|
|
4
4
|
import { VxeTableEventProps, VxeTableListeners, VxeTablePrivateMethods } from 'vxe-table/types/table';
|
|
5
|
+
import { AnnotationItem } from '../../../../../es/components/annotation-edit/src/type';
|
|
5
6
|
import { IHO_TABLE_STRING_STATUS, IhoTableEventNameTuple, IhoTableRowGroupSequence } from '../../../../../es/components/iho-table/src/constants';
|
|
6
7
|
import Sortable from 'sortablejs';
|
|
7
8
|
export * from './pluginType';
|
|
@@ -128,6 +129,13 @@ export declare type LowCodeTableFieldItem = {
|
|
|
128
129
|
separateDeep: boolean;
|
|
129
130
|
separateBinder: ArrayAble<string>;
|
|
130
131
|
separateRowEdit: boolean;
|
|
132
|
+
separatePlacement: 'bottom';
|
|
133
|
+
separateWidth: ((payload: {
|
|
134
|
+
column: VxeTableDefines.ColumnInfo;
|
|
135
|
+
row: AnyObject;
|
|
136
|
+
rowIndex: number;
|
|
137
|
+
$table: VxeTableInstance;
|
|
138
|
+
}) => number) | number;
|
|
131
139
|
/**
|
|
132
140
|
* 即将被废弃,请使用表格外层的beforeEditMethod属性
|
|
133
141
|
* @deprecated
|
|
@@ -139,6 +147,7 @@ export declare type LowCodeTableFieldItem = {
|
|
|
139
147
|
bindEventSetting: BindEventSettingItem[];
|
|
140
148
|
allowSlash: boolean | string;
|
|
141
149
|
whiteList: string[];
|
|
150
|
+
defaultValue: any;
|
|
142
151
|
}> & Partial<VxeTableDefines.ColumnInfo>;
|
|
143
152
|
export declare type IhoTableFormChangePayload = {
|
|
144
153
|
column: IhoTableFieldItem;
|
|
@@ -182,3 +191,9 @@ export declare type IhoTableSeparateInfo = {
|
|
|
182
191
|
separateLength: number;
|
|
183
192
|
ihoTableHandler?: IhoTableHandler;
|
|
184
193
|
};
|
|
194
|
+
export declare type IhoTableProps = Partial<{
|
|
195
|
+
tableConfig: IhoTableConfig;
|
|
196
|
+
fieldList: IhoTableFieldItem[];
|
|
197
|
+
tableData: AnyObject[];
|
|
198
|
+
annotation: Record<string, AnnotationItem>;
|
|
199
|
+
}>;
|
|
@@ -18,7 +18,7 @@ export declare function useUUIDMap<T>(creator: () => T, isReactive?: boolean): {
|
|
|
18
18
|
setItemFromUUID: (uuid: string, value: T) => void;
|
|
19
19
|
removeItemFromUUID: (uuid: string) => void;
|
|
20
20
|
};
|
|
21
|
-
export declare function getColumnRenderWidth(column: AnyObject, $table: MaybeRef<Nullable<VxeTableInstance>>): Promise<number>;
|
|
21
|
+
export declare function getColumnRenderWidth(column: AnyObject, row: AnyObject, rowIndex: number, $table: MaybeRef<Nullable<VxeTableInstance>>): Promise<number>;
|
|
22
22
|
export declare function useIhoTableFormEvent(payloadRef: MaybeRef<Pick<VxeGlobalRendererHandles.RenderEditParams, 'row' | 'rowIndex' | 'column' | '$table'> & {
|
|
23
23
|
$rowIndex?: number;
|
|
24
24
|
}>): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,inject as
|
|
1
|
+
import{reactive as e,inject as t,unref as n,toRaw as r,createVNode as o}from"vue";import{jsonParse as i,arrayed as u,findAncestor as l}from"../../../../shared/utils/index.js";import{promiseTimeout as a}from"@vueuse/shared";import{isFunction as c,isNumber as s,isString as d,isObject as f,isArray as p}from"lodash-es";import{InjectionIhoTableConfig as m,InjectionIhoTableEmits as v,IHO_TABLE_STRING_STATUS as I,IHO_TABLE_NUMBER_STATUS as g,IHO_TABLE_TREE_TYPE as h,InjectionIhoTableUUID as E}from"../constants/index.js";import{getSeparateInfo as T}from"./separateMap.js";export{deleteSeparateInfo,getSeparateInfo,setSeparateInfo}from"./separateMap.js";function w(e){return console.warn(`[IhoTable]: ${e}`)}const C=Object.freeze({getCellType(e){var t;return((null==(t=e.settingObj)?void 0:t.attr)||e.formType||"DEFAULT").toUpperCase()}});function R(){var e,n,r;const o=t(m);return o||w("this function(getRowHeight) only can be used in setup environment"),null!=(r=null==(n=null==(e=null==o?void 0:o.value)?void 0:e.rowConfig)?void 0:n.height)?r:32}function S(e){const t=e.slice(2);return`${t[0].toLowerCase()}${t.slice(1)}`}function O(e){return`on${e[0].toUpperCase()}${e.slice(1)}`}function P(t,n=!0){const r=n?e(new Map):new Map;return{getItemFromUUID:function(e){return r.set(e,r.get(e)||t()).get(e)},setItemFromUUID:function(e,t){r.set(e,t)},removeItemFromUUID:function(e){r.delete(e)}}}async function F(e,t,r,o){return i()||await a(0),i()||function(){const t=+e.colWidth;return s(t)?t:64}();function i(){var i;const u=null==(i=n(o))?void 0:i.getColumnByField(e.field);if(!u)return;const l=$(u);return l?c(l.separateWidth)?l.separateWidth({column:u,row:t,rowIndex:r,$table:n(o)}):s(l.separateWidth)?l.separateWidth:u.renderWidth:u.renderWidth}}function A(e){const o=t(v);function i(){var t;const r=n(e);return{$table:r.$table,value:r.row[r.column.field],row:r.row,column:{...r.column,...null==(t=r.column.editRender)?void 0:t.props},index:r.rowIndex>-1?r.rowIndex:r.$rowIndex}}function u(e={}){o("formChange",{...i(),...r(e)})}function l(e={}){o("formClick",{...i(),...r(e)})}return{emitFormChange:function(){u()},emitFormClick:function(){l()},emitFormChangeWithParams:u,emitFormClickWithParams:l}}function $(e){var t;return null==(t=e.editRender)?void 0:t.props}const b=Object.freeze({createDefaultRenderCell:function(){return function({props:e},{row:n,column:r}){if("bottom"!==(null==e?void 0:e.separatePlacement))return c(n[r.field]);const i=t(E),u=T(i,n);if(!u)return c(n[r.field]);const{originalData:l=n,isLastRow:a}=u;return c(a?l[r.field]:null);function c(e){return[o("span",{title:_(r,e)},[e])]}}},createRenderEdit:function(e){return function({props:t},n){return e({...n,fieldItem:t||{},...A(n)})}},isEditableColumn(e,t){var n;return!1!==(null==(n=e.editConfig)?void 0:n.showIcon)&&t.editRender&&!1!==t.editRender.enabled},hasFilter(e){if(y(e))return!0;let t=e.fieldSetting;return d(t)&&(t=i(t||"")),f(t)&&((n=t).notParticipatingSearch!==I.POSITIVE&&"manual"===(null==(r=n.mapping)?void 0:r.type));var n,r},hasDateFiler(e){var t;return null==(t=null==e?void 0:e.filterSetting)?void 0:t.daterange}}),x=Object.freeze({isPositive:e=>e===g.POSITIVE||e===I.POSITIVE,isNegative:e=>e===g.NEGATIVE||e===I.NEGATIVE,notPositive:e=>e!==g.POSITIVE&&e!==I.POSITIVE,notNegative:e=>e!==g.NEGATIVE&&e!==I.NEGATIVE}),N=(e,t)=>({$event:n,column:r})=>{var o;if(!u(e).includes(null==(o=r.editRender)?void 0:o.name))return!0;const i=null==n?void 0:n.target;return!f(i)||!l(i,t)};function V(e){return[h.TRANSFORM_WITH_SPAN_METHOD,h.TRANSFORM_TREE_TYPE].includes(`${e.isTree}`)}function W(e){return d(e)&&!!e.match(/^###\{[^{}]+}$/)}function D(e){try{return JSON.parse(e.replace(/^###/,""))}catch(e){return{}}}function U(e,t){if(e.$__SEPARATE||!t.editRender||!t.editRender.props)return e[t.field];const{fieldSetting:n}=t.editRender.props;if(!d(n))return e[t.field];const{mergedFeildExpression:r}=i(n);return r&&d(r)?r.replace(/#{(.+?)}/g,(function(t,n){let r=n?e[n.trim()]:null;W(r)&&(r=D(r).change_text);return r||(null==r?"--":r)})):e[t.field]}const j=["SEARCH","SELECT","RADIO","CHECKBOX"];function y(e){return e.notParticipatingSearch===g.NEGATIVE&&j.includes(C.getCellType(e))&&p(e.options)&&e.options.length}function _(e,t=""){return"tooltip"===e.showOverflow?"":t}export{b as IhoTableRenderHelper,x as IhoTableStatusHelper,C as IhoTableUtils,w as IhoTableWarn,N as createIhoTableClearActivedInterceptor,S as eventListener2EventName,O as eventName2EventListener,F as getColumnRenderWidth,$ as getLowCodeFieldFromField,R as getRowHeight,_ as getTitle,y as isCompatibleColumn,W as isRichContent,V as isTransformTreeType,U as parseMergeField,D as parseRichContent,A as useIhoTableFormEvent,P as useUUIDMap};
|