@nutui/nutui 4.3.4 → 4.3.6
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 -1
- package/dist/nutui.es.js +1 -1
- package/dist/nutui.js +5358 -5629
- package/dist/nutui.umd.js +1 -1
- package/dist/packages/audio/Audio.js +2 -1
- package/dist/packages/audiooperate/AudioOperate.js +2 -1
- package/dist/packages/cell/Cell.js +89 -80
- package/dist/packages/cellgroup/CellGroup.js +44 -21
- package/dist/packages/checkbox/Checkbox.js +1 -1
- package/dist/packages/{common-DRG0ue26.js → common-BH7uB7Cn.js} +4 -2
- package/dist/packages/countdown/Countdown.js +130 -173
- package/dist/packages/form/Form.js +5 -5
- package/dist/packages/formitem/FormItem.js +5 -5
- package/dist/packages/grid/Grid.js +68 -5
- package/dist/packages/griditem/GridItem.js +61 -81
- package/dist/packages/input/Input.js +1 -1
- package/dist/packages/inputnumber/InputNumber.js +7 -7
- package/dist/packages/invoice/Invoice.js +4 -4
- package/dist/packages/picker/Picker.js +1 -1
- package/dist/packages/radio/Radio.js +112 -1
- package/dist/packages/radiogroup/RadioGroup.js +60 -1
- package/dist/packages/range/Range.js +1 -1
- package/dist/packages/rate/Rate.js +1 -1
- package/dist/packages/searchbar/Searchbar.js +1 -1
- package/dist/packages/skeleton/Skeleton.js +88 -123
- package/dist/packages/step/Step.js +64 -83
- package/dist/packages/steps/Steps.js +44 -40
- package/dist/packages/switch/Switch.js +1 -1
- package/dist/packages/tabpane/TabPane.js +2 -1
- package/dist/packages/tabs/Tabs.js +2 -1
- package/dist/packages/textarea/Textarea.js +1 -1
- package/dist/packages/types-BMA1Y94E.js +4 -0
- package/dist/packages/types-BXlnzugj.js +4 -0
- package/dist/packages/types-CJeZIBld.js +4 -0
- package/dist/packages/uploader/Uploader.js +1 -1
- package/dist/smartips/web-types.json +446 -26
- package/dist/types/__VUE/audio/index.vue.d.ts +2 -2
- package/dist/types/__VUE/audio/types.d.ts +2 -0
- package/dist/types/__VUE/audiooperate/index.vue.d.ts +1 -1
- package/dist/types/__VUE/cell/cell.vue.d.ts +113 -0
- package/dist/types/__VUE/cell/index.d.ts +6 -0
- package/dist/types/__VUE/cellgroup/cell-group.vue.d.ts +55 -0
- package/dist/types/__VUE/cellgroup/index.d.ts +5 -0
- package/dist/types/__VUE/countdown/countdown.vue.d.ts +108 -0
- package/dist/types/__VUE/countdown/index.d.ts +5 -0
- package/dist/types/__VUE/countdown/util.d.ts +14 -0
- package/dist/types/__VUE/form/common.d.ts +1 -0
- package/dist/types/__VUE/grid/grid.vue.d.ts +87 -0
- package/dist/types/__VUE/grid/index.d.ts +6 -0
- package/dist/types/__VUE/grid/types.d.ts +2 -0
- package/dist/types/__VUE/griditem/grid-item.vue.d.ts +64 -0
- package/dist/types/__VUE/griditem/index.d.ts +5 -0
- package/dist/types/__VUE/navbar/navbar.vue.d.ts +1 -1
- package/dist/types/__VUE/picker/Column.vue.d.ts +2 -2
- package/dist/types/__VUE/radio/index.d.ts +6 -0
- package/dist/types/__VUE/radio/radio.vue.d.ts +74 -0
- package/dist/types/__VUE/radiogroup/index.d.ts +5 -0
- package/dist/types/__VUE/radiogroup/radio-group.vue.d.ts +66 -0
- package/dist/types/__VUE/skeleton/index.d.ts +5 -0
- package/dist/types/__VUE/skeleton/skeleton.vue.d.ts +102 -0
- package/dist/types/__VUE/step/index.d.ts +5 -0
- package/dist/types/__VUE/step/step.vue.d.ts +55 -0
- package/dist/types/__VUE/steps/index.d.ts +6 -0
- package/dist/types/__VUE/steps/steps.vue.d.ts +64 -0
- package/dist/types/__VUE/swiper/index.vue.d.ts +2 -2
- package/dist/types/__VUE/tabs/index.vue.d.ts +1 -1
- package/dist/types/__VUE/tabs/types.d.ts +1 -0
- package/dist/types/__VUE/uploader/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +21 -11
- package/dist/types/utils/Interceptor.d.ts +2 -2
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/useRelation/useParent.d.ts +1 -1
- package/package.json +1 -1
- package/dist/packages/common-Chr7cC9o.js +0 -145
- package/dist/packages/index.vue_vue_type_script_lang-CTQUvlgN.js +0 -99
- package/dist/packages/index.vue_vue_type_script_lang-CaSiRl9x.js +0 -46
- package/dist/types/__VUE/audiooperate/types.d.ts +0 -1
- package/dist/types/__VUE/cell/index.vue.d.ts +0 -120
- package/dist/types/__VUE/cellgroup/index.vue.d.ts +0 -33
- package/dist/types/__VUE/countdown/index.vue.d.ts +0 -125
- package/dist/types/__VUE/grid/common.d.ts +0 -73
- package/dist/types/__VUE/grid/index.vue.d.ts +0 -84
- package/dist/types/__VUE/griditem/index.vue.d.ts +0 -47
- package/dist/types/__VUE/radio/index.vue.d.ts +0 -64
- package/dist/types/__VUE/radiogroup/index.vue.d.ts +0 -49
- package/dist/types/__VUE/skeleton/index.vue.d.ts +0 -117
- package/dist/types/__VUE/step/index.vue.d.ts +0 -42
- package/dist/types/__VUE/steps/index.vue.d.ts +0 -48
|
@@ -1,59 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
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 = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { defineComponent, computed, openBlock, createElementBlock, normalizeStyle, createElementVNode, normalizeClass, renderSlot, Fragment, createTextVNode, toDisplayString } from "vue";
|
|
21
|
+
import { u as useParent } from "../useParent-D6DiuxZZ.js";
|
|
4
22
|
import { p as pxCheck } from "../pxCheck-DN6FYV6q.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
onUnmounted(() => remove(instance));
|
|
14
|
-
const index2 = computed(() => internalChildren.indexOf(instance));
|
|
15
|
-
return {
|
|
16
|
-
parent,
|
|
17
|
-
index: index2
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
return {
|
|
21
|
-
parent: null,
|
|
22
|
-
index: ref(-1)
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
const { create, componentName } = createComponent("grid-item");
|
|
26
|
-
const _sfc_main = create({
|
|
23
|
+
import { u as useRouter } from "../index-aiGQ-EiA.js";
|
|
24
|
+
import { G as GRID_KEY } from "../types-CJeZIBld.js";
|
|
25
|
+
import { w as withInstall } from "../with-install-Ch3FF0uS.js";
|
|
26
|
+
const _hoisted_1 = { class: "nut-grid-item__text" };
|
|
27
|
+
const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
|
|
28
|
+
name: "NutGridItem"
|
|
29
|
+
}), {
|
|
30
|
+
__name: "grid-item",
|
|
27
31
|
props: {
|
|
28
|
-
text: {
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
to: {
|
|
33
|
-
type: [String, Object]
|
|
34
|
-
},
|
|
35
|
-
url: {
|
|
36
|
-
type: String,
|
|
37
|
-
default: ""
|
|
38
|
-
},
|
|
39
|
-
replace: {
|
|
40
|
-
type: Boolean,
|
|
41
|
-
default: false
|
|
42
|
-
}
|
|
32
|
+
text: {},
|
|
33
|
+
to: {},
|
|
34
|
+
url: { default: "" },
|
|
35
|
+
replace: { type: Boolean, default: false }
|
|
43
36
|
},
|
|
44
37
|
emits: ["click"],
|
|
45
|
-
setup(
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
const parent = Parent.parent.props;
|
|
51
|
-
const rootClass = computed(() => {
|
|
52
|
-
const prefixCls = componentName;
|
|
53
|
-
return {
|
|
54
|
-
[prefixCls]: true
|
|
55
|
-
};
|
|
56
|
-
});
|
|
38
|
+
setup(__props, { emit: __emit }) {
|
|
39
|
+
const props = __props;
|
|
40
|
+
const emit = __emit;
|
|
41
|
+
const { parent: parentObj, index } = useParent(GRID_KEY);
|
|
42
|
+
const parent = (parentObj == null ? void 0 : parentObj.props) || {};
|
|
57
43
|
const rootStyle = computed(() => {
|
|
58
44
|
const style = {
|
|
59
45
|
flexBasis: `${100 / +parent.columnNum}%`
|
|
@@ -62,14 +48,14 @@ const _sfc_main = create({
|
|
|
62
48
|
style.paddingTop = `${100 / +parent.columnNum}%`;
|
|
63
49
|
} else if (parent.gutter) {
|
|
64
50
|
style.paddingRight = pxCheck(parent.gutter);
|
|
65
|
-
if (
|
|
51
|
+
if (index.value >= +parent.columnNum) {
|
|
66
52
|
style.marginTop = pxCheck(parent.gutter);
|
|
67
53
|
}
|
|
68
54
|
}
|
|
69
55
|
return style;
|
|
70
56
|
});
|
|
71
57
|
const contentClass = computed(() => {
|
|
72
|
-
const prefixCls =
|
|
58
|
+
const prefixCls = `nut-grid-item__content`;
|
|
73
59
|
return {
|
|
74
60
|
[`${prefixCls}`]: true,
|
|
75
61
|
[`${prefixCls}--border`]: parent.border,
|
|
@@ -90,34 +76,28 @@ const _sfc_main = create({
|
|
|
90
76
|
props.replace ? location.replace(props.url) : location.href = props.url;
|
|
91
77
|
}
|
|
92
78
|
};
|
|
93
|
-
return {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
79
|
+
return (_ctx, _cache) => {
|
|
80
|
+
return openBlock(), createElementBlock("view", {
|
|
81
|
+
class: "nut-grid-item",
|
|
82
|
+
style: normalizeStyle(rootStyle.value),
|
|
83
|
+
onClick: handleClick
|
|
84
|
+
}, [
|
|
85
|
+
createElementVNode("view", {
|
|
86
|
+
class: normalizeClass(contentClass.value)
|
|
87
|
+
}, [
|
|
88
|
+
renderSlot(_ctx.$slots, "default"),
|
|
89
|
+
createElementVNode("view", _hoisted_1, [
|
|
90
|
+
_ctx.text ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
91
|
+
createTextVNode(toDisplayString(_ctx.text), 1)
|
|
92
|
+
], 64)) : renderSlot(_ctx.$slots, "text", { key: 1 })
|
|
93
|
+
])
|
|
94
|
+
], 2)
|
|
95
|
+
], 4);
|
|
98
96
|
};
|
|
99
97
|
}
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
103
|
-
return openBlock(), createElementBlock("view", {
|
|
104
|
-
class: normalizeClass(_ctx.rootClass),
|
|
105
|
-
style: normalizeStyle(_ctx.rootStyle),
|
|
106
|
-
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
|
|
107
|
-
}, [
|
|
108
|
-
createElementVNode("view", {
|
|
109
|
-
class: normalizeClass(_ctx.contentClass)
|
|
110
|
-
}, [
|
|
111
|
-
renderSlot(_ctx.$slots, "default"),
|
|
112
|
-
createElementVNode("view", _hoisted_1, [
|
|
113
|
-
_ctx.text ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
114
|
-
createTextVNode(toDisplayString(_ctx.text), 1)
|
|
115
|
-
], 64)) : renderSlot(_ctx.$slots, "text", { key: 1 })
|
|
116
|
-
])
|
|
117
|
-
], 2)
|
|
118
|
-
], 6);
|
|
119
|
-
}
|
|
120
|
-
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
98
|
+
}));
|
|
99
|
+
withInstall(_sfc_main);
|
|
121
100
|
export {
|
|
122
|
-
|
|
101
|
+
_sfc_main as GridItem,
|
|
102
|
+
_sfc_main as default
|
|
123
103
|
};
|
|
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
import { toRef, ref, reactive, computed, watch, onMounted, h, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, createCommentVNode, createBlock, resolveDynamicComponent, normalizeStyle, toDisplayString, createTextVNode, withDirectives, createVNode, mergeProps, vShow } from "vue";
|
|
18
18
|
import { MaskClose } from "@nutui/icons-vue";
|
|
19
19
|
import { c as createComponent } from "../component-DQf3CENX.js";
|
|
20
|
-
import { u as useFormDisabled } from "../common-
|
|
20
|
+
import { u as useFormDisabled } from "../common-BH7uB7Cn.js";
|
|
21
21
|
import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
|
|
22
22
|
function trimExtraChar(value, char, regExp) {
|
|
23
23
|
const index = value.indexOf(char);
|
|
@@ -17,14 +17,15 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { defineComponent, toRef, computed, watch, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, createVNode, unref,
|
|
20
|
+
import { defineComponent, toRef, computed, watch, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, createVNode, unref, mergeProps } from "vue";
|
|
21
21
|
import { p as pxCheck } from "../pxCheck-DN6FYV6q.js";
|
|
22
22
|
import { Minus, Plus } from "@nutui/icons-vue";
|
|
23
|
-
import { u as useFormDisabled } from "../common-
|
|
23
|
+
import { u as useFormDisabled } from "../common-BH7uB7Cn.js";
|
|
24
24
|
import { w as withInstall } from "../with-install-Ch3FF0uS.js";
|
|
25
25
|
const _hoisted_1 = ["min", "max", "disabled", "readonly", "value"];
|
|
26
26
|
const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
|
|
27
|
-
name: "NutInputNumber"
|
|
27
|
+
name: "NutInputNumber",
|
|
28
|
+
inheritAttrs: false
|
|
28
29
|
}), {
|
|
29
30
|
__name: "input-number",
|
|
30
31
|
props: {
|
|
@@ -152,18 +153,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
152
153
|
}, null, 8, ["width", "height"])
|
|
153
154
|
])
|
|
154
155
|
], 2),
|
|
155
|
-
createElementVNode("input", {
|
|
156
|
-
type: "number",
|
|
156
|
+
createElementVNode("input", mergeProps({ type: "number" }, _ctx.$attrs, {
|
|
157
157
|
min: _ctx.min,
|
|
158
158
|
max: _ctx.max,
|
|
159
|
-
style:
|
|
159
|
+
style: { width: unref(pxCheck)(_ctx.inputWidth), height: unref(pxCheck)(_ctx.buttonSize) },
|
|
160
160
|
disabled: unref(disabled),
|
|
161
161
|
readonly: _ctx.readonly,
|
|
162
162
|
value: _ctx.modelValue,
|
|
163
163
|
onInput: change,
|
|
164
164
|
onBlur: blur,
|
|
165
165
|
onFocus: focus
|
|
166
|
-
}, null,
|
|
166
|
+
}), null, 16, _hoisted_1),
|
|
167
167
|
createElementVNode("view", {
|
|
168
168
|
class: normalizeClass(["nut-input-number__icon nut-input-number__right", { "nut-input-number__icon--disabled": !addAllow() }]),
|
|
169
169
|
onClick: add
|
|
@@ -20,8 +20,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
20
20
|
import { defineComponent, ref, openBlock, createElementBlock, createVNode, unref, withCtx, Fragment, renderList, createBlock, createTextVNode, toDisplayString, createCommentVNode } from "vue";
|
|
21
21
|
import { Form as _sfc_main$1 } from "../form/Form.js";
|
|
22
22
|
import { FormItem as _sfc_main$2 } from "../formitem/FormItem.js";
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
23
|
+
import { Radio as _sfc_main$4 } from "../radio/Radio.js";
|
|
24
|
+
import { RadioGroup as _sfc_main$3 } from "../radiogroup/RadioGroup.js";
|
|
25
25
|
import { Button as _sfc_main$5 } from "../button/Button.js";
|
|
26
26
|
import NutInput from "../input/Input.js";
|
|
27
27
|
import { w as withInstall } from "../with-install-Ch3FF0uS.js";
|
|
@@ -66,14 +66,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
66
66
|
prop: item.formItemProp
|
|
67
67
|
}, {
|
|
68
68
|
default: withCtx(() => [
|
|
69
|
-
item.type === "radio" ? (openBlock(), createBlock(_sfc_main$3, {
|
|
69
|
+
item.type === "radio" ? (openBlock(), createBlock(unref(_sfc_main$3), {
|
|
70
70
|
key: 0,
|
|
71
71
|
modelValue: _ctx.formValue[item.formItemProp],
|
|
72
72
|
"onUpdate:modelValue": ($event) => _ctx.formValue[item.formItemProp] = $event
|
|
73
73
|
}, {
|
|
74
74
|
default: withCtx(() => [
|
|
75
75
|
(openBlock(true), createElementBlock(Fragment, null, renderList(item.radioLabel, (radioItem, radioIndex) => {
|
|
76
|
-
return openBlock(), createBlock(_sfc_main$4, {
|
|
76
|
+
return openBlock(), createBlock(unref(_sfc_main$4), {
|
|
77
77
|
key: radioIndex,
|
|
78
78
|
shape: "button",
|
|
79
79
|
label: radioItem.label
|
|
@@ -1,4 +1,115 @@
|
|
|
1
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
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 = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { defineComponent, toRef, inject, computed, openBlock, createElementBlock, normalizeClass, renderSlot, Fragment, createVNode, unref, createElementVNode } from "vue";
|
|
21
|
+
import { CheckChecked, CheckNormal } from "@nutui/icons-vue";
|
|
22
|
+
import { p as pxCheck } from "../pxCheck-DN6FYV6q.js";
|
|
23
|
+
import { R as RADIO_KEY } from "../types-BODurTjN.js";
|
|
24
|
+
import { u as useFormDisabled } from "../common-BH7uB7Cn.js";
|
|
25
|
+
import { w as withInstall } from "../with-install-Ch3FF0uS.js";
|
|
26
|
+
const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
|
|
27
|
+
name: "NutRadio"
|
|
28
|
+
}), {
|
|
29
|
+
__name: "radio",
|
|
30
|
+
props: {
|
|
31
|
+
disabled: { type: Boolean, default: false },
|
|
32
|
+
shape: { default: "round" },
|
|
33
|
+
label: { type: [String, Number, Boolean], default: "" },
|
|
34
|
+
iconSize: { default: "" },
|
|
35
|
+
size: { default: "normal" }
|
|
36
|
+
},
|
|
37
|
+
setup(__props) {
|
|
38
|
+
const props = __props;
|
|
39
|
+
const disabled = useFormDisabled(toRef(props, "disabled"));
|
|
40
|
+
const parent = inject(RADIO_KEY, null);
|
|
41
|
+
const checked = computed(() => {
|
|
42
|
+
return parent.label.value === props.label;
|
|
43
|
+
});
|
|
44
|
+
const iconClasses = computed(() => {
|
|
45
|
+
return !disabled.value ? checked.value ? "nut-radio__icon" : "nut-radio__icon--unchecked" : "nut-radio__icon--disable";
|
|
46
|
+
});
|
|
47
|
+
const realIconSize = computed(() => {
|
|
48
|
+
return pxCheck(props.iconSize);
|
|
49
|
+
});
|
|
50
|
+
const labelClasses = computed(() => {
|
|
51
|
+
return {
|
|
52
|
+
"nut-radio__label": true,
|
|
53
|
+
"nut-radio__label--disabled": disabled.value
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
const buttonClasses = computed(() => {
|
|
57
|
+
return {
|
|
58
|
+
"nut-radio__button": true,
|
|
59
|
+
"nut-radio__button--active": checked.value,
|
|
60
|
+
[`nut-radio__button--${props.size}`]: true,
|
|
61
|
+
"nut-radio__button--disabled": props.disabled
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
const handleClick = () => {
|
|
65
|
+
if (checked.value || disabled.value)
|
|
66
|
+
return;
|
|
67
|
+
parent.updateValue(props.label);
|
|
68
|
+
};
|
|
69
|
+
const reverseState = computed(() => parent.position.value === "left");
|
|
70
|
+
const radioClasses = computed(() => {
|
|
71
|
+
return {
|
|
72
|
+
"nut-radio": true,
|
|
73
|
+
[`nut-radio--${props.shape}`]: true,
|
|
74
|
+
"nut-radio--reverse": reverseState.value
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
return (_ctx, _cache) => {
|
|
78
|
+
return openBlock(), createElementBlock("div", {
|
|
79
|
+
class: normalizeClass(radioClasses.value),
|
|
80
|
+
onClick: handleClick
|
|
81
|
+
}, [
|
|
82
|
+
_ctx.shape === "button" ? (openBlock(), createElementBlock("div", {
|
|
83
|
+
key: 0,
|
|
84
|
+
class: normalizeClass(buttonClasses.value)
|
|
85
|
+
}, [
|
|
86
|
+
renderSlot(_ctx.$slots, "default")
|
|
87
|
+
], 2)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
88
|
+
checked.value ? renderSlot(_ctx.$slots, "checkedIcon", { key: 0 }, () => [
|
|
89
|
+
createVNode(unref(CheckChecked), {
|
|
90
|
+
width: realIconSize.value,
|
|
91
|
+
height: realIconSize.value,
|
|
92
|
+
class: normalizeClass(iconClasses.value)
|
|
93
|
+
}, null, 8, ["width", "height", "class"])
|
|
94
|
+
]) : renderSlot(_ctx.$slots, "icon", { key: 1 }, () => [
|
|
95
|
+
createVNode(unref(CheckNormal), {
|
|
96
|
+
width: realIconSize.value,
|
|
97
|
+
height: realIconSize.value,
|
|
98
|
+
class: normalizeClass(iconClasses.value)
|
|
99
|
+
}, null, 8, ["width", "height", "class"])
|
|
100
|
+
]),
|
|
101
|
+
createElementVNode("div", {
|
|
102
|
+
class: normalizeClass(labelClasses.value)
|
|
103
|
+
}, [
|
|
104
|
+
renderSlot(_ctx.$slots, "default")
|
|
105
|
+
], 2)
|
|
106
|
+
], 64))
|
|
107
|
+
], 2);
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}));
|
|
111
|
+
withInstall(_sfc_main);
|
|
2
112
|
export {
|
|
113
|
+
_sfc_main as Radio,
|
|
3
114
|
_sfc_main as default
|
|
4
115
|
};
|
|
@@ -1,4 +1,63 @@
|
|
|
1
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
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 = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { defineComponent, provide, readonly, computed, watch, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
|
|
21
|
+
import { R as RADIO_KEY } from "../types-BODurTjN.js";
|
|
22
|
+
import { w as withInstall } from "../with-install-Ch3FF0uS.js";
|
|
23
|
+
const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
|
|
24
|
+
name: "NutRadioGroup"
|
|
25
|
+
}), {
|
|
26
|
+
__name: "radio-group",
|
|
27
|
+
props: {
|
|
28
|
+
modelValue: { type: [String, Number, Boolean], default: "" },
|
|
29
|
+
direction: { default: "vertical" },
|
|
30
|
+
textPosition: { default: "right" }
|
|
31
|
+
},
|
|
32
|
+
emits: ["change", "update:modelValue"],
|
|
33
|
+
setup(__props, { emit: __emit }) {
|
|
34
|
+
const props = __props;
|
|
35
|
+
const emit = __emit;
|
|
36
|
+
const updateValue = (value) => {
|
|
37
|
+
emit("update:modelValue", value);
|
|
38
|
+
};
|
|
39
|
+
provide(RADIO_KEY, {
|
|
40
|
+
label: readonly(computed(() => props.modelValue)),
|
|
41
|
+
position: readonly(computed(() => props.textPosition)),
|
|
42
|
+
updateValue
|
|
43
|
+
});
|
|
44
|
+
watch(
|
|
45
|
+
() => props.modelValue,
|
|
46
|
+
(value) => {
|
|
47
|
+
emit("change", value);
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
return (_ctx, _cache) => {
|
|
51
|
+
return openBlock(), createElementBlock("div", {
|
|
52
|
+
class: normalizeClass(["nut-radio-group", `nut-radio-group--${_ctx.direction}`])
|
|
53
|
+
}, [
|
|
54
|
+
renderSlot(_ctx.$slots, "default")
|
|
55
|
+
], 2);
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}));
|
|
59
|
+
withInstall(_sfc_main);
|
|
2
60
|
export {
|
|
61
|
+
_sfc_main as RadioGroup,
|
|
3
62
|
_sfc_main as default
|
|
4
63
|
};
|
|
@@ -22,7 +22,7 @@ import { c as createComponent } from "../component-DQf3CENX.js";
|
|
|
22
22
|
import { a as isArray } from "../util-DnfK0Qan.js";
|
|
23
23
|
import { u as useTouch } from "../index-I8tfW3Kf.js";
|
|
24
24
|
import { u as useRect } from "../index-B1qsj2XR.js";
|
|
25
|
-
import { u as useFormDisabled } from "../common-
|
|
25
|
+
import { u as useFormDisabled } from "../common-BH7uB7Cn.js";
|
|
26
26
|
import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
|
|
27
27
|
const { componentName, create } = createComponent("range");
|
|
28
28
|
const _sfc_main = create({
|
|
@@ -22,7 +22,7 @@ import { StarFillN } from "@nutui/icons-vue";
|
|
|
22
22
|
import { r as renderIcon } from "../renderIcon-BfOvhG7i.js";
|
|
23
23
|
import { p as pxCheck } from "../pxCheck-DN6FYV6q.js";
|
|
24
24
|
import { u as useTouch } from "../index-I8tfW3Kf.js";
|
|
25
|
-
import { u as useFormDisabled } from "../common-
|
|
25
|
+
import { u as useFormDisabled } from "../common-BH7uB7Cn.js";
|
|
26
26
|
import { w as withInstall } from "../with-install-Ch3FF0uS.js";
|
|
27
27
|
const _hoisted_1 = ["id"];
|
|
28
28
|
const _hoisted_2 = { class: "nut-rate-item__icon--full" };
|
|
@@ -22,7 +22,7 @@ import { c as createComponent } from "../component-DQf3CENX.js";
|
|
|
22
22
|
import { r as renderIcon } from "../renderIcon-BfOvhG7i.js";
|
|
23
23
|
import { CircleClose } from "@nutui/icons-vue";
|
|
24
24
|
import { u as useLocale } from "../index-CFigyH92.js";
|
|
25
|
-
import { u as useFormDisabled } from "../common-
|
|
25
|
+
import { u as useFormDisabled } from "../common-BH7uB7Cn.js";
|
|
26
26
|
import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
|
|
27
27
|
const { create } = createComponent("searchbar");
|
|
28
28
|
const cN = "NutSearchbar";
|