uview-plus 3.8.55 → 3.8.106
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 +2147 -1828
- package/components/u-action-sheet/props.js +3 -1
- package/components/u-action-sheet/u-action-sheet.vue +22 -2
- 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 +44 -15
- package/components/u-box/props.js +5 -2
- package/components/u-button/props.js +4 -1
- package/components/u-button/u-button.vue +2 -5
- package/components/u-button/vue.scss +3 -3
- package/components/u-calendar/calendar.js +8 -0
- package/components/u-calendar/props.js +43 -1
- package/components/u-calendar/u-calendar.vue +16 -0
- package/components/u-calendar-strip/props.js +3 -1
- package/components/u-canvas/u-canvas.vue +1028 -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 +9 -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-datetime-picker/u-datetime-picker.vue +53 -4
- package/components/u-divider/props.js +4 -1
- package/components/u-dragsort/u-dragsort.vue +57 -32
- 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 +11 -2
- package/components/u-icon/upicon.ttf +0 -0
- package/components/u-icon/util.js +103 -10
- 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-item/u-index-item.vue +1 -1
- package/components/u-index-list/props.js +4 -1
- package/components/u-index-list/u-index-list.vue +1 -1
- package/components/u-input/props.js +3 -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-novel-reader/content-normalizer.js +80 -0
- package/components/u-novel-reader/layout-engine.js +225 -0
- package/components/u-novel-reader/measure-adapter.js +69 -0
- package/components/u-novel-reader/novelReader.js +35 -0
- package/components/u-novel-reader/persistence.js +144 -0
- package/components/u-novel-reader/props.js +100 -0
- package/components/u-novel-reader/reader-catalog.vue +234 -0
- package/components/u-novel-reader/reader-content.vue +226 -0
- package/components/u-novel-reader/reader-core.js +151 -0
- package/components/u-novel-reader/reader-settings.vue +325 -0
- package/components/u-novel-reader/reader-toolbar.vue +313 -0
- package/components/u-novel-reader/theme-vars.scss +49 -0
- package/components/u-novel-reader/u-novel-reader.vue +836 -0
- 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-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 +246 -214
- package/components/u-qrcode/qrcode.js +105 -97
- package/components/u-qrcode/u-qrcode.vue +242 -289
- 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-scroll-list/scrollWxs.wxs +1 -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 +71 -29
- 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/index.wxs +43 -25
- package/components/u-swipe-action-item/nvue.js +9 -0
- package/components/u-swipe-action-item/other.js +32 -21
- package/components/u-swipe-action-item/props.js +9 -1
- package/components/u-swipe-action-item/swipeActionItem.js +1 -0
- package/components/u-swipe-action-item/u-swipe-action-item.vue +42 -4
- 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-switch/u-switch.vue +1 -1
- package/components/u-tabbar/props.js +3 -1
- package/components/u-tabbar/u-tabbar.vue +2 -1
- package/components/u-tabbar-item/props.js +4 -1
- package/components/u-tabbar-item/u-tabbar-item.vue +64 -21
- package/components/u-table/props.js +3 -1
- package/components/u-table2/tableRow.vue +155 -69
- package/components/u-table2/u-table2.vue +327 -137
- package/components/u-tabs/props.js +4 -1
- package/components/u-tabs/u-tabs.vue +11 -8
- package/components/u-tabs-item/props.js +3 -1
- package/components/u-tabs-pro/u-tabs-pro.vue +212 -0
- 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-text/text.js +1 -1
- package/components/u-text/u-text.vue +18 -6
- 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 +48 -41
- package/components/u-waterfall/u-waterfall.vue +162 -110
- package/index.js +65 -8
- package/libs/config/config.js +1 -1
- package/libs/config/props.js +180 -204
- package/libs/css/components.scss +3 -0
- package/libs/function/index.js +66 -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 +18 -54
- package/libs/root/index.js +78 -5
- package/libs/root/page.js +7 -7
- package/libs/root/root.js +73 -3
- package/libs/util/app-nvue-webview-canvas.js +486 -0
- package/libs/util/gcanvas/bridge/bridge-weex.js +10 -7
- 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 +3 -3
- package/package.json +4 -5
- package/tsconfig.json +18 -0
- package/types/comps/calendar.d.ts +38 -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/swipeActionItem.d.ts +13 -0
- package/types/comps/swiper.d.ts +5 -0
- package/types/comps/tabs.d.ts +2 -1
- package/types/comps/text.d.ts +1 -1
- package/types/comps/tooltip.d.ts +36 -1
- package/types/func.d.ts +23 -0
- package/types/index.d.ts +1 -0
- /package/components/u-markdown/{marked.esm.js → marked.esm.mjs} +0 -0
|
@@ -92,10 +92,14 @@
|
|
|
92
92
|
return {
|
|
93
93
|
columnList: [[]], // 存储每列的数据
|
|
94
94
|
children: [],
|
|
95
|
-
// 用于标记是否已经初始化
|
|
96
|
-
initialized: false,
|
|
97
|
-
windowWidth: 375,
|
|
98
|
-
windowHeight: 0
|
|
95
|
+
// 用于标记是否已经初始化
|
|
96
|
+
initialized: false,
|
|
97
|
+
windowWidth: 375,
|
|
98
|
+
windowHeight: 0,
|
|
99
|
+
distributionQueue: [],
|
|
100
|
+
distributionRunning: false,
|
|
101
|
+
distributionPromise: null,
|
|
102
|
+
distributionGeneration: 0
|
|
99
103
|
}
|
|
100
104
|
},
|
|
101
105
|
watch: {
|
|
@@ -107,22 +111,27 @@
|
|
|
107
111
|
if (this.columnList.length == 1) {
|
|
108
112
|
this.initColumnList()
|
|
109
113
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
+
if (!this.isPureAppend(nVal, oVal)) {
|
|
115
|
+
this.redistributeData(nVal);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
// 取差值,即这一次数组变化新增的部分
|
|
119
|
+
const startIndex = Array.isArray(oVal) && oVal.length > 0 ? oVal.length : 0;
|
|
120
|
+
// 纯追加时只将新增数据加入共享分配队列
|
|
121
|
+
this.handleData(nVal.slice(startIndex));
|
|
114
122
|
}
|
|
115
123
|
},
|
|
116
124
|
immediate: true
|
|
117
125
|
},
|
|
118
|
-
columns: {
|
|
119
|
-
handler() {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
+
columns: {
|
|
127
|
+
handler() {
|
|
128
|
+
// 重新分配数据
|
|
129
|
+
if (this.copyFlowList.length > 0) {
|
|
130
|
+
this.redistributeData(this.copyFlowList);
|
|
131
|
+
} else {
|
|
132
|
+
this.clear(false);
|
|
133
|
+
}
|
|
134
|
+
},
|
|
126
135
|
immediate: false
|
|
127
136
|
}
|
|
128
137
|
},
|
|
@@ -210,101 +219,144 @@
|
|
|
210
219
|
const newColumnsCount = this.getColumnsCount();
|
|
211
220
|
const oldColumnsCount = this.columnList.length;
|
|
212
221
|
|
|
213
|
-
// 只有列数发生变化时才重新分配数据
|
|
214
|
-
if (newColumnsCount !== oldColumnsCount) {
|
|
215
|
-
this.redistributeData();
|
|
216
|
-
}
|
|
217
|
-
}, 300);
|
|
218
|
-
},
|
|
219
|
-
|
|
220
|
-
// 重新分配所有数据
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
if (!newData || newData.length
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
222
|
+
// 只有列数发生变化时才重新分配数据
|
|
223
|
+
if (newColumnsCount !== oldColumnsCount) {
|
|
224
|
+
this.redistributeData(this.copyFlowList);
|
|
225
|
+
}
|
|
226
|
+
}, 300);
|
|
227
|
+
},
|
|
228
|
+
|
|
229
|
+
// 重新分配所有数据
|
|
230
|
+
redistributeData(data = this.copyFlowList) {
|
|
231
|
+
this.clear(false);
|
|
232
|
+
// 保存所有数据
|
|
233
|
+
const allData = this.cloneData(data || []);
|
|
234
|
+
// 重新分配数据
|
|
235
|
+
return this.handleData(allData);
|
|
236
|
+
},
|
|
237
|
+
|
|
238
|
+
// 判断新数据是否只在原数组末尾追加
|
|
239
|
+
isPureAppend(newData, oldData) {
|
|
240
|
+
if (!Array.isArray(oldData) || oldData.length === 0) return true;
|
|
241
|
+
if (!Array.isArray(newData) || newData.length < oldData.length) return false;
|
|
242
|
+
return oldData.every((item, index) => {
|
|
243
|
+
return JSON.stringify(item) === JSON.stringify(newData[index]);
|
|
244
|
+
});
|
|
245
|
+
},
|
|
246
|
+
|
|
247
|
+
// 将新增数据加入共享队列,确保只有一个分配循环运行
|
|
248
|
+
handleData(newData) {
|
|
249
|
+
if (!newData || newData.length === 0) {
|
|
250
|
+
return this.distributionPromise || Promise.resolve();
|
|
251
|
+
}
|
|
252
|
+
this.distributionQueue.push({
|
|
253
|
+
generation: this.distributionGeneration,
|
|
254
|
+
data: this.cloneData(newData)
|
|
255
|
+
});
|
|
256
|
+
if (!this.distributionRunning) {
|
|
257
|
+
this.distributionPromise = this.runDistributionQueue();
|
|
258
|
+
}
|
|
259
|
+
return this.distributionPromise;
|
|
260
|
+
},
|
|
261
|
+
|
|
262
|
+
// 串行消费所有待分配数据
|
|
263
|
+
async runDistributionQueue() {
|
|
264
|
+
if (this.distributionRunning) return;
|
|
265
|
+
this.distributionRunning = true;
|
|
266
|
+
try {
|
|
267
|
+
while (this.distributionQueue.length > 0) {
|
|
268
|
+
const task = this.distributionQueue.shift();
|
|
269
|
+
if (task.generation !== this.distributionGeneration) continue;
|
|
270
|
+
await this.distributeData(task.data, task.generation);
|
|
271
|
+
}
|
|
272
|
+
} finally {
|
|
273
|
+
this.distributionRunning = false;
|
|
274
|
+
this.distributionPromise = null;
|
|
275
|
+
if (this.distributionQueue.length > 0) {
|
|
276
|
+
this.distributionPromise = this.runDistributionQueue();
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
|
|
281
|
+
// 逐项测量并分配数据,代数变化时立即退出
|
|
282
|
+
async distributeData(newData, generation) {
|
|
283
|
+
let columnHeights = new Array(this.columnList.length).fill(0);
|
|
284
|
+
for (const item of newData) {
|
|
285
|
+
if (generation !== this.distributionGeneration) return;
|
|
286
|
+
columnHeights = await this.getColumnHeights();
|
|
287
|
+
if (generation !== this.distributionGeneration) return;
|
|
288
|
+
|
|
289
|
+
const minHeightIndex = this.getMinHeightColumnIndex(columnHeights);
|
|
290
|
+
this.columnList[minHeightIndex].push(item);
|
|
291
|
+
|
|
292
|
+
await sleep(this.addTime);
|
|
293
|
+
if (generation !== this.distributionGeneration) return;
|
|
294
|
+
await this.$nextTick();
|
|
295
|
+
if (generation !== this.distributionGeneration) return;
|
|
296
|
+
try {
|
|
297
|
+
const rect = await this.$uGetRect(`#u-column-${minHeightIndex}`);
|
|
298
|
+
if (generation !== this.distributionGeneration) return;
|
|
299
|
+
if (rect.height) {
|
|
300
|
+
columnHeights[minHeightIndex] = rect.height;
|
|
301
|
+
this.$emit('after-add-one', {
|
|
302
|
+
...item,
|
|
303
|
+
height: rect.height
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
} catch (e) {
|
|
307
|
+
// 获取不到列高时,下一个元素会重新测量所有列
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
if (generation !== this.distributionGeneration) return;
|
|
311
|
+
this.$emit('after-add-all', {
|
|
312
|
+
columnHeights: columnHeights,
|
|
313
|
+
newData: newData
|
|
314
|
+
});
|
|
315
|
+
},
|
|
316
|
+
|
|
317
|
+
// 获取当前所有列的真实高度
|
|
318
|
+
async getColumnHeights() {
|
|
319
|
+
const columnHeights = new Array(this.columnList.length).fill(0);
|
|
320
|
+
for (let i = 0; i < this.columnList.length; i++) {
|
|
321
|
+
try {
|
|
322
|
+
const rect = await this.$uGetRect(`#u-column-${i}`);
|
|
323
|
+
columnHeights[i] = rect.height || 0;
|
|
324
|
+
} catch (e) {
|
|
325
|
+
columnHeights[i] = 0;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
return columnHeights;
|
|
329
|
+
},
|
|
330
|
+
|
|
331
|
+
// 获取最短列;高度相同或暂不可测时按列数据量打散,避免全部落到第一列
|
|
332
|
+
getMinHeightColumnIndex(columnHeights) {
|
|
333
|
+
let minIndex = 0;
|
|
334
|
+
for (let i = 1; i < columnHeights.length; i++) {
|
|
335
|
+
const currentHeight = Number(columnHeights[i]) || 0;
|
|
336
|
+
const minHeight = Number(columnHeights[minIndex]) || 0;
|
|
337
|
+
if (currentHeight < minHeight) {
|
|
338
|
+
minIndex = i;
|
|
339
|
+
} else if (currentHeight === minHeight) {
|
|
340
|
+
const currentLength = this.columnList[i] ? this.columnList[i].length : 0;
|
|
341
|
+
const minLength = this.columnList[minIndex] ? this.columnList[minIndex].length : 0;
|
|
342
|
+
if (currentLength < minLength) {
|
|
343
|
+
minIndex = i;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
return minIndex;
|
|
348
|
+
},
|
|
349
|
+
|
|
350
|
+
// 复制而不是引用对象和数组
|
|
351
|
+
cloneData(data) {
|
|
352
|
+
return JSON.parse(JSON.stringify(data));
|
|
303
353
|
},
|
|
304
354
|
|
|
305
|
-
// 清空数据列表
|
|
306
|
-
clear(bak = true) {
|
|
307
|
-
this.
|
|
355
|
+
// 清空数据列表
|
|
356
|
+
clear(bak = true) {
|
|
357
|
+
this.distributionGeneration += 1;
|
|
358
|
+
this.distributionQueue.splice(0);
|
|
359
|
+
this.initColumnList();
|
|
308
360
|
// 同时清除父组件列表中的数据
|
|
309
361
|
if (bak) {
|
|
310
362
|
// #ifdef VUE2
|
|
@@ -413,4 +465,4 @@
|
|
|
413
465
|
max-width: 100%;
|
|
414
466
|
/* #endif */
|
|
415
467
|
}
|
|
416
|
-
</style>
|
|
468
|
+
</style>
|
package/index.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
// 补齐部分平台缺失的 uni API(如支付宝小程序的 onWindowResize)
|
|
2
|
+
import { applyUniApiShims } from './libs/function/uni-api-shims.js'
|
|
3
|
+
applyUniApiShims()
|
|
4
|
+
|
|
1
5
|
// 看到此报错,是因为没有配置vite.config.js的【transpileDependencies】
|
|
2
6
|
// const pleaseSetTranspileDependencies = {}, babelTest = pleaseSetTranspileDependencies?.test
|
|
3
7
|
|
|
@@ -27,7 +31,7 @@ import index, { rpx2px } from './libs/function/index.js'
|
|
|
27
31
|
// 配置信息
|
|
28
32
|
import config from './libs/config/config.js'
|
|
29
33
|
// props配置信息
|
|
30
|
-
import props from './libs/config/props.js'
|
|
34
|
+
import props, { setPropsConfig } from './libs/config/props.js'
|
|
31
35
|
// 各个需要fixed的地方的z-index配置文件
|
|
32
36
|
import zIndex from './libs/config/zIndex.js'
|
|
33
37
|
// 关于颜色的配置,特殊场景使用
|
|
@@ -42,7 +46,26 @@ import http from './libs/function/http.js'
|
|
|
42
46
|
import fontUtil from './components/u-icon/util.js';
|
|
43
47
|
|
|
44
48
|
// i18n
|
|
45
|
-
import i18n, {
|
|
49
|
+
import i18n, {
|
|
50
|
+
t,
|
|
51
|
+
registerLocale,
|
|
52
|
+
hasLocale,
|
|
53
|
+
getLocale,
|
|
54
|
+
setLocale
|
|
55
|
+
} from './libs/i18n/index.js'
|
|
56
|
+
import {
|
|
57
|
+
en,
|
|
58
|
+
es,
|
|
59
|
+
fr,
|
|
60
|
+
de,
|
|
61
|
+
ko,
|
|
62
|
+
ja,
|
|
63
|
+
ru,
|
|
64
|
+
th,
|
|
65
|
+
zhHans,
|
|
66
|
+
zhHant,
|
|
67
|
+
all as allLocales
|
|
68
|
+
} from './libs/i18n/locale-packs.js'
|
|
46
69
|
import {
|
|
47
70
|
themeState,
|
|
48
71
|
setTheme,
|
|
@@ -135,7 +158,41 @@ function rootNotify(options = {}) {
|
|
|
135
158
|
|
|
136
159
|
// 导出
|
|
137
160
|
let themeType = ['primary', 'success', 'error', 'warning', 'info'];
|
|
138
|
-
export {
|
|
161
|
+
export {
|
|
162
|
+
route,
|
|
163
|
+
http,
|
|
164
|
+
debounce,
|
|
165
|
+
throttle,
|
|
166
|
+
calc,
|
|
167
|
+
digit,
|
|
168
|
+
platform,
|
|
169
|
+
themeType,
|
|
170
|
+
mixin,
|
|
171
|
+
mpMixin,
|
|
172
|
+
props,
|
|
173
|
+
color,
|
|
174
|
+
test,
|
|
175
|
+
zIndex,
|
|
176
|
+
fontUtil,
|
|
177
|
+
i18n,
|
|
178
|
+
rpx2px,
|
|
179
|
+
t,
|
|
180
|
+
registerLocale,
|
|
181
|
+
hasLocale,
|
|
182
|
+
getLocale,
|
|
183
|
+
setLocale,
|
|
184
|
+
en,
|
|
185
|
+
es,
|
|
186
|
+
fr,
|
|
187
|
+
de,
|
|
188
|
+
ko,
|
|
189
|
+
ja,
|
|
190
|
+
ru,
|
|
191
|
+
th,
|
|
192
|
+
zhHans,
|
|
193
|
+
zhHant,
|
|
194
|
+
allLocales
|
|
195
|
+
}
|
|
139
196
|
export * from './libs/function/index.js'
|
|
140
197
|
export * from './libs/function/colorGradient.js'
|
|
141
198
|
|
|
@@ -149,7 +206,7 @@ export * from './libs/function/colorGradient.js'
|
|
|
149
206
|
export function setConfig(configs) {
|
|
150
207
|
const settings = configs || {}
|
|
151
208
|
index.shallowMerge(config, settings.config || {})
|
|
152
|
-
|
|
209
|
+
setPropsConfig(settings.props || {})
|
|
153
210
|
index.shallowMerge(color, settings.color || {})
|
|
154
211
|
index.shallowMerge(zIndex, settings.zIndex || {})
|
|
155
212
|
syncThemeColorOverrideState({
|
|
@@ -182,7 +239,7 @@ const $u = {
|
|
|
182
239
|
calc,
|
|
183
240
|
mixin,
|
|
184
241
|
mpMixin,
|
|
185
|
-
|
|
242
|
+
props,
|
|
186
243
|
...index,
|
|
187
244
|
color,
|
|
188
245
|
platform,
|
|
@@ -253,8 +310,8 @@ let components = []
|
|
|
253
310
|
function resolveComponents() {
|
|
254
311
|
if (components.length) return components
|
|
255
312
|
// #ifdef H5
|
|
256
|
-
|
|
257
|
-
|
|
313
|
+
// import.meta.glob is a Vite compile-time macro; the runtime guard would
|
|
314
|
+
// always fail in the browser and block component registration.
|
|
258
315
|
const importFn = import.meta.glob('./components/u-*/u-*.vue', { eager: true })
|
|
259
316
|
for (const key in importFn) {
|
|
260
317
|
const component = importFn[key]?.default
|
|
@@ -305,4 +362,4 @@ const install = (Vue, upuiParams = '') => {
|
|
|
305
362
|
|
|
306
363
|
export default {
|
|
307
364
|
install
|
|
308
|
-
}
|
|
365
|
+
}
|
package/libs/config/config.js
CHANGED