@opentinyvue/vue-cascader 2.22.0 → 3.22.0
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/lib/index.js +1 -1
- package/lib/mobile-first.js +291 -334
- package/lib/pc.js +317 -335
- package/package.json +12 -12
- package/src/index.d.ts +217 -1
- package/src/mobile-first.vue.d.ts +169 -1
- package/src/pc-first.vue.d.ts +128 -1
- package/src/pc.vue.d.ts +134 -1
package/lib/pc.js
CHANGED
|
@@ -9,36 +9,40 @@ import FilterBox from '@opentinyvue/vue-filter-box';
|
|
|
9
9
|
import Tooltip from '@opentinyvue/vue-tooltip';
|
|
10
10
|
import { iconClose, IconTriangleDown, IconUpWard, iconYes } from '@opentinyvue/vue-icon';
|
|
11
11
|
import '@opentinyvue/vue-theme/cascader/index.css';
|
|
12
|
+
import { resolveComponent, resolveDirective, withDirectives, openBlock, createElementBlock, normalizeClass, createBlock, withModifiers, createCommentVNode, createElementVNode, withCtx, resolveDynamicComponent, createTextVNode, toDisplayString, Fragment, renderList, withKeys, vModelText, createVNode, Transition, vShow, createSlots, renderSlot } from 'vue';
|
|
12
13
|
|
|
13
|
-
function
|
|
14
|
-
var
|
|
15
|
-
if (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
hook = injectStyles;
|
|
14
|
+
function _createForOfIteratorHelperLoose(r, e) {
|
|
15
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
16
|
+
if (t) return (t = t.call(r)).next.bind(t);
|
|
17
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
18
|
+
t && (r = t);
|
|
19
|
+
var o = 0;
|
|
20
|
+
return function() {
|
|
21
|
+
return o >= r.length ? { done: true } : { done: false, value: r[o++] };
|
|
22
|
+
};
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
32
|
-
} else {
|
|
33
|
-
var existing = options.beforeCreate;
|
|
34
|
-
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
35
|
-
}
|
|
24
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
25
|
+
}
|
|
26
|
+
function _unsupportedIterableToArray(r, a) {
|
|
27
|
+
if (r) {
|
|
28
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
29
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
30
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
36
31
|
}
|
|
37
|
-
return {
|
|
38
|
-
exports: scriptExports,
|
|
39
|
-
options
|
|
40
|
-
};
|
|
41
32
|
}
|
|
33
|
+
function _arrayLikeToArray(r, a) {
|
|
34
|
+
(null == a || a > r.length) && (a = r.length);
|
|
35
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
36
|
+
return n;
|
|
37
|
+
}
|
|
38
|
+
var _export_sfc = function _export_sfc2(sfc, props) {
|
|
39
|
+
var target = sfc.__vccOpts || sfc;
|
|
40
|
+
for (var _iterator = _createForOfIteratorHelperLoose(props), _step; !(_step = _iterator()).done; ) {
|
|
41
|
+
var _step$value = _step.value, key = _step$value[0], val = _step$value[1];
|
|
42
|
+
target[key] = val;
|
|
43
|
+
}
|
|
44
|
+
return target;
|
|
45
|
+
};
|
|
42
46
|
|
|
43
47
|
function _extends() {
|
|
44
48
|
return _extends = Object.assign ? Object.assign.bind() : function(n) {
|
|
@@ -49,7 +53,7 @@ function _extends() {
|
|
|
49
53
|
return n;
|
|
50
54
|
}, _extends.apply(null, arguments);
|
|
51
55
|
}
|
|
52
|
-
var
|
|
56
|
+
var _sfc_main = defineComponent({
|
|
53
57
|
props: [].concat(props, ["modelValue", "options", "props", "size", "placeholder", "disabled", "clearable", "filterable", "filterMethod", "separator", "showAllLevels", "collapseTags", "debounce", "beforeFilter", "popperClass", "placement", "popperOptions", "visibleArrow", "offset", "boundariesPadding", "arrowOffset", "popperAppendToBody", "autoSize", "displayOnly", "shape", "label", "tip", "hoverExpand", "blank", "changeCompat"]),
|
|
54
58
|
emits: ["update:modelValue", "change", "visible-change", "focus", "blur", "expand-change", "active-item-change", "remove-tag", "created"],
|
|
55
59
|
directives: _extends({}, directive({
|
|
@@ -83,322 +87,300 @@ var __vue2_script = defineComponent({
|
|
|
83
87
|
});
|
|
84
88
|
}
|
|
85
89
|
});
|
|
86
|
-
var
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}).join("; ") : _vm.state.inputValue,
|
|
133
|
-
"drop-down-visible": _vm.state.dropDownVisible,
|
|
134
|
-
"blank": _vm.blank
|
|
135
|
-
},
|
|
136
|
-
on: {
|
|
137
|
-
"click": function click($event) {
|
|
138
|
-
$event.stopPropagation();
|
|
139
|
-
return _vm.toggleDropDownVisible();
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}) : _vm._e(), _c("div", {
|
|
143
|
-
staticClass: "tiny-cascader-content"
|
|
144
|
-
}, [_vm.shape !== "filter" ? _c("tiny-input", {
|
|
145
|
-
ref: "input",
|
|
146
|
-
class: {
|
|
147
|
-
"is-focus": _vm.state.dropDownVisible
|
|
90
|
+
var _hoisted_1 = {
|
|
91
|
+
class: "tiny-cascader-content"
|
|
92
|
+
};
|
|
93
|
+
var _hoisted_2 = ["placeholder"];
|
|
94
|
+
var _hoisted_3 = ["onClick"];
|
|
95
|
+
var _hoisted_4 = {
|
|
96
|
+
class: "tiny-cascader__empty-text"
|
|
97
|
+
};
|
|
98
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
99
|
+
var _component_tiny_filter_box = resolveComponent("tiny-filter-box");
|
|
100
|
+
var _component_icon_close = resolveComponent("icon-close");
|
|
101
|
+
var _component_tiny_input = resolveComponent("tiny-input");
|
|
102
|
+
var _component_tiny_tag = resolveComponent("tiny-tag");
|
|
103
|
+
var _component_tiny_tooltip = resolveComponent("tiny-tooltip");
|
|
104
|
+
var _component_tiny_cascader_panel = resolveComponent("tiny-cascader-panel");
|
|
105
|
+
var _component_icon_yes = resolveComponent("icon-yes");
|
|
106
|
+
var _component_tiny_scrollbar = resolveComponent("tiny-scrollbar");
|
|
107
|
+
var _directive_highlight_query = resolveDirective("highlight-query");
|
|
108
|
+
var _directive_clickoutside = resolveDirective("clickoutside");
|
|
109
|
+
return withDirectives((openBlock(), createElementBlock(
|
|
110
|
+
"div",
|
|
111
|
+
{
|
|
112
|
+
ref: "reference",
|
|
113
|
+
class: normalizeClass(["tiny-cascader", _ctx.state.realSize && "tiny-cascader--" + _ctx.state.realSize, {
|
|
114
|
+
"is-disabled": _ctx.state.isDisabled
|
|
115
|
+
}, {
|
|
116
|
+
"tiny-cascader-multiple": _ctx.state.multiple
|
|
117
|
+
}, {
|
|
118
|
+
"is-display-only": _ctx.state.isDisplayOnly
|
|
119
|
+
}, {
|
|
120
|
+
"show-auto-width": _ctx.state.showAutoWidth
|
|
121
|
+
}, {
|
|
122
|
+
"is-hover-expand": _ctx.hoverExpand
|
|
123
|
+
}]),
|
|
124
|
+
onMouseenter: _cache[11] || (_cache[11] = function($event) {
|
|
125
|
+
return _ctx.state.inputHover = true;
|
|
126
|
+
}),
|
|
127
|
+
onMouseleave: _cache[12] || (_cache[12] = function($event) {
|
|
128
|
+
return _ctx.state.inputHover = false;
|
|
129
|
+
}),
|
|
130
|
+
onClick: _cache[13] || (_cache[13] = function() {
|
|
131
|
+
return _ctx.toggleDropDownVisible(_ctx.state.readonly ? void 0 : true);
|
|
132
|
+
}),
|
|
133
|
+
onKeydown: _cache[14] || (_cache[14] = function() {
|
|
134
|
+
return _ctx.handleKeyDown && _ctx.handleKeyDown.apply(_ctx, arguments);
|
|
135
|
+
})
|
|
148
136
|
},
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
"
|
|
154
|
-
"
|
|
155
|
-
|
|
156
|
-
|
|
137
|
+
[_ctx.shape === "filter" ? (openBlock(), createBlock(_component_tiny_filter_box, {
|
|
138
|
+
key: 0,
|
|
139
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(function($event) {
|
|
140
|
+
return _ctx.toggleDropDownVisible();
|
|
141
|
+
}, ["stop"])),
|
|
142
|
+
"show-close": _ctx.clearable,
|
|
143
|
+
placeholder: _ctx.placeholder,
|
|
144
|
+
disabled: _ctx.state.isDisabled,
|
|
145
|
+
label: _ctx.label,
|
|
146
|
+
tip: _ctx.tip,
|
|
147
|
+
value: _ctx.state.multiple ? _ctx.state.presentTags.map(function(item) {
|
|
148
|
+
return item.text;
|
|
149
|
+
}).join("; ") : _ctx.state.inputValue,
|
|
150
|
+
"drop-down-visible": _ctx.state.dropDownVisible,
|
|
151
|
+
blank: _ctx.blank
|
|
152
|
+
}, null, 8, ["show-close", "placeholder", "disabled", "label", "tip", "value", "drop-down-visible", "blank"])) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_1, [_ctx.shape !== "filter" ? (openBlock(), createBlock(_component_tiny_input, {
|
|
153
|
+
key: 0,
|
|
154
|
+
ref: "input",
|
|
155
|
+
"model-value": _ctx.state.multiple && _ctx.filterable ? "" : _ctx.state.inputValues,
|
|
156
|
+
size: _ctx.state.realSize,
|
|
157
|
+
placeholder: _ctx.state.multiple && _ctx.filterable ? "" : _ctx.state.placeholder,
|
|
158
|
+
readonly: _ctx.state.readonly,
|
|
159
|
+
disabled: _ctx.state.isDisabled,
|
|
160
|
+
"display-only": _ctx.displayOnly,
|
|
161
|
+
"display-only-content": _ctx.state.multiple ? _ctx.state.presentTags.map(function(item) {
|
|
157
162
|
return item.text;
|
|
158
163
|
}).join("; ") : "",
|
|
159
|
-
"validate-event": false
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
return [_vm.state.clearBtnVisible ? _c("icon-close", {
|
|
164
|
+
"validate-event": false,
|
|
165
|
+
class: normalizeClass({
|
|
166
|
+
"is-focus": _ctx.state.dropDownVisible
|
|
167
|
+
}),
|
|
168
|
+
onFocus: _ctx.handleFocus,
|
|
169
|
+
onBlur: _ctx.handleBlur,
|
|
170
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = function(val) {
|
|
171
|
+
return _ctx.handleInput(val, {});
|
|
172
|
+
})
|
|
173
|
+
}, {
|
|
174
|
+
suffix: withCtx(function() {
|
|
175
|
+
return [_ctx.state.clearBtnVisible ? (openBlock(), createBlock(_component_icon_close, {
|
|
172
176
|
key: "clear",
|
|
173
|
-
class: ["tiny-input__icon", "tiny-input__icon-close"],
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
$event.stopPropagation();
|
|
177
|
-
return _vm.handleClear.apply(null, arguments);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}) : _c(_vm.state.dropDownVisible ? "icon-chevron-up" : "icon-chevron-down", {
|
|
177
|
+
class: normalizeClass(["tiny-input__icon", "tiny-input__icon-close"]),
|
|
178
|
+
onClick: withModifiers(_ctx.handleClear, ["stop"])
|
|
179
|
+
}, null, 8, ["onClick"])) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.state.dropDownVisible ? "icon-chevron-up" : "icon-chevron-down"), {
|
|
181
180
|
key: "arrow-down",
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
181
|
+
class: normalizeClass(["tiny-input__icon", _ctx.state.dropDownVisible && "is-reverse"]),
|
|
182
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(function($event) {
|
|
183
|
+
return _ctx.toggleDropDownVisible();
|
|
184
|
+
}, ["stop"]))
|
|
185
|
+
}, null, 8, ["class"]))];
|
|
186
|
+
}),
|
|
187
|
+
_: 1
|
|
188
|
+
/* STABLE */
|
|
189
|
+
}, 8, ["model-value", "size", "placeholder", "readonly", "disabled", "display-only", "display-only-content", "class", "onFocus", "onBlur"])) : createCommentVNode("v-if", true), _ctx.state.multiple && !_ctx.state.isDisplayOnly && !_ctx.shape ? (openBlock(), createElementBlock(
|
|
190
|
+
"div",
|
|
191
|
+
{
|
|
192
|
+
key: 1,
|
|
193
|
+
ref: "tags-content",
|
|
194
|
+
class: normalizeClass(["tiny-cascader__tags", {
|
|
195
|
+
"is-expand-content": _ctx.hoverExpand && !_ctx.state.isDisabled && (_ctx.state.inputHover || _ctx.state.dropDownVisible)
|
|
196
|
+
}])
|
|
191
197
|
},
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
},
|
|
224
|
-
nativeOn: {
|
|
225
|
-
"mouseenter": function mouseenter($event) {
|
|
226
|
-
return _vm.handleMouseenter.apply(null, arguments);
|
|
227
|
-
},
|
|
228
|
-
"mouseleave": function mouseleave($event) {
|
|
229
|
-
return _vm.handleMouseleave.apply(null, arguments);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
}, [_c("span", [_vm._v(_vm._s(tag.text))])]);
|
|
233
|
-
}), _vm.filterable && !_vm.state.isDisabled ? _c("input", {
|
|
234
|
-
directives: [{
|
|
235
|
-
name: "model",
|
|
236
|
-
rawName: "v-model.trim",
|
|
237
|
-
value: _vm.state.inputValue,
|
|
238
|
-
expression: "state.inputValue",
|
|
239
|
-
modifiers: {
|
|
240
|
-
"trim": true
|
|
241
|
-
}
|
|
242
|
-
}],
|
|
243
|
-
staticClass: "tiny-cascader__search-input",
|
|
244
|
-
attrs: {
|
|
245
|
-
"type": "text",
|
|
246
|
-
"placeholder": _vm.state.presentTags.length ? "" : _vm.placeholder
|
|
247
|
-
},
|
|
248
|
-
domProps: {
|
|
249
|
-
"value": _vm.state.inputValue
|
|
250
|
-
},
|
|
251
|
-
on: {
|
|
252
|
-
"input": [function($event) {
|
|
253
|
-
if ($event.target.composing) return;
|
|
254
|
-
_vm.$set(_vm.state, "inputValue", $event.target.value.trim());
|
|
255
|
-
}, function(e) {
|
|
256
|
-
return _vm.handleInput(_vm.state.inputValue, e);
|
|
257
|
-
}],
|
|
258
|
-
"click": function click($event) {
|
|
259
|
-
$event.stopPropagation();
|
|
260
|
-
return _vm.toggleDropDownVisible(true);
|
|
261
|
-
},
|
|
262
|
-
"keydown": function keydown($event) {
|
|
263
|
-
if (!$event.type.indexOf("key") && _vm._k($event.keyCode, "delete", [8, 46], $event.key, ["Backspace", "Delete", "Del"])) return null;
|
|
264
|
-
return _vm.handleDelete.apply(null, arguments);
|
|
265
|
-
},
|
|
266
|
-
"blur": function blur($event) {
|
|
267
|
-
return _vm.$forceUpdate();
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
}) : _vm._e()], 2) : _vm._e()], 1), _c("tiny-tooltip", {
|
|
271
|
-
ref: "tooltip",
|
|
272
|
-
attrs: {
|
|
273
|
-
"manual": true,
|
|
274
|
-
"effect": "light",
|
|
275
|
-
"content": _vm.state.tooltipContent,
|
|
276
|
-
"placement": "top"
|
|
277
|
-
},
|
|
278
|
-
model: {
|
|
279
|
-
value: _vm.state.tooltipVisible,
|
|
280
|
-
callback: function callback($$v) {
|
|
281
|
-
_vm.$set(_vm.state, "tooltipVisible", $$v);
|
|
282
|
-
},
|
|
283
|
-
expression: "state.tooltipVisible"
|
|
284
|
-
}
|
|
285
|
-
}), _c("transition", {
|
|
286
|
-
attrs: {
|
|
287
|
-
"name": "tiny-zoom-in-top"
|
|
288
|
-
},
|
|
289
|
-
on: {
|
|
290
|
-
"after-leave": _vm.handleDropdownLeave
|
|
291
|
-
}
|
|
292
|
-
}, [_c("div", {
|
|
293
|
-
directives: [{
|
|
294
|
-
name: "show",
|
|
295
|
-
rawName: "v-show",
|
|
296
|
-
value: _vm.state.dropDownVisible,
|
|
297
|
-
expression: "state.dropDownVisible"
|
|
298
|
-
}],
|
|
299
|
-
ref: "popper",
|
|
300
|
-
class: ["tiny-popper", "tiny-cascader-dropdown", "tiny-cascader__dropdown", _vm.popperClass, {
|
|
301
|
-
"is-auto-size": _vm.autoSize,
|
|
302
|
-
"is-multiple": _vm.state.multiple
|
|
303
|
-
}],
|
|
304
|
-
on: {
|
|
305
|
-
"mousedown": function mousedown($event) {
|
|
306
|
-
$event.stopPropagation();
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
}, [_c("tiny-cascader-panel", {
|
|
310
|
-
directives: [{
|
|
311
|
-
name: "show",
|
|
312
|
-
rawName: "v-show",
|
|
313
|
-
value: !_vm.state.filtering,
|
|
314
|
-
expression: "!state.filtering"
|
|
315
|
-
}],
|
|
316
|
-
ref: "panel",
|
|
317
|
-
attrs: {
|
|
318
|
-
"options": _vm.options,
|
|
319
|
-
"props": _vm.state.config,
|
|
320
|
-
"border": false,
|
|
321
|
-
"render-label": _vm.slots.default,
|
|
322
|
-
"onlyUsePanel": false
|
|
323
|
-
},
|
|
324
|
-
on: {
|
|
325
|
-
"expand-change": _vm.handleExpandChange,
|
|
326
|
-
"close": function close($event) {
|
|
327
|
-
return _vm.toggleDropDownVisible(false);
|
|
328
|
-
},
|
|
329
|
-
"load-data": _vm.computePresentContent
|
|
330
|
-
},
|
|
331
|
-
model: {
|
|
332
|
-
value: _vm.state.checkedValue,
|
|
333
|
-
callback: function callback($$v) {
|
|
334
|
-
_vm.$set(_vm.state, "checkedValue", $$v);
|
|
335
|
-
},
|
|
336
|
-
expression: "state.checkedValue"
|
|
337
|
-
}
|
|
338
|
-
}), _vm.filterable ? _c("tiny-scrollbar", {
|
|
339
|
-
directives: [{
|
|
340
|
-
name: "show",
|
|
341
|
-
rawName: "v-show",
|
|
342
|
-
value: _vm.state.filtering,
|
|
343
|
-
expression: "state.filtering"
|
|
344
|
-
}],
|
|
345
|
-
ref: "suggestionPanel",
|
|
346
|
-
staticClass: "tiny-cascader__suggestion-panel",
|
|
347
|
-
attrs: {
|
|
348
|
-
"tag": "ul",
|
|
349
|
-
"view-class": "tiny-cascader__suggestion-list"
|
|
350
|
-
},
|
|
351
|
-
on: {
|
|
352
|
-
"keydown": _vm.handleSuggestionKeyDown
|
|
353
|
-
},
|
|
354
|
-
scopedSlots: _vm._u([_vm.state.suggestions.length ? {
|
|
355
|
-
key: "default",
|
|
356
|
-
fn: function fn() {
|
|
357
|
-
return _vm._l(_vm.state.suggestions, function(item, index) {
|
|
358
|
-
return _c("li", {
|
|
359
|
-
directives: [{
|
|
360
|
-
name: "highlight-query",
|
|
361
|
-
rawName: "v-highlight-query",
|
|
362
|
-
value: _vm.state.multiple ? _vm.state.presentText : _vm.state.inputValue,
|
|
363
|
-
expression: "state.multiple ? state.presentText : state.inputValue"
|
|
364
|
-
}],
|
|
365
|
-
key: item.uid,
|
|
366
|
-
class: ["tiny-cascader__suggestion-item", item.checked && "is-checked"],
|
|
367
|
-
attrs: {
|
|
368
|
-
"tabindex": -1
|
|
198
|
+
[_ctx.hoverExpand ? (openBlock(), createBlock(_component_tiny_tag, {
|
|
199
|
+
key: 0,
|
|
200
|
+
class: normalizeClass(["tiny-cascader__tags-collapse", {
|
|
201
|
+
"is-hidden": _ctx.state.isHidden
|
|
202
|
+
}]),
|
|
203
|
+
type: _ctx.state.tagTypeWhenMultiple,
|
|
204
|
+
closable: false,
|
|
205
|
+
size: _ctx.state.tagSize
|
|
206
|
+
}, {
|
|
207
|
+
default: withCtx(function() {
|
|
208
|
+
return [createTextVNode(
|
|
209
|
+
"+ " + toDisplayString(_ctx.state.collapseTagsLength),
|
|
210
|
+
1
|
|
211
|
+
/* TEXT */
|
|
212
|
+
)];
|
|
213
|
+
}),
|
|
214
|
+
_: 1
|
|
215
|
+
/* STABLE */
|
|
216
|
+
}, 8, ["class", "type", "size"])) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(
|
|
217
|
+
Fragment,
|
|
218
|
+
null,
|
|
219
|
+
renderList(_ctx.state.presentTags, function(tag, index) {
|
|
220
|
+
return openBlock(), createBlock(_component_tiny_tag, {
|
|
221
|
+
key: tag.key,
|
|
222
|
+
type: _ctx.state.tagTypeWhenMultiple,
|
|
223
|
+
size: _ctx.state.tagSize,
|
|
224
|
+
hit: tag.hitState,
|
|
225
|
+
closable: tag.closable,
|
|
226
|
+
"disable-transitions": "",
|
|
227
|
+
onClose: function onClose($event) {
|
|
228
|
+
return _ctx.deleteTag(index);
|
|
369
229
|
},
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
return _vm.handleSuggestionClick(index);
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
}, [_vm._t("filter", function() {
|
|
376
|
-
return [_c("span", [_vm._v(_vm._s(item.text))])];
|
|
230
|
+
onMouseenter: _ctx.handleMouseenter,
|
|
231
|
+
onMouseleave: _ctx.handleMouseleave
|
|
377
232
|
}, {
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
233
|
+
default: withCtx(function() {
|
|
234
|
+
return [createElementVNode(
|
|
235
|
+
"span",
|
|
236
|
+
null,
|
|
237
|
+
toDisplayString(tag.text),
|
|
238
|
+
1
|
|
239
|
+
/* TEXT */
|
|
240
|
+
)];
|
|
241
|
+
}),
|
|
242
|
+
_: 2
|
|
243
|
+
/* DYNAMIC */
|
|
244
|
+
}, 1032, ["type", "size", "hit", "closable", "onClose", "onMouseenter", "onMouseleave"]);
|
|
245
|
+
}),
|
|
246
|
+
128
|
|
247
|
+
/* KEYED_FRAGMENT */
|
|
248
|
+
)), _ctx.filterable && !_ctx.state.isDisabled ? withDirectives((openBlock(), createElementBlock("input", {
|
|
249
|
+
key: 1,
|
|
250
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = function($event) {
|
|
251
|
+
return _ctx.state.inputValue = $event;
|
|
252
|
+
}),
|
|
253
|
+
type: "text",
|
|
254
|
+
class: "tiny-cascader__search-input",
|
|
255
|
+
placeholder: _ctx.state.presentTags.length ? "" : _ctx.placeholder,
|
|
256
|
+
onInput: _cache[4] || (_cache[4] = function(e) {
|
|
257
|
+
return _ctx.handleInput(_ctx.state.inputValue, e);
|
|
258
|
+
}),
|
|
259
|
+
onClick: _cache[5] || (_cache[5] = withModifiers(function($event) {
|
|
260
|
+
return _ctx.toggleDropDownVisible(true);
|
|
261
|
+
}, ["stop"])),
|
|
262
|
+
onKeydown: _cache[6] || (_cache[6] = withKeys(function() {
|
|
263
|
+
return _ctx.handleDelete && _ctx.handleDelete.apply(_ctx, arguments);
|
|
264
|
+
}, ["delete"]))
|
|
265
|
+
}, null, 40, _hoisted_2)), [[vModelText, _ctx.state.inputValue, void 0, {
|
|
266
|
+
trim: true
|
|
267
|
+
}]]) : createCommentVNode("v-if", true)],
|
|
268
|
+
2
|
|
269
|
+
/* CLASS */
|
|
270
|
+
)) : createCommentVNode("v-if", true)]), createVNode(_component_tiny_tooltip, {
|
|
271
|
+
ref: "tooltip",
|
|
272
|
+
modelValue: _ctx.state.tooltipVisible,
|
|
273
|
+
"onUpdate:modelValue": _cache[7] || (_cache[7] = function($event) {
|
|
274
|
+
return _ctx.state.tooltipVisible = $event;
|
|
275
|
+
}),
|
|
276
|
+
manual: true,
|
|
277
|
+
effect: "light",
|
|
278
|
+
content: _ctx.state.tooltipContent,
|
|
279
|
+
placement: "top"
|
|
280
|
+
}, null, 8, ["modelValue", "content"]), createVNode(Transition, {
|
|
281
|
+
name: "tiny-zoom-in-top",
|
|
282
|
+
onAfterLeave: _ctx.handleDropdownLeave,
|
|
283
|
+
persisted: ""
|
|
284
|
+
}, {
|
|
285
|
+
default: withCtx(function() {
|
|
286
|
+
return [withDirectives(createElementVNode(
|
|
287
|
+
"div",
|
|
288
|
+
{
|
|
289
|
+
ref: "popper",
|
|
290
|
+
class: normalizeClass(["tiny-popper", "tiny-cascader-dropdown", "tiny-cascader__dropdown", _ctx.popperClass, {
|
|
291
|
+
"is-auto-size": _ctx.autoSize,
|
|
292
|
+
"is-multiple": _ctx.state.multiple
|
|
293
|
+
}]),
|
|
294
|
+
onMousedown: _cache[10] || (_cache[10] = withModifiers(function() {
|
|
295
|
+
}, ["stop"]))
|
|
296
|
+
},
|
|
297
|
+
[withDirectives(createVNode(_component_tiny_cascader_panel, {
|
|
298
|
+
ref: "panel",
|
|
299
|
+
modelValue: _ctx.state.checkedValue,
|
|
300
|
+
"onUpdate:modelValue": _cache[8] || (_cache[8] = function($event) {
|
|
301
|
+
return _ctx.state.checkedValue = $event;
|
|
302
|
+
}),
|
|
303
|
+
options: _ctx.options,
|
|
304
|
+
props: _ctx.state.config,
|
|
305
|
+
border: false,
|
|
306
|
+
"render-label": _ctx.slots.default,
|
|
307
|
+
onExpandChange: _ctx.handleExpandChange,
|
|
308
|
+
onClose: _cache[9] || (_cache[9] = function($event) {
|
|
309
|
+
return _ctx.toggleDropDownVisible(false);
|
|
310
|
+
}),
|
|
311
|
+
onLoadData: _ctx.computePresentContent,
|
|
312
|
+
onlyUsePanel: false
|
|
313
|
+
}, null, 8, ["modelValue", "options", "props", "render-label", "onExpandChange", "onLoadData"]), [[vShow, !_ctx.state.filtering]]), _ctx.filterable ? withDirectives((openBlock(), createBlock(_component_tiny_scrollbar, {
|
|
314
|
+
key: 0,
|
|
315
|
+
ref: "suggestionPanel",
|
|
316
|
+
tag: "ul",
|
|
317
|
+
class: "tiny-cascader__suggestion-panel",
|
|
318
|
+
"view-class": "tiny-cascader__suggestion-list",
|
|
319
|
+
onKeydown: _ctx.handleSuggestionKeyDown
|
|
320
|
+
}, createSlots({
|
|
321
|
+
default: withCtx(function() {
|
|
322
|
+
return [!_ctx.state.suggestions.length ? renderSlot(_ctx.$slots, "empty", {
|
|
323
|
+
key: 0
|
|
324
|
+
}, function() {
|
|
325
|
+
return [createElementVNode(
|
|
326
|
+
"li",
|
|
327
|
+
_hoisted_4,
|
|
328
|
+
toDisplayString(_ctx.t("ui.cascader.noMatch")),
|
|
329
|
+
1
|
|
330
|
+
/* TEXT */
|
|
331
|
+
)];
|
|
332
|
+
}) : createCommentVNode("v-if", true)];
|
|
333
|
+
}),
|
|
334
|
+
_: 2
|
|
335
|
+
/* DYNAMIC */
|
|
336
|
+
}, [_ctx.state.suggestions.length ? {
|
|
337
|
+
name: "default",
|
|
338
|
+
fn: withCtx(function() {
|
|
339
|
+
return [(openBlock(true), createElementBlock(
|
|
340
|
+
Fragment,
|
|
341
|
+
null,
|
|
342
|
+
renderList(_ctx.state.suggestions, function(item, index) {
|
|
343
|
+
return withDirectives((openBlock(), createElementBlock("li", {
|
|
344
|
+
key: item.uid,
|
|
345
|
+
class: normalizeClass(["tiny-cascader__suggestion-item", item.checked && "is-checked"]),
|
|
346
|
+
tabindex: -1,
|
|
347
|
+
onClick: function onClick($event) {
|
|
348
|
+
return _ctx.handleSuggestionClick(index);
|
|
349
|
+
}
|
|
350
|
+
}, [renderSlot(_ctx.$slots, "filter", {
|
|
351
|
+
item: item.text
|
|
352
|
+
}, function() {
|
|
353
|
+
return [createElementVNode(
|
|
354
|
+
"span",
|
|
355
|
+
null,
|
|
356
|
+
toDisplayString(item.text),
|
|
357
|
+
1
|
|
358
|
+
/* TEXT */
|
|
359
|
+
)];
|
|
360
|
+
}), item.checked ? (openBlock(), createBlock(_component_icon_yes, {
|
|
361
|
+
key: 0,
|
|
362
|
+
class: "icon-check"
|
|
363
|
+
})) : createCommentVNode("v-if", true)], 10, _hoisted_3)), [[_directive_highlight_query, _ctx.state.multiple ? _ctx.state.presentText : _ctx.state.inputValue]]);
|
|
364
|
+
}),
|
|
365
|
+
128
|
|
366
|
+
/* KEYED_FRAGMENT */
|
|
367
|
+
))];
|
|
368
|
+
}),
|
|
369
|
+
key: "0"
|
|
370
|
+
} : void 0]), 1032, ["onKeydown"])), [[vShow, _ctx.state.filtering]]) : createCommentVNode("v-if", true)],
|
|
371
|
+
34
|
|
372
|
+
/* CLASS, NEED_HYDRATION */
|
|
373
|
+
), [[vShow, _ctx.state.dropDownVisible]])];
|
|
374
|
+
}),
|
|
375
|
+
_: 3
|
|
376
|
+
/* FORWARDED */
|
|
377
|
+
}, 8, ["onAfterLeave"])],
|
|
378
|
+
34
|
|
379
|
+
/* CLASS, NEED_HYDRATION */
|
|
380
|
+
)), [[_directive_clickoutside, function() {
|
|
381
|
+
return _ctx.toggleDropDownVisible(false);
|
|
382
|
+
}]]);
|
|
399
383
|
}
|
|
400
|
-
var pc = /* @__PURE__ */
|
|
401
|
-
return __component__.exports;
|
|
402
|
-
}();
|
|
384
|
+
var pc = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
403
385
|
|
|
404
386
|
export { pc as default };
|