@nutui/nutui 3.1.6 → 3.1.7
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 +40 -0
- package/dist/nutui.d.ts +7 -1
- package/dist/nutui.es.js +1097 -517
- package/dist/nutui.umd.js +1158 -571
- package/dist/packages/_es/ActionSheet.js +158 -0
- package/dist/packages/_es/Address.js +525 -0
- package/dist/packages/_es/Avatar.js +87 -0
- package/dist/packages/_es/BackTop.js +159 -0
- package/dist/packages/_es/Badge.js +90 -0
- package/dist/packages/_es/Barrage.js +118 -0
- package/dist/packages/_es/Button.js +124 -0
- package/dist/packages/_es/Calendar.js +700 -0
- package/dist/packages/_es/Cell.js +95 -0
- package/dist/packages/_es/CellGroup.js +42 -0
- package/dist/packages/_es/Checkbox.js +109 -0
- package/dist/packages/_es/CheckboxGroup.js +62 -0
- package/dist/packages/_es/CircleProgress.js +109 -0
- package/dist/packages/_es/Col.js +53 -0
- package/dist/packages/_es/Collapse.js +89 -0
- package/dist/packages/_es/CollapseItem.js +257 -0
- package/dist/packages/_es/CountDown.js +224 -0
- package/dist/packages/_es/CountUp.js +547 -0
- package/dist/packages/_es/DatePicker.js +282 -0
- package/dist/packages/_es/Dialog.js +313 -0
- package/dist/packages/_es/Divider.js +49 -0
- package/dist/packages/_es/Drag.js +198 -0
- package/dist/packages/_es/Elevator.js +207 -0
- package/dist/packages/_es/FixedNav.js +127 -0
- package/dist/packages/_es/Icon.js +44 -0
- package/dist/packages/_es/ImagePreview.js +109 -0
- package/dist/packages/_es/InfiniteLoading.js +265 -0
- package/dist/packages/_es/Input.js +183 -0
- package/dist/packages/_es/InputNumber.js +172 -0
- package/dist/packages/_es/Layout.js +10 -0
- package/dist/packages/_es/MenuItem.js +180 -0
- package/dist/packages/_es/Navbar.js +160 -0
- package/dist/packages/_es/NoticeBar.js +389 -0
- package/dist/packages/_es/Notify.js +233 -0
- package/dist/packages/_es/NumberKeyboard.js +248 -0
- package/dist/packages/_es/OverLay.js +118 -0
- package/dist/packages/_es/Pagination.js +163 -0
- package/dist/packages/_es/Picker.js +485 -0
- package/dist/packages/_es/Popover.js +157 -0
- package/dist/packages/_es/Popup.js +268 -0
- package/dist/packages/_es/Price.js +104 -0
- package/dist/packages/_es/Progress.js +131 -0
- package/dist/packages/_es/Radio.js +72 -0
- package/dist/packages/_es/RadioGroup.js +37 -0
- package/dist/packages/_es/Range.js +350 -0
- package/dist/packages/_es/Rate.js +129 -0
- package/dist/packages/_es/Row.js +61 -0
- package/dist/packages/_es/ShortPassword.js +221 -0
- package/dist/packages/_es/Signature.js +167 -0
- package/dist/packages/_es/Step.js +116 -0
- package/dist/packages/_es/Steps.js +52 -0
- package/dist/packages/_es/Swipe.js +193 -0
- package/dist/packages/_es/Swiper.js +429 -0
- package/dist/packages/_es/SwiperItem.js +60 -0
- package/dist/packages/_es/Switch.js +90 -0
- package/dist/packages/_es/Tab.js +179 -0
- package/dist/packages/_es/TabPane.js +42 -0
- package/dist/packages/_es/TabPanel.js +30 -0
- package/dist/packages/_es/Tabbar.js +73 -0
- package/dist/packages/_es/TabbarItem.js +142 -0
- package/dist/packages/_es/Tag.js +98 -0
- package/dist/packages/_es/TextArea.js +127 -0
- package/dist/packages/_es/Toast.js +317 -0
- package/dist/packages/_es/Uploader.js +400 -0
- package/dist/packages/_es/Video.js +405 -0
- package/dist/packages/_es/component.js +26 -0
- package/dist/packages/_es/index.js +64 -0
- package/dist/packages/_es/index2.js +13 -0
- package/dist/packages/_es/plugin-vue_export-helper.js +12 -0
- package/dist/packages/_es/pxCheck.js +9 -0
- package/dist/packages/_es/raf.js +19 -0
- package/dist/packages/avatar/index.scss +0 -1
- package/dist/packages/badge/index.scss +35 -0
- package/dist/packages/calendar/index.scss +13 -0
- package/dist/packages/imagepreview/index.scss +48 -0
- package/dist/packages/input/index.scss +14 -7
- package/dist/packages/pagination/index.scss +51 -0
- package/dist/packages/popover/index.scss +159 -0
- package/dist/packages/shortpassword/index.scss +19 -7
- package/dist/packages/tabpane/index.scss +1 -0
- package/dist/packages/tabs/index.scss +1 -0
- package/dist/packages/tag/index.scss +47 -0
- package/dist/packages/uploader/index.scss +0 -1
- package/dist/style.css +1 -1
- package/dist/style.es.js +2 -1
- package/dist/styles/themes/default.scss +35 -28
- package/dist/styles/variables.scss +55 -32
- package/package.json +7 -7
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @nutui/nutui v3.1.7 Thu Sep 30 2021 20:17:02 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2021 @jdf2e.
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
import { computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot, createBlock, createCommentVNode, Fragment, createElementVNode, toDisplayString, createTextVNode } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { useRouter } from "vue-router";
|
|
9
|
+
import { p as pxCheck } from "./pxCheck.js";
|
|
10
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
11
|
+
const { componentName, create } = createComponent("cell");
|
|
12
|
+
const _sfc_main = create({
|
|
13
|
+
props: {
|
|
14
|
+
title: { type: String, default: "" },
|
|
15
|
+
subTitle: { type: String, default: "" },
|
|
16
|
+
desc: { type: String, default: "" },
|
|
17
|
+
descTextAlign: { type: String, default: "right" },
|
|
18
|
+
isLink: { type: Boolean, default: false },
|
|
19
|
+
to: [String, Object],
|
|
20
|
+
replace: { type: Boolean, default: false },
|
|
21
|
+
roundRadius: { type: [String, Number], default: "" },
|
|
22
|
+
url: { type: String, default: "" },
|
|
23
|
+
icon: { type: String, default: "" }
|
|
24
|
+
},
|
|
25
|
+
emits: ["click"],
|
|
26
|
+
setup(props, { emit }) {
|
|
27
|
+
const classes = computed(() => {
|
|
28
|
+
const prefixCls = componentName;
|
|
29
|
+
return {
|
|
30
|
+
[prefixCls]: true,
|
|
31
|
+
[`${prefixCls}--clickable`]: props.isLink || props.to
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
const router = useRouter();
|
|
35
|
+
const baseStyle = computed(() => {
|
|
36
|
+
return {
|
|
37
|
+
borderRadius: pxCheck(props.roundRadius)
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
const handleClick = (event) => {
|
|
41
|
+
emit("click", event);
|
|
42
|
+
if (props.to && router) {
|
|
43
|
+
router[props.replace ? "replace" : "push"](props.to);
|
|
44
|
+
} else if (props.url) {
|
|
45
|
+
props.replace ? location.replace(props.url) : location.href = props.url;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
return {
|
|
49
|
+
handleClick,
|
|
50
|
+
classes,
|
|
51
|
+
baseStyle
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
const _hoisted_1 = { class: "title" };
|
|
56
|
+
const _hoisted_2 = { class: "nut-cell__title-desc" };
|
|
57
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
58
|
+
const _component_nut_icon = resolveComponent("nut-icon");
|
|
59
|
+
return openBlock(), createElementBlock("view", {
|
|
60
|
+
class: normalizeClass(_ctx.classes),
|
|
61
|
+
style: normalizeStyle(_ctx.baseStyle),
|
|
62
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
|
|
63
|
+
}, [
|
|
64
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
65
|
+
_ctx.title || _ctx.subTitle || _ctx.icon ? (openBlock(), createElementBlock("view", {
|
|
66
|
+
key: 0,
|
|
67
|
+
class: normalizeClass(["nut-cell__title", { icon: _ctx.icon || _ctx.$slots.icon }])
|
|
68
|
+
}, [
|
|
69
|
+
_ctx.$slots.icon ? renderSlot(_ctx.$slots, "icon", { key: 0 }) : _ctx.icon ? (openBlock(), createBlock(_component_nut_icon, {
|
|
70
|
+
key: 1,
|
|
71
|
+
class: "icon",
|
|
72
|
+
name: _ctx.icon
|
|
73
|
+
}, null, 8, ["name"])) : createCommentVNode("", true),
|
|
74
|
+
_ctx.subTitle ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
75
|
+
createElementVNode("view", _hoisted_1, toDisplayString(_ctx.title), 1),
|
|
76
|
+
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.subTitle), 1)
|
|
77
|
+
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
78
|
+
createTextVNode(toDisplayString(_ctx.title), 1)
|
|
79
|
+
], 64))
|
|
80
|
+
], 2)) : createCommentVNode("", true),
|
|
81
|
+
_ctx.desc ? (openBlock(), createElementBlock("view", {
|
|
82
|
+
key: 1,
|
|
83
|
+
class: "nut-cell__value",
|
|
84
|
+
style: normalizeStyle({ "text-align": _ctx.descTextAlign })
|
|
85
|
+
}, toDisplayString(_ctx.desc), 5)) : createCommentVNode("", true),
|
|
86
|
+
_ctx.$slots.link ? renderSlot(_ctx.$slots, "link", { key: 2 }) : _ctx.isLink || _ctx.to ? (openBlock(), createBlock(_component_nut_icon, {
|
|
87
|
+
key: 3,
|
|
88
|
+
class: "nut-cell__link",
|
|
89
|
+
name: "right"
|
|
90
|
+
})) : createCommentVNode("", true)
|
|
91
|
+
])
|
|
92
|
+
], 6);
|
|
93
|
+
}
|
|
94
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
95
|
+
export { index as default };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @nutui/nutui v3.1.7 Thu Sep 30 2021 20:17:02 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2021 @jdf2e.
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
import { computed, openBlock, createElementBlock, normalizeClass, toDisplayString, createCommentVNode, createElementVNode, renderSlot } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
|
+
const { componentName, create } = createComponent("cell-group");
|
|
10
|
+
const _sfc_main = create({
|
|
11
|
+
props: {
|
|
12
|
+
title: { type: String, default: "" }
|
|
13
|
+
},
|
|
14
|
+
setup() {
|
|
15
|
+
const classes = computed(() => {
|
|
16
|
+
const prefixCls = componentName;
|
|
17
|
+
return {
|
|
18
|
+
[prefixCls]: true
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
return {
|
|
22
|
+
classes
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
const _hoisted_1 = {
|
|
27
|
+
key: 0,
|
|
28
|
+
class: "nut-cell-group__title"
|
|
29
|
+
};
|
|
30
|
+
const _hoisted_2 = { class: "nut-cell-group__warp" };
|
|
31
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
32
|
+
return openBlock(), createElementBlock("view", {
|
|
33
|
+
class: normalizeClass(_ctx.classes)
|
|
34
|
+
}, [
|
|
35
|
+
_ctx.title ? (openBlock(), createElementBlock("view", _hoisted_1, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true),
|
|
36
|
+
createElementVNode("view", _hoisted_2, [
|
|
37
|
+
renderSlot(_ctx.$slots, "default")
|
|
38
|
+
])
|
|
39
|
+
], 2);
|
|
40
|
+
}
|
|
41
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
42
|
+
export { index as default };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @nutui/nutui v3.1.7 Thu Sep 30 2021 20:17:02 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2021 @jdf2e.
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
import { inject, computed, onMounted, getCurrentInstance, h } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import _sfc_main$1 from "./Icon.js";
|
|
9
|
+
import "./pxCheck.js";
|
|
10
|
+
const { create, componentName } = createComponent("checkbox");
|
|
11
|
+
const _sfc_main = create({
|
|
12
|
+
components: {
|
|
13
|
+
nutIcon: _sfc_main$1
|
|
14
|
+
},
|
|
15
|
+
props: {
|
|
16
|
+
modelValue: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: false
|
|
19
|
+
},
|
|
20
|
+
disabled: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: false
|
|
23
|
+
},
|
|
24
|
+
textPosition: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: "right"
|
|
27
|
+
},
|
|
28
|
+
iconSize: {
|
|
29
|
+
type: [String, Number],
|
|
30
|
+
default: "18"
|
|
31
|
+
},
|
|
32
|
+
iconName: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: "check-normal"
|
|
35
|
+
},
|
|
36
|
+
iconActiveName: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: "checked"
|
|
39
|
+
},
|
|
40
|
+
label: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: ""
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
emits: ["change", "update:modelValue"],
|
|
46
|
+
setup(props, { emit, slots }) {
|
|
47
|
+
const parent = inject("parent");
|
|
48
|
+
const hasParent = computed(() => !!parent);
|
|
49
|
+
const pValue = computed(() => {
|
|
50
|
+
if (hasParent.value) {
|
|
51
|
+
return parent.value.value.includes(props.label);
|
|
52
|
+
} else {
|
|
53
|
+
return props.modelValue;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
const pDisabled = computed(() => {
|
|
57
|
+
return hasParent.value ? parent.disabled : props.disabled;
|
|
58
|
+
});
|
|
59
|
+
const checked = computed(() => !!props.modelValue);
|
|
60
|
+
const color = computed(() => {
|
|
61
|
+
return !pDisabled.value ? !pValue.value ? "nut-checkbox__icon--unchecked" : "nut-checkbox__icon" : "nut-checkbox__icon--disable";
|
|
62
|
+
});
|
|
63
|
+
const emitChange = (value, label) => {
|
|
64
|
+
emit("update:modelValue", value);
|
|
65
|
+
emit("change", value, label);
|
|
66
|
+
};
|
|
67
|
+
const renderIcon = () => {
|
|
68
|
+
const { iconName, iconSize, iconActiveName } = props;
|
|
69
|
+
return h(_sfc_main$1, {
|
|
70
|
+
name: !pValue.value ? iconName : iconActiveName,
|
|
71
|
+
size: iconSize,
|
|
72
|
+
class: color.value
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
const renderLabel = () => {
|
|
76
|
+
var _a;
|
|
77
|
+
return h("view", {
|
|
78
|
+
class: `${componentName}__label ${pDisabled.value ? `${componentName}__label--disabled` : ""}`
|
|
79
|
+
}, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
|
80
|
+
};
|
|
81
|
+
const handleClick = (e) => {
|
|
82
|
+
var _a;
|
|
83
|
+
if (pDisabled.value)
|
|
84
|
+
return;
|
|
85
|
+
emitChange(!checked.value, (_a = slots.default) == null ? void 0 : _a.call(slots)[0].children);
|
|
86
|
+
if (hasParent.value) {
|
|
87
|
+
let value = parent.value.value;
|
|
88
|
+
let { label } = props;
|
|
89
|
+
const index = value.indexOf(label);
|
|
90
|
+
if (index > -1) {
|
|
91
|
+
value.splice(index, 1);
|
|
92
|
+
} else {
|
|
93
|
+
value.push(label);
|
|
94
|
+
}
|
|
95
|
+
parent.updateValue(value);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
onMounted(() => {
|
|
99
|
+
hasParent.value && parent["relation"](getCurrentInstance());
|
|
100
|
+
});
|
|
101
|
+
return () => {
|
|
102
|
+
return h("view", {
|
|
103
|
+
class: `${componentName} ${props.textPosition === "left" ? `${componentName}--reverse` : ""}`,
|
|
104
|
+
onClick: handleClick
|
|
105
|
+
}, [renderIcon(), renderLabel()]);
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @nutui/nutui v3.1.7 Thu Sep 30 2021 20:17:02 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2021 @jdf2e.
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
import { reactive, provide, computed, watch, h } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { u as useExpose } from "./index2.js";
|
|
9
|
+
const { create, componentName } = createComponent("checkboxgroup");
|
|
10
|
+
const _sfc_main = create({
|
|
11
|
+
props: {
|
|
12
|
+
modelValue: {
|
|
13
|
+
type: Array,
|
|
14
|
+
default: () => []
|
|
15
|
+
},
|
|
16
|
+
disabled: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: false
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
emits: ["change", "update:modelValue"],
|
|
22
|
+
setup(props, { slots, emit }) {
|
|
23
|
+
const state = reactive({
|
|
24
|
+
children: []
|
|
25
|
+
});
|
|
26
|
+
const relation = (child) => {
|
|
27
|
+
if (child.proxy) {
|
|
28
|
+
state.children.push(child.proxy);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const updateValue = (value) => {
|
|
32
|
+
emit("update:modelValue", value);
|
|
33
|
+
emit("change", value);
|
|
34
|
+
};
|
|
35
|
+
const toggleAll = (checked) => {
|
|
36
|
+
let values = [];
|
|
37
|
+
if (!!checked) {
|
|
38
|
+
state.children.forEach((item) => {
|
|
39
|
+
values.push(item == null ? void 0 : item.label);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
emit("update:modelValue", values);
|
|
43
|
+
};
|
|
44
|
+
provide("parent", {
|
|
45
|
+
value: computed(() => props.modelValue),
|
|
46
|
+
disabled: props.disabled,
|
|
47
|
+
updateValue,
|
|
48
|
+
relation
|
|
49
|
+
});
|
|
50
|
+
watch(() => props.modelValue, (value) => {
|
|
51
|
+
emit("change", value);
|
|
52
|
+
});
|
|
53
|
+
useExpose({ toggleAll });
|
|
54
|
+
return () => {
|
|
55
|
+
var _a;
|
|
56
|
+
return h("view", {
|
|
57
|
+
class: `${componentName}`
|
|
58
|
+
}, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @nutui/nutui v3.1.7 Thu Sep 30 2021 20:17:02 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2021 @jdf2e.
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
import { computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, createTextVNode, toDisplayString } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
|
+
const { componentName, create } = createComponent("circleprogress");
|
|
10
|
+
const _sfc_main = create({
|
|
11
|
+
props: {
|
|
12
|
+
progress: {
|
|
13
|
+
type: [Number, String],
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
strokeInnerWidth: {
|
|
17
|
+
type: [Number, String],
|
|
18
|
+
default: 10
|
|
19
|
+
},
|
|
20
|
+
isAuto: {
|
|
21
|
+
tyep: Boolean,
|
|
22
|
+
default: false
|
|
23
|
+
},
|
|
24
|
+
progressOption: {
|
|
25
|
+
type: Object,
|
|
26
|
+
default: () => {
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
setup(props, { emit }) {
|
|
31
|
+
const classes = computed(() => {
|
|
32
|
+
const prefixCls = componentName;
|
|
33
|
+
return {
|
|
34
|
+
[prefixCls]: true
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
const option = computed(() => {
|
|
38
|
+
let baseOption = {
|
|
39
|
+
radius: 50,
|
|
40
|
+
strokeOutWidth: 10,
|
|
41
|
+
backColor: "#d9d9d9",
|
|
42
|
+
progressColor: "red",
|
|
43
|
+
cy: 1,
|
|
44
|
+
cx: 1,
|
|
45
|
+
size: 1,
|
|
46
|
+
startPosition: ""
|
|
47
|
+
};
|
|
48
|
+
Object.assign(baseOption, props.progressOption);
|
|
49
|
+
baseOption.cy = baseOption.cx = baseOption.radius + baseOption.strokeOutWidth;
|
|
50
|
+
baseOption.size = (baseOption.radius + baseOption.strokeOutWidth) * 2;
|
|
51
|
+
baseOption.startPosition = "rotate(-90," + baseOption.cx + "," + baseOption.cy + ")";
|
|
52
|
+
return baseOption;
|
|
53
|
+
});
|
|
54
|
+
const arcLength = computed(() => {
|
|
55
|
+
let circleLength = Math.floor(2 * Math.PI * option.value.radius);
|
|
56
|
+
let progressLength = props.progress / 100 * circleLength;
|
|
57
|
+
return `${progressLength},${circleLength}`;
|
|
58
|
+
});
|
|
59
|
+
return {
|
|
60
|
+
classes,
|
|
61
|
+
option,
|
|
62
|
+
arcLength
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
const _hoisted_1 = ["height", "width"];
|
|
67
|
+
const _hoisted_2 = ["r", "cx", "cy", "stroke", "stroke-width"];
|
|
68
|
+
const _hoisted_3 = ["r", "cx", "cy", "stroke", "stroke-dasharray", "stroke-width", "transform"];
|
|
69
|
+
const _hoisted_4 = { class: "nut-circleprogress-content" };
|
|
70
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
71
|
+
return openBlock(), createElementBlock("div", {
|
|
72
|
+
class: normalizeClass(_ctx.classes),
|
|
73
|
+
style: normalizeStyle({ height: _ctx.option.size + "px", width: _ctx.option.size + "px" })
|
|
74
|
+
}, [
|
|
75
|
+
(openBlock(), createElementBlock("svg", {
|
|
76
|
+
height: _ctx.option.size,
|
|
77
|
+
width: _ctx.option.size,
|
|
78
|
+
"x-mlns": "http://www.w3.org/200/svg"
|
|
79
|
+
}, [
|
|
80
|
+
createElementVNode("circle", {
|
|
81
|
+
r: _ctx.option.radius,
|
|
82
|
+
cx: _ctx.option.cx,
|
|
83
|
+
cy: _ctx.option.cy,
|
|
84
|
+
stroke: _ctx.option.backColor,
|
|
85
|
+
"stroke-width": _ctx.option.strokeOutWidth,
|
|
86
|
+
fill: "none"
|
|
87
|
+
}, null, 8, _hoisted_2),
|
|
88
|
+
createElementVNode("circle", {
|
|
89
|
+
r: _ctx.option.radius,
|
|
90
|
+
cx: _ctx.option.cx,
|
|
91
|
+
cy: _ctx.option.cy,
|
|
92
|
+
stroke: _ctx.option.progressColor,
|
|
93
|
+
"stroke-dasharray": _ctx.arcLength,
|
|
94
|
+
"stroke-width": _ctx.strokeInnerWidth,
|
|
95
|
+
fill: "none",
|
|
96
|
+
transform: _ctx.option.startPosition,
|
|
97
|
+
"stroke-linecap": "round",
|
|
98
|
+
style: { "transition": "stroke-dasharray 0.6s ease 0s, stroke 0.6s ease 0s" }
|
|
99
|
+
}, null, 8, _hoisted_3)
|
|
100
|
+
], 8, _hoisted_1)),
|
|
101
|
+
createElementVNode("div", _hoisted_4, [
|
|
102
|
+
!_ctx.isAuto ? renderSlot(_ctx.$slots, "default", { key: 0 }, () => [
|
|
103
|
+
createTextVNode(toDisplayString(_ctx.progress) + "%", 1)
|
|
104
|
+
]) : renderSlot(_ctx.$slots, "default", { key: 1 })
|
|
105
|
+
])
|
|
106
|
+
], 6);
|
|
107
|
+
}
|
|
108
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
109
|
+
export { index as default };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @nutui/nutui v3.1.7 Thu Sep 30 2021 20:17:02 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2021 @jdf2e.
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/
|
|
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
|
+
const { componentName, create } = createComponent("col");
|
|
10
|
+
const _sfc_main = create({
|
|
11
|
+
props: {
|
|
12
|
+
span: {
|
|
13
|
+
type: [String, Number],
|
|
14
|
+
default: "24"
|
|
15
|
+
},
|
|
16
|
+
offset: {
|
|
17
|
+
type: [String, Number],
|
|
18
|
+
default: "0"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
setup(props) {
|
|
22
|
+
const prefixCls = componentName;
|
|
23
|
+
const gutter = inject("gutter");
|
|
24
|
+
const classes = computed(() => {
|
|
25
|
+
return {
|
|
26
|
+
[prefixCls]: true,
|
|
27
|
+
[prefixCls + "-gutter"]: gutter,
|
|
28
|
+
["nut-col-" + props.span]: true,
|
|
29
|
+
["nut-col-offset-" + props.offset]: true
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
const style = computed(() => {
|
|
33
|
+
return {
|
|
34
|
+
paddingLeft: gutter / 2 + "px",
|
|
35
|
+
paddingRight: gutter / 2 + "px"
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
classes,
|
|
40
|
+
style
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
45
|
+
return openBlock(), createElementBlock("view", {
|
|
46
|
+
class: normalizeClass(_ctx.classes),
|
|
47
|
+
style: normalizeStyle(_ctx.style)
|
|
48
|
+
}, [
|
|
49
|
+
renderSlot(_ctx.$slots, "default")
|
|
50
|
+
], 6);
|
|
51
|
+
}
|
|
52
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
53
|
+
export { index as default };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @nutui/nutui v3.1.7 Thu Sep 30 2021 20:17:02 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2021 @jdf2e.
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
import { 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
|
+
const { create } = createComponent("collapse");
|
|
10
|
+
const _sfc_main = create({
|
|
11
|
+
props: {
|
|
12
|
+
active: {
|
|
13
|
+
type: [String, Number, Array]
|
|
14
|
+
},
|
|
15
|
+
accordion: {
|
|
16
|
+
type: Boolean
|
|
17
|
+
},
|
|
18
|
+
titleIcon: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: ""
|
|
21
|
+
},
|
|
22
|
+
titleIconSize: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: "16px"
|
|
25
|
+
},
|
|
26
|
+
titleIconColor: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: ""
|
|
29
|
+
},
|
|
30
|
+
titleIconPosition: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: "left"
|
|
33
|
+
},
|
|
34
|
+
icon: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: ""
|
|
37
|
+
},
|
|
38
|
+
iconSize: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: "16px"
|
|
41
|
+
},
|
|
42
|
+
iconColor: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: ""
|
|
45
|
+
},
|
|
46
|
+
rotate: {
|
|
47
|
+
type: [String, Number],
|
|
48
|
+
default: 180
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
emits: ["update:active", "change"],
|
|
52
|
+
setup(props, { emit }) {
|
|
53
|
+
const changeVal = (val) => {
|
|
54
|
+
emit("update:active", val);
|
|
55
|
+
emit("change", val);
|
|
56
|
+
};
|
|
57
|
+
const changeValAry = (name) => {
|
|
58
|
+
const activeItem = props.active instanceof Object ? Object.values(props.active) : props.active;
|
|
59
|
+
let index2 = -1;
|
|
60
|
+
activeItem.forEach((item, idx) => {
|
|
61
|
+
if (String(item) == String(name)) {
|
|
62
|
+
index2 = idx;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
index2 > -1 ? activeItem.splice(index2, 1) : activeItem.push(name);
|
|
66
|
+
changeVal(activeItem);
|
|
67
|
+
};
|
|
68
|
+
const isExpanded = (name) => {
|
|
69
|
+
const { accordion, active } = props;
|
|
70
|
+
if (accordion) {
|
|
71
|
+
return typeof active === "number" || typeof active === "string" ? active == name : false;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
provide("collapseParent", {
|
|
75
|
+
children: [],
|
|
76
|
+
props,
|
|
77
|
+
changeValAry,
|
|
78
|
+
changeVal,
|
|
79
|
+
isExpanded
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
84
|
+
return openBlock(), createElementBlock("view", null, [
|
|
85
|
+
renderSlot(_ctx.$slots, "default")
|
|
86
|
+
]);
|
|
87
|
+
}
|
|
88
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
89
|
+
export { index as default };
|