@ecolovo/uniapp-components 1.0.10 → 2.0.1

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 (130) hide show
  1. package/README.md +202 -66
  2. package/components/aspect/aspect.vue +24 -15
  3. package/components/badge/badge.scss +20 -0
  4. package/components/badge/badge.vue +49 -40
  5. package/components/button/button.scss +15 -0
  6. package/components/button/button.vue +121 -177
  7. package/components/checkbox/checkbox.scss +10 -0
  8. package/components/checkbox/checkbox.vue +118 -146
  9. package/components/checkbox-group/checkbox-group.vue +79 -85
  10. package/components/checkbox-group2/checkbox-group2.vue +111 -107
  11. package/components/checkbox-group2/checkbox2.vue +104 -0
  12. package/components/data-list/data-list.scss +9 -0
  13. package/components/data-list/data-list.vue +70 -79
  14. package/components/date-picker/date-picker-view.vue +125 -124
  15. package/components/date-picker/date-picker.vue +145 -146
  16. package/components/dialog/dialog-content.vue +39 -47
  17. package/components/dialog/dialog.scss +11 -0
  18. package/components/dialog/dialog.vue +125 -138
  19. package/components/dropdown/dropdown.scss +11 -0
  20. package/components/dropdown/dropdown.vue +55 -97
  21. package/components/empty/empty.scss +14 -0
  22. package/components/empty/empty.vue +42 -41
  23. package/components/flex/flex.vue +45 -54
  24. package/components/form/form.vue +29 -24
  25. package/components/form-item/form-item.scss +11 -0
  26. package/components/form-item/form-item.vue +43 -40
  27. package/components/icon/icon.vue +70 -85
  28. package/components/image/image.vue +35 -38
  29. package/components/input/input.vue +65 -79
  30. package/components/input/password-input.vue +34 -42
  31. package/components/list-page/list-page.vue +73 -99
  32. package/components/load-more/load-more.scss +12 -0
  33. package/components/load-more/load-more.vue +29 -29
  34. package/components/loading/animations/loading-animation1.vue +8 -8
  35. package/components/loading/animations/loading-animation2.vue +8 -9
  36. package/components/loading/animations/loading-animation3.vue +11 -11
  37. package/components/loading/animations/loading-animation4.vue +8 -8
  38. package/components/loading/loading.vue +19 -20
  39. package/components/message-box/message-box.vue +59 -41
  40. package/components/number-dialog/number-dialog.scss +9 -0
  41. package/components/number-dialog/number-dialog.vue +209 -204
  42. package/components/number-input/number-input.scss +9 -0
  43. package/components/number-input/number-input.vue +233 -232
  44. package/components/numpad/numpad.scss +9 -0
  45. package/components/numpad/numpad.vue +133 -150
  46. package/components/page/page-body.scss +15 -0
  47. package/components/page/page-body.vue +137 -119
  48. package/components/page/page-footer.scss +13 -0
  49. package/components/page/page-footer.vue +31 -33
  50. package/components/page/page-header.scss +17 -0
  51. package/components/page/page-header.vue +89 -94
  52. package/components/page/page.scss +9 -0
  53. package/components/page/page.vue +105 -81
  54. package/components/picker/picker-popup.vue +218 -209
  55. package/components/picker/picker.vue +99 -104
  56. package/components/popover/popover-content.vue +54 -63
  57. package/components/popover/popover-mask.vue +63 -63
  58. package/components/popover/popover.scss +28 -0
  59. package/components/popover/popover.vue +49 -47
  60. package/components/popup/popup-content.vue +49 -53
  61. package/components/popup/popup.scss +11 -0
  62. package/components/popup/popup.vue +117 -132
  63. package/components/price/price.scss +20 -0
  64. package/components/price/price.vue +31 -42
  65. package/components/search/search.scss +12 -0
  66. package/components/search/search.vue +93 -117
  67. package/components/searching/searching.vue +33 -40
  68. package/components/selector/selector.vue +43 -48
  69. package/components/switch/switch.scss +12 -0
  70. package/components/switch/switch.vue +99 -96
  71. package/components/tab/tab.scss +19 -0
  72. package/components/tab/tab.vue +151 -145
  73. package/components/textarea/textarea.vue +104 -101
  74. package/composable/component-name.d.ts +2 -0
  75. package/composable/component-name.js +8 -0
  76. package/composable/component-name.ts +10 -0
  77. package/configs/index.d.ts +25 -10
  78. package/configs/index.js +14 -23
  79. package/configs/index.ts +82 -0
  80. package/easyCom.d.ts +9 -0
  81. package/easyCom.js +1 -2
  82. package/easyCom.ts +31 -0
  83. package/index.d.ts +1 -0
  84. package/index.js +1 -0
  85. package/index.ts +1 -0
  86. package/init.d.ts +4 -7
  87. package/init.js +5 -4
  88. package/init.ts +34 -0
  89. package/package.json +14 -4
  90. package/styles/utils/css-var.scss +12 -15
  91. package/styles/utils/ellipsis.scss +0 -7
  92. package/styles/utils/z-index.scss +1 -1
  93. package/styles/var/component.scss +21 -245
  94. package/utils/date.d.ts +47 -0
  95. package/utils/date.js +23 -43
  96. package/utils/date.ts +153 -0
  97. package/utils/freezeDeep.d.ts +1 -0
  98. package/utils/freezeDeep.js +4 -14
  99. package/utils/freezeDeep.ts +9 -0
  100. package/utils/price.d.ts +24 -0
  101. package/utils/price.js +14 -8
  102. package/utils/price.ts +57 -0
  103. package/utils/round.d.ts +2 -0
  104. package/utils/round.js +2 -14
  105. package/utils/round.ts +11 -0
  106. package/utils/windowInfo.d.ts +24 -0
  107. package/utils/windowInfo.js +8 -36
  108. package/utils/windowInfo.ts +50 -0
  109. package/components/checkbox-group2/checkbox.vue +0 -109
  110. package/components/datetime-picker/datetime-picker-view.vue +0 -209
  111. package/components/datetime-picker/datetime-picker.vue +0 -235
  112. package/components/form/mixin.js +0 -13
  113. package/components/list-page/list-page.js +0 -10
  114. package/components/table/table.vue +0 -112
  115. package/components/time-picker/time-picker-view.vue +0 -127
  116. package/components/time-picker/time-picker.vue +0 -140
  117. package/components/uploader/download.js +0 -81
  118. package/components/uploader/file-uploader.vue +0 -52
  119. package/components/uploader/files.js +0 -225
  120. package/components/uploader/media-uploader.vue +0 -189
  121. package/components/uploader/mixin.js +0 -171
  122. package/components/uploader/uni.js +0 -38
  123. package/components/uploader/upload-button.vue +0 -29
  124. package/components/uploader/uploader copy.vue +0 -547
  125. package/components/uploader/uploader.vue +0 -117
  126. package/mixins/componentName.js +0 -32
  127. package/mixins/listPage.js +0 -1
  128. package/mixins/windowInfo.js +0 -1
  129. package/utils/fileSize.js +0 -39
  130. package/utils/floor.js +0 -20
