oxy-uni-ui 2.1.0 → 2.1.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 (94) hide show
  1. package/attributes.json +1 -1
  2. package/components/common/abstracts/variable.scss +132 -98
  3. package/components/common/util.ts +25 -0
  4. package/components/composables/useDynamicVirtualScroll.ts +80 -0
  5. package/components/oxy-action-sheet/index.scss +6 -6
  6. package/components/oxy-backtop/index.scss +1 -1
  7. package/components/oxy-badge/index.scss +2 -2
  8. package/components/oxy-button/index.scss +3 -6
  9. package/components/oxy-calendar/index.scss +2 -2
  10. package/components/oxy-calendar/oxy-calendar.vue +3 -3
  11. package/components/oxy-calendar-view/monthPanel/month-panel.vue +72 -37
  12. package/components/oxy-calendar-view/monthPanel/types.ts +43 -1
  13. package/components/oxy-calendar-view/types.ts +1 -1
  14. package/components/oxy-calendar-view/utils.ts +12 -1
  15. package/components/oxy-calendar-view/yearPanel/types.ts +36 -2
  16. package/components/oxy-calendar-view/yearPanel/year-panel.vue +64 -45
  17. package/components/oxy-card/index.scss +4 -4
  18. package/components/oxy-cell/index.scss +1 -1
  19. package/components/oxy-cell-group/index.scss +2 -2
  20. package/components/oxy-checkbox/index.scss +73 -218
  21. package/components/oxy-collapse/index.scss +1 -1
  22. package/components/oxy-collapse-item/index.scss +2 -2
  23. package/components/oxy-corner/index.scss +3 -3
  24. package/components/oxy-count-to/oxy-count-to.vue +3 -3
  25. package/components/oxy-count-to/types.ts +1 -1
  26. package/components/oxy-date-strip-item/index.scss +4 -4
  27. package/components/oxy-datetime-picker/types.ts +1 -1
  28. package/components/oxy-datetime-picker-view/types.ts +2 -2
  29. package/components/oxy-fab/index.scss +1 -5
  30. package/components/oxy-file-list/index.scss +2 -2
  31. package/components/oxy-footer/index.scss +2 -2
  32. package/components/oxy-footer/oxy-footer.vue +2 -3
  33. package/components/oxy-form-item/index.scss +0 -5
  34. package/components/oxy-grid/oxy-grid.vue +1 -1
  35. package/components/oxy-grid-item/index.scss +1 -1
  36. package/components/oxy-guidance/index.scss +2 -2
  37. package/components/oxy-img/index.scss +2 -2
  38. package/components/oxy-img-cropper/index.scss +0 -2
  39. package/components/oxy-img-lazy/index.scss +0 -1
  40. package/components/oxy-index-anchor/index.scss +3 -3
  41. package/components/oxy-input/index.scss +2 -2
  42. package/components/oxy-input-number/index.scss +21 -3
  43. package/components/oxy-input-number/oxy-input-number.vue +9 -1
  44. package/components/oxy-keyboard/index.scss +1 -1
  45. package/components/oxy-link/index.scss +11 -10
  46. package/components/oxy-loading/index.scss +1 -1
  47. package/components/oxy-loadmore/index.scss +1 -1
  48. package/components/oxy-message-box/index.scss +7 -7
  49. package/components/oxy-navbar/index.scss +1 -1
  50. package/components/oxy-navbar/oxy-navbar.vue +2 -3
  51. package/components/oxy-password-input/index.scss +4 -4
  52. package/components/oxy-picker/types.ts +1 -1
  53. package/components/oxy-picker-view/oxy-picker-view.vue +8 -5
  54. package/components/oxy-picker-view/types.ts +2 -2
  55. package/components/oxy-progress/index.scss +2 -2
  56. package/components/oxy-radio/index.scss +8 -4
  57. package/components/oxy-radio-group/index.scss +0 -1
  58. package/components/oxy-rich-text/index.scss +2 -6
  59. package/components/oxy-rich-text/mp-html/mp-html.d.ts +2 -0
  60. package/components/oxy-rich-text/mp-html/mp-html.vue +2 -1
  61. package/components/oxy-rich-text/mp-html/node/node.vue +23 -0
  62. package/components/oxy-rich-text/mp-html/parser.js +6 -6
  63. package/components/oxy-rich-text/oxy-rich-text.vue +23 -0
  64. package/components/oxy-search/index.scss +1 -1
  65. package/components/oxy-segmented/index.scss +4 -8
  66. package/components/oxy-select/index.scss +6 -6
  67. package/components/oxy-sidebar-item/index.scss +20 -11
  68. package/components/oxy-slider/index.scss +4 -5
  69. package/components/oxy-sort-button/index.scss +3 -5
  70. package/components/oxy-splitter-panel/index.scss +8 -8
  71. package/components/oxy-step/index.scss +9 -9
  72. package/components/oxy-swiper-nav/index.scss +2 -2
  73. package/components/oxy-switch/index.scss +3 -3
  74. package/components/oxy-tab/index.scss +8 -2
  75. package/components/oxy-tabbar/index.scss +3 -3
  76. package/components/oxy-tabbar/oxy-tabbar.vue +3 -3
  77. package/components/oxy-table/index.scss +0 -1
  78. package/components/oxy-table-col/index.scss +1 -2
  79. package/components/oxy-tabs/index.scss +3 -3
  80. package/components/oxy-tag/index.scss +4 -4
  81. package/components/oxy-text/index.scss +1 -1
  82. package/components/oxy-textarea/index.scss +2 -6
  83. package/components/oxy-toast/index.scss +1 -1
  84. package/components/oxy-tree/index.scss +31 -11
  85. package/components/oxy-tree/oxy-tree.vue +113 -2
  86. package/components/oxy-tree/types.ts +1 -0
  87. package/components/oxy-upload/index.scss +3 -3
  88. package/components/oxy-video-preview/index.scss +3 -3
  89. package/components/oxy-virtual-scroll/index.scss +1 -1
  90. package/components/oxy-voice-player/index.scss +36 -36
  91. package/components/oxy-watermark/index.scss +1 -1
  92. package/package.json +1 -1
  93. package/tags.json +1 -1
  94. package/web-types.json +1 -1
