@ecolovo/uniapp-components 2.0.7 → 2.0.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 (151) hide show
  1. package/components/badge/badge.vue +2 -2
  2. package/components/badge/types.d.ts +0 -2
  3. package/components/badge/types.js +1 -4
  4. package/components/badge/types.ts +0 -6
  5. package/components/button/button.vue +2 -2
  6. package/components/button/types.d.ts +0 -2
  7. package/components/button/types.js +1 -4
  8. package/components/button/types.ts +0 -6
  9. package/components/checkbox/checkbox.vue +2 -2
  10. package/components/checkbox/types.d.ts +0 -2
  11. package/components/checkbox/types.js +1 -4
  12. package/components/checkbox/types.ts +0 -8
  13. package/components/checkbox-group/checkbox-group.vue +2 -2
  14. package/components/checkbox-group/types.d.ts +0 -2
  15. package/components/checkbox-group/types.js +1 -8
  16. package/components/checkbox-group/types.ts +0 -12
  17. package/components/checkbox-group2/checkbox-group2.vue +2 -2
  18. package/components/date-picker/date-picker.vue +2 -2
  19. package/components/date-picker/types.d.ts +0 -2
  20. package/components/date-picker/types.js +1 -4
  21. package/components/date-picker/types.ts +0 -8
  22. package/components/dialog/dialog.vue +2 -2
  23. package/components/dialog/types.d.ts +0 -2
  24. package/components/dialog/types.js +1 -4
  25. package/components/dialog/types.ts +0 -6
  26. package/components/dropdown/dropdown.vue +2 -2
  27. package/components/dropdown/types.d.ts +0 -2
  28. package/components/dropdown/types.js +1 -4
  29. package/components/dropdown/types.ts +0 -8
  30. package/components/empty/empty.vue +2 -2
  31. package/components/empty/types.d.ts +0 -2
  32. package/components/empty/types.js +1 -9
  33. package/components/empty/types.ts +0 -11
  34. package/components/flex/flex.vue +2 -2
  35. package/components/flex/types.d.ts +0 -2
  36. package/components/flex/types.js +1 -4
  37. package/components/flex/types.ts +0 -6
  38. package/components/form/form.vue +2 -2
  39. package/components/form/types.d.ts +0 -2
  40. package/components/form/types.js +1 -4
  41. package/components/form/types.ts +0 -6
  42. package/components/form-item/form-item.vue +2 -2
  43. package/components/form-item/types.d.ts +0 -2
  44. package/components/form-item/types.js +1 -4
  45. package/components/form-item/types.ts +0 -8
  46. package/components/icon/icon.vue +59 -1
  47. package/components/image/image.vue +3 -2
  48. package/components/image/types.d.ts +0 -2
  49. package/components/image/types.js +1 -4
  50. package/components/image/types.ts +0 -6
  51. package/components/input/input.vue +2 -2
  52. package/components/input/password-input.vue +2 -2
  53. package/components/input/types.d.ts +0 -4
  54. package/components/input/types.js +1 -8
  55. package/components/input/types.ts +0 -14
  56. package/components/list-page/list-page.vue +2 -2
  57. package/components/list-page/types.d.ts +0 -2
  58. package/components/list-page/types.js +1 -4
  59. package/components/list-page/types.ts +0 -8
  60. package/components/load-more/load-more.vue +2 -2
  61. package/components/load-more/types.d.ts +0 -2
  62. package/components/load-more/types.js +1 -4
  63. package/components/load-more/types.ts +0 -8
  64. package/components/loading/loading.vue +2 -2
  65. package/components/loading/types.d.ts +0 -2
  66. package/components/loading/types.js +1 -4
  67. package/components/loading/types.ts +0 -8
  68. package/components/message-box/message-box.vue +2 -2
  69. package/components/message-box/types.d.ts +0 -2
  70. package/components/message-box/types.js +1 -4
  71. package/components/message-box/types.ts +0 -8
  72. package/components/number-dialog/number-dialog.vue +2 -2
  73. package/components/number-dialog/types.d.ts +0 -2
  74. package/components/number-dialog/types.js +1 -4
  75. package/components/number-dialog/types.ts +0 -8
  76. package/components/number-input/number-input.vue +2 -2
  77. package/components/number-input/types.d.ts +0 -2
  78. package/components/number-input/types.js +1 -4
  79. package/components/number-input/types.ts +0 -8
  80. package/components/numpad/numpad.vue +2 -2
  81. package/components/numpad/types.d.ts +0 -2
  82. package/components/numpad/types.js +1 -4
  83. package/components/numpad/types.ts +0 -6
  84. package/components/page/page-header.vue +7 -7
  85. package/components/page/page.vue +2 -2
  86. package/components/page/types.d.ts +0 -4
  87. package/components/page/types.js +1 -8
  88. package/components/page/types.ts +0 -14
  89. package/components/picker/picker.vue +2 -2
  90. package/components/picker/types.d.ts +0 -2
  91. package/components/picker/types.js +1 -4
  92. package/components/picker/types.ts +0 -6
  93. package/components/popover/popover.vue +2 -2
  94. package/components/popover/types.d.ts +0 -2
  95. package/components/popover/types.js +1 -4
  96. package/components/popover/types.ts +0 -8
  97. package/components/popup/popup.vue +2 -2
  98. package/components/popup/types.d.ts +0 -2
  99. package/components/popup/types.js +1 -4
  100. package/components/popup/types.ts +0 -6
  101. package/components/price/price.vue +2 -2
  102. package/components/price/types.d.ts +0 -2
  103. package/components/price/types.js +1 -4
  104. package/components/price/types.ts +0 -6
  105. package/components/search/search.vue +2 -2
  106. package/components/search/types.d.ts +0 -2
  107. package/components/search/types.js +1 -4
  108. package/components/search/types.ts +0 -6
  109. package/components/searching/searching.vue +2 -2
  110. package/components/searching/types.d.ts +0 -2
  111. package/components/searching/types.js +1 -4
  112. package/components/searching/types.ts +0 -8
  113. package/components/switch/switch.vue +2 -2
  114. package/components/switch/types.d.ts +0 -2
  115. package/components/switch/types.js +1 -4
  116. package/components/switch/types.ts +0 -6
  117. package/components/tab/tab.vue +2 -2
  118. package/components/tab/types.d.ts +0 -2
  119. package/components/tab/types.js +1 -4
  120. package/components/tab/types.ts +0 -6
  121. package/components/textarea/textarea.vue +2 -2
  122. package/components/textarea/types.d.ts +0 -2
  123. package/components/textarea/types.js +1 -4
  124. package/components/textarea/types.ts +0 -8
  125. package/components/upload/media-upload.vue +4 -3
  126. package/components/upload/types.d.ts +0 -2
  127. package/components/upload/types.js +1 -4
  128. package/components/upload/types.ts +0 -8
  129. package/composable/component-name.js +2 -2
  130. package/composable/component-name.ts +2 -2
  131. package/composable/message-box.d.ts +2 -2
  132. package/composable/message-box.js +6 -6
  133. package/composable/message-box.ts +14 -8
  134. package/composable/page.js +2 -2
  135. package/composable/page.ts +2 -2
  136. package/configs/index.d.ts +9 -45
  137. package/configs/index.js +9 -70
  138. package/configs/index.ts +9 -103
  139. package/globals.d.ts +8 -0
  140. package/globals.ts +7 -0
  141. package/index.d.ts +0 -1
  142. package/index.js +0 -1
  143. package/index.ts +0 -1
  144. package/package.json +1 -1
  145. package/styles/global.scss +3 -0
  146. package/vite.d.ts +22 -0
  147. package/vite.js +68 -0
  148. package/vite.ts +107 -0
  149. package/init.d.ts +0 -21
  150. package/init.js +0 -91
  151. package/init.ts +0 -119