@@ -1,20 +1,20 @@
1
1
  <template>
2
- <view :class="componentClassNames">
2
+ <view :class="[...classNames, $style['LoadingAnimation4']]">
3
3
  <view :class="$style['LoadingAnimation4--animation']"></view>
4
4
  </view>
5
5
  </template>
6
6
 
7
- <script>
8
- import componentName from '../../../mixins/componentName';
7
+ <script lang="ts" setup>
8
+ import useClassNames from '../../../composable/component-name';
9
9
 
10
- export default {
11
- name: 'LoadingAnimation4',
10
+ defineOptions({
12
11
  options: {
13
- virtualHost: true,
14
12
  styleIsolation: 'shared',
13
+ virtualHost: true,
15
14
  },
16
- mixins: [componentName],
17
- };
15
+ });
16
+
17
+ const classNames = useClassNames('loading-animation4');
18
18
  </script>
19
19
 
20
20
  <style lang="scss" module>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <view :class="componentClassNames" @touchmove.stop.prevent="doNothing">
2
+ <view :class="[...classNames, $style['Loading']]" @touchmove.stop.prevent="doNothing">
3
3
  <!-- #ifdef APP-PLUS -->
4
4
  <cover-view :class="$style['Loading--wrapper-cover']" @touchmove.stop.prevent="doNothing"></cover-view>
5
5
  <!-- #endif -->
@@ -12,35 +12,34 @@
12
12
  </view>
13
13
  </template>
14
14
 
15
- <script>
16
- import componentName from '../../mixins/componentName';
15
+ <script lang="ts" setup>
16
+ import useClassNames from '../../composable/component-name';
17
17
  import LoadingAnimation3 from './animations/loading-animation3.vue';
18
18
 