@@ -27,13 +27,13 @@
27
27
  display: flex;
28
28
  flex-direction: column;
29
29
  margin: 0 4rpx;
30
- transition-duration: 300ms;
30
+ transition-duration: $-transition-duration-slow;
31
31
  transition-property: background-color, color;
32
32
  transition-timing-function: linear;
33
33
 
34
34
  &-prefix,&-day,&-suffix {
35
35
  text-align: center;
36
- transition-duration: 200ms;
36
+ transition-duration: $-transition-duration-base;
37
37
  transition-property: color;
38
38
  transition-timing-function: linear;
39
39
  }
@@ -69,7 +69,7 @@
69
69
  &-day {
70
70
  font-size: $-date-strip-font-size;
71
71
  color: $-date-strip-color;
72
- font-weight: bold;
72
+ font-weight: $-fw-bold;
73
73
  }
74
74
  &-info {
75
75
  display: flex;
@@ -82,7 +82,7 @@
82
82
  background-color: $-date-strip-active-color;
83
83
  }
84
84
  &--active-text {
85
- color: white;
85
+ color: $-color-white;
86
86
  &-none {
87
87
  color: $-date-strip-active-color;
88
88
  }
@@ -76,7 +76,7 @@ export const datetimePickerProps = {
76
76
  /**
77
77
  * picker内部滚筒高
78
78
  */
79
- columnsHeight: makeNumberProp(217),
79
+ columnsHeight: makeNumberProp(434),
80
80
  /**
81
81
  * 选项的key
82
82
  */
@@ -20,11 +20,11 @@ export const datetimePickerViewProps = {
20
20
  /**
21
21
  * picker内部滚筒高
22
22
  */
23
- columnsHeight: makeNumberProp(217),
23
+ columnsHeight: makeNumberProp(434),
24
24
  /**
25
25
  * picker item的高度
26
26
  */
27
- itemHeight: makeNumberProp(35),
27
+ itemHeight: makeNumberProp(70),
28
28
  /**
29
29
  * 选项的key
30
30
  */
@@ -1,10 +1,6 @@
1
1
  @import "../common/abstracts/variable";
2
2
  @import "../common/abstracts/mixin";
3
3
 
4
- .oxy-theme-dark {
5
- @include b(fab) {}
6
- }
7
-
8
4
  @include b(fab) {
9
5
  position: fixed;
10
6
  z-index: 99;
@@ -60,7 +56,7 @@
60
56
 
61
57
  // 动画
62
58
  @include e(transition-enter-active, transition-leave-active) {
63
- transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
59
+ transition: $-transition-duration-slow $-transition-timing-function-base !important;
64
60
  }
65
61
 
66
62
 
@@ -19,7 +19,7 @@
19
19
  align-items: center;
20
20
  width: 100%;
21
21
  height: 100%;
22
- border: 1px solid $-color-border;
22
+ border: #{$-border-width-base} solid $-color-border;
23
23
  border-radius: $-file-list-card-radius;
24
24
  position: relative;
25
25
  }
@@ -83,7 +83,7 @@
83
83
  .oxy-file-list__delete {
84
84
  font-size: $-file-list-action-icon-size;
85
85
  color: $-file-list-action-icon-color;
86
- margin-left: 24rpx;
86
+ margin-left: $-spacing-24;
87
87
  }
88
88
  & + .oxy-file-list__list--item {
89
89
  margin-top: 20rpx;
@@ -11,9 +11,9 @@
11
11
  @include b(footer) {
12
12
  overflow: visible;
13
13
  padding: 0;
14
- background-color: $--footer-bg;
14
+ background-color: $-footer-bg;
15
15
  @include e(content) {
16
16
  overflow: visible;
17
- padding: $--footer-padding;
17
+ padding: $-footer-padding;
18
18
  }
19
19
  }
@@ -21,7 +21,7 @@ export default {
21
21
  <script setup lang="ts">
22
22
  import { getCurrentInstance, nextTick, onMounted, ref, computed, watch } from 'vue'
23
23
  import { footerProps } from './types'
24
- import { withDefaultUnit } from '../common/util'
24
+ import { convertPxToRpx, withDefaultUnit } from '../common/util'
25
25
  import NodeInfo = UniNamespace.NodeInfo
26
26
 
27
27
  const props = defineProps(footerProps)
@@ -41,8 +41,7 @@ const contentStyle = computed(() => {
41
41
 
42
42
  // 设置内容高度(rpx 语义)
43
43
  function setHeight(val: number) {
44
- const pxPer100Rpx = uni.upx2px(100)
45
- const heightInRpx = pxPer100Rpx ? (val / pxPer100Rpx) * 100 : val * 2
44
+ const heightInRpx = convertPxToRpx(val)
46
45
  placeholderHeight.value = `${heightInRpx}rpx`
47
46
  }
48
47
 
@@ -1,11 +1,6 @@
1
1
  @import '../common/abstracts/variable';
2
2
  @import '../common/abstracts/mixin';
3
3
 
4
- .oxy-theme-dark {
5
- @include b(form-item) {
6
- }
7
- }
8
-
9
4
 
10
5
  @include b(form-item) {
11
6
  @include e(error-message){
@@ -73,7 +73,7 @@ watch(
73
73
  )
74
74
 
75
75
  const rootStyle = computed(() => {
76
- return `${props.gutter ? 'padding-left:' + props.gutter * 2 + 'rpx;' + 'padding-bottom:' + props.gutter * 2 + 'rpx;' : ''}${props.customStyle}`
76
+ return `${props.gutter ? 'padding-left:' + props.gutter + 'rpx;' + 'padding-bottom:' + props.gutter + 'rpx;' : ''}${props.customStyle}`
77
77
  })
78
78
 
79
79
  const handleChildrenChange = debounce(() => {
@@ -140,7 +140,7 @@
140
140
  }
141
141
 
142
142
  @include e(text) {
143
- margin-top: 16rpx;
143
+ margin-top: $-spacing-16;
144
144
  font-size: $-grid-item-fs;
145
145
  line-height: $-grid-item-fs;
146
146
  @include lineEllipsis;
@@ -53,12 +53,12 @@
53
53
 
54
54
  @include e(next) {
55
55
  background: $-guide-tip-action-bg;
56
- height: 48rpx;
56
+ height: $-size-48;
57
57
  width: 100rpx;
58
58
  text-align: center;
59
59
  border-radius: $-guide-tip-action-radius;
60
60
  color: $-guide-tip-action-color;
61
- line-height: 48rpx;
61
+ line-height: $-lh-base;
62
62
  font-size: $-fs-secondary;
63
63
  }
64
64
  }
@@ -14,6 +14,6 @@
14
14
 
15
15
  @include when(round) {
16
16
  overflow: hidden;
17
- border-radius: 50%;
17
+ border-radius: $-radius-circle;
18
18
  }
19
- }
19
+ }
@@ -204,7 +204,6 @@
204
204
  text-align: left;
205
205
  margin: 0 40rpx;
206
206
  padding-top: 4vh;
207
- // line-height: 32px;
208
207
  box-sizing: border-box;
209
208
 
210
209
  .is-cancel {
@@ -216,7 +215,6 @@
216
215
  .is-confirm {
217
216
  position: absolute;
218
217
  right: 0;
219
- // height: 32px;
220
218
  width: 112rpx;
221
219
  border-radius: $-img-cropper-action-radius;
222
220
  font-size: $-img-cropper-action-fs;
@@ -2,7 +2,6 @@
2
2
  @import "./../common/abstracts/variable.scss";
3
3
 
4
4
  @include b(img-lazy) {
5
- // overflow: hidden;
6
5
  position: relative;
7
6
  @include e(image) {
8
7
  display: block;
@@ -10,12 +10,12 @@
10
10
 
11
11
  // #ifdef MP-DINGTALK
12
12
  @include b(index-anchor-ding) {
13
-
13
+
14
14
  @include when(sticky){
15
15
  position: sticky;
16
16
  top: 0;
17
17
  left: 0;
18
- z-index: 1;
18
+ z-index: $-z-index-sticky;
19
19
  }
20
20
  }
21
21
  // #endif
@@ -30,6 +30,6 @@
30
30
  position: sticky;
31
31
  top: 0;
32
32
  left: 0;
33
- z-index: 1;
33
+ z-index: $-z-index-sticky;
34
34
  }
35
35
  }
@@ -80,7 +80,7 @@
80
80
  height: 1px;
81
81
  background: $-input-border-color;
82
82
  transform: scaleY(0.5);
83
- transition: background-color 0.2s ease-in-out;
83
+ transition: background-color $-transition-duration-base ease-in-out;
84
84
  }
85
85
 
86
86
  @include when(not-empty) {
@@ -301,7 +301,7 @@
301
301
  }
302
302
 
303
303
  @include e(count) {
304
- margin-left: 32rpx;
304
+ margin-left: $-spacing-32;
305
305
  font-size: $-input-count-fs;
306
306
  color: $-input-count-color;
307
307
  vertical-align: middle;
@@ -27,9 +27,9 @@
27
27
  }
28
28
 
29
29
  @include b(input-number) {
30
- display: inline-block;
30
+ display: inline-flex;
31
+ align-items: center;
31
32
  user-select: none;
32
- line-height: 1.15;
33
33
 
34
34
  @include e(action) {
35
35
  position: relative;
@@ -61,6 +61,11 @@
61
61
  border-top-right-radius: calc($-input-number-radius * 2);
62
62
  border-bottom-right-radius: calc($-input-number-radius * 2);
63
63
  }
64
+
65
+ &:not(.is-disabled):active {
66
+ background-color: $-color-bg;
67
+ }
68
+
64
69
  @include when(disabled) {
65
70
  color: $-input-number-disabled-color;
66
71
  }
@@ -105,7 +110,10 @@
105
110
 
106
111
  @include edeep(action-icon) {
107
112
  position: absolute;
108
- display: inline-block;
113
+ display: flex;
114
+ align-items: center;
115
+ justify-content: center;
116
+ line-height: 1;
109
117
  font-size: $-input-number-icon-size;
110
118
  width: $-input-number-icon-size;
111
119
  height: $-input-number-icon-size;
@@ -114,6 +122,16 @@
114
122
  transform: translate(-50%, -50%);
115
123
  }
116
124
 
125
+ @include when(focus) {
126
+ .oxy-input-number__action::after {
127
+ border-color: $-color-theme;
128
+ }
129
+ .oxy-input-number__input-border {
130
+ border-top-color: $-color-theme;
131
+ border-bottom-color: $-color-theme;
132
+ }
133
+ }
134
+
117
135
  @include when(disabled) {
118
136
  .oxy-input-number__input {
119
137
  color: $-input-number-disabled-color;
@@ -1,5 +1,10 @@
1
1
  <template>
2
- <view :class="`oxy-input-number ${customClass} ${disabled ? 'is-disabled' : ''} ${withoutInput ? 'is-without-input' : ''}`" :style="customStyle">
2
+ <view
3
+ :class="`oxy-input-number ${customClass} ${disabled ? 'is-disabled' : ''} ${withoutInput ? 'is-without-input' : ''} ${
4
+ isFocused ? 'is-focus' : ''
5
+ }`"
6
+ :style="customStyle"
7
+ >
3
8
  <!-- 减号按钮 -->
4
9
  <view
5
10
  :class="`oxy-input-number__action ${minDisabled || disableMinus ? 'is-disabled' : ''}`"
@@ -76,6 +81,7 @@ const emit = defineEmits<{
76
81
  (e: 'update:modelValue', value: number | string): void
77
82
  }>()
78
83
  const inputValue = ref<string | number>(getInitValue())
84
+ const isFocused = ref(false)
79
85
  let longPressTimer: ReturnType<typeof setTimeout> | null = null
80
86
 
81
87
  /**
@@ -414,6 +420,7 @@ function handleInput(event: any) {
414
420
  * 处理失焦事件
415
421
  */
416
422
  function handleBlur(event: any) {
423
+ isFocused.value = false
417
424
  const val = event.detail.value || ''
418
425
  updateValue(val)
419
426
  emit('blur', { value: val })
@@ -423,6 +430,7 @@ function handleBlur(event: any) {
423
430
  * 处理聚焦事件
424
431
  */
425
432
  function handleFocus(event: any) {
433
+ isFocused.value = true
426
434
  emit('focus', event.detail)
427
435
  }
428
436
 
@@ -90,7 +90,7 @@
90
90
  background-color: transparent;
91
91
  border: none;
92
92
  @include m(hover) {
93
- opacity: 0.6;
93
+ opacity: $-opacity-disabled;
94
94
  }
95
95
  }
96
96
 
@@ -3,15 +3,16 @@
3
3
 
4
4
  @include b(link) {
5
5
  display: inline-block;
6
- @include e(medium) {
6
+
7
+ @include m(medium) {
7
8
  font-size: $-link-font-size-medium;
8
9
  }
9
10
 
10
- @include e(small) {
11
+ @include m(small) {
11
12
  font-size: $-link-font-size-small;
12
13
  }
13
14
 
14
- @include e(large) {
15
+ @include m(large) {
15
16
  font-size: $-link-font-size-large;
16
17
  }
17
18
 
@@ -44,14 +45,14 @@
44
45
  }
45
46
 
46
47
  @include when(disabled) {
47
- opacity: .6;
48
+ opacity: $-opacity-disabled;
48
49
  }
49
50
 
50
- &__prefix-icon:not(:empty) + &__content:not(:empty) {
51
- padding-left: 8rpx;
52
- }
51
+ .#{$B}__prefix-icon:not(:empty) + .#{$B}__content:not(:empty) {
52
+ padding-left: 8rpx;
53
+ }
53
54
 
54
- &__content:not(:empty) + &__suffix-icon:not(:empty) {
55
- padding-left: 8rpx;
56
- }
55
+ .#{$B}__content:not(:empty) + .#{$B}__suffix-icon:not(:empty) {
56
+ padding-left: 8rpx;
57
+ }
57
58
  }
@@ -12,7 +12,7 @@
12
12
  @include e(body) {
13
13
  width: 100%;
14
14
  height: 100%;
15
- animation: oxy-rotate 0.8s linear infinite;
15
+ animation: oxy-rotate linear infinite;
16
16
  animation-duration: 2s;
17
17
 
18
18
  }
@@ -15,7 +15,7 @@
15
15
 
16
16
  @include edeep(loading) {
17
17
  display: inline-block;
18
- margin-right: 16rpx;
18
+ margin-right: $-spacing-16;
19
19
  vertical-align: middle;
20
20
  width: $-loadmore-loading-size;
21
21
  height: $-loadmore-loading-size;
@@ -47,10 +47,10 @@
47
47
  text-align: center;
48
48
  font-size: $-message-box-title-fs;
49
49
  color: $-message-box-title-color;
50
- line-height: 48rpx;
51
- font-weight: 500;
52
- padding-top: 16rpx;
53
- padding-bottom: 24rpx;
50
+ line-height: $-lh-base;
51
+ font-weight: $-fw-medium;
52
+ padding-top: $-spacing-16;
53
+ padding-bottom: $-spacing-24;
54
54
  }
55
55
 
56
56
  @include e(content) {
@@ -59,7 +59,7 @@
59
59
  font-size: $-message-box-content-fs;
60
60
  text-align: center;
61
61
  overflow: auto;
62
- line-height: 48rpx;
62
+ line-height: $-lh-base;
63
63
 
64
64
  &::-webkit-scrollbar {
65
65
  width: $-message-box-content-scrollbar-width;
@@ -89,7 +89,7 @@
89
89
 
90
90
  @include edeep(actions-btn) {
91
91
  &:not(:last-child) {
92
- margin-right: 32rpx;
92
+ margin-right: $-spacing-32;
93
93
  }
94
94
  }
95
95
 
@@ -104,6 +104,6 @@
104
104
  }
105
105
 
106
106
  @include e(cancel) {
107
- margin-right: 32rpx;
107
+ margin-right: $-spacing-32;
108
108
  }
109
109
  }
@@ -88,6 +88,6 @@
88
88
  top: 0;
89
89
  left: 0;
90
90
  width: 100%;
91
- z-index: 500;
91
+ z-index: $-z-index-fixed;
92
92
  }
93
93
  }
@@ -52,7 +52,7 @@ export default {
52
52
  <script lang="ts" setup>
53
53
  import OxyIcon from '../oxy-icon/oxy-icon.vue'
54
54
  import { type CSSProperties, computed, getCurrentInstance, nextTick, onMounted, ref, watch } from 'vue'
55
- import { getRect, isDef, objToStyle, unitConvert } from '../common/util'
55
+ import { convertPxToRpx, getRect, isDef, objToStyle, unitConvert } from '../common/util'
56
56
  import { navbarProps } from './types'
57
57
 
58
58
  const props = defineProps(navbarProps)
@@ -139,8 +139,7 @@ function setPlaceholderHeight() {
139
139
  const rectBottom = Number(res.bottom)
140
140
  const occupiedHeight =
141
141
  rectHeight > 0 ? rectHeight : !Number.isNaN(rectTop) && !Number.isNaN(rectBottom) ? Math.max(rectBottom - rectTop, 0) : 0
142
- const pxPer100Rpx = uni.upx2px(100)
143
- const occupiedHeightInRpx = pxPer100Rpx ? (occupiedHeight / pxPer100Rpx) * 100 : occupiedHeight * 2
142
+ const occupiedHeightInRpx = convertPxToRpx(occupiedHeight)
144
143
 
145
144
  placeholderHeight.value = occupiedHeight ? occupiedHeightInRpx : ''
146
145
  })
@@ -51,11 +51,11 @@
51
51
  height: 100%;
52
52
  color: $-password-input-text-color;
53
53
  font-size: $-password-input-font-size;
54
- line-height: 1.2;
54
+ line-height: $-line-height-base;
55
55
  background: $-password-input-background;
56
56
 
57
57
  @include when(border) {
58
- border: 1px solid $-password-input-border-color;
58
+ border: #{$-border-width-base} solid $-password-input-border-color;
59
59
 
60
60
  &:not(:last-child) {
61
61
  border-right: none;
@@ -80,7 +80,7 @@
80
80
  width: $-password-input-dot-size;
81
81
  height: $-password-input-dot-size;
82
82
  background: $-password-input-dot-color;
83
- border-radius: 100%;
83
+ border-radius: $-radius-circle;
84
84
  transform: translate(-50%, -50%);
85
85
  visibility: hidden;
86
86
  }
@@ -121,4 +121,4 @@
121
121
  100% {
122
122
  opacity: 0;
123
123
  }
124
- }
124
+ }
@@ -103,7 +103,7 @@ export const pickerProps = {
103
103
  /**
104
104
  * 选项总高度
105
105
  */
106
- columnsHeight: makeNumberProp(217),
106
+ columnsHeight: makeNumberProp(434),
107
107
  /**
108
108
  * 选项值对应的键名
109
109
  */
@@ -3,12 +3,12 @@
3
3
  <view class="oxy-picker-view__loading" v-if="loading">
4
4
  <oxy-loading :color="loadingColor" />
5
5
  </view>
6
- <view :style="`height: ${(columnsHeight - 20) * 2}rpx;`">
6
+ <view :style="`height: ${innerColumnsHeight}rpx;`">
7
7
  <picker-view
8
8
  mask-class="oxy-picker-view__mask"
9
9
  indicator-class="oxy-picker-view__roller"
10
- :indicator-style="`height: ${itemHeight * 2}rpx;`"
11
- :style="`height: ${(columnsHeight - 20) * 2}rpx;`"
10
+ :indicator-style="`height: ${itemHeight}rpx;`"
11
+ :style="`height: ${innerColumnsHeight}rpx;`"
12
12
  :value="selectedIndex"
13
13
  :immediate-change="immediateChange"
14
14
  @change="onChange"
@@ -22,7 +22,7 @@
22
22
  :class="`oxy-picker-view-column__item ${row['disabled'] ? 'oxy-picker-view-column__item--disabled' : ''} ${
23
23
  selectedIndex[colIndex] == rowIndex ? 'oxy-picker-view-column__item--active' : ''
24
24
  }`"
25
- :style="`line-height: ${itemHeight * 2}rpx;`"
25
+ :style="`line-height: ${itemHeight}rpx;`"
26
26
  >
27
27
  {{ row[labelKey] }}
28
28
  </view>
@@ -44,13 +44,16 @@ export default {
44
44
  </script>
45
45
  <script lang="ts" setup>
46
46
  import OxyLoading from '../oxy-loading/oxy-loading.vue'
47
- import { getCurrentInstance, ref, watch, nextTick } from 'vue'
47
+ import { computed, getCurrentInstance, ref, watch, nextTick } from 'vue'
48
48
  import { deepClone, getType, isArray, isDef, isEqual, range } from '../common/util'
49
49
  import { formatArray, pickerViewProps, type ColumnItem, type PickerViewExpose } from './types'
50
50
 
51
51
  const props = defineProps(pickerViewProps)
52
52
  const emit = defineEmits(['change', 'pickstart', 'pickend', 'update:modelValue'])
53
53
 
54
+ // Root has 24rpx vertical padding on top and bottom; compensate here to keep visual viewport stable.
55
+ const innerColumnsHeight = computed(() => Math.max(props.columnsHeight - 48, props.itemHeight))
56
+
54
57
  const formatColumns = ref<ColumnItem[][]>([]) // 格式化后的列数据
55
58
  const selectedIndex = ref<Array<number>>([]) // 格式化之后,每列选中的下标集合
56
59
 
@@ -29,11 +29,11 @@ export const pickerViewProps = {
29
29
  /**
30
30
  * picker内部滚筒高
31
31
  */
32
- columnsHeight: makeNumberProp(217),
32
+ columnsHeight: makeNumberProp(434),
33
33
  /**
34
34
  * picker item的高度
35
35
  */
36
- itemHeight: makeNumberProp(35),
36
+ itemHeight: makeNumberProp(70),
37
37
  /**
38
38
  * 选项对象中,value对应的 key
39
39
  */
@@ -21,7 +21,7 @@
21
21
  position: relative;
22
22
  flex: 1;
23
23
  height: $-progress-height;
24
- border-radius: calc($-progress-height / 2);
24
+ border-radius: $-progress-radius;
25
25
  background: $-progress-bg;
26
26
  }
27
27
  @include e(inner) {
@@ -30,7 +30,7 @@
30
30
  top: 0;
31
31
  left: 0;
32
32
  height: 100%;
33
- border-radius: calc($-progress-height / 2);
33
+ border-radius: $-progress-radius;
34
34
  background: $-progress-color;
35
35
  transition-property: width;
36
36
  transition-timing-function: linear;
@@ -92,7 +92,7 @@
92
92
  vertical-align: top;
93
93
  font-size: $-radio-label-fs;
94
94
  color: $-radio-label-color;
95
- line-height: 48rpx;
95
+ line-height: $-lh-base;
96
96
  word-break: break-all;
97
97
  }
98
98
  @include when(checked) {
@@ -109,8 +109,10 @@
109
109
 
110
110
  @include when(dot) {
111
111
  .oxy-radio__shape {
112
+ width: $-radio-dot-shape-size;
113
+ height: $-radio-dot-shape-size;
112
114
  border: 4rpx solid $-radio-dot-border-color;
113
- border-radius: 50%;
115
+ border-radius: $-radius-circle;
114
116
  position: relative;
115
117
  display: inline-block;
116
118
  box-sizing: border-box;
@@ -123,7 +125,7 @@
123
125
  height: $-radio-dot-size;
124
126
  left: calc(50% - #{$-radio-dot-size / 2});
125
127
  top: calc(50% - #{$-radio-dot-size / 2});
126
- border-radius: 50%;
128
+ border-radius: $-radius-circle;
127
129
  background-color: $-color-white;
128
130
  transform: scale(0);
129
131
  transition: transform .2s ease-in;
@@ -145,7 +147,7 @@
145
147
  @include when(button) {
146
148
  display: inline-block;
147
149
  margin-top: 0;
148
- margin-right: 24rpx;
150
+ margin-right: $-spacing-24;
149
151
 
150
152
  .oxy-radio__shape {
151
153
  display: none;
@@ -294,6 +296,8 @@
294
296
 
295
297
  @include when(dot) {
296
298
  .oxy-radio__shape {
299
+ width: $-radio-dot-shape-large-size;
300
+ height: $-radio-dot-shape-large-size;
297
301
  &::before {
298
302
  width: $-radio-dot-large-size;
299
303
  height: $-radio-dot-large-size;
@@ -14,7 +14,6 @@
14
14
  // 顶部与两侧留白适当放大,避免按钮组在16px基准字号下过于紧凑
15
15
  @include when(button) {
16
16
  width: 100%;
17
- height: 100%;
18
17
  padding: 24rpx 32rpx 40rpx 32rpx;
19
18
  box-sizing: border-box;
20
19
  overflow: hidden;