oxy-uni-ui 2.1.2 → 2.1.4
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.
- package/attributes.json +1 -1
- package/components/common/AbortablePromise.ts +4 -0
- package/components/common/abstracts/variable.scss +172 -66
- package/components/common/base64.ts +6 -0
- package/components/common/clickoutside.ts +5 -0
- package/components/common/interceptor.ts +9 -0
- package/components/common/path.ts +4 -0
- package/components/common/props.ts +23 -0
- package/components/common/util.ts +18 -1
- package/components/composables/index.ts +2 -0
- package/components/composables/useCell.ts +8 -1
- package/components/composables/useChildren.ts +27 -1
- package/components/composables/useCountDown.ts +10 -1
- package/components/composables/useDynamicVirtualScroll.ts +9 -0
- package/components/composables/useGlobalLoading.ts +6 -0
- package/components/composables/useGlobalMessage.ts +6 -0
- package/components/composables/useGlobalToast.ts +6 -0
- package/components/composables/useLockScroll.ts +9 -0
- package/components/composables/useParent.ts +65 -14
- package/components/composables/usePopover.ts +9 -0
- package/components/composables/useQueue.ts +8 -0
- package/components/composables/useRaf.ts +10 -0
- package/components/composables/useSharedState.ts +284 -0
- package/components/composables/useTouch.ts +8 -0
- package/components/composables/useTranslate.ts +9 -0
- package/components/composables/useUpload.ts +83 -11
- package/components/composables/useVirtualScroll.ts +7 -0
- package/components/composables/useWindowResize.ts +9 -0
- package/components/oxy-action-sheet/index.scss +5 -5
- package/components/oxy-action-sheet/oxy-action-sheet.vue +11 -0
- package/components/oxy-backtop/index.scss +2 -2
- package/components/oxy-backtop/oxy-backtop.vue +2 -0
- package/components/oxy-badge/oxy-badge.vue +2 -0
- package/components/oxy-badge/types.ts +3 -0
- package/components/oxy-button/index.scss +13 -13
- package/components/oxy-button/oxy-button.vue +11 -0
- package/components/oxy-button/types.ts +3 -3
- package/components/oxy-calendar/index.scss +17 -17
- package/components/oxy-calendar/oxy-calendar.vue +31 -0
- package/components/oxy-calendar/types.ts +3 -0
- package/components/oxy-calendar-view/month/month.vue +2 -0
- package/components/oxy-calendar-view/monthPanel/month-panel.vue +3 -1
- package/components/oxy-calendar-view/monthPanel/types.ts +10 -7
- package/components/oxy-calendar-view/oxy-calendar-view.vue +2 -0
- package/components/oxy-calendar-view/types.ts +3 -1
- package/components/oxy-calendar-view/year/types.ts +33 -1
- package/components/oxy-calendar-view/year/year.vue +2 -0
- package/components/oxy-calendar-view/yearPanel/year-panel.vue +2 -0
- package/components/oxy-card/index.scss +1 -1
- package/components/oxy-card/oxy-card.vue +2 -0
- package/components/oxy-cell/index.scss +3 -1
- package/components/oxy-cell/oxy-cell.vue +6 -4
- package/components/oxy-cell-group/oxy-cell-group.vue +2 -0
- package/components/oxy-checkbox/index.scss +7 -7
- package/components/oxy-checkbox/oxy-checkbox.vue +22 -16
- package/components/oxy-checkbox/types.ts +9 -0
- package/components/oxy-checkbox-group/index.scss +1 -1
- package/components/oxy-checkbox-group/oxy-checkbox-group.vue +2 -0
- package/components/oxy-circle/oxy-circle.vue +2 -0
- package/components/oxy-col/oxy-col.vue +3 -1
- package/components/oxy-col-picker/index.scss +3 -3
- package/components/oxy-col-picker/oxy-col-picker.vue +17 -1
- package/components/oxy-col-picker/types.ts +3 -0
- package/components/oxy-collapse/index.scss +2 -2
- package/components/oxy-collapse/oxy-collapse.vue +9 -0
- package/components/oxy-collapse-item/oxy-collapse-item.vue +4 -2
- package/components/oxy-config-provider/oxy-config-provider.vue +18 -0
- package/components/oxy-config-provider/types.ts +18 -0
- package/components/oxy-corner/index.scss +50 -32
- package/components/oxy-corner/oxy-corner.vue +2 -0
- package/components/oxy-count-down/oxy-count-down.vue +2 -0
- package/components/oxy-count-to/oxy-count-to.vue +12 -1
- package/components/oxy-count-to/types.ts +14 -4
- package/components/oxy-curtain/index.scss +10 -9
- package/components/oxy-curtain/oxy-curtain.vue +2 -0
- package/components/oxy-date-strip/oxy-date-strip.vue +22 -1
- package/components/oxy-date-strip-item/index.scss +4 -4
- package/components/oxy-date-strip-item/oxy-date-strip-item.vue +2 -0
- package/components/oxy-datetime-picker/index.scss +3 -3
- package/components/oxy-datetime-picker/oxy-datetime-picker.vue +11 -1
- package/components/oxy-datetime-picker-view/oxy-datetime-picker-view.vue +2 -0
- package/components/oxy-divider/oxy-divider.vue +2 -0
- package/components/oxy-drop-menu/index.scss +2 -2
- package/components/oxy-drop-menu/oxy-drop-menu.vue +3 -0
- package/components/oxy-drop-menu-item/index.scss +1 -1
- package/components/oxy-drop-menu-item/oxy-drop-menu-item.vue +17 -9
- package/components/oxy-echarts/oxy-echarts.vue +4 -2
- package/components/oxy-fab/index.scss +1 -1
- package/components/oxy-fab/oxy-fab.vue +27 -0
- package/components/oxy-file-list/index.scss +9 -9
- package/components/oxy-file-list/oxy-file-list.vue +29 -17
- package/components/oxy-floating-panel/oxy-floating-panel.vue +34 -10
- package/components/oxy-footer/index.scss +7 -0
- package/components/oxy-footer/oxy-footer.vue +4 -2
- package/components/oxy-footer/types.ts +9 -6
- package/components/oxy-form/oxy-form.vue +13 -1
- package/components/oxy-form-item/oxy-form-item.vue +5 -3
- package/components/oxy-gap/oxy-gap.vue +2 -0
- package/components/oxy-global-loading/oxy-global-loading.vue +18 -5
- package/components/oxy-global-message/oxy-global-message.vue +30 -17
- package/components/oxy-global-toast/oxy-global-toast.vue +18 -5
- package/components/oxy-grid/oxy-grid.vue +6 -0
- package/components/oxy-grid-item/index.scss +1 -1
- package/components/oxy-grid-item/oxy-grid-item.vue +22 -20
- package/components/oxy-guidance/index.scss +9 -9
- package/components/oxy-guidance/oxy-guidance.vue +22 -16
- package/components/oxy-icon/oxy-icon.vue +2 -0
- package/components/oxy-icon/types.ts +3 -0
- package/components/oxy-image-preview/index.scss +75 -0
- package/components/oxy-image-preview/index.ts +56 -0
- package/components/oxy-image-preview/oxy-image-preview.vue +221 -0
- package/components/oxy-image-preview/types.ts +164 -0
- package/components/oxy-img/oxy-img.vue +2 -0
- package/components/oxy-img-cropper/index.scss +2 -2
- package/components/oxy-img-cropper/oxy-img-cropper.vue +6 -0
- package/components/oxy-img-lazy/oxy-img-lazy.vue +9 -0
- package/components/oxy-index-anchor/index.scss +1 -1
- package/components/oxy-index-anchor/oxy-index-anchor.vue +2 -2
- package/components/oxy-index-bar/index.scss +1 -1
- package/components/oxy-index-bar/oxy-index-bar.vue +18 -0
- package/components/oxy-input/index.scss +2 -1
- package/components/oxy-input/oxy-input.vue +18 -4
- package/components/oxy-input/types.ts +6 -0
- package/components/oxy-input-number/index.scss +3 -1
- package/components/oxy-input-number/oxy-input-number.vue +2 -0
- package/components/oxy-keyboard/index.scss +3 -3
- package/components/oxy-keyboard/key/index.vue +2 -0
- package/components/oxy-keyboard/oxy-keyboard.vue +11 -2
- package/components/oxy-link/index.scss +8 -4
- package/components/oxy-link/oxy-link.vue +9 -3
- package/components/oxy-link/types.ts +2 -2
- package/components/oxy-list/oxy-list.vue +2 -0
- package/components/oxy-list/types.ts +7 -0
- package/components/oxy-loading/oxy-loading.vue +6 -0
- package/components/oxy-loadmore/index.scss +1 -1
- package/components/oxy-loadmore/oxy-loadmore.vue +2 -0
- package/components/oxy-long-press-menu/index.scss +1 -1
- package/components/oxy-long-press-menu/oxy-long-press-menu.vue +42 -13
- package/components/oxy-message-box/index.scss +223 -36
- package/components/oxy-message-box/index.ts +49 -23
- package/components/oxy-message-box/oxy-message-box.vue +181 -56
- package/components/oxy-message-box/types.ts +60 -2
- package/components/oxy-navbar/index.scss +1 -1
- package/components/oxy-navbar/oxy-navbar.vue +9 -6
- package/components/oxy-navbar-capsule/oxy-navbar-capsule.vue +2 -0
- package/components/oxy-notice-bar/index.scss +1 -1
- package/components/oxy-notice-bar/oxy-notice-bar.vue +29 -0
- package/components/oxy-notify/index.ts +16 -12
- package/components/oxy-notify/oxy-notify.vue +11 -4
- package/components/oxy-overlay/oxy-overlay.vue +34 -2
- package/components/oxy-pagination/oxy-pagination.vue +2 -0
- package/components/oxy-password-input/oxy-password-input.vue +2 -0
- package/components/oxy-picker/index.scss +7 -7
- package/components/oxy-picker/oxy-picker.vue +11 -0
- package/components/oxy-picker-view/index.scss +1 -1
- package/components/oxy-picker-view/oxy-picker-view.vue +2 -0
- package/components/oxy-popover/index.scss +2 -2
- package/components/oxy-popover/oxy-popover.vue +4 -1
- package/components/oxy-popup/oxy-popup.vue +8 -0
- package/components/oxy-progress/index.scss +2 -2
- package/components/oxy-progress/oxy-progress.vue +7 -0
- package/components/oxy-qrcode/draw.ts +15 -1
- package/components/oxy-qrcode/oxy-qrcode.vue +10 -3
- package/components/oxy-radio/index.scss +8 -8
- package/components/oxy-radio/oxy-radio.vue +13 -11
- package/components/oxy-radio-group/index.scss +1 -1
- package/components/oxy-radio-group/oxy-radio-group.vue +2 -0
- package/components/oxy-rate/oxy-rate.vue +5 -0
- package/components/oxy-rate/types.ts +2 -2
- package/components/oxy-resize/oxy-resize.vue +12 -0
- package/components/oxy-rich-text/index.scss +9 -9
- package/components/oxy-rich-text/oxy-rich-text.vue +6 -0
- package/components/oxy-rich-text/types.ts +15 -0
- package/components/oxy-root-portal/oxy-root-portal.vue +23 -15
- package/components/oxy-row/oxy-row.vue +2 -0
- package/components/oxy-search/index.scss +3 -3
- package/components/oxy-search/oxy-search.vue +19 -0
- package/components/oxy-segmented/index.scss +4 -4
- package/components/oxy-segmented/oxy-segmented.vue +2 -0
- package/components/oxy-select/index.scss +25 -25
- package/components/oxy-select/oxy-select.vue +27 -0
- package/components/oxy-select/types.ts +3 -0
- package/components/oxy-select-picker/index.scss +5 -5
- package/components/oxy-select-picker/oxy-select-picker.vue +7 -0
- package/components/oxy-sidebar/oxy-sidebar.vue +2 -0
- package/components/oxy-sidebar-item/index.scss +3 -3
- package/components/oxy-sidebar-item/oxy-sidebar-item.vue +17 -31
- package/components/oxy-signature/oxy-signature.vue +17 -0
- package/components/oxy-skeleton/oxy-skeleton.vue +7 -1
- package/components/oxy-slide-verify/index.scss +95 -0
- package/components/oxy-slide-verify/oxy-slide-verify.vue +244 -0
- package/components/oxy-slide-verify/types.ts +98 -0
- package/components/oxy-slider/oxy-slider.vue +3 -0
- package/components/oxy-sort-button/index.scss +10 -8
- package/components/oxy-sort-button/oxy-sort-button.vue +6 -0
- package/components/oxy-splitter/index.scss +9 -0
- package/components/oxy-splitter/oxy-splitter.vue +23 -2
- package/components/oxy-splitter-panel/index.scss +7 -5
- package/components/oxy-splitter-panel/oxy-splitter-panel.vue +93 -89
- package/components/oxy-status-tip/index.scss +3 -3
- package/components/oxy-status-tip/oxy-status-tip.vue +2 -0
- package/components/oxy-step/index.scss +4 -4
- package/components/oxy-step/oxy-step.vue +15 -13
- package/components/oxy-steps/oxy-steps.vue +2 -0
- package/components/oxy-sticky/oxy-sticky.vue +5 -3
- package/components/oxy-stream-render/oxy-stream-render.vue +29 -0
- package/components/oxy-swipe-action/oxy-swipe-action.vue +8 -0
- package/components/oxy-swiper/oxy-swiper.vue +6 -0
- package/components/oxy-swiper-nav/index.scss +4 -4
- package/components/oxy-switch/index.scss +6 -3
- package/components/oxy-switch/oxy-switch.vue +10 -0
- package/components/oxy-tab/index.scss +1 -7
- package/components/oxy-tab/oxy-tab.vue +12 -10
- package/components/oxy-tabbar/oxy-tabbar.vue +5 -0
- package/components/oxy-tabbar-item/oxy-tabbar-item.vue +11 -9
- package/components/oxy-table/index.scss +1 -1
- package/components/oxy-table/oxy-table.vue +8 -0
- package/components/oxy-table/types.ts +3 -0
- package/components/oxy-table-col/oxy-table-col.vue +21 -19
- package/components/oxy-tabs/index.scss +11 -11
- package/components/oxy-tabs/oxy-tabs.vue +17 -0
- package/components/oxy-tag/index.scss +24 -5
- package/components/oxy-tag/oxy-tag.vue +17 -2
- package/components/oxy-tag/types.ts +7 -0
- package/components/oxy-text/oxy-text.vue +12 -1
- package/components/oxy-textarea/index.scss +3 -2
- package/components/oxy-textarea/oxy-textarea.vue +10 -4
- package/components/oxy-toast/index.ts +21 -20
- package/components/oxy-toast/oxy-toast.vue +30 -5
- package/components/oxy-toast/types.ts +20 -9
- package/components/oxy-tooltip/index.scss +1 -1
- package/components/oxy-tooltip/oxy-tooltip.vue +2 -0
- package/components/oxy-transition/index.scss +3 -1
- package/components/oxy-transition/oxy-transition.vue +14 -0
- package/components/oxy-tree/index.scss +3 -3
- package/components/oxy-tree/oxy-tree.vue +28 -5
- package/components/oxy-tree/types.ts +57 -1
- package/components/oxy-upload/index.scss +9 -9
- package/components/oxy-upload/oxy-upload.vue +5 -3
- package/components/oxy-verification-code/oxy-verification-code.vue +24 -0
- package/components/oxy-video-preview/index.scss +12 -7
- package/components/oxy-video-preview/index.ts +64 -0
- package/components/oxy-video-preview/oxy-video-preview.vue +102 -31
- package/components/oxy-video-preview/types.ts +54 -8
- package/components/oxy-virtual-scroll/index.scss +1 -1
- package/components/oxy-virtual-scroll/oxy-virtual-scroll.vue +2 -0
- package/components/oxy-voice-player/index.scss +64 -64
- package/components/oxy-voice-player/oxy-voice-player.vue +38 -10
- package/components/oxy-waterfall/oxy-waterfall.vue +13 -0
- package/components/oxy-waterfall/types.ts +7 -0
- package/components/oxy-waterfall-item/oxy-waterfall-item.vue +9 -0
- package/components/oxy-watermark/oxy-watermark.vue +2 -0
- package/global.d.ts +2 -0
- package/index.ts +2 -0
- package/locale/lang/en-US.ts +51 -2
- package/locale/lang/zh-CN.ts +51 -2
- package/package.json +2 -2
- package/styles/all.scss +125 -0
- package/tags.json +1 -1
- package/vite-plugins/vite-plugin-host-class.ts +166 -0
- package/web-types.json +1 -1
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
border: none;
|
|
53
53
|
border-radius: 0;
|
|
54
54
|
color: $-button-normal-color;
|
|
55
|
-
transition: opacity
|
|
55
|
+
transition: opacity $-transition-duration-base;
|
|
56
56
|
user-select: none;
|
|
57
57
|
font-weight: normal;
|
|
58
58
|
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
@include e(loading) {
|
|
99
|
-
margin-right:
|
|
99
|
+
margin-right: $-spacing-12;
|
|
100
100
|
animation: oxy-rotate 0.8s linear infinite;
|
|
101
101
|
animation-duration: 2s;
|
|
102
102
|
}
|
|
@@ -146,11 +146,11 @@
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
@include when(
|
|
150
|
-
height: $-button-
|
|
151
|
-
padding: $-button-
|
|
152
|
-
border-radius: $-button-
|
|
153
|
-
font-size: $-button-
|
|
149
|
+
@include when(default) {
|
|
150
|
+
height: $-button-default-height;
|
|
151
|
+
padding: $-button-default-padding;
|
|
152
|
+
border-radius: $-button-default-radius;
|
|
153
|
+
font-size: $-button-default-fs;
|
|
154
154
|
min-width: 240rpx;
|
|
155
155
|
|
|
156
156
|
|
|
@@ -168,8 +168,8 @@
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
.oxy-button__loading {
|
|
171
|
-
width: $-button-
|
|
172
|
-
height: $-button-
|
|
171
|
+
width: $-button-default-loading;
|
|
172
|
+
height: $-button-default-loading;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
@include when(text) {
|
|
198
198
|
color: $-button-primary-bg-color;
|
|
199
199
|
min-width: 0;
|
|
200
|
-
padding:
|
|
200
|
+
padding: $-spacing-8 0;
|
|
201
201
|
|
|
202
202
|
&::after {
|
|
203
203
|
display: none;
|
|
@@ -270,9 +270,9 @@
|
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
-
&.is-
|
|
273
|
+
&.is-default {
|
|
274
274
|
&::after {
|
|
275
|
-
border-radius: calc(2 * $-button-
|
|
275
|
+
border-radius: calc(2 * $-button-default-radius);
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
|
|
@@ -311,7 +311,7 @@
|
|
|
311
311
|
|
|
312
312
|
@include edeep(icon) {
|
|
313
313
|
display: block;
|
|
314
|
-
margin-right:
|
|
314
|
+
margin-right: $-spacing-12;
|
|
315
315
|
font-size: $-button-icon-fs;
|
|
316
316
|
vertical-align: middle;
|
|
317
317
|
}
|
|
@@ -54,7 +54,9 @@ export default {
|
|
|
54
54
|
name: 'oxy-button',
|
|
55
55
|
options: {
|
|
56
56
|
addGlobalClass: true,
|
|
57
|
+
// #ifndef MP-TOUTIAO
|
|
57
58
|
virtualHost: true,
|
|
59
|
+
// #endif
|
|
58
60
|
styleIsolation: 'shared'
|
|
59
61
|
}
|
|
60
62
|
}
|
|
@@ -67,6 +69,11 @@ import { ref } from 'vue'
|
|
|
67
69
|
import base64 from '../common/base64'
|
|
68
70
|
import { buttonProps } from './types'
|
|
69
71
|
|
|
72
|
+
/**
|
|
73
|
+
* 生成 loading 状态的 SVG 图标。
|
|
74
|
+
* @param color 图标颜色
|
|
75
|
+
* @param reverse 是否反转颜色
|
|
76
|
+
*/
|
|
70
77
|
const loadingIcon = (color = '#4D80F0', reverse = true) => {
|
|
71
78
|
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42 42"><defs><linearGradient x1="100%" y1="0%" x2="0%" y2="0%" id="a"><stop stop-color="${
|
|
72
79
|
reverse ? color : '#fff'
|
|
@@ -163,6 +170,10 @@ function handleChooseavatar(event: any) {
|
|
|
163
170
|
function handleAgreePrivacyAuthorization(event: any) {
|
|
164
171
|
emit('agreeprivacyauthorization', event.detail)
|
|
165
172
|
}
|
|
173
|
+
/**
|
|
174
|
+
* 根据按钮类型和状态构建 loading 图标 SVG 的 base64 编码。
|
|
175
|
+
* 当未指定 loadingColor 时,根据按钮 type 使用对应颜色。
|
|
176
|
+
*/
|
|
166
177
|
function buildLoadingSvg() {
|
|
167
178
|
const { loadingColor, type, plain } = props
|
|
168
179
|
let color = loadingColor
|
|
@@ -2,7 +2,7 @@ import type { ExtractPropTypes, PropType } from 'vue'
|
|
|
2
2
|
import { baseProps, makeBooleanProp, makeStringProp } from '../common/props'
|
|
3
3
|
|
|
4
4
|
export type ButtonType = 'primary' | 'success' | 'info' | 'warning' | 'error' | 'default' | 'text' | 'icon'
|
|
5
|
-
export type ButtonSize = 'small' | '
|
|
5
|
+
export type ButtonSize = 'small' | 'default' | 'large'
|
|
6
6
|
export type ButtonLang = 'zh_CN' | 'zh_TW' | 'en'
|
|
7
7
|
|
|
8
8
|
export type ButtonOpenType =
|
|
@@ -64,9 +64,9 @@ export const buttonProps = {
|
|
|
64
64
|
*/
|
|
65
65
|
type: makeStringProp<ButtonType>('primary'),
|
|
66
66
|
/**
|
|
67
|
-
* 按钮尺寸,可选值:small /
|
|
67
|
+
* 按钮尺寸,可选值:small / default / large
|
|
68
68
|
*/
|
|
69
|
-
size: makeStringProp<ButtonSize>('
|
|
69
|
+
size: makeStringProp<ButtonSize>('default'),
|
|
70
70
|
/**
|
|
71
71
|
* 图标类名
|
|
72
72
|
*/
|
|
@@ -42,31 +42,31 @@
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
@include e(title) {
|
|
45
|
-
color: $-
|
|
46
|
-
height: $-
|
|
47
|
-
line-height: $-
|
|
45
|
+
color: $-calendar-title-color;
|
|
46
|
+
height: $-calendar-title-height;
|
|
47
|
+
line-height: $-calendar-title-height;
|
|
48
48
|
text-align: center;
|
|
49
|
-
font-size: $-
|
|
50
|
-
font-weight: $-
|
|
49
|
+
font-size: $-calendar-title-fs;
|
|
50
|
+
font-weight: $-calendar-title-fw;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
@include edeep(close) {
|
|
54
54
|
position: absolute;
|
|
55
|
-
top: $-
|
|
56
|
-
right: $-
|
|
57
|
-
color: $-
|
|
58
|
-
font-size: $-
|
|
55
|
+
top: $-calendar-close-top;
|
|
56
|
+
right: $-calendar-close-right;
|
|
57
|
+
color: $-calendar-close-color;
|
|
58
|
+
font-size: $-calendar-close-fs;
|
|
59
59
|
transform: rotate(-45deg);
|
|
60
60
|
line-height: 1.1;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
@include e(tabs) {
|
|
64
64
|
width: 444rpx;
|
|
65
|
-
margin:
|
|
65
|
+
margin: $-spacing-24 auto 28rpx;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
@include e(shortcuts) {
|
|
69
|
-
padding:
|
|
69
|
+
padding: $-spacing-40 0;
|
|
70
70
|
text-align: center;
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -78,9 +78,9 @@
|
|
|
78
78
|
@include when(show-confirm) {
|
|
79
79
|
height: 788rpx;
|
|
80
80
|
|
|
81
|
-
@include when(range) {
|
|
82
|
-
|
|
83
|
-
}
|
|
81
|
+
// @include when(range) {
|
|
82
|
+
// height: 768rpx;
|
|
83
|
+
// }
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -106,12 +106,12 @@
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
@include e(range-sperator) {
|
|
109
|
-
margin: 0
|
|
109
|
+
margin: 0 $-spacing-48;
|
|
110
110
|
color: $-calendar-disabled-color;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
@include e(confirm) {
|
|
114
|
-
padding:
|
|
114
|
+
padding: $-spacing-24 $-spacing-48 $-spacing-32;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
@include edeep(cell) {
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
|
|
144
|
+
|
|
145
145
|
@include edeep(arrow) {
|
|
146
146
|
display: block;
|
|
147
147
|
font-size: $-cell-icon-size;
|
|
@@ -119,7 +119,9 @@ export default {
|
|
|
119
119
|
name: 'oxy-calendar',
|
|
120
120
|
options: {
|
|
121
121
|
addGlobalClass: true,
|
|
122
|
+
// #ifndef MP-TOUTIAO
|
|
122
123
|
virtualHost: true,
|
|
124
|
+
// #endif
|
|
123
125
|
styleIsolation: 'shared'
|
|
124
126
|
}
|
|
125
127
|
}
|
|
@@ -142,6 +144,14 @@ import { calendarProps, type CalendarExpose } from './types'
|
|
|
142
144
|
import type { CalendarType } from '../oxy-calendar-view/types'
|
|
143
145
|
const { translate } = useTranslate('calendar')
|
|
144
146
|
|
|
147
|
+
/**
|
|
148
|
+
* 默认的展示值格式化函数,将选中值转换为可读的展示文案。
|
|
149
|
+
* 根据不同 calendar type 格式化:date/dates/daterange/datetime/datetimerange/week/weekrange/month/monthrange。
|
|
150
|
+
*
|
|
151
|
+
* @param value 选中的值,可能是单个时间戳或时间戳数组
|
|
152
|
+
* @param type 日历类型
|
|
153
|
+
* @returns 格式化后的展示字符串
|
|
154
|
+
*/
|
|
145
155
|
const defaultDisplayFormat = (value: number | number[], type: CalendarType): string => {
|
|
146
156
|
switch (type) {
|
|
147
157
|
case 'date':
|
|
@@ -203,6 +213,12 @@ const defaultDisplayFormat = (value: number | number[], type: CalendarType): str
|
|
|
203
213
|
}
|
|
204
214
|
}
|
|
205
215
|
|
|
216
|
+
/**
|
|
217
|
+
* 范围选择时格式化单个端点日期。
|
|
218
|
+
* @param value 端点时间戳,为 0 或 undefined 时返回占位文案
|
|
219
|
+
* @param rangeType 'start' | 'end'
|
|
220
|
+
* @param type 日历类型
|
|
221
|
+
*/
|
|
206
222
|
const formatRange = (value: number, rangeType: 'start' | 'end', type: CalendarType) => {
|
|
207
223
|
switch (type) {
|
|
208
224
|
case 'daterange':
|
|
@@ -339,6 +355,10 @@ function scrollIntoView() {
|
|
|
339
355
|
calendarView.value && calendarView.value && calendarView.value.$.exposed.scrollIntoView()
|
|
340
356
|
}
|
|
341
357
|
// 对外暴露方法
|
|
358
|
+
/**
|
|
359
|
+
* 打开日历面板。设置面板可见、克隆当前值用于取消时恢复,等待渲染完成后自动滚动到选中日期。
|
|
360
|
+
* showTypeSwitch 模式下额外延迟滚动 tab 到可视区域。
|
|
361
|
+
*/
|
|
342
362
|
async function open() {
|
|
343
363
|
const { disabled, readonly } = props
|
|
344
364
|
|
|
@@ -378,6 +398,12 @@ function handleTypeChange({ index }: { index: number }) {
|
|
|
378
398
|
currentTab.value = index
|
|
379
399
|
currentType.value = type as CalendarType
|
|
380
400
|
}
|
|
401
|
+
/**
|
|
402
|
+
* 判断确认按钮是否应该禁用。
|
|
403
|
+
* - 范围选择未选满两端
|
|
404
|
+
* - dates 类型未选择任何日期
|
|
405
|
+
* - 值为空
|
|
406
|
+
*/
|
|
381
407
|
function getConfirmBtnStatus(value: number | number[] | null) {
|
|
382
408
|
let confirmBtnDisabled = false
|
|
383
409
|
// 范围选择未选择满,或者多日期选择未选择日期,按钮置灰不可点击
|
|
@@ -403,6 +429,11 @@ function handleChange({ value }: { value: number | number[] | null }) {
|
|
|
403
429
|
handleConfirm()
|
|
404
430
|
}
|
|
405
431
|
}
|
|
432
|
+
/**
|
|
433
|
+
* 确认选择。支持 beforeConfirm 异步校验:
|
|
434
|
+
* 若传入 beforeConfirm 回调,提供 resolve(isPass) 让调用方控制是否确认;
|
|
435
|
+
* 否则直接提交。
|
|
436
|
+
*/
|
|
406
437
|
function handleConfirm() {
|
|
407
438
|
if (props.beforeConfirm) {
|
|
408
439
|
props.beforeConfirm({
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
v-if="timeData.length"
|
|
48
48
|
v-model="timeValue"
|
|
49
49
|
:columns="timeData"
|
|
50
|
-
:columns-height="
|
|
50
|
+
:columns-height="260"
|
|
51
51
|
:immediate-change="immediateChange"
|
|
52
52
|
@change="handleTimeChange"
|
|
53
53
|
@pickstart="handlePickStart"
|
|
@@ -62,7 +62,9 @@
|
|
|
62
62
|
export default {
|
|
63
63
|
options: {
|
|
64
64
|
addGlobalClass: true,
|
|
65
|
+
// #ifndef MP-TOUTIAO
|
|
65
66
|
virtualHost: true,
|
|
67
|
+
// #endif
|
|
66
68
|
styleIsolation: 'shared'
|
|
67
69
|
}
|
|
68
70
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentPublicInstance, ExtractPropTypes, PropType } from 'vue'
|
|
2
|
-
import { makeBooleanProp,
|
|
2
|
+
import { makeBooleanProp, makeNumberProp, makeStringProp } from '../../common/props'
|
|
3
3
|
import type { CalendarFormatter, CalendarTimeFilter, CalendarType } from '../types'
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -15,23 +15,26 @@ export const monthPanelProps = {
|
|
|
15
15
|
/**
|
|
16
16
|
* 日期类型
|
|
17
17
|
*/
|
|
18
|
-
type:
|
|
18
|
+
type: makeStringProp<CalendarType>('date'),
|
|
19
19
|
/**
|
|
20
20
|
* 选中值
|
|
21
21
|
*/
|
|
22
|
-
value:
|
|
22
|
+
value: {
|
|
23
|
+
type: [Number, Array, null] as PropType<number | (number | null)[] | null>,
|
|
24
|
+
default: null
|
|
25
|
+
},
|
|
23
26
|
/**
|
|
24
27
|
* 最小日期时间戳
|
|
25
28
|
*/
|
|
26
|
-
minDate:
|
|
29
|
+
minDate: makeNumberProp(new Date(new Date().getFullYear(), new Date().getMonth() - 6, new Date().getDate()).getTime()),
|
|
27
30
|
/**
|
|
28
31
|
* 最大日期时间戳
|
|
29
32
|
*/
|
|
30
|
-
maxDate:
|
|
33
|
+
maxDate: makeNumberProp(new Date(new Date().getFullYear(), new Date().getMonth() + 6, new Date().getDate(), 23, 59, 59).getTime()),
|
|
31
34
|
/**
|
|
32
35
|
* 一周的第一天
|
|
33
36
|
*/
|
|
34
|
-
firstDayOfWeek:
|
|
37
|
+
firstDayOfWeek: makeNumberProp(0),
|
|
35
38
|
/**
|
|
36
39
|
* 格式化函数
|
|
37
40
|
*/
|
|
@@ -61,7 +64,7 @@ export const monthPanelProps = {
|
|
|
61
64
|
/**
|
|
62
65
|
* 面板高度
|
|
63
66
|
*/
|
|
64
|
-
panelHeight:
|
|
67
|
+
panelHeight: makeNumberProp(756),
|
|
65
68
|
/**
|
|
66
69
|
* 用于过滤时间选择器的数据
|
|
67
70
|
*/
|
|
@@ -3,18 +3,50 @@ import { makeBooleanProp, makeRequiredProp } from '../../common/props'
|
|
|
3
3
|
import type { CalendarFormatter, CalendarType } from '../types'
|
|
4
4
|
|
|
5
5
|
export const yearProps = {
|
|
6
|
+
/**
|
|
7
|
+
* 日历类型
|
|
8
|
+
*/
|
|
6
9
|
type: makeRequiredProp(String as PropType<CalendarType>),
|
|
10
|
+
/**
|
|
11
|
+
* 当前日期(13位时间戳)
|
|
12
|
+
*/
|
|
7
13
|
date: makeRequiredProp(Number),
|
|
14
|
+
/**
|
|
15
|
+
* 选中值,单选为时间戳,范围选择为时间戳数组
|
|
16
|
+
*/
|
|
8
17
|
value: makeRequiredProp([Number, Array] as PropType<number | (number | null)[] | null>),
|
|
18
|
+
/**
|
|
19
|
+
* 最小日期(13位时间戳)
|
|
20
|
+
*/
|
|
9
21
|
minDate: makeRequiredProp(Number),
|
|
22
|
+
/**
|
|
23
|
+
* 最大日期(13位时间戳)
|
|
24
|
+
*/
|
|
10
25
|
maxDate: makeRequiredProp(Number),
|
|
11
|
-
|
|
26
|
+
/**
|
|
27
|
+
* 日期格式化函数
|
|
28
|
+
*/
|
|
12
29
|
formatter: Function as PropType<CalendarFormatter>,
|
|
30
|
+
/**
|
|
31
|
+
* 最大日期范围
|
|
32
|
+
*/
|
|
13
33
|
maxRange: Number,
|
|
34
|
+
/**
|
|
35
|
+
* 超出最大范围时的错误提示
|
|
36
|
+
*/
|
|
14
37
|
rangePrompt: String,
|
|
38
|
+
/**
|
|
39
|
+
* 是否允许选择同一天
|
|
40
|
+
*/
|
|
15
41
|
allowSameDay: makeBooleanProp(false),
|
|
42
|
+
/**
|
|
43
|
+
* 选中日期所使用的当日内具体时刻
|
|
44
|
+
*/
|
|
16
45
|
defaultTime: {
|
|
17
46
|
type: [Array] as PropType<Array<number[]>>
|
|
18
47
|
},
|
|
48
|
+
/**
|
|
49
|
+
* 是否显示标题
|
|
50
|
+
*/
|
|
19
51
|
showTitle: makeBooleanProp(true)
|
|
20
52
|
}
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
@include e(label) {
|
|
112
|
-
margin-top:
|
|
112
|
+
margin-top: $-spacing-8;
|
|
113
113
|
font-size: $-cell-label-fs;
|
|
114
114
|
color: $-cell-label-color;
|
|
115
115
|
}
|
|
@@ -147,6 +147,8 @@
|
|
|
147
147
|
@include lineEllipsis;
|
|
148
148
|
min-width: 0;
|
|
149
149
|
}
|
|
150
|
+
|
|
151
|
+
|
|
150
152
|
}
|
|
151
153
|
|
|
152
154
|
@include edeep(arrow-right) {
|
|
@@ -52,7 +52,9 @@ export default {
|
|
|
52
52
|
name: 'oxy-cell',
|
|
53
53
|
options: {
|
|
54
54
|
addGlobalClass: true,
|
|
55
|
+
// #ifndef MP-TOUTIAO
|
|
55
56
|
virtualHost: true,
|
|
57
|
+
// #endif
|
|
56
58
|
styleIsolation: 'shared'
|
|
57
59
|
}
|
|
58
60
|
}
|
|
@@ -82,8 +84,8 @@ const isBorder = computed(() => {
|
|
|
82
84
|
const { parent: form } = useParent(FORM_KEY)
|
|
83
85
|
|
|
84
86
|
const errorMessage = computed(() => {
|
|
85
|
-
if (form && props.prop && form.errorMessages && form.errorMessages[props.prop]) {
|
|
86
|
-
return form.errorMessages[props.prop]
|
|
87
|
+
if (form.value && props.prop && form.value.errorMessages && form.value.errorMessages[props.prop]) {
|
|
88
|
+
return form.value.errorMessages[props.prop]
|
|
87
89
|
} else {
|
|
88
90
|
return ''
|
|
89
91
|
}
|
|
@@ -92,8 +94,8 @@ const errorMessage = computed(() => {
|
|
|
92
94
|
// 是否展示必填
|
|
93
95
|
const isRequired = computed(() => {
|
|
94
96
|
let formRequired = false
|
|
95
|
-
if (form && form.props.rules) {
|
|
96
|
-
const rules = form.props.rules
|
|
97
|
+
if (form.value && form.value.props.rules) {
|
|
98
|
+
const rules = form.value.props.rules
|
|
97
99
|
for (const key in rules) {
|
|
98
100
|
if (Object.prototype.hasOwnProperty.call(rules, key) && key === props.prop && Array.isArray(rules[key])) {
|
|
99
101
|
formRequired = rules[key].some((rule) => rule.required)
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
@include edeep(btn-check) {
|
|
54
54
|
display: inline-block;
|
|
55
55
|
font-size: $-checkbox-icon-size;
|
|
56
|
-
margin-right:
|
|
56
|
+
margin-right: $-spacing-8;
|
|
57
57
|
vertical-align: middle;
|
|
58
58
|
color: currentColor;
|
|
59
59
|
}
|
|
@@ -96,13 +96,13 @@
|
|
|
96
96
|
justify-content: center;
|
|
97
97
|
height: $-checkbox-button-height;
|
|
98
98
|
min-width: $-checkbox-button-min-width;
|
|
99
|
-
padding:
|
|
99
|
+
padding: $-spacing-16 $-spacing-32;
|
|
100
100
|
margin-left: 0;
|
|
101
101
|
border: 1px solid $-checkbox-button-border;
|
|
102
102
|
box-sizing: border-box;
|
|
103
103
|
border-radius: $-checkbox-button-radius;
|
|
104
104
|
background: $-checkbox-button-bg;
|
|
105
|
-
transition: all
|
|
105
|
+
transition: all $-transition-duration-base;
|
|
106
106
|
line-height: 1.2;
|
|
107
107
|
text-align: center;
|
|
108
108
|
}
|
|
@@ -140,13 +140,13 @@
|
|
|
140
140
|
}
|
|
141
141
|
@include when(cell-box) {
|
|
142
142
|
display: inline-block;
|
|
143
|
-
padding:
|
|
144
|
-
width: 33.3333%;
|
|
143
|
+
padding: $-cell-wrapper-padding $-cell-padding;
|
|
144
|
+
// width: 33.3333%;
|
|
145
145
|
margin: 0;
|
|
146
146
|
box-sizing: border-box;
|
|
147
147
|
font-size: 0;
|
|
148
148
|
@include when(large) {
|
|
149
|
-
padding:
|
|
149
|
+
padding: $-cell-wrapper-padding-large $-cell-padding;
|
|
150
150
|
}
|
|
151
151
|
@include when(checked) {
|
|
152
152
|
color: $-checkbox-checked-color;
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
display: inline-flex;
|
|
157
157
|
width: 33.3333%;
|
|
158
158
|
margin-right: 0;
|
|
159
|
-
padding:
|
|
159
|
+
padding: $-cell-wrapper-padding $-cell-padding 0 0;
|
|
160
160
|
box-sizing: border-box;
|
|
161
161
|
|
|
162
162
|
.oxy-checkbox__label {
|