@nutui/nutui 4.0.12-beta.1 → 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 +1 -1
- 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 +50 -50
- package/dist/styles/themes/jdb.scss +50 -50
- package/dist/styles/themes/jddkh.scss +50 -50
- package/dist/styles/themes/jdt.scss +50 -50
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- 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,13 +1,14 @@
|
|
|
1
|
-
import { ref
|
|
2
|
-
import { c as
|
|
3
|
-
import { P as
|
|
4
|
-
import { _ as
|
|
1
|
+
import { ref, computed, watch, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, createElementVNode, toDisplayString, createCommentVNode, Fragment, renderList, normalizeClass, createTextVNode } from "vue";
|
|
2
|
+
import { c as createComponent } from "./component-81a4c1d0.js";
|
|
3
|
+
import { P as Popup } from "./index-da0a7662.js";
|
|
4
|
+
import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
|
|
5
5
|
import "../locale/lang";
|
|
6
6
|
import "./Overlay.js";
|
|
7
7
|
import "@nutui/icons-vue";
|
|
8
|
-
const { create
|
|
8
|
+
const { create, translate } = createComponent("number-keyboard");
|
|
9
|
+
const _sfc_main = create({
|
|
9
10
|
components: {
|
|
10
|
-
[
|
|
11
|
+
[Popup.name]: Popup
|
|
11
12
|
},
|
|
12
13
|
props: {
|
|
13
14
|
confirmText: {
|
|
@@ -20,7 +21,7 @@ const { create: M, translate: P } = j("number-keyboard"), D = M({
|
|
|
20
21
|
},
|
|
21
22
|
visible: {
|
|
22
23
|
type: Boolean,
|
|
23
|
-
default:
|
|
24
|
+
default: false
|
|
24
25
|
},
|
|
25
26
|
type: {
|
|
26
27
|
type: String,
|
|
@@ -40,7 +41,7 @@ const { create: M, translate: P } = j("number-keyboard"), D = M({
|
|
|
40
41
|
},
|
|
41
42
|
randomKeys: {
|
|
42
43
|
type: Boolean,
|
|
43
|
-
default:
|
|
44
|
+
default: false
|
|
44
45
|
},
|
|
45
46
|
popClass: {
|
|
46
47
|
type: String,
|
|
@@ -48,157 +49,231 @@ const { create: M, translate: P } = j("number-keyboard"), D = M({
|
|
|
48
49
|
}
|
|
49
50
|
},
|
|
50
51
|
emits: ["input", "delete", "close", "blur", "update:modelValue", "update:visible"],
|
|
51
|
-
setup(
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
setup(props, { emit }) {
|
|
53
|
+
const clickKeyIndex = ref(void 0);
|
|
54
|
+
const show = ref(props.visible);
|
|
55
|
+
const root = ref();
|
|
56
|
+
function defaultKey() {
|
|
57
|
+
const { customKey } = props;
|
|
58
|
+
let object = {
|
|
56
59
|
id: "lock",
|
|
57
60
|
type: "lock"
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
};
|
|
62
|
+
let customKeys = Array.isArray(customKey) ? customKey : [customKey];
|
|
63
|
+
if (customKeys.length === 1) {
|
|
64
|
+
object = {
|
|
65
|
+
id: customKeys[0],
|
|
66
|
+
type: "custom"
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
return [...getBasicKeys(), object, { id: 0, type: "number" }, { id: "delete", type: "delete" }];
|
|
63
70
|
}
|
|
64
|
-
function
|
|
65
|
-
const
|
|
66
|
-
for (let
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
function getBasicKeys() {
|
|
72
|
+
const keys = [];
|
|
73
|
+
for (let i = 1; i <= 9; i++) {
|
|
74
|
+
keys.push({ id: i, type: "number" });
|
|
75
|
+
}
|
|
76
|
+
if (props.randomKeys) {
|
|
77
|
+
return keys.sort(() => Math.random() > 0.5 ? 1 : -1);
|
|
78
|
+
}
|
|
79
|
+
return keys;
|
|
69
80
|
}
|
|
70
|
-
function
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
)
|
|
81
|
+
function genCustomKeys() {
|
|
82
|
+
const keys = getBasicKeys();
|
|
83
|
+
const { customKey } = props;
|
|
84
|
+
let customKeys = Array.isArray(customKey) ? customKey : [customKey];
|
|
85
|
+
if (customKeys.length > 2) {
|
|
86
|
+
customKeys = [customKeys[0], customKeys[1]];
|
|
87
|
+
}
|
|
88
|
+
if (customKeys.length == 2 && props.title && props.type != "rightColumn") {
|
|
89
|
+
customKeys = [customKeys[0]];
|
|
90
|
+
}
|
|
91
|
+
if (customKeys.length === 1) {
|
|
92
|
+
if (props.title && props.type != "rightColumn") {
|
|
93
|
+
keys.push({ id: customKeys[0], type: "custom" }, { id: 0, type: "number" }, { id: "delete", type: "delete" });
|
|
94
|
+
} else {
|
|
95
|
+
keys.push({ id: 0, type: "number" }, { id: customKeys[0], type: "custom" });
|
|
96
|
+
}
|
|
97
|
+
} else if (customKeys.length === 2) {
|
|
98
|
+
keys.push(
|
|
99
|
+
{ id: customKeys[0], type: "custom" },
|
|
100
|
+
{ id: 0, type: "number" },
|
|
101
|
+
{ id: customKeys[1], type: "custom" }
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
return keys;
|
|
78
105
|
}
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
106
|
+
const keysList = computed(() => {
|
|
107
|
+
if (props.type == "rightColumn" || props.title != "") {
|
|
108
|
+
return genCustomKeys();
|
|
109
|
+
}
|
|
110
|
+
return defaultKey();
|
|
111
|
+
});
|
|
112
|
+
const onBlur = () => {
|
|
113
|
+
if (props.visible) {
|
|
114
|
+
emit("blur");
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const clickAway = (event) => {
|
|
118
|
+
const element = root.value;
|
|
119
|
+
let el = element && !element.contains(event.target);
|
|
120
|
+
if (el) {
|
|
121
|
+
onBlur();
|
|
122
|
+
}
|
|
84
123
|
};
|
|
85
|
-
|
|
86
|
-
() =>
|
|
87
|
-
(
|
|
88
|
-
|
|
124
|
+
watch(
|
|
125
|
+
() => props.visible,
|
|
126
|
+
(value) => {
|
|
127
|
+
show.value = value;
|
|
128
|
+
if (value) {
|
|
129
|
+
window.addEventListener("touchstart", clickAway, false);
|
|
130
|
+
} else {
|
|
131
|
+
window.removeEventListener("touchstart", clickAway, false);
|
|
132
|
+
}
|
|
89
133
|
}
|
|
90
134
|
);
|
|
91
|
-
function
|
|
92
|
-
|
|
135
|
+
function onTouchstart(item, event) {
|
|
136
|
+
event.stopPropagation();
|
|
137
|
+
clickKeyIndex.value = item.id;
|
|
138
|
+
if (item.type == "number" || item.type == "custom") {
|
|
139
|
+
emit("input", item.id);
|
|
140
|
+
if (props.modelValue.length < props.maxlength) {
|
|
141
|
+
emit("update:modelValue", props.modelValue + item.id);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
if (item.type == "lock") {
|
|
145
|
+
closeBoard();
|
|
146
|
+
}
|
|
147
|
+
if (item.type == "delete") {
|
|
148
|
+
emit("delete");
|
|
149
|
+
emit("update:modelValue", props.modelValue.slice(0, props.modelValue.length - 1));
|
|
150
|
+
}
|
|
93
151
|
}
|
|
94
|
-
function
|
|
95
|
-
|
|
152
|
+
function onTouchMove(event) {
|
|
153
|
+
event.stopPropagation();
|
|
96
154
|
}
|
|
97
|
-
function
|
|
98
|
-
|
|
155
|
+
function onTouchEnd(event) {
|
|
156
|
+
event.preventDefault();
|
|
157
|
+
clickKeyIndex.value = void 0;
|
|
99
158
|
}
|
|
100
|
-
function
|
|
101
|
-
|
|
159
|
+
function closeBoard() {
|
|
160
|
+
emit("update:visible", false);
|
|
161
|
+
emit("close");
|
|
102
162
|
}
|
|
103
163
|
return {
|
|
104
|
-
clickKeyIndex
|
|
105
|
-
defaultKey
|
|
106
|
-
closeBoard
|
|
107
|
-
onTouchEnd
|
|
108
|
-
onTouchMove
|
|
109
|
-
onTouchstart
|
|
110
|
-
keysList
|
|
111
|
-
genCustomKeys
|
|
112
|
-
getBasicKeys
|
|
113
|
-
root
|
|
114
|
-
show
|
|
115
|
-
translate
|
|
164
|
+
clickKeyIndex,
|
|
165
|
+
defaultKey,
|
|
166
|
+
closeBoard,
|
|
167
|
+
onTouchEnd,
|
|
168
|
+
onTouchMove,
|
|
169
|
+
onTouchstart,
|
|
170
|
+
keysList,
|
|
171
|
+
genCustomKeys,
|
|
172
|
+
getBasicKeys,
|
|
173
|
+
root,
|
|
174
|
+
show,
|
|
175
|
+
translate
|
|
116
176
|
};
|
|
117
177
|
}
|
|
118
|
-
})
|
|
178
|
+
});
|
|
179
|
+
const _hoisted_1 = { ref: "root" };
|
|
180
|
+
const _hoisted_2 = { class: "nut-number-keyboard" };
|
|
181
|
+
const _hoisted_3 = {
|
|
119
182
|
key: 0,
|
|
120
183
|
class: "nut-number-keyboard__header"
|
|
121
|
-
}
|
|
184
|
+
};
|
|
185
|
+
const _hoisted_4 = { class: "nut-number-keyboard__title" };
|
|
186
|
+
const _hoisted_5 = { class: "nut-number-keyboard__body" };
|
|
187
|
+
const _hoisted_6 = { class: "nut-number-keyboard__keys" };
|
|
188
|
+
const _hoisted_7 = ["onTouchstart"];
|
|
189
|
+
const _hoisted_8 = {
|
|
122
190
|
key: 1,
|
|
123
191
|
src: "https://img11.360buyimg.com/imagetools/jfs/t1/146371/38/8485/738/5f606425Eca239740/14f4b4f5f20d8a68.png"
|
|
124
|
-
}
|
|
192
|
+
};
|
|
193
|
+
const _hoisted_9 = {
|
|
125
194
|
key: 2,
|
|
126
195
|
src: "https://img11.360buyimg.com/imagetools/jfs/t1/129395/8/12735/2030/5f61ac37E70cab338/fb477dc11f46056c.png"
|
|
127
|
-
}
|
|
196
|
+
};
|
|
197
|
+
const _hoisted_10 = {
|
|
128
198
|
key: 0,
|
|
129
199
|
class: "nut-number-keyboard__sidebar"
|
|
130
|
-
}
|
|
131
|
-
|
|
200
|
+
};
|
|
201
|
+
const _hoisted_11 = { class: "nut-key__wrapper" };
|
|
202
|
+
const _hoisted_12 = /* @__PURE__ */ createElementVNode("img", { src: "https://img11.360buyimg.com/imagetools/jfs/t1/129395/8/12735/2030/5f61ac37E70cab338/fb477dc11f46056c.png" }, null, -1);
|
|
203
|
+
const _hoisted_13 = [
|
|
204
|
+
_hoisted_12
|
|
132
205
|
];
|
|
133
|
-
function
|
|
134
|
-
const
|
|
135
|
-
return
|
|
136
|
-
|
|
137
|
-
visible:
|
|
138
|
-
"onUpdate:visible":
|
|
206
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
207
|
+
const _component_nut_popup = resolveComponent("nut-popup");
|
|
208
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
209
|
+
createVNode(_component_nut_popup, {
|
|
210
|
+
visible: _ctx.show,
|
|
211
|
+
"onUpdate:visible": _cache[7] || (_cache[7] = ($event) => _ctx.show = $event),
|
|
139
212
|
position: "bottom",
|
|
140
|
-
popClass:
|
|
141
|
-
overlay:
|
|
142
|
-
teleportDisable:
|
|
213
|
+
popClass: _ctx.popClass,
|
|
214
|
+
overlay: false,
|
|
215
|
+
teleportDisable: false
|
|
143
216
|
}, {
|
|
144
|
-
default:
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
217
|
+
default: withCtx(() => [
|
|
218
|
+
createElementVNode("div", _hoisted_2, [
|
|
219
|
+
_ctx.title ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
220
|
+
createElementVNode("h3", _hoisted_4, toDisplayString(_ctx.title), 1),
|
|
221
|
+
_ctx.type == "default" ? (openBlock(), createElementBlock("span", {
|
|
149
222
|
key: 0,
|
|
150
223
|
class: "nut-number-keyboard__close",
|
|
151
|
-
onClick:
|
|
152
|
-
},
|
|
153
|
-
])) :
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
(
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
i("div", {
|
|
166
|
-
class: m([
|
|
167
|
-
"nut-key",
|
|
168
|
-
{ "nut-key--active": n.id == e.clickKeyIndex },
|
|
169
|
-
{ "nut-key--lock": n.type == "lock" },
|
|
170
|
-
{ "nut-key--delete": n.type == "delete" }
|
|
171
|
-
]),
|
|
172
|
-
onTouchstart: (d) => e.onTouchstart(n, d),
|
|
173
|
-
onTouchmove: o[1] || (o[1] = (d) => e.onTouchMove(d)),
|
|
174
|
-
onTouchend: o[2] || (o[2] = (d) => e.onTouchEnd(d))
|
|
224
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.closeBoard())
|
|
225
|
+
}, toDisplayString(_ctx.translate("done")), 1)) : createCommentVNode("", true)
|
|
226
|
+
])) : createCommentVNode("", true),
|
|
227
|
+
createElementVNode("div", _hoisted_5, [
|
|
228
|
+
createElementVNode("div", _hoisted_6, [
|
|
229
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.keysList, (item) => {
|
|
230
|
+
return openBlock(), createElementBlock("div", {
|
|
231
|
+
key: "key" + item.id,
|
|
232
|
+
class: normalizeClass([
|
|
233
|
+
"nut-key__wrapper",
|
|
234
|
+
{
|
|
235
|
+
"nut-key__wrapper--wider": item.id == 0 && _ctx.type == "rightColumn" && Array.isArray(_ctx.customKey) && _ctx.customKey.length == 1
|
|
236
|
+
}
|
|
237
|
+
])
|
|
175
238
|
}, [
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
239
|
+
createElementVNode("div", {
|
|
240
|
+
class: normalizeClass([
|
|
241
|
+
"nut-key",
|
|
242
|
+
{ "nut-key--active": item.id == _ctx.clickKeyIndex },
|
|
243
|
+
{ "nut-key--lock": item.type == "lock" },
|
|
244
|
+
{ "nut-key--delete": item.type == "delete" }
|
|
245
|
+
]),
|
|
246
|
+
onTouchstart: (event) => _ctx.onTouchstart(item, event),
|
|
247
|
+
onTouchmove: _cache[1] || (_cache[1] = (event) => _ctx.onTouchMove(event)),
|
|
248
|
+
onTouchend: _cache[2] || (_cache[2] = (event) => _ctx.onTouchEnd(event))
|
|
249
|
+
}, [
|
|
250
|
+
item.type == "number" || item.type == "custom" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
251
|
+
createTextVNode(toDisplayString(item.id), 1)
|
|
252
|
+
], 64)) : createCommentVNode("", true),
|
|
253
|
+
item.type == "lock" ? (openBlock(), createElementBlock("img", _hoisted_8)) : createCommentVNode("", true),
|
|
254
|
+
item.type == "delete" ? (openBlock(), createElementBlock("img", _hoisted_9)) : createCommentVNode("", true)
|
|
255
|
+
], 42, _hoisted_7)
|
|
256
|
+
], 2);
|
|
257
|
+
}), 128))
|
|
183
258
|
]),
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
class:
|
|
188
|
-
onTouchstart:
|
|
189
|
-
onTouchmove:
|
|
190
|
-
onTouchend:
|
|
191
|
-
},
|
|
259
|
+
_ctx.type == "rightColumn" ? (openBlock(), createElementBlock("div", _hoisted_10, [
|
|
260
|
+
createElementVNode("div", _hoisted_11, [
|
|
261
|
+
createElementVNode("div", {
|
|
262
|
+
class: normalizeClass(["nut-key", { active: _ctx.clickKeyIndex == "delete" }]),
|
|
263
|
+
onTouchstart: _cache[3] || (_cache[3] = (event) => _ctx.onTouchstart({ id: "delete", type: "delete" }, event)),
|
|
264
|
+
onTouchmove: _cache[4] || (_cache[4] = (event) => _ctx.onTouchMove(event)),
|
|
265
|
+
onTouchend: _cache[5] || (_cache[5] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
|
|
266
|
+
}, _hoisted_13, 34)
|
|
192
267
|
]),
|
|
193
|
-
|
|
268
|
+
createElementVNode("div", {
|
|
194
269
|
class: "nut-key__wrapper nut-key__wrapper--finish",
|
|
195
|
-
onClick:
|
|
270
|
+
onClick: _cache[6] || (_cache[6] = ($event) => _ctx.closeBoard())
|
|
196
271
|
}, [
|
|
197
|
-
|
|
198
|
-
class:
|
|
199
|
-
},
|
|
272
|
+
createElementVNode("div", {
|
|
273
|
+
class: normalizeClass(["nut-key", "nut-key--finish ", { activeFinsh: _ctx.clickKeyIndex == "finish" }])
|
|
274
|
+
}, toDisplayString(_ctx.confirmText || _ctx.translate("done")), 3)
|
|
200
275
|
])
|
|
201
|
-
])) :
|
|
276
|
+
])) : createCommentVNode("", true)
|
|
202
277
|
])
|
|
203
278
|
])
|
|
204
279
|
]),
|
|
@@ -206,7 +281,7 @@ function Z(e, o, c, f, h, b) {
|
|
|
206
281
|
}, 8, ["visible", "popClass"])
|
|
207
282
|
], 512);
|
|
208
283
|
}
|
|
209
|
-
const
|
|
284
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
210
285
|
export {
|
|
211
|
-
|
|
286
|
+
index as default
|
|
212
287
|
};
|
|
@@ -1,36 +1,52 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
11
16
|
};
|
|
12
|
-
import { computed
|
|
13
|
-
import { b as
|
|
14
|
-
import { _ as
|
|
17
|
+
import { computed, watchEffect, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, withModifiers, normalizeStyle, renderSlot, vShow } from "vue";
|
|
18
|
+
import { b as body, c as createComponent } from "./component-81a4c1d0.js";
|
|
19
|
+
import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
|
|
15
20
|
import "../locale/lang";
|
|
16
|
-
let
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
let count = 0;
|
|
22
|
+
const CLSNAME = "nut-overflow-hidden";
|
|
23
|
+
const useLockScroll = (isLock) => {
|
|
24
|
+
const lock = () => {
|
|
25
|
+
if (isLock()) {
|
|
26
|
+
try {
|
|
27
|
+
!count && body.classList.add(CLSNAME);
|
|
28
|
+
count++;
|
|
29
|
+
} catch (error) {
|
|
30
|
+
}
|
|
22
31
|
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
};
|
|
33
|
+
const unlock = () => {
|
|
34
|
+
if (isLock() && count) {
|
|
35
|
+
try {
|
|
36
|
+
count--;
|
|
37
|
+
!count && body.classList.remove(CLSNAME);
|
|
38
|
+
} catch (error) {
|
|
39
|
+
}
|
|
28
40
|
}
|
|
29
|
-
}
|
|
41
|
+
};
|
|
42
|
+
return [lock, unlock];
|
|
43
|
+
};
|
|
44
|
+
const { componentName, create } = createComponent("overlay");
|
|
45
|
+
const _sfc_main = create({
|
|
30
46
|
props: {
|
|
31
47
|
visible: {
|
|
32
48
|
type: Boolean,
|
|
33
|
-
default:
|
|
49
|
+
default: false
|
|
34
50
|
},
|
|
35
51
|
zIndex: {
|
|
36
52
|
type: [Number, String],
|
|
@@ -42,7 +58,7 @@ const k = "nut-overflow-hidden", L = (e) => [() => {
|
|
|
42
58
|
},
|
|
43
59
|
lockScroll: {
|
|
44
60
|
type: Boolean,
|
|
45
|
-
default:
|
|
61
|
+
default: true
|
|
46
62
|
},
|
|
47
63
|
overlayClass: {
|
|
48
64
|
type: String,
|
|
@@ -53,42 +69,54 @@ const k = "nut-overflow-hidden", L = (e) => [() => {
|
|
|
53
69
|
},
|
|
54
70
|
closeOnClickOverlay: {
|
|
55
71
|
type: Boolean,
|
|
56
|
-
default:
|
|
72
|
+
default: true
|
|
57
73
|
}
|
|
58
74
|
},
|
|
59
75
|
emits: ["click", "update:visible"],
|
|
60
|
-
setup(
|
|
61
|
-
const [
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
76
|
+
setup(props, { emit }) {
|
|
77
|
+
const [lock, unlock] = useLockScroll(() => props.lockScroll);
|
|
78
|
+
const classes = computed(() => {
|
|
79
|
+
const prefixCls = componentName;
|
|
80
|
+
return {
|
|
81
|
+
[prefixCls]: true,
|
|
82
|
+
[props.overlayClass]: true
|
|
83
|
+
};
|
|
84
|
+
});
|
|
85
|
+
const style = computed(() => {
|
|
86
|
+
return __spreadValues({
|
|
87
|
+
transitionDuration: `${props.duration}s`,
|
|
88
|
+
zIndex: props.zIndex
|
|
89
|
+
}, props.overlayStyle);
|
|
90
|
+
});
|
|
91
|
+
watchEffect(() => {
|
|
92
|
+
props.visible ? lock() : unlock();
|
|
93
|
+
});
|
|
94
|
+
const onClick = (e) => {
|
|
95
|
+
emit("click", e);
|
|
96
|
+
if (props.closeOnClickOverlay) {
|
|
97
|
+
emit("update:visible", false);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
return { classes, style, onClick };
|
|
73
101
|
}
|
|
74
102
|
});
|
|
75
|
-
function
|
|
76
|
-
return
|
|
77
|
-
default:
|
|
78
|
-
|
|
79
|
-
class:
|
|
80
|
-
onClick:
|
|
81
|
-
style:
|
|
103
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
104
|
+
return openBlock(), createBlock(Transition, { name: "overlay-fade" }, {
|
|
105
|
+
default: withCtx(() => [
|
|
106
|
+
withDirectives(createElementVNode("view", {
|
|
107
|
+
class: normalizeClass(_ctx.classes),
|
|
108
|
+
onClick: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.onClick && _ctx.onClick(...args), ["stop"])),
|
|
109
|
+
style: normalizeStyle(_ctx.style)
|
|
82
110
|
}, [
|
|
83
|
-
|
|
111
|
+
renderSlot(_ctx.$slots, "default")
|
|
84
112
|
], 6), [
|
|
85
|
-
[
|
|
113
|
+
[vShow, _ctx.visible]
|
|
86
114
|
])
|
|
87
115
|
]),
|
|
88
116
|
_: 3
|
|
89
117
|
});
|
|
90
118
|
}
|
|
91
|
-
const
|
|
119
|
+
const Overlay = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
92
120
|
export {
|
|
93
|
-
|
|
121
|
+
Overlay as default
|
|
94
122
|
};
|