19
- export default {
20
- name: 'Loading',
19
+ defineOptions({
21
20
  options: {
22
- virtualHost: true,
23
21
  styleIsolation: 'shared',
22
+ virtualHost: true,
24
23
  },
25
- components: { LoadingAnimation3 },
26
- mixins: [componentName],
27
- props: {
28
- title: {
29
- type: String,
30
- default: '加载中...',
31
- },
32
- },
33
- methods: {
34
- doNothing() {},
35
- },
24
+ });
25
+
26
+ const classNames = useClassNames('loading');
27
+
28
+ type _Props = {
29
+ /** 加载文本 */
30
+ title?: string;
36
31
  };
32
+
33
+ withDefaults(defineProps<_Props>(), {
34
+ title: '加载中...',
35
+ });
36
+
37
+ const doNothing = () => {};
37
38
  </script>
38
39
 
39
40
  <style lang="scss" module>
40
41
  @use '../../styles/index' as *;
41
42
 
42
- $component-name: 'badge';
43
-
44
43
  .Loading {
45
44
  position: fixed;
46
45
  top: 0;
@@ -50,7 +49,7 @@ $component-name: 'badge';
50
49
  display: flex;
51
50
  justify-content: center;
52
51
  align-items: center;
53
- z-index: UTILS__z-index();
52
+ z-index: UTILS__z-index('loading');
54
53
  background: #0000004d;
55
54
 
56
55
  /* #ifdef APP-PLUS */
@@ -1,60 +1,78 @@
1
1
  <template>
2
2
  <dialog-cpn
3
- :value="value"
3
+ :model-value="isVisible"
4
4
  :cancel="false"
5
- hide-on-confirm
6
5
  confirm="我知道了"
7
6
  modal
8
7
  :title="title"
9
- :class="componentClassNames"
10
- @input="$emit('input', $event)"
11
- @confirm="$_onConfirm()"
8
+ :class="[...classNames, $style['MessageBox']]"
9
+ @update:model-value="emit('update:modelValue', $event)"
10
+ @confirm="onConfirm()"
11
+ @closed="isVisible = false"
12
12
  >
13
13
  {{ content }}
14
14
  </dialog-cpn>
15
15
  </template>
16
16
 
17
- <script>
18
- import componentName from '../../mixins/componentName';
17
+ <script lang="ts" setup>
18
+ import { ref, useCssModule, watch } from 'vue';
19
+ import useClassNames from '../../composable/component-name';
19
20
  import DialogCpn from '../dialog/dialog.vue';
20
21
 
21
- export default {
22
- name: 'MessageBox',
22
+ defineOptions({
23
23
  options: {
24
24
  virtualHost: true,
25
25
  styleIsolation: 'shared',
26
26
  },
27
- components: { DialogCpn },
28
- mixins: [componentName],
29
- props: {
30
- /** 是否可见 */
31
- value: {
32
- type: Boolean,
33
- default: false,
34
- },
35
- /** 对话框标题 */
36
- title: {
37
- type: String,
38
- default: '提示',
39
- },
40
- /** 是否模态 */
41
- content: {
42
- type: String,
43
- default: '',
44
- },
45
- },
46
- created() {
47
- this._promise = new Promise((resolve) => {
48
- this._resolve = resolve;
49
- });
50
- },
51
- methods: {
52
- show() {
53
- return this._promise;
54
- },
55
- $_onConfirm() {
56
- this._resolve();
57
- },
58
- },
27
+ });
28
+
29
+ const classNames = useClassNames('message-box');
30
+ const $style = useCssModule();
31
+
32
+ type _Props = {
33
+ /** 是否可见 */
34
+ modelValue?: boolean;
35
+ /** 对话框标题 */
36
+ title?: string;
37
+ /** 内容 */
38
+ content?: string;
39
+ };
40
+
41
+ const props = withDefaults(defineProps<_Props>(), {
42
+ modelValue: false,
43
+ title: '提示',
44
+ content: '',
45
+ });
46
+
47
+ const isVisible = ref(false);
48
+
49
+ watch(
50
+ () => props.modelValue,
51
+ (v) => {
52
+ isVisible.value = v;
53
+ }
54
+ );
55
+
56
+ const emit = defineEmits<{
57
+ (e: 'update:modelValue', val: boolean): void;
58
+ }>();
59
+
60
+ let resolvePromise: PromiseWithResolvers<void>['resolve'] | undefined;
61
+
62
+ const show = () => {
63
+ emit('update:modelValue', (isVisible.value = true));
64
+ const { promise, resolve } = Promise.withResolvers();
65
+ resolvePromise = resolve;
66
+ return promise;
59
67
  };
68
+
69
+ const onConfirm = () => {
70
+ resolvePromise?.();
71
+ };
72
+
73
+ defineExpose({ show });
60
74
  </script>
75
+
76
+ <style lang="scss" module>
77
+ @use '../../styles/index' as *;
78
+ </style>
@@ -0,0 +1,9 @@
1
+ @use 'sass:map';
2
+
3
+ // 可配置的变量
4
+ $number-dialog: () !default;
5
+ $number-dialog-default: (
6
+ // 按钮尺寸
7
+ button-size: 48rpx
8
+ );
9
+ $number-dialog: map.merge($number-dialog-default, $number-dialog);