@nutui/nutui 3.1.17-beta.0 → 3.1.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/CHANGELOG.md +78 -0
- package/LICENSE +1 -1
- package/README.md +7 -1
- package/dist/nutui.d.ts +3 -1
- package/dist/nutui.es.js +2335 -1280
- package/dist/nutui.umd.js +2350 -1293
- package/dist/packages/_es/ActionSheet.js +8 -3
- package/dist/packages/_es/Address.js +17 -11
- package/dist/packages/_es/Audio.js +2 -2
- package/dist/packages/_es/Avatar.js +2 -2
- package/dist/packages/_es/BackTop.js +7 -4
- package/dist/packages/_es/Badge.js +2 -2
- package/dist/packages/_es/Barrage.js +2 -2
- package/dist/packages/_es/Button.js +2 -2
- package/dist/packages/_es/Calendar.js +15 -16
- package/dist/packages/_es/Card.js +2 -2
- package/dist/packages/_es/Cascader.js +2 -2
- package/dist/packages/_es/Cell.js +25 -18
- package/dist/packages/_es/CellGroup.js +2 -2
- package/dist/packages/_es/Checkbox.js +4 -4
- package/dist/packages/_es/CheckboxGroup.js +4 -4
- package/dist/packages/_es/CircleProgress.js +2 -2
- package/dist/packages/_es/Col.js +2 -2
- package/dist/packages/_es/Collapse.js +2 -2
- package/dist/packages/_es/CollapseItem.js +31 -19
- package/dist/packages/_es/CountDown.js +4 -2
- package/dist/packages/_es/CountUp.js +25 -16
- package/dist/packages/_es/DatePicker.js +83 -47
- package/dist/packages/_es/Dialog.js +5 -3
- package/dist/packages/_es/Divider.js +2 -2
- package/dist/packages/_es/Drag.js +4 -4
- package/dist/packages/_es/Elevator.js +3 -3
- package/dist/packages/_es/Empty.js +2 -2
- package/dist/packages/_es/FixedNav.js +2 -2
- package/dist/packages/_es/Form.js +8 -6
- package/dist/packages/_es/FormItem.js +9 -6
- package/dist/packages/_es/Grid.js +2 -2
- package/dist/packages/_es/GridItem.js +3 -3
- package/dist/packages/_es/Icon.js +2 -2
- package/dist/packages/_es/ImagePreview.js +9 -4
- package/dist/packages/_es/Indicator.js +2 -2
- package/dist/packages/_es/InfiniteLoading.js +2 -2
- package/dist/packages/_es/Input.js +290 -66
- package/dist/packages/_es/InputNumber.js +2 -2
- package/dist/packages/_es/Layout.js +2 -2
- package/dist/packages/_es/List.js +124 -0
- package/dist/packages/_es/Menu.js +3 -3
- package/dist/packages/_es/MenuItem.js +2 -2
- package/dist/packages/_es/Navbar.js +31 -66
- package/dist/packages/_es/NoticeBar.js +41 -22
- package/dist/packages/_es/Notify.js +7 -3
- package/dist/packages/_es/NumberKeyboard.js +9 -4
- package/dist/packages/_es/OverLay.js +2 -2
- package/dist/packages/_es/Pagination.js +2 -2
- package/dist/packages/_es/Picker.js +163 -156
- package/dist/packages/_es/Popover.js +5 -2
- package/dist/packages/_es/Popup.js +2 -2
- package/dist/packages/_es/Price.js +2 -2
- package/dist/packages/_es/Progress.js +14 -22
- package/dist/packages/_es/Radio.js +3 -3
- package/dist/packages/_es/RadioGroup.js +2 -2
- package/dist/packages/_es/Range.js +131 -21
- package/dist/packages/_es/Rate.js +2 -2
- package/dist/packages/_es/Row.js +2 -2
- package/dist/packages/_es/SearchBar.js +2 -2
- package/dist/packages/_es/ShortPassword.js +9 -4
- package/dist/packages/_es/SideNavBar.js +2 -2
- package/dist/packages/_es/SideNavBarItem.js +2 -2
- package/dist/packages/_es/Signature.js +25 -6
- package/dist/packages/_es/Skeleton.js +2 -2
- package/dist/packages/_es/Sku.js +31 -13
- package/dist/packages/_es/Step.js +28 -12
- package/dist/packages/_es/Steps.js +8 -3
- package/dist/packages/_es/Sticky.js +3 -3
- package/dist/packages/_es/SubSideNavBar.js +2 -2
- package/dist/packages/_es/Swipe.js +3 -3
- package/dist/packages/_es/Swiper.js +3 -3
- package/dist/packages/_es/SwiperItem.js +3 -3
- package/dist/packages/_es/Switch.js +2 -2
- package/dist/packages/_es/TabPane.js +2 -2
- package/dist/packages/_es/Tabbar.js +2 -2
- package/dist/packages/_es/TabbarItem.js +23 -8
- package/dist/packages/_es/Table.js +2 -2
- package/dist/packages/_es/Tabs.js +8 -5
- package/dist/packages/_es/Tag.js +11 -5
- package/dist/packages/_es/TextArea.js +38 -6
- package/dist/packages/_es/TimeDetail.js +2 -2
- package/dist/packages/_es/TimePannel.js +2 -2
- package/dist/packages/_es/TimeSelect.js +8 -3
- package/dist/packages/_es/Toast.js +16 -9
- package/dist/packages/_es/Uploader.js +2 -4
- package/dist/packages/_es/Video.js +12 -8
- package/dist/packages/_es/common.js +2 -2
- package/dist/packages/_es/component.js +2 -2
- package/dist/packages/_es/index.js +6 -8
- package/dist/packages/_es/index2.js +9 -32
- package/dist/packages/_es/index3.js +29 -57
- package/dist/packages/_es/index4.js +64 -0
- package/dist/packages/_es/plugin-vue_export-helper.js +2 -2
- package/dist/packages/_es/pxCheck.js +2 -2
- package/dist/packages/_es/raf.js +2 -2
- package/dist/packages/_es/util.js +2 -2
- package/dist/packages/actionsheet/index.scss +7 -6
- package/dist/packages/badge/index.scss +11 -13
- package/dist/packages/button/index.scss +6 -5
- package/dist/packages/calendar/index.scss +9 -4
- package/dist/packages/calendaritem/index.scss +0 -207
- package/dist/packages/cell/index.scss +9 -9
- package/dist/packages/cellgroup/index.scss +1 -1
- package/dist/packages/checkbox/index.scss +4 -3
- package/dist/packages/collapseitem/index.scss +21 -11
- package/dist/packages/countdown/index.scss +3 -1
- package/dist/packages/divider/index.scss +8 -8
- package/dist/packages/elevator/index.scss +36 -36
- package/dist/packages/formitem/index.scss +15 -8
- package/dist/packages/indicator/index.scss +1 -1
- package/dist/packages/input/index.scss +70 -24
- package/dist/packages/inputnumber/index.scss +4 -2
- package/dist/packages/list/index.scss +24 -0
- package/dist/packages/menu/index.scss +3 -3
- package/dist/packages/navbar/index.scss +30 -8
- package/dist/packages/noticebar/index.scss +10 -5
- package/dist/packages/notify/index.scss +10 -0
- package/dist/packages/numberkeyboard/index.scss +22 -21
- package/dist/packages/oldpicker/index.scss +131 -0
- package/dist/packages/picker/index.scss +38 -32
- package/dist/packages/progress/index.scss +24 -19
- package/dist/packages/radio/index.scss +7 -6
- package/dist/packages/range/index.scss +113 -6
- package/dist/packages/searchbar/index.scss +7 -7
- package/dist/packages/sidenavbaritem/index.scss +5 -5
- package/dist/packages/step/index.scss +29 -29
- package/dist/packages/subsidenavbar/index.scss +10 -8
- package/dist/packages/swiper/index.scss +4 -4
- package/dist/packages/switch/index.scss +8 -8
- package/dist/packages/tabbar/index.scss +3 -2
- package/dist/packages/tabbaritem/index.scss +19 -3
- package/dist/packages/tabs/index.scss +1 -0
- package/dist/packages/timedetail/index.scss +13 -13
- package/dist/packages/timepannel/index.scss +7 -7
- package/dist/packages/timeselect/index.scss +3 -3
- package/dist/packages/toast/index.scss +8 -7
- package/dist/packages/uploader/index.scss +4 -4
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +43 -41
- package/dist/styles/themes/jdt.scss +91 -0
- package/dist/styles/variables-jdt.scss +727 -0
- package/dist/styles/variables.scss +322 -38
- package/package.json +3 -2
- package/dist/styles/themes/jdd.scss +0 -2
|
@@ -18,46 +18,35 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
22
|
-
* (c)
|
|
21
|
+
* @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
|
|
22
|
+
* (c) 2022 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
25
|
-
import { ref, reactive, computed, watch, onMounted, toRefs, openBlock, createElementBlock, createElementVNode, normalizeStyle, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode,
|
|
25
|
+
import { ref, reactive, computed, watch, onMounted, toRefs, openBlock, createElementBlock, createElementVNode, normalizeStyle, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode, onBeforeUnmount, resolveComponent, createVNode, withCtx } from "vue";
|
|
26
26
|
import { c as createComponent } from "./component.js";
|
|
27
|
-
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
28
27
|
import Popup, { popupProps } from "./Popup.js";
|
|
28
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
29
29
|
import "./OverLay.js";
|
|
30
30
|
import "./Icon.js";
|
|
31
31
|
import "./pxCheck.js";
|
|
32
|
-
const commonProps = {
|
|
33
|
-
listData: {
|
|
34
|
-
type: Array,
|
|
35
|
-
default: () => {
|
|
36
|
-
return [];
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
readonly: {
|
|
40
|
-
type: Boolean,
|
|
41
|
-
default: false
|
|
42
|
-
},
|
|
43
|
-
defaultIndex: {
|
|
44
|
-
type: [Number, String],
|
|
45
|
-
default: 0
|
|
46
|
-
},
|
|
47
|
-
itemHeight: {
|
|
48
|
-
type: [Number, String],
|
|
49
|
-
default: 35
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
32
|
const { create: create$1 } = createComponent("picker-column");
|
|
53
33
|
const _sfc_main$1 = create$1({
|
|
54
|
-
props:
|
|
55
|
-
|
|
34
|
+
props: {
|
|
35
|
+
value: [String, Number],
|
|
36
|
+
columnsType: String,
|
|
56
37
|
itemShow: {
|
|
57
38
|
type: Boolean,
|
|
58
39
|
default: false
|
|
40
|
+
},
|
|
41
|
+
column: {
|
|
42
|
+
type: Array,
|
|
43
|
+
default: () => []
|
|
44
|
+
},
|
|
45
|
+
readonly: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: false
|
|
59
48
|
}
|
|
60
|
-
},
|
|
49
|
+
},
|
|
61
50
|
emits: ["click", "change"],
|
|
62
51
|
setup(props, { emit }) {
|
|
63
52
|
const wrapper = ref();
|
|
@@ -67,7 +56,8 @@ const _sfc_main$1 = create$1({
|
|
|
67
56
|
endY: 0,
|
|
68
57
|
startTime: 0,
|
|
69
58
|
endTime: 0,
|
|
70
|
-
lastY: 0
|
|
59
|
+
lastY: 0,
|
|
60
|
+
lastTime: 0
|
|
71
61
|
},
|
|
72
62
|
currIndex: 1,
|
|
73
63
|
transformY: 0,
|
|
@@ -113,7 +103,7 @@ const _sfc_main$1 = create$1({
|
|
|
113
103
|
event.preventDefault();
|
|
114
104
|
let changedTouches = event.changedTouches[0];
|
|
115
105
|
state.touchParams.lastY = changedTouches.pageY;
|
|
116
|
-
state.touchParams.lastTime = event.
|
|
106
|
+
state.touchParams.lastTime = event.timeStamp || Date.now();
|
|
117
107
|
let move = state.touchParams.lastY - state.touchParams.startY;
|
|
118
108
|
let moveTime = state.touchParams.lastTime - state.touchParams.startTime;
|
|
119
109
|
if (moveTime <= 300) {
|
|
@@ -150,8 +140,8 @@ const _sfc_main$1 = create$1({
|
|
|
150
140
|
if (updateMove > 0) {
|
|
151
141
|
updateMove = 0;
|
|
152
142
|
}
|
|
153
|
-
if (updateMove < -(props.
|
|
154
|
-
updateMove = -(props.
|
|
143
|
+
if (updateMove < -(props.column.length - 1) * state.lineSpacing) {
|
|
144
|
+
updateMove = -(props.column.length - 1) * state.lineSpacing;
|
|
155
145
|
}
|
|
156
146
|
let endMove = Math.round(updateMove / state.lineSpacing) * state.lineSpacing;
|
|
157
147
|
let deg = `${(Math.abs(Math.round(endMove / state.lineSpacing)) + 1) * state.rotation}deg`;
|
|
@@ -173,25 +163,22 @@ const _sfc_main$1 = create$1({
|
|
|
173
163
|
}
|
|
174
164
|
};
|
|
175
165
|
const setChooseValue = () => {
|
|
176
|
-
emit("change", state.currIndex - 1);
|
|
166
|
+
emit("change", props.column[state.currIndex - 1]);
|
|
177
167
|
};
|
|
178
168
|
const modifyStatus = (type) => {
|
|
179
|
-
|
|
169
|
+
const { column: column2 } = props;
|
|
170
|
+
let index = column2.findIndex((columnItem) => columnItem.value == props.value);
|
|
180
171
|
state.currIndex = index === -1 ? 1 : index + 1;
|
|
181
172
|
let move = index === -1 ? 0 : index * state.lineSpacing;
|
|
182
173
|
type && setChooseValue();
|
|
183
174
|
setMove(-move);
|
|
184
175
|
};
|
|
185
|
-
watch(() => props.
|
|
176
|
+
watch(() => props.column, (val) => {
|
|
186
177
|
state.transformY = 0;
|
|
187
178
|
modifyStatus(false);
|
|
188
179
|
}, {
|
|
189
180
|
deep: true
|
|
190
181
|
});
|
|
191
|
-
watch(() => props.defaultIndex, (val) => {
|
|
192
|
-
state.transformY = 0;
|
|
193
|
-
modifyStatus(false);
|
|
194
|
-
});
|
|
195
182
|
onMounted(() => {
|
|
196
183
|
modifyStatus(true);
|
|
197
184
|
});
|
|
@@ -206,7 +193,8 @@ const _sfc_main$1 = create$1({
|
|
|
206
193
|
onTouchMove,
|
|
207
194
|
onTouchEnd,
|
|
208
195
|
touchRollerStyle,
|
|
209
|
-
touchListStyle
|
|
196
|
+
touchListStyle,
|
|
197
|
+
setMove
|
|
210
198
|
});
|
|
211
199
|
}
|
|
212
200
|
});
|
|
@@ -227,12 +215,12 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
227
215
|
ref: "roller",
|
|
228
216
|
style: normalizeStyle(_ctx.touchRollerStyle)
|
|
229
217
|
}, [
|
|
230
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.
|
|
218
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.column, (item, index) => {
|
|
231
219
|
return openBlock(), createElementBlock("view", {
|
|
232
220
|
class: normalizeClass(["nut-picker-roller-item", { "nut-picker-roller-item-hidden": _ctx.isHidden(index + 1) }]),
|
|
233
221
|
style: normalizeStyle(_ctx.setRollerStyle(index + 1)),
|
|
234
|
-
key: item.
|
|
235
|
-
}, toDisplayString(
|
|
222
|
+
key: item.value ? item.value : index
|
|
223
|
+
}, toDisplayString(item.text), 7);
|
|
236
224
|
}), 128))
|
|
237
225
|
], 4),
|
|
238
226
|
createElementVNode("view", _hoisted_1$1, [
|
|
@@ -241,25 +229,29 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
241
229
|
ref: "list",
|
|
242
230
|
style: normalizeStyle(_ctx.touchListStyle)
|
|
243
231
|
}, [
|
|
244
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.
|
|
232
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.column, (item, index) => {
|
|
245
233
|
return openBlock(), createElementBlock("view", {
|
|
246
|
-
class: "nut-picker-item nut-picker-item-ref",
|
|
247
|
-
key: item.
|
|
248
|
-
}, toDisplayString(
|
|
234
|
+
class: normalizeClass(["nut-picker-item", "nut-picker-item-ref", item.className]),
|
|
235
|
+
key: item.value ? item.value : index
|
|
236
|
+
}, toDisplayString(item.text), 3);
|
|
249
237
|
}), 128)),
|
|
250
|
-
_ctx.
|
|
238
|
+
_ctx.column && _ctx.column.length === 1 ? (openBlock(), createElementBlock("view", _hoisted_2$1)) : createCommentVNode("", true)
|
|
251
239
|
], 4)
|
|
252
240
|
])
|
|
253
241
|
], 32);
|
|
254
242
|
}
|
|
255
243
|
var column = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
|
|
256
|
-
const {
|
|
244
|
+
const { componentName, create } = createComponent("picker");
|
|
257
245
|
const _sfc_main = create({
|
|
258
246
|
components: {
|
|
259
247
|
[column.name]: column,
|
|
260
248
|
[Popup.name]: Popup
|
|
261
249
|
},
|
|
262
|
-
props:
|
|
250
|
+
props: __spreadProps(__spreadValues({}, popupProps), {
|
|
251
|
+
modelValue: {
|
|
252
|
+
type: Array,
|
|
253
|
+
default: () => []
|
|
254
|
+
},
|
|
263
255
|
title: {
|
|
264
256
|
type: String,
|
|
265
257
|
default: ""
|
|
@@ -271,143 +263,158 @@ const _sfc_main = create({
|
|
|
271
263
|
okText: {
|
|
272
264
|
type: String,
|
|
273
265
|
default: "\u786E\u5B9A"
|
|
266
|
+
},
|
|
267
|
+
columns: {
|
|
268
|
+
type: Array,
|
|
269
|
+
default: () => {
|
|
270
|
+
return [];
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
readonly: {
|
|
274
|
+
type: Boolean,
|
|
275
|
+
default: false
|
|
274
276
|
}
|
|
275
|
-
}),
|
|
276
|
-
emits: ["close", "change", "confirm", "update:visible"],
|
|
277
|
+
}),
|
|
278
|
+
emits: ["close", "change", "confirm", "update:visible", "update:modelValue"],
|
|
277
279
|
setup(props, { emit }) {
|
|
278
|
-
const childrenKey = "children";
|
|
279
|
-
const valuesKey = "values";
|
|
280
280
|
const state = reactive({
|
|
281
281
|
show: false,
|
|
282
|
-
formattedColumns: props.
|
|
283
|
-
defaultIndex: props.defaultIndex
|
|
282
|
+
formattedColumns: props.columns
|
|
284
283
|
});
|
|
285
|
-
let
|
|
286
|
-
let defaultIndexList = [];
|
|
284
|
+
let defaultValues = ref(props.modelValue);
|
|
287
285
|
const classes = computed(() => {
|
|
288
286
|
const prefixCls = componentName;
|
|
289
287
|
return {
|
|
290
288
|
[prefixCls]: true
|
|
291
289
|
};
|
|
292
290
|
});
|
|
293
|
-
const
|
|
291
|
+
const selectedOptions = computed(() => {
|
|
292
|
+
let optins = [];
|
|
293
|
+
columnsList.value.map((column2, index) => {
|
|
294
|
+
let currOptions = [];
|
|
295
|
+
currOptions = column2.filter((item) => item.value == defaultValues.value[index]);
|
|
296
|
+
optins.push(currOptions[0]);
|
|
297
|
+
});
|
|
298
|
+
return optins;
|
|
299
|
+
});
|
|
300
|
+
const columnsType = computed(() => {
|
|
294
301
|
const firstColumn = state.formattedColumns[0];
|
|
295
|
-
if (
|
|
296
|
-
if (firstColumn
|
|
302
|
+
if (firstColumn) {
|
|
303
|
+
if (Array.isArray(firstColumn)) {
|
|
304
|
+
return "multiple";
|
|
305
|
+
}
|
|
306
|
+
if ("children" in firstColumn) {
|
|
297
307
|
return "cascade";
|
|
298
|
-
} else if (firstColumn == null ? void 0 : firstColumn[valuesKey]) {
|
|
299
|
-
addDefaultIndexList(props.listData);
|
|
300
|
-
return "multipleColumns";
|
|
301
308
|
}
|
|
302
309
|
}
|
|
303
|
-
return "
|
|
310
|
+
return "single";
|
|
304
311
|
});
|
|
305
|
-
const
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
+
const columnsList = computed(() => {
|
|
313
|
+
switch (columnsType.value) {
|
|
314
|
+
case "multiple":
|
|
315
|
+
return state.formattedColumns;
|
|
316
|
+
case "cascade":
|
|
317
|
+
return formatCascade(state.formattedColumns, defaultValues.value);
|
|
318
|
+
default:
|
|
319
|
+
return [state.formattedColumns];
|
|
312
320
|
}
|
|
313
|
-
return state.formattedColumns;
|
|
314
321
|
});
|
|
315
|
-
const
|
|
316
|
-
defaultIndexList = [];
|
|
317
|
-
listData.forEach((res) => {
|
|
318
|
-
defaultIndexList.push(res.defaultIndex || 0);
|
|
319
|
-
});
|
|
320
|
-
};
|
|
321
|
-
const formatCascade = (listData, defaultIndex) => {
|
|
322
|
+
const formatCascade = (columns, defaultValues2) => {
|
|
322
323
|
const formatted = [];
|
|
323
|
-
let
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
324
|
+
let cursor = {
|
|
325
|
+
text: "",
|
|
326
|
+
value: "",
|
|
327
|
+
children: columns
|
|
328
|
+
};
|
|
329
|
+
let columnIndex = 0;
|
|
330
|
+
while (cursor && cursor.children) {
|
|
331
|
+
const options = cursor.children;
|
|
332
|
+
const value = defaultValues2[columnIndex];
|
|
333
|
+
let index = options.findIndex((columnItem) => columnItem.value == value);
|
|
334
|
+
if (index == -1)
|
|
335
|
+
index = 0;
|
|
336
|
+
cursor = cursor.children[index];
|
|
337
|
+
columnIndex++;
|
|
338
|
+
formatted.push(options);
|
|
331
339
|
}
|
|
332
|
-
addDefaultIndexList(formatted);
|
|
333
340
|
return formatted;
|
|
334
341
|
};
|
|
335
|
-
const getCascadeData = (listData, defaultIndex) => {
|
|
336
|
-
var _a;
|
|
337
|
-
let arr = listData;
|
|
338
|
-
arr.defaultIndex = defaultIndex;
|
|
339
|
-
const dataList = [];
|
|
340
|
-
while (arr) {
|
|
341
|
-
const item = arr[(_a = arr.defaultIndex) != null ? _a : 0];
|
|
342
|
-
dataList.push(item.text);
|
|
343
|
-
arr = item.children;
|
|
344
|
-
}
|
|
345
|
-
return dataList;
|
|
346
|
-
};
|
|
347
342
|
const close = () => {
|
|
348
343
|
emit("close");
|
|
349
344
|
emit("update:visible", false);
|
|
350
345
|
};
|
|
351
|
-
const changeHandler = (columnIndex,
|
|
352
|
-
if (
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
cursor
|
|
361
|
-
} else if (i > columnIndex) {
|
|
362
|
-
cursor.defaultIndex = 0;
|
|
346
|
+
const changeHandler = (columnIndex, option) => {
|
|
347
|
+
if (option && Object.keys(option).length) {
|
|
348
|
+
if (columnsType.value === "cascade") {
|
|
349
|
+
defaultValues.value[columnIndex] = option.value ? option.value : "";
|
|
350
|
+
let index = columnIndex;
|
|
351
|
+
let cursor = option;
|
|
352
|
+
while (cursor && cursor.children) {
|
|
353
|
+
defaultValues.value[index + 1] = cursor.children[0].value;
|
|
354
|
+
index++;
|
|
355
|
+
cursor = cursor.children[0];
|
|
363
356
|
}
|
|
364
|
-
|
|
365
|
-
|
|
357
|
+
} else {
|
|
358
|
+
defaultValues.value[columnIndex] = option.value ? option.value : "";
|
|
366
359
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
emit("change", val, columnIndex, dataIndex);
|
|
360
|
+
emit("change", {
|
|
361
|
+
columnIndex,
|
|
362
|
+
selectedValue: defaultValues.value,
|
|
363
|
+
selectedOptions: selectedOptions.value
|
|
364
|
+
});
|
|
373
365
|
}
|
|
374
366
|
};
|
|
375
|
-
const
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
}
|
|
380
|
-
for (let i = 0; i < defaultIndexList.length; i++) {
|
|
381
|
-
state.formattedColumns[i].defaultIndex = defaultIndexList[i];
|
|
382
|
-
}
|
|
383
|
-
const checkedArr = toRaw(state.formattedColumns).map((res) => res.values && res.values[res.defaultIndex]);
|
|
384
|
-
emit("confirm", checkedArr);
|
|
385
|
-
} else if (dataType.value === "cascade") {
|
|
386
|
-
emit("confirm", getCascadeData(toRaw(state.formattedColumns), state.defaultIndex));
|
|
387
|
-
}
|
|
367
|
+
const confirmHandler = () => {
|
|
368
|
+
emit("confirm", {
|
|
369
|
+
selectedValue: defaultValues.value,
|
|
370
|
+
selectedOptions: selectedOptions.value
|
|
371
|
+
});
|
|
388
372
|
emit("update:visible", false);
|
|
389
373
|
};
|
|
374
|
+
onMounted(() => {
|
|
375
|
+
if (props.visible)
|
|
376
|
+
state.show = props.visible;
|
|
377
|
+
});
|
|
378
|
+
onBeforeUnmount(() => {
|
|
379
|
+
if (props.visible)
|
|
380
|
+
state.show = false;
|
|
381
|
+
});
|
|
382
|
+
watch(() => props.modelValue, (newValues) => {
|
|
383
|
+
const isSameValue = JSON.stringify(newValues) === JSON.stringify(defaultValues.value);
|
|
384
|
+
if (!isSameValue) {
|
|
385
|
+
defaultValues.value = newValues;
|
|
386
|
+
}
|
|
387
|
+
}, { deep: true });
|
|
388
|
+
watch(defaultValues, (newValues) => {
|
|
389
|
+
const isSameValue = JSON.stringify(newValues) === JSON.stringify(props.modelValue);
|
|
390
|
+
if (!isSameValue) {
|
|
391
|
+
emit("update:modelValue", newValues);
|
|
392
|
+
}
|
|
393
|
+
}, { immediate: true });
|
|
390
394
|
watch(() => props.visible, (val) => {
|
|
391
395
|
state.show = val;
|
|
392
396
|
});
|
|
393
|
-
watch(() => props.
|
|
394
|
-
|
|
397
|
+
watch(() => props.columns, (val) => {
|
|
398
|
+
if (val.length)
|
|
399
|
+
state.formattedColumns = val;
|
|
395
400
|
});
|
|
396
401
|
return __spreadProps(__spreadValues({
|
|
397
402
|
classes
|
|
398
403
|
}, toRefs(state)), {
|
|
399
404
|
column,
|
|
400
|
-
|
|
401
|
-
|
|
405
|
+
columnsType,
|
|
406
|
+
columnsList,
|
|
402
407
|
close,
|
|
403
408
|
changeHandler,
|
|
404
|
-
|
|
409
|
+
confirmHandler,
|
|
410
|
+
defaultValues
|
|
405
411
|
});
|
|
406
412
|
}
|
|
407
413
|
});
|
|
408
414
|
const _hoisted_1 = { class: "nut-picker__bar" };
|
|
409
|
-
const _hoisted_2 = { class: "nut-
|
|
410
|
-
const _hoisted_3 =
|
|
415
|
+
const _hoisted_2 = { class: "nut-picker__title" };
|
|
416
|
+
const _hoisted_3 = { class: "nut-picker__column" };
|
|
417
|
+
const _hoisted_4 = /* @__PURE__ */ createElementVNode("view", { class: "nut-picker__hairline" }, null, -1);
|
|
411
418
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
412
419
|
const _component_nut_picker_column = resolveComponent("nut-picker-column");
|
|
413
420
|
const _component_nut_popup = resolveComponent("nut-popup");
|
|
@@ -422,44 +429,44 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
422
429
|
"lock-scroll": _ctx.lockScroll,
|
|
423
430
|
"close-on-click-overlay": _ctx.closeOnClickOverlay,
|
|
424
431
|
onClose: _ctx.close,
|
|
425
|
-
round: true
|
|
432
|
+
round: true,
|
|
433
|
+
isWrapTeleport: _ctx.isWrapTeleport
|
|
426
434
|
}, {
|
|
427
435
|
default: withCtx(() => [
|
|
428
436
|
createElementVNode("view", _hoisted_1, [
|
|
429
437
|
createElementVNode("view", {
|
|
430
|
-
class: "nut-picker__left nut-picker__button",
|
|
438
|
+
class: "nut-picker__cancel nut-picker__left nut-picker__button",
|
|
431
439
|
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.close && _ctx.close(...args))
|
|
432
440
|
}, toDisplayString(_ctx.cancelText), 1),
|
|
433
|
-
createElementVNode("view",
|
|
441
|
+
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.title), 1),
|
|
434
442
|
createElementVNode("view", {
|
|
435
|
-
class: "nut-picker__button",
|
|
436
|
-
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.
|
|
443
|
+
class: "nut-picker__confirm nut-picker__right nut-picker__button",
|
|
444
|
+
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.confirmHandler())
|
|
437
445
|
}, toDisplayString(_ctx.okText), 1)
|
|
438
446
|
]),
|
|
439
|
-
createElementVNode("view",
|
|
440
|
-
|
|
441
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.
|
|
447
|
+
createElementVNode("view", _hoisted_3, [
|
|
448
|
+
_hoisted_4,
|
|
449
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columnsList, (column2, columnIndex) => {
|
|
442
450
|
return openBlock(), createElementBlock("view", {
|
|
443
451
|
class: "nut-picker__columnitem",
|
|
444
452
|
key: columnIndex
|
|
445
453
|
}, [
|
|
446
454
|
createVNode(_component_nut_picker_column, {
|
|
447
455
|
itemShow: _ctx.show,
|
|
448
|
-
|
|
456
|
+
column: column2,
|
|
449
457
|
readonly: _ctx.readonly,
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
_ctx.changeHandler(columnIndex, dataIndex);
|
|
458
|
+
columnsType: _ctx.columnsType,
|
|
459
|
+
value: _ctx.defaultValues[columnIndex],
|
|
460
|
+
onChange: (option) => {
|
|
461
|
+
_ctx.changeHandler(columnIndex, option);
|
|
455
462
|
}
|
|
456
|
-
}, null, 8, ["itemShow", "
|
|
463
|
+
}, null, 8, ["itemShow", "column", "readonly", "columnsType", "value", "onChange"])
|
|
457
464
|
]);
|
|
458
465
|
}), 128))
|
|
459
466
|
])
|
|
460
467
|
]),
|
|
461
468
|
_: 1
|
|
462
|
-
}, 8, ["visible", "teleport", "lock-scroll", "close-on-click-overlay", "onClose"])
|
|
469
|
+
}, 8, ["visible", "teleport", "lock-scroll", "close-on-click-overlay", "onClose", "isWrapTeleport"])
|
|
463
470
|
], 2);
|
|
464
471
|
}
|
|
465
472
|
var picker = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
@@ -18,8 +18,8 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
22
|
-
* (c)
|
|
21
|
+
* @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
|
|
22
|
+
* (c) 2022 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
25
25
|
import { ref, reactive, toRefs, computed, onMounted, watch, resolveComponent, openBlock, createElementBlock, withModifiers, normalizeClass, createElementVNode, renderSlot, Fragment, normalizeStyle, renderList, createVNode, createCommentVNode, toDisplayString } from "vue";
|
|
@@ -138,6 +138,9 @@ const _sfc_main = create({
|
|
|
138
138
|
emit("update:visible", false);
|
|
139
139
|
};
|
|
140
140
|
const chooseItem = (item, index2) => {
|
|
141
|
+
if (item.disabled) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
141
144
|
emit("choose", item, index2);
|
|
142
145
|
};
|
|
143
146
|
return {
|
|
@@ -18,8 +18,8 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
22
|
-
* (c)
|
|
21
|
+
* @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
|
|
22
|
+
* (c) 2022 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
25
25
|
import { reactive, computed, onMounted, onBeforeUnmount, onBeforeMount, onActivated, onDeactivated, watch, toRefs, resolveComponent, openBlock, createBlock, Teleport, normalizeClass, normalizeStyle, createCommentVNode, createVNode, Transition, withCtx, withDirectives, createElementVNode, renderSlot, createElementBlock, vShow } from "vue";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
3
|
-
* (c)
|
|
2
|
+
* @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { computed, openBlock, createElementBlock, normalizeClass, createCommentVNode, createElementVNode, toDisplayString } from "vue";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
3
|
-
* (c)
|
|
2
|
+
* @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { ref, computed,
|
|
6
|
+
import { ref, computed, onMounted, resolveComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, normalizeStyle, toDisplayString, createCommentVNode, createBlock } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
8
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
const { create } = createComponent("progress");
|
|
@@ -42,6 +42,10 @@ const _sfc_main = create({
|
|
|
42
42
|
tyep: String,
|
|
43
43
|
default: ""
|
|
44
44
|
},
|
|
45
|
+
textBackground: {
|
|
46
|
+
tyep: String,
|
|
47
|
+
default: ""
|
|
48
|
+
},
|
|
45
49
|
iconName: {
|
|
46
50
|
type: String,
|
|
47
51
|
default: "checked"
|
|
@@ -59,7 +63,6 @@ const _sfc_main = create({
|
|
|
59
63
|
const height = ref(props.strokeWidth + "px");
|
|
60
64
|
const progressOuter = ref();
|
|
61
65
|
const insideText = ref();
|
|
62
|
-
const left = ref();
|
|
63
66
|
const bgStyle = computed(() => {
|
|
64
67
|
return {
|
|
65
68
|
width: props.percentage + "%",
|
|
@@ -71,30 +74,14 @@ const _sfc_main = create({
|
|
|
71
74
|
color: props.textColor || ""
|
|
72
75
|
};
|
|
73
76
|
});
|
|
74
|
-
const slideLeft = (values) => {
|
|
75
|
-
if (props.textInside) {
|
|
76
|
-
let offsetWidth = progressOuter.value.offsetWidth;
|
|
77
|
-
let percentageWidth = progressOuter.value.offsetWidth * Number(values) * 0.01;
|
|
78
|
-
let insideTextWidth = insideText.value.offsetWidth;
|
|
79
|
-
left.value = percentageWidth - 5 + "px";
|
|
80
|
-
if (offsetWidth == percentageWidth) {
|
|
81
|
-
left.value = percentageWidth - insideTextWidth + "px";
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
watch(() => props.percentage, (values) => {
|
|
86
|
-
slideLeft(values);
|
|
87
|
-
});
|
|
88
77
|
onMounted(() => {
|
|
89
|
-
slideLeft(props.percentage);
|
|
90
78
|
});
|
|
91
79
|
return {
|
|
92
80
|
height,
|
|
93
81
|
bgStyle,
|
|
94
82
|
textStyle,
|
|
95
83
|
progressOuter,
|
|
96
|
-
insideText
|
|
97
|
-
left
|
|
84
|
+
insideText
|
|
98
85
|
};
|
|
99
86
|
}
|
|
100
87
|
});
|
|
@@ -115,7 +102,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
115
102
|
key: 0,
|
|
116
103
|
class: "nut-progress-text nut-progress-insidetext",
|
|
117
104
|
ref: "insideText",
|
|
118
|
-
style: normalizeStyle({
|
|
105
|
+
style: normalizeStyle({
|
|
106
|
+
lineHeight: _ctx.height,
|
|
107
|
+
left: `${_ctx.percentage}%`,
|
|
108
|
+
transform: `translate(-${+_ctx.percentage}%,-50%)`,
|
|
109
|
+
background: _ctx.textBackground || _ctx.strokeColor
|
|
110
|
+
})
|
|
119
111
|
}, [
|
|
120
112
|
createElementVNode("span", {
|
|
121
113
|
style: normalizeStyle(_ctx.textStyle)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
3
|
-
* (c)
|
|
2
|
+
* @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { inject, computed, h } from "vue";
|
|
@@ -32,7 +32,7 @@ const _sfc_main = create({
|
|
|
32
32
|
},
|
|
33
33
|
iconSize: {
|
|
34
34
|
type: [String, Number],
|
|
35
|
-
default:
|
|
35
|
+
default: ""
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
setup(props, { emit, slots }) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
3
|
-
* (c)
|
|
2
|
+
* @nutui/nutui v3.1.18 Fri Mar 25 2022 15:02:08 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { provide, readonly, computed, watch, h } from "vue";
|