cnhis-design-vue 3.1.55-beta.6 → 3.1.55-release.0
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/src/hooks/renderCanvas.js +1 -1
- 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/index.d.ts +0 -13
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +0 -13
- package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +6 -26
- package/es/components/classification/index.d.ts +1 -486
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +1 -473
- package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +1 -473
- package/es/components/classification/src/index.vue.d.ts +1 -486
- package/es/components/classification/src/index.vue2.js +1 -1
- 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/index.d.ts +0 -1
- package/es/components/fabric-chart/src/FabricChart.vue.d.ts +0 -1
- package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
- package/es/components/fabric-chart/src/constants/index.d.ts +0 -1
- package/es/components/fabric-chart/src/constants/index.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/useDetailEvent.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts +0 -5
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/useCumputedPoint.d.ts +3 -3
- package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +1 -1
- package/es/components/form-config/index.d.ts +57 -104
- package/es/components/form-config/src/FormConfig.vue.d.ts +57 -104
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +6 -26
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +21 -44
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +5 -5
- package/es/components/form-render/index.d.ts +6 -26
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/FormRender.vue.d.ts +6 -26
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +6 -26
- package/es/components/form-render/src/components/renderer/complex.js +1 -1
- 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/lineBar/FormCollapse.vue.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue2.js +1 -1
- package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/components/renderer/switch.js +1 -1
- package/es/components/form-render/src/components/renderer/textarea.js +1 -1
- package/es/components/form-render/src/constants/index.d.ts +1 -0
- package/es/components/form-render/src/constants/index.js +1 -1
- package/es/components/form-render/src/hooks/index.d.ts +9 -20
- package/es/components/form-render/src/hooks/index.js +1 -1
- package/es/components/form-render/src/hooks/useAnchor.js +1 -1
- package/es/components/form-render/src/hooks/useBusinessBinding.d.ts +1 -1
- package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
- package/es/components/form-render/src/hooks/useFieldVisitor.js +1 -1
- package/es/components/form-render/src/hooks/useFormEvent.d.ts +3 -14
- package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
- package/es/components/form-render/src/hooks/useFormItemDeps.d.ts +4 -4
- package/es/components/form-render/src/hooks/useFormItemDeps.js +1 -1
- package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +10 -11
- package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
- package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
- package/es/components/form-render/src/hooks/useOperationalForm.d.ts +2 -3
- package/es/components/form-render/src/hooks/useOperationalForm.js +1 -1
- package/es/components/form-render/src/hooks/usePresetScope.js +1 -1
- package/es/components/form-render/src/hooks/useWordbookSetting.d.ts +4 -13
- package/es/components/form-render/src/hooks/useWordbookSetting.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +0 -1
- package/es/components/form-render/src/types/index.d.ts +5 -10
- package/es/components/form-render/src/utils/index.d.ts +16 -3
- package/es/components/form-render/src/utils/index.js +1 -1
- package/es/components/iho-table/src/plugins/bindEventSettingPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/operationalFormPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.js +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/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/editTime.vue.d.ts +3 -7
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/defaultRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/htmlRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/labelRendererPlugin.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +0 -2
- 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/iho-table/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +2 -3
- package/es/components/index.js +1 -1
- package/es/components/info-header/index.d.ts +12 -52
- package/es/components/info-header/src/InfoHeader.vue.d.ts +12 -52
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +6 -26
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +6 -26
- package/es/components/{biunique-chat → multi-chat}/index.d.ts +2 -2
- package/es/components/multi-chat/index.js +1 -0
- package/es/components/multi-chat/src/MultiChat.vue.js +1 -0
- package/es/components/multi-chat/src/MultiChat.vue2.js +1 -0
- 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/shortcut-setter/index.d.ts +11 -32
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +11 -32
- package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +3 -0
- package/es/components/table-filter/src/constants/index.d.ts +0 -1
- package/es/components/table-filter/src/constants/index.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/utils/business.d.ts +0 -1
- package/es/shared/utils/business.js +1 -1
- package/es/shared/utils/fabricjs/index.d.ts +6823 -0
- package/es/shared/utils/index.js +1 -1
- package/es/shared/utils/tapable/index.d.ts +139 -0
- package/package.json +2 -3
- package/es/components/audio-sdk/index.d.ts +0 -2
- package/es/components/audio-sdk/index.js +0 -1
- package/es/components/audio-sdk/src/audioSDK.d.ts +0 -24
- package/es/components/audio-sdk/src/audioSDK.js +0 -1
- package/es/components/audio-sdk/src/components/recordingDialog.vue.d.ts +0 -26
- package/es/components/audio-sdk/src/components/recordingDialog.vue.js +0 -1
- package/es/components/audio-sdk/src/components/recordingDialog.vue2.js +0 -1
- package/es/components/audio-sdk/src/utils/recordingDialog.d.ts +0 -8
- package/es/components/audio-sdk/src/utils/recordingDialog.js +0 -1
- package/es/components/audio-sdk/style/index.css +0 -1
- package/es/components/biunique-chat/index.js +0 -1
- package/es/components/biunique-chat/src/BiuniqueChat.vue.js +0 -1
- package/es/components/biunique-chat/src/BiuniqueChat.vue2.js +0 -1
- package/es/components/iho-table/src/plugins/colorAndIconPlugin.d.ts +0 -1
- package/es/components/iho-table/src/plugins/colorAndIconPlugin.js +0 -1
- package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.d.ts +0 -320
- package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.js +0 -1
- package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue2.js +0 -1
- package/es/components/table-filter/src/components/bi-filter/components/Date.vue.d.ts +0 -127
- package/es/components/table-filter/src/components/bi-filter/components/Date.vue.js +0 -1
- package/es/components/table-filter/src/components/bi-filter/components/Date.vue2.js +0 -1
- package/es/components/table-filter/src/components/bi-filter/components/InputFilter.vue.d.ts +0 -41
- package/es/components/table-filter/src/components/bi-filter/components/InputFilter.vue.js +0 -1
- package/es/components/table-filter/src/components/bi-filter/components/InputFilter.vue2.js +0 -1
- package/es/components/table-filter/src/components/bi-filter/components/InputNumber.vue.d.ts +0 -28
- package/es/components/table-filter/src/components/bi-filter/components/InputNumber.vue.js +0 -1
- package/es/components/table-filter/src/components/bi-filter/components/InputNumber.vue2.js +0 -1
- package/es/components/table-filter/src/components/bi-filter/components/SelectFilter.vue.d.ts +0 -51
- package/es/components/table-filter/src/components/bi-filter/components/SelectFilter.vue.js +0 -1
- package/es/components/table-filter/src/components/bi-filter/components/SelectFilter.vue2.js +0 -1
- package/es/components/table-filter/src/components/bi-filter/components/index.d.ts +0 -244
- package/es/components/table-filter/src/components/bi-filter/components/index.js +0 -1
- package/es/components/table-filter/src/components/bi-filter/helpers/options.d.ts +0 -14
- package/es/components/table-filter/src/components/bi-filter/helpers/options.js +0 -1
- package/es/components/table-filter/src/components/bi-filter/hooks/useBiConditions.d.ts +0 -13
- package/es/components/table-filter/src/components/bi-filter/hooks/useBiConditions.js +0 -1
- package/es/components/table-filter/src/components/bi-filter/index.vue.d.ts +0 -474
- package/es/components/table-filter/src/components/bi-filter/index.vue.js +0 -1
- package/es/components/table-filter/src/components/bi-filter/index.vue2.js +0 -1
- /package/es/components/{biunique-chat/src/BiuniqueChat.vue.d.ts → multi-chat/src/MultiChat.vue.d.ts} +0 -0
- /package/es/components/{biunique-chat → multi-chat}/src/api/index.d.ts +0 -0
- /package/es/components/{biunique-chat → multi-chat}/src/api/index.js +0 -0
- /package/es/components/{biunique-chat → multi-chat}/src/components/ChatFooter.vue.d.ts +0 -0
- /package/es/components/{biunique-chat → multi-chat}/src/components/ChatFooter.vue.js +0 -0
- /package/es/components/{biunique-chat → multi-chat}/src/components/ChatFooter.vue2.js +0 -0
- /package/es/components/{biunique-chat → multi-chat}/src/components/ChatHeader.vue.d.ts +0 -0
- /package/es/components/{biunique-chat → multi-chat}/src/components/ChatHeader.vue.js +0 -0
- /package/es/components/{biunique-chat → multi-chat}/src/components/ChatHeader.vue2.js +0 -0
- /package/es/components/{biunique-chat → multi-chat}/src/components/ChatMain.vue.d.ts +0 -0
- /package/es/components/{biunique-chat → multi-chat}/src/components/ChatMain.vue.js +0 -0
- /package/es/components/{biunique-chat → multi-chat}/src/components/ChatMain.vue2.js +0 -0
- /package/es/components/{biunique-chat → multi-chat}/src/components/SiderList.vue.d.ts +0 -0
- /package/es/components/{biunique-chat → multi-chat}/src/components/SiderList.vue.js +0 -0
- /package/es/components/{biunique-chat → multi-chat}/src/components/SiderList.vue2.js +0 -0
- /package/es/components/{biunique-chat → multi-chat}/src/utils/chatSock.d.ts +0 -0
- /package/es/components/{biunique-chat → multi-chat}/src/utils/chatSock.js +0 -0
- /package/es/components/{biunique-chat → multi-chat}/style/index.css +0 -0
|
@@ -1,30 +1,19 @@
|
|
|
1
1
|
import { AnyObject } from '../../../../../es/shared/types';
|
|
2
2
|
import { Field, Form, IFieldState } from '@formily/core';
|
|
3
3
|
import { Ref } from 'vue';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
export declare function useFormExposeEvent({ formModel, formRenderRef, formUUID, getFieldList, formItemDepsCollector, businessCollector, wordbookSettingHandler, operationalFormHandler }: {
|
|
4
|
+
import { FieldItem, FormItemDepsCollector, FormRenderProps } from '../../../../../es/components/form-render';
|
|
5
|
+
export declare function useFormExposeEvent({ formModel, formRenderRef, formUUID, getFieldList, formItemDepsCollector }: {
|
|
7
6
|
formModel: Form;
|
|
8
7
|
formRenderRef: Ref<HTMLElement | undefined>;
|
|
9
8
|
formUUID: string;
|
|
10
9
|
getFieldList: () => FieldItem[];
|
|
11
10
|
formItemDepsCollector: FormItemDepsCollector;
|
|
12
|
-
businessCollector: BusinessCollector;
|
|
13
|
-
wordbookSettingHandler: wordbookSettingHandler;
|
|
14
|
-
operationalFormHandler: ReturnType<typeof useOperationalForm>;
|
|
15
11
|
}): {
|
|
16
12
|
validate(path?: string | ((field: Field) => boolean), { force }?: {
|
|
17
13
|
force?: boolean | undefined;
|
|
18
14
|
}): Promise<void>;
|
|
19
15
|
getFormValues(needCombineExtendKey?: boolean): any;
|
|
20
|
-
setFormValues(values: AnyObject,
|
|
21
|
-
needSplitExtendKey?: boolean | undefined;
|
|
22
|
-
avoidBusinessConnection?: string | boolean | undefined;
|
|
23
|
-
avoidDependKeyConnection?: string | boolean | undefined;
|
|
24
|
-
avoidWordbookSettingConnection?: string | boolean | undefined;
|
|
25
|
-
avoidOperationalFormConnection?: string | boolean | undefined;
|
|
26
|
-
overwrite?: boolean | undefined;
|
|
27
|
-
}, avoidBusinessConnection?: string | boolean, overwrite?: boolean): Promise<void>;
|
|
16
|
+
setFormValues(values: AnyObject, needSplitExtendKey?: boolean, overwrite?: boolean): void;
|
|
28
17
|
setFieldState(path: string, setter: (field: IFieldState) => void): void;
|
|
29
18
|
resetFields(path?: string): Promise<void>;
|
|
30
19
|
queryWidget(key: string): Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e,findAncestor as t}from"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{Path as o}from"@formily/path";import{isObject as i}from"@vue/shared";import{promiseTimeout as n}from"@vueuse/shared";import{isFunction as
|
|
1
|
+
import{arrayed as e,findAncestor as t}from"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{Path as o}from"@formily/path";import{isObject as i}from"@vue/shared";import{promiseTimeout as n}from"@vueuse/shared";import{isFunction as s,isArray as a,isString as f}from"lodash-es";import{nextTick as m}from"vue";import"../../index.js";import{FormItemLineBarDepKeyPrepend as l,NESTED_FORM_ITEM_TYPE as u}from"../constants/index.js";import{queryDecoratorByAddress as d,queryInput as c,queryDecoratorByFieldKey as p,findNextWidget as g}from"../utils/dom.js";import{validateMessageParser as h,combineExtendKey as v,splitExtendKey as y}from"../utils/index.js";import{getParentLinebar as x}from"../utils/schema.js";function I({formModel:t,formRenderRef:n,formUUID:u,getFieldList:g,formItemDepsCollector:I}){return{validate(o="*",{force:m}={}){if(s(o)){const e=Object.entries(t.fields).reduce(((e,[t,r])=>(o(r)&&e.push(t),e)),[]);if(!e.length)return Promise.resolve();o=e.length?`*(${e.join(",")})`:"*"}const l=[];m&&t.setFieldState(o,(e=>{"visible"===e.display&&"editable"!==e.pattern&&r(e)&&(l.push({pattern:e.pattern,state:e}),e.pattern="editable")}));const p=t.validate(o).catch((e=>Promise.reject(Array.isArray(e)?e.reduce(g,[]):e)));return m&&l.forEach((({pattern:e,state:t})=>t.pattern=e)),p;function g(t,r){if(!i(r))return t;let o=!1;return a(r.messages)&&r.messages.forEach((r=>{i(r)&&(t.push(...e(r).map(v)),o=!0)})),!o&&t.push(v(r)),t}function v(e){if(e.decoratorElement)return e;const r=t.query(e.path),o=r.get("title"),s=e.messages.map((e=>function(e,t){if(!t||!i(t.fieldItem))return e;const r=t.fieldItem.defined_error_msg;return h(r&&f(r)?r:e,t.fieldItem)}(e,r.get("decoratorProps")))),a=d(e.address,n.value,u);return{...e,messages:s,title:o,decoratorElement:a,...c(a)}}},getFormValues(e=!0){let r=t.getFormState().values;return e&&(r=v(g(),r)),r},setFormValues(e,i=!0,n=!0){i&&(e=y(g(),e)),t.setFieldState("*",(t=>{r(t)&&(n||o.existIn(e,t.path))&&(t.value=o.getIn(e,t.path))}))},setFieldState(e,r){t.setFieldState(e,r)},resetFields:(e="*")=>t.reset(e),queryWidget:async e=>n.value?await async function(e,t,r){if(!n.value)return s();const o=p(e,t,u);if(o)return s(o);const i=x(e,r);return i?(I.trigger(l+i,!0),await m(),s(p(e,t,u))):s();function s(e){return{decoratorElement:e,...c(e)}}}(e,n.value,g()):null}}function j({props:e,formRenderRef:r,formModel:o}){return{onKeydown:async function i(a){var f;if(e.enterToNextWidget&&a.target){if("TEXTAREA"===a.target.tagName&&!a.ctrlKey)return;a.preventDefault()}if(await n(0),Reflect.get(a,"stopCapture")||!e.enterToNextWidget||!r.value)return;const m=t(a.target,(e=>e.classList.contains("form-render__formItem")));if(!m)return;const l=`.form-render__formItem${u.map((e=>`:not([widget-type=${e}])`)).join("")}`,d=Array.from(r.value.querySelectorAll(l)),c=d.findIndex((e=>e.id===m.id));if(!~c)return;const{widget:p,field:h}=g(d,c,a.target);if(p)if(s(e.enterToNextWidget)){const t=h&&o.query(h).take();!t||e.enterToNextWidget(null==(f=t.decoratorProps)?void 0:f.fieldItem)?v():i({target:p})}else v();async function v(){await n(0),p.focus()}}}}export{j as useFormDomEvent,I as useFormExposeEvent};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AnyFn } from '../../../../../es/shared/types';
|
|
2
|
-
import { Path } from '@formily/path';
|
|
3
2
|
import { DependKeyType } from '../../../../../es/components/form-render';
|
|
4
3
|
export declare class FormItemDepsCollector {
|
|
5
|
-
triggerDisabled:
|
|
4
|
+
triggerDisabled: boolean;
|
|
6
5
|
private readonly collector;
|
|
7
|
-
setDeps(
|
|
8
|
-
|
|
6
|
+
setDeps(key: string, dependKeys: DependKeyType, callback: AnyFn): void;
|
|
7
|
+
getDeps(dependKey: string): Map<string, AnyFn<any[], any>> | undefined;
|
|
8
|
+
trigger(dependKey: string, payload?: unknown): void;
|
|
9
9
|
}
|
|
10
10
|
export declare function useFormItemDeps(): {
|
|
11
11
|
create: () => FormItemDepsCollector;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{isFunction as t}from"lodash-es";import"vue";import"../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"naive-ui";import"../../index.js";import"date-fns";import{traverseDependKey as e}from"../utils/schema.js";class r{constructor(){this.triggerDisabled=!1,this.collector=new Map}setDeps(t,r,i){e(r,(e=>{const r=this.collector.get(e)||new Map;r.set(t,i),this.collector.set(e,r)}))}getDeps(t){return this.collector.get(t)}trigger(e,r){var i;this.triggerDisabled||null==(i=this.getDeps(e))||i.forEach((e=>t(e)&&e(r)))}}function i(){return{create:function(){return new r}}}export{r as FormItemDepsCollector,i as useFormItemDeps};
|
|
@@ -25,22 +25,21 @@ export declare function useUrlConfigOptions(props: Partial<{
|
|
|
25
25
|
labelField: string;
|
|
26
26
|
valueField: string;
|
|
27
27
|
showField: string;
|
|
28
|
-
searchField: string[];
|
|
29
28
|
urlConfig: UrlConfig;
|
|
30
29
|
options: AnyObject[];
|
|
31
30
|
requestCache: boolean;
|
|
32
31
|
lazyRequest: boolean;
|
|
33
32
|
searchByValue: boolean;
|
|
34
33
|
}>, valueRef: Ref, hooks?: UseOptionHooks): {
|
|
35
|
-
labelKey:
|
|
34
|
+
labelKey: import("vue").ComputedRef<string>;
|
|
36
35
|
loading: Ref<boolean>;
|
|
37
|
-
showKey:
|
|
38
|
-
valueKey:
|
|
36
|
+
showKey: import("vue").ComputedRef<string | undefined>;
|
|
37
|
+
valueKey: import("vue").ComputedRef<string>;
|
|
39
38
|
remoteOptions: Ref<AnyObject[] | null>;
|
|
40
39
|
filterOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
41
40
|
fullOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
42
|
-
fetchData: (content?: string
|
|
43
|
-
avoidSearchContent?: boolean
|
|
41
|
+
fetchData: (content?: string, otherParams?: AnyObject, options?: {
|
|
42
|
+
avoidSearchContent?: boolean;
|
|
44
43
|
}) => Promise<null | undefined>;
|
|
45
44
|
searchContent: Ref<string | undefined>;
|
|
46
45
|
};
|
|
@@ -54,15 +53,15 @@ export declare function useAutographOptions(props: Partial<{
|
|
|
54
53
|
lazyRequest: boolean;
|
|
55
54
|
options: AnyObject[];
|
|
56
55
|
}>, valueRef: Ref, hooks?: UseOptionHooks): {
|
|
57
|
-
labelKey:
|
|
56
|
+
labelKey: import("vue").ComputedRef<string>;
|
|
57
|
+
showKey: import("vue").ComputedRef<string | undefined>;
|
|
58
58
|
loading: Ref<boolean>;
|
|
59
|
-
showKey: Ref<string | undefined>;
|
|
60
|
-
valueKey: Ref<string>;
|
|
61
59
|
remoteOptions: Ref<AnyObject[] | null>;
|
|
60
|
+
valueKey: import("vue").ComputedRef<string>;
|
|
62
61
|
filterOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
63
62
|
fullOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
64
|
-
fetchData: (content?: string
|
|
65
|
-
avoidSearchContent?: boolean
|
|
63
|
+
fetchData: (content?: string, otherParams?: AnyObject, options?: {
|
|
64
|
+
avoidSearchContent?: boolean;
|
|
66
65
|
}) => Promise<null | undefined>;
|
|
67
66
|
searchContent: Ref<string | undefined>;
|
|
68
67
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{checkInSetupEnv as e,arrayed as l,jsonParse as n}from"../../../../shared/utils/index.js";import{uniqBy as o,isEqual as a,isString as t,omit as u,isFunction as r}from"lodash-es";import"naive-ui";import{computed as i,inject as s,ref as v,watch as c,toRaw as m}from"vue";import"@vueuse/core";import"date-fns";import{useFormRequest as d}from"../../../../shared/hooks/useFormRequest/index.js";import"@vueuse/shared";import{useOptionFiltered as f}from"../../../../shared/hooks/selectHooks/useOptionFiltered.js";import{useSearchContent as y}from"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{useForm as p}from"@formily/vue";import"../../index.js";import{InjectionAsyncQueue as h,InjectionFormLifeCycleCaller as g,InjectionFormItemDepsCollector as K}from"../constants/index.js";import{createUrlConfigParams as C,formRenderLog as k}from"../utils/index.js";import{useFormField as b}from"./useFormField.js";function w(e,l){const n=v();return i({get:()=>n.value?n.value:e[l],set(e){n.value=e}})}function O(e,l,a,t,v){const c=w(e,"commonList"),m=w(e,"recentList"),{searchContent:f,optionSearchFilter:p}=y();function g(e){return n(e.itemObj)}const K=i((()=>{var e,l;return null!=(l=null==(e=c.value)?void 0:e.map(g))?l:[]})),C=i((()=>{var e,l;return null!=(l=null==(e=m.value)?void 0:e.map(g))?l:[]})),k=i((()=>{if(!e.recommend||!K.value.length&&!C.value.length)return l.value;const n=o(K.value.concat(C.value),(e=>e[v.value])),a=l.value.filter((e=>n.every((function(l){return l[v.value]!==e[v.value]}))));return[...p(n,t.value),...a]})),{getRecommendRequestInfo:O,getHttpInstance:R}=d();function q(l){const{url:n,getRecommendIds:o}=O(),a=r(o)?o():{},t=r(e.getRecommendInfo)?e.getRecommendInfo():{};return{url:n[l],info:Object.assign({},a,t)}}const{fieldKey:F,field:j}=b(),I=s(h);return{postRecommend:async function(l){if(!e.recommend)return;const n=R();if(!n)return;const{url:o,info:t}=q("post"),u=k.value.find((e=>e[v.value]===l));u&&a("postRecommend",await n.post(o,{...t,keyword:"",itemId:v.value,itemObj:JSON.stringify(u)}))},getRecommend:async function(l){if(!e.recommend)return;if(f.value=l,c.value&&m.value&&e.recommendCache)return;const n=await I.addAsync(function(l,n){const{url:o,info:a}=q("get");return{url:o,method:"get",key:l,cache:n,params:{...a,recNum:Math.max(e.commonNum,e.recentNum),keyword:""},payload:{field:j.value,labelKey:t.value,valueKey:v.value}}}(F.value,e.recommendCache)),{commonly:o,recently:a}=n.reduce(((e,l)=>("commonly"===l.type?e.commonly.push(u(l,["type"])):"recently"===l.type&&e.recently.push(u(l,["type"])),e)),{commonly:[],recently:[]});c.value=o.slice(0,e.commonNum),m.value=a.slice(0,e.recentNum)},sortedOptions:k}}function R(l,n,o){e();const u=s(h),r=s(g),d=i((()=>{var e,n,o;return null!=(o=null!=(n=null==(e=l.urlConfig)?void 0:e.nameKey)?n:l.labelField)?o:"text"})),y=i((()=>{var e,n,o;return null!=(o=null!=(n=null==(e=l.urlConfig)?void 0:e.valueKey)?n:l.valueField)?o:"value"})),p=i((()=>{var e,n;return null!=(n=null==(e=l.urlConfig)?void 0:e.showKey)?n:l.showField})),{remoteOptions:w,filterOptions:O,fullOptions:R,searchContent:q}=f(l,{labelKey:d,valueKey:y}),{field:F,fieldKey:j}=b(),I=v(!1),x=async function(e,n,o={avoidSearchContent:!0}){if(q.value=e,!l.urlConfig)return w.value=null;if(!o.avoidSearchContent||null==q.value)try{I.value=!0;const e={field:F.value,labelKey:d.value,valueKey:y.value},o=await u.addAsync(await C({config:{...l.urlConfig,payload:e,params:{...l.urlConfig.params,...n}},cache:l.requestCache,field:F.value}));m(w.value)!==o&&(w.value=o,r("afterOptionInit",[j.value,w.value,e]))}catch(e){t(e)&&k(e)}finally{I.value=!1}},S=s(K);return c((()=>l.urlConfig),((e,t)=>{if(a(e,t))return;if(w.value=null,!e)return w.value=null;const u={fetchData:x,labelKey:d.value,valueKey:y.value},{onRequestConfigChange:r,onDepsChange:i}=o||{};S.setDeps(j.value,e.dependKey||[],(async()=>{w.value=null,n.value=null,l.lazyRequest||(i?i(u):x())})),!n.value&&l.lazyRequest||(r?r(u):x())}),{immediate:!0}),{labelKey:d,loading:I,showKey:p,valueKey:y,remoteOptions:w,filterOptions:O,fullOptions:R,fetchData:x,searchContent:q}}function q(n,o,u){e();const r=s(h),y=s(g),C=p(),w=i((()=>{var e;const o=l(null==(e=n.wordbook)?void 0:e.show_key)[0];return t(o)?o:null})),O=i((()=>{var e,l,o,a;const u=null==(l=null==(e=n.wordbook)?void 0:e.render_key)?void 0:l[0];return t(u)?u:null!=(a=null!=(o=w.value)?o:n.labelField)?a:"text"})),R=i((()=>{var e,l,o;return null!=(o=null!=(l=null==(e=n.wordbook)?void 0:e.value_key)?l:n.valueField)?o:"value"})),q=i((()=>{var e;return(null==(e=n.wordbook)?void 0:e.search_key)||[]})),F=i((()=>{var e;return null!=(e=w.value)?e:n.showField})),{fieldKey:j,field:I}=b(),{getSearchRequestInfo:x}=d(),{searchContent:S,remoteOptions:D,filterOptions:N,fullOptions:_}=f(n,{labelKey:O,valueKey:R,searchKey:q}),z=v(!1),A=async function(e,l,o={avoidSearchContent:!0}){if(S.value=e,!n.autograph||!n.wordbook)return D.value=null;if(!o.avoidSearchContent||null==S.value)try{z.value=!0;const e={field:I.value,labelKey:O.value,valueKey:R.value},o=await r.addAsync(function(e,l,o,a,t){var u,r,i;const s={autograph:l,wordbookId:e.id,wordbookType:e.type,fieldKeys:e.search_key,keyword:"",page:1,...t};if(null==(u=e.queryParams)?void 0:u.length){const l=null!=(i=null==(r=C.value)?void 0:r.getFormState().values)?i:{};e.queryParams.forEach((e=>{s[e]=l[e]}))}return{...x(),params:s,key:o,cache:n.requestCache,payload:a}}(n.wordbook,n.autograph,j.value,e,l));m(D.value)!==o&&(D.value=o,y("afterOptionInit",[j.value,D.value,e]))}catch(e){t(e)&&k(e)}finally{z.value=!1}},H=s(K);return c((()=>n.wordbook),((e,l)=>{if(a(e,l))return;if(D.value=null,!e)return D.value=null;const t={fetchData:A,labelKey:O.value,valueKey:R.value},{onRequestConfigChange:r,onDepsChange:i}=u||{};H.setDeps(j.value,e.queryParams||[],(async()=>{D.value=null,i?i(t):A()})),!o.value&&n.lazyRequest||(r?r(t):A())}),{immediate:!0}),{labelKey:O,showKey:F,loading:z,remoteOptions:D,valueKey:R,filterOptions:N,fullOptions:_,fetchData:A,searchContent:S}}export{q as useAutographOptions,O as useRecommendOptions,R as useUrlConfigOptions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e}from"../../../../shared/utils/index.js";import{once as
|
|
1
|
+
import{arrayed as e}from"../../../../shared/utils/index.js";import{once as i,isNumber as a,isString as m}from"lodash-es";import"vue";import{registerValidateLocale as r,registerValidateRules as s}from"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import{isFunction as l}from"@vueuse/core";import"naive-ui";import"../../index.js";import{isIdCard as n}from"../utils/business.js";function o(){const i=new Map([["mobile",({validate:e})=>({format:"phone",message:null==e?void 0:e.message})],["integer",({validate:e})=>({format:"integer",message:null==e?void 0:e.message})],["number",({validate:e})=>({format:"number",message:null==e?void 0:e.message})],["id_card",({validate:e})=>({validator(i){var a;if(null!=i&&""!==i)return m(i)&&n(i)?void 0:null!=(a=null==e?void 0:e.message)?a:"该字段不是合法的身份证格式"}})],["regular",({validate:e,regular_expression:i,regular_error_tip:a})=>({pattern:i||(null==e?void 0:e.regular_expression)||"",message:a||(null==e?void 0:e.regular_error_tip)||(null==e?void 0:e.message)||"格式错误"})]]),a={triggerType:"onBlur"};return{createValidatorSchema:function(m){const r=[],{validate:{vali_obj:s,max_length:n,min_length:o,message:u,max_value:t,min_value:g,decimal_length:d}={},validator:v}=m;if(v&&e(v).forEach((e=>{l(e)&&r.push({validator:i=>e(i,m)})})),n&&r.push({max:n,message:u}),o&&r.push({min:o,message:u}),t&&r.push({maximum:t,message:u}),g&&r.push({minimum:g,message:u}),null!=d&&r.push(((e,i)=>{const a=null!=i?i:`小数位数最多${e}位`;return{validator(i){var m;return(null==(m=String(i).split(".")[1])?void 0:m.length)>e?a:""}}})(+d,u)),s){const e=i.get(s)||(({validate:e})=>({format:s,message:null==e?void 0:e.message}));r.push(Object.assign({},a,e(m)))}return r}}}const u=i((()=>{r({"zh-CN":{required:"${alias||name}为必填"}}),s({maximum:(e,i)=>a(Number(i.maximum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!a(e)||isNaN(e)?"":e>Number(i.maximum)&&i.message||""):"",minimum:(e,i)=>a(Number(i.minimum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!a(e)||isNaN(e)?"":e<Number(i.minimum)&&i.message||""):""})}));export{o as useFormValidator,u as validateMessageLocale};
|
|
@@ -4,7 +4,6 @@ export declare function useOperationalForm(props: {
|
|
|
4
4
|
operationalForm?: LowCodeTypes.operationalConfig[];
|
|
5
5
|
dateOperationalForm?: LowCodeTypes.dateOperationalConfig[];
|
|
6
6
|
}, formModel: Form): {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
triggerDisabled: string | boolean;
|
|
7
|
+
operationalFormHandler(fieldKey: string): void;
|
|
8
|
+
triggerAllOperationalFormHandler(): void;
|
|
10
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{
|
|
1
|
+
import"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{format as e}from"date-fns";import{isNumber as o,isDate as t}from"lodash-es";import{computed as a}from"vue";import{getOperationalFormHandler as l,getDateOperationalFormHandler as n}from"../../../../shared/utils/business.js";function i(i,m){const s=r=>m.getValuesIn(r),{triggerAllOperationalFormHandler:d,operationalFormHandler:p}=l(a((()=>i.operationalForm)),s,((r,e)=>m.setValuesIn(r,e))),{triggerAllDateOperationalFormHandler:u,dateOperationalFormHandler:f}=n(a((()=>i.dateOperationalForm)),s,((a,l)=>{var n,i,s;const d=m.query(a).take();if(!r(d))return;const[p]=d.component||[];if(["DATE","TIME"].includes(p)){const r=null!=(s=null==(i=null==(n=d.decoratorProps)?void 0:n.fieldItem)?void 0:i.date_format)?s:"yyyy-MM-dd";l=o(l)||t(l)?e(new Date(l),r):l}d.setValue(l)}));return{operationalFormHandler(r){p(r),f(r)},triggerAllOperationalFormHandler(){d(),u()}}}export{i as useOperationalForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isString as i}from"lodash-es";import"vue";import"../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"naive-ui";import{isIdCard as o,isMobile as r}from"../utils/business.js";function s(){return{isIdCard:r=>i(r)&&o(r),isMobile:o=>i(o)&&r(o),isEmail:o=>i(o)&&/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(o),isNumber:o=>i(o)&&/\d+/.test(o)}}export{s as usePresetScope};
|
|
1
|
+
import{isString as i}from"lodash-es";import"vue";import"../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"naive-ui";import"../../index.js";import{isIdCard as o,isMobile as r}from"../utils/business.js";function s(){return{isIdCard:r=>i(r)&&o(r),isMobile:o=>i(o)&&r(o),isEmail:o=>i(o)&&/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(o),isNumber:o=>i(o)&&/\d+/.test(o)}}export{s as usePresetScope};
|
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Field, Form } from '@formily/core';
|
|
1
|
+
import { Form } from '@formily/core';
|
|
3
2
|
import { ContextCollector } from '../../../../../es/components/form-render';
|
|
4
|
-
export declare
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
triggerDisabled: string | boolean;
|
|
8
|
-
constructor(formModel: Form, changeContextCollector: ContextCollector);
|
|
9
|
-
getWordbook(field: Field): LowCodeTypes.wordbook | undefined;
|
|
10
|
-
findFieldByLabel(formModel: Form, label: string): import("@formily/core").GeneralField | undefined;
|
|
11
|
-
trigger(fieldKey: string, value: unknown): void;
|
|
12
|
-
}
|
|
13
|
-
export declare function useWordbookSetting(): {
|
|
14
|
-
create: (formModel: Form, changeContextCollector: ContextCollector) => wordbookSettingHandler;
|
|
3
|
+
export declare function useWordbookSetting(formModel: Form, changeContextCollector: ContextCollector): {
|
|
4
|
+
trigger: (fieldKey: string, value: unknown) => void;
|
|
5
|
+
setDisabled: (value: boolean) => void;
|
|
15
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isField as t}from"@formily/core";
|
|
1
|
+
import{isField as t}from"@formily/core";function n(n,e){let r=!1;return{trigger:function(o,i){var l,u;if(r)return;const c=n.query(o).take();if(!t(c))return;const a=function(t){var n,e;return null==(e=null==(n=t.decoratorProps)?void 0:n.fieldItem)?void 0:e.wordbook}(c);(null==(u=null==(l=null==a?void 0:a.setting)?void 0:l.cascading)?void 0:u.length)&&a.setting.cascading.forEach((r=>{var l;const u=function(t,n){return Object.values(t.fields).find((t=>t.title===n))}(n,r["form.name"]);if(!u||!t(u))return;const c=null==(l=e.getContext(o,i))?void 0:l.currentOption;c&&u.setValue(c[r.value])}))},setDisabled:function(t){r=t}}}export{n as useWordbookSetting};
|
|
@@ -38,10 +38,8 @@ export declare type FormRenderExpose = {
|
|
|
38
38
|
* @param {object} values 值对象
|
|
39
39
|
* @param {{
|
|
40
40
|
* needSplitExtendKey?: boolean;
|
|
41
|
-
* avoidBusinessConnection?: boolean
|
|
42
|
-
* avoidDependKeyConnection?: boolean
|
|
43
|
-
* avoidWordbookSettingConnection?: boolean|string;
|
|
44
|
-
* avoidOperationalFormConnection?: boolean|string;
|
|
41
|
+
* avoidBusinessConnection?: boolean;
|
|
42
|
+
* avoidDependKeyConnection?: boolean;
|
|
45
43
|
* overwrite?: boolean;
|
|
46
44
|
* } | boolean} options 为了兼容旧的用法, 也可以直接传boolean值, 但是此用法即将移除
|
|
47
45
|
* ⭐️ 当值为对象时(推荐)
|
|
@@ -49,8 +47,6 @@ export declare type FormRenderExpose = {
|
|
|
49
47
|
* needSplitExtendKey, //是否将extendKey展开, 默认为true
|
|
50
48
|
* avoidBusinessConnection, // 赋值时是否规避业务联动, 默认为false
|
|
51
49
|
* avoidDependKeyConnection, // 赋值时是否规避依赖联动, 默认为true
|
|
52
|
-
* avoidWordbookSettingConnection, // 赋值时是否规避字典联动, 默认为true
|
|
53
|
-
* avoidOperationalFormConnection, // 赋值时是否规避操作联动, 默认为true
|
|
54
50
|
* overwrite // 是否对表单值进行全量覆盖, 默认为true
|
|
55
51
|
* }
|
|
56
52
|
* 🗑 当值为boolean时(即将移除此用法)
|
|
@@ -60,10 +56,9 @@ export declare type FormRenderExpose = {
|
|
|
60
56
|
*/
|
|
61
57
|
setFormValues(values: AnyObject, options?: Partial<{
|
|
62
58
|
needSplitExtendKey: boolean;
|
|
63
|
-
avoidBusinessConnection: boolean
|
|
64
|
-
avoidDependKeyConnection: boolean
|
|
65
|
-
avoidWordbookSettingConnection: boolean
|
|
66
|
-
avoidOperationalFormConnection: boolean | string;
|
|
59
|
+
avoidBusinessConnection: boolean;
|
|
60
|
+
avoidDependKeyConnection: boolean;
|
|
61
|
+
avoidWordbookSettingConnection: boolean;
|
|
67
62
|
overwrite: boolean;
|
|
68
63
|
}> | boolean, avoidBusinessConnection?: boolean, overwrite?: boolean): any;
|
|
69
64
|
/**
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { AnyObject, ArrayAble } from '../../../../../es/shared/types';
|
|
2
2
|
import { GeneralField } from '@formily/core';
|
|
3
|
-
import { Pattern } from '@formily/path';
|
|
4
3
|
import { FunctionalComponent, InjectionKey, VNode } from 'vue';
|
|
5
|
-
import { FieldItem } from '../types';
|
|
4
|
+
import { FieldItem, UrlConfig } from '../types';
|
|
6
5
|
export * from './business';
|
|
7
6
|
export * from './dom';
|
|
8
7
|
export * from './schema';
|
|
@@ -19,5 +18,19 @@ export declare function combineExtendKey(fieldList: FieldItem[], values: AnyObje
|
|
|
19
18
|
export declare function splitExtendKey(fieldList: FieldItem[], values: AnyObject): AnyObject;
|
|
20
19
|
export declare function isNestedType(type?: string): boolean | "" | undefined;
|
|
21
20
|
export declare function isNestedFieldType(field: FieldItem | GeneralField): boolean | "" | undefined;
|
|
21
|
+
export declare function createUrlConfigParams({ config, field, cache }: {
|
|
22
|
+
config: UrlConfig;
|
|
23
|
+
field: GeneralField;
|
|
24
|
+
cache?: boolean;
|
|
25
|
+
}): Promise<{
|
|
26
|
+
params: AnyObject;
|
|
27
|
+
key: string;
|
|
28
|
+
cache: boolean | undefined;
|
|
29
|
+
url: string;
|
|
30
|
+
method?: import("../../..").FormRequestDefine.RequestType | undefined;
|
|
31
|
+
nameKey?: string | undefined;
|
|
32
|
+
valueKey?: string | undefined;
|
|
33
|
+
showKey?: string | undefined;
|
|
34
|
+
dependKey?: import("../../../../../es/components/form-render").DependKeyType | undefined;
|
|
35
|
+
}>;
|
|
22
36
|
export declare function renderDescOption(labelNode: any, option: AnyObject): JSX.Element;
|
|
23
|
-
export declare function getAbsoluteKey(fieldKey: string, field: Pattern): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{inject as
|
|
1
|
+
import{inject as e,provide as n,computed as t,createVNode as r,Fragment as o}from"vue";import{arrayed as i}from"../../../../shared/utils/index.js";import{isGeneralField as c,isField as u}from"@formily/core";import{Path as s}from"@formily/path";import{HelpCircleSharp as f}from"@vicons/ionicons5";import{isObject as a}from"@vue/shared";import{useMemoize as l}from"@vueuse/core";import{isString as p,isFunction as m,omit as d}from"lodash-es";import{NTooltip as h,NIcon as y}from"naive-ui";import"../../index.js";import{NESTED_FORM_ITEM_TYPE as x}from"../constants/index.js";import"date-fns";import{traverseDependKey as g}from"./schema.js";export{assignClearBindVisited,assignUpdateValue,assignValueBindKey,createLinebarId,createObjSchema,createVisitedSetter,dotEscape,fieldKeyEscape,getParentLinebar,traverseDependKey,traverseSchema}from"./schema.js";function v(e){console.warn(`[FormRender]: ${e}`)}function j(e,n,t=["children","properties","suffixConfig"],r="val_key",o="default_val"){return function e(n,r){r.forEach((r=>{a(r)&&(null!=u(r)&&null==n[c(r)]&&s.setIn(n,c(r),u(r)),t.forEach((t=>{r[t]&&(n[c(r)]||(n[c(r)]={}),e(n[c(r)],i(r[t])))})))}))}(e,n),e;function c(e){return e[r]}function u(e){return e[o]}}function K(t,r){let o=e(t,null);return o||(o=r(),n(t,o)),o}function E(e){return e&&p(e)?+e:e}function b(e,n,t){if(a(e)&&!m(e)){const t={};return Object.entries(e).forEach((([e,r])=>{m(r)&&(t[e]=()=>r(n))})),t}return{default:()=>m(e)?e(n):t?t(e):[e]}}function k(e,n){return t((()=>{const t={};return e.prefix&&(t.prefix=()=>r(o,null,[b(e.prefix,e,n).default()])),e.suffix&&(t.suffix=()=>r(o,null,[b(e.suffix,e,n).default()])),t}))}function O(e,n){return p(e)&&e?e.replace(/\$\{([^}]*)}/g,(function(e,t){const r=t.split("||");for(const e of r){const t=n[e.trim()];if(t)return t}return""})):""}function S(e){return e.reduce(((e,n)=>(p(n.extendKey)&&n.extendKey&&e.push(n),I(n)&&e.push(...S(n.children||[])),e)),[])}function _(e,n){const t=S(e);if(!t.length)return n;const r={},o=new Map;return Object.entries(n).forEach((([e,i])=>{const c=t.find((n=>n.val_key===e));if(!c)return r[e]=i;const{val_key:u,extendKey:s}=c,f=o.get(s)||{};o.set(s,f),f[u]=n[u]})),[...o.entries()].forEach((([e,n])=>{r[e]=JSON.stringify(n)})),r}function V(e,n){const t=S(e);if(!t.length)return n;const r=l((e=>{try{return a(n[e])?n[e]:JSON.parse(n[e])||{}}catch(e){return{}}})),o=d(n,t.map((e=>e.extendKey)));return t.forEach((({val_key:e,extendKey:n})=>{Reflect.has(o,e)||(o[e]=r(n)[e])})),o}function w(e){return e&&x.includes(e)}function I(e){return w(c(e)?e.componentType:e.html_type)}async function $({config:e,field:n,cache:t}){const r={},o=n.props.name.toString();try{g(e.dependKey||[],((e,t,o)=>{const i=n.query(e).take();if(!u(i)||o&&null==i.value)throw`缺少必须的参数=>${e}`;r[t]=i.value}))}catch(e){return Promise.reject(e)}return{...e,params:Object.assign({},e.params,r),key:o,cache:t}}function B(e,n){return r("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[e,n.desc?r(h,null,{trigger:()=>r(y,{component:f},null),default:()=>n.desc}):null])}export{_ as combineExtendKey,k as createInputSlot,b as createSlot,$ as createUrlConfigParams,v as formRenderLog,K as injectOrProvide,I as isNestedFieldType,w as isNestedType,j as mergeDeepProperties,E as parseNumberFromMaybeString,B as renderDescOption,V as splitExtendKey,O as validateMessageParser};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../../../../shared/utils/index.js";import"../../../index.js";import{isFunction as n}from"lodash-es";import{
|
|
1
|
+
import"../../../../../shared/utils/index.js";import"../../../index.js";import{isFunction as n}from"lodash-es";import{defineTablePlugin as t}from"../../hooks/useTablePlugin.js";import{getBindEventSettingTrigger as o}from"../../../../../shared/utils/business.js";function e(){const e="bindEventSettingPlugin";return t({name:e,apply(t){t.configHooks.config.tap(e,(t=>{const e=t.onFormChange;return t.onFormChange=function(t){var i;const{column:r,row:s}=t,u=null==(i=r.editRender)?void 0:i.props;if(u&&(null==u?void 0:u.bindEventSetting)){u.bindEventSetting.forEach((n=>{o(n.event_type)(n,{getter:n=>s[n],setter:(n,t)=>s[n]=t})}))}n(e)&&e(t)},t}))}})}export{e as bindEventSettingPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"./anchorPlugin/index.js";import*as r from"./bindEventSettingPlugin/index.js";import*as i from"./
|
|
1
|
+
import*as e from"./anchorPlugin/index.js";import*as r from"./bindEventSettingPlugin/index.js";import*as i from"./copyPastePlugin.js";import*as n from"./defaultConfigPlugin/index.js";import*as s from"./defaultValuePlugin.js";import*as t from"./filterDaterangeRenderPlugin/index.js";import*as d from"./filterRenderPlugin/index.js";import*as l from"./filterVisibleEventPlugin.js";import*as g from"./forceArrowKeyPlugin.js";import*as u from"./headerPlugin.js";import*as o from"./highLightSetPlugin.js";import*as a from"./keyboardEventPlugin/index.js";import*as P from"./lowCodeFieldAdaptorPlugin/index.js";import*as m from"./maxCheckSizePlugin.js";import*as x from"./operationalFormPlugin/index.js";import*as f from"./rendererPlugins/editableWidgets/dateRendererPlugin/index.js";import*as p from"./rendererPlugins/editableWidgets/inputRendererPlugin.js";import*as j from"./rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.js";import*as R from"./rendererPlugins/editableWidgets/numberRendererPlugin.js";import*as b from"./rendererPlugins/editableWidgets/radioRendererPlugin.js";import*as w from"./rendererPlugins/editableWidgets/selectRendererPlugin/index.js";import*as c from"./rendererPlugins/editableWidgets/separateRendererPlugin/index.js";import*as h from"./rendererPlugins/editableWidgets/timeRendererPlugin/index.js";import*as W from"./rendererPlugins/widgets/checkRendererPlugin.js";import*as v from"./rendererPlugins/widgets/colorRendererPlugin.js";import*as S from"./rendererPlugins/widgets/defaultRendererPlugin.js";import*as k from"./rendererPlugins/widgets/htmlRendererPlugin.js";import*as C from"./rendererPlugins/widgets/labelRendererPlugin.js";import*as y from"./rendererPlugins/widgets/pictureRendererPlugin.js";import*as E from"./rendererPlugins/widgets/seqRendererPlugin.js";import*as A from"./rowClickPlugin/index.js";import*as D from"./rowDragPlugin/index.js";import*as F from"./rowGroupSettingPlugin/index.js";import*as V from"./varialbleHeightPlugin/index.js";import*as q from"./virtualTreePlugin/index.js";import*as z from"./wordbookSettingPlugin.js";import{separateMetaModule as G}from"../../../../shared/utils/index.js";var H=G(Object.assign({"./anchorPlugin/index.tsx":e,"./bindEventSettingPlugin/index.ts":r,"./copyPastePlugin.ts":i,"./defaultConfigPlugin/index.ts":n,"./defaultValuePlugin.ts":s,"./filterDaterangeRenderPlugin/index.tsx":t,"./filterRenderPlugin/index.tsx":d,"./filterVisibleEventPlugin.ts":l,"./forceArrowKeyPlugin.ts":g,"./headerPlugin.tsx":u,"./highLightSetPlugin.tsx":o,"./keyboardEventPlugin/index.ts":a,"./lowCodeFieldAdaptorPlugin/index.tsx":P,"./maxCheckSizePlugin.ts":m,"./operationalFormPlugin/index.ts":x,"./rendererPlugins/editableWidgets/dateRendererPlugin/index.tsx":f,"./rendererPlugins/editableWidgets/inputRendererPlugin.tsx":p,"./rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.tsx":j,"./rendererPlugins/editableWidgets/numberRendererPlugin.tsx":R,"./rendererPlugins/editableWidgets/radioRendererPlugin.tsx":b,"./rendererPlugins/editableWidgets/selectRendererPlugin/index.tsx":w,"./rendererPlugins/editableWidgets/separateRendererPlugin/index.tsx":c,"./rendererPlugins/editableWidgets/timeRendererPlugin/index.tsx":h,"./rendererPlugins/widgets/checkRendererPlugin.tsx":W,"./rendererPlugins/widgets/colorRendererPlugin.tsx":v,"./rendererPlugins/widgets/defaultRendererPlugin.tsx":S,"./rendererPlugins/widgets/htmlRendererPlugin.tsx":k,"./rendererPlugins/widgets/labelRendererPlugin.tsx":C,"./rendererPlugins/widgets/pictureRendererPlugin.tsx":y,"./rendererPlugins/widgets/seqRendererPlugin.tsx":E,"./rowClickPlugin/index.ts":A,"./rowDragPlugin/index.ts":D,"./rowGroupSettingPlugin/index.ts":F,"./varialbleHeightPlugin/index.tsx":V,"./virtualTreePlugin/index.ts":q,"./wordbookSettingPlugin.ts":z}));export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../../../../shared/utils/index.js";import{format as o}from"date-fns";import"../../../index.js";import{isFunction as n,isNumber as t,isDate as e}from"lodash-es";import{EDITABLE_WIDGET_TYPE as r}from"../../constants/index.js";import{getLowCodeFieldFromField as i,IhoTableUtils as s}from"../../utils/index.js";import{
|
|
1
|
+
import"../../../../../shared/utils/index.js";import{format as o}from"date-fns";import"../../../index.js";import{isFunction as n,isNumber as t,isDate as e}from"lodash-es";import{EDITABLE_WIDGET_TYPE as r}from"../../constants/index.js";import{getLowCodeFieldFromField as i,IhoTableUtils as s}from"../../utils/index.js";import{defineTablePlugin as a}from"../../hooks/useTablePlugin.js";import{getOperationalFormHandler as m,getDateOperationalFormHandler as l}from"../../../../../shared/utils/business.js";function u(){const u="operationalFormPlugin";return a({name:u,apply(a){a.configHooks.config.tap(u,(a=>{const u=a.onFormChange;return a.onFormChange=function(d){const{column:p,row:f,$table:c}=d;!function(n,u){const{operationalFormHandler:d}=m(a.operationalForm||a.operationForm,(o=>n[o]),((o,t)=>{u.getColumns().some((n=>n.field===o))&&(n[o]=t)})),{dateOperationalFormHandler:p}=l(a.dateOperationalForm,(o=>n[o]),((a,m)=>{const l=u.getColumns().find((o=>o.field===a));if(!l)return;const d=i(l);d&&[r.DATE,r.TIME].includes(s.getCellType(d))&&(m=t(m)||e(m)?o(new Date(m),d.valueFormat||"yyyy-MM-dd HH:mm:ss"):null),n[a]=m}));return function(o){d(o),p(o)}}(f,c)(p.field),n(u)&&u(d)},a}))}})}export{u as operationalFormPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{computed as e,createVNode as o,mergeProps as r}from"vue";import{isString as n,isArray as t}from"lodash-es";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as l}from"../../../../constants/index.js";import{useAutoFocus as i}from"../hooks/useAutoFocus.js";import{getLowCodeFieldFromField as d,IhoTableRenderHelper as a,createIhoTableClearActivedInterceptor as s}from"../../../../utils/index.js";import u from"./levelSearchCascade.vue.js";import{defineTablePlugin as c}from"../../../../hooks/useTablePlugin.js";function m(){const m="levelSearchCascadePlugin";return c({name:m,vxe(i){i.renderer.add(l.LEVEL_SEARCH_CASCADE,{renderCell:(e,{column:o,row:r})=>{const l=r[o.field];return n(l)?l:t(l)?function(e){var r,n,t;const l=d(o);if(!l)return"";const i=(null==(n=null==(r=l.wordbook)?void 0:r.show_key)?void 0:n[0])||(null==(t=l.componentProps)?void 0:t.labelField)||"text";return e.reduce(((e,o,r)=>0===r?o[i]:e+" / "+o[i]),"")}(l):""},renderEdit:a.createRenderEdit((({fieldItem:n,row:t,column:l,emitFormClick:i,emitFormChangeWithParams:d,rowIndex:a,columnIndex:s})=>{const c=e({get:()=>t[l.field],set(e){const o=t[l.field];t[l.field]=e,d({oldValue:o})}});return[o(u,r({value:c.value,"onUpdate:value":e=>c.value=e,options:n.options,wordbook:n.wordbook,autograph:n.autograph,onClick:i},n.componentProps,{fieldKey:l.field,payload:{row:t,column:l,rowIndex:a,columnIndex:s}}),null)]}))}),i.interceptor.add("event.clearActived",s(l.LEVEL_SEARCH_CASCADE,(e=>e.classList.contains("search-cascader__menuWrapper"))))},apply(e){i(e).bindAutoFocusConfig(m,l.LEVEL_SEARCH_CASCADE,"input")}})}export{m as levelSearchCascadePlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,inject as l,ref as o,computed as t,onBeforeUnmount as n,nextTick as a,createVNode as r,toRaw as u}from"vue";import{arrayed as i}from"../../../../../../../shared/utils/index.js";import{isFunction as s,isEmpty as d,isArray as c,isObject as p,omit as v,cloneDeep as f,xor as m}from"lodash-es";import{NSelect as y}from"naive-ui";import{useVModel as h,useDebounceFn as b}from"@vueuse/core";import"date-fns";import"@vue/shared";import{useSelectAllowModify as w}from"../../../../../../../shared/hooks/selectHooks/useSelectAllowModify.js";import{useOptionFiltered as S}from"../../../../../../../shared/hooks/selectHooks/useOptionFiltered.js";import"../../../../../../../shared/hooks/selectHooks/useSearchContent.js";import{useSelectRenders as g}from"../../../../../../../shared/hooks/selectHooks/useSelectRenders.js";import{InjectionIhoTableUUID as F}from"../../../../constants/index.js";import{useIhoTableFormEvent as O}from"../../../../utils/index.js";import{getSelectOptions as k,selectOptionsMap as B}from"../hooks/useSelectOption.js";var j=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:"请选择"},allowModify:{type:Boolean},allowCreate:{type:Boolean},shouldSave:{type:Boolean},consistentMenuWidth:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},aliasField:{type:String},menuProps:{type:Object},multiple:{type:Boolean},deletable:{type:Boolean,default:!0},selectAll:{type:Boolean,default:!0},searchByValue:{type:Boolean}},emits:["update:value"],setup(e,{emit:j}){const x=l("$xetable"),$=h(e,"value",j),q=o(null),{emitFormChangeWithParams:C}=O({...e,$table:x}),K=t((()=>e.labelField)),
|
|
1
|
+
import{defineComponent as e,inject as l,ref as o,computed as t,onBeforeUnmount as n,nextTick as a,createVNode as r,toRaw as u}from"vue";import{arrayed as i}from"../../../../../../../shared/utils/index.js";import{isFunction as s,isEmpty as d,isArray as c,isObject as p,omit as v,cloneDeep as f,xor as m}from"lodash-es";import{NSelect as y}from"naive-ui";import{useVModel as h,useDebounceFn as b}from"@vueuse/core";import"date-fns";import"@vue/shared";import{useSelectAllowModify as w}from"../../../../../../../shared/hooks/selectHooks/useSelectAllowModify.js";import{useOptionFiltered as S}from"../../../../../../../shared/hooks/selectHooks/useOptionFiltered.js";import"../../../../../../../shared/hooks/selectHooks/useSearchContent.js";import{useSelectRenders as g}from"../../../../../../../shared/hooks/selectHooks/useSelectRenders.js";import{InjectionIhoTableUUID as F}from"../../../../constants/index.js";import{useIhoTableFormEvent as O}from"../../../../utils/index.js";import{getSelectOptions as k,selectOptionsMap as B}from"../hooks/useSelectOption.js";var j=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:"请选择"},allowModify:{type:Boolean},allowCreate:{type:Boolean},shouldSave:{type:Boolean},consistentMenuWidth:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},aliasField:{type:String},menuProps:{type:Object},multiple:{type:Boolean},deletable:{type:Boolean,default:!0},selectAll:{type:Boolean,default:!0},searchByValue:{type:Boolean}},emits:["update:value"],setup(e,{emit:j}){const x=l("$xetable"),$=h(e,"value",j),q=o(null),{emitFormChangeWithParams:C}=O({...e,$table:x}),K=t((()=>e.labelField)),R=t((()=>e.valueField)),A=t((()=>e.aliasField)),{fullOptions:M,filterOptions:P,searchContent:_,remoteOptions:E}=S(e,{labelKey:K,valueKey:R}),{modifyEvent:H,modifyAbleRef:T,getOptionsWithCreated:V}=w(e,{searchContent:_,labelKey:K,valueKey:R,valueRef:$,fullOptions:M}),W=t((()=>V(T.value?M.value:P.value))),D=o(!1),I=b((async function(l=""){_.value=l;try{if(D.value=!0,!s(e.queryOptions)||!d(e.options))return;E.value=await e.queryOptions({keyword:l,row:e.row,column:e.column,rowIndex:e.rowIndex})}catch(l){console.log(`获取${e.column.field}options错误`)}finally{D.value=!1}}),400),L=l(F);function N(){U(),I()}async function U(l=!1){var o,t,n;if(!e.multiple)return;await a();const{refTableLeftBody:r,refTableBody:u}=x.getRefMaps(),i=null==(o=null==r?void 0:r.value)?void 0:o.$el;if(!i)return;const s=null==(t=null==u?void 0:u.value)?void 0:t.$el,d=x.getRowid(e.row),c=null==(n=s.querySelector(`.vxe-body--row[rowid="${d}"]`))?void 0:n.clientHeight;i.querySelector(`.vxe-body--row[rowid="${d}"]`).style.height=l?"unset":c+"px"}async function z(l,o){var t,n;const a=e.value;await H.updateValue(l,o);const r=k(L,e.column.field,e.row,x);L&&c(r)&&i(o).forEach((e=>{if(!p(e))return;const l=e;l.created&&l.shouldSave&&r.push(v(u(l),["created","shouldSave"]))}));const s=null==(t=e.column.editRender)?void 0:t.props;if(L&&(null==s?void 0:s.connectField)){const o=null==(n=s.connectField)?void 0:n.split(","),t=B.get(L);o.forEach((async o=>{var n;const{tableColumn:a}=x.reactData,r=a.find((e=>e.field===o)),u=null==(n=null==r?void 0:r.editRender)?void 0:n.props;if(null==u?void 0:u.queryOptions){const n=l?`${o}__${e.column.field}-${l}`:o;if(t[n])return;t[n]=await u.queryOptions({row:e.row,column:r,isFullData:!0,connectColumn:e.column})}}))}return C({oldValue:a,option:f(o)}),U()}function G(e){var l,o;"Tab"===e.key&&q.value&&(null==(o=(l=q.value).handleKeydown)||o.call(l,{...e,key:"Enter",preventDefault:e.preventDefault.bind(e)}))}n((()=>U(!0)));const{renderTag:J,renderLabel:Q,renderSelectAll:X}=g(e,{labelKey:K,valueKey:R,valueRef:$,showKey:A,searchContent:_});function Y(l){if(!e.multiple)return;const o=l?W.value.map((e=>e[R.value])):[];if(!m(o,$.value).length)return;const t=$.value;$.value=o,C({oldValue:t,option:l?W.value:[]})}const Z=()=>({class:"iho-table__selectOption"}),ee=t((()=>{var l,o;return{...e.menuProps,class:`iho-table__selectMenu ${null!=(o=null==(l=e.menuProps)?void 0:l.class)?o:""}`}}));return()=>{const l={};return e.multiple&&e.selectAll&&(l.action=()=>X(Y)),r(y,{ref:q.value,consistentMenuWidth:e.consistentMenuWidth,placeholder:e.placeholder,labelField:e.labelField,valueField:e.valueField,loading:D.value,options:W.value,multiple:e.multiple,value:e.value,remote:!0,onSearch:I,clearable:!0,filterable:!0,nodeProps:Z,menuProps:ee.value,renderTag:J,renderLabel:Q,onUpdateShow:N,onUpdateValue:z,onKeydown:G,onFocus:H.focus,onBlur:H.blur},l)}}});export{j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,inject as o,createVNode as t,mergeProps as l,onBeforeUnmount as n}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 a,IhoTableRenderHelper as c,IhoTableUtils as p}from"../../../../utils/index.js";import f from"./editSelect.js";import{getDefaultValue as m,isConnectField as v,getArray as w}from"./selectUtils.js";import{getSelectOptions as C,selectOptionsMap as E}from"../hooks/useSelectOption.js";import{cloneDeep as g,isEqual as
|
|
1
|
+
import{reactive as e,inject as o,createVNode as t,mergeProps as l,onBeforeUnmount as n}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 a,IhoTableRenderHelper as c,IhoTableUtils as p}from"../../../../utils/index.js";import f from"./editSelect.js";import{getDefaultValue as m,isConnectField as v,getArray as w}from"./selectUtils.js";import{getSelectOptions as C,selectOptionsMap as E}from"../hooks/useSelectOption.js";import{cloneDeep as g,isEqual as y}from"lodash-es";import{defineTablePlugin as h}from"../../../../hooks/useTablePlugin.js";function b(){const b="selectRendererPlugin",x=e(new Map);function k(e){return!0===e||"1"===e}return h({name:b,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:l,column:n,$table:r}){var d;const u=o(s),c=C(u,n.field,l,r),p=m(l,e,c),f=i(p).join(","),v=e&&(k(e.variableHeight)||(null==(d=e.componentProps)?void 0:d.indexedText));return[t("span",{title:a(n,f)},[v?i(p).reduce(((e,o)=>(null!=o&&e.push([o,";",t("br",null,null)]),e)),[]):f])]},renderEdit:c.createRenderEdit((({fieldItem:e,emitFormClick:n,row:i,column:r,$rowIndex:d,$table:u})=>{var a,c,p,m;const v=o(s),w=C(v,r.field,i,u),E=k(null!=(c=null==(a=e.componentProps)?void 0:a.allowModify)?c:e.allowModify),g=k(null!=(m=null==(p=e.componentProps)?void 0:p.allowCreate)?m:e.allowCreate)||E;return[t(f,l({queryOptions:e.queryOptions},e.componentProps,{options:w,column:r,row:i,"row-index":d,value:i[r.field],"onUpdate:value":e=>i[r.field]=e,allowModify:E,allowCreate:g,onClick:n}),null)]}))})},apply(e){async function o(e,o={}){var t,l,n;const i=null==(t=e.editRender)?void 0:t.props;if(!i)return[];let r=w(i.options)||w(null==(l=i.componentProps)?void 0:l.options)||[];if(i.queryOptions)try{const t={column:e,isFullData:!0,...o};r=await(null==(n=i.queryOptions)?void 0:n.call(i,t))}catch(e){console.log(`获取${i.field}_options错误`)}return r}d(e).bindAutoFocusConfig(b,r.SELECT,".n-base-selection-input,.n-base-selection-tags"),e.fieldHooks.fieldList.tap(b,((e,{uuid:t})=>{if(t){E.get(t)||E.set(t,{}),x.set(t,g(e));const l=E.get(t);e.forEach((async t=>{var n;const i=null==(n=t.editRender)?void 0:n.props;t.field&&i&&"SELECT"===p.getCellType(i)&&(l[t.field]||v(e,t.field)||(l[t.field]=[],l[t.field]=await o(t)))}))}return e})),e.dataHooks.data.tap(b,((e,{uuid:t},l)=>{if(!t)return;const n=x.get(t);if(!n||!n.length)return;const i=E.get(t);n.forEach((async t=>{var l;const r=null==(l=t.editRender)?void 0:l.props;if(t.field&&r&&"SELECT"===p.getCellType(r)&&(null==r?void 0:r.connectField)){const l=r.connectField.split(","),s=e[r.columnName];l.forEach((async l=>{const d=null==n?void 0:n.find((e=>e.field===l));if(!d)return;const u=s?`${l}__${r.columnName}-${s}`:l;i[u]||(i[u]=[],i[u]=await o(d,{row:e,connectColumn:t}))}))}}))})),e.setupHooks.setup.tap(b,(e=>{n((()=>{var o;const t=null==(o=e.value)?void 0:o.uuid;t&&(E.delete(t),x.delete(t))}))})),e.eventHooks.onCellDblclick.tap(b,(({$table:e},o,{emits:t})=>{var l;const{column:n,row:i}=e.reactData.editStore.actived;if(!n||!i)return;const s=null==(l=n.editRender)?void 0:l.props,{cellDblclickSelectable:d=!1,multiple:u=!1,valueField:a="value"}=s.componentProps||{};if(!d||!function(e){return e&&p.getCellType(e)===r.SELECT}(s))return;const c=o.uuid&&C(o.uuid,n.field,i,e);if(1!==(null==c?void 0:c.length))return;const f=u?[c[0][a]]:c[0][a],m=i[n.field];e.clearEdit(),y(f,m)||(i[n.field]=f,t("formChange",{column:n,row:i,oldValue:m,value:f,index:e.getRowIndex(i),$table:e,option:c[0]}))}))}})}export{b as selectRendererPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,inject as t,createVNode as a,toRaw as
|
|
1
|
+
import{reactive as e,inject as t,createVNode as a,toRaw as r,h as o,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 F(){const F="separateRendererPlugins",I=e(new Map);return O({name:F,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:r,row:o}){var n,i;const u=t(A),l=null!=(i=null==(n=H(u,o))?void 0:n.separateData)?i:{},s=g(r),d=(null==s?void 0:s.separateFormatter)?s.separateFormatter(l[r.field]):l[r.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=r(v),E.menu=l(v)?v:s(v)?e=>o(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)}():function(){var t;const r=null==(t=null==f?void 0:f.separateData)?void 0:t[n.field],o=l(e.separateFormatter)?e.separateFormatter(r):r;return[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":o,onClick:u},E)]}()}))})},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(F,E.SEPARATE,".iho-table__separateText"),e.eventHooks.onEditClosed.tap(F,(({row:e,column:t,$table:a},r,{emits:o})=>{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]})),r=l[c];l[c]=d(l[c])?e:e.join(""),o("formChange",{value:l[c],oldValue:r,row:l,column:t,index:p,$table:a}),null==s||s.updateTableDataRef()}})),e.fieldHooks.fieldList.tap(F,((e,{uuid:t})=>(t&&I.set(t,e.reduce(((e,t)=>(i(t,(t=>{k(t)&&(e.push(r(t)),t.showOverflow="ellipsis")})),e)),[])),e))),e.dataHooks.data.tapPromise(F,(async(e,t,{insertAfter:a,index:r,$table:o})=>{var n;if(!t.uuid)return;const i=I.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,r,o),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 r=p(u(a.separateBinder).map(s));if(!r.length)return;const o=r.concat(e),n=Math.max(...o.map((e=>e.data.length)));c(n).forEach((e=>{const t=o.map((t=>({item:t.data[e],data:t.data}))),a=t.map((({item:e})=>n(e)));if(1===f(a).length)return;const r=Math.max(...a);function n(e){return d(e)?e.length:1}t.forEach((({item:t,data:a})=>{const o=n(t);o!==r&&(d(t)?t.push(...x(r,o)):a[e]=c(r).map(((e,a)=>0===a?t:"")))}))}))})),l.forEach((e=>{e.data=_(e.data)})),c(C(l)).forEach(((o,n,i)=>{var u;const s=S(l,n),d={index:r,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=r,j(t.uuid,p,d),e.$__SEPARATE_DATA.push(s),a(p)}))})),e.eventHooks.onResizableChange.tap(F,(async(e,t,a)=>{a.updateTableDataRef()})),e.configHooks.editConfig.tap(F,((e={},t)=>{const a=e.beforeEditMethod;return e.beforeEditMethod=(...e)=>{var r;if(!t.uuid)return c();const o=I.get(t.uuid);if(!o||!o.length)return c();const{row:n,column:i}=e[0],u=H(t.uuid,n);if(!u)return c();const s=null==(r=i.editRender)?void 0:r.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(F,((e={},a)=>(e.checkMethod=t(e.checkMethod),e.visibleMethod=t(e.visibleMethod),e))),e.setupHooks.setup.tap(F,(e=>{n((()=>{e.value.uuid&&(I.delete(e.value.uuid),M(e.value.uuid))}))}))}})}export{F as separateRendererPlugins};
|
|
@@ -54,17 +54,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
54
54
|
isShow: import("vue").Ref<boolean>;
|
|
55
55
|
timePickerRef: import("vue").Ref<any>;
|
|
56
56
|
inputValue: import("vue").Ref<any>;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
} | {
|
|
60
|
-
style?: undefined;
|
|
61
|
-
}>;
|
|
62
|
-
__formattedValue: import("vue").WritableComputedRef<any>;
|
|
57
|
+
__formattedValue: import("vue").Ref<any>;
|
|
58
|
+
oldValue: any;
|
|
63
59
|
placeholder: any;
|
|
64
60
|
valueFormat: any;
|
|
65
61
|
timeConfig: AnyObject;
|
|
66
62
|
clickShortcutOption: (item: string) => void;
|
|
67
|
-
onUpdateFormattedValue: (value: string
|
|
63
|
+
onUpdateFormattedValue: (value: string) => void;
|
|
68
64
|
isDisabled: (value: string) => boolean;
|
|
69
65
|
onChange: () => void;
|
|
70
66
|
onKeydown: (event: KeyboardEvent) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as l,inject as t,ref as a,
|
|
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 d,createVNode as c,mergeProps as m,createElementBlock as v,Fragment as s,renderList as f,createTextVNode as p,toDisplayString as h,createCommentVNode as k}from"vue";import{NPopover as y,NInput as b,NSpace as _,NScrollbar as w,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,getHours as q,getMinutes as x,getSeconds as D,isValid as O,format as j}from"date-fns";var S=e({__name:"editTime",props:{formattedValue:{type:String},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0},shortcutOptions:{type:Array,default:()=>[]}},emits:["update:formattedValue","click"],setup(e,{emit:S}){const $=e,A=l(),H=t("$xetable"),{emitFormChangeWithParams:I}=V({...$,$table:H}),P=a(null),R=a(!1),E=a(),M=a(),U=a();let z=$.formattedValue;const{placeholder:K="请选择",valueFormat:N="HH:mm"}=A,T={...A,placeholder:K,valueFormat:N,format:N};function W(e){if(e&&B(e))return;if(U.value=e,z===e)return;const l=e||null;S("update:formattedValue",l),I({oldValue:z}),z=l}function B(e){var l,t,a;const r=F(e,T.format,new Date),o=q(r),u=x(r),i=D(r),n=null==(l=T.isHourDisabled)?void 0:l.call(T,o),d=null==(t=T.isMinuteDisabled)?void 0:t.call(T,u,o),c=null==(a=T.isSecondDisabled)?void 0:a.call(T,i,u,o);return!!n||(!!d||!!c)}function G(){[T.valueFormat.replace(/:/,""),T.valueFormat].some((e=>{const l=F(M.value,e,new Date);if(!M.value||O(l)){return W(M.value?j(l,T.valueFormat):""),!0}return!1}))}function J(e){var l;const{key:t}=e;"Enter"===t&&(null==(l=P.value)||l.blur(),R.value=!1)}return r((()=>$.formattedValue),(e=>{M.value=e,U.value=e}),{immediate:!0}),r((()=>R.value),(async e=>{var l,t,a,r,u;e&&(await o(),null==(u=null==(r=null==(a=null==(t=null==(l=E.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()})))})),(l,t)=>(u(),i(n(y),{show:R.value,trigger:"click",showArrow:!1,placement:"bottom-start",style:{padding:"0"},onClickoutside:t[3]||(t[3]=()=>R.value=!1)},{trigger:d((()=>[c(n(b),{ref_key:"formRef",ref:P,clearable:"",placeholder:n(K),value:M.value,"onUpdate:value":t[0]||(t[0]=e=>M.value=e),valueModifiers:{trim:!0},onClick:t[1]||(t[1]=()=>R.value=!0),onChange:G,onKeydown:J},null,8,["placeholder","value"])])),default:d((()=>[c(n(_),null,{default:d((()=>[c(n(C),m({ref_key:"timePickerRef",ref:E,show:"","formatted-value":U.value},n(T),{class:"iho-table__time-picker",to:!1,"onUpdate:formattedValue":W,onConfirm:t[2]||(t[2]=()=>R.value=!1)}),null,16,["formatted-value"]),c(n(w),{class:"iho-table__scrollbar"},{default:d((()=>[e.shortcutOptions.length?(u(),i(n(_),{key:0,vertical:"",wrap:!1},{default:d((()=>[(u(!0),v(s,null,f(e.shortcutOptions,(e=>(u(),i(n(g),{size:"tiny",key:e,disabled:B(e),onClick:l=>function(e){W(e),R.value=!1}(e)},{default:d((()=>[p(h(e),1)])),_:2},1032,["disabled","onClick"])))),128))])),_:1})):k("v-if",!0)])),_:1})])),_:1})])),_:1},8,["show"]))}});export{S as default};
|
package/es/components/iho-table/src/plugins/rendererPlugins/widgets/defaultRendererPlugin.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createVNode as n}from"vue";import"../../../../index.js";import{WIDGET_TYPE as
|
|
1
|
+
import{createVNode as n}from"vue";import"../../../../../../shared/utils/index.js";import{isObject as o,isArray as e}from"lodash-es";import"../../../../index.js";import{WIDGET_TYPE as t}from"../../../constants/index.js";import{parseMergeField as r,isRichContent as i,parseRichContent as l,getTitle as s}from"../../../utils/index.js";import{isMatchLowCodeCondition as c}from"../../../../../../shared/utils/business.js";import{defineTablePlugin as d}from"../../../hooks/useTablePlugin.js";function u(){return d({name:"defaultRendererPlugin",vxe(d){d.renderer.add(t.DEFAULT,{renderCell(t,{row:d,column:u}){const a=r(d,u),f=i(a)?function(o,e){const t=l(o);return[n("span",{title:s(e,t.change_text),style:{color:t.background||t.icon}},[r(t.icon),t.change_text])];function r(o){return o?o.match(/#[\da-f]{6}|[\da-f]{3}/i)?n("i",{class:"icon-dot",style:{"--table-icon-color":o,"--table-icon-shadow":o}},null):n("i",{class:t.icon},null):null}}(a,u):[a];return function(o,t,r,i){if(!e(o)||!o.length)return n("span",{title:s(r,i)},[i]);const l=o.find((n=>n.condition&&n.condition.find((n=>{const o=t[n.field_key||r.field];return c(o,n)}))));return n("span",l?{title:s(r,i),style:{color:l.color},class:l.icon}:{title:s(r,i)},[i])}(function(n){var e,t,r;const i=null==(e=n.editRender)?void 0:e.props;if(!o(i))return;return null!=(r=i.colorAndIcon)?r:null==(t=i.settingObj)?void 0:t.colorAndIcon}(u),d,u,f)}}),d.renderer.add(t.STATUS,d.renderer.get(t.DEFAULT))}})}export{u as defaultRendererPlugin};
|