@nutui/nutui 4.3.1 → 4.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/dist/nutui.es.js +2 -4
- package/dist/nutui.js +6035 -6408
- package/dist/nutui.umd.js +1 -1
- package/dist/packages/actionsheet/ActionSheet.js +1 -1
- package/dist/packages/address/Address.js +1 -1
- package/dist/packages/addresslist/AddressList.js +2 -2
- package/dist/packages/animate/Animate.js +51 -44
- package/dist/packages/backtop/Backtop.js +79 -89
- package/dist/packages/calendar/Calendar.js +814 -3
- package/dist/packages/calendar/index.scss +0 -1
- package/dist/packages/calendarcard/CalendarCard.js +1 -1
- package/dist/packages/card/Card.js +4 -4
- package/dist/packages/cascader/Cascader.js +1 -1
- package/dist/packages/checkbox/Checkbox.js +1 -1
- package/dist/packages/circleprogress/CircleProgress.js +90 -97
- package/dist/packages/col/Col.js +41 -30
- package/dist/packages/comment/Comment.js +2 -2
- package/dist/packages/{common-LvGbU-A3.js → common-FZL3qC99.js} +5 -2
- package/dist/packages/dialog/Dialog.js +1 -1
- package/dist/packages/ecard/Ecard.js +2 -2
- package/dist/packages/form/Form.js +3 -1
- package/dist/packages/formitem/FormItem.js +1 -1
- package/dist/packages/imagepreview/ImagePreview.js +1 -1
- package/dist/packages/{index-wY4t0zYt.js → index-BqB5dTeo.js} +29 -17
- package/dist/packages/{index.vue_vue_type_script_lang-w2sgcysj.js → index.vue_vue_type_script_lang-n0HbjvfF.js} +1 -1
- package/dist/packages/input/Input.js +8 -8
- package/dist/packages/inputnumber/InputNumber.js +84 -103
- package/dist/packages/invoice/Invoice.js +87 -138
- package/dist/packages/layout/Layout.js +3 -0
- package/dist/packages/menuitem/MenuItem.js +1 -1
- package/dist/packages/navbar/Navbar.js +103 -115
- package/dist/packages/notify/Notify.js +1 -1
- package/dist/packages/numberkeyboard/NumberKeyboard.js +1 -1
- package/dist/packages/popover/Popover.js +1 -1
- package/dist/packages/popup/Popup.js +1 -1
- package/dist/packages/price/Price.js +69 -77
- package/dist/packages/progress/Progress.js +96 -115
- package/dist/packages/radio/Radio.js +1 -1
- package/dist/packages/range/Range.js +1 -1
- package/dist/packages/rate/Rate.js +99 -141
- package/dist/packages/row/Row.js +43 -39
- package/dist/packages/searchbar/Searchbar.js +1 -1
- package/dist/packages/shortpassword/ShortPassword.js +1 -1
- package/dist/packages/sku/Sku.js +5 -5
- package/dist/packages/swipe/Swipe.js +96 -110
- package/dist/packages/swipegroup/SwipeGroup.js +41 -23
- package/dist/packages/switch/Switch.js +12 -4
- package/dist/packages/switch/index.css +1 -1
- package/dist/packages/switch/index.scss +1 -1
- package/dist/packages/tag/Tag.js +57 -66
- package/dist/packages/textarea/Textarea.js +1 -1
- package/dist/packages/timeselect/TimeSelect.js +1 -1
- package/dist/packages/uploader/Uploader.js +5 -5
- package/dist/smartips/web-types.json +12 -3
- package/dist/style.css +1 -1
- package/dist/styles/base-jdb.css +1 -1
- package/dist/styles/base-jddkh.css +1 -1
- package/dist/styles/base-jdt.css +1 -1
- package/dist/styles/themes/default.scss +0 -1
- package/dist/styles/themes/jdb.scss +0 -1
- package/dist/styles/themes/jddkh.scss +0 -1
- package/dist/styles/themes/jdt.scss +0 -1
- package/dist/styles/variables-jdb.scss +0 -1
- package/dist/styles/variables-jddkh.scss +0 -1
- package/dist/styles/variables-jdt.scss +0 -1
- package/dist/styles/variables.scss +0 -1
- package/dist/types/__VUE/animate/animate.vue.d.ts +75 -0
- package/dist/types/__VUE/animate/index.d.ts +6 -0
- package/dist/types/__VUE/backtop/backtop.vue.d.ts +87 -0
- package/dist/types/__VUE/backtop/index.d.ts +5 -0
- package/dist/types/__VUE/calendaritem/index.vue.d.ts +2 -12
- package/dist/types/__VUE/circleprogress/circle-progress.vue.d.ts +88 -0
- package/dist/types/__VUE/circleprogress/index.d.ts +6 -0
- package/dist/types/__VUE/col/col.vue.d.ts +53 -0
- package/dist/types/__VUE/col/index.d.ts +5 -0
- package/dist/types/__VUE/form/common.d.ts +2 -0
- package/dist/types/__VUE/form/types.d.ts +0 -1
- package/dist/types/__VUE/input/index.vue.d.ts +1 -1
- package/dist/types/__VUE/inputnumber/index.d.ts +5 -0
- package/dist/types/__VUE/inputnumber/input-number.vue.d.ts +112 -0
- package/dist/types/__VUE/invoice/index.d.ts +6 -0
- package/dist/types/__VUE/invoice/invoice.vue.d.ts +59 -0
- package/dist/types/__VUE/invoice/types.d.ts +12 -0
- package/dist/types/__VUE/layout/index.d.ts +4 -0
- package/dist/types/__VUE/layout/layout.vue.d.ts +10 -0
- package/dist/types/__VUE/navbar/index.d.ts +5 -0
- package/dist/types/__VUE/navbar/navbar.vue.d.ts +125 -0
- package/dist/types/__VUE/price/index.d.ts +6 -0
- package/dist/types/__VUE/price/price.vue.d.ts +83 -0
- package/dist/types/__VUE/progress/index.d.ts +6 -0
- package/dist/types/__VUE/progress/progress.vue.d.ts +91 -0
- package/dist/types/__VUE/rate/index.d.ts +5 -0
- package/dist/types/__VUE/rate/rate.vue.d.ts +208 -0
- package/dist/types/__VUE/row/index.d.ts +5 -0
- package/dist/types/__VUE/row/row.vue.d.ts +71 -0
- package/dist/types/__VUE/swipe/index.d.ts +6 -0
- package/dist/types/__VUE/swipe/swipe.vue.d.ts +79 -0
- package/dist/types/__VUE/swipe/types.d.ts +1 -0
- package/dist/types/__VUE/swipegroup/index.d.ts +5 -0
- package/dist/types/__VUE/swipegroup/swipe-group.vue.d.ts +47 -0
- package/dist/types/__VUE/switch/index.vue.d.ts +9 -0
- package/dist/types/__VUE/tag/index.d.ts +6 -0
- package/dist/types/__VUE/tag/tag.vue.d.ts +90 -0
- package/dist/types/__VUE/tag/types.d.ts +1 -1
- package/dist/types/index.d.ts +32 -18
- package/package.json +1 -1
- package/dist/packages/calendaritem/CalendarItem.js +0 -819
- package/dist/packages/calendaritem/index.css +0 -0
- package/dist/packages/calendaritem/index.mjs +0 -2
- package/dist/packages/calendaritem/index.scss +0 -0
- package/dist/packages/calendaritem/style/css.mjs +0 -2
- package/dist/packages/calendaritem/style/index.mjs +0 -2
- package/dist/packages/types-Ynmct7na.js +0 -4
- package/dist/types/__VUE/animate/index.vue.d.ts +0 -71
- package/dist/types/__VUE/backtop/index.vue.d.ts +0 -98
- package/dist/types/__VUE/circleprogress/index.vue.d.ts +0 -95
- package/dist/types/__VUE/col/index.vue.d.ts +0 -42
- package/dist/types/__VUE/inputnumber/index.vue.d.ts +0 -117
- package/dist/types/__VUE/invoice/index.vue.d.ts +0 -53
- package/dist/types/__VUE/layout/index.vue.d.ts +0 -12
- package/dist/types/__VUE/navbar/index.vue.d.ts +0 -129
- package/dist/types/__VUE/price/index.vue.d.ts +0 -97
- package/dist/types/__VUE/progress/index.vue.d.ts +0 -120
- package/dist/types/__VUE/rate/index.vue.d.ts +0 -240
- package/dist/types/__VUE/row/index.vue.d.ts +0 -62
- package/dist/types/__VUE/swipe/index.vue.d.ts +0 -70
- package/dist/types/__VUE/swipegroup/index.vue.d.ts +0 -26
- package/dist/types/__VUE/tag/index.vue.d.ts +0 -94
- /package/dist/types/__VUE/animate/{type.d.ts → types.d.ts} +0 -0
|
@@ -17,33 +17,24 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { defineComponent, ref, computed, inject, watch, reactive, openBlock, createElementBlock, normalizeStyle, createElementVNode, renderSlot } from "vue";
|
|
20
21
|
import { u as useTouch } from "../index-084nl_oE.js";
|
|
21
|
-
import { ref, computed, inject, watch, reactive, openBlock, createElementBlock, normalizeStyle, createElementVNode, renderSlot } from "vue";
|
|
22
|
-
import { c as createComponent } from "../component-TCzwHGVq.js";
|
|
23
22
|
import { S as SWIPE_KEY } from "../types-qOrhXtA_.js";
|
|
24
|
-
import {
|
|
25
|
-
const
|
|
26
|
-
|
|
23
|
+
import { w as withInstall } from "../with-install-p59gYYU_.js";
|
|
24
|
+
const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
|
|
25
|
+
name: "NutSwipe"
|
|
26
|
+
}), {
|
|
27
|
+
__name: "swipe",
|
|
27
28
|
props: {
|
|
28
|
-
name: {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
touchMoveStopPropagation: {
|
|
33
|
-
type: Boolean,
|
|
34
|
-
default: false
|
|
35
|
-
},
|
|
36
|
-
touchMovePreventDefault: {
|
|
37
|
-
type: Boolean,
|
|
38
|
-
default: false
|
|
39
|
-
},
|
|
40
|
-
disabled: {
|
|
41
|
-
type: Boolean,
|
|
42
|
-
default: false
|
|
43
|
-
}
|
|
29
|
+
name: { default: "" },
|
|
30
|
+
touchMoveStopPropagation: { type: Boolean, default: false },
|
|
31
|
+
touchMovePreventDefault: { type: Boolean, default: false },
|
|
32
|
+
disabled: { type: Boolean, default: false }
|
|
44
33
|
},
|
|
45
34
|
emits: ["open", "close", "click"],
|
|
46
|
-
setup(
|
|
35
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
36
|
+
const props = __props;
|
|
37
|
+
const emit = __emit;
|
|
47
38
|
const getRefWidth = (ref2) => {
|
|
48
39
|
var _a;
|
|
49
40
|
return ((_a = ref2.value) == null ? void 0 : _a.getBoundingClientRect().width) || 0;
|
|
@@ -130,100 +121,95 @@ const _sfc_main = create({
|
|
|
130
121
|
state.offset = offset;
|
|
131
122
|
};
|
|
132
123
|
const touch = useTouch();
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
event.preventDefault();
|
|
149
|
-
}
|
|
150
|
-
if (props.touchMoveStopPropagation) {
|
|
151
|
-
event.stopPropagation();
|
|
152
|
-
}
|
|
124
|
+
const onTouchStart = (event) => {
|
|
125
|
+
if (props.disabled)
|
|
126
|
+
return;
|
|
127
|
+
touch.start(event);
|
|
128
|
+
};
|
|
129
|
+
const onTouchMove = (event) => {
|
|
130
|
+
if (props.disabled)
|
|
131
|
+
return;
|
|
132
|
+
touch.move(event);
|
|
133
|
+
if (touch.isHorizontal()) {
|
|
134
|
+
lockClick.value = true;
|
|
135
|
+
state.moving = true;
|
|
136
|
+
setoffset(touch.deltaX.value);
|
|
137
|
+
if (props.touchMovePreventDefault) {
|
|
138
|
+
event.preventDefault();
|
|
153
139
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
if (state.moving) {
|
|
157
|
-
state.moving = false;
|
|
158
|
-
oldPosition = position;
|
|
159
|
-
switch (position) {
|
|
160
|
-
case "left":
|
|
161
|
-
if (Math.abs(state.offset) <= rightRefWidth.value / 2) {
|
|
162
|
-
close();
|
|
163
|
-
} else {
|
|
164
|
-
state.offset = -rightRefWidth.value;
|
|
165
|
-
open();
|
|
166
|
-
}
|
|
167
|
-
break;
|
|
168
|
-
case "right":
|
|
169
|
-
if (Math.abs(state.offset) <= leftRefWidth.value / 2) {
|
|
170
|
-
close();
|
|
171
|
-
} else {
|
|
172
|
-
state.offset = leftRefWidth.value;
|
|
173
|
-
open();
|
|
174
|
-
}
|
|
175
|
-
break;
|
|
176
|
-
}
|
|
177
|
-
setTimeout(() => {
|
|
178
|
-
lockClick.value = false;
|
|
179
|
-
}, 0);
|
|
140
|
+
if (props.touchMoveStopPropagation) {
|
|
141
|
+
event.stopPropagation();
|
|
180
142
|
}
|
|
181
143
|
}
|
|
182
144
|
};
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
145
|
+
const onTouchEnd = () => {
|
|
146
|
+
if (state.moving) {
|
|
147
|
+
state.moving = false;
|
|
148
|
+
oldPosition = position;
|
|
149
|
+
switch (position) {
|
|
150
|
+
case "left":
|
|
151
|
+
if (Math.abs(state.offset) <= rightRefWidth.value / 2) {
|
|
152
|
+
close();
|
|
153
|
+
} else {
|
|
154
|
+
state.offset = -rightRefWidth.value;
|
|
155
|
+
open();
|
|
156
|
+
}
|
|
157
|
+
break;
|
|
158
|
+
case "right":
|
|
159
|
+
if (Math.abs(state.offset) <= leftRefWidth.value / 2) {
|
|
160
|
+
close();
|
|
161
|
+
} else {
|
|
162
|
+
state.offset = leftRefWidth.value;
|
|
163
|
+
open();
|
|
164
|
+
}
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
setTimeout(() => {
|
|
168
|
+
lockClick.value = false;
|
|
169
|
+
}, 0);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
__expose({
|
|
188
173
|
open,
|
|
189
|
-
close
|
|
190
|
-
onClick,
|
|
191
|
-
lockClick
|
|
174
|
+
close
|
|
192
175
|
});
|
|
176
|
+
return (_ctx, _cache) => {
|
|
177
|
+
return openBlock(), createElementBlock("view", {
|
|
178
|
+
class: "nut-swipe",
|
|
179
|
+
style: normalizeStyle(touchStyle.value),
|
|
180
|
+
onTouchstart: onTouchStart,
|
|
181
|
+
onTouchmove: onTouchMove,
|
|
182
|
+
onTouchend: onTouchEnd,
|
|
183
|
+
onTouchcancel: onTouchEnd
|
|
184
|
+
}, [
|
|
185
|
+
createElementVNode("view", {
|
|
186
|
+
ref_key: "leftRef",
|
|
187
|
+
ref: leftRef,
|
|
188
|
+
class: "nut-swipe__left",
|
|
189
|
+
onClick: _cache[0] || (_cache[0] = ($event) => onClick($event, "left", true))
|
|
190
|
+
}, [
|
|
191
|
+
renderSlot(_ctx.$slots, "left")
|
|
192
|
+
], 512),
|
|
193
|
+
createElementVNode("view", {
|
|
194
|
+
class: "nut-swipe__content",
|
|
195
|
+
onClick: _cache[1] || (_cache[1] = ($event) => onClick($event, "content", lockClick.value))
|
|
196
|
+
}, [
|
|
197
|
+
renderSlot(_ctx.$slots, "default")
|
|
198
|
+
]),
|
|
199
|
+
createElementVNode("view", {
|
|
200
|
+
ref_key: "rightRef",
|
|
201
|
+
ref: rightRef,
|
|
202
|
+
class: "nut-swipe__right",
|
|
203
|
+
onClick: _cache[2] || (_cache[2] = ($event) => onClick($event, "right", true))
|
|
204
|
+
}, [
|
|
205
|
+
renderSlot(_ctx.$slots, "right")
|
|
206
|
+
], 512)
|
|
207
|
+
], 36);
|
|
208
|
+
};
|
|
193
209
|
}
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
return openBlock(), createElementBlock("view", {
|
|
197
|
-
class: "nut-swipe",
|
|
198
|
-
style: normalizeStyle(_ctx.touchStyle),
|
|
199
|
-
onTouchstart: _cache[3] || (_cache[3] = (...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args)),
|
|
200
|
-
onTouchmove: _cache[4] || (_cache[4] = (...args) => _ctx.onTouchMove && _ctx.onTouchMove(...args)),
|
|
201
|
-
onTouchend: _cache[5] || (_cache[5] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args)),
|
|
202
|
-
onTouchcancel: _cache[6] || (_cache[6] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
|
|
203
|
-
}, [
|
|
204
|
-
createElementVNode("view", {
|
|
205
|
-
ref: "leftRef",
|
|
206
|
-
class: "nut-swipe__left",
|
|
207
|
-
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.onClick($event, "left", true))
|
|
208
|
-
}, [
|
|
209
|
-
renderSlot(_ctx.$slots, "left")
|
|
210
|
-
], 512),
|
|
211
|
-
createElementVNode("view", {
|
|
212
|
-
class: "nut-swipe__content",
|
|
213
|
-
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.onClick($event, "content", _ctx.lockClick))
|
|
214
|
-
}, [
|
|
215
|
-
renderSlot(_ctx.$slots, "default")
|
|
216
|
-
]),
|
|
217
|
-
createElementVNode("view", {
|
|
218
|
-
ref: "rightRef",
|
|
219
|
-
class: "nut-swipe__right",
|
|
220
|
-
onClick: _cache[2] || (_cache[2] = ($event) => _ctx.onClick($event, "right", true))
|
|
221
|
-
}, [
|
|
222
|
-
renderSlot(_ctx.$slots, "right")
|
|
223
|
-
], 512)
|
|
224
|
-
], 36);
|
|
225
|
-
}
|
|
226
|
-
const NutSwipe = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
210
|
+
}));
|
|
211
|
+
withInstall(_sfc_main);
|
|
227
212
|
export {
|
|
228
|
-
|
|
213
|
+
_sfc_main as Swipe,
|
|
214
|
+
_sfc_main as default
|
|
229
215
|
};
|
|
@@ -1,16 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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, ref, provide, openBlock, createElementBlock, renderSlot } from "vue";
|
|
3
21
|
import { S as SWIPE_KEY } from "../types-qOrhXtA_.js";
|
|
4
|
-
import {
|
|
5
|
-
const
|
|
6
|
-
|
|
22
|
+
import { w as withInstall } from "../with-install-p59gYYU_.js";
|
|
23
|
+
const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
|
|
24
|
+
name: "NutSwipeGroup"
|
|
25
|
+
}), {
|
|
26
|
+
__name: "swipe-group",
|
|
7
27
|
props: {
|
|
8
|
-
lock: {
|
|
9
|
-
type: Boolean,
|
|
10
|
-
default: false
|
|
11
|
-
}
|
|
28
|
+
lock: { type: Boolean, default: false }
|
|
12
29
|
},
|
|
13
|
-
setup(
|
|
30
|
+
setup(__props) {
|
|
31
|
+
const props = __props;
|
|
14
32
|
const swipeGroupRef = ref(null);
|
|
15
33
|
const name = ref("");
|
|
16
34
|
const update = (n) => {
|
|
@@ -21,19 +39,19 @@ const _sfc_main = create({
|
|
|
21
39
|
lock: props.lock,
|
|
22
40
|
name
|
|
23
41
|
});
|
|
24
|
-
return
|
|
42
|
+
return (_ctx, _cache) => {
|
|
43
|
+
return openBlock(), createElementBlock("div", {
|
|
44
|
+
ref_key: "swipeGroupRef",
|
|
45
|
+
ref: swipeGroupRef,
|
|
46
|
+
class: "nut-swipe-group"
|
|
47
|
+
}, [
|
|
48
|
+
renderSlot(_ctx.$slots, "default")
|
|
49
|
+
], 512);
|
|
50
|
+
};
|
|
25
51
|
}
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
ref: "swipeGroupRef",
|
|
29
|
-
class: "nut-swipe-group"
|
|
30
|
-
};
|
|
31
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
32
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
33
|
-
renderSlot(_ctx.$slots, "default")
|
|
34
|
-
], 512);
|
|
35
|
-
}
|
|
36
|
-
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
52
|
+
}));
|
|
53
|
+
withInstall(_sfc_main);
|
|
37
54
|
export {
|
|
38
|
-
|
|
55
|
+
_sfc_main as SwipeGroup,
|
|
56
|
+
_sfc_main as default
|
|
39
57
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { computed, watch, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, createVNode, createCommentVNode, Fragment, withDirectives, toDisplayString, vShow } from "vue";
|
|
2
2
|
import { c as createComponent } from "../component-TCzwHGVq.js";
|
|
3
3
|
import { Loading1 } from "@nutui/icons-vue";
|
|
4
|
-
import { u as useFormDisabled } from "../common-
|
|
4
|
+
import { u as useFormDisabled } from "../common-FZL3qC99.js";
|
|
5
5
|
import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
|
|
6
6
|
const { componentName, create } = createComponent("switch");
|
|
7
7
|
const _sfc_main = create({
|
|
@@ -11,6 +11,13 @@ const _sfc_main = create({
|
|
|
11
11
|
type: [String, Number, Boolean],
|
|
12
12
|
default: false
|
|
13
13
|
},
|
|
14
|
+
disabled: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: false
|
|
17
|
+
},
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Please use `disabled` prop instead.
|
|
20
|
+
*/
|
|
14
21
|
disable: {
|
|
15
22
|
type: Boolean,
|
|
16
23
|
default: false
|
|
@@ -46,14 +53,15 @@ const _sfc_main = create({
|
|
|
46
53
|
},
|
|
47
54
|
emits: ["change", "update:modelValue", "update:loading"],
|
|
48
55
|
setup(props, { emit }) {
|
|
49
|
-
const
|
|
56
|
+
const legacyDisabled = computed(() => props.disabled || props.disable);
|
|
57
|
+
const disabled = useFormDisabled(legacyDisabled);
|
|
50
58
|
const isActive = computed(() => props.modelValue === props.activeValue);
|
|
51
59
|
const classes = computed(() => {
|
|
52
60
|
const prefixCls = componentName;
|
|
53
61
|
return {
|
|
54
62
|
[prefixCls]: true,
|
|
55
63
|
[isActive.value ? "nut-switch-open" : "nut-switch-close"]: true,
|
|
56
|
-
[`${prefixCls}-
|
|
64
|
+
[`${prefixCls}-disabled`]: disabled.value,
|
|
57
65
|
[`${prefixCls}-base`]: true
|
|
58
66
|
};
|
|
59
67
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.nut-switch{cursor:pointer;display:inline-flex;align-items:center;background-color:var(--nut-primary-color, #fa2c19);border-radius:var(--nut-switch-border-radius, 21px);background-size:100% 100%;background-repeat:no-repeat;background-position:center center;flex:0 0 auto}.nut-switch .nut-icon-loading1{width:12px;height:12px;font-size:12px}.nut-switch.nut-switch-close{background-color:var(--nut-switch-close-bg-color, #ebebeb)}.nut-switch .nut-switch-button{display:flex;align-items:center;justify-content:center;border-radius:50%;background:var(--nut-white, #fff);transition:transform .3s}.nut-switch .nut-switch-button .nut-switch-label{color:var(--nut-white, #fff);font-size:var(--nut-font-size-1, 12px)}.nut-switch .nut-switch-button .nut-switch-label.open{transform:translateX(-16px)}.nut-switch .nut-switch-button .nut-switch-label.close{transform:translateX(16px)}.nut-switch.nut-switch-
|
|
1
|
+
.nut-switch{cursor:pointer;display:inline-flex;align-items:center;background-color:var(--nut-primary-color, #fa2c19);border-radius:var(--nut-switch-border-radius, 21px);background-size:100% 100%;background-repeat:no-repeat;background-position:center center;flex:0 0 auto}.nut-switch .nut-icon-loading1{width:12px;height:12px;font-size:12px}.nut-switch.nut-switch-close{background-color:var(--nut-switch-close-bg-color, #ebebeb)}.nut-switch .nut-switch-button{display:flex;align-items:center;justify-content:center;border-radius:50%;background:var(--nut-white, #fff);transition:transform .3s}.nut-switch .nut-switch-button .nut-switch-label{color:var(--nut-white, #fff);font-size:var(--nut-font-size-1, 12px)}.nut-switch .nut-switch-button .nut-switch-label.open{transform:translateX(-16px)}.nut-switch .nut-switch-button .nut-switch-label.close{transform:translateX(16px)}.nut-switch.nut-switch-disabled{opacity:.6}.nut-switch.nut-switch-base{min-width:var(--nut-switch-width, 36px);height:var(--nut-switch-height, 21px);line-height:var(--nut-switch-line-height, 21px);overflow:hidden}.nut-switch.nut-switch-base .nut-switch-button{height:var(--nut-switch-inside-height, 13px);width:var(--nut-switch-inside-width, 13px);transform:var(--nut-switch-inside-close-transform, translateX(30%))}.nut-switch.nut-switch-base.nut-switch-open .nut-switch-button{transform:var(--nut-switch-inside-open-transform, translateX(146%))}
|
package/dist/packages/tag/Tag.js
CHANGED
|
@@ -1,44 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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, normalizeClass, normalizeStyle, renderSlot, createBlock, unref, withModifiers, createCommentVNode } from "vue";
|
|
3
21
|
import { Close } from "@nutui/icons-vue";
|
|
4
|
-
import {
|
|
5
|
-
const
|
|
6
|
-
|
|
22
|
+
import { w as withInstall } from "../with-install-p59gYYU_.js";
|
|
23
|
+
const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
|
|
24
|
+
name: "NutTag"
|
|
25
|
+
}), {
|
|
26
|
+
__name: "tag",
|
|
7
27
|
props: {
|
|
8
|
-
color: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
type: {
|
|
17
|
-
type: String,
|
|
18
|
-
default: "default"
|
|
19
|
-
},
|
|
20
|
-
plain: {
|
|
21
|
-
type: Boolean,
|
|
22
|
-
default: false
|
|
23
|
-
},
|
|
24
|
-
round: {
|
|
25
|
-
type: Boolean,
|
|
26
|
-
default: false
|
|
27
|
-
},
|
|
28
|
-
mark: {
|
|
29
|
-
type: Boolean,
|
|
30
|
-
default: false
|
|
31
|
-
},
|
|
32
|
-
closeable: {
|
|
33
|
-
type: Boolean,
|
|
34
|
-
default: false
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
components: {
|
|
38
|
-
Close
|
|
28
|
+
color: { default: "" },
|
|
29
|
+
textColor: { default: "" },
|
|
30
|
+
type: { default: "default" },
|
|
31
|
+
plain: { type: Boolean, default: false },
|
|
32
|
+
round: { type: Boolean, default: false },
|
|
33
|
+
mark: { type: Boolean, default: false },
|
|
34
|
+
closeable: { type: Boolean, default: false }
|
|
39
35
|
},
|
|
40
36
|
emits: ["close", "click"],
|
|
41
|
-
setup(
|
|
37
|
+
setup(__props, { emit: __emit }) {
|
|
38
|
+
const props = __props;
|
|
39
|
+
const emits = __emit;
|
|
42
40
|
const classes = computed(() => {
|
|
43
41
|
const prefixCls = "nut-tag";
|
|
44
42
|
return {
|
|
@@ -58,45 +56,38 @@ const _sfc_main = create({
|
|
|
58
56
|
}
|
|
59
57
|
if (props.plain) {
|
|
60
58
|
style2.background = "#fff";
|
|
61
|
-
style2
|
|
59
|
+
style2.borderColor = props.color;
|
|
62
60
|
} else if (props.color) {
|
|
63
61
|
style2.background = props.color;
|
|
64
62
|
}
|
|
65
63
|
return style2;
|
|
66
64
|
});
|
|
67
65
|
const onClose = (event) => {
|
|
68
|
-
event
|
|
69
|
-
emit("close", event);
|
|
66
|
+
emits("close", event);
|
|
70
67
|
};
|
|
71
68
|
const onClick = (event) => {
|
|
72
|
-
|
|
69
|
+
emits("click", event);
|
|
73
70
|
};
|
|
74
|
-
return {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
return (_ctx, _cache) => {
|
|
72
|
+
return openBlock(), createElementBlock("view", {
|
|
73
|
+
class: normalizeClass(classes.value),
|
|
74
|
+
style: normalizeStyle(style.value),
|
|
75
|
+
onClick
|
|
76
|
+
}, [
|
|
77
|
+
renderSlot(_ctx.$slots, "default"),
|
|
78
|
+
_ctx.closeable ? (openBlock(), createBlock(unref(Close), {
|
|
79
|
+
key: 0,
|
|
80
|
+
class: "nut-tag--close",
|
|
81
|
+
width: "12px",
|
|
82
|
+
height: "12px",
|
|
83
|
+
onClick: withModifiers(onClose, ["stop"])
|
|
84
|
+
})) : createCommentVNode("", true)
|
|
85
|
+
], 6);
|
|
79
86
|
};
|
|
80
87
|
}
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
const _component_Close = resolveComponent("Close");
|
|
84
|
-
return openBlock(), createElementBlock("view", {
|
|
85
|
-
class: normalizeClass(_ctx.classes),
|
|
86
|
-
style: normalizeStyle(_ctx.style),
|
|
87
|
-
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args))
|
|
88
|
-
}, [
|
|
89
|
-
renderSlot(_ctx.$slots, "default"),
|
|
90
|
-
_ctx.closeable ? (openBlock(), createBlock(_component_Close, {
|
|
91
|
-
key: 0,
|
|
92
|
-
class: "nut-tag--close",
|
|
93
|
-
width: "12px",
|
|
94
|
-
height: "12px",
|
|
95
|
-
onClick: _ctx.onClose
|
|
96
|
-
}, null, 8, ["onClick"])) : createCommentVNode("", true)
|
|
97
|
-
], 6);
|
|
98
|
-
}
|
|
99
|
-
const NutTag = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
88
|
+
}));
|
|
89
|
+
withInstall(_sfc_main);
|
|
100
90
|
export {
|
|
101
|
-
|
|
91
|
+
_sfc_main as Tag,
|
|
92
|
+
_sfc_main as default
|
|
102
93
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { toRef, ref, computed, onMounted, nextTick, watch, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, toDisplayString, createCommentVNode } from "vue";
|
|
2
2
|
import { c as createComponent } from "../component-TCzwHGVq.js";
|
|
3
3
|
import { u as useLocale } from "../index-s3RgMhc7.js";
|
|
4
|
-
import { u as useFormDisabled } from "../common-
|
|
4
|
+
import { u as useFormDisabled } from "../common-FZL3qC99.js";
|
|
5
5
|
import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
|
|
6
6
|
const { create } = createComponent("textarea");
|
|
7
7
|
const cN = "NutTextarea";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, provide, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, createElementBlock, toDisplayString, renderSlot } from "vue";
|
|
2
2
|
import { c as createComponent } from "../component-TCzwHGVq.js";
|
|
3
|
-
import { N as NutPopup } from "../index-
|
|
3
|
+
import { N as NutPopup } from "../index-BqB5dTeo.js";
|
|
4
4
|
import { u as useLocale } from "../index-s3RgMhc7.js";
|
|
5
5
|
import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
|
|
6
6
|
const { create } = createComponent("time-select");
|
|
@@ -4,13 +4,13 @@ var __publicField = (obj, key, value) => {
|
|
|
4
4
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
|
-
import { toRef, ref, watch, h, reactive, resolveComponent, openBlock, createElementBlock, renderSlot, createBlock, resolveDynamicComponent, createCommentVNode, Fragment, renderList, normalizeClass, createElementVNode, toDisplayString, createVNode } from "vue";
|
|
7
|
+
import { toRef, ref, watch, h, reactive, resolveComponent, openBlock, createElementBlock, renderSlot, createBlock, resolveDynamicComponent, createCommentVNode, Fragment, renderList, normalizeClass, createElementVNode, toDisplayString, createVNode, withModifiers } from "vue";
|
|
8
8
|
import { c as createComponent } from "../component-TCzwHGVq.js";
|
|
9
9
|
import { f as funInterceptor } from "../Interceptor-WYVtGbGC.js";
|
|
10
|
-
import
|
|
10
|
+
import { Progress as _sfc_main$1 } from "../progress/Progress.js";
|
|
11
11
|
import { Photograph, Failure, Loading, Del, Link } from "@nutui/icons-vue";
|
|
12
12
|
import { u as useLocale } from "../index-s3RgMhc7.js";
|
|
13
|
-
import { u as useFormDisabled } from "../common-
|
|
13
|
+
import { u as useFormDisabled } from "../common-FZL3qC99.js";
|
|
14
14
|
import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
|
|
15
15
|
class UploadOptions {
|
|
16
16
|
constructor() {
|
|
@@ -94,7 +94,7 @@ const { create } = createComponent("uploader");
|
|
|
94
94
|
const cN = "NutUploader";
|
|
95
95
|
const _sfc_main = create({
|
|
96
96
|
components: {
|
|
97
|
-
NutProgress,
|
|
97
|
+
NutProgress: _sfc_main$1,
|
|
98
98
|
Photograph,
|
|
99
99
|
Failure,
|
|
100
100
|
Loading,
|
|
@@ -452,7 +452,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
452
452
|
key: 0,
|
|
453
453
|
color: "#808080",
|
|
454
454
|
class: "nut-uploader__preview-img__file__del",
|
|
455
|
-
onClick: ($event) => _ctx.onDelete(item, index2)
|
|
455
|
+
onClick: withModifiers(($event) => _ctx.onDelete(item, index2), ["stop"])
|
|
456
456
|
}, null, 8, ["onClick"])) : createCommentVNode("", true)
|
|
457
457
|
], 10, _hoisted_13),
|
|
458
458
|
item.status == "uploading" ? (openBlock(), createBlock(_component_nut_progress, {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"framework": "vue",
|
|
4
4
|
"name": "NutUI",
|
|
5
|
-
"version": "4.3.
|
|
5
|
+
"version": "4.3.3",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"tags": [
|
|
@@ -5986,7 +5986,7 @@
|
|
|
5986
5986
|
}
|
|
5987
5987
|
},
|
|
5988
5988
|
{
|
|
5989
|
-
"name": "
|
|
5989
|
+
"name": "disabled ",
|
|
5990
5990
|
"default": "`false`",
|
|
5991
5991
|
"description": "禁用状态",
|
|
5992
5992
|
"value": {
|
|
@@ -6056,6 +6056,15 @@
|
|
|
6056
6056
|
"type": "boolean | string | number",
|
|
6057
6057
|
"kind": "expression"
|
|
6058
6058
|
}
|
|
6059
|
+
},
|
|
6060
|
+
{
|
|
6061
|
+
"name": "disable ",
|
|
6062
|
+
"default": "`false`",
|
|
6063
|
+
"description": "禁用状态",
|
|
6064
|
+
"value": {
|
|
6065
|
+
"type": "boolean",
|
|
6066
|
+
"kind": "expression"
|
|
6067
|
+
}
|
|
6059
6068
|
}
|
|
6060
6069
|
]
|
|
6061
6070
|
},
|
|
@@ -6322,7 +6331,7 @@
|
|
|
6322
6331
|
{
|
|
6323
6332
|
"name": "type",
|
|
6324
6333
|
"default": "`default`",
|
|
6325
|
-
"description": "标签类型,可选值为 `primary`、`success`、`danger`、`warning`",
|
|
6334
|
+
"description": "标签类型,可选值为 `primary`、`success`、`danger`、`warning`、`default`",
|
|
6326
6335
|
"value": {
|
|
6327
6336
|
"type": "string",
|
|
6328
6337
|
"kind": "expression"
|