@@ -16,7 +16,7 @@
16
16
  <script lang="ts" setup>
17
17
  import { computed } from 'vue';
18
18
  import useClassNames from '../../composable/component-name';
19
- import { badgeProps } from './types';
19
+ import { EC_DEFAULT_PROPS } from '../../configs';
20
20
 
21
21
  defineOptions({
22
22
  options: {
@@ -47,7 +47,7 @@ type _Props = {
47
47
  const props = withDefaults(defineProps<_Props>(), {
48
48
  value: 0,
49
49
  max: 99,
50
- ...badgeProps,
50
+ ...EC_DEFAULT_PROPS.badge,
51
51
  });
52
52
 
53
53
  const showValue = computed(() => {
@@ -2,5 +2,3 @@ export type ConfigurableBadgeProps = {
2
2
  /** 最大显示值,超出时会在后面添加一个“+” */
3
3
  max?: number;
4
4
  };
5
- export declare let badgeProps: ConfigurableBadgeProps;
6
- export declare const setDefaultBadgeProps: (props?: ConfigurableBadgeProps) => void;
@@ -1,4 +1 @@
1
- export let badgeProps = {};
2
- export const setDefaultBadgeProps = (props = {}) => {
3
- badgeProps = props;
4
- };
1
+ export {};
@@ -2,9 +2,3 @@ export type ConfigurableBadgeProps = {
2
2
  /** 最大显示值,超出时会在后面添加一个“+” */
3
3
  max?: number;
4
4
  };
5
-
6
- export let badgeProps: ConfigurableBadgeProps = {};
7
-
8
- export const setDefaultBadgeProps = (props: ConfigurableBadgeProps = {}) => {
9
- badgeProps = props;
10
- };
@@ -77,8 +77,8 @@
77
77
  <script lang="ts" setup>
78
78
  import { computed, ref, useCssModule } from 'vue';
79
79
  import useClassNames from '../../composable/component-name';
80
+ import { EC_DEFAULT_PROPS } from '../../configs';
80
81
  import IconCpn from '../icon/icon.vue';
81
- import { buttonProps } from './types';
82
82
 
83
83
  defineOptions({
84
84
  options: {
@@ -149,7 +149,7 @@ const props = withDefaults(defineProps<_Props>(), {
149
149
  showLoading: undefined,
150
150
  small: false,
151
151
  large: false,
152
- ...buttonProps,
152
+ ...EC_DEFAULT_PROPS.button,
153
153
  });
154
154
 
155
155
  const emit = defineEmits<{
@@ -16,5 +16,3 @@ export type ConfigurableButtonProps = {
16
16
  /** 大尺寸 */
17
17
  large?: boolean;
18
18
  };
19
- export declare let buttonProps: ConfigurableButtonProps;
20
- export declare const setDefaultButtonProps: (props?: ConfigurableButtonProps) => void;
@@ -1,4 +1 @@
1
- export let buttonProps = {};
2
- export const setDefaultButtonProps = (props = {}) => {
3
- buttonProps = props;
4
- };
1
+ export {};
@@ -16,9 +16,3 @@ export type ConfigurableButtonProps = {
16
16
  /** 大尺寸 */
17
17
  large?: boolean;
18
18
  };
19
-
20
- export let buttonProps: ConfigurableButtonProps = {};
21
-
22
- export const setDefaultButtonProps = (props: ConfigurableButtonProps = {}) => {
23
- buttonProps = props;
24
- };
@@ -20,7 +20,7 @@ import { computed, inject, ref } from 'vue';
20
20
  import type { ComputedRef, Ref } from 'vue';
21
21
  import IconCpn from '../icon/icon.vue';
22
22
  import useClassNames from '../../composable/component-name';
23
- import { checkboxProps } from './types';
23
+ import { EC_DEFAULT_PROPS } from '../../configs';
24
24
 
25
25
  defineOptions({
26
26
  options: {
@@ -79,7 +79,7 @@ const props = withDefaults(defineProps<_Props>(), {
79
79
  icon: undefined,
80
80
  checkedIcon: '',
81
81
  uncheckedIcon: '',
82
- ...checkboxProps,
82
+ ...EC_DEFAULT_PROPS.checkbox,
83
83
  });
84
84
 
85
85
  const emit = defineEmits<{
@@ -6,5 +6,3 @@ export type ConfigurableCheckboxProps = {
6
6
  /** 未选中时的图标 */
7
7
  uncheckedIcon?: string;
8
8
  };
9
- export declare let checkboxProps: ConfigurableCheckboxProps;
10
- export declare const setDefaultCheckboxProps: (props?: ConfigurableCheckboxProps) => void;
@@ -1,4 +1 @@
1
- export let checkboxProps = {};
2
- export const setDefaultCheckboxProps = (props = {}) => {
3
- checkboxProps = props;
4
- };
1
+ export {};
@@ -6,11 +6,3 @@ export type ConfigurableCheckboxProps = {
6
6
  /** 未选中时的图标 */
7
7
  uncheckedIcon?: string;
8
8
  };
9
-
10
- export let checkboxProps: ConfigurableCheckboxProps = {};
11
-
12
- export const setDefaultCheckboxProps = (
13
- props: ConfigurableCheckboxProps = {}
14
- ) => {
15
- checkboxProps = props;
16
- };
@@ -7,7 +7,7 @@
7
7
  <script lang="ts" setup>
8
8
  import { computed, provide, ref, watch } from 'vue';
9
9
  import useClassNames from '../../composable/component-name';
10
- import { checkboxGroupProps } from './types';
10
+ import { EC_DEFAULT_PROPS } from '../../configs';
11
11
 
12
12
  defineOptions({
13
13
  options: {
@@ -37,7 +37,7 @@ const props = withDefaults(defineProps<_Props>(), {
37
37
  icon: true,
38
38
  checkedIcon: '',
39
39
  uncheckedIcon: '',
40
- ...checkboxGroupProps,
40
+ ...EC_DEFAULT_PROPS.checkboxGroup,
41
41
  });
42
42
 
43
43
  const emit = defineEmits<{
@@ -6,5 +6,3 @@ export type ConfigurableCheckboxGroupProps = {
6
6
  /** 未选中时的图标 */
7
7
  uncheckedIcon?: string;
8
8
  };
9
- export declare let checkboxGroupProps: ConfigurableCheckboxGroupProps;
10
- export declare const setDefaultCheckboxGroupProps: (props?: ConfigurableCheckboxGroupProps) => void;
@@ -1,8 +1 @@
1
- export let checkboxGroupProps = {
2
- icon: true,
3
- checkedIcon: '',
4
- uncheckedIcon: '',
5
- };
6
- export const setDefaultCheckboxGroupProps = (props = {}) => {
7
- checkboxGroupProps = props;
8
- };
1
+ export {};
@@ -6,15 +6,3 @@ export type ConfigurableCheckboxGroupProps = {
6
6
  /** 未选中时的图标 */
7
7
  uncheckedIcon?: string;
8
8
  };
9
-
10
- export let checkboxGroupProps: ConfigurableCheckboxGroupProps = {
11
- icon: true,
12
- checkedIcon: '',
13
- uncheckedIcon: '',
14
- };
15
-
16
- export const setDefaultCheckboxGroupProps = (
17
- props: ConfigurableCheckboxGroupProps = {}
18
- ) => {
19
- checkboxGroupProps = props;
20
- };
@@ -28,8 +28,8 @@
28
28
  <script lang="ts" setup>
29
29
  import { computed, ref } from 'vue';
30
30
  import useClassNames from '../../composable/component-name';
31
+ import { EC_DEFAULT_PROPS } from '../../configs';
31
32
  import Checkbox2Cpn from './checkbox2.vue';
32
- import { checkboxGroupProps } from '../checkbox-group/types';
33
33
 
34
34
  defineOptions({
35
35
  options: {
@@ -68,7 +68,7 @@ const props = withDefaults(defineProps<_Props>(), {
68
68
  icon: true,
69
69
  checkedIcon: undefined,
70
70
  uncheckedIcon: undefined,
71
- ...checkboxGroupProps,
71
+ ...EC_DEFAULT_PROPS.checkboxGroup,
72
72
  });
73
73
 
74
74
  const emit = defineEmits<{
@@ -70,12 +70,12 @@
70
70
 
71
71
  <script lang="ts" setup>
72
72
  import { computed, inject, ref } from 'vue';
73
+ import { EC_DEFAULT_PROPS } from '../../configs';
73
74
  import useClassNames from '../../composable/component-name';
74
75
  import { formatDate, toDate } from '../../utils/date';
75
76
  import PopupCpn from '../popup/popup.vue';
76
77
  import SelectorCpn from '../selector/selector.vue';
77
78
  import DatePickerViewCpn from './date-picker-view.vue';
78
- import { datePickerProps } from './types';
79
79
 
80
80
  defineOptions({
81
81
  options: {
@@ -120,7 +120,7 @@ const props = withDefaults(defineProps<_Props>(), {
120
120
  timeAppend: '',
121
121
  min: '',
122
122
  max: '',
123
- ...datePickerProps,
123
+ ...EC_DEFAULT_PROPS.datePicker,
124
124
  });
125
125
 
126
126
  const emit = defineEmits<{
@@ -8,5 +8,3 @@ export type ConfigurableDatePickerProps = {
8
8
  /** 在选择的日期后面拼接时间字符串,如果传入的是数组,会分别对应添加到范围日期值后 */
9
9
  timeAppend?: string | (() => string[]);
10
10
  };
11
- export declare let datePickerProps: ConfigurableDatePickerProps;
12
- export declare const setDefaultDatePickerProps: (props?: ConfigurableDatePickerProps) => void;
@@ -1,4 +1 @@
1
- export let datePickerProps = {};
2
- export const setDefaultDatePickerProps = (props = {}) => {
3
- datePickerProps = props;
4
- };
1
+ export {};
@@ -8,11 +8,3 @@ export type ConfigurableDatePickerProps = {
8
8
  /** 在选择的日期后面拼接时间字符串,如果传入的是数组,会分别对应添加到范围日期值后 */
9
9
  timeAppend?: string | (() => string[]);
10
10
  };
11
-
12
- export let datePickerProps: ConfigurableDatePickerProps = {};
13
-
14
- export const setDefaultDatePickerProps = (
15
- props: ConfigurableDatePickerProps = {}
16
- ) => {
17
- datePickerProps = props;
18
- };
@@ -37,8 +37,8 @@ import { ref, computed, useSlots } from 'vue';
37
37
  import useClassNames from '../../composable/component-name';
38
38
  import PopoverMaskCpn from '../popover/popover-mask.vue';
39
39
  import DialogContentCpn from './dialog-content.vue';
40
- import { dialogProps } from './types';
41
40
  import { useAwaitableDialog, useModelValue } from '../../composable';
41
+ import { EC_DEFAULT_PROPS } from '../../configs';
42
42
 
43
43
  defineOptions({
44
44
  options: {
@@ -105,7 +105,7 @@ const props = withDefaults(defineProps<_Props>(), {
105
105
  confirm: '确认',
106
106
  closeOnConfirm: true,
107
107
  async: false,
108
- ...dialogProps,
108
+ ...EC_DEFAULT_PROPS.dialog,
109
109
  });
110
110
 
111
111
  const emit = defineEmits<{
@@ -16,5 +16,3 @@ export type ConfigurableDialogProps = {
16
16
  /** 点击确认按钮时是否自动关闭对话框 */
17
17
  closeOnConfirm?: boolean;
18
18
  };
19
- export declare let dialogProps: ConfigurableDialogProps;
20
- export declare const setDefaultDialogProps: (props?: ConfigurableDialogProps) => void;
@@ -1,4 +1 @@
1
- export let dialogProps = {};
2
- export const setDefaultDialogProps = (props = {}) => {
3
- dialogProps = props;
4
- };
1
+ export {};
@@ -16,9 +16,3 @@ export type ConfigurableDialogProps = {
16
16
  /** 点击确认按钮时是否自动关闭对话框 */
17
17
  closeOnConfirm?: boolean;
18
18
  };
19
-
20
- export let dialogProps: ConfigurableDialogProps = {};
21
-
22
- export const setDefaultDialogProps = (props: ConfigurableDialogProps = {}) => {
23
- dialogProps = props;
24
- };
@@ -28,8 +28,8 @@
28
28
  <script lang="ts" setup>
29
29
  import { computed } from 'vue';
30
30
  import useClassNames from '../../composable/component-name';
31
+ import { EC_DEFAULT_PROPS } from '../../configs';
31
32
  import IconCpn from '../icon/icon.vue';
32
- import { dropdownProps } from './types';
33
33
 
34
34
  defineOptions({
35
35
  options: {
@@ -59,7 +59,7 @@ const props = withDefaults(defineProps<_Props>(), {
59
59
  align: '',
60
60
  multiple: true,
61
61
  formatter: null,
62
- ...dropdownProps,
62
+ ...EC_DEFAULT_PROPS.dropdown,
63
63
  });
64
64
 
65
65
  /** 是否选择了值 */
@@ -6,5 +6,3 @@ export type ConfigurableDropdownProps = {
6
6
  /** 展示值格式化函数 */
7
7
  formatter?: ((val: unknown) => string) | null;
8
8
  };
9
- export declare let dropdownProps: ConfigurableDropdownProps;
10
- export declare const setDefaultDropdownProps: (props?: ConfigurableDropdownProps) => void;
@@ -1,4 +1 @@
1
- export let dropdownProps = {};
2
- export const setDefaultDropdownProps = (props = {}) => {
3
- dropdownProps = props;
4
- };
1
+ export {};
@@ -6,11 +6,3 @@ export type ConfigurableDropdownProps = {
6
6
  /** 展示值格式化函数 */
7
7
  formatter?: ((val: unknown) => string) | null;
8
8
  };
9
-
10
- export let dropdownProps: ConfigurableDropdownProps = {};
11
-
12
- export const setDefaultDropdownProps = (
13
- props: ConfigurableDropdownProps = {}
14
- ) => {
15
- dropdownProps = props;
16
- };
@@ -42,7 +42,7 @@
42
42
  import useClassNames from '../../composable/component-name';
43
43
  import IconCpn from '../icon/icon.vue';
44
44
  import emptyImage from '../../resources/image/empty.svg';
45
- import { emptyProps } from './types';
45
+ import { EC_DEFAULT_PROPS } from '../../configs';
46
46
 
47
47
  defineOptions({
48
48
  options: {
@@ -72,7 +72,7 @@ withDefaults(defineProps<_Props>(), {
72
72
  loading: false,
73
73
  loadingImage: '',
74
74
  loadingText: '数据加载中',
75
- ...emptyProps,
75
+ ...EC_DEFAULT_PROPS.empty,
76
76
  });
77
77
  </script>
78
78
 
@@ -8,5 +8,3 @@ export type ConfigurableEmptyProps = {
8
8
  /** 加载中文本 */
9
9
  loadingText?: string;
10
10
  };
11
- export declare let emptyProps: ConfigurableEmptyProps;
12
- export declare const setDefaultEmptyProps: (props?: ConfigurableEmptyProps) => void;
@@ -1,9 +1 @@
1
- export let emptyProps = {
2
- image: '',
3
- text: '暂无数据',
4
- loadingImage: '',
5
- loadingText: '数据加载中',
6
- };
7
- export const setDefaultEmptyProps = (props = {}) => {
8
- emptyProps = props;
9
- };
1
+ export {};
@@ -8,14 +8,3 @@ export type ConfigurableEmptyProps = {
8
8
  /** 加载中文本 */
9
9
  loadingText?: string;
10
10
  };
11
-
12
- export let emptyProps: ConfigurableEmptyProps = {
13
- image: '',
14
- text: '暂无数据',
15
- loadingImage: '',
16
- loadingText: '数据加载中',
17
- };
18
-
19
- export const setDefaultEmptyProps = (props: ConfigurableEmptyProps = {}) => {
20
- emptyProps = props;
21
- };
@@ -7,7 +7,7 @@
7
7
  <script lang="ts" setup>
8
8
  import { computed } from 'vue';
9
9
  import useClassNames from '../../composable/component-name';
10
- import { flexProps } from './types';
10
+ import { EC_DEFAULT_PROPS } from '../../configs';
11
11
 
12
12
  defineOptions({
13
13
  options: {
@@ -43,7 +43,7 @@ const props = withDefaults(defineProps<_Props>(), {
43
43
  align: 'center',
44
44
  wrap: false,
45
45
  gap: '0px',
46
- ...flexProps,
46
+ ...EC_DEFAULT_PROPS.flex,
47
47
  });
48
48
 
49
49
  const gapValue = computed(() => {
@@ -8,5 +8,3 @@ export type ConfigurableFlexProps = {
8
8
  /** 间距 */
9
9
  gap?: string | number | (() => (string | number)[]);
10
10
  };
11
- export declare let flexProps: ConfigurableFlexProps;
12
- export declare const setDefaultFlexProps: (props?: ConfigurableFlexProps) => void;
@@ -1,4 +1 @@
1
- export let flexProps = {};
2
- export const setDefaultFlexProps = (props = {}) => {
3
- flexProps = props;
4
- };
1
+ export {};
@@ -14,9 +14,3 @@ export type ConfigurableFlexProps = {
14
14
  /** 间距 */
15
15
  gap?: string | number | (() => (string | number)[]);
16
16
  };
17
-
18
- export let flexProps: ConfigurableFlexProps = {};
19
-
20
- export const setDefaultFlexProps = (props: ConfigurableFlexProps = {}) => {
21
- flexProps = props;
22
- };
@@ -7,7 +7,7 @@
7
7
  <script lang="ts" setup>
8
8
  import { computed, provide } from 'vue';
9
9
  import useClassNames from '../../composable/component-name';
10
- import { formProps } from './types';
10
+ import { EC_DEFAULT_PROPS } from '../../configs';
11
11
 
12
12
  defineOptions({
13
13
  options: {
@@ -28,7 +28,7 @@ type _Props = {
28
28
  const props = withDefaults(defineProps<_Props>(), {
29
29
  readonly: false,
30
30
  type: 'line',
31
- ...formProps,
31
+ ...EC_DEFAULT_PROPS.form,
32
32
  });
33
33
 
34
34
  provide(
@@ -2,5 +2,3 @@ export type ConfigurableFormProps = {
2
2
  /** 表单显示类型 */
3
3
  type?: 'line' | 'next' | 'block';
4
4
  };
5
- export declare let formProps: ConfigurableFormProps;
6
- export declare const setDefaultFormProps: (props?: ConfigurableFormProps) => void;
@@ -1,4 +1 @@
1
- export let formProps = {};
2
- export const setDefaultFormProps = (props = {}) => {
3
- formProps = props;
4
- };
1
+ export {};
@@ -2,9 +2,3 @@ export type ConfigurableFormProps = {
2
2
  /** 表单显示类型 */
3
3
  type?: 'line' | 'next' | 'block';
4
4
  };
5
-
6
- export let formProps: ConfigurableFormProps = {};
7
-
8
- export const setDefaultFormProps = (props: ConfigurableFormProps = {}) => {
9
- formProps = props;
10
- };
@@ -31,7 +31,7 @@
31
31
  import { computed, inject } from 'vue';
32
32
  import type { ComputedRef } from 'vue';
33
33
  import useClassNames from '../../composable/component-name';
34
- import { formItemProps } from './types';
34
+ import { EC_DEFAULT_PROPS } from '../../configs';
35
35
 
36
36
  defineOptions({
37
37
  options: {
@@ -58,7 +58,7 @@ const props = withDefaults(defineProps<_Props>(), {
58
58
  subLabel: '',
59
59
  required: false,
60
60
  type: undefined,
61
- ...formItemProps,
61
+ ...EC_DEFAULT_PROPS.formItem,
62
62
  });
63
63
 
64
64
  /** 表单是否只读 */
@@ -2,5 +2,3 @@ export type ConfigurableFormItemProps = {
2
2
  /** 表单显示类型 */
3
3
  type?: 'line' | 'next' | 'block';
4
4
  };
5
- export declare let formItemProps: ConfigurableFormItemProps;
6
- export declare const setDefaultFormItemProps: (props?: ConfigurableFormItemProps) => void;
@@ -1,4 +1 @@
1
- export let formItemProps = {};
2
- export const setDefaultFormItemProps = (props = {}) => {
3
- formItemProps = props;
4
- };
1
+ export {};
@@ -2,11 +2,3 @@ export type ConfigurableFormItemProps = {
2
2
  /** 表单显示类型 */
3
3
  type?: 'line' | 'next' | 'block';
4
4
  };
5
-
6
- export let formItemProps: ConfigurableFormItemProps = {};
7
-
8
- export const setDefaultFormItemProps = (
9
- props: ConfigurableFormItemProps = {}
10
- ) => {
11
- formItemProps = props;
12
- };
@@ -13,10 +13,68 @@
13
13
  </text>
14
14
  </template>
15
15
 
16
+ <script lang="ts">
17
+ import defaultIconFonts from '../../resources/iconfont/uniapp_ui_icon/iconfont.json';
18
+ import { EC_USE_INNER_ICON, EC_ICON_FONT } from '../../configs/index';
19
+
20
+ /** Icon */
21
+ interface IconInfo {
22
+ /** 字体文件名 */
23
+ fontFamily: string;
24
+ /** 图标前缀 */
25
+ prefix: string;
26
+ /** 图标名称 */
27
+ name: string;
28
+ }
29
+
30
+ /** iconfont 图标 map */
31
+ const iconMap: Map<string, IconInfo> = new Map();
32
+
33
+ /**
34
+ * 添加单个图标
35
+ *
36
+ * @param fontFamily 字体文件名
37
+ * @param prefix 图标前缀
38
+ * @param name 图标名称
39
+ */
40
+ function addIconToMap(fontFamily: string, prefix: string, name: string) {
41
+ if (iconMap.has(name)) {
42
+ // eslint-disable-next-line no-console
43
+ console.warn(
44
+ `图标库 "${fontFamily}" 中的图标 "${name}" 在图标库 "${
45
+ iconMap.get(name)!.fontFamily
46
+ }" 中已存在,新的图标将会覆盖已存在的同名图标`
47
+ );
48
+ }
49
+ iconMap.set(name, {
50
+ fontFamily,
51
+ prefix,
52
+ name,
53
+ });
54
+ }
55
+
56
+ /**
57
+ * 添加一组图标,传入 iconfont.json 文件内容
58
+ *
59
+ * @param iconJson iconfont.json 文件内容
60
+ */
61
+ function addIcons(iconJson: IconFontJson) {
62
+ const fontFamily = iconJson.font_family;
63
+ const prefix = iconJson.css_prefix_text;
64
+ const glyphs = iconJson.glyphs;
65
+ glyphs.forEach((glyph) => {
66
+ addIconToMap(fontFamily, prefix, glyph.font_class);
67
+ });
68
+ }
69
+
70
+ // 添加内部图标库
71
+ if (EC_USE_INNER_ICON) addIcons(defaultIconFonts);
72
+ // 添加额外 IconFont
73
+ EC_ICON_FONT.forEach(addIcons);
74
+ </script>
16
75
  <script lang="ts" setup>
17
76
  import { computed } from 'vue';
18
77
  import useClassNames from '../../composable/component-name';
19
- import { iconMap } from '../../configs';
20
78
 
21
79
  defineOptions({
22
80
  options: {
@@ -13,7 +13,8 @@
13
13
  <script lang="ts" setup>
14
14
  import { computed } from 'vue';
15
15
  import useClassNames from '../../composable/component-name';
16
- import { imageProps, type ImageProps } from './types';
16
+ import { EC_DEFAULT_PROPS } from '../../configs';
17
+ import { type ImageProps } from './types';
17
18
 
18
19
  defineOptions({
19
20
  options: {
@@ -39,7 +40,7 @@ const props = withDefaults(defineProps<_Props>(), {
39
40
  lazyLoad: false,
40
41
  preview: false,
41
42
  previewIndex: undefined,
42
- ...imageProps,
43
+ ...EC_DEFAULT_PROPS.image,
43
44
  });
44
45
 
45
46
  const emit = defineEmits<{
@@ -14,5 +14,3 @@ export type ConfigurableImageProps = {
14
14
  /** 图片显示模式 */
15
15
  mode?: UniApp.ImageMode;
16
16
  };
17
- export declare let imageProps: ConfigurableImageProps;
18
- export declare const setDefaultImageProps: (props?: ConfigurableImageProps) => void;
@@ -1,4 +1 @@
1
- export let imageProps = {};
2
- export const setDefaultImageProps = (props = {}) => {
3
- imageProps = props;
4
- };
1
+ export {};
@@ -15,9 +15,3 @@ export type ConfigurableImageProps = {
15
15
  /** 图片显示模式 */
16
16
  mode?: UniApp.ImageMode;
17
17
  };
18
-
19
- export let imageProps: ConfigurableImageProps = {};
20
-
21
- export const setDefaultImageProps = (props: ConfigurableImageProps = {}) => {
22
- imageProps = props;
23
- };