@nutui/nutui 4.0.11 → 4.0.12
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 +1 -1
- package/dist/nutui.js +2 -2
- package/dist/nutui.umd.js +1 -1
- package/dist/packages/_es/ActionSheet.js +111 -78
- package/dist/packages/_es/Address.js +375 -250
- package/dist/packages/_es/AddressList.js +354 -269
- package/dist/packages/_es/Animate.js +58 -41
- package/dist/packages/_es/Audio.js +197 -128
- package/dist/packages/_es/AudioOperate.js +71 -60
- package/dist/packages/_es/Avatar.js +89 -66
- package/dist/packages/_es/AvatarGroup.js +31 -23
- package/dist/packages/_es/Backtop.js +99 -59
- package/dist/packages/_es/Badge.js +47 -36
- package/dist/packages/_es/Barrage.js +147 -68
- package/dist/packages/_es/Button.js +66 -47
- package/dist/packages/_es/Calendar.js +157 -135
- package/dist/packages/_es/CalendarItem.js +6 -6
- package/dist/packages/_es/Card.js +56 -42
- package/dist/packages/_es/Cascader.js +474 -315
- package/dist/packages/_es/Category.js +39 -29
- package/dist/packages/_es/CategoryPane.js +83 -57
- package/dist/packages/_es/Cell.js +71 -56
- package/dist/packages/_es/CellGroup.js +27 -19
- package/dist/packages/_es/Checkbox.js +156 -109
- package/dist/packages/_es/CheckboxGroup.js +59 -38
- package/dist/packages/_es/CircleProgress.js +96 -67
- package/dist/packages/_es/Col.js +31 -23
- package/dist/packages/_es/Collapse.js +58 -33
- package/dist/packages/_es/CollapseItem.js +108 -78
- package/dist/packages/_es/Comment.js +279 -207
- package/dist/packages/_es/ConfigProvider.js +55 -37
- package/dist/packages/_es/Countdown.js +212 -100
- package/dist/packages/_es/Countup.js +445 -232
- package/dist/packages/_es/DatePicker.js +265 -162
- package/dist/packages/_es/Dialog.js +213 -161
- package/dist/packages/_es/Divider.js +57 -42
- package/dist/packages/_es/Drag.js +153 -70
- package/dist/packages/_es/Ecard.js +104 -64
- package/dist/packages/_es/Elevator.js +219 -143
- package/dist/packages/_es/Ellipsis.js +178 -95
- package/dist/packages/_es/Empty.js +39 -23
- package/dist/packages/_es/FixedNav.js +116 -93
- package/dist/packages/_es/Form.js +178 -107
- package/dist/packages/_es/FormItem.js +61 -48
- package/dist/packages/_es/Grid.js +6 -5
- package/dist/packages/_es/GridItem.js +84 -58
- package/dist/packages/_es/Image.js +130 -90
- package/dist/packages/_es/ImagePreview.js +412 -256
- package/dist/packages/_es/Indicator.js +34 -30
- package/dist/packages/_es/InfiniteLoading.js +136 -83
- package/dist/packages/_es/Input.js +264 -160
- package/dist/packages/_es/InputNumber.js +117 -81
- package/dist/packages/_es/Interceptor-956b24fc.js +29 -0
- package/dist/packages/_es/Invoice.js +130 -104
- package/dist/packages/_es/Layout.js +4 -3
- package/dist/packages/_es/List.js +215 -117
- package/dist/packages/_es/Menu.js +150 -95
- package/dist/packages/_es/MenuItem.js +154 -109
- package/dist/packages/_es/Navbar.js +119 -103
- package/dist/packages/_es/Noticebar.js +312 -197
- package/dist/packages/_es/Notify.js +166 -110
- package/dist/packages/_es/NumberKeyboard.js +202 -127
- package/dist/packages/_es/Overlay.js +80 -52
- package/dist/packages/_es/Pagination.js +100 -70
- package/dist/packages/_es/Picker.js +437 -275
- package/dist/packages/_es/Popover.js +225 -122
- package/dist/packages/_es/Popup.js +4 -4
- package/dist/packages/_es/Price.js +82 -44
- package/dist/packages/_es/Progress.js +79 -63
- package/dist/packages/_es/PullRefresh.js +173 -95
- package/dist/packages/_es/Radio.js +4 -4
- package/dist/packages/_es/RadioGroup.js +3 -3
- package/dist/packages/_es/Range.js +347 -204
- package/dist/packages/_es/Rate.js +141 -92
- package/dist/packages/_es/Row.js +27 -21
- package/dist/packages/_es/Searchbar.js +174 -123
- package/dist/packages/_es/ShortPassword.js +93 -69
- package/dist/packages/_es/SideNavbar.js +80 -49
- package/dist/packages/_es/SideNavbarItem.js +32 -22
- package/dist/packages/_es/Signature.js +146 -83
- package/dist/packages/_es/Skeleton.js +130 -110
- package/dist/packages/_es/Sku.js +343 -250
- package/dist/packages/_es/Step.js +86 -59
- package/dist/packages/_es/Steps.js +31 -26
- package/dist/packages/_es/Sticky.js +4 -4
- package/dist/packages/_es/SubSideNavbar.js +74 -52
- package/dist/packages/_es/Swipe.js +155 -83
- package/dist/packages/_es/Swiper.js +311 -174
- package/dist/packages/_es/SwiperItem.js +44 -28
- package/dist/packages/_es/Switch.js +68 -55
- package/dist/packages/_es/TabPane.js +41 -30
- package/dist/packages/_es/Tabbar.js +52 -41
- package/dist/packages/_es/TabbarItem.js +82 -61
- package/dist/packages/_es/Table.js +165 -109
- package/dist/packages/_es/Tabs.js +388 -240
- package/dist/packages/_es/Tag.js +61 -44
- package/dist/packages/_es/Textarea.js +124 -80
- package/dist/packages/_es/TimeDetail.js +76 -49
- package/dist/packages/_es/TimePannel.js +48 -34
- package/dist/packages/_es/TimeSelect.js +68 -47
- package/dist/packages/_es/Toast.js +218 -144
- package/dist/packages/_es/Tour.js +192 -138
- package/dist/packages/_es/TrendArrow.js +77 -57
- package/dist/packages/_es/Uploader.js +359 -234
- package/dist/packages/_es/Video.js +316 -191
- package/dist/packages/_es/Watermark.js +117 -84
- package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +10 -0
- package/dist/packages/_es/common-b9a5e726.js +145 -0
- package/dist/packages/_es/component-81a4c1d0.js +145 -0
- package/dist/packages/_es/index-29892cda.js +33 -0
- package/dist/packages/_es/index-43c34ac6.js +30 -0
- package/dist/packages/_es/index-54d03fc1.js +8 -0
- package/dist/packages/_es/index-79c5dc33.js +10 -0
- package/dist/packages/_es/index-7a7385e4.js +67 -0
- package/dist/packages/_es/index-87422be8.js +942 -0
- package/dist/packages/_es/index-da0a7662.js +259 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +46 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-a8856969.js +97 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +151 -0
- package/dist/packages/_es/mountComponent-8b24c346.js +39 -0
- package/dist/packages/_es/pxCheck-c6b9f6b7.js +6 -0
- package/dist/packages/_es/raf-729dad54.js +25 -0
- package/dist/packages/_es/renderIcon-3d0fd47c.js +9 -0
- package/dist/packages/locale/lang/baseLang-3a8457ac.js +5 -0
- package/dist/packages/locale/lang/en-US.js +39 -36
- package/dist/packages/locale/lang/id-ID.js +39 -36
- package/dist/packages/locale/lang/index.js +44 -22
- package/dist/packages/locale/lang/zh-CN.js +38 -35
- package/dist/packages/locale/lang/zh-TW.js +38 -35
- package/dist/resolver/index.js +26 -1
- package/dist/resolver/index.mjs +17 -14
- package/dist/smartips/web-types.json +1 -1
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +48 -48
- package/dist/styles/themes/jdb.scss +48 -48
- package/dist/styles/themes/jddkh.scss +48 -48
- package/dist/styles/themes/jdt.scss +48 -48
- package/dist/types/index.d.ts +1 -1
- package/package.json +3 -4
- package/dist/packages/_es/Interceptor-6e26b757.js +0 -18
- package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +0 -9
- package/dist/packages/_es/common-d218746f.js +0 -116
- package/dist/packages/_es/component-234624bc.js +0 -89
- package/dist/packages/_es/index-14dfadc4.js +0 -561
- package/dist/packages/_es/index-192a3ef6.js +0 -29
- package/dist/packages/_es/index-360c5092.js +0 -210
- package/dist/packages/_es/index-496e6e05.js +0 -24
- package/dist/packages/_es/index-50eed3d9.js +0 -7
- package/dist/packages/_es/index-53ec2d4d.js +0 -34
- package/dist/packages/_es/index-fadb0974.js +0 -8
- package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +0 -43
- package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +0 -77
- package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +0 -110
- package/dist/packages/_es/mountComponent-6d4ff200.js +0 -23
- package/dist/packages/_es/pxCheck-38173291.js +0 -4
- package/dist/packages/_es/raf-a74f1a06.js +0 -16
- package/dist/packages/_es/renderIcon-47498b32.js +0 -5
- package/dist/packages/locale/lang/baseLang-0bdc6353.js +0 -5
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { computed
|
|
2
|
-
import { c as
|
|
3
|
-
import { p as
|
|
4
|
-
import { Minus
|
|
5
|
-
import { _ as
|
|
1
|
+
import { computed, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, createVNode, normalizeStyle } from "vue";
|
|
2
|
+
import { c as createComponent } from "./component-81a4c1d0.js";
|
|
3
|
+
import { p as pxCheck } from "./pxCheck-c6b9f6b7.js";
|
|
4
|
+
import { Minus, Plus } from "@nutui/icons-vue";
|
|
5
|
+
import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
|
|
6
6
|
import "../locale/lang";
|
|
7
|
-
const { componentName
|
|
8
|
-
|
|
7
|
+
const { componentName, create } = createComponent("input-number");
|
|
8
|
+
const _sfc_main = create({
|
|
9
|
+
components: { Minus, Plus },
|
|
9
10
|
props: {
|
|
10
11
|
modelValue: {
|
|
11
12
|
type: [Number, String],
|
|
@@ -37,102 +38,137 @@ const { componentName: v, create: $ } = C("input-number"), A = $({
|
|
|
37
38
|
},
|
|
38
39
|
disabled: {
|
|
39
40
|
type: Boolean,
|
|
40
|
-
default:
|
|
41
|
+
default: false
|
|
41
42
|
},
|
|
42
43
|
readonly: {
|
|
43
44
|
type: Boolean,
|
|
44
|
-
default:
|
|
45
|
+
default: false
|
|
45
46
|
}
|
|
46
47
|
},
|
|
47
48
|
emits: ["update:modelValue", "change", "blur", "focus", "reduce", "add", "overlimit"],
|
|
48
|
-
setup(
|
|
49
|
-
const
|
|
50
|
-
const
|
|
49
|
+
setup(props, { emit }) {
|
|
50
|
+
const classes = computed(() => {
|
|
51
|
+
const prefixCls = componentName;
|
|
51
52
|
return {
|
|
52
|
-
[
|
|
53
|
-
[`${
|
|
53
|
+
[prefixCls]: true,
|
|
54
|
+
[`${prefixCls}--disabled`]: props.disabled
|
|
54
55
|
};
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
});
|
|
57
|
+
const fixedDecimalPlaces = (v) => {
|
|
58
|
+
return Number(v).toFixed(Number(props.decimalPlaces));
|
|
59
|
+
};
|
|
60
|
+
const change = (event) => {
|
|
61
|
+
const input = event.target;
|
|
62
|
+
emit("update:modelValue", input.valueAsNumber, event);
|
|
63
|
+
};
|
|
64
|
+
const emitChange = (value, event) => {
|
|
65
|
+
let output_value = fixedDecimalPlaces(value);
|
|
66
|
+
emit("update:modelValue", output_value, event);
|
|
67
|
+
emit("change", output_value, event);
|
|
68
|
+
};
|
|
69
|
+
const addAllow = (value = Number(props.modelValue)) => {
|
|
70
|
+
return value < Number(props.max) && !props.disabled;
|
|
71
|
+
};
|
|
72
|
+
const reduceAllow = (value = Number(props.modelValue)) => {
|
|
73
|
+
return value > Number(props.min) && !props.disabled;
|
|
74
|
+
};
|
|
75
|
+
const reduce = (event) => {
|
|
76
|
+
emit("reduce", event);
|
|
77
|
+
if (reduceAllow()) {
|
|
78
|
+
let output_value = Number(props.modelValue) - Number(props.step);
|
|
79
|
+
emitChange(output_value, event);
|
|
80
|
+
} else {
|
|
81
|
+
emit("overlimit", event, "reduce");
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const add = (event) => {
|
|
85
|
+
emit("add", event);
|
|
86
|
+
if (addAllow()) {
|
|
87
|
+
let output_value = Number(props.modelValue) + Number(props.step);
|
|
88
|
+
emitChange(output_value, event);
|
|
89
|
+
} else {
|
|
90
|
+
emit("overlimit", event, "add");
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
const focus = (event) => {
|
|
94
|
+
if (props.disabled)
|
|
95
|
+
return;
|
|
96
|
+
if (props.readonly)
|
|
97
|
+
return;
|
|
98
|
+
emit("focus", event);
|
|
99
|
+
};
|
|
100
|
+
const blur = (event) => {
|
|
101
|
+
if (props.disabled)
|
|
102
|
+
return;
|
|
103
|
+
if (props.readonly)
|
|
104
|
+
return;
|
|
105
|
+
const input = event.target;
|
|
106
|
+
let value = input.valueAsNumber;
|
|
107
|
+
if (value < Number(props.min)) {
|
|
108
|
+
value = Number(props.min);
|
|
109
|
+
} else if (value > Number(props.max)) {
|
|
110
|
+
value = Number(props.max);
|
|
111
|
+
}
|
|
112
|
+
emitChange(value, event);
|
|
113
|
+
emit("blur", event);
|
|
114
|
+
};
|
|
62
115
|
return {
|
|
63
|
-
classes
|
|
64
|
-
change
|
|
65
|
-
blur
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
e.disabled || e.readonly || n("focus", u);
|
|
73
|
-
},
|
|
74
|
-
add: (u) => {
|
|
75
|
-
if (n("add", u), d()) {
|
|
76
|
-
let t = Number(e.modelValue) + Number(e.step);
|
|
77
|
-
i(t, u);
|
|
78
|
-
} else
|
|
79
|
-
n("overlimit", u, "add");
|
|
80
|
-
},
|
|
81
|
-
addAllow: d,
|
|
82
|
-
reduce: (u) => {
|
|
83
|
-
if (n("reduce", u), o()) {
|
|
84
|
-
let t = Number(e.modelValue) - Number(e.step);
|
|
85
|
-
i(t, u);
|
|
86
|
-
} else
|
|
87
|
-
n("overlimit", u, "reduce");
|
|
88
|
-
},
|
|
89
|
-
reduceAllow: o,
|
|
90
|
-
pxCheck: w
|
|
116
|
+
classes,
|
|
117
|
+
change,
|
|
118
|
+
blur,
|
|
119
|
+
focus,
|
|
120
|
+
add,
|
|
121
|
+
addAllow,
|
|
122
|
+
reduce,
|
|
123
|
+
reduceAllow,
|
|
124
|
+
pxCheck
|
|
91
125
|
};
|
|
92
126
|
}
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
127
|
+
});
|
|
128
|
+
const _hoisted_1 = ["min", "max", "disabled", "readonly", "value"];
|
|
129
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
130
|
+
const _component_Minus = resolveComponent("Minus");
|
|
131
|
+
const _component_Plus = resolveComponent("Plus");
|
|
132
|
+
return openBlock(), createElementBlock("view", {
|
|
133
|
+
class: normalizeClass(_ctx.classes)
|
|
98
134
|
}, [
|
|
99
|
-
|
|
100
|
-
class:
|
|
101
|
-
onClick:
|
|
135
|
+
createElementVNode("view", {
|
|
136
|
+
class: normalizeClass(["nut-input-number__icon nut-input-number__left", { "nut-input-number__icon--disabled": !_ctx.reduceAllow() }]),
|
|
137
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.reduce && _ctx.reduce(...args))
|
|
102
138
|
}, [
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
width:
|
|
106
|
-
height:
|
|
139
|
+
renderSlot(_ctx.$slots, "left-icon", {}, () => [
|
|
140
|
+
createVNode(_component_Minus, {
|
|
141
|
+
width: _ctx.pxCheck(_ctx.buttonSize),
|
|
142
|
+
height: _ctx.pxCheck(_ctx.buttonSize)
|
|
107
143
|
}, null, 8, ["width", "height"])
|
|
108
144
|
])
|
|
109
145
|
], 2),
|
|
110
|
-
|
|
146
|
+
createElementVNode("input", {
|
|
111
147
|
type: "number",
|
|
112
|
-
min:
|
|
113
|
-
max:
|
|
114
|
-
style:
|
|
115
|
-
disabled:
|
|
116
|
-
readonly:
|
|
117
|
-
value:
|
|
118
|
-
onInput:
|
|
119
|
-
onBlur:
|
|
120
|
-
onFocus:
|
|
121
|
-
}, null, 44,
|
|
122
|
-
|
|
123
|
-
class:
|
|
124
|
-
onClick:
|
|
148
|
+
min: _ctx.min,
|
|
149
|
+
max: _ctx.max,
|
|
150
|
+
style: normalizeStyle({ width: _ctx.pxCheck(_ctx.inputWidth), height: _ctx.pxCheck(_ctx.buttonSize) }),
|
|
151
|
+
disabled: _ctx.disabled,
|
|
152
|
+
readonly: _ctx.readonly,
|
|
153
|
+
value: _ctx.modelValue,
|
|
154
|
+
onInput: _cache[1] || (_cache[1] = (...args) => _ctx.change && _ctx.change(...args)),
|
|
155
|
+
onBlur: _cache[2] || (_cache[2] = (...args) => _ctx.blur && _ctx.blur(...args)),
|
|
156
|
+
onFocus: _cache[3] || (_cache[3] = (...args) => _ctx.focus && _ctx.focus(...args))
|
|
157
|
+
}, null, 44, _hoisted_1),
|
|
158
|
+
createElementVNode("view", {
|
|
159
|
+
class: normalizeClass(["nut-input-number__icon nut-input-number__right", { "nut-input-number__icon--disabled": !_ctx.addAllow() }]),
|
|
160
|
+
onClick: _cache[4] || (_cache[4] = (...args) => _ctx.add && _ctx.add(...args))
|
|
125
161
|
}, [
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
width:
|
|
129
|
-
height:
|
|
162
|
+
renderSlot(_ctx.$slots, "right-icon", {}, () => [
|
|
163
|
+
createVNode(_component_Plus, {
|
|
164
|
+
width: _ctx.pxCheck(_ctx.buttonSize),
|
|
165
|
+
height: _ctx.pxCheck(_ctx.buttonSize)
|
|
130
166
|
}, null, 8, ["width", "height"])
|
|
131
167
|
])
|
|
132
168
|
], 2)
|
|
133
169
|
], 2);
|
|
134
170
|
}
|
|
135
|
-
const
|
|
171
|
+
const InputNumber = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
136
172
|
export {
|
|
137
|
-
|
|
173
|
+
InputNumber as default
|
|
138
174
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { f as isPromise } from "./component-81a4c1d0.js";
|
|
2
|
+
const funInterceptor = (interceptor, {
|
|
3
|
+
args = [],
|
|
4
|
+
done,
|
|
5
|
+
canceled
|
|
6
|
+
}) => {
|
|
7
|
+
if (interceptor) {
|
|
8
|
+
const returnVal = interceptor.apply(null, args);
|
|
9
|
+
if (isPromise(returnVal)) {
|
|
10
|
+
returnVal.then((value) => {
|
|
11
|
+
if (value) {
|
|
12
|
+
done(value);
|
|
13
|
+
} else if (canceled) {
|
|
14
|
+
canceled();
|
|
15
|
+
}
|
|
16
|
+
}).catch(() => {
|
|
17
|
+
});
|
|
18
|
+
} else if (returnVal) {
|
|
19
|
+
done();
|
|
20
|
+
} else if (canceled) {
|
|
21
|
+
canceled();
|
|
22
|
+
}
|
|
23
|
+
} else {
|
|
24
|
+
done();
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
funInterceptor as f
|
|
29
|
+
};
|
|
@@ -1,36 +1,44 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
import {
|
|
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 { ref, reactive, computed, onMounted, watch, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createVNode, withCtx, Fragment, renderList, createBlock, createTextVNode, toDisplayString, withDirectives, vModelText, createCommentVNode } from "vue";
|
|
21
|
+
import { c as createComponent } from "./component-81a4c1d0.js";
|
|
22
|
+
import Form from "./Form.js";
|
|
23
|
+
import FormItem from "./FormItem.js";
|
|
24
|
+
import { _ as _sfc_main$1 } from "./index.vue_vue_type_script_lang-a8856969.js";
|
|
25
|
+
import { _ as _sfc_main$2 } from "./index.vue_vue_type_script_lang-22dfc112.js";
|
|
26
|
+
import Button from "./Button.js";
|
|
27
|
+
import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
|
|
21
28
|
import "../locale/lang";
|
|
22
29
|
import "./CellGroup.js";
|
|
23
|
-
import "./pxCheck-
|
|
30
|
+
import "./pxCheck-c6b9f6b7.js";
|
|
24
31
|
import "./Cell.js";
|
|
25
|
-
import "./index-
|
|
32
|
+
import "./index-54d03fc1.js";
|
|
26
33
|
import "@nutui/icons-vue";
|
|
27
|
-
const { componentName
|
|
34
|
+
const { componentName, create } = createComponent("invoice");
|
|
35
|
+
const _sfc_main = create({
|
|
28
36
|
components: {
|
|
29
|
-
[
|
|
30
|
-
[
|
|
31
|
-
[
|
|
32
|
-
[
|
|
33
|
-
[
|
|
37
|
+
[Form.name]: Form,
|
|
38
|
+
[FormItem.name]: FormItem,
|
|
39
|
+
[_sfc_main$1.name]: _sfc_main$1,
|
|
40
|
+
[_sfc_main$2.name]: _sfc_main$2,
|
|
41
|
+
[Button.name]: Button
|
|
34
42
|
},
|
|
35
43
|
props: {
|
|
36
44
|
data: {
|
|
@@ -43,107 +51,125 @@ const { componentName: X, create: Y } = Q("invoice"), Z = Y({
|
|
|
43
51
|
},
|
|
44
52
|
submit: {
|
|
45
53
|
type: Boolean,
|
|
46
|
-
default:
|
|
54
|
+
default: true
|
|
47
55
|
}
|
|
48
56
|
},
|
|
49
57
|
emits: ["onSubmit", "scroll-bottom"],
|
|
50
|
-
setup(
|
|
51
|
-
const
|
|
58
|
+
setup(props, { emit }) {
|
|
59
|
+
const formRef = ref();
|
|
60
|
+
const list = ref([]);
|
|
61
|
+
const state = reactive({
|
|
52
62
|
// list: []
|
|
53
|
-
}), b = M(() => ({
|
|
54
|
-
[X]: !0
|
|
55
|
-
}));
|
|
56
|
-
T(() => {
|
|
57
|
-
s();
|
|
58
63
|
});
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
const classes = computed(() => {
|
|
65
|
+
const prefixCls = componentName;
|
|
66
|
+
return {
|
|
67
|
+
[prefixCls]: true
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
onMounted(() => {
|
|
71
|
+
init();
|
|
72
|
+
});
|
|
73
|
+
const init = () => {
|
|
74
|
+
list.value = props.data;
|
|
75
|
+
};
|
|
76
|
+
const submitFun = () => {
|
|
77
|
+
formRef.value.validate().then(({ valid, errors }) => {
|
|
78
|
+
emit("onSubmit", valid, errors);
|
|
64
79
|
});
|
|
65
80
|
};
|
|
66
|
-
|
|
67
|
-
() =>
|
|
68
|
-
() =>
|
|
69
|
-
{ deep:
|
|
70
|
-
)
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
81
|
+
watch(
|
|
82
|
+
() => props.data,
|
|
83
|
+
() => init(),
|
|
84
|
+
{ deep: true }
|
|
85
|
+
);
|
|
86
|
+
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
|
87
|
+
classes,
|
|
88
|
+
formRef,
|
|
89
|
+
list,
|
|
90
|
+
submitFun
|
|
75
91
|
});
|
|
76
92
|
}
|
|
77
|
-
})
|
|
93
|
+
});
|
|
94
|
+
const _hoisted_1 = ["placeholder", "onUpdate:modelValue"];
|
|
95
|
+
const _hoisted_2 = {
|
|
78
96
|
key: 0,
|
|
79
97
|
class: "nut-invoice__submit"
|
|
80
98
|
};
|
|
81
|
-
function
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
99
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
100
|
+
const _component_nut_radio = resolveComponent("nut-radio");
|
|
101
|
+
const _component_nut_radio_group = resolveComponent("nut-radio-group");
|
|
102
|
+
const _component_nut_form_item = resolveComponent("nut-form-item");
|
|
103
|
+
const _component_nut_form = resolveComponent("nut-form");
|
|
104
|
+
const _component_nut_button = resolveComponent("nut-button");
|
|
105
|
+
return openBlock(), createElementBlock("view", {
|
|
106
|
+
class: normalizeClass(_ctx.classes)
|
|
85
107
|
}, [
|
|
86
|
-
|
|
87
|
-
"model-value":
|
|
108
|
+
createVNode(_component_nut_form, {
|
|
109
|
+
"model-value": _ctx.formValue,
|
|
88
110
|
ref: "formRef"
|
|
89
111
|
}, {
|
|
90
|
-
default:
|
|
91
|
-
(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
112
|
+
default: withCtx(() => [
|
|
113
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.list, (item, index2) => {
|
|
114
|
+
return openBlock(), createBlock(_component_nut_form_item, {
|
|
115
|
+
key: index2,
|
|
116
|
+
label: item.label,
|
|
117
|
+
required: item.required,
|
|
118
|
+
rules: item.rules,
|
|
119
|
+
prop: item.formItemProp
|
|
120
|
+
}, {
|
|
121
|
+
default: withCtx(() => [
|
|
122
|
+
item.type === "radio" ? (openBlock(), createBlock(_component_nut_radio_group, {
|
|
123
|
+
key: 0,
|
|
124
|
+
modelValue: _ctx.formValue[item.formItemProp],
|
|
125
|
+
"onUpdate:modelValue": ($event) => _ctx.formValue[item.formItemProp] = $event
|
|
126
|
+
}, {
|
|
127
|
+
default: withCtx(() => [
|
|
128
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(item.radioLabel, (radioItem, radioIndex) => {
|
|
129
|
+
return openBlock(), createBlock(_component_nut_radio, {
|
|
130
|
+
key: radioIndex,
|
|
131
|
+
shape: "button",
|
|
132
|
+
label: radioItem.label
|
|
133
|
+
}, {
|
|
134
|
+
default: withCtx(() => [
|
|
135
|
+
createTextVNode(toDisplayString(radioItem.label), 1)
|
|
136
|
+
]),
|
|
137
|
+
_: 2
|
|
138
|
+
}, 1032, ["label"]);
|
|
139
|
+
}), 128))
|
|
140
|
+
]),
|
|
141
|
+
_: 2
|
|
142
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"])) : withDirectives((openBlock(), createElementBlock("input", {
|
|
143
|
+
key: 1,
|
|
144
|
+
class: "nut-input-text",
|
|
145
|
+
placeholder: item.placeholder,
|
|
146
|
+
"onUpdate:modelValue": ($event) => _ctx.formValue[item.formItemProp] = $event,
|
|
147
|
+
type: "text"
|
|
148
|
+
}, null, 8, _hoisted_1)), [
|
|
149
|
+
[vModelText, _ctx.formValue[item.formItemProp]]
|
|
150
|
+
])
|
|
151
|
+
]),
|
|
152
|
+
_: 2
|
|
153
|
+
}, 1032, ["label", "required", "rules", "prop"]);
|
|
154
|
+
}), 128))
|
|
129
155
|
]),
|
|
130
156
|
_: 1
|
|
131
157
|
}, 8, ["model-value"]),
|
|
132
|
-
|
|
133
|
-
|
|
158
|
+
_ctx.submit ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
159
|
+
createVNode(_component_nut_button, {
|
|
134
160
|
type: "primary",
|
|
135
161
|
block: "",
|
|
136
|
-
onClick:
|
|
162
|
+
onClick: _ctx.submitFun
|
|
137
163
|
}, {
|
|
138
|
-
default:
|
|
139
|
-
|
|
164
|
+
default: withCtx(() => [
|
|
165
|
+
createTextVNode("提交审批")
|
|
140
166
|
]),
|
|
141
167
|
_: 1
|
|
142
168
|
}, 8, ["onClick"])
|
|
143
|
-
])) :
|
|
169
|
+
])) : createCommentVNode("", true)
|
|
144
170
|
], 2);
|
|
145
171
|
}
|
|
146
|
-
const
|
|
172
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
147
173
|
export {
|
|
148
|
-
|
|
174
|
+
index as default
|
|
149
175
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { c as
|
|
1
|
+
import { c as createComponent } from "./component-81a4c1d0.js";
|
|
2
2
|
import "vue";
|
|
3
3
|
import "../locale/lang";
|
|
4
|
-
const { create
|
|
4
|
+
const { create } = createComponent("layout");
|
|
5
|
+
const _sfc_main = create({});
|
|
5
6
|
export {
|
|
6
|
-
|
|
7
|
+
_sfc_main as default
|
|
7
8
|
};
|