cnhis-design-vue 3.1.33-beta.1 → 3.1.33-beta.10

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.
Files changed (104) hide show
  1. package/README.md +123 -123
  2. package/es/components/big-table/index.d.ts +1 -1
  3. package/es/components/big-table/src/BigTable.vue.d.ts +1 -1
  4. package/es/components/big-table/src/BigTable.vue2.js +8 -8
  5. package/es/components/big-table/src/components/edit-form/edit-time.js +7 -4
  6. package/es/components/fabric-chart/index.d.ts +389 -181
  7. package/es/components/fabric-chart/src/BirthProcessChart.vue.d.ts +181 -0
  8. package/es/components/fabric-chart/src/BirthProcessChart.vue.js +171 -0
  9. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +390 -182
  10. package/es/components/fabric-chart/src/FabricChart.vue.js +21 -327
  11. package/es/components/fabric-chart/src/TemperatureChart.vue.d.ts +214 -0
  12. package/es/components/fabric-chart/src/TemperatureChart.vue.js +358 -0
  13. package/es/components/fabric-chart/src/components/PopupMenu.js +2 -2
  14. package/es/components/fabric-chart/src/components/PopupTip.vue.d.ts +3 -2
  15. package/es/components/fabric-chart/src/hooks/index.d.ts +1 -0
  16. package/es/components/fabric-chart/src/hooks/index.js +2 -1
  17. package/es/components/fabric-chart/src/hooks/useBirthProcess.d.ts +26 -0
  18. package/es/components/fabric-chart/src/hooks/useBirthProcess.js +419 -0
  19. package/es/components/fabric-chart/src/hooks/useCenter.d.ts +0 -2
  20. package/es/components/fabric-chart/src/hooks/useCenter.js +4 -37
  21. package/es/components/fabric-chart/src/hooks/useCommon.d.ts +5 -0
  22. package/es/components/fabric-chart/src/hooks/useCommon.js +16 -0
  23. package/es/components/fabric-chart/src/hooks/useCumputedPoint.d.ts +9 -2
  24. package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +34 -1
  25. package/es/components/fabric-chart/src/hooks/useGrid.d.ts +2 -2
  26. package/es/components/fabric-chart/src/hooks/useGrid.js +28 -18
  27. package/es/components/fabric-chart/src/hooks/useLeft.d.ts +1 -1
  28. package/es/components/fabric-chart/src/hooks/useLeft.js +3 -1
  29. package/es/components/fabric-chart/src/interface.d.ts +24 -6
  30. package/es/components/fabric-chart/src/interface.js +0 -3
  31. package/es/components/fabric-chart/src/utils/utils.d.ts +11 -0
  32. package/es/components/fabric-chart/src/utils/utils.js +27 -0
  33. package/es/components/form-render/src/FormRender.vue.js +1 -0
  34. package/es/components/form-render/src/FormRenderWrapper.vue.js +5 -1
  35. package/es/components/form-render/src/components/renderer/radio.js +10 -3
  36. package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +2 -4
  37. package/es/components/form-render/src/hooks/useFormRenderOptions.js +14 -8
  38. package/es/components/form-render/src/types/index.d.ts +2 -1
  39. package/es/components/iho-table/index.d.ts +1 -0
  40. package/es/components/iho-table/index.js +1 -1
  41. package/es/components/iho-table/src/IhoTable.vue.d.ts +1 -0
  42. package/es/components/iho-table/src/IhoTable.vue.js +7 -1
  43. package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +1 -0
  44. package/es/components/iho-table/src/hooks/tapHooks/index.js +3 -1
  45. package/es/components/iho-table/src/hooks/tapHooks/useExposeHooks.d.ts +11 -0
  46. package/es/components/iho-table/src/hooks/tapHooks/useExposeHooks.js +26 -0
  47. package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +1 -2
  48. package/es/components/iho-table/src/plugins/filterPlugin/filter.vue.d.ts +2 -1
  49. package/es/components/iho-table/src/plugins/filterPlugin/filter.vue.js +17 -12
  50. package/es/components/iho-table/src/plugins/filterPlugin/index.js +16 -5
  51. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.js +8 -22
  52. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugin.js +9 -22
  53. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +11 -24
  54. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +8 -16
  55. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +10 -16
  56. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin.js +10 -23
  57. package/es/components/iho-table/src/types/index.d.ts +6 -1
  58. package/es/components/iho-table/src/types/index.js +1 -1
  59. package/es/components/iho-table/src/types/pluginType.d.ts +4 -0
  60. package/es/components/iho-table/src/types/pluginType.js +3 -1
  61. package/es/components/iho-table/src/utils/index.d.ts +10 -0
  62. package/es/components/iho-table/src/utils/index.js +34 -7
  63. package/es/components/iho-table/style/index.css +1 -1
  64. package/es/components/index.css +1 -1
  65. package/es/components/index.js +1 -1
  66. package/es/components/info-header/index.d.ts +2 -0
  67. package/es/components/info-header/src/InfoHeader.vue.d.ts +2 -0
  68. package/es/components/info-header/src/InfoHeader.vue.js +72 -56
  69. package/es/components/info-header/style/index.css +1 -1
  70. package/es/components/shortcut-provider/src/utils/index.d.ts +0 -1
  71. package/es/components/shortcut-provider/src/utils/index.js +26 -3
  72. package/es/components/shortcut-setter/src/ShortcutSetterItem.vue.js +3 -0
  73. package/es/shared/assets/img/failure.js +1 -1
  74. package/es/shared/assets/img/failure.png.js +1 -1
  75. package/es/shared/assets/img/icon-asc.js +1 -1
  76. package/es/shared/assets/img/icon-desc.js +1 -1
  77. package/es/shared/assets/img/no-permission.js +1 -1
  78. package/es/shared/assets/img/no-permission.png.js +1 -1
  79. package/es/shared/assets/img/nodata.js +1 -1
  80. package/es/shared/assets/img/nodata.png.js +1 -1
  81. package/es/shared/assets/img/notfound.js +1 -1
  82. package/es/shared/assets/img/notfound.png.js +1 -1
  83. package/es/shared/assets/img/qr.js +1 -1
  84. package/es/shared/assets/img/qr.png.js +1 -1
  85. package/es/shared/assets/img/success.js +1 -1
  86. package/es/shared/assets/img/success.png.js +1 -1
  87. package/es/shared/assets/img/video.js +1 -1
  88. package/es/shared/assets/img/video.png.js +1 -1
  89. package/es/shared/assets/img/video_default_cover.js +1 -1
  90. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  91. package/es/shared/assets/img/video_hover.js +1 -1
  92. package/es/shared/assets/img/video_play_hover.js +1 -1
  93. package/es/shared/assets/img/xb_big.js +1 -1
  94. package/es/shared/assets/img/xb_big.png.js +1 -1
  95. package/es/shared/assets/img/xb_small.js +1 -1
  96. package/es/shared/assets/img/xb_small.png.js +1 -1
  97. package/package.json +2 -2
  98. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  99. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  100. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  101. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  102. package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
  103. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  104. package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -1,6 +1,6 @@
