cnhis-design-vue 3.1.52-beta.2 → 3.1.52-beta.21
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 +47 -0
- package/es/components/body-select/index.js +1 -0
- package/es/components/body-select/src/config/index.d.ts +101 -0
- package/es/components/body-select/src/config/index.js +1 -0
- package/es/components/body-select/src/hooks/renderCanvas.d.ts +6 -0
- package/es/components/body-select/src/hooks/renderCanvas.js +1 -0
- package/es/components/body-select/src/index.vue.d.ts +48 -0
- package/es/components/body-select/src/index.vue.js +1 -0
- package/es/components/body-select/src/index.vue2.js +1 -0
- package/es/components/body-select/style/index.css +1 -0
- package/es/components/callback/src/components/render/popupMaps.d.ts +37 -37
- package/es/components/classification/index.d.ts +76 -6
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +76 -6
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +76 -6
- package/es/components/classification/src/index.vue.d.ts +76 -6
- package/es/components/date-picker/index.d.ts +38 -3
- package/es/components/date-picker/src/DatePicker.vue.d.ts +38 -3
- package/es/components/date-picker/src/DatePicker.vue2.js +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/useScaleColumn.js +1 -1
- package/es/components/fabric-chart/src/interface.d.ts +2 -2
- package/es/components/form-config/index.d.ts +9 -2
- package/es/components/form-config/src/FormConfig.vue.d.ts +81 -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 +40 -37
- package/es/components/form-config/src/hooks/useConfigurationField.js +1 -1
- 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/FormRender.vue.d.ts +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +37 -37
- package/es/components/form-render/src/components/renderer/date.d.ts +25 -0
- package/es/components/form-render/src/components/renderer/date.js +1 -1
- package/es/components/form-render/src/components/renderer/formItem.js +1 -1
- package/es/components/form-render/src/components/renderer/levelSearchCascader.js +1 -1
- package/es/components/form-render/src/components/renderer/radio&checkbox.d.ts +18 -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/useComplexOptions.d.ts +2 -1
- 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 +2 -2
- package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +2 -1
- package/es/components/form-render/src/types/fieldItem.js +1 -1
- package/es/components/form-render/src/types/index.d.ts +2 -2
- package/es/components/form-render/src/types/index.js +1 -1
- package/es/components/form-render/style/index.css +1 -1
- package/es/components/iho-table/index.js +1 -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/defaultValuePlugin.js +1 -1
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +38 -3
- 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/editDate.vue.d.ts +38 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue2.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 +1 -1
- package/es/components/iho-table/src/utils/index.d.ts +2 -0
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +1 -1
- package/es/components/info-header/index.d.ts +2 -2
- 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/keyboard/src/Keyboard.vue2.js +1 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-map.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
- package/es/components/scale-view/style/index.css +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
- package/es/components/select-person/src/SearchOrgAndStaff.vue2.js +1 -1
- package/es/components/shortcut-setter/index.d.ts +2 -1
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +38 -37
- package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +0 -3
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +76 -6
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +38 -3
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +38 -3
- package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +76 -6
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +76 -6
- package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +38 -3
- package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +38 -3
- package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +38 -3
- package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +38 -3
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +152 -12
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +152 -12
- package/es/components/time-picker/src/TimePicker.vue2.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/InputNumberSlash/InputNumberSlash.d.ts +9 -0
- package/es/shared/components/InputNumberSlash/InputNumberSlash.js +1 -1
- package/es/shared/hooks/useDateTime.d.ts +8 -2
- package/es/shared/hooks/useDateTime.js +1 -1
- package/es/shared/package.json.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/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/fabricjs/index.d.ts +0 -6823
- package/es/shared/utils/tapable/index.d.ts +0 -139
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{promiseTimeout as e}from"@vueuse/shared";import"../../../index.js";import{defineTablePlugin as o}from"../../hooks/useTablePlugin.js";function t(){const t="keyboardEventPlugin";return o({name:t,apply(o){o.eventHooks.onKeydown.tap(t,(async({$event:o,$table:t},n,{emits:r})=>{await e(0);const{row:a,column:i}=t.getSelectedCell()||t.getEditRecord()||{};if(!a||!i)return;r("keyboard",{$table:t,key:o.key,index:t.getRowIndex(a),value:a[i.field],row:a,column:i})}))}})}export{t as keyboardEventPlugin};
|
|
@@ -76,6 +76,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
76
76
|
onConfirm: {
|
|
77
77
|
type: FunctionConstructor;
|
|
78
78
|
};
|
|
79
|
+
formattedValue: {
|
|
80
|
+
type: StringConstructor;
|
|
81
|
+
};
|
|
82
|
+
placeholder: {
|
|
83
|
+
type: StringConstructor;
|
|
84
|
+
};
|
|
85
|
+
allowedInvalidValue: {
|
|
86
|
+
type: StringConstructor;
|
|
87
|
+
};
|
|
79
88
|
}, {
|
|
80
89
|
attrs: {
|
|
81
90
|
[x: string]: unknown;
|
|
@@ -87,9 +96,23 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
87
96
|
onConfirm: {
|
|
88
97
|
type: FunctionConstructor;
|
|
89
98
|
};
|
|
90
|
-
|
|
99
|
+
formattedValue: {
|
|
100
|
+
type: StringConstructor;
|
|
101
|
+
};
|
|
102
|
+
placeholder: {
|
|
103
|
+
type: StringConstructor;
|
|
104
|
+
};
|
|
105
|
+
allowedInvalidValue: {
|
|
106
|
+
type: StringConstructor;
|
|
107
|
+
};
|
|
108
|
+
}>> & {
|
|
109
|
+
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
|
110
|
+
}>>;
|
|
111
|
+
emit: (event: "update:formatted-value", ...args: any[]) => void;
|
|
91
112
|
datePickerRef: import("vue").Ref<AnyObject | null>;
|
|
92
113
|
panelInstRef: import("vue").Ref<null>;
|
|
114
|
+
placeholderRef: import("vue").Ref<any>;
|
|
115
|
+
currentFormattedValue: import("vue").WritableComputedRef<string | null | undefined>;
|
|
93
116
|
isDateTime: import("vue").ComputedRef<boolean>;
|
|
94
117
|
formatRef: import("vue").ComputedRef<string>;
|
|
95
118
|
panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
|
|
@@ -98,15 +121,27 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
98
121
|
handleConfirm: (target: HTMLInputElement) => void;
|
|
99
122
|
onUpdateShow: (show: boolean) => void;
|
|
100
123
|
onConfirm: (...args: any[]) => Promise<void>;
|
|
124
|
+
isAllowedInvalidValue: (value?: string) => boolean | "" | undefined;
|
|
101
125
|
NDatePicker: any;
|
|
102
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
126
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:formatted-value"[], "update:formatted-value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
103
127
|
updateUnchangedValue: {
|
|
104
128
|
type: BooleanConstructor;
|
|
105
129
|
};
|
|
106
130
|
onConfirm: {
|
|
107
131
|
type: FunctionConstructor;
|
|
108
132
|
};
|
|
109
|
-
|
|
133
|
+
formattedValue: {
|
|
134
|
+
type: StringConstructor;
|
|
135
|
+
};
|
|
136
|
+
placeholder: {
|
|
137
|
+
type: StringConstructor;
|
|
138
|
+
};
|
|
139
|
+
allowedInvalidValue: {
|
|
140
|
+
type: StringConstructor;
|
|
141
|
+
};
|
|
142
|
+
}>> & {
|
|
143
|
+
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
|
144
|
+
}, {
|
|
110
145
|
updateUnchangedValue: boolean;
|
|
111
146
|
}>>;
|
|
112
147
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as t,inject as r,ref as i,computed as a,onMounted as l,openBlock as o,createBlock as n,unref as u,mergeProps as s,isRef as d}from"vue";import{generateTimeFormat as m}from"../../../../../../../shared/utils/index.js";import{isFunction as p}from"lodash-es";import{useIhoTableFormEvent as c}from"../../../../utils/index.js";import
|
|
1
|
+
import{defineComponent as e,useAttrs as t,inject as r,ref as i,computed as a,onMounted as l,openBlock as o,createBlock as n,unref as u,mergeProps as s,isRef as d}from"vue";import{generateTimeFormat as m}from"../../../../../../../shared/utils/index.js";import{isFunction as p}from"lodash-es";import{useIhoTableFormEvent as c}from"../../../../utils/index.js";import v from"../../../../../../date-picker/index.js";var f=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:f}){const w=e,D=t(),b=r("$xetable"),{emitFormChangeWithParams:y}=c({...w,$table:b}),g=i(),$=a({get:()=>w.value,set(e){const t=w.value;t!==e&&(f("update:value",e),y({oldValue:t}))}}),T=a((()=>{const e=D.valueFormat||"yyyy-MM-dd HH:mm:ss";return{valueFormat:e,format:e,timePickerProps:{format:m(e)}}})),{isStartDate:h=!1,isEndDate:x=!1}=D,j=D.connectField||"",S=(e,t)=>h&&j?e>t:!(!x||!j)&&e<t,k=e=>{const t=new Date(w.row[j]),r=new Date(e),{h:i,m:a,s:l}=H(t),o=(e,t,r,i)=>!(x&&r>i)&&(!(h&&r<i)&&S(e,t));return{isHourDisabled:t=>{if(!w.row[j])return!1;const a=new Date(`${w.row[j].split(" ")[0]} 00:00:00`).getTime(),{m:l,s:n}=H(r);return o(t,i,e-60*t*60*1e3-60*l*1e3-1e3*n,a)},isMinuteDisabled:t=>{if(!w.row[j])return!1;const l=new Date(`${w.row[j].split(" ")[0]} ${i}:00:00`).getTime(),{s:n}=H(r);return o(t,a,e-60*t*1e3-1e3*n,l)},isSecondDisabled:t=>{if(!w.row[j])return!1;const r=new Date(`${w.row[j].split(" ")[0]} ${i}:${a}:00`).getTime();return o(t,l,e-1e3*t,r)}}},q={type:D.type||"datetime",clearable:!0,allowedInvalidValue:"-",...D,...T.value,isDateDisabled:F(D.isDateDisabled)||(e=>!!w.row[j]&&S(e,x?new Date(`${w.row[j].split(" ")[0]} 00:00:00`).getTime():new Date(w.row[j]).getTime()))};function F(e){return p(e)?t=>e(t,w.row):null}function H(e){return{h:e.getHours(),m:e.getMinutes(),s:e.getSeconds()}}return q.type.includes("time")&&(q.isTimeDisabled=F(D.isTimeDisabled)||k),l((()=>{var e,t,r,i,a,l,o;return null==(o=null==(a=null==(r=null==(t=null==(e=g.value)?void 0:e.$datePicker)?void 0:t.inputInstRef)?void 0:(i=r.$el).querySelector)?void 0:(l=a.call(i,"input")).select)?void 0:o.call(l)})),(e,t)=>(o(),n(u(v),s({ref_key:"formRef",ref:g},u(q),{"formatted-value":u($),"onUpdate:formatted-value":t[0]||(t[0]=e=>d($)?$.value=e:null)}),null,16,["formatted-value"]))}});export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createVNode as e,mergeProps as
|
|
1
|
+
import{createVNode as e,mergeProps as o}from"vue";import{format as t}from"date-fns";import{isFunction as n}from"lodash-es";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as r}from"../../../../constants/index.js";import{createIhoTableClearActivedInterceptor as i,IhoTableRenderHelper as d,isInvalidDate as l,getLowCodeFieldFromField as a}from"../../../../utils/index.js";import m from"./editDate.vue.js";import{defineTablePlugin as s}from"../../../../hooks/useTablePlugin.js";function u(){const u="dateRendererPlugin";return s({name:u,vxe(t){t.interceptor.add("event.clearActived",i(r.DATE,(e=>e.classList.contains("n-date-panel")))),t.renderer.add(r.DATE,{renderCell:d.createDefaultRenderCell(),renderEdit:d.createRenderEdit((({fieldItem:t,emitFormClick:n,row:r,column:i,$rowIndex:d})=>[e(m,o({value:r[i.field],"onUpdate:value":e=>r[i.field]=e,isStartDate:t.isStartDate,isEndDate:t.isEndDate,connectField:t.connectField,valueFormat:t.valueFormat},t.componentProps,{column:i,row:r,"row-index":d,onClick:n}),null)]))})},apply(e){e.eventHooks.onCellDblclick.tap(u,(({row:e,column:o,columnIndex:i,rowIndex:d},m,{$table:s})=>{var u,c,f,p;if((null==(u=o.editRender)?void 0:u.name)!==r.DATE||e[o.field])return;if(n(null==(c=m.editConfig)?void 0:c.beforeEditMethod)){if(!(null==(f=m.editConfig)?void 0:f.beforeEditMethod({row:e,column:o,columnIndex:i,rowIndex:d,$table:s,$grid:s})))return}const v=new Date;l(o,e,v)||(e[o.field]=t(v,(null==(p=a(o))?void 0:p.valueFormat)||"yyyy-MM-dd HH:mm:ss"))}))}})}export{u as dateRendererPlugin};
|
|
@@ -141,9 +141,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
141
141
|
valueField: string;
|
|
142
142
|
placeholder: string;
|
|
143
143
|
deletable: boolean;
|
|
144
|
+
selectAll: boolean;
|
|
144
145
|
shouldSave: boolean;
|
|
145
146
|
consistentMenuWidth: boolean;
|
|
146
147
|
allowCreate: boolean;
|
|
147
|
-
selectAll: boolean;
|
|
148
148
|
}>;
|
|
149
149
|
export default _default;
|
|
@@ -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"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as
|
|
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},d,{$table:a})=>{var f,s,c,p;if((null==(f=o.editRender)?void 0:f.name)!==n.TIME||e[o.field])return;if(r(null==(s=d.editConfig)?void 0:s.beforeEditMethod)){if(!(null==(c=d.editConfig)?void 0:c.beforeEditMethod({row:e,column:o,columnIndex:i,rowIndex:l,$table:a,$grid:a})))return}const v=t(new Date,(null==(p=m(o))?void 0:p.valueFormat)||"HH:mm");u(o,v)||(e[o.field]=v)}))}})}export{s as timeRendererPlugin};
|
|
@@ -55,3 +55,5 @@ export declare function parseRichContent(richContent: string): any;
|
|
|
55
55
|
export declare function parseMergeField(row: AnyObject, column: VxeTableDefines.ColumnInfo): any;
|
|
56
56
|
export declare function isCompatibleColumn(field: LowCodeTableFieldItem): number | false;
|
|
57
57
|
export declare function getTitle(column: VxeTableDefines.ColumnInfo, value?: string): string;
|
|
58
|
+
export declare function isInvalidTime(column: VxeTableDefines.ColumnInfo, newValue: MaybeRef<any>): boolean;
|
|
59
|
+
export declare function isInvalidDate(column: VxeTableDefines.ColumnInfo, row: AnyObject, newValue: MaybeRef<any>): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,inject as
|
|
1
|
+
import{reactive as e,inject as n,unref as t,toRaw as r,createVNode as o}from"vue";import{jsonParse as i,arrayed as l,findAncestor as u}from"../../../../shared/utils/index.js";import{promiseTimeout as a}from"@vueuse/shared";import{parse as c,isValid as d,compareDesc as s}from"date-fns";import{isNumber as f,isFunction as p,isString as m,isObject as v,isArray as I}from"lodash-es";import{InjectionIhoTableConfig as g,InjectionIhoTableEmits as h,IHO_TABLE_STRING_STATUS as E,IHO_TABLE_NUMBER_STATUS as w,IHO_TABLE_TREE_TYPE as T,InjectionIhoTableUUID as R}from"../constants/index.js";import{getSeparateInfo as S}from"./separateMap.js";export{deleteSeparateInfo,getSeparateInfo,setSeparateInfo}from"./separateMap.js";function C(e){return console.warn(`[IhoTable]: ${e}`)}const F=Object.freeze({getCellType(e){var n;return((null==(n=e.settingObj)?void 0:n.attr)||e.formType||"DEFAULT").toUpperCase()}});function D(){var e,t,r;const o=n(g);return o||C("this function(getRowHeight) only can be used in setup environment"),null!=(r=null==(t=null==(e=null==o?void 0:o.value)?void 0:e.rowConfig)?void 0:t.height)?r:32}function O(e){const n=e.slice(2);return`${n[0].toLowerCase()}${n.slice(1)}`}function P(e){return`on${e[0].toUpperCase()}${e.slice(1)}`}function A(n,t=!0){const r=t?e(new Map):new Map;return{getItemFromUUID:function(e){return r.set(e,r.get(e)||n()).get(e)},setItemFromUUID:function(e,n){r.set(e,n)},removeItemFromUUID:function(e){r.delete(e)}}}async function $(e,n,r,o){const i=l();return f(i)||await a(0),l()||function(){const n=+e.colWidth;return f(n)?n:64}();function l(){var i;const l=null==(i=t(o))?void 0:i.getColumnByField(e.field);if(!l)return;const u=x(l);return u?p(u.separateWidth)?u.separateWidth({column:l,row:n,rowIndex:r,$table:t(o)}):f(u.separateWidth)?u.separateWidth:l.renderWidth:l.renderWidth}}function b(e){const o=n(h);function i(){var n;const r=t(e);return{$table:r.$table,value:r.row[r.column.field],row:r.row,column:{...r.column,...null==(n=r.column.editRender)?void 0:n.props},index:r.rowIndex>-1?r.rowIndex:r.$rowIndex}}function l(e={}){o("formChange",{...i(),...r(e)})}function u(e={}){o("formClick",{...i(),...r(e)})}return{emitFormChange:function(){l()},emitFormClick:function(){u()},emitFormChangeWithParams:l,emitFormClickWithParams:u}}function x(e){var n;return null==(n=e.editRender)?void 0:n.props}const N=Object.freeze({createDefaultRenderCell:function(){return function({props:e},{row:t,column:r}){if("bottom"!==(null==e?void 0:e.separatePlacement))return c(t[r.field]);const i=n(R),l=S(i,t);if(!l)return c(t[r.field]);const{originalData:u=t,isLastRow:a}=l;return c(a?u[r.field]:null);function c(e){return[o("span",{title:G(r,e)},[e])]}}},createRenderEdit:function(e){return function({props:n},t){return e({...t,fieldItem:n||{},...b(t)})}},isEditableColumn(e,n){var t;return!1!==(null==(t=e.editConfig)?void 0:t.showIcon)&&n.editRender&&!1!==n.editRender.enabled},hasFilter(e){if(M(e))return!0;let n=e.fieldSetting;return m(n)&&(n=i(n||"")),v(n)&&((t=n).notParticipatingSearch!==E.POSITIVE&&"manual"===(null==(r=t.mapping)?void 0:r.type));var t,r},hasDateFiler(e){var n;return null==(n=null==e?void 0:e.filterSetting)?void 0:n.daterange}}),V=Object.freeze({isPositive:e=>e===w.POSITIVE||e===E.POSITIVE,isNegative:e=>e===w.NEGATIVE||e===E.NEGATIVE,notPositive:e=>e!==w.POSITIVE&&e!==E.POSITIVE,notNegative:e=>e!==w.NEGATIVE&&e!==E.NEGATIVE}),W=(e,n)=>({$event:t,column:r})=>{var o;if(!l(e).includes(null==(o=r.editRender)?void 0:o.name))return!0;const i=null==t?void 0:t.target;return!v(i)||!u(i,n)};function U(e){return[T.TRANSFORM_WITH_SPAN_METHOD,T.TRANSFORM_TREE_TYPE].includes(`${e.isTree}`)}function j(e){return m(e)&&!!e.match(/^###\{[^{}]+}$/)}function y(e){try{return JSON.parse(e.replace(/^###/,""))}catch(e){return{}}}function _(e,n){if(e.$__SEPARATE||!n.editRender||!n.editRender.props)return e[n.field];const{fieldSetting:t}=n.editRender.props;if(!m(t))return e[n.field];const{mergedFeildExpression:r}=i(t);return r&&m(r)?r.replace(/#{(.+?)}/g,(function(n,t){let r=t?e[t.trim()]:null;j(r)&&(r=y(r).change_text);return r||(null==r?"--":r)})):e[n.field]}const H=["SEARCH","SELECT","RADIO","CHECKBOX"];function M(e){return e.notParticipatingSearch===w.NEGATIVE&&H.includes(F.getCellType(e))&&I(e.options)&&e.options.length}function G(e,n=""){return"tooltip"===e.showOverflow?"":n}function L(e,n){var r,o,i;n=t(n)||"";const l=null!=(o=null==(r=e.editRender)?void 0:r.props)?o:{},u=c(n,(null==(i=null==l?void 0:l.componentProps)?void 0:i.valueFormat)||"HH:mm",new Date);return!d(u)}function k(e,n,r){var o,i;const l=null!=(i=null==(o=e.editRender)?void 0:o.props)?i:{};return r=t(r)||"",!d(new Date(r))||m(l.connectField)&&n[l.connectField]&&(l.isStartDate&&s(new Date(r),new Date(n[l.connectField]))<0||l.isEndDate&&s(new Date(r),new Date(n[l.connectField]))>0)}export{N as IhoTableRenderHelper,V as IhoTableStatusHelper,F as IhoTableUtils,C as IhoTableWarn,W as createIhoTableClearActivedInterceptor,O as eventListener2EventName,P as eventName2EventListener,$ as getColumnRenderWidth,x as getLowCodeFieldFromField,D as getRowHeight,G as getTitle,M as isCompatibleColumn,k as isInvalidDate,L as isInvalidTime,j as isRichContent,U as isTransformTreeType,_ as parseMergeField,y as parseRichContent,b as useIhoTableFormEvent,A as useUUIDMap};
|