uview-plus 3.8.49 → 3.8.86
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/changelog.md +2043 -1827
- package/components/u-action-sheet/props.js +3 -1
- package/components/u-action-sheet/u-action-sheet.vue +1 -0
- package/components/u-album/props.js +3 -1
- package/components/u-alert/props.js +4 -2
- package/components/u-avatar/props.js +4 -1
- package/components/u-avatar-group/props.js +4 -1
- package/components/u-back-top/props.js +4 -1
- package/components/u-badge/props.js +4 -1
- package/components/u-barcode/u-barcode.vue +46 -15
- package/components/u-box/props.js +5 -2
- package/components/u-button/props.js +4 -1
- package/components/u-button/vue.scss +3 -3
- package/components/u-calendar/calendar.js +14 -2
- package/components/u-calendar/month.vue +41 -6
- package/components/u-calendar/props.js +63 -1
- package/components/u-calendar/u-calendar.vue +311 -2
- package/components/u-calendar-strip/props.js +3 -1
- package/components/u-canvas/u-canvas.vue +734 -423
- package/components/u-car-keyboard/props.js +3 -1
- package/components/u-card/props.js +3 -1
- package/components/u-cell/props.js +4 -1
- package/components/u-cell/u-cell.vue +1 -1
- package/components/u-cell-group/props.js +4 -1
- package/components/u-checkbox/props.js +4 -1
- package/components/u-checkbox/u-checkbox.vue +7 -3
- package/components/u-checkbox-group/props.js +3 -1
- package/components/u-circle-progress/props.js +4 -1
- package/components/u-code/props.js +4 -1
- package/components/u-code-input/props.js +4 -1
- package/components/u-col/props.js +4 -1
- package/components/u-collapse/props.js +4 -1
- package/components/u-collapse-item/props.js +4 -1
- package/components/u-color-picker/u-color-picker.vue +1 -0
- package/components/u-column-notice/props.js +4 -1
- package/components/u-count-down/props.js +4 -1
- package/components/u-count-to/props.js +4 -1
- package/components/u-cropper/u-cropper.vue +95 -51
- package/components/u-datetime-picker/props.js +4 -1
- package/components/u-divider/props.js +4 -1
- package/components/u-dragsort/u-dragsort.vue +2 -1
- package/components/u-dropdown/props.js +3 -1
- package/components/u-dropdown-item/props.js +3 -1
- package/components/u-empty/props.js +4 -1
- package/components/u-form/props.js +4 -1
- package/components/u-form-item/props.js +4 -1
- package/components/u-gap/props.js +4 -1
- package/components/u-grid/props.js +4 -1
- package/components/u-grid-item/props.js +4 -1
- package/components/u-guide/props.js +3 -1
- package/components/u-icon/props.js +4 -1
- package/components/u-icon/u-icon.vue +2 -2
- package/components/u-icon/upicon.ttf +0 -0
- package/components/u-icon/util.js +29 -7
- package/components/u-image/props.js +4 -1
- package/components/u-image/u-image.vue +280 -267
- package/components/u-index-anchor/props.js +4 -1
- package/components/u-index-item/props.js +2 -1
- package/components/u-index-list/props.js +4 -1
- package/components/u-input/props.js +3 -1
- package/components/u-input/u-input.vue +10 -1
- package/components/u-keyboard/props.js +4 -1
- package/components/u-line/props.js +4 -1
- package/components/u-line-progress/props.js +6 -3
- package/components/u-link/props.js +4 -1
- package/components/u-list/props.js +4 -1
- package/components/u-list-item/props.js +4 -1
- package/components/u-loading-icon/props.js +4 -1
- package/components/u-loading-page/props.js +3 -1
- package/components/u-loadmore/props.js +4 -1
- package/components/u-markdown/u-markdown.vue +45 -3
- package/components/u-modal/props.js +4 -1
- package/components/u-navbar/props.js +4 -2
- package/components/u-navbar/u-navbar.vue +15 -9
- package/components/u-no-network/props.js +4 -1
- package/components/u-notice-bar/props.js +4 -1
- package/components/u-notify/props.js +4 -1
- package/components/u-number-box/props.js +4 -1
- package/components/u-number-box/u-number-box.vue +2 -2
- package/components/u-number-keyboard/props.js +4 -1
- package/components/u-overlay/props.js +4 -1
- package/components/u-pagination/u-pagination.vue +60 -39
- package/components/u-parse/props.js +4 -1
- package/components/u-picker/props.js +4 -1
- package/components/u-picker/u-picker.vue +15 -0
- package/components/u-picker-column/props.js +3 -1
- package/components/u-popover/props.js +2 -1
- package/components/u-popup/props.js +4 -1
- package/components/u-poster/u-poster.vue +29 -14
- package/components/u-qrcode/qrcode.js +88 -87
- package/components/u-qrcode/u-qrcode.vue +138 -256
- package/components/u-radio/props.js +4 -1
- package/components/u-radio/u-radio.vue +7 -3
- package/components/u-radio-group/props.js +4 -1
- package/components/u-rate/props.js +4 -1
- package/components/u-read-more/props.js +4 -1
- package/components/u-row/props.js +4 -1
- package/components/u-row-notice/props.js +4 -1
- package/components/u-safe-bottom/props.js +2 -1
- package/components/u-scroll-list/props.js +4 -1
- package/components/u-search/props.js +3 -1
- package/components/u-skeleton/props.js +4 -1
- package/components/u-slider/props.js +3 -1
- package/components/u-slider/u-slider.vue +70 -28
- package/components/u-status-bar/props.js +4 -1
- package/components/u-steps/props.js +4 -1
- package/components/u-steps-item/props.js +4 -1
- package/components/u-sticky/props.js +4 -1
- package/components/u-sticky/u-sticky.vue +11 -0
- package/components/u-subsection/props.js +3 -1
- package/components/u-swipe-action/props.js +4 -1
- package/components/u-swipe-action-item/props.js +4 -1
- package/components/u-swipe-action-item/u-swipe-action-item.vue +14 -0
- package/components/u-swiper/props.js +9 -1
- package/components/u-swiper/swiper.js +1 -0
- package/components/u-swiper/u-swiper.vue +2 -0
- package/components/u-swiper-indicator/props.js +4 -1
- package/components/u-switch/props.js +4 -1
- package/components/u-tabbar/props.js +3 -1
- package/components/u-tabbar-item/props.js +4 -1
- package/components/u-table/props.js +3 -1
- package/components/u-table2/tableRow.vue +155 -69
- package/components/u-table2/u-table2.vue +328 -140
- package/components/u-tabs/props.js +4 -1
- package/components/u-tabs-item/props.js +3 -1
- package/components/u-tag/props.js +4 -1
- package/components/u-td/props.js +3 -1
- package/components/u-text/props.js +4 -1
- package/components/u-textarea/props.js +3 -1
- package/components/u-textarea/u-textarea.vue +16 -5
- package/components/u-th/props.js +3 -1
- package/components/u-toolbar/props.js +4 -1
- package/components/u-tooltip/props.js +10 -2
- package/components/u-tooltip/tooltip.js +2 -1
- package/components/u-tooltip/u-tooltip.vue +31 -3
- package/components/u-tr/props.js +3 -1
- package/components/u-transition/nvue-ani-map.js +75 -68
- package/components/u-transition/props.js +4 -1
- package/components/u-transition/transitionMixin.js +164 -163
- package/components/u-upload/props.js +4 -1
- package/components/u-upload/u-upload.vue +47 -40
- package/components/u-waterfall/u-waterfall.vue +50 -51
- package/index.js +65 -8
- package/libs/config/props.js +179 -204
- package/libs/css/components.scss +3 -0
- package/libs/function/uni-api-shims.js +29 -0
- package/libs/i18n/index.js +71 -36
- package/libs/i18n/locale-packs.js +11 -0
- package/libs/i18n/locales/all.js +23 -0
- package/libs/i18n/locales/{de.json → de.js} +1 -1
- package/libs/i18n/locales/{en.json → en.js} +2 -2
- package/libs/i18n/locales/{es.json → es.js} +1 -1
- package/libs/i18n/locales/{fr.json → fr.js} +2 -2
- package/libs/i18n/locales/{ja.json → ja.js} +1 -1
- package/libs/i18n/locales/{ko.json → ko.js} +1 -1
- package/libs/i18n/locales/{ru.json → ru.js} +1 -1
- package/libs/i18n/locales/{th.json → th.js} +1 -1
- package/libs/i18n/locales/{zh-Hans.json → zh-Hans.js} +1 -1
- package/libs/i18n/locales/{zh-Hant.json → zh-Hant.js} +1 -1
- package/libs/mixin/mixin.js +14 -4
- package/libs/util/gcanvas/bridge/bridge-weex.js +10 -5
- package/package.json +4 -5
- package/tsconfig.json +18 -0
- package/types/comps/calendar.d.ts +57 -0
- package/types/comps/checkbox.d.ts +12 -0
- package/types/comps/lineProgress.d.ts +5 -0
- package/types/comps/navbar.d.ts +3 -3
- package/types/comps/swiper.d.ts +5 -0
- package/types/comps/tooltip.d.ts +36 -1
- /package/components/u-markdown/{marked.esm.js → marked.esm.mjs} +0 -0
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
display: flex;
|
|
26
26
|
flex-direction: row;
|
|
27
27
|
align-items: center;
|
|
28
|
+
min-width: 0;
|
|
29
|
+
box-sizing: border-box;
|
|
28
30
|
padding: 10px 1px;
|
|
29
31
|
font-size: 14px;
|
|
30
32
|
white-space: nowrap;
|
|
@@ -47,6 +49,36 @@
|
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
|
|
52
|
+
.u-table-cell_content {
|
|
53
|
+
width: 100%;
|
|
54
|
+
min-width: 0;
|
|
55
|
+
max-width: 100%;
|
|
56
|
+
flex: 1;
|
|
57
|
+
box-sizing: border-box;
|
|
58
|
+
display: block;
|
|
59
|
+
text-align: inherit;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.u-table-cell_text {
|
|
63
|
+
width: 100%;
|
|
64
|
+
min-width: 0;
|
|
65
|
+
max-width: 100%;
|
|
66
|
+
display: block;
|
|
67
|
+
box-sizing: border-box;
|
|
68
|
+
text-align: inherit;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.u-table-cell_content-overflow,
|
|
72
|
+
.u-table-cell_content-overflow .u-table-cell_text {
|
|
73
|
+
width: 100%;
|
|
74
|
+
min-width: 0;
|
|
75
|
+
max-width: 100%;
|
|
76
|
+
display: block;
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
text-overflow: ellipsis;
|
|
79
|
+
white-space: nowrap;
|
|
80
|
+
}
|
|
81
|
+
|
|
50
82
|
.u-table-row-zebra {
|
|
51
83
|
background-color: var(--up-table2-zebra-bg-color, #fafafa);
|
|
52
84
|
}
|
|
@@ -72,17 +104,18 @@
|
|
|
72
104
|
}
|
|
73
105
|
</style>
|
|
74
106
|
<template>
|
|
75
|
-
<view class="u-table-row u-table-row-child"
|
|
76
|
-
:class="[highlightCurrentRow && currentRow === row ? 'u-table-row-highlight' : '',
|
|
77
|
-
rowClassName ? rowClassName(row, rowIndex) : '',
|
|
78
|
-
stripe && rowIndex % 2 === 1 ? 'u-table-row-zebra' : ''
|
|
79
|
-
]" :style="{height: rowHeight}" @click="handleRowClick(row)">
|
|
80
|
-
<view v-for="(col, colIndex) in columns" :key="col.key"
|
|
81
|
-
class="u-table-cell"
|
|
82
|
-
:class="[col.align ? 'u-text-' + col.align : '',
|
|
83
|
-
cellClassName ? cellClassName(row, col) : '',
|
|
84
|
-
getFixedClass(col),
|
|
85
|
-
|
|
107
|
+
<view class="u-table-row u-table-row-child"
|
|
108
|
+
:class="[highlightCurrentRow && currentRow === row ? 'u-table-row-highlight' : '',
|
|
109
|
+
rowClassName ? rowClassName(row, rowIndex, context) : '',
|
|
110
|
+
stripe && rowIndex % 2 === 1 ? 'u-table-row-zebra' : ''
|
|
111
|
+
]" :style="[{height: rowHeight}, getRowStyle(row, rowIndex)]" @click="handleRowClick(row)">
|
|
112
|
+
<view v-for="(col, colIndex) in columns" :key="col.key"
|
|
113
|
+
class="u-table-cell"
|
|
114
|
+
:class="[col.align ? 'u-text-' + col.align : '',
|
|
115
|
+
cellClassName ? cellClassName(row, col, context) : '',
|
|
116
|
+
getFixedClass(col),
|
|
117
|
+
isOverflowTooltipEnabled(col) ? 'u-table-cell-overflow' : '',
|
|
118
|
+
getCellSpanClass(rowIndex, colIndex)
|
|
86
119
|
]"
|
|
87
120
|
:style="[cellStyleInner({row: row, column: col, rowIndex: rowIndex, columnIndex: colIndex, level: level}), getCellSpanStyle(rowIndex, colIndex)]">
|
|
88
121
|
<!-- 复选框列 -->
|
|
@@ -91,19 +124,22 @@
|
|
|
91
124
|
@click.stop="$emit('toggleSelect', row)" />
|
|
92
125
|
</view>
|
|
93
126
|
<template v-else>
|
|
94
|
-
<!-- 在mainCol列显示展开图标 -->
|
|
95
|
-
<view v-if="col.key === computedMainCol && hasTree"
|
|
96
|
-
@click.stop="toggleExpand(row)" :style="{width: expandWidth}">
|
|
97
|
-
<view v-if="row
|
|
98
|
-
{{ isExpanded(row) ? '▼' : '▶' }}
|
|
99
|
-
</view>
|
|
100
|
-
</view>
|
|
101
|
-
<
|
|
102
|
-
:
|
|
103
|
-
<
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
127
|
+
<!-- 在mainCol列显示展开图标 -->
|
|
128
|
+
<view v-if="col.key === computedMainCol && hasTree"
|
|
129
|
+
@click.stop="toggleExpand(row, level)" :style="{width: expandWidth}">
|
|
130
|
+
<view v-if="hasExpandableChildren(row)">
|
|
131
|
+
{{ isLazyLoading(row) ? '...' : (isExpanded(row) ? '▼' : '▶') }}
|
|
132
|
+
</view>
|
|
133
|
+
</view>
|
|
134
|
+
<view class="u-table-cell_content"
|
|
135
|
+
:class="{ 'u-table-cell_content-overflow': isOverflowTooltipEnabled(col) }">
|
|
136
|
+
<slot name="cellChild" :row="row" :column="col" :prow="parentRow"
|
|
137
|
+
:rowIndex="rowIndex" :columnIndex="colIndex" :level="level" :context="context">
|
|
138
|
+
<text class="u-table-cell_text" :class="{ 'u-line-1': isOverflowTooltipEnabled(col) }" :lines="isOverflowTooltipEnabled(col) ? 1 : undefined">
|
|
139
|
+
{{ row[col.key] }}
|
|
140
|
+
</text>
|
|
141
|
+
</slot>
|
|
142
|
+
</view>
|
|
107
143
|
</template>
|
|
108
144
|
</view>
|
|
109
145
|
</view>
|
|
@@ -119,31 +155,39 @@
|
|
|
119
155
|
:row-key="rowKey"
|
|
120
156
|
:expanded-keys="expandedKeys"
|
|
121
157
|
:cell-style-inner="cellStyleInner"
|
|
122
|
-
:is-expanded="isExpanded"
|
|
123
|
-
:row-class-name="rowClassName"
|
|
124
|
-
:
|
|
125
|
-
:
|
|
126
|
-
:
|
|
127
|
-
:
|
|
128
|
-
:
|
|
129
|
-
:
|
|
158
|
+
:is-expanded="isExpanded"
|
|
159
|
+
:row-class-name="rowClassName"
|
|
160
|
+
:row-style="rowStyle"
|
|
161
|
+
:stripe="stripe"
|
|
162
|
+
:cell-class-name="cellClassName"
|
|
163
|
+
:get-fixed-class="getFixedClass"
|
|
164
|
+
:context="context"
|
|
165
|
+
:highlight-current-row="highlightCurrentRow"
|
|
166
|
+
:current-row="currentRow"
|
|
167
|
+
:handle-row-click="handleRowClick"
|
|
130
168
|
:toggle-expand="toggleExpand"
|
|
131
169
|
:level="level + 1"
|
|
132
170
|
:rowHeight="rowHeight"
|
|
133
171
|
:hasTree="hasTree"
|
|
134
172
|
:selectedRows="selectedRows"
|
|
135
173
|
:expandWidth="expandWidth"
|
|
136
|
-
:computed-main-col="computedMainCol"
|
|
137
|
-
:span-method="spanMethod"
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
174
|
+
:computed-main-col="computedMainCol"
|
|
175
|
+
:span-method="spanMethod"
|
|
176
|
+
:show-overflow-tooltip="showOverflowTooltip"
|
|
177
|
+
:has-expandable-children="hasExpandableChildren"
|
|
178
|
+
:is-lazy-loading="isLazyLoading"
|
|
179
|
+
@toggle-select="$emit('toggleSelect', $event)"
|
|
180
|
+
@row-click="$emit('rowClick', $event)"
|
|
181
|
+
@toggle-expand="$emit('toggleExpand', $event)"
|
|
141
182
|
>
|
|
142
|
-
<template v-slot:cellChild="scope">
|
|
143
|
-
<slot name="cellChild" :row="scope.row" :column="scope.column" :prow="scope.prow"
|
|
144
|
-
:rowIndex="scope.rowIndex" :columnIndex="scope.columnIndex" :level="level">
|
|
145
|
-
|
|
146
|
-
|
|
183
|
+
<template v-slot:cellChild="scope">
|
|
184
|
+
<slot name="cellChild" :row="scope.row" :column="scope.column" :prow="scope.prow"
|
|
185
|
+
:rowIndex="scope.rowIndex" :columnIndex="scope.columnIndex" :level="level" :context="context">
|
|
186
|
+
<text class="u-table-cell_text" :class="{ 'u-line-1': isOverflowTooltipEnabled(scope.column) }" :lines="isOverflowTooltipEnabled(scope.column) ? 1 : undefined">
|
|
187
|
+
{{ scope.row[scope.column.key] }}
|
|
188
|
+
</text>
|
|
189
|
+
</slot>
|
|
190
|
+
</template>
|
|
147
191
|
</table-row>
|
|
148
192
|
</template>
|
|
149
193
|
</template>
|
|
@@ -189,25 +233,33 @@ export default {
|
|
|
189
233
|
type: Function,
|
|
190
234
|
required: true
|
|
191
235
|
},
|
|
192
|
-
rowClassName: {
|
|
193
|
-
type: Function,
|
|
194
|
-
default: null
|
|
195
|
-
},
|
|
196
|
-
|
|
197
|
-
type:
|
|
198
|
-
default:
|
|
199
|
-
},
|
|
236
|
+
rowClassName: {
|
|
237
|
+
type: Function,
|
|
238
|
+
default: null
|
|
239
|
+
},
|
|
240
|
+
rowStyle: {
|
|
241
|
+
type: [Object, Function],
|
|
242
|
+
default: () => ({})
|
|
243
|
+
},
|
|
244
|
+
stripe: {
|
|
245
|
+
type: Boolean,
|
|
246
|
+
default: false
|
|
247
|
+
},
|
|
200
248
|
cellClassName: {
|
|
201
249
|
type: Function,
|
|
202
250
|
default: null
|
|
203
251
|
},
|
|
204
|
-
getFixedClass: {
|
|
205
|
-
type: Function,
|
|
206
|
-
required: true
|
|
207
|
-
},
|
|
208
|
-
|
|
209
|
-
type:
|
|
210
|
-
default:
|
|
252
|
+
getFixedClass: {
|
|
253
|
+
type: Function,
|
|
254
|
+
required: true
|
|
255
|
+
},
|
|
256
|
+
context: {
|
|
257
|
+
type: Object,
|
|
258
|
+
default: null
|
|
259
|
+
},
|
|
260
|
+
highlightCurrentRow: {
|
|
261
|
+
type: Boolean,
|
|
262
|
+
default: false
|
|
211
263
|
},
|
|
212
264
|
currentRow: {
|
|
213
265
|
type: Object,
|
|
@@ -230,6 +282,10 @@ export default {
|
|
|
230
282
|
type: String,
|
|
231
283
|
required: true
|
|
232
284
|
},
|
|
285
|
+
showOverflowTooltip: {
|
|
286
|
+
type: [Boolean, Object],
|
|
287
|
+
default: false
|
|
288
|
+
},
|
|
233
289
|
expandWidth: {
|
|
234
290
|
type: String,
|
|
235
291
|
required: true
|
|
@@ -247,17 +303,46 @@ export default {
|
|
|
247
303
|
required: true
|
|
248
304
|
},
|
|
249
305
|
// 添加spanMethod属性
|
|
250
|
-
spanMethod: {
|
|
251
|
-
type: Function,
|
|
252
|
-
default: null
|
|
253
|
-
}
|
|
254
|
-
|
|
306
|
+
spanMethod: {
|
|
307
|
+
type: Function,
|
|
308
|
+
default: null
|
|
309
|
+
},
|
|
310
|
+
hasExpandableChildren: {
|
|
311
|
+
type: Function,
|
|
312
|
+
required: true
|
|
313
|
+
},
|
|
314
|
+
isLazyLoading: {
|
|
315
|
+
type: Function,
|
|
316
|
+
required: true
|
|
317
|
+
}
|
|
318
|
+
},
|
|
255
319
|
emits: ['rowClick', 'toggleExpand', 'toggleSelect'],
|
|
256
320
|
methods: {
|
|
257
321
|
isSelected(row) {
|
|
258
322
|
return this.selectedRows.some(r => r[this.rowKey] === row[this.rowKey]);
|
|
259
323
|
},
|
|
260
|
-
|
|
324
|
+
isOverflowTooltipEnabled(column) {
|
|
325
|
+
if (column && column.type === 'selection') {
|
|
326
|
+
return false;
|
|
327
|
+
}
|
|
328
|
+
if (column && typeof column.showOverflowTooltip !== 'undefined') {
|
|
329
|
+
return !!column.showOverflowTooltip;
|
|
330
|
+
}
|
|
331
|
+
return !!this.showOverflowTooltip;
|
|
332
|
+
},
|
|
333
|
+
getRowStyle(row, rowIndex) {
|
|
334
|
+
if (typeof this.rowStyle === 'function') {
|
|
335
|
+
return this.rowStyle({
|
|
336
|
+
row,
|
|
337
|
+
rowIndex,
|
|
338
|
+
level: this.level,
|
|
339
|
+
parentRow: this.parentRow,
|
|
340
|
+
context: this.context
|
|
341
|
+
}) || {};
|
|
342
|
+
}
|
|
343
|
+
return this.rowStyle || {};
|
|
344
|
+
},
|
|
345
|
+
// 获取单元格的合并信息
|
|
261
346
|
getCellSpan(rowIndex, columnIndex) {
|
|
262
347
|
if (typeof this.spanMethod !== 'function') {
|
|
263
348
|
return { rowspan: 1, colspan: 1 };
|
|
@@ -266,12 +351,13 @@ export default {
|
|
|
266
351
|
const row = this.row;
|
|
267
352
|
const column = this.columns[columnIndex];
|
|
268
353
|
|
|
269
|
-
const result = this.spanMethod({
|
|
270
|
-
row,
|
|
271
|
-
column,
|
|
272
|
-
rowIndex,
|
|
273
|
-
columnIndex
|
|
274
|
-
|
|
354
|
+
const result = this.spanMethod({
|
|
355
|
+
row,
|
|
356
|
+
column,
|
|
357
|
+
rowIndex,
|
|
358
|
+
columnIndex,
|
|
359
|
+
context: this.context
|
|
360
|
+
});
|
|
275
361
|
|
|
276
362
|
if (Array.isArray(result)) {
|
|
277
363
|
const [rowspan, colspan] = result;
|