cnhis-design-vue 3.1.21-beta.7 → 3.1.21-beta.9

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 (30) hide show
  1. package/es/components/form-config/index.d.ts +1 -0
  2. package/es/components/form-config/src/FormConfig.vue.d.ts +1 -0
  3. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +1 -0
  4. package/es/components/form-render/index2.js +4 -6
  5. package/es/components/form-render/src/components/renderer/cascader.js +3 -5
  6. package/es/components/form-render/src/components/renderer/checkbox.js +2 -6
  7. package/es/components/form-render/src/components/renderer/combination.js +2 -5
  8. package/es/components/form-render/src/components/renderer/complex.js +1 -5
  9. package/es/components/form-render/src/components/renderer/date.js +1 -4
  10. package/es/components/form-render/src/components/renderer/formItem.js +1 -5
  11. package/es/components/form-render/src/components/renderer/radio.js +1 -4
  12. package/es/components/form-render/src/components/renderer/search.d.ts +0 -9
  13. package/es/components/form-render/src/components/renderer/search.js +6 -17
  14. package/es/components/form-render/src/components/renderer/select.d.ts +0 -9
  15. package/es/components/form-render/src/components/renderer/select.js +8 -19
  16. package/es/components/form-render/src/components/renderer/switch.js +2 -6
  17. package/es/components/form-render/src/components/renderer/textarea.js +2 -6
  18. package/es/components/form-render/src/hooks/useAnchor2.js +1 -4
  19. package/es/components/form-render/src/hooks/useBusinessBinding2.js +1 -4
  20. package/es/components/form-render/src/hooks/useFormItemDeps2.js +1 -5
  21. package/es/components/form-render/src/hooks/usePresetScope2.js +1 -5
  22. package/es/components/form-render/src/types/fieldItem.d.ts +1 -0
  23. package/es/components/form-render/src/utils/index.d.ts +4 -4
  24. package/es/components/form-render/src/utils/index.js +26 -8
  25. package/es/components/info-header/index.d.ts +28 -5
  26. package/es/components/info-header/src/InfoHeader.js +9 -10
  27. package/es/components/info-header/src/InfoHeader.vue.d.ts +29 -5
  28. package/es/components/shortcut-setter/index.d.ts +1 -0
  29. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -0
  30. package/package.json +2 -3
@@ -927,6 +927,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
927
927
  option?: {
928
928
  text: string;
929
929
  value: any;
930
+ keyword?: string | undefined;
930
931
  children?: any[] | undefined;
931
932
  }[] | undefined;
932
933
  multi_select?: import("..").FormCommonState | undefined;
