uview-plus 3.7.36 → 3.8.18
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/README.md +0 -1
- package/changelog.md +1993 -1820
- package/components/u-action-sheet/u-action-sheet.vue +54 -16
- package/components/u-agreement/u-agreement.vue +2 -1
- package/components/u-alert/u-alert.vue +8 -10
- package/components/u-button/u-button.vue +35 -5
- package/components/u-calendar/calendar.js +1 -0
- package/components/u-calendar/header.vue +98 -9
- package/components/u-calendar/month.vue +10 -7
- package/components/u-calendar/props.js +5 -0
- package/components/u-calendar/u-calendar.vue +109 -2
- package/components/u-car-keyboard/u-car-keyboard.vue +7 -7
- package/components/u-card/u-card.vue +6 -6
- package/components/u-cascader/u-cascader.vue +32 -12
- package/components/u-cate-tab/u-cate-tab.vue +49 -48
- package/components/u-cell/u-cell.vue +24 -4
- package/components/u-cell-group/u-cell-group.vue +10 -3
- package/components/u-checkbox/u-checkbox.vue +6 -6
- package/components/u-choose/u-choose.vue +9 -4
- package/components/u-city-locate/u-city-locate.vue +28 -22
- package/components/u-color-picker/u-color-picker.vue +15 -15
- package/components/u-datetime-picker/u-datetime-picker.vue +79 -10
- package/components/u-dragsort/u-dragsort.vue +3 -0
- package/components/u-dropdown/u-dropdown.vue +15 -2
- package/components/u-dropdown-item/u-dropdown-item.vue +3 -3
- package/components/u-form-item/u-form-item.vue +6 -1
- package/components/u-gap/u-gap.vue +5 -1
- package/components/u-goods-sku/u-goods-sku.vue +16 -15
- package/components/u-index-anchor/u-index-anchor.vue +13 -2
- package/components/u-index-list/u-index-list.vue +18 -5
- package/components/u-input/input.js +3 -3
- package/components/u-input/u-input.vue +27 -5
- package/components/u-keyboard/u-keyboard.vue +11 -6
- package/components/u-loading-page/loadingPage.js +1 -1
- package/components/u-loading-page/u-loading-page.vue +18 -12
- package/components/u-navbar/navbar.js +2 -3
- package/components/u-navbar/theme-vars.scss +21 -0
- package/components/u-navbar/u-navbar.vue +30 -6
- package/components/u-notice-bar/theme-vars.scss +25 -0
- package/components/u-notice-bar/u-notice-bar.vue +24 -5
- package/components/u-number-box/numberBox.js +4 -4
- package/components/u-number-box/u-number-box.vue +27 -13
- package/components/u-number-keyboard/u-number-keyboard.vue +6 -6
- package/components/u-picker/picker.js +43 -43
- package/components/u-picker/u-picker.vue +14 -2
- package/components/u-popup/popup.js +1 -1
- package/components/u-popup/u-popup.vue +14 -6
- package/components/u-pull-refresh/u-pull-refresh.vue +6 -6
- package/components/u-radio/u-radio.vue +6 -6
- package/components/u-rate/rate.js +2 -2
- package/components/u-rate/u-rate.vue +98 -21
- package/components/u-search/search.js +3 -3
- package/components/u-search/u-search.vue +29 -6
- package/components/u-select/u-select.vue +141 -73
- package/components/u-signature/u-signature.vue +35 -16
- package/components/u-skeleton/u-skeleton.vue +7 -2
- package/components/u-slider/u-slider.vue +30 -31
- package/components/u-steps-item/u-steps-item.vue +20 -17
- package/components/u-subsection/theme-vars.scss +41 -0
- package/components/u-subsection/u-subsection.vue +69 -16
- package/components/u-swipe-action-item/u-swipe-action-item.vue +11 -5
- package/components/u-switch/theme-vars.scss +41 -0
- package/components/u-switch/u-switch.vue +44 -15
- package/components/u-tabbar/u-tabbar.vue +5 -5
- package/components/u-tabbar-item/u-tabbar-item.vue +16 -5
- package/components/u-table/u-table.vue +18 -3
- package/components/u-table2/tableRow.vue +43 -41
- package/components/u-table2/u-table2.vue +56 -50
- package/components/u-tabs/u-tabs.vue +14 -1
- package/components/u-tag/theme-vars.scss +21 -0
- package/components/u-tag/u-tag.vue +17 -7
- package/components/u-td/u-td.vue +5 -3
- package/components/u-text/text.js +1 -1
- package/components/u-text/u-text.vue +15 -13
- package/components/u-textarea/props.js +2 -2
- package/components/u-textarea/textarea.js +1 -1
- package/components/u-textarea/u-textarea.vue +115 -61
- package/components/u-th/u-th.vue +5 -4
- package/components/u-title/u-title.vue +1 -0
- package/components/u-toast/u-toast.vue +8 -8
- package/components/u-tree/u-tree.vue +491 -51
- package/components/u-upload/u-upload.vue +34 -6
- package/index.js +178 -27
- package/index.scss +5 -1
- package/libs/config/color.js +1 -2
- package/libs/config/props.js +1 -1
- package/libs/css/theme-vars-core.scss +197 -0
- package/libs/css/theme-vars.scss +1 -0
- package/libs/function/index.js +7 -7
- package/libs/mixin/mixin.js +111 -4
- package/libs/root/index.js +175 -0
- package/libs/root/nvue-root.vue +72 -0
- package/libs/root/page.js +269 -0
- package/libs/root/root-toast-host.vue +31 -0
- package/libs/root/root.js +40 -0
- package/libs/root/runtime.js +11 -0
- package/libs/root/utils.js +115 -0
- package/libs/theme/runtime.js +391 -0
- package/libs/theme/theme.js +684 -0
- package/libs/util/gcanvas/bridge/bridge-weex.js +0 -0
- package/libs/util/gcanvas/context-2d/FillStyleLinearGradient.js +0 -0
- package/libs/util/gcanvas/context-2d/FillStylePattern.js +0 -0
- package/libs/util/gcanvas/context-2d/FillStyleRadialGradient.js +0 -0
- package/libs/util/gcanvas/context-2d/RenderingContext.js +0 -0
- package/libs/util/gcanvas/context-webgl/ActiveInfo.js +0 -0
- package/libs/util/gcanvas/context-webgl/Buffer.js +0 -0
- package/libs/util/gcanvas/context-webgl/Framebuffer.js +0 -0
- package/libs/util/gcanvas/context-webgl/GLenum.js +0 -0
- package/libs/util/gcanvas/context-webgl/GLmethod.js +0 -0
- package/libs/util/gcanvas/context-webgl/GLtype.js +0 -0
- package/libs/util/gcanvas/context-webgl/Program.js +0 -0
- package/libs/util/gcanvas/context-webgl/Renderbuffer.js +0 -0
- package/libs/util/gcanvas/context-webgl/RenderingContext.js +0 -0
- package/libs/util/gcanvas/context-webgl/Shader.js +0 -0
- package/libs/util/gcanvas/context-webgl/ShaderPrecisionFormat.js +0 -0
- package/libs/util/gcanvas/context-webgl/Texture.js +0 -0
- package/libs/util/gcanvas/context-webgl/UniformLocation.js +0 -0
- package/libs/util/gcanvas/context-webgl/classUtils.js +0 -0
- package/libs/util/gcanvas/env/canvas.js +0 -0
- package/libs/util/gcanvas/env/image.js +0 -0
- package/libs/util/gcanvas/env/tool.js +0 -0
- package/libs/util/gcanvas/index.js +0 -0
- package/package.json +3 -2
- package/theme.scss +113 -32
- package/types/index.d.ts +41 -2
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="u-select">
|
|
3
|
-
<view :class="['u-select__content', disabled && 'disabled']">
|
|
4
|
-
<view class="u-select__label" @click="openSelect">
|
|
5
|
-
<slot name="text" :currentLabel="currentLabel">
|
|
6
|
-
<text class="u-select__text" v-if="showOptionsLabel">
|
|
7
|
-
{{ currentLabel }}
|
|
8
|
-
</text>
|
|
9
|
-
<text class="u-select__text" v-else>
|
|
10
|
-
{{ label }}
|
|
11
|
-
</text>
|
|
12
|
-
</slot>
|
|
13
|
-
<slot name="icon">
|
|
14
|
-
<up-icon name="arrow-down" :size="iconSize" :color="
|
|
15
|
-
</slot>
|
|
16
|
-
</view>
|
|
17
|
-
<u-overlay :show="isOpen" @click="overlayClick" v-if="overlay" :zIndex="zIndex" :duration="duration + 50"
|
|
18
|
-
:customStyle="overlayStyle" :opacity="overlayOpacity" @touchmove.stop.prevent="noop"></u-overlay>
|
|
19
|
-
<view class="u-select__options__wrap"
|
|
20
|
-
:style="
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
:key="index" v-for="(item, index) in options" @click="selectItem(item)">
|
|
25
|
-
<slot name="optionItem" :item="item">
|
|
26
|
-
<text class="u-select__item_text" :style="{color:
|
|
27
|
-
{{item[labelName]}}
|
|
28
|
-
</text>
|
|
1
|
+
<template>
|
|
2
|
+
<view class="u-select">
|
|
3
|
+
<view :class="['u-select__content', disabled && 'disabled']">
|
|
4
|
+
<view :class="['u-select__label', border && 'u-select__label--border']" :style="selectLabelStyle" @click="openSelect">
|
|
5
|
+
<slot name="text" :currentLabel="currentLabel">
|
|
6
|
+
<text class="u-select__text" :style="{ color: resolvedTextColor }" v-if="showOptionsLabel">
|
|
7
|
+
{{ currentLabel }}
|
|
8
|
+
</text>
|
|
9
|
+
<text class="u-select__text" :style="{ color: resolvedTextColor }" v-else>
|
|
10
|
+
{{ label }}
|
|
11
|
+
</text>
|
|
12
|
+
</slot>
|
|
13
|
+
<slot name="icon">
|
|
14
|
+
<up-icon name="arrow-down" :size="iconSize" :color="resolvedIconColor"></up-icon>
|
|
15
|
+
</slot>
|
|
16
|
+
</view>
|
|
17
|
+
<u-overlay :show="isOpen" @click="overlayClick" v-if="overlay" :zIndex="zIndex" :duration="duration + 50"
|
|
18
|
+
:customStyle="overlayStyle" :opacity="overlayOpacity" @touchmove.stop.prevent="noop"></u-overlay>
|
|
19
|
+
<view class="u-select__options__wrap" :style="optionsWrapStyle">
|
|
20
|
+
<view class="u-select__options" :style="optionsStyle" v-if="isOpen">
|
|
21
|
+
<slot name="options">
|
|
22
|
+
<view class="u-select__options_item" :class="current == item[keyName] ? 'active': ''"
|
|
23
|
+
:style="{ color: resolvedItemColor }"
|
|
24
|
+
:key="index" v-for="(item, index) in options" @click="selectItem(item)">
|
|
25
|
+
<slot name="optionItem" :item="item">
|
|
26
|
+
<text class="u-select__item_text" :style="{color: resolvedItemColor}">
|
|
27
|
+
{{item[labelName]}}
|
|
28
|
+
</text>
|
|
29
29
|
</slot>
|
|
30
30
|
</view>
|
|
31
31
|
</slot>
|
|
@@ -102,10 +102,10 @@
|
|
|
102
102
|
type: Number,
|
|
103
103
|
default: 11000
|
|
104
104
|
},
|
|
105
|
-
itemColor: {
|
|
106
|
-
type: String,
|
|
107
|
-
default: '
|
|
108
|
-
},
|
|
105
|
+
itemColor: {
|
|
106
|
+
type: String,
|
|
107
|
+
default: ''
|
|
108
|
+
},
|
|
109
109
|
iconColor: {
|
|
110
110
|
type: String,
|
|
111
111
|
default: ''
|
|
@@ -115,23 +115,79 @@
|
|
|
115
115
|
default: '13px'
|
|
116
116
|
},
|
|
117
117
|
// 是否禁用
|
|
118
|
-
disabled: {
|
|
119
|
-
type: Boolean,
|
|
120
|
-
default: false
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
118
|
+
disabled: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
default: false
|
|
121
|
+
},
|
|
122
|
+
// 是否显示触发区边框
|
|
123
|
+
border: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
default: false
|
|
126
|
+
},
|
|
127
|
+
// 下拉面板宽度,支持 px/rpx/% 等,如 240px 或 300rpx
|
|
128
|
+
optionsWidth: {
|
|
129
|
+
type: [String, Number],
|
|
130
|
+
default: ''
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
data() {
|
|
134
|
+
return {
|
|
125
135
|
isOpen: false,
|
|
126
136
|
optionsWrapLeft: 'auto',
|
|
127
137
|
optionsWrapRight: 'auto'
|
|
128
138
|
}
|
|
129
139
|
},
|
|
130
|
-
computed: {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
140
|
+
computed: {
|
|
141
|
+
resolvedItemColor() {
|
|
142
|
+
return this.itemColor || this.upThemeVar('--up-main-color', '#303133');
|
|
143
|
+
},
|
|
144
|
+
resolvedTextColor() {
|
|
145
|
+
return this.upThemeVar('--up-main-color', '#303133');
|
|
146
|
+
},
|
|
147
|
+
resolvedIconColor() {
|
|
148
|
+
return this.iconColor || this.upThemeVar('--up-content-color', '#606266');
|
|
149
|
+
},
|
|
150
|
+
normalizedOptionsWidth() {
|
|
151
|
+
if (this.optionsWidth === '' || this.optionsWidth === null || typeof this.optionsWidth === 'undefined') {
|
|
152
|
+
return '';
|
|
153
|
+
}
|
|
154
|
+
if (typeof this.optionsWidth === 'number') {
|
|
155
|
+
return `${this.optionsWidth}px`;
|
|
156
|
+
}
|
|
157
|
+
return this.optionsWidth;
|
|
158
|
+
},
|
|
159
|
+
selectLabelStyle() {
|
|
160
|
+
if (!this.border) return {};
|
|
161
|
+
return {
|
|
162
|
+
borderColor: this.upThemeVar('--up-border-color', '#dadbde'),
|
|
163
|
+
backgroundColor: this.upThemeVar('--up-card-bg-color', '#ffffff')
|
|
164
|
+
};
|
|
165
|
+
},
|
|
166
|
+
optionsWrapStyle() {
|
|
167
|
+
const style = {
|
|
168
|
+
overflowY: 'auto',
|
|
169
|
+
zIndex: this.zIndex + 1,
|
|
170
|
+
left: this.optionsWrapLeft,
|
|
171
|
+
right: this.optionsWrapRight,
|
|
172
|
+
maxHeight: this.maxHeight
|
|
173
|
+
};
|
|
174
|
+
if (this.normalizedOptionsWidth) {
|
|
175
|
+
style.width = this.normalizedOptionsWidth;
|
|
176
|
+
}
|
|
177
|
+
return style;
|
|
178
|
+
},
|
|
179
|
+
optionsStyle() {
|
|
180
|
+
const style = {};
|
|
181
|
+
if (this.normalizedOptionsWidth) {
|
|
182
|
+
style.width = this.normalizedOptionsWidth;
|
|
183
|
+
style.minWidth = this.normalizedOptionsWidth;
|
|
184
|
+
}
|
|
185
|
+
return style;
|
|
186
|
+
},
|
|
187
|
+
currentLabel() {
|
|
188
|
+
let name = '';
|
|
189
|
+
this.options.forEach((ele) => {
|
|
190
|
+
if (ele[this.keyName] === this.current) {
|
|
135
191
|
name = ele[this.labelName];
|
|
136
192
|
}
|
|
137
193
|
});
|
|
@@ -159,12 +215,14 @@
|
|
|
159
215
|
this.$emit('update:current', item[this.keyName]);
|
|
160
216
|
this.$emit('select', item);
|
|
161
217
|
},
|
|
162
|
-
adjustOptionsWrapPosition() {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
218
|
+
adjustOptionsWrapPosition() {
|
|
219
|
+
this.optionsWrapLeft = '0px';
|
|
220
|
+
this.optionsWrapRight = 'auto';
|
|
221
|
+
let wi = getWindowInfo();
|
|
222
|
+
let windowWidth = wi.windowWidth;
|
|
223
|
+
this.$uGetRect('.u-select__options__wrap').then(rect => {
|
|
224
|
+
if (rect.left + rect.width > windowWidth) {
|
|
225
|
+
// 如果右侧被遮挡,则调整到左侧
|
|
168
226
|
this.optionsWrapLeft = 'auto';
|
|
169
227
|
this.optionsWrapRight = `0px`;
|
|
170
228
|
}
|
|
@@ -178,14 +236,24 @@
|
|
|
178
236
|
.u-select__content {
|
|
179
237
|
position: relative;
|
|
180
238
|
|
|
181
|
-
.u-select__label {
|
|
182
|
-
display: flex;
|
|
183
|
-
justify-content: space-between;
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
239
|
+
.u-select__label {
|
|
240
|
+
display: flex;
|
|
241
|
+
justify-content: space-between;
|
|
242
|
+
align-items: center;
|
|
243
|
+
|
|
244
|
+
&--border {
|
|
245
|
+
padding: 8px 10px;
|
|
246
|
+
border-width: 1px;
|
|
247
|
+
border-style: solid;
|
|
248
|
+
border-radius: 4px;
|
|
249
|
+
min-height: 36px;
|
|
250
|
+
box-sizing: border-box;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/* #ifdef H5 */
|
|
254
|
+
&:hover {
|
|
255
|
+
cursor: pointer;
|
|
256
|
+
}
|
|
189
257
|
|
|
190
258
|
/* #endif */
|
|
191
259
|
}
|
|
@@ -199,19 +267,19 @@
|
|
|
199
267
|
pointer-events: none;
|
|
200
268
|
}
|
|
201
269
|
|
|
202
|
-
.u-select__options__wrap {
|
|
203
|
-
margin-bottom: 46px;
|
|
204
|
-
position: absolute;
|
|
205
|
-
top:
|
|
206
|
-
left: 0;
|
|
207
|
-
}
|
|
270
|
+
.u-select__options__wrap {
|
|
271
|
+
margin-bottom: 46px;
|
|
272
|
+
position: absolute;
|
|
273
|
+
top: calc(100% + 4px);
|
|
274
|
+
left: 0;
|
|
275
|
+
}
|
|
208
276
|
|
|
209
|
-
.u-select__options {
|
|
210
|
-
min-width: 100px;
|
|
211
|
-
box-sizing: border-box;
|
|
212
|
-
border-radius: 4px;
|
|
213
|
-
border: 1px solid #f1f1f1;
|
|
214
|
-
background-color: #fff;
|
|
277
|
+
.u-select__options {
|
|
278
|
+
min-width: 100px;
|
|
279
|
+
box-sizing: border-box;
|
|
280
|
+
border-radius: 4px;
|
|
281
|
+
border: 1px solid var(--up-border-color, #f1f1f1);
|
|
282
|
+
background-color: var(--up-card-bg-color, #fff);
|
|
215
283
|
|
|
216
284
|
.u-select__options_item {
|
|
217
285
|
padding: 10px 12px;
|
|
@@ -219,9 +287,9 @@
|
|
|
219
287
|
width: 100%;
|
|
220
288
|
height: 100%;
|
|
221
289
|
|
|
222
|
-
&:hover {
|
|
223
|
-
background-color: #f7f7f7;
|
|
224
|
-
}
|
|
290
|
+
&:hover {
|
|
291
|
+
background-color: var(--up-bg-color, #f7f7f7);
|
|
292
|
+
}
|
|
225
293
|
|
|
226
294
|
/* #ifdef H5 */
|
|
227
295
|
&:hover {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="u-signature">
|
|
3
|
-
<view class="u-signature__canvas-wrap" :style="{background:
|
|
3
|
+
<view class="u-signature__canvas-wrap" :style="{background: resolvedBgColor}">
|
|
4
4
|
<up-canvas
|
|
5
5
|
ref="signatureCanvas"
|
|
6
6
|
:canvas-id="canvasId"
|
|
7
7
|
:width="canvasWidth"
|
|
8
8
|
:height="canvasHeight"
|
|
9
|
-
:bg-color="
|
|
9
|
+
:bg-color="resolvedBgColor"
|
|
10
10
|
@touchstart="touchStart"
|
|
11
11
|
@touchmove="touchMove"
|
|
12
12
|
@touchend="touchEnd"
|
|
@@ -22,19 +22,19 @@
|
|
|
22
22
|
<view v-if="showToolbar" class="u-signature__toolbar">
|
|
23
23
|
<view class="u-signature__toolbar-icons u-flex u-flex-x">
|
|
24
24
|
<view class="u-signature__toolbar-icon" @click="undo">
|
|
25
|
-
<up-icon name="arrow-left" size="22" :color="pathStack.length === 0 ?
|
|
25
|
+
<up-icon name="arrow-left" size="22" :color="pathStack.length === 0 ? iconDisabledColor : iconDefaultColor"></up-icon>
|
|
26
26
|
</view>
|
|
27
27
|
<view class="u-signature__toolbar-icon" @click="clear">
|
|
28
|
-
<up-icon name="trash" size="25" color="
|
|
28
|
+
<up-icon name="trash" size="25" :color="iconDefaultColor"></up-icon>
|
|
29
29
|
</view>
|
|
30
30
|
<view class="u-signature__toolbar-icon" @click="toggleBrushSettings">
|
|
31
|
-
<up-icon name="edit-pen" size="25" color="
|
|
31
|
+
<up-icon name="edit-pen" size="25" :color="iconDefaultColor"></up-icon>
|
|
32
32
|
</view>
|
|
33
33
|
<view class="u-signature__toolbar-icon" @click="toggleColorSettings">
|
|
34
|
-
<up-icon name="grid" size="24" color="
|
|
34
|
+
<up-icon name="grid" size="24" :color="iconDefaultColor"></up-icon>
|
|
35
35
|
</view>
|
|
36
36
|
<view class="u-signature__toolbar-icon" @click="exportSignature">
|
|
37
|
-
<up-icon name="checkmark" size="25" :color="isEmpty ?
|
|
37
|
+
<up-icon name="checkmark" size="25" :color="isEmpty ? iconDisabledColor : iconDefaultColor"></up-icon>
|
|
38
38
|
</view>
|
|
39
39
|
</view>
|
|
40
40
|
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
canvasId: 'u-signature-' + Math.random().toString(36).substr(2, 9),
|
|
115
115
|
canvasWidth: 300,
|
|
116
116
|
canvasHeight: 200,
|
|
117
|
-
lineColor: '
|
|
117
|
+
lineColor: '',
|
|
118
118
|
lineWidth: 3,
|
|
119
119
|
isDrawing: false,
|
|
120
120
|
pathStack: [], // 存储绘制路径用于回退
|
|
@@ -136,6 +136,19 @@
|
|
|
136
136
|
canvasInstance: null // 缓存canvas实例
|
|
137
137
|
}
|
|
138
138
|
},
|
|
139
|
+
computed: {
|
|
140
|
+
resolvedBgColor() {
|
|
141
|
+
return this.bgColor === '#ffffff'
|
|
142
|
+
? (this.upThemeIsDark ? '#1c1c1e' : '#ffffff')
|
|
143
|
+
: this.bgColor
|
|
144
|
+
},
|
|
145
|
+
iconDefaultColor() {
|
|
146
|
+
return this.upThemeVar('--up-content-color', '#999999')
|
|
147
|
+
},
|
|
148
|
+
iconDisabledColor() {
|
|
149
|
+
return this.upThemeVar('--up-disabled-color', '#c8c9cc')
|
|
150
|
+
}
|
|
151
|
+
},
|
|
139
152
|
mounted() {
|
|
140
153
|
// 初始化时获取canvas实例
|
|
141
154
|
this.$nextTick(() => {
|
|
@@ -158,7 +171,7 @@
|
|
|
158
171
|
},
|
|
159
172
|
color: {
|
|
160
173
|
handler(newVal) {
|
|
161
|
-
this.lineColor = newVal
|
|
174
|
+
this.lineColor = this.resolveStrokeColor(newVal)
|
|
162
175
|
},
|
|
163
176
|
immediate: true
|
|
164
177
|
},
|
|
@@ -171,6 +184,12 @@
|
|
|
171
184
|
},
|
|
172
185
|
methods: {
|
|
173
186
|
t,
|
|
187
|
+
resolveStrokeColor(color) {
|
|
188
|
+
if (color === '#000000') {
|
|
189
|
+
return this.upThemeIsDark ? '#f5f5f5' : '#000000'
|
|
190
|
+
}
|
|
191
|
+
return color
|
|
192
|
+
},
|
|
174
193
|
|
|
175
194
|
// 获取签名画布实例
|
|
176
195
|
getCanvasInstance() {
|
|
@@ -400,7 +419,7 @@
|
|
|
400
419
|
flex-direction: column;
|
|
401
420
|
|
|
402
421
|
&__canvas-wrap {
|
|
403
|
-
border: 1px solid #e0e0e0;
|
|
422
|
+
border: 1px solid var(--up-border-color, #e0e0e0);
|
|
404
423
|
border-radius: 4px;
|
|
405
424
|
overflow: hidden;
|
|
406
425
|
}
|
|
@@ -412,7 +431,7 @@
|
|
|
412
431
|
|
|
413
432
|
&__toolbar {
|
|
414
433
|
margin-top: 5px;
|
|
415
|
-
background-color: #fff;
|
|
434
|
+
background-color: var(--up-card-bg-color, #fff);
|
|
416
435
|
}
|
|
417
436
|
|
|
418
437
|
&__toolbar-icons {
|
|
@@ -441,7 +460,7 @@
|
|
|
441
460
|
display: block;
|
|
442
461
|
margin-bottom: 10px;
|
|
443
462
|
font-size: 14px;
|
|
444
|
-
color: #999;
|
|
463
|
+
color: var(--up-tips-color, #999);
|
|
445
464
|
}
|
|
446
465
|
}
|
|
447
466
|
|
|
@@ -453,7 +472,7 @@
|
|
|
453
472
|
display: block;
|
|
454
473
|
margin-bottom: 10px;
|
|
455
474
|
font-size: 14px;
|
|
456
|
-
color: #999;
|
|
475
|
+
color: var(--up-tips-color, #999);
|
|
457
476
|
}
|
|
458
477
|
|
|
459
478
|
&__colors {
|
|
@@ -467,11 +486,11 @@
|
|
|
467
486
|
width: 30px;
|
|
468
487
|
height: 30px;
|
|
469
488
|
border-radius: 50%;
|
|
470
|
-
border: 2px solid #f0f0f0;
|
|
489
|
+
border: 2px solid var(--up-border-color, #f0f0f0);
|
|
471
490
|
cursor: pointer;
|
|
472
491
|
|
|
473
492
|
&--active {
|
|
474
|
-
border-color: #2979ff;
|
|
493
|
+
border-color: var(--up-primary, #2979ff);
|
|
475
494
|
transform: scale(1.1);
|
|
476
495
|
}
|
|
477
496
|
}
|
|
@@ -483,4 +502,4 @@
|
|
|
483
502
|
justify-content: center;
|
|
484
503
|
}
|
|
485
504
|
}
|
|
486
|
-
</style>
|
|
505
|
+
</style>
|
|
@@ -190,10 +190,15 @@
|
|
|
190
190
|
|
|
191
191
|
@mixin background {
|
|
192
192
|
/* #ifdef APP-NVUE */
|
|
193
|
-
background-color: #
|
|
193
|
+
background-color: var(--up-skeleton-bg-color, var(--up-fill-color, #2f3135));
|
|
194
194
|
/* #endif */
|
|
195
195
|
/* #ifndef APP-NVUE */
|
|
196
|
-
background: linear-gradient(
|
|
196
|
+
background: linear-gradient(
|
|
197
|
+
90deg,
|
|
198
|
+
var(--up-skeleton-bg-color, var(--up-fill-color, #2f3135)) 25%,
|
|
199
|
+
var(--up-skeleton-shimmer-color, rgba(255, 255, 255, 0.12)) 37%,
|
|
200
|
+
var(--up-skeleton-bg-color, var(--up-fill-color, #2f3135)) 50%
|
|
201
|
+
);
|
|
197
202
|
background-size: 400% 100%;
|
|
198
203
|
/* #endif */
|
|
199
204
|
}
|
|
@@ -177,11 +177,40 @@
|
|
|
177
177
|
deep:true
|
|
178
178
|
}
|
|
179
179
|
},
|
|
180
|
-
mounted() {
|
|
180
|
+
async mounted() {
|
|
181
181
|
if (this.height != '') {
|
|
182
182
|
this.sizeLocal = val
|
|
183
183
|
} else {
|
|
184
184
|
this.sizeLocal = this.size
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// 获取滑块条的尺寸信息
|
|
188
|
+
if (!this.useNative) {
|
|
189
|
+
// #ifndef APP-NVUE
|
|
190
|
+
this.$uGetRect('.u-slider__base').then(rect => {
|
|
191
|
+
this.sliderRect = rect;
|
|
192
|
+
// console.log('sliderRect', this.sliderRect)
|
|
193
|
+
if (this.sliderRect.width == 0) {
|
|
194
|
+
console.info('如在弹窗等元素中使用,请使用v-if来显示滑块,否则无法计算长度。')
|
|
195
|
+
}
|
|
196
|
+
this.init()
|
|
197
|
+
});
|
|
198
|
+
// #endif
|
|
199
|
+
// #ifdef APP-NVUE
|
|
200
|
+
await sleep(30) // 不延迟会出现size获取都为0的问题
|
|
201
|
+
const ref = this.$refs['u-slider__base']
|
|
202
|
+
ref &&
|
|
203
|
+
dom.getComponentRect(ref, (res) => {
|
|
204
|
+
// console.log(res)
|
|
205
|
+
this.sliderRect = {
|
|
206
|
+
top: res.size.top,
|
|
207
|
+
left: res.size.left,
|
|
208
|
+
width: res.size.width,
|
|
209
|
+
height: res.size.height
|
|
210
|
+
};
|
|
211
|
+
this.init()
|
|
212
|
+
})
|
|
213
|
+
// #endif
|
|
185
214
|
}
|
|
186
215
|
},
|
|
187
216
|
computed: {
|
|
@@ -215,36 +244,6 @@
|
|
|
215
244
|
return style;
|
|
216
245
|
}
|
|
217
246
|
},
|
|
218
|
-
async mounted() {
|
|
219
|
-
// 获取滑块条的尺寸信息
|
|
220
|
-
if (!this.useNative) {
|
|
221
|
-
// #ifndef APP-NVUE
|
|
222
|
-
this.$uGetRect('.u-slider__base').then(rect => {
|
|
223
|
-
this.sliderRect = rect;
|
|
224
|
-
// console.log('sliderRect', this.sliderRect)
|
|
225
|
-
if (this.sliderRect.width == 0) {
|
|
226
|
-
console.info('如在弹窗等元素中使用,请使用v-if来显示滑块,否则无法计算长度。')
|
|
227
|
-
}
|
|
228
|
-
this.init()
|
|
229
|
-
});
|
|
230
|
-
// #endif
|
|
231
|
-
// #ifdef APP-NVUE
|
|
232
|
-
await sleep(30) // 不延迟会出现size获取都为0的问题
|
|
233
|
-
const ref = this.$refs['u-slider__base']
|
|
234
|
-
ref &&
|
|
235
|
-
dom.getComponentRect(ref, (res) => {
|
|
236
|
-
// console.log(res)
|
|
237
|
-
this.sliderRect = {
|
|
238
|
-
top: res.size.top,
|
|
239
|
-
left: res.size.left,
|
|
240
|
-
width: res.size.width,
|
|
241
|
-
height: res.size.height
|
|
242
|
-
};
|
|
243
|
-
this.init()
|
|
244
|
-
})
|
|
245
|
-
// #endif
|
|
246
|
-
}
|
|
247
|
-
},
|
|
248
247
|
methods: {
|
|
249
248
|
addUnit,
|
|
250
249
|
addStyle,
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
backgroundColor: statusClass === 'process' ? parentData.activeColor : 'transparent',
|
|
22
22
|
borderColor: statusColor
|
|
23
23
|
}" class="u-steps-item__wrapper__circle">
|
|
24
|
-
<text v-if="statusClass === 'process' || statusClass === 'wait'"
|
|
25
|
-
class="u-steps-item__wrapper__circle__text" :style="{
|
|
26
|
-
color: index == parentData.current ?
|
|
27
|
-
}">{{ index + 1}}</text>
|
|
24
|
+
<text v-if="statusClass === 'process' || statusClass === 'wait'"
|
|
25
|
+
class="u-steps-item__wrapper__circle__text" :style="{
|
|
26
|
+
color: index == parentData.current ? activeStepTextColor : parentData.inactiveColor
|
|
27
|
+
}">{{ index + 1}}</text>
|
|
28
28
|
<up-icon v-else :color="statusClass === 'error' ? 'error' : parentData.activeColor" size="12"
|
|
29
29
|
:name="statusClass === 'error' ? 'close' : 'checkmark'"></up-icon>
|
|
30
30
|
</view>
|
|
@@ -170,8 +170,8 @@
|
|
|
170
170
|
}
|
|
171
171
|
return colorTmp
|
|
172
172
|
},
|
|
173
|
-
contentStyle() {
|
|
174
|
-
const style = {}
|
|
173
|
+
contentStyle() {
|
|
174
|
+
const style = {}
|
|
175
175
|
if (this.parentData.direction === 'column') {
|
|
176
176
|
style.marginLeft = this.parentData.dot ? '2px' : '6px'
|
|
177
177
|
style.marginTop = this.parentData.dot ? '0px' : '6px'
|
|
@@ -179,10 +179,13 @@
|
|
|
179
179
|
style.marginTop = this.parentData.dot ? '2px' : '6px'
|
|
180
180
|
style.marginLeft = this.parentData.dot ? '2px' : '6px'
|
|
181
181
|
}
|
|
182
|
-
|
|
183
|
-
return style
|
|
184
|
-
}
|
|
185
|
-
|
|
182
|
+
|
|
183
|
+
return style
|
|
184
|
+
},
|
|
185
|
+
activeStepTextColor() {
|
|
186
|
+
return this.upThemeVar('--up-white', '#ffffff')
|
|
187
|
+
}
|
|
188
|
+
},
|
|
186
189
|
mounted() {
|
|
187
190
|
this.parent && this.parent.updateFromChild()
|
|
188
191
|
sleep().then(() => {
|
|
@@ -247,13 +250,13 @@
|
|
|
247
250
|
padding-bottom: 5px;
|
|
248
251
|
}
|
|
249
252
|
|
|
250
|
-
&__wrapper {
|
|
251
|
-
@include flex;
|
|
252
|
-
justify-content: center;
|
|
253
|
-
align-items: center;
|
|
254
|
-
position: relative;
|
|
255
|
-
background-color: #fff;
|
|
256
|
-
border-radius: 50px;
|
|
253
|
+
&__wrapper {
|
|
254
|
+
@include flex;
|
|
255
|
+
justify-content: center;
|
|
256
|
+
align-items: center;
|
|
257
|
+
position: relative;
|
|
258
|
+
background-color: var(--up-card-bg-color, #fff);
|
|
259
|
+
border-radius: 50px;
|
|
257
260
|
|
|
258
261
|
&--column {
|
|
259
262
|
width: 20px;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
:root,
|
|
2
|
+
page,
|
|
3
|
+
body {
|
|
4
|
+
--up-subsection-bg-color: #eeeeef;
|
|
5
|
+
--up-subsection-bar-color: #ffffff;
|
|
6
|
+
--up-subsection-inactive-color: #303133;
|
|
7
|
+
--up-subsection-disabled-text-color: #c8c9cc;
|
|
8
|
+
--up-subsection-disabled-border-color: #d4d4d4;
|
|
9
|
+
--up-subsection-disabled-bar-color: #f5f5f5;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@media (prefers-color-scheme: dark) {
|
|
13
|
+
:root,
|
|
14
|
+
page,
|
|
15
|
+
body {
|
|
16
|
+
--up-subsection-bg-color: #2b2c30;
|
|
17
|
+
--up-subsection-bar-color: #3a3b40;
|
|
18
|
+
--up-subsection-inactive-color: #d1d5db;
|
|
19
|
+
--up-subsection-disabled-text-color: #6b7280;
|
|
20
|
+
--up-subsection-disabled-border-color: #3a3a3c;
|
|
21
|
+
--up-subsection-disabled-bar-color: #3a3a3c;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
[data-up-theme='light'] {
|
|
26
|
+
--up-subsection-bg-color: #eeeeef;
|
|
27
|
+
--up-subsection-bar-color: #ffffff;
|
|
28
|
+
--up-subsection-inactive-color: #303133;
|
|
29
|
+
--up-subsection-disabled-text-color: #c8c9cc;
|
|
30
|
+
--up-subsection-disabled-border-color: #d4d4d4;
|
|
31
|
+
--up-subsection-disabled-bar-color: #f5f5f5;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
[data-up-theme='dark'] {
|
|
35
|
+
--up-subsection-bg-color: #2b2c30;
|
|
36
|
+
--up-subsection-bar-color: #3a3b40;
|
|
37
|
+
--up-subsection-inactive-color: #d1d5db;
|
|
38
|
+
--up-subsection-disabled-text-color: #6b7280;
|
|
39
|
+
--up-subsection-disabled-border-color: #3a3a3c;
|
|
40
|
+
--up-subsection-disabled-bar-color: #3a3a3c;
|
|
41
|
+
}
|