@nutui/nutui 3.1.22-beta.0 → 3.1.22-beta.3
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/dist/nutui.es.js +4019 -19251
- package/dist/nutui.umd.js +4012 -19344
- package/dist/packages/_es/ActionSheet.js +26 -157
- package/dist/packages/_es/Address.js +119 -542
- package/dist/packages/_es/AddressList.js +113 -613
- package/dist/packages/_es/Audio.js +62 -264
- package/dist/packages/_es/AudioOperate.js +18 -107
- package/dist/packages/_es/Avatar.js +42 -165
- package/dist/packages/_es/AvatarGroup.js +14 -73
- package/dist/packages/_es/BackTop.js +43 -156
- package/dist/packages/_es/Badge.js +14 -86
- package/dist/packages/_es/Barrage.js +41 -120
- package/dist/packages/_es/Button.js +23 -128
- package/dist/packages/_es/Calendar.js +24 -237
- package/dist/packages/_es/CalendarItem.js +1 -1
- package/dist/packages/_es/Card.js +10 -107
- package/dist/packages/_es/Cascader.js +156 -500
- package/dist/packages/_es/Category.js +15 -58
- package/dist/packages/_es/CategoryPane.js +11 -111
- package/dist/packages/_es/Cell.js +21 -100
- package/dist/packages/_es/CellGroup.js +9 -44
- package/dist/packages/_es/Checkbox.js +31 -113
- package/dist/packages/_es/CheckboxGroup.js +29 -58
- package/dist/packages/_es/CircleProgress.js +28 -151
- package/dist/packages/_es/Col.js +14 -56
- package/dist/packages/_es/Collapse.js +24 -85
- package/dist/packages/_es/CollapseItem.js +70 -261
- package/dist/packages/_es/Comment.js +64 -434
- package/dist/packages/_es/CountDown.js +61 -242
- package/dist/packages/_es/CountUp.js +149 -546
- package/dist/packages/_es/DatePicker.js +107 -322
- package/dist/packages/_es/Dialog.js +69 -261
- package/dist/packages/_es/Divider.js +18 -68
- package/dist/packages/_es/Drag.js +56 -197
- package/dist/packages/_es/Ecard.js +24 -159
- package/dist/packages/_es/Elevator.js +63 -198
- package/dist/packages/_es/Empty.js +12 -71
- package/dist/packages/_es/FixedNav.js +15 -122
- package/dist/packages/_es/Form.js +64 -151
- package/dist/packages/_es/FormItem.js +15 -110
- package/dist/packages/_es/Grid.js +5 -6
- package/dist/packages/_es/GridItem.js +33 -144
- package/dist/packages/_es/Icon.js +15 -40
- package/dist/packages/_es/ImagePreview.js +74 -298
- package/dist/packages/_es/Indicator.js +15 -62
- package/dist/packages/_es/InfiniteLoading.js +66 -258
- package/dist/packages/_es/Input.js +51 -413
- package/dist/packages/_es/InputNumber.js +41 -160
- package/dist/packages/_es/Layout.js +4 -5
- package/dist/packages/_es/List.js +23 -110
- package/dist/packages/_es/Menu.js +30 -118
- package/dist/packages/_es/MenuItem.js +34 -162
- package/dist/packages/_es/Navbar.js +30 -192
- package/dist/packages/_es/NoticeBar.js +83 -387
- package/dist/packages/_es/Notify.js +81 -236
- package/dist/packages/_es/NumberKeyboard.js +41 -272
- package/dist/packages/_es/OldPicker.js +140 -464
- package/dist/packages/_es/OverLay.js +32 -105
- package/dist/packages/_es/Pagination.js +39 -157
- package/dist/packages/_es/Picker.js +138 -459
- package/dist/packages/_es/Popover.js +327 -965
- package/dist/packages/_es/Popup.js +64 -303
- package/dist/packages/_es/Price.js +16 -118
- package/dist/packages/_es/Progress.js +14 -146
- package/dist/packages/_es/PullRefresh.js +92 -346
- package/dist/packages/_es/Radio.js +22 -90
- package/dist/packages/_es/RadioGroup.js +8 -37
- package/dist/packages/_es/Range.js +92 -417
- package/dist/packages/_es/Rate.js +16 -139
- package/dist/packages/_es/Row.js +22 -64
- package/dist/packages/_es/SearchBar.js +46 -247
- package/dist/packages/_es/ShortPassword.js +35 -225
- package/dist/packages/_es/SideNavBar.js +33 -89
- package/dist/packages/_es/SideNavBarItem.js +11 -46
- package/dist/packages/_es/Signature.js +46 -165
- package/dist/packages/_es/Skeleton.js +20 -136
- package/dist/packages/_es/Sku.js +93 -499
- package/dist/packages/_es/Step.js +25 -119
- package/dist/packages/_es/Steps.js +18 -53
- package/dist/packages/_es/Sticky.js +53 -138
- package/dist/packages/_es/SubSideNavBar.js +26 -90
- package/dist/packages/_es/Swipe.js +46 -183
- package/dist/packages/_es/Swiper.js +121 -433
- package/dist/packages/_es/SwiperItem.js +22 -53
- package/dist/packages/_es/Switch.js +21 -116
- package/dist/packages/_es/TabPane.js +12 -39
- package/dist/packages/_es/Tabbar.js +17 -72
- package/dist/packages/_es/TabbarItem.js +29 -151
- package/dist/packages/_es/Table.js +27 -186
- package/dist/packages/_es/Tabs.js +51 -209
- package/dist/packages/_es/Tag.js +20 -97
- package/dist/packages/_es/TextArea.js +42 -160
- package/dist/packages/_es/TimeDetail.js +23 -84
- package/dist/packages/_es/TimePannel.js +19 -52
- package/dist/packages/_es/TimeSelect.js +15 -103
- package/dist/packages/_es/Toast.js +80 -319
- package/dist/packages/_es/Uploader.js +112 -460
- package/dist/packages/_es/Video.js +83 -340
- package/dist/packages/_es/common.js +38 -128
- package/dist/packages/_es/component.js +35 -76
- package/dist/packages/_es/index.js +5 -6
- package/dist/packages/_es/index2.js +9 -30
- package/dist/packages/_es/index3.js +6 -8
- package/dist/packages/_es/index4.js +13 -58
- package/dist/packages/_es/index5.js +120 -675
- package/dist/packages/_es/plugin-vue_export-helper.js +7 -8
- package/dist/packages/_es/pxCheck.js +3 -5
- package/dist/packages/_es/raf.js +8 -15
- package/dist/packages/button/index.scss +2 -1
- package/dist/packages/cell/index.scss +11 -0
- package/dist/packages/checkbox/index.scss +6 -0
- package/dist/packages/dialog/index.scss +1 -0
- package/dist/packages/elevator/index.scss +21 -0
- package/dist/packages/input/index.scss +13 -1
- package/dist/packages/locale/lang/baseLang.d.ts +1 -0
- package/dist/packages/locale/lang/baseLang.js +3 -3
- package/dist/packages/locale/lang/en-US.d.ts +8 -0
- package/dist/packages/locale/lang/en-US.js +5 -97
- package/dist/packages/locale/lang/id-ID.d.ts +8 -0
- package/dist/packages/locale/lang/id-ID.js +5 -97
- package/dist/packages/locale/lang/index.js +16 -38
- package/dist/packages/locale/lang/zh-CN.d.ts +8 -0
- package/dist/packages/locale/lang/zh-CN.js +5 -97
- package/dist/packages/locale/lang/zh-TW.d.ts +8 -0
- package/dist/packages/locale/lang/zh-TW.js +5 -97
- package/dist/packages/radio/index.scss +1 -0
- package/dist/packages/switch/index.scss +3 -3
- package/dist/packages/tabpane/index.scss +1 -0
- package/dist/smartips/attributes.json +62 -10
- package/dist/smartips/tags.json +17 -4
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +49 -49
- package/dist/styles/themes/jdb.scss +49 -49
- package/dist/styles/themes/jdt.scss +49 -49
- package/dist/styles/variables-jdb.scss +10 -1
- package/dist/styles/variables-jdt.scss +10 -1
- package/dist/styles/variables.scss +10 -1
- package/dist/types/__VUE/address/index.vue.d.ts +5 -5
- package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +1 -0
- package/dist/types/__VUE/audiooperate/index.vue.d.ts +1 -0
- package/dist/types/__VUE/avatar/index.vue.d.ts +4 -4
- package/dist/types/__VUE/backtop/index.vue.d.ts +2 -2
- package/dist/types/__VUE/badge/index.vue.d.ts +2 -2
- package/dist/types/__VUE/button/index.vue.d.ts +2 -2
- package/dist/types/__VUE/cascader/index.vue.d.ts +1 -1
- package/dist/types/__VUE/cell/index.vue.d.ts +11 -4
- package/dist/types/__VUE/checkbox/common.d.ts +59 -0
- package/dist/types/__VUE/checkbox/index.vue.d.ts +18 -5
- package/dist/types/__VUE/checkboxgroup/index.vue.d.ts +7 -0
- package/dist/types/__VUE/collapseitem/index.vue.d.ts +2 -2
- package/dist/types/__VUE/dialog/index.d.ts +9 -2
- package/dist/types/__VUE/dialog/index.vue.d.ts +23 -8
- package/dist/types/__VUE/ecard/index.vue.d.ts +3 -3
- package/dist/types/__VUE/elevator/index.vue.d.ts +29 -0
- package/dist/types/__VUE/empty/index.vue.d.ts +2 -2
- package/dist/types/__VUE/formitem/index.vue.d.ts +3 -10
- package/dist/types/__VUE/grid/index.vue.d.ts +4 -4
- package/dist/types/__VUE/griditem/index.vue.d.ts +1 -1
- package/dist/types/__VUE/input/index.vue.d.ts +2 -2
- package/dist/types/__VUE/noticebar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/oldpicker/index.vue.d.ts +2 -2
- package/dist/types/__VUE/picker/index.vue.d.ts +2 -2
- package/dist/types/__VUE/popover/index.vue.d.ts +2 -2
- package/dist/types/__VUE/range/index.vue.d.ts +1 -1
- package/dist/types/__VUE/rate/index.vue.d.ts +2 -2
- package/dist/types/__VUE/row/index.vue.d.ts +2 -2
- package/dist/types/__VUE/shortpassword/index.vue.d.ts +2 -2
- package/dist/types/__VUE/step/index.vue.d.ts +2 -2
- package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
- package/dist/types/__VUE/tabbaritem/index.vue.d.ts +2 -2
- package/dist/types/__VUE/timeselect/index.vue.d.ts +9 -2
- package/dist/types/__VUE/toast/index.vue.d.ts +3 -3
- package/dist/types/__VUE/uploader/index.vue.d.ts +2 -2
- package/dist/types/__VUE/video/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -1
|
@@ -1,165 +1,46 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.22-beta.
|
|
2
|
+
* @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createVNode, createElementVNode } from "vue";
|
|
7
|
-
import { c as
|
|
8
|
-
import { p as
|
|
9
|
-
import { _ as
|
|
6
|
+
import { computed as e, resolveComponent as u, openBlock as l, createElementBlock as t, normalizeClass as a, normalizeStyle as n, createVNode as r, createElementVNode as d } from "vue";
|
|
7
|
+
import { c as i } from "./component.js";
|
|
8
|
+
import { p as m } from "./pxCheck.js";
|
|
9
|
+
import { _ as o } from "./plugin-vue_export-helper.js";
|
|
10
10
|
import "../locale/lang";
|
|
11
|
-
const { componentName, create } =
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
modelValue
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
type: Boolean,
|
|
48
|
-
default: false
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
emits: ["update:modelValue", "change", "blur", "focus", "reduce", "add", "overlimit"],
|
|
52
|
-
setup(props, { emit }) {
|
|
53
|
-
const classes = computed(() => {
|
|
54
|
-
const prefixCls = componentName;
|
|
55
|
-
return {
|
|
56
|
-
[prefixCls]: true,
|
|
57
|
-
[`${prefixCls}--disabled`]: props.disabled
|
|
58
|
-
};
|
|
59
|
-
});
|
|
60
|
-
const fixedDecimalPlaces = (v) => {
|
|
61
|
-
return Number(v).toFixed(Number(props.decimalPlaces));
|
|
62
|
-
};
|
|
63
|
-
const change = (event) => {
|
|
64
|
-
const input = event.target;
|
|
65
|
-
emit("update:modelValue", input.valueAsNumber, event);
|
|
66
|
-
};
|
|
67
|
-
const emitChange = (value, event) => {
|
|
68
|
-
let output_value = fixedDecimalPlaces(value);
|
|
69
|
-
emit("update:modelValue", output_value, event);
|
|
70
|
-
emit("change", output_value, event);
|
|
71
|
-
};
|
|
72
|
-
const addAllow = (value = Number(props.modelValue)) => {
|
|
73
|
-
return value < Number(props.max) && !props.disabled;
|
|
74
|
-
};
|
|
75
|
-
const reduceAllow = (value = Number(props.modelValue)) => {
|
|
76
|
-
return value > Number(props.min) && !props.disabled;
|
|
77
|
-
};
|
|
78
|
-
const reduce = (event) => {
|
|
79
|
-
emit("reduce", event);
|
|
80
|
-
if (reduceAllow()) {
|
|
81
|
-
let output_value = Number(props.modelValue) - Number(props.step);
|
|
82
|
-
emitChange(output_value, event);
|
|
83
|
-
} else {
|
|
84
|
-
emit("overlimit", event, "reduce");
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
const add = (event) => {
|
|
88
|
-
emit("add", event);
|
|
89
|
-
if (addAllow()) {
|
|
90
|
-
let output_value = Number(props.modelValue) + Number(props.step);
|
|
91
|
-
emitChange(output_value, event);
|
|
92
|
-
} else {
|
|
93
|
-
emit("overlimit", event, "add");
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
const focus = (event) => {
|
|
97
|
-
if (props.disabled)
|
|
98
|
-
return;
|
|
99
|
-
if (props.readonly)
|
|
100
|
-
return;
|
|
101
|
-
emit("focus", event);
|
|
102
|
-
};
|
|
103
|
-
const blur = (event) => {
|
|
104
|
-
if (props.disabled)
|
|
105
|
-
return;
|
|
106
|
-
if (props.readonly)
|
|
107
|
-
return;
|
|
108
|
-
const input = event.target;
|
|
109
|
-
let value = input.valueAsNumber;
|
|
110
|
-
if (value < Number(props.min)) {
|
|
111
|
-
value = Number(props.min);
|
|
112
|
-
} else if (value > Number(props.max)) {
|
|
113
|
-
value = Number(props.max);
|
|
114
|
-
}
|
|
115
|
-
emitChange(value, event);
|
|
116
|
-
emit("blur", event);
|
|
117
|
-
};
|
|
118
|
-
return {
|
|
119
|
-
classes,
|
|
120
|
-
change,
|
|
121
|
-
blur,
|
|
122
|
-
focus,
|
|
123
|
-
add,
|
|
124
|
-
addAllow,
|
|
125
|
-
reduce,
|
|
126
|
-
reduceAllow,
|
|
127
|
-
pxCheck
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
const _hoisted_1 = ["min", "max", "disabled", "readonly", "value"];
|
|
132
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
133
|
-
const _component_nut_icon = resolveComponent("nut-icon");
|
|
134
|
-
return openBlock(), createElementBlock("view", {
|
|
135
|
-
class: normalizeClass(_ctx.classes),
|
|
136
|
-
style: normalizeStyle({ height: _ctx.pxCheck(_ctx.buttonSize) })
|
|
137
|
-
}, [
|
|
138
|
-
createVNode(_component_nut_icon, {
|
|
139
|
-
name: "minus",
|
|
140
|
-
class: normalizeClass(["nut-inputnumber__icon", { "nut-inputnumber__icon--disabled": !_ctx.reduceAllow() }]),
|
|
141
|
-
size: _ctx.buttonSize,
|
|
142
|
-
onClick: _ctx.reduce
|
|
143
|
-
}, null, 8, ["class", "size", "onClick"]),
|
|
144
|
-
createElementVNode("input", {
|
|
145
|
-
type: "number",
|
|
146
|
-
min: _ctx.min,
|
|
147
|
-
max: _ctx.max,
|
|
148
|
-
style: normalizeStyle({ width: _ctx.pxCheck(_ctx.inputWidth) }),
|
|
149
|
-
disabled: _ctx.disabled,
|
|
150
|
-
readonly: _ctx.readonly,
|
|
151
|
-
value: _ctx.modelValue,
|
|
152
|
-
onInput: _cache[0] || (_cache[0] = (...args) => _ctx.change && _ctx.change(...args)),
|
|
153
|
-
onBlur: _cache[1] || (_cache[1] = (...args) => _ctx.blur && _ctx.blur(...args)),
|
|
154
|
-
onFocus: _cache[2] || (_cache[2] = (...args) => _ctx.focus && _ctx.focus(...args))
|
|
155
|
-
}, null, 44, _hoisted_1),
|
|
156
|
-
createVNode(_component_nut_icon, {
|
|
157
|
-
name: "plus",
|
|
158
|
-
class: normalizeClass(["nut-inputnumber__icon", { "nut-inputnumber__icon--disabled": !_ctx.addAllow() }]),
|
|
159
|
-
size: _ctx.buttonSize,
|
|
160
|
-
onClick: _ctx.add
|
|
161
|
-
}, null, 8, ["class", "size", "onClick"])
|
|
162
|
-
], 6);
|
|
163
|
-
}
|
|
164
|
-
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
165
|
-
export { index as default };
|
|
11
|
+
const { componentName: s, create: c } = i("inputnumber"), b = c({ props: { modelValue: { type: [Number, String], default: 0 }, inputWidth: { type: [Number, String], default: "" }, buttonSize: { type: [Number, String], default: "" }, min: { type: [Number, String], default: 1 }, max: { type: [Number, String], default: 9999 }, step: { type: [Number, String], default: 1 }, decimalPlaces: { type: [Number, String], default: 0 }, disabled: { type: Boolean, default: false }, readonly: { type: Boolean, default: false } }, emits: ["update:modelValue", "change", "blur", "focus", "reduce", "add", "overlimit"], setup(u2, { emit: l2 }) {
|
|
12
|
+
const t2 = e(() => ({ [s]: true, [`${s}--disabled`]: u2.disabled })), a2 = (e2, t3) => {
|
|
13
|
+
let a3 = Number(e2).toFixed(Number(u2.decimalPlaces));
|
|
14
|
+
l2("update:modelValue", a3, t3), l2("change", a3, t3);
|
|
15
|
+
}, n2 = (e2 = Number(u2.modelValue)) => e2 < Number(u2.max) && !u2.disabled, r2 = (e2 = Number(u2.modelValue)) => e2 > Number(u2.min) && !u2.disabled;
|
|
16
|
+
return { classes: t2, change: (e2) => {
|
|
17
|
+
const u3 = e2.target;
|
|
18
|
+
l2("update:modelValue", u3.valueAsNumber, e2);
|
|
19
|
+
}, blur: (e2) => {
|
|
20
|
+
if (u2.disabled)
|
|
21
|
+
return;
|
|
22
|
+
if (u2.readonly)
|
|
23
|
+
return;
|
|
24
|
+
let t3 = e2.target.valueAsNumber;
|
|
25
|
+
t3 < Number(u2.min) ? t3 = Number(u2.min) : t3 > Number(u2.max) && (t3 = Number(u2.max)), a2(t3, e2), l2("blur", e2);
|
|
26
|
+
}, focus: (e2) => {
|
|
27
|
+
u2.disabled || u2.readonly || l2("focus", e2);
|
|
28
|
+
}, add: (e2) => {
|
|
29
|
+
if (l2("add", e2), n2()) {
|
|
30
|
+
let l3 = Number(u2.modelValue) + Number(u2.step);
|
|
31
|
+
a2(l3, e2);
|
|
32
|
+
} else
|
|
33
|
+
l2("overlimit", e2, "add");
|
|
34
|
+
}, addAllow: n2, reduce: (e2) => {
|
|
35
|
+
if (l2("reduce", e2), r2()) {
|
|
36
|
+
let l3 = Number(u2.modelValue) - Number(u2.step);
|
|
37
|
+
a2(l3, e2);
|
|
38
|
+
} else
|
|
39
|
+
l2("overlimit", e2, "reduce");
|
|
40
|
+
}, reduceAllow: r2, pxCheck: m };
|
|
41
|
+
} }), p = ["min", "max", "disabled", "readonly", "value"];
|
|
42
|
+
var f = o(b, [["render", function(e2, i2, m2, o2, s2, c2) {
|
|
43
|
+
const b2 = u("nut-icon");
|
|
44
|
+
return l(), t("view", { class: a(e2.classes), style: n({ height: e2.pxCheck(e2.buttonSize) }) }, [r(b2, { name: "minus", class: a(["nut-inputnumber__icon", { "nut-inputnumber__icon--disabled": !e2.reduceAllow() }]), size: e2.buttonSize, onClick: e2.reduce }, null, 8, ["class", "size", "onClick"]), d("input", { type: "number", min: e2.min, max: e2.max, style: n({ width: e2.pxCheck(e2.inputWidth) }), disabled: e2.disabled, readonly: e2.readonly, value: e2.modelValue, onInput: i2[0] || (i2[0] = (...u2) => e2.change && e2.change(...u2)), onBlur: i2[1] || (i2[1] = (...u2) => e2.blur && e2.blur(...u2)), onFocus: i2[2] || (i2[2] = (...u2) => e2.focus && e2.focus(...u2)) }, null, 44, p), r(b2, { name: "plus", class: a(["nut-inputnumber__icon", { "nut-inputnumber__icon--disabled": !e2.addAllow() }]), size: e2.buttonSize, onClick: e2.add }, null, 8, ["class", "size", "onClick"])], 6);
|
|
45
|
+
}]]);
|
|
46
|
+
export { f as default };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.22-beta.
|
|
2
|
+
* @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { c as
|
|
6
|
+
import { c as o } from "./component.js";
|
|
7
7
|
import "vue";
|
|
8
8
|
import "../locale/lang";
|
|
9
|
-
const { create } =
|
|
10
|
-
|
|
11
|
-
export { _sfc_main as default };
|
|
9
|
+
const { create: t } = o("layout"), a = t({});
|
|
10
|
+
export { a as default };
|
|
@@ -5,125 +5,38 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
6
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
7
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (
|
|
8
|
+
var __spreadValues = (a2, b) => {
|
|
9
9
|
for (var prop in b || (b = {}))
|
|
10
10
|
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(
|
|
11
|
+
__defNormalProp(a2, prop, b[prop]);
|
|
12
12
|
if (__getOwnPropSymbols)
|
|
13
13
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
14
|
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(
|
|
15
|
+
__defNormalProp(a2, prop, b[prop]);
|
|
16
16
|
}
|
|
17
|
-
return
|
|
17
|
+
return a2;
|
|
18
18
|
};
|
|
19
|
-
var __spreadProps = (
|
|
19
|
+
var __spreadProps = (a2, b) => __defProps(a2, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.22-beta.
|
|
21
|
+
* @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
|
|
22
22
|
* (c) 2022 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
25
|
-
import { ref, reactive, computed, watch, toRefs, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, Fragment, renderList, renderSlot } from "vue";
|
|
26
|
-
import { c as
|
|
27
|
-
import { _ as
|
|
25
|
+
import { ref as t, reactive as e, computed as l, watch as s, toRefs as i, openBlock as a, createElementBlock as r, normalizeClass as n, createElementVNode as o, normalizeStyle as c, Fragment as h, renderList as m, renderSlot as u } from "vue";
|
|
26
|
+
import { c as g } from "./component.js";
|
|
27
|
+
import { _ as p } from "./plugin-vue_export-helper.js";
|
|
28
28
|
import "../locale/lang";
|
|
29
|
-
const { componentName, create } =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
type: [Number],
|
|
44
|
-
default: document.documentElement.clientHeight || document.body.clientHeight || 667
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
emits: ["scroll", "scroll-bottom"],
|
|
48
|
-
setup(props, { emit }) {
|
|
49
|
-
const list = ref(null);
|
|
50
|
-
const state = reactive({
|
|
51
|
-
startOffset: 0,
|
|
52
|
-
start: 0,
|
|
53
|
-
list: props.listData.slice()
|
|
54
|
-
});
|
|
55
|
-
const visibleCount = computed(() => {
|
|
56
|
-
return Math.ceil(props.containerHeight / props.height);
|
|
57
|
-
});
|
|
58
|
-
const end = computed(() => {
|
|
59
|
-
return state.start + visibleCount.value;
|
|
60
|
-
});
|
|
61
|
-
const getTransform = computed(() => {
|
|
62
|
-
return `translate3d(0, ${state.startOffset}px, 0)`;
|
|
63
|
-
});
|
|
64
|
-
const classes = computed(() => {
|
|
65
|
-
const prefixCls = componentName;
|
|
66
|
-
return {
|
|
67
|
-
[prefixCls]: true
|
|
68
|
-
};
|
|
69
|
-
});
|
|
70
|
-
const listHeight = computed(() => {
|
|
71
|
-
return state.list.length * props.height;
|
|
72
|
-
});
|
|
73
|
-
const visibleData = computed(() => {
|
|
74
|
-
return state.list.slice(state.start, Math.min(end.value, state.list.length));
|
|
75
|
-
});
|
|
76
|
-
const handleScrollEvent = () => {
|
|
77
|
-
var _a;
|
|
78
|
-
const scrollTop = (_a = list.value) == null ? void 0 : _a.scrollTop;
|
|
79
|
-
state.start = Math.floor(scrollTop / props.height);
|
|
80
|
-
if (end.value > state.list.length) {
|
|
81
|
-
emit("scroll");
|
|
82
|
-
emit("scroll-bottom");
|
|
83
|
-
}
|
|
84
|
-
state.startOffset = scrollTop - scrollTop % props.height;
|
|
85
|
-
};
|
|
86
|
-
watch(() => props.listData, () => {
|
|
87
|
-
state.list = props.listData.slice();
|
|
88
|
-
});
|
|
89
|
-
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
|
90
|
-
list,
|
|
91
|
-
getTransform,
|
|
92
|
-
listHeight,
|
|
93
|
-
visibleData,
|
|
94
|
-
classes,
|
|
95
|
-
handleScrollEvent
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
100
|
-
return openBlock(), createElementBlock("view", {
|
|
101
|
-
class: normalizeClass(_ctx.classes),
|
|
102
|
-
onScrollPassive: _cache[0] || (_cache[0] = (...args) => _ctx.handleScrollEvent && _ctx.handleScrollEvent(...args)),
|
|
103
|
-
ref: "list"
|
|
104
|
-
}, [
|
|
105
|
-
createElementVNode("div", {
|
|
106
|
-
class: "nut-list-phantom",
|
|
107
|
-
style: normalizeStyle({ height: _ctx.listHeight + "px" })
|
|
108
|
-
}, null, 4),
|
|
109
|
-
createElementVNode("div", {
|
|
110
|
-
class: "nut-list-container",
|
|
111
|
-
style: normalizeStyle({ transform: _ctx.getTransform })
|
|
112
|
-
}, [
|
|
113
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.visibleData, (item, index2) => {
|
|
114
|
-
return openBlock(), createElementBlock("div", {
|
|
115
|
-
class: "nut-list-item",
|
|
116
|
-
style: normalizeStyle({ height: _ctx.height + "px" }),
|
|
117
|
-
key: item
|
|
118
|
-
}, [
|
|
119
|
-
renderSlot(_ctx.$slots, "default", {
|
|
120
|
-
item,
|
|
121
|
-
index: index2
|
|
122
|
-
})
|
|
123
|
-
], 4);
|
|
124
|
-
}), 128))
|
|
125
|
-
], 4)
|
|
126
|
-
], 34);
|
|
127
|
-
}
|
|
128
|
-
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
129
|
-
export { index as default };
|
|
29
|
+
const { componentName: f, create: d } = g("list");
|
|
30
|
+
var v = p(d({ props: { height: { type: [Number], default: 50 }, listData: { type: Array, default: () => [] }, containerHeight: { type: [Number], default: document.documentElement.clientHeight || document.body.clientHeight || 667 } }, emits: ["scroll", "scroll-bottom"], setup(a2, { emit: r2 }) {
|
|
31
|
+
const n2 = t(null), o2 = e({ startOffset: 0, start: 0, list: a2.listData.slice() }), c2 = l(() => Math.ceil(a2.containerHeight / a2.height)), h2 = l(() => o2.start + c2.value), m2 = l(() => `translate3d(0, ${o2.startOffset}px, 0)`), u2 = l(() => ({ [f]: true })), g2 = l(() => o2.list.length * a2.height), p2 = l(() => o2.list.slice(o2.start, Math.min(h2.value, o2.list.length)));
|
|
32
|
+
return s(() => a2.listData, () => {
|
|
33
|
+
o2.list = a2.listData.slice();
|
|
34
|
+
}), __spreadProps(__spreadValues({}, i(o2)), { list: n2, getTransform: m2, listHeight: g2, visibleData: p2, classes: u2, handleScrollEvent: () => {
|
|
35
|
+
var _a;
|
|
36
|
+
const t2 = (_a = n2.value) == null ? void 0 : _a.scrollTop;
|
|
37
|
+
o2.start = Math.floor(t2 / a2.height), h2.value > o2.list.length && (r2("scroll"), r2("scroll-bottom")), o2.startOffset = t2 - t2 % a2.height;
|
|
38
|
+
} });
|
|
39
|
+
} }), [["render", function(t2, e2, l2, s2, i2, g2) {
|
|
40
|
+
return a(), r("view", { class: n(t2.classes), onScrollPassive: e2[0] || (e2[0] = (...e3) => t2.handleScrollEvent && t2.handleScrollEvent(...e3)), ref: "list" }, [o("div", { class: "nut-list-phantom", style: c({ height: t2.listHeight + "px" }) }, null, 4), o("div", { class: "nut-list-container", style: c({ transform: t2.getTransform }) }, [(a(true), r(h, null, m(t2.visibleData, (e3, l3) => (a(), r("div", { class: "nut-list-item", style: c({ height: t2.height + "px" }), key: e3 }, [u(t2.$slots, "default", { item: e3, index: l3 })], 4))), 128))], 4)], 34);
|
|
41
|
+
}]]);
|
|
42
|
+
export { v as default };
|
|
@@ -1,124 +1,36 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.22-beta.
|
|
2
|
+
* @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { ref, computed, reactive, provide, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, normalizeStyle, toDisplayString, createVNode, renderSlot } from "vue";
|
|
7
|
-
import { c as
|
|
8
|
-
import { u as
|
|
9
|
-
import { _ as
|
|
6
|
+
import { ref as e, computed as t, reactive as o, provide as n, resolveComponent as l, openBlock as s, createElementBlock as r, normalizeClass as a, createElementVNode as i, Fragment as u, renderList as c, normalizeStyle as p, toDisplayString as m, createVNode as d, renderSlot as f } from "vue";
|
|
7
|
+
import { c as h } from "./component.js";
|
|
8
|
+
import { u as v } from "./index2.js";
|
|
9
|
+
import { _ as g } from "./plugin-vue_export-helper.js";
|
|
10
10
|
import "../locale/lang";
|
|
11
|
-
const { componentName, create } =
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
type: Boolean,
|
|
28
|
-
default: true
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
setup(props, { emit, slots }) {
|
|
32
|
-
const barRef = ref();
|
|
33
|
-
const offset = ref(0);
|
|
34
|
-
const useChildren = () => {
|
|
35
|
-
const publicChildren = reactive([]);
|
|
36
|
-
const internalChildren = reactive([]);
|
|
37
|
-
const linkChildren2 = (value) => {
|
|
38
|
-
const link = (child) => {
|
|
39
|
-
if (child.proxy) {
|
|
40
|
-
internalChildren.push(child);
|
|
41
|
-
publicChildren.push(child.proxy);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
provide("menuParent", Object.assign({
|
|
45
|
-
link,
|
|
46
|
-
children: publicChildren,
|
|
47
|
-
internalChildren
|
|
48
|
-
}, value));
|
|
49
|
-
};
|
|
50
|
-
return {
|
|
51
|
-
children: publicChildren,
|
|
52
|
-
linkChildren: linkChildren2
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
const { children, linkChildren } = useChildren();
|
|
56
|
-
const opened = computed(() => children.some((item) => item.state.showWrapper));
|
|
57
|
-
const classes = computed(() => {
|
|
58
|
-
const prefixCls = componentName;
|
|
59
|
-
return {
|
|
60
|
-
[prefixCls]: true
|
|
61
|
-
};
|
|
62
|
-
});
|
|
63
|
-
const updateOffset = () => {
|
|
64
|
-
if (barRef.value) {
|
|
65
|
-
const rect = useRect(barRef);
|
|
66
|
-
offset.value = rect.bottom;
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
linkChildren({ props, offset });
|
|
70
|
-
const toggleItem = (active) => {
|
|
71
|
-
children.forEach((item, index2) => {
|
|
72
|
-
if (index2 === active) {
|
|
73
|
-
updateOffset();
|
|
74
|
-
item.toggle();
|
|
75
|
-
} else if (item.state.showPopup) {
|
|
76
|
-
item.toggle(false, { immediate: true });
|
|
11
|
+
const { componentName: _, create: w } = h("menu"), y = w({ props: { activeColor: { type: String, default: "" }, overlay: { type: Boolean, default: true }, duration: { type: [Number, String], default: 0 }, closeOnClickOverlay: { type: Boolean, default: true } }, setup(l2, { emit: s2, slots: r2 }) {
|
|
12
|
+
const a2 = e(), i2 = e(0), { children: u2, linkChildren: c2 } = (() => {
|
|
13
|
+
const e2 = o([]), t2 = o([]);
|
|
14
|
+
return { children: e2, linkChildren: (o2) => {
|
|
15
|
+
n("menuParent", Object.assign({ link: (o3) => {
|
|
16
|
+
o3.proxy && (t2.push(o3), e2.push(o3.proxy));
|
|
17
|
+
}, children: e2, internalChildren: t2 }, o2));
|
|
18
|
+
} };
|
|
19
|
+
})(), p2 = t(() => u2.some((e2) => e2.state.showWrapper)), m2 = t(() => ({ [_]: true }));
|
|
20
|
+
c2({ props: l2, offset: i2 });
|
|
21
|
+
return { toggleItem: (e2) => {
|
|
22
|
+
u2.forEach((t2, o2) => {
|
|
23
|
+
o2 === e2 ? ((() => {
|
|
24
|
+
if (a2.value) {
|
|
25
|
+
const e3 = v(a2);
|
|
26
|
+
i2.value = e3.bottom;
|
|
77
27
|
}
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
const _hoisted_1 = ["onClick"];
|
|
90
|
-
const _hoisted_2 = { class: "nut-menu__title-text" };
|
|
91
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
92
|
-
const _component_nut_icon = resolveComponent("nut-icon");
|
|
93
|
-
return openBlock(), createElementBlock("view", {
|
|
94
|
-
class: normalizeClass(_ctx.classes)
|
|
95
|
-
}, [
|
|
96
|
-
createElementVNode("view", {
|
|
97
|
-
class: normalizeClass(["nut-menu__bar", { opened: _ctx.opened }]),
|
|
98
|
-
ref: "barRef"
|
|
99
|
-
}, [
|
|
100
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.children, (item, index2) => {
|
|
101
|
-
return openBlock(), createElementBlock("view", {
|
|
102
|
-
key: index2,
|
|
103
|
-
class: normalizeClass(["nut-menu__item", { disabled: item.disabled, active: item.state.showPopup }]),
|
|
104
|
-
onClick: ($event) => !item.disabled && _ctx.toggleItem(index2),
|
|
105
|
-
style: normalizeStyle({ color: item.state.showPopup ? _ctx.activeColor : "" })
|
|
106
|
-
}, [
|
|
107
|
-
createElementVNode("view", {
|
|
108
|
-
class: normalizeClass(["nut-menu__title", { active: item.state.showPopup }])
|
|
109
|
-
}, [
|
|
110
|
-
createElementVNode("view", _hoisted_2, toDisplayString(item.renderTitle()), 1),
|
|
111
|
-
createVNode(_component_nut_icon, {
|
|
112
|
-
name: item.titleIcon,
|
|
113
|
-
size: "10",
|
|
114
|
-
class: "nut-menu__title-icon"
|
|
115
|
-
}, null, 8, ["name"])
|
|
116
|
-
], 2)
|
|
117
|
-
], 14, _hoisted_1);
|
|
118
|
-
}), 128))
|
|
119
|
-
], 2),
|
|
120
|
-
renderSlot(_ctx.$slots, "default")
|
|
121
|
-
], 2);
|
|
122
|
-
}
|
|
123
|
-
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
124
|
-
export { index as default };
|
|
28
|
+
})(), t2.toggle()) : t2.state.showPopup && t2.toggle(false, { immediate: true });
|
|
29
|
+
});
|
|
30
|
+
}, children: u2, opened: p2, classes: m2, barRef: a2 };
|
|
31
|
+
} }), b = ["onClick"], C = { class: "nut-menu__title-text" };
|
|
32
|
+
var k = g(y, [["render", function(e2, t2, o2, n2, h2, v2) {
|
|
33
|
+
const g2 = l("nut-icon");
|
|
34
|
+
return s(), r("view", { class: a(e2.classes) }, [i("view", { class: a(["nut-menu__bar", { opened: e2.opened }]), ref: "barRef" }, [(s(true), r(u, null, c(e2.children, (t3, o3) => (s(), r("view", { key: o3, class: a(["nut-menu__item", { disabled: t3.disabled, active: t3.state.showPopup }]), onClick: (n3) => !t3.disabled && e2.toggleItem(o3), style: p({ color: t3.state.showPopup ? e2.activeColor : "" }) }, [i("view", { class: a(["nut-menu__title", { active: t3.state.showPopup }]) }, [i("view", C, m(t3.renderTitle()), 1), d(g2, { name: t3.titleIcon, size: "10", class: "nut-menu__title-icon" }, null, 8, ["name"])], 2)], 14, b))), 128))], 2), f(e2.$slots, "default")], 2);
|
|
35
|
+
}]]);
|
|
36
|
+
export { k as default };
|