cnhis-design-vue 3.1.52-release.3 → 3.1.52-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/README.md +87 -87
- package/es/components/body-select/index.d.ts +14 -4
- package/es/components/body-select/src/config/index.js +1 -1
- package/es/components/body-select/src/hooks/renderCanvas.d.ts +1 -1
- package/es/components/body-select/src/hooks/renderCanvas.js +1 -1
- package/es/components/body-select/src/index.vue.d.ts +14 -4
- package/es/components/body-select/src/index.vue2.js +1 -1
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
- package/es/components/button-print/src/utils/print.d.ts +3 -3
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +45 -41
- package/es/components/classification/index.d.ts +6 -4
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +6 -4
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +6 -4
- package/es/components/classification/src/index.vue.d.ts +6 -4
- package/es/components/classification/style/index.css +1 -1
- package/es/components/expand-field/src/components/form.vue2.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/useGrid.js +1 -1
- package/es/components/fabric-chart/src/hooks/useScaleColumn.js +1 -1
- package/es/components/fabric-chart/src/interface.d.ts +2 -2
- package/es/components/form-config/index.d.ts +108 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +182 -74
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +37 -37
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +73 -37
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +12 -0
- package/es/components/form-render/index.d.ts +37 -37
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +37 -37
- package/es/components/form-render/src/components/renderer/radio&checkbox.d.ts +6 -0
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
- package/es/components/form-render/src/components/renderer/select.d.ts +7 -0
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +1 -1
- package/es/components/form-render/src/types/fieldItem.js +1 -1
- package/es/components/form-render/src/types/index.js +1 -1
- package/es/components/iho-table/index.d.ts +8 -4
- package/es/components/iho-table/src/IhoTable.vue.d.ts +8 -4
- package/es/components/iho-table/src/hooks/tapHooks/useConfigHooks.d.ts +3 -1
- package/es/components/iho-table/src/plugins/copyPastePlugin.d.ts +1 -0
- package/es/components/iho-table/src/plugins/copyPastePlugin.js +1 -0
- package/es/components/iho-table/src/plugins/forceArrowKeyPlugin.d.ts +1 -0
- package/es/components/iho-table/src/plugins/forceArrowKeyPlugin.js +1 -0
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/keyboardEventPlugin/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/editSelect.d.ts +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +2 -7
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.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 -11
- package/es/components/index.css +1 -1
- package/es/components/index.js +1 -1
- package/es/components/info-header/src/InfoHeader.vue.d.ts +75 -75
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +38 -38
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +37 -37
- package/es/components/quick-search/index.d.ts +3 -1
- package/es/components/quick-search/src/index.vue.d.ts +3 -1
- package/es/components/quick-search/src/index.vue2.js +1 -1
- package/es/components/quick-search/style/index.css +1 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/select-person/src/SearchMultiple.vue.d.ts +0 -6
- package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
- package/es/components/shortcut-setter/index.d.ts +12 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +49 -37
- package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +3 -0
- package/es/components/table-filter/index.d.ts +2 -0
- package/es/components/table-filter/index.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +0 -2
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +0 -1
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +0 -1
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +0 -2
- package/es/components/table-filter/src/components/classify-filter/hooks/useDisplayCategory.d.ts +2 -2
- package/es/components/table-filter/src/components/classify-filter/hooks/useDisplayCategory.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +6 -4
- package/es/components/table-filter/src/components/classify-filter/index.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/DateInner.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue2.js +1 -1
- package/es/components/table-filter/src/hooks/useRenderWidget.js +1 -1
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
- package/es/shared/package.json.js +1 -1
- package/es/shared/types/business.d.ts +2 -0
- package/es/shared/utils/business.d.ts +1 -1
- package/es/shared/utils/business.js +1 -1
- package/es/shared/utils/fabricjs/index.d.ts +6823 -0
- package/es/shared/utils/tapable/index.d.ts +139 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,inject as l,ref as t,computed as o,onBeforeUnmount as n,watch as a,nextTick as u,createVNode as i,toRaw as r,Fragment as d,createTextVNode as s}from"vue";import{keywordMatcher as c,arrayed as p}from"../../../../../../../shared/utils/index.js";import{NSelect as v,NTooltip as f,NIcon as m,NTag as y,NButton as h}from"naive-ui";import{HelpCircleSharp as b}from"@vicons/ionicons5";import{InjectionIhoTableUUID as w}from"../../../../constants/index.js";import{getSelectOptions as F,selectOptionsMap as g}from"../hooks/useSelectOption.js";import{useIhoTableFormEvent as S}from"../../../../utils/index.js";import{useDebounceFn as q}from"@vueuse/core";import{isEmpty as O,isFunction as $,isArray as x,isObject as C,omit as B,cloneDeep as _}from"lodash-es";var
|
|
1
|
+
import{defineComponent as e,inject as l,ref as t,computed as o,onBeforeUnmount as n,watch as a,nextTick as u,createVNode as i,toRaw as r,Fragment as d,createTextVNode as s}from"vue";import{keywordMatcher as c,arrayed as p}from"../../../../../../../shared/utils/index.js";import{NSelect as v,NTooltip as f,NIcon as m,NTag as y,NButton as h}from"naive-ui";import{HelpCircleSharp as b}from"@vicons/ionicons5";import{InjectionIhoTableUUID as w}from"../../../../constants/index.js";import{getSelectOptions as F,selectOptionsMap as g}from"../hooks/useSelectOption.js";import{useIhoTableFormEvent as S}from"../../../../utils/index.js";import{useDebounceFn as q}from"@vueuse/core";import{isEmpty as O,isFunction as $,isArray as x,isObject as C,omit as B,cloneDeep as _,xor as j,uniq as k}from"lodash-es";var P=e({name:"EditSelect",props:{value:{type:[Array,String,Number]},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0},options:{type:Array,default:()=>[]},queryOptions:{type:Function},placeholder:{type:String,default:"请选择"},allowCreate:{type:Boolean,default:!1},shouldSave:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},aliasField:{type:String},menuProps:{type:Object},multiple:{type:Boolean,default:!1},deletable:{type:Boolean,default:!0},selectAll:{type:Boolean,default:!0}},emits:["update:value"],setup(e,{emit:P}){const M=l("$xetable"),W=t(null);function A(e){W.value=e}const D=t(!1),{emitFormChangeWithParams:E}=S({...e,$table:M}),R=t("");function T(){return z()}const I=t([]),U=o((()=>{let l=O(I.value)?e.options:I.value;return R.value?(l=l.filter((l=>l[e.labelField]&&l[e.labelField].includes(R.value)||c(R.value,l.keyword))),!e.allowCreate||l.some((l=>l[e.labelField]===R.value))?l:[...l,{[e.labelField]:R.value,[e.valueField]:R.value,created:!0,shouldSave:e.shouldSave}]):l})),V=t(!1),z=q((async function(l=""){R.value=l;try{if(V.value=!0,!$(e.queryOptions)||!O(e.options))return;I.value=await e.queryOptions({keyword:l,row:e.row,column:e.column,rowIndex:e.rowIndex})}catch(l){console.log(`获取${e.column.field}options错误`)}finally{V.value=!1}}),400),K=l(w);function N(l=!1){e.multiple&&u((()=>{var t,o,n;const{refTableLeftBody:a,refTableBody:u}=M.getRefMaps(),i=null==(t=null==a?void 0:a.value)?void 0:t.$el;if(!i)return;const r=null==(o=null==u?void 0:u.value)?void 0:o.$el,d=M.getRowid(e.row),s=null==(n=r.querySelector(`.vxe-body--row[rowid="${d}"]`))?void 0:n.clientHeight,c=i.querySelector(`.vxe-body--row[rowid="${d}"]`),p=l?"unset":s+"px";c.style.height=p}))}function H(l,t){var o,n;const a=e.value;P("update:value",l);const u=F(K,e.column.field,e.row,M);K&&x(u)&&p(t).forEach((e=>{if(!C(e))return;const l=e;l.created&&l.shouldSave&&u.push(B(r(l),["created","shouldSave"]))}));const i=null==(o=e.column.editRender)?void 0:o.props;if(K&&(null==i?void 0:i.connectField)){const t=null==(n=i.connectField)?void 0:n.split(","),o=g.get(K);t.forEach((async t=>{var n;const{tableColumn:a}=M.reactData,u=a.find((e=>e.field===t)),i=null==(n=null==u?void 0:u.editRender)?void 0:n.props;if(null==i?void 0:i.queryOptions){const n=l?`${t}__${e.column.field}-${l}`:t;if(o[n])return;const a=await i.queryOptions({row:e.row,column:u,isFullData:!0,connectColumn:e.column});o[n]=a}}))}E({oldValue:a,option:_(t)}),N()}function L(e){var l,t;"Tab"===e.key&&W.value&&(null==(t=(l=W.value).handleKeydown)||t.call(l,{...e,key:"Enter",preventDefault:e.preventDefault.bind(e)}))}function G(l){const t=l?U.value.map((l=>l[e.valueField])):[],o=x(e.value)?e.value:[],n=j(t,o),a=l?k(o.concat(n)):[];if(o.length===a.length)return;P("update:value",a);const u=F(K,e.column.field,e.row,M);E({oldValue:o,option:l?u.filter((l=>a.includes(l[e.valueField]))):[]})}function J({node:e,option:l}){return l.desc?i("div",{class:"iho-table__selectOptionWrapper"},[[e,i(f,null,{trigger:()=>i(m,{component:b},null),default:()=>l.desc})]]):e}function Q({option:l,handleClose:t}){var o;const n=null!=(o=e.aliasField&&l[e.aliasField])?o:l[e.labelField];return x(e.value)?e.deletable?i(y,{closable:!0,onClose:e=>{e.stopPropagation(),t()}},{default:()=>n}):`${n} ;`:i(d,null,[n])}function X(){return i(d,null,[i(h,{quaternary:!0,type:"primary",size:"tiny",onClick:()=>G(!0)},{default:()=>[s("全选")]}),i(h,{quaternary:!0,type:"primary",size:"tiny",onClick:()=>G(!1)},{default:()=>[s("清空")]})])}n((()=>{N(!0)})),a((()=>D.value),(e=>{N()}),{immediate:!0});const Y=()=>({class:"iho-table__selectOption"}),Z=o((()=>{var l,t;return{...e.menuProps,class:`iho-table__selectMenu ${null!=(t=null==(l=e.menuProps)?void 0:l.class)?t:""}`}}));return()=>{const l={};return e.multiple&&e.selectAll&&(l.action=X),i(v,{ref:A,show:D.value,"onUpdate:show":e=>D.value=e,consistentMenuWidth:e.consistentMenuWidth,placeholder:e.placeholder,labelField:e.labelField,valueField:e.valueField,loading:V.value,options:U.value,multiple:e.multiple,value:e.value,remote:!0,onSearch:z,clearable:!0,filterable:!0,nodeProps:Y,menuProps:Z.value,renderTag:Q,renderOption:J,onUpdateShow:T,onUpdateValue:H,onKeydown:L},l)}}});export{P as default};
|
|
@@ -4,7 +4,6 @@ import { AnyObject } from '../../../../../../../../es/shared/types';
|
|
|
4
4
|
declare const _default: import("vue").DefineComponent<{
|
|
5
5
|
formattedValue: {
|
|
6
6
|
type: StringConstructor;
|
|
7
|
-
default: undefined;
|
|
8
7
|
};
|
|
9
8
|
column: {
|
|
10
9
|
type: PropType<VxeTableDefines.ColumnInfo>;
|
|
@@ -23,7 +22,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
23
22
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
24
23
|
formattedValue: {
|
|
25
24
|
type: StringConstructor;
|
|
26
|
-
default: undefined;
|
|
27
25
|
};
|
|
28
26
|
column: {
|
|
29
27
|
type: PropType<VxeTableDefines.ColumnInfo>;
|
|
@@ -49,7 +47,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
49
47
|
timePickerRef: import("vue").Ref<any>;
|
|
50
48
|
inputValue: import("vue").Ref<any>;
|
|
51
49
|
__formattedValue: import("vue").Ref<any>;
|
|
52
|
-
oldValue:
|
|
50
|
+
oldValue: any;
|
|
53
51
|
placeholder: any;
|
|
54
52
|
valueFormat: any;
|
|
55
53
|
shortcutOptions: any;
|
|
@@ -76,7 +74,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
76
74
|
}, 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<{
|
|
77
75
|
formattedValue: {
|
|
78
76
|
type: StringConstructor;
|
|
79
|
-
default: undefined;
|
|
80
77
|
};
|
|
81
78
|
column: {
|
|
82
79
|
type: PropType<VxeTableDefines.ColumnInfo>;
|
|
@@ -93,7 +90,5 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
93
90
|
}>> & {
|
|
94
91
|
onClick?: ((...args: any[]) => any) | undefined;
|
|
95
92
|
"onUpdate:formattedValue"?: ((...args: any[]) => any) | undefined;
|
|
96
|
-
}, {
|
|
97
|
-
formattedValue: string;
|
|
98
|
-
}>;
|
|
93
|
+
}, {}>;
|
|
99
94
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as l,inject as t,ref as a,watch as r,nextTick as o,openBlock as u,createBlock as i,unref as n,
|
|
1
|
+
import{defineComponent as e,useAttrs as l,inject as t,ref as a,watch as r,nextTick as o,openBlock as u,createBlock as i,unref as n,withCtx as m,createVNode as c,mergeProps as v,createElementBlock as d,Fragment as f,renderList as s,createTextVNode as p,toDisplayString as k,createCommentVNode as y}from"vue";import{NPopover as _,NInput as h,NSpace as w,NScrollbar as b,NButton as g}from"naive-ui";import{useIhoTableFormEvent as V}from"../../../../utils/index.js";import C from"../../../../../../time-picker/index.js";import{parse as F,isValid as q,format as x}from"date-fns";var j=e({__name:"editTime",props:{formattedValue:{type:String},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0}},emits:["update:formattedValue","click"],setup(e,{emit:j}){const $=e,I=l(),O=t("$xetable"),{emitFormChangeWithParams:P}=V({...$,$table:O}),R=a(null),S=a(!1),A=a(),E=a(),H=a();let U=$.formattedValue;const{placeholder:z="请选择",valueFormat:D="HH:mm",shortcutOptions:K=[]}=I,M={placeholder:z,valueFormat:D,format:D};function N(e){if(H.value=e,U===e)return;const l=e||null;j("update:formattedValue",l),P({oldValue:U}),U=l}function T(){[M.valueFormat.replace(/:/,""),M.valueFormat].some((e=>{const l=F(E.value,e,new Date);if(!E.value||q(l)){return N(E.value?x(l,M.valueFormat):""),!0}return!1}))}function W(e){var l;const{key:t}=e;"Enter"===t&&(null==(l=R.value)||l.blur(),S.value=!1)}return r((()=>$.formattedValue),(e=>{E.value=e,H.value=e}),{immediate:!0}),r((()=>S.value),(async e=>{var l,t,a,r,u;e&&(await o(),null==(u=null==(r=null==(a=null==(t=null==(l=A.value)?void 0:l.$timePicker)?void 0:t.panelInstRef)?void 0:a.$el)?void 0:r.querySelectorAll(".n-time-picker-col"))||u.forEach((e=>{var l,t;return null==(t=null==(l=null==e?void 0:e.querySelector)?void 0:l.call(e,".n-time-picker-col__item--active"))?void 0:t.scrollIntoView()})))})),(e,l)=>(u(),i(n(_),{show:S.value,trigger:"click",showArrow:!1,placement:"bottom-start",style:{padding:"0"},onClickoutside:l[3]||(l[3]=()=>S.value=!1)},{trigger:m((()=>[c(n(h),{ref_key:"formRef",ref:R,clearable:"",value:E.value,"onUpdate:value":l[0]||(l[0]=e=>E.value=e),valueModifiers:{trim:!0},onClick:l[1]||(l[1]=()=>S.value=!0),onChange:T,onKeydown:W},null,8,["value"])])),default:m((()=>[c(n(w),null,{default:m((()=>[c(n(C),v({ref_key:"timePickerRef",ref:A,show:"","formatted-value":H.value},n(M),{class:"iho-table__time-picker",to:!1,"onUpdate:formattedValue":N,onConfirm:l[2]||(l[2]=()=>S.value=!1)}),null,16,["formatted-value"]),c(n(b),{class:"iho-table__scrollbar"},{default:m((()=>[n(K).length?(u(),i(n(w),{key:0,vertical:"",wrap:!1},{default:m((()=>[(u(!0),d(f,null,s(n(K),(e=>(u(),i(n(g),{size:"tiny",key:e,onClick:l=>function(e){N(e),S.value=!1}(e)},{default:m((()=>[p(k(e),1)])),_:2},1032,["onClick"])))),128))])),_:1})):y("v-if",!0)])),_:1})])),_:1})])),_:1},8,["show"]))}});export{j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createVNode as e,mergeProps as o}from"vue";import{format as t}from"date-fns";import{isFunction as r}from"lodash-es";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as n}from"../../../../constants/index.js";import{useAutoFocus as i}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as l,IhoTableRenderHelper as d,getLowCodeFieldFromField as m,isInvalidTime as u}from"../../../../utils/index.js";import a from"./editTime.vue.js";import{defineTablePlugin as f}from"../../../../hooks/useTablePlugin.js";function s(){const s="timeRendererPlugin";return f({name:s,vxe(t){t.interceptor.add("event.clearActived",l(n.TIME,(e=>e.classList.contains("n-popover")))),t.renderer.add(n.TIME,{renderCell:d.createDefaultRenderCell(),renderEdit:d.createRenderEdit((({fieldItem:t,emitFormClick:r,row:n,column:i,$rowIndex:l})=>[e(a,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){i(e).bindAutoFocusConfig(s,n.TIME,".n-input__input-el",{after:e=>(Reflect.set(e.editRender,"autoselect",!0),e)}),e.eventHooks.onCellDblclick.tap(s,(({row:e,column:o,columnIndex:i,rowIndex:l},
|
|
1
|
+
import{createVNode as e,mergeProps as o}from"vue";import{format as t}from"date-fns";import{isFunction as r}from"lodash-es";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as n}from"../../../../constants/index.js";import{useAutoFocus as i}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as l,IhoTableRenderHelper as d,getLowCodeFieldFromField as m,isInvalidTime as u}from"../../../../utils/index.js";import a from"./editTime.vue.js";import{defineTablePlugin as f}from"../../../../hooks/useTablePlugin.js";function s(){const s="timeRendererPlugin";return f({name:s,vxe(t){t.interceptor.add("event.clearActived",l(n.TIME,(e=>e.classList.contains("n-popover")))),t.renderer.add(n.TIME,{renderCell:d.createDefaultRenderCell(),renderEdit:d.createRenderEdit((({fieldItem:t,emitFormClick:r,row:n,column:i,$rowIndex:l})=>[e(a,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){i(e).bindAutoFocusConfig(s,n.TIME,".n-input__input-el",{after:e=>(Reflect.set(e.editRender,"autoselect",!0),e)}),e.eventHooks.onCellDblclick.tap(s,(({row:e,column:o,columnIndex:i,rowIndex:l,$rowIndex:d},a,{$table:f,emits:s})=>{var c,p,v,x;if((null==(c=o.editRender)?void 0:c.name)!==n.TIME||e[o.field])return;if(r(null==(p=a.editConfig)?void 0:p.beforeEditMethod)){if(!(null==(v=a.editConfig)?void 0:v.beforeEditMethod({row:e,column:o,columnIndex:i,rowIndex:l,$table:f,$grid:f})))return}const w=t(new Date,(null==(x=m(o))?void 0:x.valueFormat)||"HH:mm");if(u(o,w))return;const I=e[o.field];e[o.field]=w,s("formChange",{oldValue:I,index:l>-1?l:d,value:e[o.field],row:e,column:o,$table:f})}))}})}export{s as timeRendererPlugin};
|
|
@@ -18,36 +18,40 @@ export declare type IhoTableConfig = VxeTableProps & Partial<{
|
|
|
18
18
|
isTree: MaybeString<0 | 1 | 2 | 3>;
|
|
19
19
|
isBatchSelect: MaybeString<0 | 1>;
|
|
20
20
|
isSingleSelect: MaybeString<0 | 1>;
|
|
21
|
-
|
|
21
|
+
selectType: Exclude<VxeTableDefines.ColumnInfo['type'], 'seq' | 'expand' | 'html'>;
|
|
22
|
+
rowDraggable: boolean;
|
|
22
23
|
showSeq: boolean;
|
|
23
24
|
forceClearable: boolean;
|
|
24
|
-
|
|
25
|
+
hideSettingBtn: MaybeString<0 | 1>;
|
|
25
26
|
rowGroupSetting: Partial<Record<TupleToUnion<typeof IhoTableRowGroupSequence>, IhoTableRowGroupItem[]>>;
|
|
26
27
|
anchorList: Array<{
|
|
27
28
|
name?: string;
|
|
28
29
|
field: string;
|
|
29
30
|
} | string>;
|
|
30
|
-
rowConfig: Partial<VxeTableProps['rowConfig'] & {
|
|
31
|
-
clickToCancel: boolean;
|
|
32
|
-
}>;
|
|
33
31
|
columnConfig: {
|
|
34
32
|
seqSlotFn: VxeColumnPropTypes.Slots['default'];
|
|
35
33
|
};
|
|
34
|
+
sortableConfig: Partial<{
|
|
35
|
+
enable: boolean;
|
|
36
|
+
usePreset: boolean;
|
|
37
|
+
[K: string]: any;
|
|
38
|
+
}>;
|
|
39
|
+
operationForm: FormOperationalConfig[];
|
|
36
40
|
checkboxConfig: Partial<VxeTableProps['checkboxConfig'] & {
|
|
37
41
|
slots: VxeColumnPropTypes.Slots;
|
|
38
42
|
maxCheckSize: number;
|
|
39
43
|
disableHeader: boolean;
|
|
40
44
|
useNCheckbox: boolean;
|
|
41
45
|
}>;
|
|
46
|
+
rowConfig: Partial<VxeTableProps['rowConfig'] & {
|
|
47
|
+
clickToCancel: boolean;
|
|
48
|
+
}>;
|
|
49
|
+
keyboardConfig: Partial<VxeTableProps['keyboardConfig'] & {
|
|
50
|
+
forceArrowKey: boolean;
|
|
51
|
+
}>;
|
|
42
52
|
radioConfig: Partial<VxeTableProps['radioConfig'] & {
|
|
43
53
|
slots: VxeColumnPropTypes.Slots;
|
|
44
54
|
}>;
|
|
45
|
-
sortableConfig: Partial<{
|
|
46
|
-
enable: boolean;
|
|
47
|
-
usePreset: boolean;
|
|
48
|
-
[K: string]: any;
|
|
49
|
-
}>;
|
|
50
|
-
operationForm: FormOperationalConfig[];
|
|
51
55
|
[K: string]: unknown;
|
|
52
56
|
}>;
|
|
53
57
|
export declare type IhoTableFieldItem = {
|