1
- import { InjectionKey, Ref } from 'vue';
2
1
  import { fabric } from './utils';
3
2
  import { AnyObject } from '../../../../es/shared/types';
3
+ export declare type IMode = 'temperature' | 'birthProcess' | undefined;
4
4
  interface IEvent {
5
5
  selectable: boolean;
6
6
  evented: boolean;
@@ -107,15 +107,15 @@ export interface IData {
107
107
  width: number;
108
108
  height: number;
109
109
  borderStyle?: fabric.ILineOptions;
110
- selectionStyle?: any;
110
+ selectionStyle?: AnyObject;
111
111
  hospitalizationDate: string;
112
112
  grid: IGrid;
113
113
  other?: IOther;
114
114
  top: ITop;
115
115
  left: ILeft;
116
116
  right?: IRight;
117
- bottom: any;
118
- config?: any;
117
+ bottom: AnyObject;
118
+ config?: AnyObject;
119
119
  }
120
120
  export interface ICoordinateValue {
121
121
  x: number;
@@ -128,6 +128,24 @@ export interface ILineOptions extends fabric.ILineOptions {
128
128
  export interface ITextOptions extends fabric.ITextOptions {
129
129
  [key: string]: any;
130
130
  }
131
- export declare const InjectionCanvas: InjectionKey<Ref<fabric.Canvas>>;
132
- export declare const InjectionPropItems: InjectionKey<IPropItems>;
131
+ interface IBirthProcessOther {
132
+ fetalPresentationPositionLine?: fabric.ILineOptions;
133
+ alertLine?: fabric.ILineOptions;
134
+ processLine?: fabric.ILineOptions;
135
+ }
136
+ interface IBirthProcessXAxis {
137
+ time: AnyObject;
138
+ processTime: AnyObject;
139
+ }
140
+ export interface IBirthProcessData {
141
+ width: number;
142
+ height: number;
143
+ borderStyle?: fabric.ILineOptions;
144
+ selectionStyle?: AnyObject;
145
+ grid: AnyObject;
146
+ other?: IBirthProcessOther;
147
+ xAxis: IBirthProcessXAxis;
148
+ scaleValues: AnyObject[];
149
+ }
150
+ export declare type IObject = fabric.Object & AnyObject;
133
151
  export {};
@@ -1,4 +1 @@
1
- const InjectionCanvas = Symbol("canvas");
2
- const InjectionPropItems = Symbol("propItems");
3
1
 
4
- export { InjectionCanvas, InjectionPropItems };
@@ -0,0 +1,11 @@
1
+ import { IPoint } from '../interface';
2
+ import { AnyObject } from '../../../../../es/shared/types';
3
+ export declare function isEffectiveNode(node: IPoint): string | number | boolean;
4
+ /**
5
+ * @description: 根据断点分割数组
6
+ * @param {any} arr
7
+ * @return {[number, number][][]}
8
+ */
9
+ export declare function getPointArr(arr: AnyObject[]): AnyObject;
10
+ export declare function deleteProperty(data: AnyObject, list: AnyObject[]): void;
11
+ export declare function getIndex(time: string, list: AnyObject[]): number;
@@ -0,0 +1,27 @@
1
+ function isEffectiveNode(node) {
2
+ return (node == null ? void 0 : node.time) && ((node == null ? void 0 : node.value) || (node == null ? void 0 : node.value) === 0);
3
+ }
4
+ function getPointArr(arr) {
5
+ let _arr = [];
6
+ return arr.reduce((pre, cur, index) => {
7
+ var _a, _b;
8
+ _arr.push([cur.left, cur.top]);
9
+ if (((_b = (_a = cur.origin) == null ? void 0 : _a.data) == null ? void 0 : _b.breakpoint) || arr.length - 1 === index) {
10
+ pre.push(_arr);
11
+ _arr = [];
12
+ }
13
+ return pre;
14
+ }, []);
15
+ }
16
+ function deleteProperty(data, list) {
17
+ list.map((v) => v.type).forEach((key) => {
18
+ if (Reflect.has(data, key))
19
+ Reflect.deleteProperty(data, key);
20
+ });
21
+ }
22
+ function getIndex(time, list) {
23
+ const index = list.findIndex((v) => new Date(v.time).getTime() > new Date(time).getTime());
24
+ return !~index ? list.length : index;
25
+ }
26
+
27
+ export { deleteProperty, getIndex, getPointArr, isEffectiveNode };
@@ -146,6 +146,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
146
146
  }
147
147
  }
148
148
  expose({
149
+ formModel,
149
150
  validate(path = "*") {
150
151
  return formModel.validate(path).catch((err) => {
151
152
  return Promise.reject(Array.isArray(err) ? err.reduce(errInfoNormalize, []) : err);
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, openBlock, createBlock, nextTick } from 'vue';
1
+ import { defineComponent, ref, computed, openBlock, createBlock, nextTick } from 'vue';
2
2
  import FormRender from './FormRender.vue.js';
3
3
  import _export_sfc from '../../../_virtual/plugin-vue_export-helper.js';
4
4
 
@@ -29,6 +29,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
29
29
  }, {});
30
30
  expose({
31
31
  ...exposed,
32
+ formModel: computed(() => {
33
+ var _a;
34
+ return (_a = formRenderRef.value) == null ? void 0 : _a.formModel;
35
+ }),
32
36
  reload
33
37
  });
34
38
  return (_ctx, _cache) => {
@@ -4,8 +4,9 @@ import { isNumber } from 'lodash-es';
4
4
  import { NRadioGroup, NSpace, NRadio } from 'naive-ui';
5
5
  import '../../../index.js';
6
6
  import '../../utils/index.js';
7
+ import { useFormField } from '../../hooks/useFormField.js';
7
8
  import { useAutographOptions } from '../../hooks/useFormRenderOptions.js';
8
- import { assignUpdateValue } from '../../utils/schema.js';
9
+ import { visitedDecorator, assignUpdateValue } from '../../utils/schema.js';
9
10
  import { useCommonInjection } from '../../hooks/useCommonInjection.js';
10
11
 
11
12
  function _isSlot(s) {
@@ -57,21 +58,27 @@ const script = defineComponent({
57
58
  emit("update:value", v);
58
59
  }
59
60
  });
61
+ const {
62
+ field
63
+ } = useFormField();
60
64
  const {
61
65
  labelKey,
62
66
  valueKey,
63
67
  options
64
68
  } = useAutographOptions(props, valueRef);
65
69
  const {
66
- injectValueBindKey
70
+ injectValueBindKey,
71
+ injectValueValidate
67
72
  } = useCommonInjection();
73
+ injectValueValidate(valueRef);
68
74
  const key = injectValueBindKey(valueRef);
69
75
  return () => {
70
76
  let _slot;
71
77
  return createVNode(NRadioGroup, {
72
78
  "key": key.value,
73
79
  "value": valueRef.value,
74
- "onUpdate:value": ($event) => valueRef.value = $event
80
+ "onUpdate:value": ($event) => valueRef.value = $event,
81
+ "onClick": visitedDecorator(field)
75
82
  }, {
76
83
  default: () => [createVNode(NSpace, {
77
84
  "vertical": props.vertical
@@ -32,10 +32,8 @@ export declare function useAutographOptions(props: {
32
32
  lazyRequest?: boolean;
33
33
  options?: AnyObject[];
34
34
  }, valueRef: Ref): {
35
- valueRef: Ref<any>;
36
- options: import("vue").ComputedRef<AnyObject[]>;
37
- fetchData: (content?: string) => Promise<void>;
38
35
  labelKey: import("vue").ComputedRef<string>;
39
36
  valueKey: import("vue").ComputedRef<string>;
40
- lastSearch: Ref<string>;
37
+ options: import("vue").ComputedRef<AnyObject[]>;
38
+ fetchData: (content?: string) => Promise<null | undefined>;
41
39
  };
@@ -1,7 +1,7 @@
1
1
  import { jsonParse } from '../../../../shared/utils/index.js';
2
2
  import { useDebounceFn } from '@vueuse/core';
3
3
  import { isString, isEqual, omit, isFunction } from 'lodash-es';
4
- import { computed, inject, ref, watch, getCurrentInstance } from 'vue';
4
+ import { computed, inject, getCurrentInstance, ref, watch } from 'vue';
5
5
  import '../../index.js';
6
6
  import { InjectionAsyncQueue, InjectionFormItemDepsCollector } from '../constants/index.js';
7
7
  import { createUrlConfigParams, formRenderLog, optionMatcherWithKeyword } from '../utils/index.js';
@@ -115,6 +115,9 @@ function useRecommendOptions(props, options, emit, valueKey) {
115
115
  };
116
116
  }
117
117
  function useUrlConfigOptions(props, valueRef) {
118
+ if (!getCurrentInstance())
119
+ throw new Error("can't use this hook out of setup environment");
120
+ const asyncQueue = inject(InjectionAsyncQueue);
118
121
  const labelKey = computed(() => {
119
122
  var _a, _b;
120
123
  return (_b = (_a = props.urlConfig) == null ? void 0 : _a.nameKey) != null ? _b : "text";
@@ -123,10 +126,9 @@ function useUrlConfigOptions(props, valueRef) {
123
126
  var _a, _b;
124
127
  return (_b = (_a = props.urlConfig) == null ? void 0 : _a.valueKey) != null ? _b : "value";
125
128
  });
129
+ const remoteOptions = ref(null);
126
130
  const lastSearch = ref("");
127
131
  const { field, fieldKey } = useFormField();
128
- const remoteOptions = ref(null);
129
- const asyncQueue = inject(InjectionAsyncQueue);
130
132
  const fetchData = useDebounceFn(async function(content) {
131
133
  lastSearch.value = content || "";
132
134
  if (!props.urlConfig) {
@@ -188,9 +190,10 @@ function useAutographOptions(props, valueRef) {
188
190
  const { fieldKey } = useFormField();
189
191
  const { getSearchRequestInfo } = useFormRequest();
190
192
  const fetchData = useDebounceFn(async function(content) {
191
- if (!props.autograph || !props.wordbook)
192
- return;
193
193
  lastSearch.value = content || "";
194
+ if (!props.autograph || !props.wordbook) {
195
+ return remoteOptions.value = null;
196
+ }
194
197
  try {
195
198
  remoteOptions.value = await asyncQueue.addAsync(createParams(props.wordbook, props.autograph, fieldKey.value));
196
199
  } catch (e) {
@@ -209,8 +212,11 @@ function useAutographOptions(props, valueRef) {
209
212
  }
210
213
  }, 300);
211
214
  const options = computed(() => {
212
- var _a;
213
- return remoteOptions.value ? optionMatcherWithKeyword(remoteOptions.value, lastSearch.value, labelKey.value) : (_a = props.options) != null ? _a : [];
215
+ if (remoteOptions.value)
216
+ return optionMatcherWithKeyword(remoteOptions.value, lastSearch.value, labelKey.value);
217
+ if (!Array.isArray(props.options))
218
+ return [];
219
+ return optionMatcherWithKeyword(props.options, lastSearch.value, labelKey.value);
214
220
  });
215
221
  watch(
216
222
  () => props.wordbook,
@@ -224,7 +230,7 @@ function useAutographOptions(props, valueRef) {
224
230
  },
225
231
  { immediate: true }
226
232
  );
227
- return { valueRef, options, fetchData, labelKey, valueKey, lastSearch };
233
+ return { labelKey, valueKey, options, fetchData };
228
234
  }
229
235
 
230
236
  export { useAutographOptions, useRecommendOptions, useUrlConfigOptions };
@@ -1,5 +1,5 @@
1
1
  import { AnyObject, UndefinedAble } from '../../../../../es/shared/types';
2
- import { DataField, Field } from '@formily/core';
2
+ import { DataField, Field, Form } from '@formily/core';
3
3
  import { ISchema } from '@formily/json-schema/esm/types';
4
4
  import { Component, FunctionalComponent } from 'vue';
5
5
  import { FIELD_BUSINESS_TYPE } from '../../../../../es/components/form-render/src/constants';
@@ -26,6 +26,7 @@ export declare type FormAsyncQueue = AsyncQueue<FormAsyncQueueItem, any, AnyObje
26
26
  export declare type AgeContext = Record<'age' | 'day' | 'month' | 'year' | 'hours', number>;
27
27
  export declare type IdCardParseInfo = Record<'sex' | 'birthday', string> & AgeContext;
28
28
  export declare type FormRenderExpose = {
29
+ formModel: Form;
29
30
  validate(path?: string): Promise<unknown>;
30
31
  getFormValues(needCombineExtendKey?: boolean): AnyObject;
31
32
  setFormValues(values: AnyObject, needSplitExtendKey?: boolean): AnyObject;
@@ -111,6 +111,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
111
111
  dataHooks: import("../../../es/components/iho-table/src/types").AbstractDataHooks;
112
112
  setupHooks: import("../../../es/components/iho-table/src/types").AbstractSetupHooks;
113
113
  domInsertHooks: import("../../../es/components/iho-table/src/types").AbstractDomInsertHooks;
114
+ exposeHooks: import("../../../es/components/iho-table/src/types").AbstractExposeHooks;
114
115
  }>;
115
116
  configRef: import("vue").Ref<{
116
117
  [x: string]: unknown;
@@ -15,7 +15,7 @@ import '../../shared/utils/tapable/AsyncSeriesHook.js';
15
15
  import '../../shared/utils/tapable/AsyncSeriesBailHook.js';
16
16
  import '../../shared/utils/tapable/AsyncSeriesLoopHook.js';
17
17
  import '../../shared/utils/tapable/AsyncSeriesWaterfallHook.js';
18
- export { AbstractConfigHooks, AbstractDataHooks, AbstractDomInsertHooks, AbstractEventHooks, AbstractFieldHooks, AbstractSetupHooks } from './src/types/pluginType.js';
18
+ export { AbstractConfigHooks, AbstractDataHooks, AbstractDomInsertHooks, AbstractEventHooks, AbstractExposeHooks, AbstractFieldHooks, AbstractSetupHooks } from './src/types/pluginType.js';
19
19
  import { useTablePlugin } from './src/hooks/useTablePlugin.js';
20
20
  export { defineTablePlugin, useTablePlugin } from './src/hooks/useTablePlugin.js';
21
21
  export { useColumnConfigAdaptor } from './src/hooks/useColumnConfigAdaptor.js';
@@ -110,6 +110,7 @@ declare const _default: import("vue").DefineComponent<{
110
110
  dataHooks: import("../../../../es/components/iho-table/src/types").AbstractDataHooks;
111
111
  setupHooks: import("../../../../es/components/iho-table/src/types").AbstractSetupHooks;
112
112
  domInsertHooks: import("../../../../es/components/iho-table/src/types").AbstractDomInsertHooks;
113
+ exposeHooks: import("../../../../es/components/iho-table/src/types").AbstractExposeHooks;
113
114
  }>;
114
115
  configRef: import("vue").Ref<{
115
116
  [x: string]: unknown;
@@ -90,7 +90,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
90
90
  _updateFieldListRef();
91
91
  _updateTableDataRef();
92
92
  const { header, footer } = createDomInsertComponent(hooks);
93
- expose({ $table });
93
+ expose({
94
+ $table,
95
+ setFilter(fieldName, value) {
96
+ return { fieldName, value };
97
+ },
98
+ ...hooks.exposeHooks.expose.call({}, configRef)
99
+ });
94
100
  hooks.setupHooks.setup.call(configRef, fieldListRef);
95
101
  return (_ctx, _cache) => {
96
102
  const _component_vxe_table = resolveComponent("vxe-table");
@@ -10,6 +10,7 @@ export declare const createTableHooks: () => Readonly<{
10
10
  dataHooks: import("../../../../../../es/components/iho-table/src/types").AbstractDataHooks;
11
11
  setupHooks: import("../../../../../../es/components/iho-table/src/types").AbstractSetupHooks;
12
12
  domInsertHooks: import("../../../../../../es/components/iho-table/src/types").AbstractDomInsertHooks;
13
+ exposeHooks: import("../../../../../../es/components/iho-table/src/types").AbstractExposeHooks;
13
14
  }>;
14
15
  export declare function applyTableConfigHooks(hooks: TableHooks, config: IhoTableConfig): IhoTableConfig;
15
16
  export declare function applyTableFieldHooks(hooks: TableHooks, fieldList: IhoTableFieldItem[], config: IhoTableConfig): IhoTableFieldItem[];
@@ -5,6 +5,7 @@ import { VxeEventListenerNameList } from '../../constants/index.js';
5
5
  import { useDataHooks } from './useDataHooks.js';
6
6
  import { useDomInsertHooks } from './useDomInsertHooks.js';
7
7
  import { useEventHooks } from './useEventHooks.js';
8
+ import { useExposeHooks } from './useExposeHooks.js';
8
9
  import { useSetupHooks } from './useSetupHooks.js';
9
10
  import { getEventName } from '../../utils/index.js';
10
11
  import { useConfigHooks } from './useConfigHooks.js';
@@ -19,7 +20,8 @@ const createTableHooks = (() => {
19
20
  eventHooks: useEventHooks().create(),
20
21
  dataHooks: useDataHooks().create(),
21
22
  setupHooks: useSetupHooks().create(),
22
- domInsertHooks: useDomInsertHooks().create()
23
+ domInsertHooks: useDomInsertHooks().create(),
24
+ exposeHooks: useExposeHooks().create()
23
25
  });
24
26
  }
25
27
  return () => {
@@ -0,0 +1,11 @@
1
+ import { Func } from '../../../../../../es/shared/types';
2
+ import { SyncWaterfallHook } from '../../../../../../es/shared/utils/tapable';
3
+ import { Ref } from 'vue';
4
+ import { AbstractExposeHooks, IhoTableConfig } from '../../../../../../es/components/iho-table/src/types';
5
+ declare class ExposeHooks extends AbstractExposeHooks {
6
+ readonly expose: SyncWaterfallHook<[Record<string, Func<any[], any>>, Ref<IhoTableConfig>], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
7
+ }
8
+ export declare function useExposeHooks(): {
9
+ create: () => ExposeHooks;
10
+ };
11
+ export {};
@@ -0,0 +1,26 @@
1
+ import '../../../../../shared/utils/tapable/SyncHook.js';
2
+ import '../../../../../shared/utils/tapable/SyncBailHook.js';
3
+ import SyncWaterfallHook from '../../../../../shared/utils/tapable/SyncWaterfallHook.js';
4
+ import '../../../../../shared/utils/tapable/SyncLoopHook.js';
5
+ import '../../../../../shared/utils/tapable/AsyncParallelHook.js';
6
+ import '../../../../../shared/utils/tapable/AsyncParallelBailHook.js';
7
+ import '../../../../../shared/utils/tapable/AsyncSeriesHook.js';
8
+ import '../../../../../shared/utils/tapable/AsyncSeriesBailHook.js';
9
+ import '../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js';
10
+ import '../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js';
11
+ import { AbstractExposeHooks } from '../../types/pluginType.js';
12
+
13
+ class ExposeHooks extends AbstractExposeHooks {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.expose = new SyncWaterfallHook(["expose", "config"]);
17
+ }
18
+ }
19
+ function useExposeHooks() {
20
+ function create() {
21
+ return new ExposeHooks();
22
+ }
23
+ return { create };
24
+ }
25
+
26
+ export { useExposeHooks };
@@ -1,4 +1,4 @@
1
- import { cloneDeep, isString, isFunction, pick, isArray } from 'lodash-es';
1
+ import { cloneDeep, isString, isFunction, isArray } from 'lodash-es';
2
2
  import { isObject } from '@vue/shared';
3
3
 
4
4
  const REMOVE_PROPERTY = Symbol("remove property");
@@ -139,7 +139,6 @@ function useColumnConfigAdaptor() {
139
139
  }
140
140
  }
141
141
  });
142
- result.componentProps = pick(result, ["options", "multiple", "isDateDisabled"]);
143
142
  return result;
144
143
  function valueTransfer(value, rule) {
145
144
  var _a, _b;
@@ -53,8 +53,9 @@ declare const _default: import("vue").DefineComponent<{
53
53
  text: string;
54
54
  }[];
55
55
  setSortStatus: (value: IHO_TABLE_FILTER_STATUS) => void;
56
+ iconActive: import("vue").ComputedRef<number>;
56
57
  toggleFilter: () => void;
57
- FilterOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
58
+ FunnelSharp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
58
59
  ref: typeof ref;
59
60
  NButton: any;
60
61
  NButtonGroup: any;
@@ -1,15 +1,16 @@
1
- import { defineComponent, inject, toRefs, ref, onDeactivated, computed, openBlock, createElementBlock, createVNode, unref, withCtx, createTextVNode, toDisplayString, createElementVNode, Fragment, renderList, normalizeClass, isRef, normalizeStyle } from 'vue';
1
+ import { defineComponent, inject, toRefs, ref, onDeactivated, computed, openBlock, createElementBlock, createVNode, unref, withCtx, createTextVNode, toDisplayString, normalizeClass, createElementVNode, Fragment, renderList, isRef, normalizeStyle } from 'vue';
2
2
  import { widthAppend } from '../../../../../shared/utils/index.js';
3
- import { FilterOutline } from '@vicons/ionicons5';
3
+ import { FunnelSharp } from '@vicons/ionicons5';
4
4
  import { useVirtualList } from '@vueuse/core';
5
5
  import { InjectionIhoTableUUID, InjectionIhoTableEmits } from '../../constants/index.js';
6
6
  import { IHO_TABLE_FILTER_STATUS } from './types.js';
7
7
  import { NEllipsis, NPopover, NIcon, NInput, NCheckboxGroup, NCheckbox, NButtonGroup, NButton } from 'naive-ui';
8
8
  import _export_sfc from '../../../../../_virtual/plugin-vue_export-helper.js';
9
9
 
10
- const _hoisted_1 = { class: "iho-table__filterWrapper" };
11
- const _hoisted_2 = ["onClick"];
12
- const _hoisted_3 = { class: "iho-table__filterFooter" };
10
+ const _hoisted_1 = { style: { "display": "flex", "align-items": "center" } };
11
+ const _hoisted_2 = { class: "iho-table__filterWrapper" };
12
+ const _hoisted_3 = ["onClick"];
13
+ const _hoisted_4 = { class: "iho-table__filterFooter" };
13
14
  const _sfc_main = /* @__PURE__ */ defineComponent({
14
15
  __name: "filter",
15
16
  props: {
@@ -75,6 +76,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
75
76
  close();
76
77
  globEmit("sortChange", { type: "sort", value: sortStatus.value });
77
78
  }
79
+ const iconActive = computed(() => {
80
+ var _a, _b;
81
+ return ((_a = props.filterState) == null ? void 0 : _a.checked.length) || ((_b = props.filterState) == null ? void 0 : _b.sortStatus);
82
+ });
78
83
  function toggleFilter() {
79
84
  filterVisible.value = !filterVisible.value;
80
85
  if (filterVisible.value) {
@@ -85,7 +90,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
85
90
  }
86
91
  }
87
92
  return (_ctx, _cache) => {
88
- return openBlock(), createElementBlock("section", null, [
93
+ return openBlock(), createElementBlock("section", _hoisted_1, [
89
94
  createVNode(unref(NEllipsis), { style: { "max-width": "calc(100% - 22px)" } }, {
90
95
  default: withCtx(() => [
91
96
  createTextVNode(toDisplayString(__props.payload.column.title), 1)
@@ -98,19 +103,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
98
103
  }, {
99
104
  trigger: withCtx(() => [
100
105
  createVNode(unref(NIcon), {
101
- class: "iho-table__filterIcon",
102
- component: unref(FilterOutline),
106
+ class: normalizeClass(["iho-table__filterIcon", { "is-active": unref(iconActive) }]),
107
+ component: unref(FunnelSharp),
103
108
  onClick: toggleFilter
104
- }, null, 8, ["component"])
109
+ }, null, 8, ["class", "component"])
105
110
  ]),
106
111
  default: withCtx(() => [
107
- createElementVNode("section", _hoisted_1, [
112
+ createElementVNode("section", _hoisted_2, [
108
113
  (openBlock(), createElementBlock(Fragment, null, renderList(sortStatusList, (item) => {
109
114
  return createElementVNode("div", {
110
115
  key: item.status,
111
116
  class: normalizeClass(["iho-table__filterButton", { "iho-table__filterButton--active": unref(sortStatus) === item.status }]),
112
117
  onClick: ($event) => setSortStatus(item.status)
113
- }, toDisplayString(item.text), 11, _hoisted_2);
118
+ }, toDisplayString(item.text), 11, _hoisted_3);
114
119
  }), 64)),
115
120
  createVNode(unref(NInput), {
116
121
  value: searchFilterText.value,
@@ -146,7 +151,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
146
151
  ]),
147
152
  _: 1
148
153
  }, 8, ["value"]),
149
- createElementVNode("footer", _hoisted_3, [
154
+ createElementVNode("footer", _hoisted_4, [
150
155
  createElementVNode("section", null, toDisplayString(`\u5DF2\u9009\u62E9${unref(checked).length}\u9879`), 1),
151
156
  createVNode(unref(NButtonGroup), { size: "tiny" }, {
152
157
  default: withCtx(() => [
@@ -1,4 +1,4 @@
1
- import { isObject, isArray } from 'lodash-es';
1
+ import { isObject, pick, isArray } from 'lodash-es';
2
2
  import { h, onBeforeUnmount } from 'vue';
3
3
  import '../../../index.js';
4
4
  import { IHO_TABLE_NUMBER_STATUS, IHO_TABLE_STRING_STATUS } from '../../constants/index.js';
@@ -10,14 +10,14 @@ import { defineTablePlugin } from '../../hooks/useTablePlugin.js';
10
10
  function filterPlugin() {
11
11
  const pluginName = "filterPlugin";
12
12
  const { getItemFromUUID, removeItemFromUUID } = useUUIDMap(() => /* @__PURE__ */ new Map());
13
- function initFilterState(uuid, fieldName) {
13
+ function initFilterState(uuid, fieldName, initValue = {}) {
14
14
  const stateMap = getItemFromUUID(uuid);
15
15
  return stateMap.set(
16
16
  fieldName,
17
17
  stateMap.get(fieldName) || {
18
18
  options: [],
19
- checked: [],
20
- sortStatus: IHO_TABLE_FILTER_STATUS.DEFAULT
19
+ checked: initValue.checked || [],
20
+ sortStatus: initValue.sortStatus || IHO_TABLE_FILTER_STATUS.DEFAULT
21
21
  }
22
22
  ).get(fieldName);
23
23
  }
@@ -38,7 +38,7 @@ function filterPlugin() {
38
38
  if (isCompatibleColumn(lowCodeField)) {
39
39
  options = (_f = (_e = lowCodeField.options) == null ? void 0 : _e.map((option) => ({ ...option, key: option.label }))) != null ? _f : [];
40
40
  }
41
- const filterState = initFilterState(uuid, fieldItem.field);
41
+ const filterState = initFilterState(uuid, fieldItem.field, lowCodeField.filterDefaultValue);
42
42
  filterState.options = options;
43
43
  const oldHeader = (_g = fieldItem.slots) == null ? void 0 : _g.header;
44
44
  fieldItem.slots = {
@@ -55,6 +55,17 @@ function filterPlugin() {
55
55
  hooks.setupHooks.setup.tap(pluginName, (config) => {
56
56
  onBeforeUnmount(() => config.value.uuid && removeItemFromUUID(config.value.uuid));
57
57
  });
58
+ hooks.exposeHooks.expose.tap(pluginName, (expose, configRef) => {
59
+ return {
60
+ ...expose,
61
+ setFilter(fieldName, value) {
62
+ if (!configRef.value.uuid)
63
+ return;
64
+ const state = initFilterState(configRef.value.uuid, fieldName);
65
+ Object.assign(state, pick(value, ["checked", "sortStatus"]));
66
+ }
67
+ };
68
+ });
58
69
  function isCompatibleColumn(field) {
59
70
  const filterTypes = ["SEARCH", "SELECT", "RADIO", "CHECKBOX"];
60
71
  const notParticipatingSearch = field.notParticipatingSearch || "";
@@ -1,7 +1,7 @@
1
1
  import { createVNode, mergeProps } from 'vue';
2
2
  import '../../../../../index.js';
3
3
  import { EDITABLE_WIDGET_TYPE } from '../../../../constants/index.js';
4
- import { useIhoTableFormEvent } from '../../../../utils/index.js';
4
+ import { IhoTableRenderHelper } from '../../../../utils/index.js';
5
5
  import EditDate from './editDate.vue.js';
6
6
  import { defineTablePlugin } from '../../../../hooks/useTablePlugin.js';
7
7
 
@@ -11,38 +11,24 @@ function dateRendererPlugin() {
11
11
  name: pluginName,
12
12
  vxe(instance) {
13
13
  instance.renderer.add(EDITABLE_WIDGET_TYPE.DATE, {
14
- renderCell({
15
- props
16
- }, {
17
- row,
18
- column
19
- }) {
20
- return [createVNode("span", null, [row[column.field]])];
21
- },
22
- renderEdit({
23
- props
24
- }, {
14
+ renderCell: IhoTableRenderHelper.createDefaultRenderCell(),
15
+ renderEdit: IhoTableRenderHelper.createRenderEdit(({
16
+ fieldItem,
17
+ emitFormClick,
25
18
  row,
26
19
  column,
27
20
  $rowIndex
28
- }) {
29
- const {
30
- emitFormClick
31
- } = useIhoTableFormEvent({
32
- row,
33
- column,
34
- $rowIndex
35
- });
21
+ }) => {
36
22
  return [createVNode(EditDate, mergeProps({
37
23
  "value": row[column.field],
38
24
  "onUpdate:value": ($event) => row[column.field] = $event
39
- }, (props == null ? void 0 : props.componentProps) || {}, {
25
+ }, fieldItem.componentProps, {
40
26
  "column": column,
41
27
  "row": row,
42
28
  "index": $rowIndex,
43
29
  "onClick": emitFormClick
44
30
  }), null)];
45
- }
31
+ })
46
32
  });
47
33
  }
48
34
  });
@@ -2,7 +2,7 @@ import { createVNode, mergeProps } from 'vue';
2
2
  import { NInput } from 'naive-ui';
3
3
  import '../../../../index.js';
4
4
  import { EDITABLE_WIDGET_TYPE } from '../../../constants/index.js';
5
- import { useIhoTableFormEvent } from '../../../utils/index.js';
5
+ import { IhoTableRenderHelper } from '../../../utils/index.js';
6
6
  import { defineTablePlugin } from '../../../hooks/useTablePlugin.js';
7
7
 
8
8
  function inputRendererPlugin() {
@@ -11,34 +11,21 @@ function inputRendererPlugin() {
11
11
  name: pluginName,
12
12
  vxe(instance) {
13
13
  instance.renderer.add(EDITABLE_WIDGET_TYPE.INPUT, {
14
- renderCell(renderOpts, {
15
- row,
16
- column
17
- }) {
18
- return [createVNode("span", null, [row[column.field]])];
19
- },
20
- renderEdit({
21
- props
22
- }, {
14
+ renderCell: IhoTableRenderHelper.createDefaultRenderCell(),
15
+ renderEdit: IhoTableRenderHelper.createRenderEdit(({
16
+ fieldItem,
23
17
  row,
24
18
  column,
25
- $rowIndex
26
- }) {
27
- const {
28
- emitFormClick,
29
- emitFormChange
30
- } = useIhoTableFormEvent({
31
- row,
32
- column,
33
- $rowIndex
34
- });
19
+ emitFormChange,
20
+ emitFormClick
21
+ }) => {
35
22
  return [createVNode(NInput, mergeProps({
36
23
  "value": row[column.field],
37
24
  "onUpdate:value": ($event) => row[column.field] = $event,
38
25
  "onBlur": emitFormChange,
39
26
  "onClick": emitFormClick
40
- }, props == null ? void 0 : props.componentProps), null)];
41
- }
27
+ }, fieldItem.componentProps), null)];
28
+ })
42
29
  });
43
30
  }
44
31
  });