@nutui/nutui 3.1.22-beta.5 → 3.1.23-beta.1
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 +48 -0
- package/README.md +3 -4
- package/dist/nutui.es.js +20412 -4214
- package/dist/nutui.umd.js +20518 -4216
- package/dist/packages/_es/ActionSheet.js +149 -17
- package/dist/packages/_es/Address.js +535 -110
- package/dist/packages/_es/AddressList.js +615 -113
- package/dist/packages/_es/Animate.js +59 -17
- package/dist/packages/_es/Audio.js +257 -53
- package/dist/packages/_es/AudioOperate.js +100 -13
- package/dist/packages/_es/Avatar.js +162 -38
- package/dist/packages/_es/AvatarGroup.js +73 -14
- package/dist/packages/_es/BackTop.js +156 -43
- package/dist/packages/_es/Badge.js +86 -14
- package/dist/packages/_es/Barrage.js +120 -41
- package/dist/packages/_es/Button.js +128 -23
- package/dist/packages/_es/Calendar.js +246 -30
- package/dist/packages/_es/CalendarItem.js +1 -1
- package/dist/packages/_es/Card.js +107 -10
- package/dist/packages/_es/Cascader.js +496 -147
- package/dist/packages/_es/Category.js +58 -15
- package/dist/packages/_es/CategoryPane.js +111 -11
- package/dist/packages/_es/Cell.js +108 -21
- package/dist/packages/_es/CellGroup.js +44 -9
- package/dist/packages/_es/Checkbox.js +134 -29
- package/dist/packages/_es/CheckboxGroup.js +79 -29
- package/dist/packages/_es/CircleProgress.js +150 -28
- package/dist/packages/_es/Col.js +56 -14
- package/dist/packages/_es/Collapse.js +109 -32
- package/dist/packages/_es/CollapseItem.js +253 -59
- package/dist/packages/_es/Comment.js +434 -64
- package/dist/packages/_es/ConfigProvider.js +20 -8
- package/dist/packages/_es/CountDown.js +238 -56
- package/dist/packages/_es/CountUp.js +539 -140
- package/dist/packages/_es/DatePicker.js +315 -98
- package/dist/packages/_es/Dialog.js +289 -60
- package/dist/packages/_es/Divider.js +65 -13
- package/dist/packages/_es/Drag.js +197 -56
- package/dist/packages/_es/Ecard.js +159 -24
- package/dist/packages/_es/Elevator.js +255 -58
- package/dist/packages/_es/Ellipsis.js +200 -58
- package/dist/packages/_es/Empty.js +71 -12
- package/dist/packages/_es/FixedNav.js +122 -15
- package/dist/packages/_es/Form.js +151 -64
- package/dist/packages/_es/FormItem.js +114 -15
- package/dist/packages/_es/Grid.js +6 -5
- package/dist/packages/_es/GridItem.js +144 -33
- package/dist/packages/_es/Icon.js +40 -15
- package/dist/packages/_es/Image.js +137 -26
- package/dist/packages/_es/ImagePreview.js +547 -76
- package/dist/packages/_es/Indicator.js +62 -15
- package/dist/packages/_es/InfiniteLoading.js +249 -57
- package/dist/packages/_es/Input.js +433 -51
- package/dist/packages/_es/InputNumber.js +160 -41
- package/dist/packages/_es/Layout.js +5 -4
- package/dist/packages/_es/List.js +106 -18
- package/dist/packages/_es/Menu.js +168 -44
- package/dist/packages/_es/MenuItem.js +173 -37
- package/dist/packages/_es/Navbar.js +192 -30
- package/dist/packages/_es/NoticeBar.js +380 -74
- package/dist/packages/_es/Notify.js +227 -72
- package/dist/packages/_es/NumberKeyboard.js +272 -41
- package/dist/packages/_es/OldPicker.js +457 -130
- package/dist/packages/_es/OverLay.js +98 -24
- package/dist/packages/_es/Pagination.js +157 -39
- package/dist/packages/_es/Picker.js +454 -129
- package/dist/packages/_es/Popover.js +957 -318
- package/dist/packages/_es/Popup.js +299 -55
- package/dist/packages/_es/Price.js +118 -16
- package/dist/packages/_es/Progress.js +146 -14
- package/dist/packages/_es/PullRefresh.js +339 -84
- package/dist/packages/_es/Radio.js +90 -22
- package/dist/packages/_es/RadioGroup.js +37 -8
- package/dist/packages/_es/Range.js +408 -83
- package/dist/packages/_es/Rate.js +192 -36
- package/dist/packages/_es/Row.js +64 -22
- package/dist/packages/_es/SearchBar.js +238 -37
- package/dist/packages/_es/ShortPassword.js +225 -35
- package/dist/packages/_es/SideNavBar.js +81 -24
- package/dist/packages/_es/SideNavBarItem.js +46 -11
- package/dist/packages/_es/Signature.js +160 -41
- package/dist/packages/_es/Skeleton.js +136 -20
- package/dist/packages/_es/Sku.js +491 -84
- package/dist/packages/_es/Step.js +115 -20
- package/dist/packages/_es/Steps.js +53 -18
- package/dist/packages/_es/Sticky.js +138 -53
- package/dist/packages/_es/SubSideNavBar.js +82 -17
- package/dist/packages/_es/Swipe.js +178 -41
- package/dist/packages/_es/Swiper.js +433 -121
- package/dist/packages/_es/SwiperItem.js +53 -22
- package/dist/packages/_es/Switch.js +116 -21
- package/dist/packages/_es/TabPane.js +39 -12
- package/dist/packages/_es/Tabbar.js +72 -17
- package/dist/packages/_es/TabbarItem.js +151 -29
- package/dist/packages/_es/Table.js +178 -18
- package/dist/packages/_es/Tabs.js +202 -43
- package/dist/packages/_es/Tag.js +97 -20
- package/dist/packages/_es/TextArea.js +160 -42
- package/dist/packages/_es/TimeDetail.js +79 -18
- package/dist/packages/_es/TimePannel.js +48 -14
- package/dist/packages/_es/TimeSelect.js +112 -15
- package/dist/packages/_es/Toast.js +310 -71
- package/dist/packages/_es/Uploader.js +455 -104
- package/dist/packages/_es/Video.js +332 -74
- package/dist/packages/_es/common.js +128 -38
- package/dist/packages/_es/component.js +76 -35
- package/dist/packages/_es/index.js +6 -5
- package/dist/packages/_es/index2.js +30 -9
- package/dist/packages/_es/index3.js +8 -6
- package/dist/packages/_es/index4.js +64 -13
- package/dist/packages/_es/index5.js +780 -164
- package/dist/packages/_es/plugin-vue_export-helper.js +8 -7
- package/dist/packages/_es/pxCheck.js +5 -3
- package/dist/packages/_es/raf.js +15 -8
- package/dist/packages/imagepreview/index.scss +6 -1
- package/dist/packages/locale/lang/baseLang.js +3 -3
- package/dist/packages/locale/lang/en-US.js +105 -5
- package/dist/packages/locale/lang/id-ID.js +105 -5
- package/dist/packages/locale/lang/index.js +38 -16
- package/dist/packages/locale/lang/zh-CN.js +105 -5
- package/dist/packages/locale/lang/zh-TW.js +105 -5
- package/dist/packages/picker/index.scss +13 -0
- package/dist/smartips/attributes.json +8 -0
- package/dist/smartips/tags.json +3 -1
- package/dist/smartips/web-types.json +19 -1
- package/dist/style.css +1 -1
- package/dist/style.es.js +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 +4 -1
- package/dist/styles/variables-jdt.scss +4 -1
- package/dist/styles/variables.scss +1 -1
- package/dist/types/__VUE/actionsheet/index.vue.d.ts +3 -3
- package/dist/types/__VUE/address/index.vue.d.ts +4 -4
- package/dist/types/__VUE/calendar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/cascader/index.vue.d.ts +3 -3
- package/dist/types/__VUE/cell/index.vue.d.ts +2 -2
- package/dist/types/__VUE/checkbox/index.vue.d.ts +2 -2
- package/dist/types/__VUE/collapse/index.vue.d.ts +2 -2
- package/dist/types/__VUE/datepicker/index.vue.d.ts +2 -2
- package/dist/types/__VUE/dialog/index.vue.d.ts +2 -2
- package/dist/types/__VUE/ecard/index.vue.d.ts +2 -2
- package/dist/types/__VUE/fixednav/index.vue.d.ts +2 -2
- package/dist/types/__VUE/grid/index.vue.d.ts +3 -3
- package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +95 -0
- package/dist/types/__VUE/imagepreview/index.vue.d.ts +23 -25
- package/dist/types/__VUE/infiniteloading/index.vue.d.ts +6 -6
- package/dist/types/__VUE/input/index.vue.d.ts +2 -2
- package/dist/types/__VUE/menu/index.vue.d.ts +4 -4
- package/dist/types/__VUE/menuitem/index.vue.d.ts +1 -1
- package/dist/types/__VUE/numberkeyboard/index.vue.d.ts +2 -2
- package/dist/types/__VUE/oldpicker/index.vue.d.ts +3 -3
- package/dist/types/__VUE/picker/index.vue.d.ts +3 -3
- package/dist/types/__VUE/popover/index.vue.d.ts +6 -6
- package/dist/types/__VUE/popup/index.vue.d.ts +4 -4
- 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/searchbar/index.vue.d.ts +2 -2
- package/dist/types/__VUE/shortpassword/index.vue.d.ts +1 -1
- package/dist/types/__VUE/sku/index.vue.d.ts +3 -3
- package/dist/types/__VUE/swipe/index.vue.d.ts +2 -2
- package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
- package/dist/types/__VUE/tabbar/index.vue.d.ts +2 -2
- package/dist/types/__VUE/textarea/index.vue.d.ts +2 -2
- package/dist/types/__VUE/toast/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -2
|
@@ -1,34 +1,84 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.1 Mon Jun 27 2022 21:39:05 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { reactive
|
|
7
|
-
import { c as
|
|
8
|
-
import { u } from "./index3.js";
|
|
6
|
+
import { reactive, provide, computed, watch, h } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { u as useExpose } from "./index3.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
|
-
const { create
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
10
|
+
const { create, componentName } = createComponent("checkboxgroup");
|
|
11
|
+
const _sfc_main = create({
|
|
12
|
+
props: {
|
|
13
|
+
modelValue: {
|
|
14
|
+
type: Array,
|
|
15
|
+
default: () => []
|
|
16
|
+
},
|
|
17
|
+
disabled: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false
|
|
20
|
+
},
|
|
21
|
+
max: {
|
|
22
|
+
type: Number,
|
|
23
|
+
default: 0
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
emits: ["change", "update:modelValue"],
|
|
27
|
+
setup(props, { slots, emit }) {
|
|
28
|
+
const state = reactive({
|
|
29
|
+
children: []
|
|
30
|
+
});
|
|
31
|
+
const relation = (child) => {
|
|
32
|
+
if (child.proxy) {
|
|
33
|
+
state.children.push(child.proxy);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const updateValue = (value) => {
|
|
37
|
+
emit("update:modelValue", value);
|
|
38
|
+
emit("change", value);
|
|
39
|
+
};
|
|
40
|
+
const toggleAll = (checked) => {
|
|
41
|
+
let values = [];
|
|
42
|
+
if (!!checked) {
|
|
43
|
+
state.children.forEach((item) => {
|
|
44
|
+
if (!(item == null ? void 0 : item.disabled)) {
|
|
45
|
+
values.push(item == null ? void 0 : item.label);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
emit("update:modelValue", values);
|
|
50
|
+
};
|
|
51
|
+
const toggleReverse = () => {
|
|
52
|
+
let values = props.modelValue.slice();
|
|
53
|
+
state.children.forEach((item) => {
|
|
54
|
+
let findIndex = values.findIndex((value) => value === item.label);
|
|
55
|
+
if (findIndex > -1) {
|
|
56
|
+
values.splice(findIndex, 1);
|
|
57
|
+
} else {
|
|
58
|
+
if (!(item == null ? void 0 : item.disabled)) {
|
|
59
|
+
values.push(item == null ? void 0 : item.label);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
emit("update:modelValue", values);
|
|
64
|
+
};
|
|
65
|
+
provide("parent", {
|
|
66
|
+
value: computed(() => props.modelValue),
|
|
67
|
+
disabled: computed(() => props.disabled),
|
|
68
|
+
max: computed(() => props.max),
|
|
69
|
+
updateValue,
|
|
70
|
+
relation
|
|
71
|
+
});
|
|
72
|
+
watch(() => props.modelValue, (value) => {
|
|
73
|
+
emit("change", value);
|
|
74
|
+
});
|
|
75
|
+
useExpose({ toggleAll, toggleReverse });
|
|
76
|
+
return () => {
|
|
77
|
+
var _a;
|
|
78
|
+
return h("view", {
|
|
79
|
+
class: `${componentName}`
|
|
80
|
+
}, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
export { _sfc_main as default };
|
|
@@ -1,33 +1,155 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.1 Mon Jun 27 2022 21:39:05 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { useSlots
|
|
7
|
-
import { i as
|
|
8
|
-
import { _ as
|
|
6
|
+
import { useSlots, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, Fragment, renderList, renderSlot, toDisplayString, createCommentVNode } from "vue";
|
|
7
|
+
import { i as isObject, c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
|
-
const { componentName
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
10
|
+
const { componentName, create } = createComponent("circleprogress");
|
|
11
|
+
const _sfc_main = create({
|
|
12
|
+
props: {
|
|
13
|
+
progress: {
|
|
14
|
+
type: [Number, String],
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
strokeWidth: {
|
|
18
|
+
type: [Number, String],
|
|
19
|
+
default: 5
|
|
20
|
+
},
|
|
21
|
+
radius: {
|
|
22
|
+
type: [Number, String],
|
|
23
|
+
default: 50
|
|
24
|
+
},
|
|
25
|
+
strokeLinecap: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: "round"
|
|
28
|
+
},
|
|
29
|
+
color: {
|
|
30
|
+
type: [String, Object],
|
|
31
|
+
default: ""
|
|
32
|
+
},
|
|
33
|
+
pathColor: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: ""
|
|
36
|
+
},
|
|
37
|
+
clockwise: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: true
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
setup(props, { emit }) {
|
|
43
|
+
const slotDefault = !!useSlots().default;
|
|
44
|
+
const refRandomId = Math.random().toString(36).slice(-8);
|
|
45
|
+
const classes = computed(() => {
|
|
46
|
+
const prefixCls = componentName;
|
|
47
|
+
return {
|
|
48
|
+
[prefixCls]: true
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
const path = computed(() => {
|
|
52
|
+
const isWise = props.clockwise ? 1 : 0;
|
|
53
|
+
return `M 50 50 m 0 -45 a 45 45 0 1 ${isWise} 0 90 a 45 45 0 1, ${isWise} 0 -90`;
|
|
54
|
+
});
|
|
55
|
+
const hoverColor = computed(() => {
|
|
56
|
+
return isObject(props.color) ? `url(#${refRandomId})` : props.color;
|
|
57
|
+
});
|
|
58
|
+
const hoverStyle = computed(() => {
|
|
59
|
+
let perimeter = 283;
|
|
60
|
+
let offset = perimeter * Number(props.progress) / 100;
|
|
61
|
+
return {
|
|
62
|
+
stroke: isObject(props.color) ? `url(#${refRandomId})` : props.color,
|
|
63
|
+
strokeDasharray: `${offset}px ${perimeter}px`
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
const pathStyle = computed(() => {
|
|
67
|
+
return {
|
|
68
|
+
stroke: props.pathColor
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
const stop = computed(() => {
|
|
72
|
+
if (!isObject(props.color)) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
let color = props.color;
|
|
76
|
+
const colorArr = Object.keys(color).sort((a, b) => parseFloat(a) - parseFloat(b));
|
|
77
|
+
let stopArr = [];
|
|
78
|
+
colorArr.map((item, index2) => {
|
|
79
|
+
let obj = {
|
|
80
|
+
key: "",
|
|
81
|
+
value: ""
|
|
82
|
+
};
|
|
83
|
+
obj.key = item;
|
|
84
|
+
obj.value = color[item];
|
|
85
|
+
stopArr.push(obj);
|
|
86
|
+
});
|
|
87
|
+
return stopArr;
|
|
88
|
+
});
|
|
89
|
+
return {
|
|
90
|
+
classes,
|
|
91
|
+
hoverStyle,
|
|
92
|
+
pathStyle,
|
|
93
|
+
path,
|
|
94
|
+
hoverColor,
|
|
95
|
+
stop,
|
|
96
|
+
slotDefault,
|
|
97
|
+
refRandomId
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
const _hoisted_1 = { viewBox: "0 0 100 100" };
|
|
102
|
+
const _hoisted_2 = ["id"];
|
|
103
|
+
const _hoisted_3 = ["offset", "stop-color"];
|
|
104
|
+
const _hoisted_4 = ["d", "stroke-width"];
|
|
105
|
+
const _hoisted_5 = ["d", "stroke", "stroke-linecap", "stroke-width"];
|
|
106
|
+
const _hoisted_6 = { class: "nut-circleprogress-text" };
|
|
107
|
+
const _hoisted_7 = { key: 0 };
|
|
108
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
109
|
+
return openBlock(), createElementBlock("div", {
|
|
110
|
+
class: normalizeClass(_ctx.classes),
|
|
111
|
+
style: normalizeStyle({ height: _ctx.radius * 2 + "px", width: _ctx.radius * 2 + "px" })
|
|
112
|
+
}, [
|
|
113
|
+
(openBlock(), createElementBlock("svg", _hoisted_1, [
|
|
114
|
+
createElementVNode("defs", null, [
|
|
115
|
+
createElementVNode("linearGradient", {
|
|
116
|
+
id: _ctx.refRandomId,
|
|
117
|
+
x1: "100%",
|
|
118
|
+
y1: "0%",
|
|
119
|
+
x2: "0%",
|
|
120
|
+
y2: "0%"
|
|
121
|
+
}, [
|
|
122
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.stop, (item, index2) => {
|
|
123
|
+
return openBlock(), createElementBlock("stop", {
|
|
124
|
+
key: index2,
|
|
125
|
+
offset: item.key,
|
|
126
|
+
"stop-color": item.value
|
|
127
|
+
}, null, 8, _hoisted_3);
|
|
128
|
+
}), 128))
|
|
129
|
+
], 8, _hoisted_2)
|
|
130
|
+
]),
|
|
131
|
+
createElementVNode("path", {
|
|
132
|
+
class: "nut-circleprogress-path",
|
|
133
|
+
style: normalizeStyle(_ctx.pathStyle),
|
|
134
|
+
d: _ctx.path,
|
|
135
|
+
fill: "none",
|
|
136
|
+
"stroke-width": _ctx.strokeWidth
|
|
137
|
+
}, " > ", 12, _hoisted_4),
|
|
138
|
+
createElementVNode("path", {
|
|
139
|
+
class: "nut-circleprogress-hover",
|
|
140
|
+
style: normalizeStyle(_ctx.hoverStyle),
|
|
141
|
+
d: _ctx.path,
|
|
142
|
+
fill: "none",
|
|
143
|
+
stroke: _ctx.hoverColor,
|
|
144
|
+
"stroke-linecap": _ctx.strokeLinecap,
|
|
145
|
+
"stroke-width": _ctx.strokeWidth
|
|
146
|
+
}, null, 12, _hoisted_5)
|
|
147
|
+
])),
|
|
148
|
+
createElementVNode("div", _hoisted_6, [
|
|
149
|
+
renderSlot(_ctx.$slots, "default"),
|
|
150
|
+
!_ctx.slotDefault ? (openBlock(), createElementBlock("div", _hoisted_7, toDisplayString(_ctx.progress) + "%", 1)) : createCommentVNode("", true)
|
|
151
|
+
])
|
|
152
|
+
], 6);
|
|
153
|
+
}
|
|
154
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
155
|
+
export { index as default };
|
package/dist/packages/_es/Col.js
CHANGED
|
@@ -1,19 +1,61 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.1 Mon Jun 27 2022 21:39:05 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { inject
|
|
7
|
-
import { c as
|
|
8
|
-
import { _ as
|
|
6
|
+
import { inject, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
|
-
const { componentName
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
const { componentName, create } = createComponent("col");
|
|
11
|
+
const _sfc_main = create({
|
|
12
|
+
props: {
|
|
13
|
+
span: {
|
|
14
|
+
type: [String, Number],
|
|
15
|
+
default: "24"
|
|
16
|
+
},
|
|
17
|
+
offset: {
|
|
18
|
+
type: [String, Number],
|
|
19
|
+
default: "0"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
emits: ["click"],
|
|
23
|
+
setup(props, { emit }) {
|
|
24
|
+
const prefixCls = componentName;
|
|
25
|
+
const gutter = inject("gutter");
|
|
26
|
+
const classes = computed(() => {
|
|
27
|
+
return {
|
|
28
|
+
[prefixCls]: true,
|
|
29
|
+
[prefixCls + "-gutter"]: gutter,
|
|
30
|
+
["nut-col-" + props.span]: true,
|
|
31
|
+
["nut-col-offset-" + props.offset]: true
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
const style = computed(() => {
|
|
35
|
+
return {
|
|
36
|
+
paddingLeft: gutter / 2 + "px",
|
|
37
|
+
paddingRight: gutter / 2 + "px"
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
const handleClick = (evt) => {
|
|
41
|
+
evt.stopPropagation();
|
|
42
|
+
emit("click", evt);
|
|
43
|
+
};
|
|
44
|
+
return {
|
|
45
|
+
classes,
|
|
46
|
+
style,
|
|
47
|
+
handleClick
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
52
|
+
return openBlock(), createElementBlock("view", {
|
|
53
|
+
class: normalizeClass(_ctx.classes),
|
|
54
|
+
style: normalizeStyle(_ctx.style),
|
|
55
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
|
|
56
|
+
}, [
|
|
57
|
+
renderSlot(_ctx.$slots, "default")
|
|
58
|
+
], 6);
|
|
59
|
+
}
|
|
60
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
61
|
+
export { index as default };
|
|
@@ -1,38 +1,115 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.1 Mon Jun 27 2022 21:39:05 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { ref
|
|
7
|
-
import { c as
|
|
8
|
-
import { _ as
|
|
6
|
+
import { ref, watch, provide, openBlock, createElementBlock, renderSlot } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
|
-
const { create
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
const { create } = createComponent("collapse");
|
|
11
|
+
const _sfc_main = create({
|
|
12
|
+
props: {
|
|
13
|
+
active: {
|
|
14
|
+
type: [String, Number, Array]
|
|
15
|
+
},
|
|
16
|
+
accordion: {
|
|
17
|
+
type: Boolean
|
|
18
|
+
},
|
|
19
|
+
titleIcon: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: ""
|
|
22
|
+
},
|
|
23
|
+
titleIconSize: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: "16px"
|
|
26
|
+
},
|
|
27
|
+
titleIconColor: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: ""
|
|
30
|
+
},
|
|
31
|
+
titleIconPosition: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "left"
|
|
34
|
+
},
|
|
35
|
+
icon: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: ""
|
|
38
|
+
},
|
|
39
|
+
iconSize: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: "16px"
|
|
42
|
+
},
|
|
43
|
+
iconColor: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: ""
|
|
46
|
+
},
|
|
47
|
+
rotate: {
|
|
48
|
+
type: [String, Number],
|
|
49
|
+
default: 180
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
emits: ["update:active", "change"],
|
|
53
|
+
setup(props, { emit, slots }) {
|
|
54
|
+
const collapseDom = ref(null);
|
|
55
|
+
watch(() => props.active, (newval, oldval) => {
|
|
56
|
+
var _a, _b;
|
|
57
|
+
let domsProps = (_a = slots == null ? void 0 : slots.default) == null ? void 0 : _a.call(slots);
|
|
58
|
+
let doms = (_b = collapseDom.value) == null ? void 0 : _b.children;
|
|
59
|
+
Array.from(doms).forEach((dom, index2) => {
|
|
60
|
+
const item = dom["__vueParentComponent"]["ctx"];
|
|
61
|
+
if (typeof newval == "number" || typeof newval == "string") {
|
|
62
|
+
if (newval == domsProps[index2].props.name) {
|
|
63
|
+
item.changeOpen(!item.openExpanded);
|
|
64
|
+
} else {
|
|
65
|
+
item.changeOpen(false);
|
|
66
|
+
}
|
|
67
|
+
} else if (Object.values(newval) instanceof Array) {
|
|
68
|
+
if (newval.indexOf(Number(domsProps[index2].props.name)) > -1 || newval.indexOf(String(domsProps[index2].props.name)) > -1) {
|
|
69
|
+
item.changeOpen(true);
|
|
70
|
+
} else {
|
|
71
|
+
item.changeOpen(false);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
item.animation();
|
|
75
|
+
});
|
|
18
76
|
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
77
|
+
const changeVal = (val) => {
|
|
78
|
+
emit("update:active", val);
|
|
79
|
+
emit("change", val);
|
|
80
|
+
};
|
|
81
|
+
const changeValAry = (name) => {
|
|
82
|
+
const activeItem = props.active instanceof Object ? Object.values(props.active) : props.active;
|
|
83
|
+
let index2 = -1;
|
|
84
|
+
activeItem.forEach((item, idx) => {
|
|
85
|
+
if (String(item) == String(name)) {
|
|
86
|
+
index2 = idx;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
index2 > -1 ? activeItem.splice(index2, 1) : activeItem.push(name);
|
|
90
|
+
changeVal(activeItem);
|
|
91
|
+
};
|
|
92
|
+
const isExpanded = (name) => {
|
|
93
|
+
const { accordion, active } = props;
|
|
94
|
+
if (accordion) {
|
|
95
|
+
return typeof active === "number" || typeof active === "string" ? active == name : false;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
provide("collapseParent", {
|
|
99
|
+
children: [],
|
|
100
|
+
props,
|
|
101
|
+
changeValAry,
|
|
102
|
+
changeVal,
|
|
103
|
+
isExpanded
|
|
104
|
+
});
|
|
105
|
+
return { collapseDom };
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
const _hoisted_1 = { ref: "collapseDom" };
|
|
109
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
110
|
+
return openBlock(), createElementBlock("view", _hoisted_1, [
|
|
111
|
+
renderSlot(_ctx.$slots, "default")
|
|
112
|
+
], 512);
|
|
113
|
+
}
|
|
114
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
115
|
+
export { index as default };
|