@@ -929,6 +929,7 @@ declare const _default: import("vue").DefineComponent<{
929
929
  option?: {
930
930
  text: string;
931
931
  value: any;
932
+ keyword?: string | undefined;
932
933
  children?: any[] | undefined;
933
934
  }[] | undefined;
934
935
  multi_select?: import("../..").FormCommonState | undefined;
@@ -56,6 +56,7 @@ declare const _default: import("vue").DefineComponent<{}, {
56
56
  option?: {
57
57
  text: string;
58
58
  value: any;
59
+ keyword?: string | undefined;
59
60
  children?: any[] | undefined;
60
61
  }[] | undefined;
61
62
  multi_select?: import("../../../../../es/components/form-render").FormCommonState | undefined;
@@ -3,13 +3,9 @@ import { safeComponentRegister } from '../../shared/utils/index2.js';
3
3
  import script from './src/FormRender.js';
4
4
  import '@vueuse/core';
5
5
  import 'lodash-es';
6
- import 'vue';
7
- import '@formily/path';
8
- import '@vue/shared';
9
- import 'pinyin-match';
10
- import 'date-fns';
11
- export * from '@formily/core';
6
+ import './src/utils/index.js';
12
7
  import '@formily/vue';
8
+ import 'vue';
13
9
  import '../../shared/utils/tapable/SyncHook.js';
14
10
  import '../../shared/utils/tapable/SyncBailHook.js';
15
11
  import '../../shared/utils/tapable/SyncWaterfallHook.js';
@@ -20,6 +16,8 @@ import '../../shared/utils/tapable/AsyncSeriesHook.js';
20
16
  import '../../shared/utils/tapable/AsyncSeriesBailHook.js';
21
17
  import '../../shared/utils/tapable/AsyncSeriesLoopHook.js';
22
18
  import '../../shared/utils/tapable/AsyncSeriesWaterfallHook.js';
19
+ export * from '@formily/core';
20
+ import '@vue/shared';
23
21
  import './src/components/renderer/input.js';
24
22
  import './src/components/renderer/select.js';
25
23
  import './src/components/renderer/formItem.js';
@@ -5,11 +5,7 @@ import { useCommonInjection } from '../../hooks/useCommonInjection2.js';
5
5
  import { InjectAsyncQueue } from '../../constants/index2.js';
6
6
  import '@vueuse/core';
7
7
  import '../../../index2.js';
8
- import '@formily/path';
9
- import '@vue/shared';
10
- import 'pinyin-match';
11
- import 'date-fns';
12
- import { assignUpdateValue, assignValueBindKey, traverseDependKey } from '../../utils/schema2.js';
8
+ import '../../utils/index.js';
13
9
  import { useFormField } from '../../hooks/useFormField2.js';
14
10
  import '../../../../../shared/utils/tapable/SyncHook.js';
15
11
  import '../../../../../shared/utils/tapable/SyncBailHook.js';
@@ -21,6 +17,7 @@ import '../../../../../shared/utils/tapable/AsyncSeriesHook.js';
21
17
  import '../../../../../shared/utils/tapable/AsyncSeriesBailHook.js';
22
18
  import '../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js';
23
19
  import '../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js';
20
+ import '@vue/shared';
24
21
  import { connect, mapProps } from '@formily/vue';
25
22
  import './input.js';
26
23
  import './select.js';
@@ -41,6 +38,7 @@ import './complex.js';
41
38
  import './simpleComponent.js';
42
39
  import './search.js';
43
40
  import { NCascader } from 'naive-ui';
41
+ import { assignUpdateValue, assignValueBindKey, traverseDependKey } from '../../utils/schema2.js';
44
42
 
45
43
  const script = defineComponent({
46
44
  name: "FormCascader",
@@ -1,12 +1,8 @@
1
1
  import { defineComponent, createVNode } from 'vue';
2
- import '@formily/path';
3
- import '@vue/shared';
4
- import 'lodash-es';
5
- import 'pinyin-match';
6
- import 'date-fns';
7
- import { assignUpdateValue, assignValueBindKey } from '../../utils/schema2.js';
2
+ import '../../utils/index.js';
8
3
  import { connect, mapProps } from '@formily/vue';
9
4
  import { NCheckboxGroup, NSpace, NCheckbox } from 'naive-ui';
5
+ import { assignUpdateValue, assignValueBindKey } from '../../utils/schema2.js';
10
6
 
11
7
  const script = defineComponent({
12
8
  name: "FormCheckbox",
@@ -4,13 +4,10 @@ import '../../../index2.js';
4
4
  import { useField, RecursionField, connect } from '@formily/vue';
5
5
  import { NButton, NIcon } from 'naive-ui';
6
6
  import { InjectionBusinessCollector } from '../../constants/index2.js';
7
- import '@formily/path';
8
- import '@vue/shared';
9
- import 'pinyin-match';
10
- import 'date-fns';
11
- import { createObjSchema } from '../../utils/schema2.js';
7
+ import '../../utils/index.js';
12
8
  import { AddCircleOutline, RemoveCircle } from '@vicons/ionicons5';
13
9
  import { useFieldListAdaptor } from '../../hooks/useFieldListAdaptor2.js';
10
+ import { createObjSchema } from '../../utils/schema2.js';
14
11
 
15
12
  const script = defineComponent({
16
13
  name: "FormCombination",
@@ -1,10 +1,6 @@
1
1
  import { defineComponent, createVNode } from 'vue';
2
2
  import { connect, mapProps } from '@formily/vue';
3
- import '@formily/path';
4
- import '@vue/shared';
5
- import 'lodash-es';
6
- import 'pinyin-match';
7
- import 'date-fns';
3
+ import '../../utils/index.js';
8
4
  import { assignUpdateValue } from '../../utils/schema2.js';
9
5
 
10
6
  const script = defineComponent({
@@ -5,10 +5,7 @@ import { isObject } from '@vueuse/core';
5
5
  import { format } from 'date-fns';
6
6
  import { NDatePicker } from 'naive-ui';
7
7
  import { useCommonInjection } from '../../hooks/useCommonInjection2.js';
8
- import '@formily/path';
9
- import '@vue/shared';
10
- import 'lodash-es';
11
- import 'pinyin-match';
8
+ import '../../utils/index.js';
12
9
  import { assignUpdateValue, assignValueBindKey } from '../../utils/schema2.js';
13
10
 
14
11
  const script = defineComponent({
@@ -4,11 +4,7 @@ import { useField, connect, mapProps } from '@formily/vue';
4
4
  import { NFormItem } from 'naive-ui';
5
5
  import Annotation from '../../../../annotation-edit/index2.js';
6
6
  import { InjectionAnnotation, InjectionFormUUID } from '../../constants/index2.js';
7
- import '@formily/path';
8
- import '@vue/shared';
9
- import 'lodash-es';
10
- import 'pinyin-match';
11
- import 'date-fns';
7
+ import '../../utils/index.js';
12
8
  import { dotEscape } from '../../utils/schema2.js';
13
9
 
14
10
  const script = defineComponent({
@@ -2,10 +2,7 @@ import { defineComponent, computed, createVNode } from 'vue';
2
2
  import { connect, mapProps } from '@formily/vue';
3
3
  import { isNumber } from 'lodash-es';
4
4
  import { NRadioGroup, NSpace, NRadio } from 'naive-ui';
5
- import '@formily/path';
6
- import '@vue/shared';
7
- import 'pinyin-match';
8
- import 'date-fns';
5
+ import '../../utils/index.js';
9
6
  import { assignUpdateValue, assignValueBindKey } from '../../utils/schema2.js';
10
7
 
11
8
  const script = defineComponent({
@@ -27,10 +27,6 @@ export declare const SEARCH: import("vue").DefineComponent<{
27
27
  onFocus: {
28
28
  type: PropType<Func<any[], any>>;
29
29
  };
30
- pinyin: {
31
- type: BooleanConstructor;
32
- default: boolean;
33
- };
34
30
  onChange: {};
35
31
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
36
32
  value: {
@@ -59,14 +55,9 @@ export declare const SEARCH: import("vue").DefineComponent<{
59
55
  onFocus: {
60
56
  type: PropType<Func<any[], any>>;
61
57
  };
62
- pinyin: {
63
- type: BooleanConstructor;
64
- default: boolean;
65
- };
66
58
  onChange: {};
67
59
  }>> & {
68
60
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
69
61
  }, {
70
62
  lazyRequest: boolean;
71
- pinyin: boolean;
72
63
  }>;
@@ -1,10 +1,10 @@
1
1
  import { defineComponent, computed, ref, inject, watch, createVNode } from 'vue';
2
- import { cloneDeep, isEqual, isString } from 'lodash-es';
2
+ import { useDebounceFn } from '@vueuse/core';
3
+ import { isString, cloneDeep, isEqual } from 'lodash-es';
3
4
  import { useCommonInjection } from '../../hooks/useCommonInjection2.js';
4
5
  import { InjectAsyncQueue, InjectionChangeContextCollector } from '../../constants/index2.js';
5
- import '@vueuse/core';
6
6
  import '../../../index2.js';
7
- import { stringMatcher, formRenderLog } from '../../utils/index.js';
7
+ import { formRenderLog, optionMatcher } from '../../utils/index.js';
8
8
  import { useFormRequest } from '../../hooks/useFormRequest2.js';
9
9
  import { useFormField } from '../../hooks/useFormField2.js';
10
10
  import '../../../../../shared/utils/tapable/SyncHook.js';
@@ -62,10 +62,6 @@ const script = defineComponent({
62
62
  onFocus: {
63
63
  type: Function
64
64
  },
65
- pinyin: {
66
- type: Boolean,
67
- default: true
68
- },
69
65
  onChange: {}
70
66
  },
71
67
  emits: ["update:value"],
@@ -95,7 +91,7 @@ const script = defineComponent({
95
91
  const {
96
92
  getSearchRequestInfo
97
93
  } = useFormRequest();
98
- async function fetchData(content) {
94
+ const fetchData = useDebounceFn(async function(content) {
99
95
  lastSearch.value = content || "";
100
96
  if (remoteOptions.value)
101
97
  return;
@@ -119,16 +115,9 @@ const script = defineComponent({
119
115
  key: key2
120
116
  };
121
117
  }
122
- }
118
+ }, 300);
123
119
  const parsedOptions = computed(() => {
124
- return remoteOptions.value ? filterOption(remoteOptions.value, lastSearch.value) : [];
125
- function filterOption(options, searchContent) {
126
- return options.filter((option) => {
127
- return !searchContent || stringMatcher(searchContent, option[labelKey.value], {
128
- pinyin: props.pinyin
129
- });
130
- });
131
- }
120
+ return remoteOptions.value ? optionMatcher(remoteOptions.value, lastSearch.value, labelKey.value) : [];
132
121
  });
133
122
  const changeContextCollector = inject(InjectionChangeContextCollector);
134
123
  changeContextCollector.setContext(fieldKey.value, (v) => {
@@ -19,10 +19,6 @@ export declare const SELECT: import("vue").DefineComponent<{
19
19
  onFocus: {
20
20
  type: PropType<Func<any[], any>>;
21
21
  };
22
- pinyin: {
23
- type: BooleanConstructor;
24
- default: boolean;
25
- };
26
22
  onChange: {};
27
23
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
28
24
  value: {
@@ -42,15 +38,10 @@ export declare const SELECT: import("vue").DefineComponent<{
42
38
  onFocus: {
43
39
  type: PropType<Func<any[], any>>;
44
40
  };
45
- pinyin: {
46
- type: BooleanConstructor;
47
- default: boolean;
48
- };
49
41
  onChange: {};
50
42
  }>> & {
51
43
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
52
44
  }, {
53
45
  options: AnyObject[];
54
46
  lazyRequest: boolean;
55
- pinyin: boolean;
56
47
  }>;
@@ -1,11 +1,11 @@
1
1
  import { defineComponent, computed, ref, inject, watch, createVNode } from 'vue';
2
2
  import { isField } from '@formily/core';
3
- import { cloneDeep, isEqual, isString } from 'lodash-es';
3
+ import { useDebounceFn } from '@vueuse/core';
4
+ import { isString, cloneDeep, isEqual } from 'lodash-es';
4
5
  import { useCommonInjection } from '../../hooks/useCommonInjection2.js';
5
6
  import { InjectAsyncQueue, InjectionChangeContextCollector, InjectionFormItemDepsCollector } from '../../constants/index2.js';
6
- import '@vueuse/core';
7
7
  import '../../../index2.js';
8
- import { stringMatcher, formRenderLog } from '../../utils/index.js';
8
+ import { formRenderLog, optionMatcher } from '../../utils/index.js';
9
9
  import { useFormField } from '../../hooks/useFormField2.js';
10
10
  import '../../../../../shared/utils/tapable/SyncHook.js';
11
11
  import '../../../../../shared/utils/tapable/SyncBailHook.js';
@@ -38,7 +38,7 @@ import './complex.js';
38
38
  import './simpleComponent.js';
39
39
  import './search.js';
40
40
  import { NSelect } from 'naive-ui';
41
- import { focusDecorator, assignUpdateValue, traverseDependKey } from '../../utils/schema2.js';
41
+ import { traverseDependKey, focusDecorator, assignUpdateValue } from '../../utils/schema2.js';
42
42
 
43
43
  const script = defineComponent({
44
44
  name: "FormSelect",
@@ -60,10 +60,6 @@ const script = defineComponent({
60
60
  onFocus: {
61
61
  type: Function
62
62
  },
63
- pinyin: {
64
- type: Boolean,
65
- default: true
66
- },
67
63
  onChange: {}
68
64
  },
69
65
  emits: ["update:value"],
@@ -90,7 +86,7 @@ const script = defineComponent({
90
86
  fieldKey
91
87
  } = useFormField();
92
88
  const asyncQueue = inject(InjectAsyncQueue);
93
- async function fetchData(content) {
89
+ const fetchData = useDebounceFn(async function(content) {
94
90
  lastSearch.value = content || "";
95
91
  if (!configFor(props)) {
96
92
  return remoteOptions.value = null;
@@ -126,20 +122,13 @@ const script = defineComponent({
126
122
  function configFor(target) {
127
123
  return target.urlConfig;
128
124
  }
129
- }
125
+ }, 300);
130
126
  const parsedOptions = computed(() => {
131
127
  if (remoteOptions.value)
132
- return filterOption(remoteOptions.value, lastSearch.value);
128
+ return optionMatcher(remoteOptions.value, lastSearch.value, labelKey.value);
133
129
  if (!Array.isArray(props.options))
134
130
  return [];
135
- return filterOption(props.options, lastSearch.value);
136
- function filterOption(options, searchContent) {
137
- return options.filter((option) => {
138
- return !searchContent || stringMatcher(searchContent, option[labelKey.value], {
139
- pinyin: props.pinyin
140
- });
141
- });
142
- }
131
+ return optionMatcher(props.options, lastSearch.value, labelKey.value);
143
132
  });
144
133
  const changeContextCollector = inject(InjectionChangeContextCollector);
145
134
  changeContextCollector.setContext(fieldKey.value, (v) => {
@@ -1,12 +1,8 @@
1
1
  import { defineComponent, computed, createVNode, createTextVNode } from 'vue';
2
2
  import { NSwitch } from 'naive-ui';
3
- import '@formily/path';
4
- import '@vue/shared';
5
- import 'lodash-es';
6
- import 'pinyin-match';
7
- import 'date-fns';
8
- import { assignUpdateValue, assignValueBindKey } from '../../utils/schema2.js';
3
+ import '../../utils/index.js';
9
4
  import { connect, mapProps } from '@formily/vue';
5
+ import { assignUpdateValue, assignValueBindKey } from '../../utils/schema2.js';
10
6
 
11
7
  const script = defineComponent({
12
8
  name: "FormSwitch",
@@ -1,13 +1,9 @@
1
1
  import { defineComponent, computed, createVNode } from 'vue';
2
2
  import { useCommonInjection } from '../../hooks/useCommonInjection2.js';
3
- import '@formily/path';
4
- import '@vue/shared';
5
- import 'lodash-es';
6
- import 'pinyin-match';
7
- import 'date-fns';
8
- import { assignUpdateValue } from '../../utils/schema2.js';
3
+ import '../../utils/index.js';
9
4
  import { connect, mapProps } from '@formily/vue';
10
5
  import { NInput } from 'naive-ui';
6
+ import { assignUpdateValue } from '../../utils/schema2.js';
11
7
 
12
8
  const script = defineComponent({
13
9
  name: "FormTextarea",
@@ -3,10 +3,7 @@ import { useDebounceFn } from '@vueuse/core';
3
3
  import { isNumber } from 'lodash-es';
4
4
  import { ref, computed, watch, nextTick } from 'vue';
5
5
  import { FormItemLineBarDepKeyPrepend } from '../constants/index2.js';
6
- import '@formily/path';
7
- import '@vue/shared';
8
- import 'pinyin-match';
9
- import 'date-fns';
6
+ import '../utils/index.js';
10
7
  import { createLinebarId, traverseSchema } from '../utils/schema2.js';
11
8
 
12
9
  function useAnchor(props, scrollbarRef, collector) {
@@ -2,10 +2,7 @@ import { isField } from '@formily/core';
2
2
  import { isString } from '@vueuse/core';
3
3
  import { isFunction, isNumber } from 'lodash-es';
4
4
  import { FIELD_BUSINESS_TYPE } from '../constants/index2.js';
5
- import 'vue';
6
- import '@formily/path';
7
- import '@vue/shared';
8
- import 'pinyin-match';
5
+ import '../utils/index.js';
9
6
  import { isIdCard, parseIdCard, parseAge2FromContext, parseBirthday, parseAge2Birthday } from '../utils/business2.js';
10
7
 
11
8
  class BusinessCollector {
@@ -1,9 +1,5 @@
1
1
  import { isFunction } from 'lodash-es';
2
- import 'vue';
3
- import '@formily/path';
4
- import '@vue/shared';
5
- import 'pinyin-match';
6
- import 'date-fns';
2
+ import '../utils/index.js';
7
3
  import { traverseDependKey } from '../utils/schema2.js';
8
4
 
9
5
  class FormItemDepsCollector {
@@ -1,10 +1,6 @@
1
1
  import { isString } from 'lodash-es';
2
- import 'vue';
3
- import '@formily/path';
4
- import '@vue/shared';
5
- import 'pinyin-match';
2
+ import '../utils/index.js';
6
3
  import { isIdCard, isMobile } from '../utils/business2.js';
7
- import '@formily/core';
8
4
 
9
5
  function usePresetScope() {
10
6
  return {
@@ -25,6 +25,7 @@ export declare type ValidateItem = Partial<{
25
25
  interface OptionItem {
26
26
  text: string;
27
27
  value: any;
28
+ keyword?: string;
28
29
  children?: OptionItem[];
29
30
  }
30
31
  interface FormRendererPayload {
@@ -1,4 +1,4 @@
1
- import { AnyObject, ArrayAble } from '../../../../../es/shared/types';
1
+ import { AnyObject, ArrayAble, Nullable } from '../../../../../es/shared/types';
2
2
  import { FunctionalComponent, InjectionKey, VNode } from 'vue';
3
3
  import { FieldItem } from '../types';
4
4
  export * from './business';
@@ -15,6 +15,6 @@ export declare function createSlot(renderer: unknown, props: AnyObject): Record<
15
15
  };
16
16
  export declare function createInputSlot(props: AnyObject): import("vue").ComputedRef<Record<string, FunctionalComponent<{}, {}>>>;
17
17
  export declare function presetRequestHandler(res: unknown): any;
18
- export declare function stringMatcher(input: unknown, target: unknown, options?: {
19
- pinyin?: boolean;
20
- }): boolean | [number, number];
18
+ export declare function optionMatcher(options: AnyObject[], input: Nullable<string>, key: string, matcherOption?: {
19
+ keyword?: string;
20
+ }): AnyObject[];
@@ -1,8 +1,8 @@
1
1
  import { computed, createVNode, Fragment, inject, provide } from 'vue';
2
2
  import { Path } from '@formily/path';
3
3
  import { isObject } from '@vue/shared';
4
+ import { useMemoize } from '@vueuse/core';
4
5
  import { isString, isFunction } from 'lodash-es';
5
- import PinyinMatch from 'pinyin-match';
6
6
  import 'date-fns';
7
7
  import '@formily/core';
8
8
 
@@ -112,12 +112,30 @@ function presetRequestHandler(res) {
112
112
  return map.rows;
113
113
  }
114
114
  }
115
- function stringMatcher(input, target, options = {}) {
116
- if (!isString(input) || !isString(target))
117
- return true;
118
- if (options.pinyin)
119
- return PinyinMatch.match(target, input);
120
- return target.includes(input);
115
+ const keywordMatcher = useMemoize(function(text, keyword) {
116
+ if (!isString(keyword) || !isString(text))
117
+ return false;
118
+ return keyword.split(",").some((k) => k.trim().includes(text));
119
+ }, {
120
+ getKey(...args) {
121
+ return args.reduce((res, arg) => {
122
+ return String(res) + "_" + String(arg);
123
+ }, "");
124
+ }
125
+ });
126
+ function optionMatcher(options, input, key, matcherOption = {
127
+ keyword: "keyword"
128
+ }) {
129
+ if (!input)
130
+ return options;
131
+ return options.filter((option) => {
132
+ if (!isString(keyFor(option)))
133
+ return;
134
+ return keyFor(option).includes(input) || matcherOption.keyword && keywordMatcher(input, option[matcherOption.keyword]);
135
+ });
136
+ function keyFor(option) {
137
+ return option[key];
138
+ }
121
139
  }
122
140
 
123
- export { arrayed, createInputSlot, createSlot, formRenderLog, injectOrProvide, mergeDeepProperties, parseNumberFromMaybeString, presetRequestHandler, stringMatcher, uuidGenerator };
141
+ export { arrayed, createInputSlot, createSlot, formRenderLog, injectOrProvide, mergeDeepProperties, optionMatcher, parseNumberFromMaybeString, presetRequestHandler, uuidGenerator };
@@ -15,8 +15,12 @@ declare const InfoHeader: SFCWithInstall<import("vue").DefineComponent<{
15
15
  age: string;
16
16
  ageUnit?: string | undefined;
17
17
  tagList?: Partial<{
18
- type: "warning" | "info";
18
+ type?: "warning" | "info" | undefined;
19
19
  content: string;
20
+ color?: {
21
+ color?: string | undefined;
22
+ textColor?: string | undefined;
23
+ } | undefined;
20
24
  }>[] | undefined;
21
25
  }>>;
22
26
  default: () => {};
@@ -58,8 +62,12 @@ declare const InfoHeader: SFCWithInstall<import("vue").DefineComponent<{
58
62
  age: string;
59
63
  ageUnit?: string | undefined;
60
64
  tagList?: Partial<{
61
- type: "warning" | "info";
65
+ type?: "warning" | "info" | undefined;
62
66
  content: string;
67
+ color?: {
68
+ color?: string | undefined;
69
+ textColor?: string | undefined;
70
+ } | undefined;
63
71
  }>[] | undefined;
64
72
  }>>;
65
73
  default: () => {};
@@ -93,7 +101,14 @@ declare const InfoHeader: SFCWithInstall<import("vue").DefineComponent<{
93
101
  toggleCompact: () => void;
94
102
  openPatientInfo: () => void;
95
103
  fieldSet: () => void;
96
- getTagColor: (type: "warning" | "info") => {
104
+ getTagColor: ({ type }: Partial<{
105
+ type?: "warning" | "info" | undefined;
106
+ content: string;
107
+ color?: {
108
+ color?: string | undefined;
109
+ textColor?: string | undefined;
110
+ } | undefined;
111
+ }>) => {
97
112
  color: string;
98
113
  textColor: string;
99
114
  };
@@ -286,8 +301,12 @@ declare const InfoHeader: SFCWithInstall<import("vue").DefineComponent<{
286
301
  age: string;
287
302
  ageUnit?: string | undefined;
288
303
  tagList?: Partial<{
289
- type: "warning" | "info";
304
+ type?: "warning" | "info" | undefined;
290
305
  content: string;
306
+ color?: {
307
+ color?: string | undefined;
308
+ textColor?: string | undefined;
309
+ } | undefined;
291
310
  }>[] | undefined;
292
311
  }>>;
293
312
  default: () => {};
@@ -324,8 +343,12 @@ declare const InfoHeader: SFCWithInstall<import("vue").DefineComponent<{
324
343
  age: string;
325
344
  ageUnit?: string | undefined;
326
345
  tagList?: Partial<{
327
- type: "warning" | "info";
346
+ type?: "warning" | "info" | undefined;
328
347
  content: string;
348
+ color?: {
349
+ color?: string | undefined;
350
+ textColor?: string | undefined;
351
+ } | undefined;
329
352
  }>[] | undefined;
330
353
  }>;
331
354
  labelField: string;
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, nextTick, onMounted, watch, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, createCommentVNode, Fragment, toDisplayString, renderList, withDirectives, createBlock, unref, withCtx, createTextVNode, vShow, createVNode } from 'vue';
1
+ import { defineComponent, ref, nextTick, onMounted, watch, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, createCommentVNode, Fragment, toDisplayString, renderList, withDirectives, createBlock, unref, mergeProps, withCtx, createTextVNode, vShow, createVNode } from 'vue';
2
2
  import { NTag, NDescriptions, NDescriptionsItem } from 'naive-ui';
3
3
  import { useThrottleFn, useEventListener } from '@vueuse/core';
4
4
  import script$1 from '../../../shared/components/SlotRender/SlotRender.js';
@@ -57,11 +57,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
57
57
  function fieldSet() {
58
58
  emit("fieldSet");
59
59
  }
60
- function getTagColor(type) {
61
- return {
62
- color: type === "warning" ? "#fcc200" : "rgba(45, 122, 255, 0.1)",
63
- textColor: type === "warning" ? "#ffffff" : "#2563F4"
64
- };
60
+ function getTagColor({ type = "warning" }) {
61
+ const colorMap = { warning: "#fcc200", info: "rgba(45, 122, 255, 0.1)" };
62
+ const textColorMap = { warning: "#fff", info: "#2563F4" };
63
+ return { color: colorMap[type], textColor: textColorMap[type] };
65
64
  }
66
65
  function getDescriptionItemStyle({ bold = true, contentStyle = {} } = {}) {
67
66
  return { fontWeight: bold ? 700 : 500, ...contentStyle };
@@ -124,17 +123,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
124
123
  __props.patientInfo.sex ? (openBlock(), createElementBlock("div", _hoisted_6, "/ " + toDisplayString(__props.patientInfo.sex), 1)) : createCommentVNode("v-if", true),
125
124
  __props.patientInfo.age ? (openBlock(), createElementBlock("div", _hoisted_7, " / " + toDisplayString(__props.patientInfo.age) + toDisplayString(__props.patientInfo.ageUnit || "\u5C81"), 1)) : createCommentVNode("v-if", true),
126
125
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.patientInfo.tagList || [], (tag) => {
127
- return withDirectives((openBlock(), createBlock(unref(NTag), {
126
+ return withDirectives((openBlock(), createBlock(unref(NTag), mergeProps({
128
127
  key: tag.content,
129
128
  size: "medium",
130
129
  bordered: false,
131
- color: getTagColor(tag.type || "warning")
132
- }, {
130
+ color: getTagColor(tag)
131
+ }, tag), {
133
132
  default: withCtx(() => [
134
133
  createTextVNode(toDisplayString(tag.content), 1)
135
134
  ]),
136
135
  _: 2
137
- }, 1032, ["color"])), [
136
+ }, 1040, ["color"])), [
138
137
  [vShow, tag.content]
139
138
  ]);
140
139
  }), 128))
@@ -1,5 +1,13 @@
1
1
  import { AnyObject } from '../../../../es/shared/types';
2
2
  import { CSSProperties, PropType } from 'vue';
3
+ declare type PatientTag = Partial<{
4
+ type?: 'warning' | 'info';
5
+ content: string;
6
+ color?: {
7
+ color?: string;
8
+ textColor?: string;
9
+ };
10
+ }>;
3
11
  declare const _default: import("vue").DefineComponent<{
4
12
  compact: {
5
13
  type: BooleanConstructor;
@@ -16,8 +24,12 @@ declare const _default: import("vue").DefineComponent<{
16
24
  age: string;
17
25
  ageUnit?: string | undefined;
18
26
  tagList?: Partial<{
19
- type: "warning" | "info";
27
+ type?: "warning" | "info" | undefined;
20
28
  content: string;
29
+ color?: {
30
+ color?: string | undefined;
31
+ textColor?: string | undefined;
32
+ } | undefined;
21
33
  }>[] | undefined;
22
34
  }>>;
23
35
  default: () => {};
@@ -59,8 +71,12 @@ declare const _default: import("vue").DefineComponent<{
59
71
  age: string;
60
72
  ageUnit?: string | undefined;
61
73
  tagList?: Partial<{
62
- type: "warning" | "info";
74
+ type?: "warning" | "info" | undefined;
63
75
  content: string;
76
+ color?: {
77
+ color?: string | undefined;
78
+ textColor?: string | undefined;
79
+ } | undefined;
64
80
  }>[] | undefined;
65
81
  }>>;
66
82
  default: () => {};
@@ -94,7 +110,7 @@ declare const _default: import("vue").DefineComponent<{
94
110
  toggleCompact: () => void;
95
111
  openPatientInfo: () => void;
96
112
  fieldSet: () => void;
97
- getTagColor: (type: 'warning' | 'info') => {
113
+ getTagColor: ({ type }: PatientTag) => {
98
114
  color: string;
99
115
  textColor: string;
100
116
  };
@@ -287,8 +303,12 @@ declare const _default: import("vue").DefineComponent<{
287
303
  age: string;
288
304
  ageUnit?: string | undefined;
289
305
  tagList?: Partial<{
290
- type: "warning" | "info";
306
+ type?: "warning" | "info" | undefined;
291
307
  content: string;
308
+ color?: {
309
+ color?: string | undefined;
310
+ textColor?: string | undefined;
311
+ } | undefined;
292
312
  }>[] | undefined;
293
313
  }>>;
294
314
  default: () => {};
@@ -325,8 +345,12 @@ declare const _default: import("vue").DefineComponent<{
325
345
  age: string;
326
346
  ageUnit?: string | undefined;
327
347
  tagList?: Partial<{
328
- type: "warning" | "info";
348
+ type?: "warning" | "info" | undefined;
329
349
  content: string;
350
+ color?: {
351
+ color?: string | undefined;
352
+ textColor?: string | undefined;
353
+ } | undefined;
330
354
  }>[] | undefined;
331
355
  }>;
332
356
  labelField: string;
@@ -87,6 +87,7 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
87
87
  option?: {
88
88
  text: string;
89
89
  value: any;
90
+ keyword?: string | undefined;
90
91
  children?: any[] | undefined;
91
92
  }[] | undefined;
92
93
  multi_select?: import("..").FormCommonState | undefined;
@@ -89,6 +89,7 @@ declare const _default: import("vue").DefineComponent<{
89
89
  option?: {
90
90
  text: string;
91
91
  value: any;
92
+ keyword?: string | undefined;
92
93
  children?: any[] | undefined;
93
94
  }[] | undefined;
94
95
  multi_select?: import("../../../../es/components/form-render").FormCommonState | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.1.21-beta.7",
3
+ "version": "3.1.21-beta.9",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -44,7 +44,6 @@
44
44
  "min-dom": "^3.2.1",
45
45
  "moment": "^2.29.1",
46
46
  "naive-ui": "^2.30.0",
47
- "pinyin-match": "^1.2.2",
48
47
  "rimraf": "^3.0.2",
49
48
  "spark-md5": "^3.0.2",
50
49
  "tiny-svg": "^2.2.4",
@@ -67,5 +66,5 @@
67
66
  "iOS 7",
68
67
  "last 3 iOS versions"
69
68
  ],
70
- "gitHead": "23a26386967f38d02eb9cc3a3423d3582bf52ed2"
69
+ "gitHead": "340ff7172f0555f7c5e352a6007752d50cad288f"
71
70
  }