front-ui-admin 1.1.8 → 1.1.9
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/front-ui-admin.common.js +1371 -15
- package/front-ui-admin.common.js.map +1 -1
- package/front-ui-admin.umd.js +1371 -15
- package/front-ui-admin.umd.js.map +1 -1
- package/front-ui-admin.umd.min.js +3 -3
- package/front-ui-admin.umd.min.js.map +1 -1
- package/package.json +1 -1
package/front-ui-admin.common.js
CHANGED
|
@@ -6813,6 +6813,50 @@ module.exports = !fails(function () {
|
|
|
6813
6813
|
});
|
|
6814
6814
|
|
|
6815
6815
|
|
|
6816
|
+
/***/ }),
|
|
6817
|
+
|
|
6818
|
+
/***/ "e221":
|
|
6819
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
6820
|
+
|
|
6821
|
+
"use strict";
|
|
6822
|
+
|
|
6823
|
+
|
|
6824
|
+
__webpack_require__("14d9");
|
|
6825
|
+
__webpack_require__("13d5");
|
|
6826
|
+
exports.__esModule = true;
|
|
6827
|
+
exports.default = scrollIntoView;
|
|
6828
|
+
var _vue = __webpack_require__("8bbf");
|
|
6829
|
+
var _vue2 = _interopRequireDefault(_vue);
|
|
6830
|
+
function _interopRequireDefault(obj) {
|
|
6831
|
+
return obj && obj.__esModule ? obj : {
|
|
6832
|
+
default: obj
|
|
6833
|
+
};
|
|
6834
|
+
}
|
|
6835
|
+
function scrollIntoView(container, selected) {
|
|
6836
|
+
if (_vue2.default.prototype.$isServer) return;
|
|
6837
|
+
if (!selected) {
|
|
6838
|
+
container.scrollTop = 0;
|
|
6839
|
+
return;
|
|
6840
|
+
}
|
|
6841
|
+
var offsetParents = [];
|
|
6842
|
+
var pointer = selected.offsetParent;
|
|
6843
|
+
while (pointer && container !== pointer && container.contains(pointer)) {
|
|
6844
|
+
offsetParents.push(pointer);
|
|
6845
|
+
pointer = pointer.offsetParent;
|
|
6846
|
+
}
|
|
6847
|
+
var top = selected.offsetTop + offsetParents.reduce(function (prev, curr) {
|
|
6848
|
+
return prev + curr.offsetTop;
|
|
6849
|
+
}, 0);
|
|
6850
|
+
var bottom = top + selected.offsetHeight;
|
|
6851
|
+
var viewRectTop = container.scrollTop;
|
|
6852
|
+
var viewRectBottom = viewRectTop + container.clientHeight;
|
|
6853
|
+
if (top < viewRectTop) {
|
|
6854
|
+
container.scrollTop = top;
|
|
6855
|
+
} else if (bottom > viewRectBottom) {
|
|
6856
|
+
container.scrollTop = bottom - container.clientHeight;
|
|
6857
|
+
}
|
|
6858
|
+
}
|
|
6859
|
+
|
|
6816
6860
|
/***/ }),
|
|
6817
6861
|
|
|
6818
6862
|
/***/ "e330":
|
|
@@ -8414,7 +8458,7 @@ var es_typed_array_with = __webpack_require__("4ea1");
|
|
|
8414
8458
|
function isString(obj) {
|
|
8415
8459
|
return Object.prototype.toString.call(obj) === '[object String]';
|
|
8416
8460
|
}
|
|
8417
|
-
function
|
|
8461
|
+
function types_isObject(obj) {
|
|
8418
8462
|
return Object.prototype.toString.call(obj) === '[object Object]';
|
|
8419
8463
|
}
|
|
8420
8464
|
function isHtmlElement(node) {
|
|
@@ -8435,7 +8479,7 @@ if ( true && typeof Int8Array !== 'object' && (external_vue_default.a.prototype.
|
|
|
8435
8479
|
};
|
|
8436
8480
|
}
|
|
8437
8481
|
|
|
8438
|
-
const
|
|
8482
|
+
const types_isUndefined = val => {
|
|
8439
8483
|
return val === void 0;
|
|
8440
8484
|
};
|
|
8441
8485
|
const isDefined = val => {
|
|
@@ -8577,8 +8621,8 @@ const capitalize = function (str) {
|
|
|
8577
8621
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
8578
8622
|
};
|
|
8579
8623
|
const looseEqual = function (a, b) {
|
|
8580
|
-
const isObjectA =
|
|
8581
|
-
const isObjectB =
|
|
8624
|
+
const isObjectA = types_isObject(a);
|
|
8625
|
+
const isObjectB = types_isObject(b);
|
|
8582
8626
|
if (isObjectA && isObjectB) {
|
|
8583
8627
|
return JSON.stringify(a) === JSON.stringify(b);
|
|
8584
8628
|
} else if (!isObjectA && !isObjectB) {
|
|
@@ -8600,7 +8644,7 @@ const arrayEquals = function (arrayA, arrayB) {
|
|
|
8600
8644
|
}
|
|
8601
8645
|
return true;
|
|
8602
8646
|
};
|
|
8603
|
-
const
|
|
8647
|
+
const util_isEqual = function (value1, value2) {
|
|
8604
8648
|
if (Array.isArray(value1) && Array.isArray(value2)) {
|
|
8605
8649
|
return arrayEquals(value1, value2);
|
|
8606
8650
|
}
|
|
@@ -14217,18 +14261,1330 @@ tag.install = function (Vue) {
|
|
|
14217
14261
|
Vue.component(tag.name, tag);
|
|
14218
14262
|
};
|
|
14219
14263
|
/* harmony default export */ var p_tag = (tag);
|
|
14220
|
-
// CONCATENATED MODULE: ./src/package-admin/p-select/
|
|
14221
|
-
|
|
14222
|
-
|
|
14223
|
-
|
|
14264
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"b232aafa-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/package-admin/p-select/src/select.vue?vue&type=template&id=5cd02054
|
|
14265
|
+
var selectvue_type_template_id_5cd02054_render = function render() {
|
|
14266
|
+
var _vm = this,
|
|
14267
|
+
_c = _vm._self._c;
|
|
14268
|
+
return _c('div', {
|
|
14269
|
+
directives: [{
|
|
14270
|
+
name: "clickoutside",
|
|
14271
|
+
rawName: "v-clickoutside",
|
|
14272
|
+
value: _vm.handleClose,
|
|
14273
|
+
expression: "handleClose"
|
|
14274
|
+
}],
|
|
14275
|
+
staticClass: "el-select",
|
|
14276
|
+
class: [_vm.selectSize ? 'el-select--' + _vm.selectSize : ''],
|
|
14277
|
+
on: {
|
|
14278
|
+
"click": function ($event) {
|
|
14279
|
+
$event.stopPropagation();
|
|
14280
|
+
return _vm.toggleMenu.apply(null, arguments);
|
|
14281
|
+
}
|
|
14282
|
+
}
|
|
14283
|
+
}, [_vm.multiple ? _c('div', {
|
|
14284
|
+
ref: "tags",
|
|
14285
|
+
staticClass: "el-select__tags",
|
|
14286
|
+
style: {
|
|
14287
|
+
'max-width': _vm.inputWidth - 32 + 'px',
|
|
14288
|
+
width: '100%'
|
|
14289
|
+
}
|
|
14290
|
+
}, [_vm.collapseTags && _vm.selected.length ? _c('span', [_c('p-tag', {
|
|
14291
|
+
attrs: {
|
|
14292
|
+
"closable": !_vm.selectDisabled,
|
|
14293
|
+
"size": _vm.collapseTagSize,
|
|
14294
|
+
"hit": _vm.selected[0].hitState,
|
|
14295
|
+
"type": "info",
|
|
14296
|
+
"disable-transitions": ""
|
|
14297
|
+
},
|
|
14298
|
+
on: {
|
|
14299
|
+
"close": function ($event) {
|
|
14300
|
+
return _vm.deleteTag($event, _vm.selected[0]);
|
|
14301
|
+
}
|
|
14302
|
+
}
|
|
14303
|
+
}, [_c('span', {
|
|
14304
|
+
staticClass: "el-select__tags-text"
|
|
14305
|
+
}, [_vm._v(_vm._s(_vm.selected[0].currentLabel))])]), _vm.selected.length > 1 ? _c('p-tag', {
|
|
14306
|
+
attrs: {
|
|
14307
|
+
"closable": false,
|
|
14308
|
+
"size": _vm.collapseTagSize,
|
|
14309
|
+
"type": "info",
|
|
14310
|
+
"disable-transitions": ""
|
|
14311
|
+
}
|
|
14312
|
+
}, [_c('span', {
|
|
14313
|
+
staticClass: "el-select__tags-text"
|
|
14314
|
+
}, [_vm._v("+ " + _vm._s(_vm.selected.length - 1))])]) : _vm._e()], 1) : _vm._e(), !_vm.collapseTags ? _c('transition-group', {
|
|
14315
|
+
on: {
|
|
14316
|
+
"after-leave": _vm.resetInputHeight
|
|
14317
|
+
}
|
|
14318
|
+
}, _vm._l(_vm.selected, function (item) {
|
|
14319
|
+
return _c('p-tag', {
|
|
14320
|
+
key: _vm.getValueKey(item),
|
|
14321
|
+
attrs: {
|
|
14322
|
+
"closable": !_vm.selectDisabled,
|
|
14323
|
+
"size": _vm.collapseTagSize,
|
|
14324
|
+
"hit": item.hitState,
|
|
14325
|
+
"type": "info",
|
|
14326
|
+
"disable-transitions": ""
|
|
14327
|
+
},
|
|
14328
|
+
on: {
|
|
14329
|
+
"close": function ($event) {
|
|
14330
|
+
return _vm.deleteTag($event, item);
|
|
14331
|
+
}
|
|
14332
|
+
}
|
|
14333
|
+
}, [_c('span', {
|
|
14334
|
+
staticClass: "el-select__tags-text"
|
|
14335
|
+
}, [_vm._v(_vm._s(item.currentLabel))])]);
|
|
14336
|
+
}), 1) : _vm._e(), _vm.filterable ? _c('input', {
|
|
14337
|
+
directives: [{
|
|
14338
|
+
name: "model",
|
|
14339
|
+
rawName: "v-model",
|
|
14340
|
+
value: _vm.query,
|
|
14341
|
+
expression: "query"
|
|
14342
|
+
}],
|
|
14343
|
+
ref: "input",
|
|
14344
|
+
staticClass: "el-select__input",
|
|
14345
|
+
class: [_vm.selectSize ? `is-${_vm.selectSize}` : ''],
|
|
14346
|
+
style: {
|
|
14347
|
+
'flex-grow': '1',
|
|
14348
|
+
width: _vm.inputLength / (_vm.inputWidth - 32) + '%',
|
|
14349
|
+
'max-width': _vm.inputWidth - 42 + 'px'
|
|
14350
|
+
},
|
|
14351
|
+
attrs: {
|
|
14352
|
+
"type": "text",
|
|
14353
|
+
"disabled": _vm.selectDisabled,
|
|
14354
|
+
"autocomplete": _vm.autoComplete || _vm.autocomplete
|
|
14355
|
+
},
|
|
14356
|
+
domProps: {
|
|
14357
|
+
"value": _vm.query
|
|
14358
|
+
},
|
|
14359
|
+
on: {
|
|
14360
|
+
"focus": _vm.handleFocus,
|
|
14361
|
+
"blur": function ($event) {
|
|
14362
|
+
_vm.softFocus = false;
|
|
14363
|
+
},
|
|
14364
|
+
"keyup": _vm.managePlaceholder,
|
|
14365
|
+
"keydown": [_vm.resetInputState, function ($event) {
|
|
14366
|
+
if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "down", 40, $event.key, ["Down", "ArrowDown"])) return null;
|
|
14367
|
+
$event.preventDefault();
|
|
14368
|
+
return _vm.handleNavigate('next');
|
|
14369
|
+
}, function ($event) {
|
|
14370
|
+
if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])) return null;
|
|
14371
|
+
$event.preventDefault();
|
|
14372
|
+
return _vm.handleNavigate('prev');
|
|
14373
|
+
}, function ($event) {
|
|
14374
|
+
if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) return null;
|
|
14375
|
+
$event.preventDefault();
|
|
14376
|
+
return _vm.selectOption.apply(null, arguments);
|
|
14377
|
+
}, function ($event) {
|
|
14378
|
+
if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "esc", 27, $event.key, ["Esc", "Escape"])) return null;
|
|
14379
|
+
$event.stopPropagation();
|
|
14380
|
+
$event.preventDefault();
|
|
14381
|
+
_vm.visible = false;
|
|
14382
|
+
}, function ($event) {
|
|
14383
|
+
if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "delete", [8, 46], $event.key, ["Backspace", "Delete", "Del"])) return null;
|
|
14384
|
+
return _vm.deletePrevTag.apply(null, arguments);
|
|
14385
|
+
}, function ($event) {
|
|
14386
|
+
if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")) return null;
|
|
14387
|
+
_vm.visible = false;
|
|
14388
|
+
}],
|
|
14389
|
+
"compositionstart": _vm.handleComposition,
|
|
14390
|
+
"compositionupdate": _vm.handleComposition,
|
|
14391
|
+
"compositionend": _vm.handleComposition,
|
|
14392
|
+
"input": [function ($event) {
|
|
14393
|
+
if ($event.target.composing) return;
|
|
14394
|
+
_vm.query = $event.target.value;
|
|
14395
|
+
}, _vm.debouncedQueryChange]
|
|
14396
|
+
}
|
|
14397
|
+
}) : _vm._e()], 1) : _vm._e(), _c('p-input', {
|
|
14398
|
+
ref: "reference",
|
|
14399
|
+
class: {
|
|
14400
|
+
'is-focus': _vm.visible
|
|
14401
|
+
},
|
|
14402
|
+
attrs: {
|
|
14403
|
+
"type": "text",
|
|
14404
|
+
"placeholder": _vm.currentPlaceholder,
|
|
14405
|
+
"name": _vm.name,
|
|
14406
|
+
"id": _vm.id,
|
|
14407
|
+
"autocomplete": _vm.autoComplete || _vm.autocomplete,
|
|
14408
|
+
"size": _vm.selectSize,
|
|
14409
|
+
"disabled": _vm.selectDisabled,
|
|
14410
|
+
"readonly": _vm.readonly,
|
|
14411
|
+
"validate-event": false,
|
|
14412
|
+
"tabindex": _vm.multiple && _vm.filterable ? '-1' : null
|
|
14413
|
+
},
|
|
14414
|
+
on: {
|
|
14415
|
+
"focus": _vm.handleFocus,
|
|
14416
|
+
"blur": _vm.handleBlur,
|
|
14417
|
+
"input": _vm.debouncedOnInputChange,
|
|
14418
|
+
"compositionstart": _vm.handleComposition,
|
|
14419
|
+
"compositionupdate": _vm.handleComposition,
|
|
14420
|
+
"compositionend": _vm.handleComposition
|
|
14421
|
+
},
|
|
14422
|
+
nativeOn: {
|
|
14423
|
+
"keydown": [function ($event) {
|
|
14424
|
+
if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "down", 40, $event.key, ["Down", "ArrowDown"])) return null;
|
|
14425
|
+
$event.stopPropagation();
|
|
14426
|
+
$event.preventDefault();
|
|
14427
|
+
return _vm.handleNavigate('next');
|
|
14428
|
+
}, function ($event) {
|
|
14429
|
+
if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])) return null;
|
|
14430
|
+
$event.stopPropagation();
|
|
14431
|
+
$event.preventDefault();
|
|
14432
|
+
return _vm.handleNavigate('prev');
|
|
14433
|
+
}, function ($event) {
|
|
14434
|
+
if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) return null;
|
|
14435
|
+
$event.preventDefault();
|
|
14436
|
+
return _vm.selectOption.apply(null, arguments);
|
|
14437
|
+
}, function ($event) {
|
|
14438
|
+
if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "esc", 27, $event.key, ["Esc", "Escape"])) return null;
|
|
14439
|
+
$event.stopPropagation();
|
|
14440
|
+
$event.preventDefault();
|
|
14441
|
+
_vm.visible = false;
|
|
14442
|
+
}, function ($event) {
|
|
14443
|
+
if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")) return null;
|
|
14444
|
+
_vm.visible = false;
|
|
14445
|
+
}],
|
|
14446
|
+
"mouseenter": function ($event) {
|
|
14447
|
+
_vm.inputHovering = true;
|
|
14448
|
+
},
|
|
14449
|
+
"mouseleave": function ($event) {
|
|
14450
|
+
_vm.inputHovering = false;
|
|
14451
|
+
}
|
|
14452
|
+
},
|
|
14453
|
+
model: {
|
|
14454
|
+
value: _vm.selectedLabel,
|
|
14455
|
+
callback: function ($$v) {
|
|
14456
|
+
_vm.selectedLabel = $$v;
|
|
14457
|
+
},
|
|
14458
|
+
expression: "selectedLabel"
|
|
14459
|
+
}
|
|
14460
|
+
}, [_vm.$slots.prefix ? _c('template', {
|
|
14461
|
+
slot: "prefix"
|
|
14462
|
+
}, [_vm._t("prefix")], 2) : _vm._e(), _c('template', {
|
|
14463
|
+
slot: "suffix"
|
|
14464
|
+
}, [_c('i', {
|
|
14465
|
+
directives: [{
|
|
14466
|
+
name: "show",
|
|
14467
|
+
rawName: "v-show",
|
|
14468
|
+
value: !_vm.showClose,
|
|
14469
|
+
expression: "!showClose"
|
|
14470
|
+
}],
|
|
14471
|
+
class: ['el-select__caret', 'el-input__icon', 'el-icon-' + _vm.iconClass]
|
|
14472
|
+
}), _vm.showClose ? _c('i', {
|
|
14473
|
+
staticClass: "el-select__caret p-input__icon el-icon-circle-close",
|
|
14474
|
+
on: {
|
|
14475
|
+
"click": _vm.handleClearClick
|
|
14476
|
+
}
|
|
14477
|
+
}) : _vm._e()])], 2), _c('transition', {
|
|
14478
|
+
attrs: {
|
|
14479
|
+
"name": "el-zoom-in-top"
|
|
14480
|
+
},
|
|
14481
|
+
on: {
|
|
14482
|
+
"before-enter": _vm.handleMenuEnter,
|
|
14483
|
+
"after-leave": _vm.doDestroy
|
|
14484
|
+
}
|
|
14485
|
+
}, [_c('p-select-menu', {
|
|
14486
|
+
directives: [{
|
|
14487
|
+
name: "show",
|
|
14488
|
+
rawName: "v-show",
|
|
14489
|
+
value: _vm.visible && _vm.emptyText !== false,
|
|
14490
|
+
expression: "visible && emptyText !== false"
|
|
14491
|
+
}],
|
|
14492
|
+
ref: "popper",
|
|
14493
|
+
attrs: {
|
|
14494
|
+
"append-to-body": _vm.popperAppendToBody
|
|
14495
|
+
}
|
|
14496
|
+
}, [_c('p-scrollbar', {
|
|
14497
|
+
directives: [{
|
|
14498
|
+
name: "show",
|
|
14499
|
+
rawName: "v-show",
|
|
14500
|
+
value: _vm.options.length > 0 && !_vm.loading,
|
|
14501
|
+
expression: "options.length > 0 && !loading"
|
|
14502
|
+
}],
|
|
14503
|
+
ref: "scrollbar",
|
|
14504
|
+
class: {
|
|
14505
|
+
'is-empty': !_vm.allowCreate && _vm.query && _vm.filteredOptionsCount === 0
|
|
14506
|
+
},
|
|
14507
|
+
attrs: {
|
|
14508
|
+
"tag": "ul",
|
|
14509
|
+
"wrap-class": "el-select-dropdown__wrap",
|
|
14510
|
+
"view-class": "el-select-dropdown__list"
|
|
14511
|
+
}
|
|
14512
|
+
}, [_vm.showNewOption ? _c('p-option', {
|
|
14513
|
+
attrs: {
|
|
14514
|
+
"value": _vm.query,
|
|
14515
|
+
"created": ""
|
|
14516
|
+
}
|
|
14517
|
+
}) : _vm._e(), _vm._t("default")], 2), _vm.emptyText && (!_vm.allowCreate || _vm.loading || _vm.allowCreate && _vm.options.length === 0) ? [_vm.$slots.empty ? _vm._t("empty") : _c('p', {
|
|
14518
|
+
staticClass: "el-select-dropdown__empty"
|
|
14519
|
+
}, [_vm._v(" " + _vm._s(_vm.emptyText) + " ")])] : _vm._e()], 2)], 1)], 1);
|
|
14224
14520
|
};
|
|
14225
|
-
|
|
14226
|
-
// EXTERNAL MODULE: ./node_modules/@vue/babel-helper-vue-jsx-merge-props/dist/helper.js
|
|
14227
|
-
var helper = __webpack_require__("2638");
|
|
14228
|
-
var helper_default = /*#__PURE__*/__webpack_require__.n(helper);
|
|
14521
|
+
var selectvue_type_template_id_5cd02054_staticRenderFns = [];
|
|
14229
14522
|
|
|
14230
|
-
//
|
|
14231
|
-
|
|
14523
|
+
// CONCATENATED MODULE: ./src/package-admin/p-select/src/select.vue?vue&type=template&id=5cd02054
|
|
14524
|
+
|
|
14525
|
+
// CONCATENATED MODULE: ./src/mixins/focus.js
|
|
14526
|
+
/* harmony default export */ var mixins_focus = (function (ref) {
|
|
14527
|
+
return {
|
|
14528
|
+
methods: {
|
|
14529
|
+
focus() {
|
|
14530
|
+
this.$refs[ref].focus();
|
|
14531
|
+
}
|
|
14532
|
+
}
|
|
14533
|
+
};
|
|
14534
|
+
});
|
|
14535
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"b232aafa-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/package-admin/p-select/src/select-dropdown.vue?vue&type=template&id=44b4e5ed
|
|
14536
|
+
var select_dropdownvue_type_template_id_44b4e5ed_render = function render() {
|
|
14537
|
+
var _vm = this,
|
|
14538
|
+
_c = _vm._self._c;
|
|
14539
|
+
return _c('div', {
|
|
14540
|
+
staticClass: "el-select-dropdown el-popper",
|
|
14541
|
+
class: [{
|
|
14542
|
+
'is-multiple': _vm.$parent.multiple
|
|
14543
|
+
}, _vm.popperClass],
|
|
14544
|
+
style: {
|
|
14545
|
+
minWidth: _vm.minWidth
|
|
14546
|
+
}
|
|
14547
|
+
}, [_vm._t("default")], 2);
|
|
14548
|
+
};
|
|
14549
|
+
var select_dropdownvue_type_template_id_44b4e5ed_staticRenderFns = [];
|
|
14550
|
+
|
|
14551
|
+
// CONCATENATED MODULE: ./src/package-admin/p-select/src/select-dropdown.vue?vue&type=template&id=44b4e5ed
|
|
14552
|
+
|
|
14553
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/package-admin/p-select/src/select-dropdown.vue?vue&type=script&lang=js
|
|
14554
|
+
|
|
14555
|
+
/* harmony default export */ var select_dropdownvue_type_script_lang_js = ({
|
|
14556
|
+
name: 'PSelectDropdown',
|
|
14557
|
+
componentName: 'PSelectDropdown',
|
|
14558
|
+
mixins: [vue_popper],
|
|
14559
|
+
props: {
|
|
14560
|
+
placement: {
|
|
14561
|
+
default: 'bottom-start'
|
|
14562
|
+
},
|
|
14563
|
+
boundariesPadding: {
|
|
14564
|
+
default: 0
|
|
14565
|
+
},
|
|
14566
|
+
popperOptions: {
|
|
14567
|
+
default() {
|
|
14568
|
+
return {
|
|
14569
|
+
gpuAcceleration: false
|
|
14570
|
+
};
|
|
14571
|
+
}
|
|
14572
|
+
},
|
|
14573
|
+
visibleArrow: {
|
|
14574
|
+
default: true
|
|
14575
|
+
},
|
|
14576
|
+
appendToBody: {
|
|
14577
|
+
type: Boolean,
|
|
14578
|
+
default: true
|
|
14579
|
+
}
|
|
14580
|
+
},
|
|
14581
|
+
data() {
|
|
14582
|
+
return {
|
|
14583
|
+
minWidth: ''
|
|
14584
|
+
};
|
|
14585
|
+
},
|
|
14586
|
+
computed: {
|
|
14587
|
+
popperClass() {
|
|
14588
|
+
return this.$parent.popperClass;
|
|
14589
|
+
}
|
|
14590
|
+
},
|
|
14591
|
+
watch: {
|
|
14592
|
+
'$parent.inputWidth'() {
|
|
14593
|
+
this.minWidth = this.$parent.$el.getBoundingClientRect().width + 'px';
|
|
14594
|
+
}
|
|
14595
|
+
},
|
|
14596
|
+
mounted() {
|
|
14597
|
+
this.referenceElm = this.$parent.$refs.reference.$el;
|
|
14598
|
+
this.$parent.popperElm = this.popperElm = this.$el;
|
|
14599
|
+
this.$on('updatePopper', () => {
|
|
14600
|
+
if (this.$parent.visible) this.updatePopper();
|
|
14601
|
+
});
|
|
14602
|
+
this.$on('destroyPopper', this.destroyPopper);
|
|
14603
|
+
}
|
|
14604
|
+
});
|
|
14605
|
+
// CONCATENATED MODULE: ./src/package-admin/p-select/src/select-dropdown.vue?vue&type=script&lang=js
|
|
14606
|
+
/* harmony default export */ var src_select_dropdownvue_type_script_lang_js = (select_dropdownvue_type_script_lang_js);
|
|
14607
|
+
// CONCATENATED MODULE: ./src/package-admin/p-select/src/select-dropdown.vue
|
|
14608
|
+
|
|
14609
|
+
|
|
14610
|
+
|
|
14611
|
+
|
|
14612
|
+
|
|
14613
|
+
/* normalize component */
|
|
14614
|
+
|
|
14615
|
+
var select_dropdown_component = normalizeComponent(
|
|
14616
|
+
src_select_dropdownvue_type_script_lang_js,
|
|
14617
|
+
select_dropdownvue_type_template_id_44b4e5ed_render,
|
|
14618
|
+
select_dropdownvue_type_template_id_44b4e5ed_staticRenderFns,
|
|
14619
|
+
false,
|
|
14620
|
+
null,
|
|
14621
|
+
null,
|
|
14622
|
+
null
|
|
14623
|
+
|
|
14624
|
+
)
|
|
14625
|
+
|
|
14626
|
+
/* harmony default export */ var select_dropdown = (select_dropdown_component.exports);
|
|
14627
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"b232aafa-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/package-admin/p-select/src/option.vue?vue&type=template&id=7c5f371e
|
|
14628
|
+
var optionvue_type_template_id_7c5f371e_render = function render() {
|
|
14629
|
+
var _vm = this,
|
|
14630
|
+
_c = _vm._self._c;
|
|
14631
|
+
return _c('li', {
|
|
14632
|
+
directives: [{
|
|
14633
|
+
name: "show",
|
|
14634
|
+
rawName: "v-show",
|
|
14635
|
+
value: _vm.visible,
|
|
14636
|
+
expression: "visible"
|
|
14637
|
+
}],
|
|
14638
|
+
staticClass: "el-select-dropdown__item",
|
|
14639
|
+
class: {
|
|
14640
|
+
'selected': _vm.itemSelected,
|
|
14641
|
+
'is-disabled': _vm.disabled || _vm.groupDisabled || _vm.limitReached,
|
|
14642
|
+
'hover': _vm.hover
|
|
14643
|
+
},
|
|
14644
|
+
on: {
|
|
14645
|
+
"mouseenter": _vm.hoverItem,
|
|
14646
|
+
"click": function ($event) {
|
|
14647
|
+
$event.stopPropagation();
|
|
14648
|
+
return _vm.selectOptionClick.apply(null, arguments);
|
|
14649
|
+
}
|
|
14650
|
+
}
|
|
14651
|
+
}, [_vm._t("default", function () {
|
|
14652
|
+
return [_c('span', [_vm._v(_vm._s(_vm.currentLabel))])];
|
|
14653
|
+
})], 2);
|
|
14654
|
+
};
|
|
14655
|
+
var optionvue_type_template_id_7c5f371e_staticRenderFns = [];
|
|
14656
|
+
|
|
14657
|
+
// CONCATENATED MODULE: ./src/package-admin/p-select/src/option.vue?vue&type=template&id=7c5f371e
|
|
14658
|
+
|
|
14659
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/package-admin/p-select/src/option.vue?vue&type=script&lang=js
|
|
14660
|
+
|
|
14661
|
+
|
|
14662
|
+
|
|
14663
|
+
|
|
14664
|
+
|
|
14665
|
+
/* harmony default export */ var optionvue_type_script_lang_js = ({
|
|
14666
|
+
mixins: [emitter],
|
|
14667
|
+
name: 'POption',
|
|
14668
|
+
componentName: 'POption',
|
|
14669
|
+
inject: ['select'],
|
|
14670
|
+
props: {
|
|
14671
|
+
value: {
|
|
14672
|
+
required: true
|
|
14673
|
+
},
|
|
14674
|
+
label: [String, Number],
|
|
14675
|
+
created: Boolean,
|
|
14676
|
+
disabled: {
|
|
14677
|
+
type: Boolean,
|
|
14678
|
+
default: false
|
|
14679
|
+
}
|
|
14680
|
+
},
|
|
14681
|
+
data() {
|
|
14682
|
+
return {
|
|
14683
|
+
index: -1,
|
|
14684
|
+
groupDisabled: false,
|
|
14685
|
+
visible: true,
|
|
14686
|
+
hitState: false,
|
|
14687
|
+
hover: false
|
|
14688
|
+
};
|
|
14689
|
+
},
|
|
14690
|
+
computed: {
|
|
14691
|
+
isObject() {
|
|
14692
|
+
return Object.prototype.toString.call(this.value).toLowerCase() === '[object object]';
|
|
14693
|
+
},
|
|
14694
|
+
currentLabel() {
|
|
14695
|
+
return this.label || (this.isObject ? '' : this.value);
|
|
14696
|
+
},
|
|
14697
|
+
currentValue() {
|
|
14698
|
+
return this.value || this.label || '';
|
|
14699
|
+
},
|
|
14700
|
+
itemSelected() {
|
|
14701
|
+
if (!this.select.multiple) {
|
|
14702
|
+
return this.isEqual(this.value, this.select.value);
|
|
14703
|
+
} else {
|
|
14704
|
+
return this.contains(this.select.value, this.value);
|
|
14705
|
+
}
|
|
14706
|
+
},
|
|
14707
|
+
limitReached() {
|
|
14708
|
+
if (this.select.multiple) {
|
|
14709
|
+
return !this.itemSelected && (this.select.value || []).length >= this.select.multipleLimit && this.select.multipleLimit > 0;
|
|
14710
|
+
} else {
|
|
14711
|
+
return false;
|
|
14712
|
+
}
|
|
14713
|
+
}
|
|
14714
|
+
},
|
|
14715
|
+
watch: {
|
|
14716
|
+
currentLabel() {
|
|
14717
|
+
if (!this.created && !this.select.remote) this.dispatch('PSelect', 'setSelected');
|
|
14718
|
+
},
|
|
14719
|
+
value(val, oldVal) {
|
|
14720
|
+
const {
|
|
14721
|
+
remote,
|
|
14722
|
+
valueKey
|
|
14723
|
+
} = this.select;
|
|
14724
|
+
if (!this.created && !remote) {
|
|
14725
|
+
if (valueKey && typeof val === 'object' && typeof oldVal === 'object' && val[valueKey] === oldVal[valueKey]) {
|
|
14726
|
+
return;
|
|
14727
|
+
}
|
|
14728
|
+
this.dispatch('PSelect', 'setSelected');
|
|
14729
|
+
}
|
|
14730
|
+
}
|
|
14731
|
+
},
|
|
14732
|
+
methods: {
|
|
14733
|
+
isEqual(a, b) {
|
|
14734
|
+
if (!this.isObject) {
|
|
14735
|
+
return a === b;
|
|
14736
|
+
} else {
|
|
14737
|
+
const valueKey = this.select.valueKey;
|
|
14738
|
+
return getValueByPath(a, valueKey) === getValueByPath(b, valueKey);
|
|
14739
|
+
}
|
|
14740
|
+
},
|
|
14741
|
+
contains(arr = [], target) {
|
|
14742
|
+
if (!this.isObject) {
|
|
14743
|
+
return arr && arr.indexOf(target) > -1;
|
|
14744
|
+
} else {
|
|
14745
|
+
const valueKey = this.select.valueKey;
|
|
14746
|
+
return arr && arr.some(item => {
|
|
14747
|
+
return getValueByPath(item, valueKey) === getValueByPath(target, valueKey);
|
|
14748
|
+
});
|
|
14749
|
+
}
|
|
14750
|
+
},
|
|
14751
|
+
handleGroupDisabled(val) {
|
|
14752
|
+
this.groupDisabled = val;
|
|
14753
|
+
},
|
|
14754
|
+
hoverItem() {
|
|
14755
|
+
if (!this.disabled && !this.groupDisabled) {
|
|
14756
|
+
this.select.hoverIndex = this.select.options.indexOf(this);
|
|
14757
|
+
}
|
|
14758
|
+
},
|
|
14759
|
+
selectOptionClick() {
|
|
14760
|
+
if (this.disabled !== true && this.groupDisabled !== true) {
|
|
14761
|
+
this.dispatch('PSelect', 'handleOptionClick', [this, true]);
|
|
14762
|
+
}
|
|
14763
|
+
},
|
|
14764
|
+
queryChange(query) {
|
|
14765
|
+
this.visible = new RegExp(escapeRegexpString(query), 'i').test(this.currentLabel) || this.created;
|
|
14766
|
+
if (!this.visible) {
|
|
14767
|
+
this.select.filteredOptionsCount--;
|
|
14768
|
+
}
|
|
14769
|
+
}
|
|
14770
|
+
},
|
|
14771
|
+
created() {
|
|
14772
|
+
this.select.options.push(this);
|
|
14773
|
+
this.select.cachedOptions.push(this);
|
|
14774
|
+
this.select.optionsCount++;
|
|
14775
|
+
this.select.filteredOptionsCount++;
|
|
14776
|
+
this.$on('queryChange', this.queryChange);
|
|
14777
|
+
this.$on('handleGroupDisabled', this.handleGroupDisabled);
|
|
14778
|
+
},
|
|
14779
|
+
beforeDestroy() {
|
|
14780
|
+
const {
|
|
14781
|
+
selected,
|
|
14782
|
+
multiple
|
|
14783
|
+
} = this.select;
|
|
14784
|
+
let selectedOptions = multiple ? selected : [selected];
|
|
14785
|
+
let index = this.select.cachedOptions.indexOf(this);
|
|
14786
|
+
let selectedIndex = selectedOptions.indexOf(this);
|
|
14787
|
+
|
|
14788
|
+
// if option is not selected, remove it from cache
|
|
14789
|
+
if (index > -1 && selectedIndex < 0) {
|
|
14790
|
+
this.select.cachedOptions.splice(index, 1);
|
|
14791
|
+
}
|
|
14792
|
+
this.select.onOptionDestroy(this.select.options.indexOf(this));
|
|
14793
|
+
}
|
|
14794
|
+
});
|
|
14795
|
+
// CONCATENATED MODULE: ./src/package-admin/p-select/src/option.vue?vue&type=script&lang=js
|
|
14796
|
+
/* harmony default export */ var src_optionvue_type_script_lang_js = (optionvue_type_script_lang_js);
|
|
14797
|
+
// CONCATENATED MODULE: ./src/package-admin/p-select/src/option.vue
|
|
14798
|
+
|
|
14799
|
+
|
|
14800
|
+
|
|
14801
|
+
|
|
14802
|
+
|
|
14803
|
+
/* normalize component */
|
|
14804
|
+
|
|
14805
|
+
var option_component = normalizeComponent(
|
|
14806
|
+
src_optionvue_type_script_lang_js,
|
|
14807
|
+
optionvue_type_template_id_7c5f371e_render,
|
|
14808
|
+
optionvue_type_template_id_7c5f371e_staticRenderFns,
|
|
14809
|
+
false,
|
|
14810
|
+
null,
|
|
14811
|
+
null,
|
|
14812
|
+
null
|
|
14813
|
+
|
|
14814
|
+
)
|
|
14815
|
+
|
|
14816
|
+
/* harmony default export */ var src_option = (option_component.exports);
|
|
14817
|
+
// EXTERNAL MODULE: ./src/utils/scroll-into-view.js
|
|
14818
|
+
var scroll_into_view = __webpack_require__("e221");
|
|
14819
|
+
var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_view);
|
|
14820
|
+
|
|
14821
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.every.js
|
|
14822
|
+
var es_iterator_every = __webpack_require__("d866");
|
|
14823
|
+
|
|
14824
|
+
// CONCATENATED MODULE: ./src/package-admin/p-select/src/navigation-mixin.js
|
|
14825
|
+
|
|
14826
|
+
|
|
14827
|
+
|
|
14828
|
+
|
|
14829
|
+
/* harmony default export */ var navigation_mixin = ({
|
|
14830
|
+
data() {
|
|
14831
|
+
return {
|
|
14832
|
+
hoverOption: -1
|
|
14833
|
+
};
|
|
14834
|
+
},
|
|
14835
|
+
computed: {
|
|
14836
|
+
optionsAllDisabled() {
|
|
14837
|
+
return this.options.filter(option => option.visible).every(option => option.disabled);
|
|
14838
|
+
}
|
|
14839
|
+
},
|
|
14840
|
+
watch: {
|
|
14841
|
+
hoverIndex(val) {
|
|
14842
|
+
if (typeof val === 'number' && val > -1) {
|
|
14843
|
+
this.hoverOption = this.options[val] || {};
|
|
14844
|
+
}
|
|
14845
|
+
this.options.forEach(option => {
|
|
14846
|
+
option.hover = this.hoverOption === option;
|
|
14847
|
+
});
|
|
14848
|
+
}
|
|
14849
|
+
},
|
|
14850
|
+
methods: {
|
|
14851
|
+
navigateOptions(direction) {
|
|
14852
|
+
if (!this.visible) {
|
|
14853
|
+
this.visible = true;
|
|
14854
|
+
return;
|
|
14855
|
+
}
|
|
14856
|
+
if (this.options.length === 0 || this.filteredOptionsCount === 0) return;
|
|
14857
|
+
if (!this.optionsAllDisabled) {
|
|
14858
|
+
if (direction === 'next') {
|
|
14859
|
+
this.hoverIndex++;
|
|
14860
|
+
if (this.hoverIndex === this.options.length) {
|
|
14861
|
+
this.hoverIndex = 0;
|
|
14862
|
+
}
|
|
14863
|
+
} else if (direction === 'prev') {
|
|
14864
|
+
this.hoverIndex--;
|
|
14865
|
+
if (this.hoverIndex < 0) {
|
|
14866
|
+
this.hoverIndex = this.options.length - 1;
|
|
14867
|
+
}
|
|
14868
|
+
}
|
|
14869
|
+
const option = this.options[this.hoverIndex];
|
|
14870
|
+
if (option.disabled === true || option.groupDisabled === true || !option.visible) {
|
|
14871
|
+
this.navigateOptions(direction);
|
|
14872
|
+
}
|
|
14873
|
+
this.$nextTick(() => this.scrollToOption(this.hoverOption));
|
|
14874
|
+
}
|
|
14875
|
+
}
|
|
14876
|
+
}
|
|
14877
|
+
});
|
|
14878
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/package-admin/p-select/src/select.vue?vue&type=script&lang=js
|
|
14879
|
+
|
|
14880
|
+
|
|
14881
|
+
|
|
14882
|
+
|
|
14883
|
+
|
|
14884
|
+
|
|
14885
|
+
|
|
14886
|
+
|
|
14887
|
+
|
|
14888
|
+
|
|
14889
|
+
|
|
14890
|
+
|
|
14891
|
+
|
|
14892
|
+
|
|
14893
|
+
|
|
14894
|
+
|
|
14895
|
+
|
|
14896
|
+
|
|
14897
|
+
|
|
14898
|
+
|
|
14899
|
+
|
|
14900
|
+
/* harmony default export */ var selectvue_type_script_lang_js = ({
|
|
14901
|
+
mixins: [emitter, mixins_locale, mixins_focus('reference'), navigation_mixin],
|
|
14902
|
+
name: 'PSelect',
|
|
14903
|
+
componentName: 'PSelect',
|
|
14904
|
+
inject: {
|
|
14905
|
+
elForm: {
|
|
14906
|
+
default: ''
|
|
14907
|
+
},
|
|
14908
|
+
elFormItem: {
|
|
14909
|
+
default: ''
|
|
14910
|
+
}
|
|
14911
|
+
},
|
|
14912
|
+
provide() {
|
|
14913
|
+
return {
|
|
14914
|
+
'select': this
|
|
14915
|
+
};
|
|
14916
|
+
},
|
|
14917
|
+
computed: {
|
|
14918
|
+
_elFormItemSize() {
|
|
14919
|
+
return (this.elFormItem || {}).elFormItemSize;
|
|
14920
|
+
},
|
|
14921
|
+
readonly() {
|
|
14922
|
+
return !this.filterable || this.multiple || !isIE() && !isEdge() && !this.visible;
|
|
14923
|
+
},
|
|
14924
|
+
showClose() {
|
|
14925
|
+
let hasValue = this.multiple ? Array.isArray(this.value) && this.value.length > 0 : this.value !== undefined && this.value !== null && this.value !== '';
|
|
14926
|
+
let criteria = this.clearable && !this.selectDisabled && this.inputHovering && hasValue;
|
|
14927
|
+
return criteria;
|
|
14928
|
+
},
|
|
14929
|
+
iconClass() {
|
|
14930
|
+
return this.remote && this.filterable ? '' : this.visible ? 'arrow-up is-reverse' : 'arrow-up';
|
|
14931
|
+
},
|
|
14932
|
+
debounce() {
|
|
14933
|
+
return this.remote ? 300 : 0;
|
|
14934
|
+
},
|
|
14935
|
+
emptyText() {
|
|
14936
|
+
if (this.loading) {
|
|
14937
|
+
return this.loadingText || this.t('el.select.loading');
|
|
14938
|
+
} else {
|
|
14939
|
+
if (this.remote && this.query === '' && this.options.length === 0) return false;
|
|
14940
|
+
if (this.filterable && this.query && this.options.length > 0 && this.filteredOptionsCount === 0) {
|
|
14941
|
+
return this.noMatchText || this.t('el.select.noMatch');
|
|
14942
|
+
}
|
|
14943
|
+
if (this.options.length === 0) {
|
|
14944
|
+
return this.noDataText || this.t('el.select.noData');
|
|
14945
|
+
}
|
|
14946
|
+
}
|
|
14947
|
+
return null;
|
|
14948
|
+
},
|
|
14949
|
+
showNewOption() {
|
|
14950
|
+
let hasExistingOption = this.options.filter(option => !option.created).some(option => option.currentLabel === this.query);
|
|
14951
|
+
return this.filterable && this.allowCreate && this.query !== '' && !hasExistingOption;
|
|
14952
|
+
},
|
|
14953
|
+
selectSize() {
|
|
14954
|
+
return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
|
|
14955
|
+
},
|
|
14956
|
+
selectDisabled() {
|
|
14957
|
+
return this.disabled || (this.elForm || {}).disabled;
|
|
14958
|
+
},
|
|
14959
|
+
collapseTagSize() {
|
|
14960
|
+
return ['small', 'mini'].indexOf(this.selectSize) > -1 ? 'mini' : 'small';
|
|
14961
|
+
},
|
|
14962
|
+
propPlaceholder() {
|
|
14963
|
+
return typeof this.placeholder !== 'undefined' ? this.placeholder : this.t('el.select.placeholder');
|
|
14964
|
+
}
|
|
14965
|
+
},
|
|
14966
|
+
components: {
|
|
14967
|
+
PInput: p_input,
|
|
14968
|
+
PSelectMenu: select_dropdown,
|
|
14969
|
+
POption: src_option,
|
|
14970
|
+
PTag: p_tag,
|
|
14971
|
+
PScrollbar: p_scrollbar
|
|
14972
|
+
},
|
|
14973
|
+
directives: {
|
|
14974
|
+
Clickoutside: clickoutside
|
|
14975
|
+
},
|
|
14976
|
+
props: {
|
|
14977
|
+
name: String,
|
|
14978
|
+
id: String,
|
|
14979
|
+
value: {
|
|
14980
|
+
required: true
|
|
14981
|
+
},
|
|
14982
|
+
autocomplete: {
|
|
14983
|
+
type: String,
|
|
14984
|
+
default: 'off'
|
|
14985
|
+
},
|
|
14986
|
+
/** @Deprecated in next major version */
|
|
14987
|
+
autoComplete: {
|
|
14988
|
+
type: String,
|
|
14989
|
+
validator(val) {
|
|
14990
|
+
false && false;
|
|
14991
|
+
return true;
|
|
14992
|
+
}
|
|
14993
|
+
},
|
|
14994
|
+
automaticDropdown: Boolean,
|
|
14995
|
+
size: String,
|
|
14996
|
+
disabled: Boolean,
|
|
14997
|
+
clearable: Boolean,
|
|
14998
|
+
filterable: Boolean,
|
|
14999
|
+
allowCreate: Boolean,
|
|
15000
|
+
loading: Boolean,
|
|
15001
|
+
popperClass: String,
|
|
15002
|
+
remote: Boolean,
|
|
15003
|
+
loadingText: String,
|
|
15004
|
+
noMatchText: String,
|
|
15005
|
+
noDataText: String,
|
|
15006
|
+
remoteMethod: Function,
|
|
15007
|
+
filterMethod: Function,
|
|
15008
|
+
multiple: Boolean,
|
|
15009
|
+
multipleLimit: {
|
|
15010
|
+
type: Number,
|
|
15011
|
+
default: 0
|
|
15012
|
+
},
|
|
15013
|
+
placeholder: {
|
|
15014
|
+
type: String,
|
|
15015
|
+
required: false
|
|
15016
|
+
},
|
|
15017
|
+
defaultFirstOption: Boolean,
|
|
15018
|
+
reserveKeyword: Boolean,
|
|
15019
|
+
valueKey: {
|
|
15020
|
+
type: String,
|
|
15021
|
+
default: 'value'
|
|
15022
|
+
},
|
|
15023
|
+
collapseTags: Boolean,
|
|
15024
|
+
popperAppendToBody: {
|
|
15025
|
+
type: Boolean,
|
|
15026
|
+
default: true
|
|
15027
|
+
}
|
|
15028
|
+
},
|
|
15029
|
+
data() {
|
|
15030
|
+
return {
|
|
15031
|
+
options: [],
|
|
15032
|
+
cachedOptions: [],
|
|
15033
|
+
createdLabel: null,
|
|
15034
|
+
createdSelected: false,
|
|
15035
|
+
selected: this.multiple ? [] : {},
|
|
15036
|
+
inputLength: 20,
|
|
15037
|
+
inputWidth: 0,
|
|
15038
|
+
initialInputHeight: 0,
|
|
15039
|
+
cachedPlaceHolder: '',
|
|
15040
|
+
optionsCount: 0,
|
|
15041
|
+
filteredOptionsCount: 0,
|
|
15042
|
+
visible: false,
|
|
15043
|
+
softFocus: false,
|
|
15044
|
+
selectedLabel: '',
|
|
15045
|
+
hoverIndex: -1,
|
|
15046
|
+
query: '',
|
|
15047
|
+
previousQuery: null,
|
|
15048
|
+
inputHovering: false,
|
|
15049
|
+
currentPlaceholder: '',
|
|
15050
|
+
menuVisibleOnFocus: false,
|
|
15051
|
+
isOnComposition: false,
|
|
15052
|
+
isSilentBlur: false
|
|
15053
|
+
};
|
|
15054
|
+
},
|
|
15055
|
+
watch: {
|
|
15056
|
+
selectDisabled() {
|
|
15057
|
+
this.$nextTick(() => {
|
|
15058
|
+
this.resetInputHeight();
|
|
15059
|
+
});
|
|
15060
|
+
},
|
|
15061
|
+
propPlaceholder(val) {
|
|
15062
|
+
this.cachedPlaceHolder = this.currentPlaceholder = val;
|
|
15063
|
+
},
|
|
15064
|
+
value(val, oldVal) {
|
|
15065
|
+
if (this.multiple) {
|
|
15066
|
+
this.resetInputHeight();
|
|
15067
|
+
if (val && val.length > 0 || this.$refs.input && this.query !== '') {
|
|
15068
|
+
this.currentPlaceholder = '';
|
|
15069
|
+
} else {
|
|
15070
|
+
this.currentPlaceholder = this.cachedPlaceHolder;
|
|
15071
|
+
}
|
|
15072
|
+
if (this.filterable && !this.reserveKeyword) {
|
|
15073
|
+
this.query = '';
|
|
15074
|
+
this.handleQueryChange(this.query);
|
|
15075
|
+
}
|
|
15076
|
+
}
|
|
15077
|
+
this.setSelected();
|
|
15078
|
+
if (this.filterable && !this.multiple) {
|
|
15079
|
+
this.inputLength = 20;
|
|
15080
|
+
}
|
|
15081
|
+
if (!valueEquals(val, oldVal)) {
|
|
15082
|
+
this.dispatch('PFormItem', 'el.form.change', val);
|
|
15083
|
+
}
|
|
15084
|
+
},
|
|
15085
|
+
visible(val) {
|
|
15086
|
+
if (!val) {
|
|
15087
|
+
this.broadcast('PSelectDropdown', 'destroyPopper');
|
|
15088
|
+
if (this.$refs.input) {
|
|
15089
|
+
this.$refs.input.blur();
|
|
15090
|
+
}
|
|
15091
|
+
this.query = '';
|
|
15092
|
+
this.previousQuery = null;
|
|
15093
|
+
this.selectedLabel = '';
|
|
15094
|
+
this.inputLength = 20;
|
|
15095
|
+
this.menuVisibleOnFocus = false;
|
|
15096
|
+
this.resetHoverIndex();
|
|
15097
|
+
this.$nextTick(() => {
|
|
15098
|
+
if (this.$refs.input && this.$refs.input.value === '' && this.selected.length === 0) {
|
|
15099
|
+
this.currentPlaceholder = this.cachedPlaceHolder;
|
|
15100
|
+
}
|
|
15101
|
+
});
|
|
15102
|
+
if (!this.multiple) {
|
|
15103
|
+
if (this.selected) {
|
|
15104
|
+
if (this.filterable && this.allowCreate && this.createdSelected && this.createdLabel) {
|
|
15105
|
+
this.selectedLabel = this.createdLabel;
|
|
15106
|
+
} else {
|
|
15107
|
+
this.selectedLabel = this.selected.currentLabel;
|
|
15108
|
+
}
|
|
15109
|
+
if (this.filterable) this.query = this.selectedLabel;
|
|
15110
|
+
}
|
|
15111
|
+
if (this.filterable) {
|
|
15112
|
+
this.currentPlaceholder = this.cachedPlaceHolder;
|
|
15113
|
+
}
|
|
15114
|
+
}
|
|
15115
|
+
} else {
|
|
15116
|
+
this.broadcast('PSelectDropdown', 'updatePopper');
|
|
15117
|
+
if (this.filterable) {
|
|
15118
|
+
this.query = this.remote ? '' : this.selectedLabel;
|
|
15119
|
+
this.handleQueryChange(this.query);
|
|
15120
|
+
if (this.multiple) {
|
|
15121
|
+
this.$refs.input.focus();
|
|
15122
|
+
} else {
|
|
15123
|
+
if (!this.remote) {
|
|
15124
|
+
this.broadcast('POption', 'queryChange', '');
|
|
15125
|
+
this.broadcast('POptionGroup', 'queryChange');
|
|
15126
|
+
}
|
|
15127
|
+
if (this.selectedLabel) {
|
|
15128
|
+
this.currentPlaceholder = this.selectedLabel;
|
|
15129
|
+
this.selectedLabel = '';
|
|
15130
|
+
}
|
|
15131
|
+
}
|
|
15132
|
+
}
|
|
15133
|
+
}
|
|
15134
|
+
this.$emit('visible-change', val);
|
|
15135
|
+
},
|
|
15136
|
+
options() {
|
|
15137
|
+
if (this.$isServer) return;
|
|
15138
|
+
this.$nextTick(() => {
|
|
15139
|
+
this.broadcast('PSelectDropdown', 'updatePopper');
|
|
15140
|
+
});
|
|
15141
|
+
if (this.multiple) {
|
|
15142
|
+
this.resetInputHeight();
|
|
15143
|
+
}
|
|
15144
|
+
let inputs = this.$el.querySelectorAll('input');
|
|
15145
|
+
if ([].indexOf.call(inputs, document.activeElement) === -1) {
|
|
15146
|
+
this.setSelected();
|
|
15147
|
+
}
|
|
15148
|
+
if (this.defaultFirstOption && (this.filterable || this.remote) && this.filteredOptionsCount) {
|
|
15149
|
+
this.checkDefaultFirstOption();
|
|
15150
|
+
}
|
|
15151
|
+
}
|
|
15152
|
+
},
|
|
15153
|
+
methods: {
|
|
15154
|
+
handleNavigate(direction) {
|
|
15155
|
+
if (this.isOnComposition) return;
|
|
15156
|
+
this.navigateOptions(direction);
|
|
15157
|
+
},
|
|
15158
|
+
handleComposition(event) {
|
|
15159
|
+
const text = event.target.value;
|
|
15160
|
+
if (event.type === 'compositionend') {
|
|
15161
|
+
this.isOnComposition = false;
|
|
15162
|
+
this.$nextTick(_ => this.handleQueryChange(text));
|
|
15163
|
+
} else {
|
|
15164
|
+
const lastCharacter = text[text.length - 1] || '';
|
|
15165
|
+
this.isOnComposition = !isKorean(lastCharacter);
|
|
15166
|
+
}
|
|
15167
|
+
},
|
|
15168
|
+
handleQueryChange(val) {
|
|
15169
|
+
if (this.previousQuery === val || this.isOnComposition) return;
|
|
15170
|
+
if (this.previousQuery === null && (typeof this.filterMethod === 'function' || typeof this.remoteMethod === 'function')) {
|
|
15171
|
+
this.previousQuery = val;
|
|
15172
|
+
return;
|
|
15173
|
+
}
|
|
15174
|
+
this.previousQuery = val;
|
|
15175
|
+
this.$nextTick(() => {
|
|
15176
|
+
if (this.visible) this.broadcast('PSelectDropdown', 'updatePopper');
|
|
15177
|
+
});
|
|
15178
|
+
this.hoverIndex = -1;
|
|
15179
|
+
if (this.multiple && this.filterable) {
|
|
15180
|
+
this.$nextTick(() => {
|
|
15181
|
+
const length = this.$refs.input.value.length * 15 + 20;
|
|
15182
|
+
this.inputLength = this.collapseTags ? Math.min(50, length) : length;
|
|
15183
|
+
this.managePlaceholder();
|
|
15184
|
+
this.resetInputHeight();
|
|
15185
|
+
});
|
|
15186
|
+
}
|
|
15187
|
+
if (this.remote && typeof this.remoteMethod === 'function') {
|
|
15188
|
+
this.hoverIndex = -1;
|
|
15189
|
+
this.remoteMethod(val);
|
|
15190
|
+
} else if (typeof this.filterMethod === 'function') {
|
|
15191
|
+
this.filterMethod(val);
|
|
15192
|
+
this.broadcast('POptionGroup', 'queryChange');
|
|
15193
|
+
} else {
|
|
15194
|
+
this.filteredOptionsCount = this.optionsCount;
|
|
15195
|
+
this.broadcast('POption', 'queryChange', val);
|
|
15196
|
+
this.broadcast('POptionGroup', 'queryChange');
|
|
15197
|
+
}
|
|
15198
|
+
if (this.defaultFirstOption && (this.filterable || this.remote) && this.filteredOptionsCount) {
|
|
15199
|
+
this.checkDefaultFirstOption();
|
|
15200
|
+
}
|
|
15201
|
+
},
|
|
15202
|
+
scrollToOption(option) {
|
|
15203
|
+
const target = Array.isArray(option) && option[0] ? option[0].$el : option.$el;
|
|
15204
|
+
if (this.$refs.popper && target) {
|
|
15205
|
+
const menu = this.$refs.popper.$el.querySelector('.el-select-dropdown__wrap');
|
|
15206
|
+
scroll_into_view_default()(menu, target);
|
|
15207
|
+
}
|
|
15208
|
+
this.$refs.scrollbar && this.$refs.scrollbar.handleScroll();
|
|
15209
|
+
},
|
|
15210
|
+
handleMenuEnter() {
|
|
15211
|
+
this.$nextTick(() => this.scrollToOption(this.selected));
|
|
15212
|
+
},
|
|
15213
|
+
emitChange(val) {
|
|
15214
|
+
if (!valueEquals(this.value, val)) {
|
|
15215
|
+
this.$emit('change', val);
|
|
15216
|
+
}
|
|
15217
|
+
},
|
|
15218
|
+
getOption(value) {
|
|
15219
|
+
let option;
|
|
15220
|
+
const isObject = Object.prototype.toString.call(value).toLowerCase() === '[object object]';
|
|
15221
|
+
const isNull = Object.prototype.toString.call(value).toLowerCase() === '[object null]';
|
|
15222
|
+
const isUndefined = Object.prototype.toString.call(value).toLowerCase() === '[object undefined]';
|
|
15223
|
+
for (let i = this.cachedOptions.length - 1; i >= 0; i--) {
|
|
15224
|
+
const cachedOption = this.cachedOptions[i];
|
|
15225
|
+
const isEqual = isObject ? getValueByPath(cachedOption.value, this.valueKey) === getValueByPath(value, this.valueKey) : cachedOption.value === value;
|
|
15226
|
+
if (isEqual) {
|
|
15227
|
+
option = cachedOption;
|
|
15228
|
+
break;
|
|
15229
|
+
}
|
|
15230
|
+
}
|
|
15231
|
+
if (option) return option;
|
|
15232
|
+
const label = !isObject && !isNull && !isUndefined ? String(value) : '';
|
|
15233
|
+
let newOption = {
|
|
15234
|
+
value: value,
|
|
15235
|
+
currentLabel: label
|
|
15236
|
+
};
|
|
15237
|
+
if (this.multiple) {
|
|
15238
|
+
newOption.hitState = false;
|
|
15239
|
+
}
|
|
15240
|
+
return newOption;
|
|
15241
|
+
},
|
|
15242
|
+
setSelected() {
|
|
15243
|
+
if (!this.multiple) {
|
|
15244
|
+
let option = this.getOption(this.value);
|
|
15245
|
+
if (option.created) {
|
|
15246
|
+
this.createdLabel = option.currentLabel;
|
|
15247
|
+
this.createdSelected = true;
|
|
15248
|
+
} else {
|
|
15249
|
+
this.createdSelected = false;
|
|
15250
|
+
}
|
|
15251
|
+
this.selectedLabel = option.currentLabel;
|
|
15252
|
+
this.selected = option;
|
|
15253
|
+
if (this.filterable) this.query = this.selectedLabel;
|
|
15254
|
+
return;
|
|
15255
|
+
}
|
|
15256
|
+
let result = [];
|
|
15257
|
+
if (Array.isArray(this.value)) {
|
|
15258
|
+
this.value.forEach(value => {
|
|
15259
|
+
result.push(this.getOption(value));
|
|
15260
|
+
});
|
|
15261
|
+
}
|
|
15262
|
+
this.selected = result;
|
|
15263
|
+
this.$nextTick(() => {
|
|
15264
|
+
this.resetInputHeight();
|
|
15265
|
+
});
|
|
15266
|
+
},
|
|
15267
|
+
handleFocus(event) {
|
|
15268
|
+
if (!this.softFocus) {
|
|
15269
|
+
if (this.automaticDropdown || this.filterable) {
|
|
15270
|
+
if (this.filterable && !this.visible) {
|
|
15271
|
+
this.menuVisibleOnFocus = true;
|
|
15272
|
+
}
|
|
15273
|
+
this.visible = true;
|
|
15274
|
+
}
|
|
15275
|
+
this.$emit('focus', event);
|
|
15276
|
+
} else {
|
|
15277
|
+
this.softFocus = false;
|
|
15278
|
+
}
|
|
15279
|
+
},
|
|
15280
|
+
blur() {
|
|
15281
|
+
this.visible = false;
|
|
15282
|
+
this.$refs.reference.blur();
|
|
15283
|
+
},
|
|
15284
|
+
handleBlur(event) {
|
|
15285
|
+
setTimeout(() => {
|
|
15286
|
+
if (this.isSilentBlur) {
|
|
15287
|
+
this.isSilentBlur = false;
|
|
15288
|
+
} else {
|
|
15289
|
+
this.$emit('blur', event);
|
|
15290
|
+
}
|
|
15291
|
+
}, 50);
|
|
15292
|
+
this.softFocus = false;
|
|
15293
|
+
},
|
|
15294
|
+
handleClearClick(event) {
|
|
15295
|
+
this.deleteSelected(event);
|
|
15296
|
+
},
|
|
15297
|
+
doDestroy() {
|
|
15298
|
+
this.$refs.popper && this.$refs.popper.doDestroy();
|
|
15299
|
+
},
|
|
15300
|
+
handleClose() {
|
|
15301
|
+
this.visible = false;
|
|
15302
|
+
},
|
|
15303
|
+
toggleLastOptionHitState(hit) {
|
|
15304
|
+
if (!Array.isArray(this.selected)) return;
|
|
15305
|
+
const option = this.selected[this.selected.length - 1];
|
|
15306
|
+
if (!option) return;
|
|
15307
|
+
if (hit === true || hit === false) {
|
|
15308
|
+
option.hitState = hit;
|
|
15309
|
+
return hit;
|
|
15310
|
+
}
|
|
15311
|
+
option.hitState = !option.hitState;
|
|
15312
|
+
return option.hitState;
|
|
15313
|
+
},
|
|
15314
|
+
deletePrevTag(e) {
|
|
15315
|
+
if (e.target.value.length <= 0 && !this.toggleLastOptionHitState()) {
|
|
15316
|
+
const value = this.value.slice();
|
|
15317
|
+
value.pop();
|
|
15318
|
+
this.$emit('input', value);
|
|
15319
|
+
this.emitChange(value);
|
|
15320
|
+
}
|
|
15321
|
+
},
|
|
15322
|
+
managePlaceholder() {
|
|
15323
|
+
if (this.currentPlaceholder !== '') {
|
|
15324
|
+
this.currentPlaceholder = this.$refs.input.value ? '' : this.cachedPlaceHolder;
|
|
15325
|
+
}
|
|
15326
|
+
},
|
|
15327
|
+
resetInputState(e) {
|
|
15328
|
+
if (e.keyCode !== 8) this.toggleLastOptionHitState(false);
|
|
15329
|
+
this.inputLength = this.$refs.input.value.length * 15 + 20;
|
|
15330
|
+
this.resetInputHeight();
|
|
15331
|
+
},
|
|
15332
|
+
resetInputHeight() {
|
|
15333
|
+
if (this.collapseTags && !this.filterable) return;
|
|
15334
|
+
this.$nextTick(() => {
|
|
15335
|
+
if (!this.$refs.reference) return;
|
|
15336
|
+
let inputChildNodes = this.$refs.reference.$el.childNodes;
|
|
15337
|
+
let input = [].filter.call(inputChildNodes, item => item.tagName === 'INPUT')[0];
|
|
15338
|
+
const tags = this.$refs.tags;
|
|
15339
|
+
const tagsHeight = tags ? Math.round(tags.getBoundingClientRect().height) : 0;
|
|
15340
|
+
const sizeInMap = this.initialInputHeight || 40;
|
|
15341
|
+
input.style.height = this.selected.length === 0 ? sizeInMap + 'px' : Math.max(tags ? tagsHeight + (tagsHeight > sizeInMap ? 6 : 0) : 0, sizeInMap) + 'px';
|
|
15342
|
+
if (this.visible && this.emptyText !== false) {
|
|
15343
|
+
this.broadcast('PSelectDropdown', 'updatePopper');
|
|
15344
|
+
}
|
|
15345
|
+
});
|
|
15346
|
+
},
|
|
15347
|
+
resetHoverIndex() {
|
|
15348
|
+
setTimeout(() => {
|
|
15349
|
+
if (!this.multiple) {
|
|
15350
|
+
this.hoverIndex = this.options.indexOf(this.selected);
|
|
15351
|
+
} else {
|
|
15352
|
+
if (this.selected.length > 0) {
|
|
15353
|
+
this.hoverIndex = Math.min.apply(null, this.selected.map(item => this.options.indexOf(item)));
|
|
15354
|
+
} else {
|
|
15355
|
+
this.hoverIndex = -1;
|
|
15356
|
+
}
|
|
15357
|
+
}
|
|
15358
|
+
}, 300);
|
|
15359
|
+
},
|
|
15360
|
+
handleOptionSelect(option, byClick) {
|
|
15361
|
+
if (this.multiple) {
|
|
15362
|
+
const value = (this.value || []).slice();
|
|
15363
|
+
const optionIndex = this.getValueIndex(value, option.value);
|
|
15364
|
+
if (optionIndex > -1) {
|
|
15365
|
+
value.splice(optionIndex, 1);
|
|
15366
|
+
} else if (this.multipleLimit <= 0 || value.length < this.multipleLimit) {
|
|
15367
|
+
value.push(option.value);
|
|
15368
|
+
}
|
|
15369
|
+
this.$emit('input', value);
|
|
15370
|
+
this.emitChange(value);
|
|
15371
|
+
if (option.created) {
|
|
15372
|
+
this.query = '';
|
|
15373
|
+
this.handleQueryChange('');
|
|
15374
|
+
this.inputLength = 20;
|
|
15375
|
+
}
|
|
15376
|
+
if (this.filterable) this.$refs.input.focus();
|
|
15377
|
+
} else {
|
|
15378
|
+
this.$emit('input', option.value);
|
|
15379
|
+
this.emitChange(option.value);
|
|
15380
|
+
this.visible = false;
|
|
15381
|
+
}
|
|
15382
|
+
this.isSilentBlur = byClick;
|
|
15383
|
+
this.setSoftFocus();
|
|
15384
|
+
if (this.visible) return;
|
|
15385
|
+
this.$nextTick(() => {
|
|
15386
|
+
this.scrollToOption(option);
|
|
15387
|
+
});
|
|
15388
|
+
},
|
|
15389
|
+
setSoftFocus() {
|
|
15390
|
+
this.softFocus = true;
|
|
15391
|
+
const input = this.$refs.input || this.$refs.reference;
|
|
15392
|
+
if (input) {
|
|
15393
|
+
input.focus();
|
|
15394
|
+
}
|
|
15395
|
+
},
|
|
15396
|
+
getValueIndex(arr = [], value) {
|
|
15397
|
+
const isObject = Object.prototype.toString.call(value).toLowerCase() === '[object object]';
|
|
15398
|
+
if (!isObject) {
|
|
15399
|
+
return arr.indexOf(value);
|
|
15400
|
+
} else {
|
|
15401
|
+
const valueKey = this.valueKey;
|
|
15402
|
+
let index = -1;
|
|
15403
|
+
arr.some((item, i) => {
|
|
15404
|
+
if (getValueByPath(item, valueKey) === getValueByPath(value, valueKey)) {
|
|
15405
|
+
index = i;
|
|
15406
|
+
return true;
|
|
15407
|
+
}
|
|
15408
|
+
return false;
|
|
15409
|
+
});
|
|
15410
|
+
return index;
|
|
15411
|
+
}
|
|
15412
|
+
},
|
|
15413
|
+
toggleMenu() {
|
|
15414
|
+
if (!this.selectDisabled) {
|
|
15415
|
+
if (this.menuVisibleOnFocus) {
|
|
15416
|
+
this.menuVisibleOnFocus = false;
|
|
15417
|
+
} else {
|
|
15418
|
+
this.visible = !this.visible;
|
|
15419
|
+
}
|
|
15420
|
+
if (this.visible) {
|
|
15421
|
+
(this.$refs.input || this.$refs.reference).focus();
|
|
15422
|
+
}
|
|
15423
|
+
}
|
|
15424
|
+
},
|
|
15425
|
+
selectOption() {
|
|
15426
|
+
if (!this.visible) {
|
|
15427
|
+
this.toggleMenu();
|
|
15428
|
+
} else {
|
|
15429
|
+
if (this.options[this.hoverIndex]) {
|
|
15430
|
+
this.handleOptionSelect(this.options[this.hoverIndex]);
|
|
15431
|
+
}
|
|
15432
|
+
}
|
|
15433
|
+
},
|
|
15434
|
+
deleteSelected(event) {
|
|
15435
|
+
event.stopPropagation();
|
|
15436
|
+
const value = this.multiple ? [] : '';
|
|
15437
|
+
this.$emit('input', value);
|
|
15438
|
+
this.emitChange(value);
|
|
15439
|
+
this.visible = false;
|
|
15440
|
+
this.$emit('clear');
|
|
15441
|
+
},
|
|
15442
|
+
deleteTag(event, tag) {
|
|
15443
|
+
let index = this.selected.indexOf(tag);
|
|
15444
|
+
if (index > -1 && !this.selectDisabled) {
|
|
15445
|
+
const value = this.value.slice();
|
|
15446
|
+
value.splice(index, 1);
|
|
15447
|
+
this.$emit('input', value);
|
|
15448
|
+
this.emitChange(value);
|
|
15449
|
+
this.$emit('remove-tag', tag.value);
|
|
15450
|
+
}
|
|
15451
|
+
event.stopPropagation();
|
|
15452
|
+
},
|
|
15453
|
+
onInputChange() {
|
|
15454
|
+
if (this.filterable && this.query !== this.selectedLabel) {
|
|
15455
|
+
this.query = this.selectedLabel;
|
|
15456
|
+
this.handleQueryChange(this.query);
|
|
15457
|
+
}
|
|
15458
|
+
},
|
|
15459
|
+
onOptionDestroy(index) {
|
|
15460
|
+
if (index > -1) {
|
|
15461
|
+
this.optionsCount--;
|
|
15462
|
+
this.filteredOptionsCount--;
|
|
15463
|
+
this.options.splice(index, 1);
|
|
15464
|
+
}
|
|
15465
|
+
},
|
|
15466
|
+
resetInputWidth() {
|
|
15467
|
+
this.inputWidth = this.$refs.reference.$el.getBoundingClientRect().width;
|
|
15468
|
+
},
|
|
15469
|
+
handleResize() {
|
|
15470
|
+
this.resetInputWidth();
|
|
15471
|
+
if (this.multiple) this.resetInputHeight();
|
|
15472
|
+
},
|
|
15473
|
+
checkDefaultFirstOption() {
|
|
15474
|
+
this.hoverIndex = -1;
|
|
15475
|
+
// highlight the created option
|
|
15476
|
+
let hasCreated = false;
|
|
15477
|
+
for (let i = this.options.length - 1; i >= 0; i--) {
|
|
15478
|
+
if (this.options[i].created) {
|
|
15479
|
+
hasCreated = true;
|
|
15480
|
+
this.hoverIndex = i;
|
|
15481
|
+
break;
|
|
15482
|
+
}
|
|
15483
|
+
}
|
|
15484
|
+
if (hasCreated) return;
|
|
15485
|
+
for (let i = 0; i !== this.options.length; ++i) {
|
|
15486
|
+
const option = this.options[i];
|
|
15487
|
+
if (this.query) {
|
|
15488
|
+
// highlight first options that passes the filter
|
|
15489
|
+
if (!option.disabled && !option.groupDisabled && option.visible) {
|
|
15490
|
+
this.hoverIndex = i;
|
|
15491
|
+
break;
|
|
15492
|
+
}
|
|
15493
|
+
} else {
|
|
15494
|
+
// highlight currently selected option
|
|
15495
|
+
if (option.itemSelected) {
|
|
15496
|
+
this.hoverIndex = i;
|
|
15497
|
+
break;
|
|
15498
|
+
}
|
|
15499
|
+
}
|
|
15500
|
+
}
|
|
15501
|
+
},
|
|
15502
|
+
getValueKey(item) {
|
|
15503
|
+
if (Object.prototype.toString.call(item.value).toLowerCase() !== '[object object]') {
|
|
15504
|
+
return item.value;
|
|
15505
|
+
} else {
|
|
15506
|
+
return getValueByPath(item.value, this.valueKey);
|
|
15507
|
+
}
|
|
15508
|
+
}
|
|
15509
|
+
},
|
|
15510
|
+
created() {
|
|
15511
|
+
this.cachedPlaceHolder = this.currentPlaceholder = this.propPlaceholder;
|
|
15512
|
+
if (this.multiple && !Array.isArray(this.value)) {
|
|
15513
|
+
this.$emit('input', []);
|
|
15514
|
+
}
|
|
15515
|
+
if (!this.multiple && Array.isArray(this.value)) {
|
|
15516
|
+
this.$emit('input', '');
|
|
15517
|
+
}
|
|
15518
|
+
this.debouncedOnInputChange = debounce_default()(this.debounce, () => {
|
|
15519
|
+
this.onInputChange();
|
|
15520
|
+
});
|
|
15521
|
+
this.debouncedQueryChange = debounce_default()(this.debounce, e => {
|
|
15522
|
+
this.handleQueryChange(e.target.value);
|
|
15523
|
+
});
|
|
15524
|
+
this.$on('handleOptionClick', this.handleOptionSelect);
|
|
15525
|
+
this.$on('setSelected', this.setSelected);
|
|
15526
|
+
},
|
|
15527
|
+
mounted() {
|
|
15528
|
+
if (this.multiple && Array.isArray(this.value) && this.value.length > 0) {
|
|
15529
|
+
this.currentPlaceholder = '';
|
|
15530
|
+
}
|
|
15531
|
+
addResizeListener(this.$el, this.handleResize);
|
|
15532
|
+
const reference = this.$refs.reference;
|
|
15533
|
+
if (reference && reference.$el) {
|
|
15534
|
+
const sizeMap = {
|
|
15535
|
+
medium: 36,
|
|
15536
|
+
small: 32,
|
|
15537
|
+
mini: 28
|
|
15538
|
+
};
|
|
15539
|
+
const input = reference.$el.querySelector('input');
|
|
15540
|
+
this.initialInputHeight = input.getBoundingClientRect().height || sizeMap[this.selectSize];
|
|
15541
|
+
}
|
|
15542
|
+
if (this.remote && this.multiple) {
|
|
15543
|
+
this.resetInputHeight();
|
|
15544
|
+
}
|
|
15545
|
+
this.$nextTick(() => {
|
|
15546
|
+
if (reference && reference.$el) {
|
|
15547
|
+
this.inputWidth = reference.$el.getBoundingClientRect().width;
|
|
15548
|
+
}
|
|
15549
|
+
});
|
|
15550
|
+
this.setSelected();
|
|
15551
|
+
},
|
|
15552
|
+
beforeDestroy() {
|
|
15553
|
+
if (this.$el && this.handleResize) removeResizeListener(this.$el, this.handleResize);
|
|
15554
|
+
}
|
|
15555
|
+
});
|
|
15556
|
+
// CONCATENATED MODULE: ./src/package-admin/p-select/src/select.vue?vue&type=script&lang=js
|
|
15557
|
+
/* harmony default export */ var src_selectvue_type_script_lang_js = (selectvue_type_script_lang_js);
|
|
15558
|
+
// CONCATENATED MODULE: ./src/package-admin/p-select/src/select.vue
|
|
15559
|
+
|
|
15560
|
+
|
|
15561
|
+
|
|
15562
|
+
|
|
15563
|
+
|
|
15564
|
+
/* normalize component */
|
|
15565
|
+
|
|
15566
|
+
var select_component = normalizeComponent(
|
|
15567
|
+
src_selectvue_type_script_lang_js,
|
|
15568
|
+
selectvue_type_template_id_5cd02054_render,
|
|
15569
|
+
selectvue_type_template_id_5cd02054_staticRenderFns,
|
|
15570
|
+
false,
|
|
15571
|
+
null,
|
|
15572
|
+
null,
|
|
15573
|
+
null
|
|
15574
|
+
|
|
15575
|
+
)
|
|
15576
|
+
|
|
15577
|
+
/* harmony default export */ var src_select = (select_component.exports);
|
|
15578
|
+
// CONCATENATED MODULE: ./src/package-admin/p-select/index.js
|
|
15579
|
+
/* istanbul ignore next */
|
|
15580
|
+
|
|
15581
|
+
src_select.install = function (Vue) {
|
|
15582
|
+
Vue.component(src_select.name, src_select);
|
|
15583
|
+
};
|
|
15584
|
+
/* harmony default export */ var p_select = (src_select);
|
|
15585
|
+
// EXTERNAL MODULE: ./node_modules/@vue/babel-helper-vue-jsx-merge-props/dist/helper.js
|
|
15586
|
+
var helper = __webpack_require__("2638");
|
|
15587
|
+
var helper_default = /*#__PURE__*/__webpack_require__.n(helper);
|
|
14232
15588
|
|
|
14233
15589
|
// CONCATENATED MODULE: ./src/package-admin/p-table/src/config.js
|
|
14234
15590
|
|