yk-smart-ui-test
Version:
A Component Library for Vue.js.
1,890 lines (1,715 loc) • 96 kB
JavaScript
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "/dist/";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 103);
/******/ })
/************************************************************************/
/******/ ({
/***/ 0:
/***/ (function(module, exports) {
module.exports = require("vue");
/***/ }),
/***/ 103:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/_vue-loader@15.9.8@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_vue-loader@15.9.8@vue-loader/lib??vue-loader-options!./packages/transfer/src/main.vue?vue&type=template&id=5c654dd8&
var render = function () {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c(
"div",
{ staticClass: "yk-transfer" },
[
_c(
"transfer-panel",
_vm._b(
{
ref: "leftPanel",
attrs: {
data: _vm.sourceData,
title: _vm.titles[0] || _vm.t("el.transfer.titles.0"),
"default-checked": _vm.leftDefaultChecked,
placeholder:
_vm.filterPlaceholder || _vm.t("el.transfer.filterPlaceholder"),
},
on: { "checked-change": _vm.onSourceCheckedChange },
},
"transfer-panel",
_vm.$props,
false
),
[_vm._t("left-footer")],
2
),
_c(
"div",
{ staticClass: "yk-transfer__buttons" },
[
_c(
"yk-button",
{
class: [
"yk-transfer__button",
_vm.hasButtonTexts ? "is-with-texts" : "",
],
attrs: {
type: "primary",
disabled: _vm.rightChecked.length === 0,
},
nativeOn: {
click: function ($event) {
return _vm.addToLeft($event)
},
},
},
[
_c("i", { staticClass: "yk_icon_arrow_border_2_right" }),
_vm.buttonTexts[0] !== undefined
? _c("span", [_vm._v(_vm._s(_vm.buttonTexts[0]))])
: _vm._e(),
]
),
_c(
"yk-button",
{
class: [
"secBtton",
"yk-transfer__button",
_vm.hasButtonTexts ? "is-with-texts" : "",
],
attrs: {
type: "primary",
disabled: _vm.leftChecked.length === 0,
},
nativeOn: {
click: function ($event) {
return _vm.addToRight($event)
},
},
},
[
_vm.buttonTexts[1] !== undefined
? _c("span", [_vm._v(_vm._s(_vm.buttonTexts[1]))])
: _vm._e(),
_c("i", { staticClass: "yk_icon_arrow_border_2_left" }),
]
),
],
1
),
_c(
"transfer-panel",
_vm._b(
{
ref: "rightPanel",
attrs: {
data: _vm.targetData,
title: _vm.titles[1] || _vm.t("el.transfer.titles.1"),
"default-checked": _vm.rightDefaultChecked,
placeholder:
_vm.filterPlaceholder || _vm.t("el.transfer.filterPlaceholder"),
},
on: { "checked-change": _vm.onTargetCheckedChange },
},
"transfer-panel",
_vm.$props,
false
),
[_vm._t("right-footer")],
2
),
],
1
)
}
var staticRenderFns = []
render._withStripped = true
// CONCATENATED MODULE: ./packages/transfer/src/main.vue?vue&type=template&id=5c654dd8&
// EXTERNAL MODULE: ./packages/button/index.js + 5 modules
var packages_button = __webpack_require__(22);
// EXTERNAL MODULE: ./src/mixins/emitter.js
var emitter = __webpack_require__(6);
// EXTERNAL MODULE: ./src/mixins/locale.js
var locale = __webpack_require__(13);
// CONCATENATED MODULE: ./node_modules/_vue-loader@15.9.8@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_vue-loader@15.9.8@vue-loader/lib??vue-loader-options!./packages/transfer/src/transfer-panel.vue?vue&type=template&id=2ddab8bd&
var transfer_panelvue_type_template_id_2ddab8bd_render = function () {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c("div", { staticClass: "yk-transfer-panel" }, [
_c(
"p",
{ staticClass: "yk-transfer-panel__header" },
[
_c(
"yk-checkbox",
{
attrs: { indeterminate: _vm.isIndeterminate },
on: { change: _vm.handleAllCheckedChange },
model: {
value: _vm.allChecked,
callback: function ($$v) {
_vm.allChecked = $$v
},
expression: "allChecked",
},
},
[
_vm._v("\n " + _vm._s(_vm.title) + "\n "),
_c("span", [_vm._v(_vm._s(_vm.checkedSummary) + "条")]),
]
),
],
1
),
_c(
"div",
{
class: [
"yk-transfer-panel__body",
_vm.hasFooter ? "is-with-footer" : "",
],
},
[
_vm.filterable
? _c(
"yk-input",
{
staticClass: "yk-transfer-panel__filter",
attrs: { size: "small", placeholder: _vm.placeholder },
nativeOn: {
mouseenter: function ($event) {
_vm.inputHover = true
},
mouseleave: function ($event) {
_vm.inputHover = false
},
},
model: {
value: _vm.query,
callback: function ($$v) {
_vm.query = $$v
},
expression: "query",
},
},
[
_vm.query.length > 0 && _vm.inputHover
? _c("i", {
class: ["yk-input__icon", "yk_icon_close"],
attrs: { slot: "suffix" },
on: { click: _vm.clearQuery },
slot: "suffix",
})
: _c("i", {
class: ["yk-input__icon", "yk_icon_search"],
attrs: { slot: "prefix" },
on: { click: _vm.clearQuery },
slot: "prefix",
}),
]
)
: _vm._e(),
_c(
"yk-checkbox-group",
{
directives: [
{
name: "show",
rawName: "v-show",
value: !_vm.hasNoMatch && _vm.data.length > 0,
expression: "!hasNoMatch && data.length > 0",
},
],
staticClass: "yk-transfer-panel__list",
class: { "is-filterable": _vm.filterable },
model: {
value: _vm.checked,
callback: function ($$v) {
_vm.checked = $$v
},
expression: "checked",
},
},
_vm._l(_vm.filteredData, function (item) {
return _c(
"yk-checkbox",
{
key: item[_vm.keyProp],
staticClass: "yk-transfer-panel__item",
attrs: {
label: item[_vm.keyProp],
disabled: item[_vm.disabledProp],
},
},
[_c("option-content", { attrs: { option: item } })],
1
)
}),
1
),
_c(
"p",
{
directives: [
{
name: "show",
rawName: "v-show",
value: _vm.hasNoMatch,
expression: "hasNoMatch",
},
],
staticClass: "yk-transfer-panel__empty",
},
[_vm._v(_vm._s(_vm.t("el.transfer.noMatch")))]
),
_c(
"p",
{
directives: [
{
name: "show",
rawName: "v-show",
value: _vm.data.length === 0 && !_vm.hasNoMatch,
expression: "data.length === 0 && !hasNoMatch",
},
],
staticClass: "yk-transfer-panel__empty",
},
[_vm._v(_vm._s(_vm.t("el.transfer.noData")))]
),
],
1
),
_vm.hasFooter
? _c(
"p",
{ staticClass: "yk-transfer-panel__footer" },
[_vm._t("default")],
2
)
: _vm._e(),
])
}
var transfer_panelvue_type_template_id_2ddab8bd_staticRenderFns = []
transfer_panelvue_type_template_id_2ddab8bd_render._withStripped = true
// CONCATENATED MODULE: ./packages/transfer/src/transfer-panel.vue?vue&type=template&id=2ddab8bd&
// EXTERNAL MODULE: ./packages/checkbox-group/index.js + 5 modules
var checkbox_group = __webpack_require__(43);
// EXTERNAL MODULE: ./packages/checkbox/index.js + 5 modules
var packages_checkbox = __webpack_require__(26);
// EXTERNAL MODULE: ./packages/input/index.js + 6 modules
var input = __webpack_require__(18);
// CONCATENATED MODULE: ./node_modules/_babel-loader@7.1.5@babel-loader/lib!./node_modules/_vue-loader@15.9.8@vue-loader/lib??vue-loader-options!./packages/transfer/src/transfer-panel.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var transfer_panelvue_type_script_lang_js_ = ({
mixins: [locale["a" /* default */]],
name: 'YkTransferPanel',
componentName: 'YkTransferPanel',
components: {
YkCheckboxGroup: checkbox_group["default"],
YkCheckbox: packages_checkbox["default"],
ElInput: input["default"],
OptionContent: {
props: {
option: Object
},
render: function render(h) {
var getParent = function getParent(vm) {
if (vm.$options.componentName === 'YkTransferPanel') {
return vm;
} else if (vm.$parent) {
return getParent(vm.$parent);
} else {
return vm;
}
};
var panel = getParent(this);
var transfer = panel.$parent || panel;
return panel.renderContent ? panel.renderContent(h, this.option) : transfer.$scopedSlots.default ? transfer.$scopedSlots.default({ option: this.option }) : h('span', [this.option[panel.labelProp] || this.option[panel.keyProp]]);
}
}
},
props: {
data: {
type: Array,
default: function _default() {
return [];
}
},
renderContent: Function,
placeholder: String,
title: String,
filterable: Boolean,
format: Object,
filterMethod: Function,
defaultChecked: Array,
props: Object
},
data: function data() {
return {
checked: [],
allChecked: false,
query: '',
inputHover: false,
checkChangeByUser: true
};
},
watch: {
checked: function checked(val, oldVal) {
this.updateAllChecked();
if (this.checkChangeByUser) {
var movedKeys = val.concat(oldVal).filter(function (v) {
return val.indexOf(v) === -1 || oldVal.indexOf(v) === -1;
});
this.$emit('checked-change', val, movedKeys);
} else {
this.$emit('checked-change', val);
this.checkChangeByUser = true;
}
},
data: function data() {
var _this = this;
var checked = [];
var filteredDataKeys = this.filteredData.map(function (item) {
return item[_this.keyProp];
});
this.checked.forEach(function (item) {
if (filteredDataKeys.indexOf(item) > -1) {
checked.push(item);
}
});
this.checkChangeByUser = false;
this.checked = checked;
},
checkableData: function checkableData() {
this.updateAllChecked();
},
defaultChecked: {
immediate: true,
handler: function handler(val, oldVal) {
var _this2 = this;
if (oldVal && val.length === oldVal.length && val.every(function (item) {
return oldVal.indexOf(item) > -1;
})) return;
var checked = [];
var checkableDataKeys = this.checkableData.map(function (item) {
return item[_this2.keyProp];
});
val.forEach(function (item) {
if (checkableDataKeys.indexOf(item) > -1) {
checked.push(item);
}
});
this.checkChangeByUser = false;
this.checked = checked;
}
}
},
computed: {
filteredData: function filteredData() {
var _this3 = this;
return this.data.filter(function (item) {
if (typeof _this3.filterMethod === 'function') {
return _this3.filterMethod(_this3.query, item);
} else {
var label = item[_this3.labelProp] || item[_this3.keyProp].toString();
return label.toLowerCase().indexOf(_this3.query.toLowerCase()) > -1;
}
});
},
checkableData: function checkableData() {
var _this4 = this;
return this.filteredData.filter(function (item) {
return !item[_this4.disabledProp];
});
},
checkedSummary: function checkedSummary() {
var checkedLength = this.checked.length;
var dataLength = this.data.length;
var _format = this.format,
noChecked = _format.noChecked,
hasChecked = _format.hasChecked;
if (noChecked && hasChecked) {
return checkedLength > 0 ? hasChecked.replace(/\${checked}/g, checkedLength).replace(/\${total}/g, dataLength) : noChecked.replace(/\${total}/g, dataLength);
} else {
return checkedLength + '/' + dataLength;
}
},
isIndeterminate: function isIndeterminate() {
var checkedLength = this.checked.length;
return checkedLength > 0 && checkedLength < this.checkableData.length;
},
hasNoMatch: function hasNoMatch() {
return this.query.length > 0 && this.filteredData.length === 0;
},
inputIcon: function inputIcon() {
return this.query.length > 0 && this.inputHover ? 'yk_icon_close' : 'yk_icon_search';
},
labelProp: function labelProp() {
return this.props.label || 'label';
},
keyProp: function keyProp() {
return this.props.key || 'key';
},
disabledProp: function disabledProp() {
return this.props.disabled || 'disabled';
},
hasFooter: function hasFooter() {
return !!this.$slots.default;
}
},
methods: {
updateAllChecked: function updateAllChecked() {
var _this5 = this;
var checkableDataKeys = this.checkableData.map(function (item) {
return item[_this5.keyProp];
});
this.allChecked = checkableDataKeys.length > 0 && checkableDataKeys.every(function (item) {
return _this5.checked.indexOf(item) > -1;
});
},
handleAllCheckedChange: function handleAllCheckedChange(value) {
var _this6 = this;
this.checked = value ? this.checkableData.map(function (item) {
return item[_this6.keyProp];
}) : [];
},
clearQuery: function clearQuery() {
if (this.inputIcon === 'circle-close') {
this.query = '';
}
}
}
});
// CONCATENATED MODULE: ./packages/transfer/src/transfer-panel.vue?vue&type=script&lang=js&
/* harmony default export */ var src_transfer_panelvue_type_script_lang_js_ = (transfer_panelvue_type_script_lang_js_);
// EXTERNAL MODULE: ./node_modules/_vue-loader@15.9.8@vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(2);
// CONCATENATED MODULE: ./packages/transfer/src/transfer-panel.vue
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
src_transfer_panelvue_type_script_lang_js_,
transfer_panelvue_type_template_id_2ddab8bd_render,
transfer_panelvue_type_template_id_2ddab8bd_staticRenderFns,
false,
null,
null,
null
)
/* hot reload */
if (false) { var api; }
component.options.__file = "packages/transfer/src/transfer-panel.vue"
/* harmony default export */ var transfer_panel = (component.exports);
// EXTERNAL MODULE: ./src/mixins/migrating.js
var migrating = __webpack_require__(12);
// CONCATENATED MODULE: ./node_modules/_babel-loader@7.1.5@babel-loader/lib!./node_modules/_vue-loader@15.9.8@vue-loader/lib??vue-loader-options!./packages/transfer/src/main.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var mainvue_type_script_lang_js_ = ({
name: 'YkTransfer',
mixins: [emitter["a" /* default */], locale["a" /* default */], migrating["a" /* default */]],
components: {
TransferPanel: transfer_panel,
YkButton: packages_button["default"]
},
props: {
data: {
type: Array,
default: function _default() {
return [];
}
},
titles: {
type: Array,
default: function _default() {
return [];
}
},
buttonTexts: {
type: Array,
default: function _default() {
return [];
}
},
filterPlaceholder: {
type: String,
default: ''
},
filterMethod: Function,
leftDefaultChecked: {
type: Array,
default: function _default() {
return [];
}
},
rightDefaultChecked: {
type: Array,
default: function _default() {
return [];
}
},
renderContent: Function,
value: {
type: Array,
default: function _default() {
return [];
}
},
format: {
type: Object,
default: function _default() {
return {};
}
},
filterable: Boolean,
props: {
type: Object,
default: function _default() {
return {
label: 'label',
key: 'key',
disabled: 'disabled'
};
}
},
targetOrder: {
type: String,
default: 'original'
}
},
data: function data() {
return {
leftChecked: [],
rightChecked: []
};
},
computed: {
dataObj: function dataObj() {
var key = this.props.key;
return this.data.reduce(function (o, cur) {
return (o[cur[key]] = cur) && o;
}, {});
},
sourceData: function sourceData() {
var _this = this;
return this.data.filter(function (item) {
return _this.value.indexOf(item[_this.props.key]) === -1;
});
},
targetData: function targetData() {
var _this2 = this;
if (this.targetOrder === 'original') {
return this.data.filter(function (item) {
return _this2.value.indexOf(item[_this2.props.key]) > -1;
});
} else {
return this.value.reduce(function (arr, cur) {
var val = _this2.dataObj[cur];
if (val) {
arr.push(val);
}
return arr;
}, []);
}
},
hasButtonTexts: function hasButtonTexts() {
return this.buttonTexts.length === 2;
}
},
watch: {
value: function value(val) {
this.dispatch('YkFormItem', 'el.form.change', val);
}
},
methods: {
getMigratingConfig: function getMigratingConfig() {
return {
props: {
'footer-format': 'footer-format is renamed to format.'
}
};
},
onSourceCheckedChange: function onSourceCheckedChange(val, movedKeys) {
this.leftChecked = val;
if (movedKeys === undefined) return;
this.$emit('left-check-change', val, movedKeys);
},
onTargetCheckedChange: function onTargetCheckedChange(val, movedKeys) {
this.rightChecked = val;
if (movedKeys === undefined) return;
this.$emit('right-check-change', val, movedKeys);
},
addToLeft: function addToLeft() {
var currentValue = this.value.slice();
this.rightChecked.forEach(function (item) {
var index = currentValue.indexOf(item);
if (index > -1) {
currentValue.splice(index, 1);
}
});
this.$emit('input', currentValue);
this.$emit('change', currentValue, 'left', this.rightChecked);
},
addToRight: function addToRight() {
var _this3 = this;
var currentValue = this.value.slice();
var itemsToBeMoved = [];
var key = this.props.key;
this.data.forEach(function (item) {
var itemKey = item[key];
if (_this3.leftChecked.indexOf(itemKey) > -1 && _this3.value.indexOf(itemKey) === -1) {
itemsToBeMoved.push(itemKey);
}
});
currentValue = this.targetOrder === 'unshift' ? itemsToBeMoved.concat(currentValue) : currentValue.concat(itemsToBeMoved);
this.$emit('input', currentValue);
this.$emit('change', currentValue, 'right', this.leftChecked);
},
clearQuery: function clearQuery(which) {
if (which === 'left') {
this.$refs.leftPanel.query = '';
} else if (which === 'right') {
this.$refs.rightPanel.query = '';
}
}
}
});
// CONCATENATED MODULE: ./packages/transfer/src/main.vue?vue&type=script&lang=js&
/* harmony default export */ var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_);
// CONCATENATED MODULE: ./packages/transfer/src/main.vue
/* normalize component */
var main_component = Object(componentNormalizer["a" /* default */])(
src_mainvue_type_script_lang_js_,
render,
staticRenderFns,
false,
null,
null,
null
)
/* hot reload */
if (false) { var main_api; }
main_component.options.__file = "packages/transfer/src/main.vue"
/* harmony default export */ var main = (main_component.exports);
// CONCATENATED MODULE: ./packages/transfer/index.js
/* istanbul ignore next */
main.install = function (Vue) {
Vue.component(main.name, main);
};
/* harmony default export */ var transfer = __webpack_exports__["default"] = (main);
/***/ }),
/***/ 11:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXPORTS
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ t; });
// UNUSED EXPORTS: use, i18n
// CONCATENATED MODULE: ./src/locale/lang/zh-CN.js
/* harmony default export */ var zh_CN = ({
el: {
colorpicker: {
confirm: '确定',
clear: '清空'
},
datepicker: {
now: '此刻',
today: '今天',
cancel: '取消',
clear: '清空',
confirm: '确定',
selectDate: '选择日期',
selectTime: '选择时间',
startDate: '开始日期',
startTime: '开始时间',
endDate: '结束日期',
endTime: '结束时间',
prevYear: '前一年',
nextYear: '后一年',
prevMonth: '上个月',
nextMonth: '下个月',
year: '年',
month1: '1 月',
month2: '2 月',
month3: '3 月',
month4: '4 月',
month5: '5 月',
month6: '6 月',
month7: '7 月',
month8: '8 月',
month9: '9 月',
month10: '10 月',
month11: '11 月',
month12: '12 月',
// week: '周次',
weeks: {
sun: '日',
mon: '一',
tue: '二',
wed: '三',
thu: '四',
fri: '五',
sat: '六'
},
months: {
jan: '一月',
feb: '二月',
mar: '三月',
apr: '四月',
may: '五月',
jun: '六月',
jul: '七月',
aug: '八月',
sep: '九月',
oct: '十月',
nov: '十一月',
dec: '十二月'
},
shortcuts: {
Today: '今天',
Yestoday: '昨天',
LastThreeDays: '最近三天',
LastSevenDays: '最近七天',
ThisWeek: '本周',
LastWeek: '上周',
ThisMoth: '本月',
LastMonth: '上月',
LastThreeMonths: '最近三个月',
LastSixMonths: '最近六个月'
}
},
select: {
loading: '加载中',
noMatch: '无匹配数据',
noData: '无数据',
placeholder: '请选择'
},
cascader: {
noMatch: '无匹配数据',
loading: '加载中',
placeholder: '请选择',
noData: '暂无数据'
},
pagination: {
goto: '前往',
pagesize: '条/页',
total: '共 {total} 条',
pageClassifier: '页'
},
messagebox: {
title: '提示',
confirm: '确定',
cancel: '取消',
error: '输入的数据不合法!'
},
upload: {
deleteTip: '按 delete 键可删除',
delete: '删除',
preview: '查看图片',
continue: '继续上传'
},
table: {
emptyText: '暂无数据',
confirmFilter: '筛选',
resetFilter: '重置',
clearFilter: '全部',
sumText: '合计'
},
tree: {
emptyText: '暂无数据'
},
transfer: {
noMatch: '无匹配数据',
noData: '无数据',
titles: ['列表 1', '列表 2'],
filterPlaceholder: '请输入搜索内容',
noCheckedFormat: '共 {total} 项',
hasCheckedFormat: '已选 {checked}/{total} 项'
},
image: {
error: '加载失败'
},
pageHeader: {
title: '返回'
},
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消'
},
empty: {
description: '暂无数据'
}
}
});
// EXTERNAL MODULE: external "vue"
var external_vue_ = __webpack_require__(0);
var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
// EXTERNAL MODULE: external "deepmerge"
var external_deepmerge_ = __webpack_require__(17);
var external_deepmerge_default = /*#__PURE__*/__webpack_require__.n(external_deepmerge_);
// EXTERNAL MODULE: ./src/utils/util.js
var util = __webpack_require__(3);
// CONCATENATED MODULE: ./src/locale/format.js
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var RE_NARGS = /(%|)\{([0-9a-zA-Z_]+)\}/g;
/**
* String format template
* - Inspired:
* https://github.com/Matt-Esch/string-template/index.js
*/
/* harmony default export */ var format = (function (Vue) {
/**
* template
*
* @param {String} string
* @param {Array} ...args
* @return {String}
*/
function template(string) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
if (args.length === 1 && _typeof(args[0]) === 'object') {
args = args[0];
}
if (!args || !args.hasOwnProperty) {
args = {};
}
return string.replace(RE_NARGS, function (match, prefix, i, index) {
var result = void 0;
if (string[index - 1] === '{' && string[index + match.length] === '}') {
return i;
} else {
result = Object(util["j" /* hasOwn */])(args, i) ? args[i] : null;
if (result === null || result === undefined) {
return '';
}
return result;
}
});
}
return template;
});
// CONCATENATED MODULE: ./src/locale/index.js
var locale_format = format(external_vue_default.a);
var lang = zh_CN;
var merged = false;
var locale_i18nHandler = function i18nHandler() {
var vuei18n = Object.getPrototypeOf(this || external_vue_default.a).$t;
if (typeof vuei18n === 'function' && !!external_vue_default.a.locale) {
if (!merged) {
merged = true;
external_vue_default.a.locale(external_vue_default.a.config.lang, external_deepmerge_default()(lang, external_vue_default.a.locale(external_vue_default.a.config.lang) || {}, { clone: true }));
}
return vuei18n.apply(this, arguments);
}
};
var t = function t(path, options) {
var value = locale_i18nHandler.apply(this, arguments);
if (value !== null && value !== undefined) return value;
var array = path.split('.');
var current = lang;
for (var i = 0, j = array.length; i < j; i++) {
var property = array[i];
value = current[property];
if (i === j - 1) return locale_format(value, options);
if (!value) return '';
current = value;
}
return '';
};
var use = function use(l) {
lang = l || lang;
};
var i18n = function i18n(fn) {
locale_i18nHandler = fn || locale_i18nHandler;
};
/* harmony default export */ var locale = ({ use: use, t: t, i18n: i18n });
/***/ }),
/***/ 12:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
/**
* Show migrating guide in browser console.
*
* Usage:
* import Migrating from 'element-ui/src/mixins/migrating';
*
* mixins: [Migrating]
*
* add getMigratingConfig method for your component.
* getMigratingConfig() {
* return {
* props: {
* 'allow-no-selection': 'allow-no-selection is removed.',
* 'selection-mode': 'selection-mode is removed.'
* },
* events: {
* selectionchange: 'selectionchange is renamed to selection-change.'
* }
* };
* },
*/
/* harmony default export */ __webpack_exports__["a"] = ({
mounted: function mounted() {
if (true) return;
if (!this.$vnode) return;
var _getMigratingConfig = this.getMigratingConfig(),
_getMigratingConfig$p = _getMigratingConfig.props,
props = _getMigratingConfig$p === undefined ? {} : _getMigratingConfig$p,
_getMigratingConfig$e = _getMigratingConfig.events,
events = _getMigratingConfig$e === undefined ? {} : _getMigratingConfig$e;
var _$vnode = this.$vnode,
data = _$vnode.data,
componentOptions = _$vnode.componentOptions;
var definedProps = data.attrs || {};
var definedEvents = componentOptions.listeners || {};
for (var propName in definedProps) {
propName = Object(element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* kebabCase */ "p"])(propName); // compatible with camel case
if (props[propName]) {
console.warn('[Element Migrating][' + this.$options.name + '][Attribute]: ' + props[propName]);
}
}
for (var eventName in definedEvents) {
eventName = Object(element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* kebabCase */ "p"])(eventName); // compatible with camel case
if (events[eventName]) {
console.warn('[Element Migrating][' + this.$options.name + '][Event]: ' + events[eventName]);
}
}
},
methods: {
getMigratingConfig: function getMigratingConfig() {
return {
props: {},
events: {}
};
}
}
});
/***/ }),
/***/ 13:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var element_ui_src_locale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11);
/* harmony default export */ __webpack_exports__["a"] = ({
methods: {
t: function t() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return element_ui_src_locale__WEBPACK_IMPORTED_MODULE_0__[/* t */ "a"].apply(this, args);
}
}
});
/***/ }),
/***/ 16:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDef; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isKorean; });
function isDef(val) {
return val !== undefined && val !== null;
}
function isKorean(text) {
var reg = /([(\uAC00-\uD7AF)|(\u3130-\u318F)])+/gi;
return reg.test(text);
}
/***/ }),
/***/ 17:
/***/ (function(module, exports) {
module.exports = require("deepmerge");
/***/ }),
/***/ 18:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/_vue-loader@15.9.8@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_vue-loader@15.9.8@vue-loader/lib??vue-loader-options!./packages/input/src/input.vue?vue&type=template&id=343dd774&
var render = function () {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c(
"div",
{
class: [
_vm.type === "textarea" ? "yk-textarea" : "yk-input",
_vm.inputSize ? "yk-input--" + _vm.inputSize : "",
{
"is-disabled": _vm.inputDisabled,
"is-exceed": _vm.inputExceed,
"is-focus": _vm.focused,
"yk-input-group": _vm.$slots.prepend || _vm.$slots.append,
"yk-input-group--append": _vm.$slots.append,
"yk-input-group--prepend": _vm.$slots.prepend,
"yk-input--prefix": _vm.$slots.prefix || _vm.prefixIcon,
"yk-input--suffix":
_vm.$slots.suffix ||
_vm.suffixIcon ||
_vm.clearable ||
_vm.showPassword,
},
],
on: {
mouseenter: function ($event) {
_vm.hovering = true
},
mouseleave: function ($event) {
_vm.hovering = false
},
},
},
[
_vm.type !== "textarea"
? [
_vm.$slots.prepend
? _c(
"div",
{ staticClass: "yk-input-group__prepend" },
[_vm._t("prepend")],
2
)
: _vm._e(),
_vm.type !== "textarea"
? _c(
"input",
_vm._b(
{
ref: "input",
staticClass: "yk-input__inner",
class: [
_vm.$slots.prefix ? "hasPrefix" : "",
_vm.getSuffixVisible() ? "hasSuffix" : "",
],
attrs: {
tabindex: _vm.tabindex,
type: _vm.showPassword
? _vm.passwordVisible
? "text"
: "password"
: _vm.type,
disabled: _vm.inputDisabled,
readonly: _vm.readonly,
autocomplete: _vm.autoComplete || _vm.autocomplete,
"aria-label": _vm.label,
},
on: {
compositionstart: _vm.handleCompositionStart,
compositionupdate: _vm.handleCompositionUpdate,
compositionend: _vm.handleCompositionEnd,
input: _vm.handleInput,
focus: _vm.handleFocus,
blur: _vm.handleBlur,
change: _vm.handleChange,
},
},
"input",
_vm.$attrs,
false
)
)
: _vm._e(),
_vm.$slots.prefix || _vm.prefixIcon
? _c(
"span",
{
staticClass: "yk-input__prefix",
class: _vm.focused ? "focused" : "",
},
[
_vm._t("prefix"),
_vm.prefixIcon
? _c("i", {
staticClass: "yk-input__icon",
class: _vm.prefixIcon,
})
: _vm._e(),
],
2
)
: _vm._e(),
_vm.getSuffixVisible()
? _c(
"span",
{
staticClass: "yk-input__suffix",
class: _vm.focused ? "focused" : "",
},
[
_c(
"span",
{ staticClass: "yk-input__suffix-inner" },
[
!_vm.showClear ||
!_vm.showPwdVisible ||
!_vm.isWordLimitVisible
? [
_vm._t("suffix"),
_vm.suffixIcon
? _c("i", {
staticClass: "yk-input__icon",
class: _vm.suffixIcon,
})
: _vm._e(),
]
: _vm._e(),
_vm.showClear
? _c("i", {
staticClass:
"yk-input__icon yk_icon_close yk-input__clear",
on: {
mousedown: function ($event) {
$event.preventDefault()
},
click: _vm.clear,
},
})
: _vm._e(),
_vm.showPwdVisible
? _c("i", {
class: {
"yk-input__icon": true,
yk_icon_eye_close_fill: !_vm.passwordVisible,
yk_icon_eye_open_fill: _vm.passwordVisible,
"yk-input__clear": true,
},
on: { click: _vm.handlePasswordVisible },
})
: _vm._e(),
_vm.isWordLimitVisible
? _c("span", { staticClass: "yk-input__count" }, [
_c(
"span",
{ staticClass: "yk-input__count-inner" },
[
_vm._v(
"\n " +
_vm._s(_vm.textLength) +
"/" +
_vm._s(_vm.upperLimit) +
"\n "
),
]
),
])
: _vm._e(),
],
2
),
_vm.validateState === "validating"
? _c("i", {
staticClass: "yk-input__icon",
class: ["yk-input__validateIcon", _vm.validateIcon],
})
: _vm._e(),
["error", "success"].includes(_vm.validateState) &&
_vm.needStatusIcon
? _c("span", {
staticClass: "yk-input__status-iocn",
style: {
background:
_vm.validateState === "error"
? "#DD425A"
: this.value
? "#67C23A"
: "#fff",
},
})
: _vm._e(),
]
)
: _vm._e(),
_vm.$slots.append
? _c(
"div",
{ staticClass: "yk-input-group__append" },
[_vm._t("append")],
2
)
: _vm._e(),
]
: _c(
"textarea",
_vm._b(
{
ref: "textarea",
staticClass: "yk-textarea__inner",
style: _vm.textareaStyle,
attrs: {
tabindex: _vm.tabindex,
disabled: _vm.inputDisabled,
readonly: _vm.readonly,
autocomplete: _vm.autoComplete || _vm.autocomplete,
"aria-label": _vm.label,
},
on: {
compositionstart: _vm.handleCompositionStart,
compositionupdate: _vm.handleCompositionUpdate,
compositionend: _vm.handleCompositionEnd,
input: _vm.handleInput,
focus: _vm.handleFocus,
blur: _vm.handleBlur,
change: _vm.handleChange,
},
},
"textarea",
_vm.$attrs,
false
)
),
_vm.isWordLimitVisible && _vm.type === "textarea"
? _c("span", { staticClass: "yk-input__count" }, [
_vm._v(_vm._s(_vm.textLength) + "/" + _vm._s(_vm.upperLimit)),
])
: _vm._e(),
],
2
)
}
var staticRenderFns = []
render._withStripped = true
// CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=template&id=343dd774&
// EXTERNAL MODULE: ./src/mixins/emitter.js
var emitter = __webpack_require__(6);
// EXTERNAL MODULE: ./src/mixins/migrating.js
var migrating = __webpack_require__(12);
// CONCATENATED MODULE: ./packages/input/src/calcTextareaHeight.js
var hiddenTextarea = void 0;
var HIDDEN_STYLE = '\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n';
var CONTEXT_STYLE = ['letter-spacing', 'line-height', 'padding-top', 'padding-bottom', 'font-family', 'font-weight', 'font-size', 'text-rendering', 'text-transform', 'width', 'text-indent', 'padding-left', 'padding-right', 'border-width', 'box-sizing'];
function calculateNodeStyling(targetElement) {
var style = window.getComputedStyle(targetElement);
var boxSizing = style.getPropertyValue('box-sizing');
var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));
var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));
var contextStyle = CONTEXT_STYLE.map(function (name) {
return name + ':' + style.getPropertyValue(name);
}).join(';');
return { contextStyle: contextStyle, paddingSize: paddingSize, borderSize: borderSize, boxSizing: boxSizing };
}
function calcTextareaHeight(targetElement) {
var minRows = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
var maxRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
if (!hiddenTextarea) {
hiddenTextarea = document.createElement('textarea');
document.body.appendChild(hiddenTextarea);
}
var _calculateNodeStyling = calculateNodeStyling(targetElement),
paddingSize = _calculateNodeStyling.paddingSize,
borderSize = _calculateNodeStyling.borderSize,
boxSizing = _calculateNodeStyling.boxSizing,
contextStyle = _calculateNodeStyling.contextStyle;
hiddenTextarea.setAttribute('style', contextStyle + ';' + HIDDEN_STYLE);
hiddenTextarea.value = targetElement.value || targetElement.placeholder || '';
var height = hiddenTextarea.scrollHeight;
var result = {};
if (boxSizing === 'border-box') {
height = height + borderSize;
} else if (boxSizing === 'content-box') {
height = height - paddingSize;
}
hiddenTextarea.value = '';
var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
if (minRows !== null) {
var minHeight = singleRowHeight * minRows;
if (boxSizing === 'border-box') {
minHeight = minHeight + paddingSize + borderSize;
}
height = Math.max(minHeight, height);
result.minHeight = minHeight + 'px';
}
if (maxRows !== null) {
var maxHeight = singleRowHeight * maxRows;
if (boxSizing === 'border-box') {
maxHeight = maxHeight + paddingSize + borderSize;
}
height = Math.min(maxHeight, height);
}
result.height = height + 'px';
hiddenTextarea.parentNode && hiddenTextarea.parentNode.removeChild(hiddenTextarea);
hiddenTextarea = null;
return result;
};
// EXTERNAL MODULE: ./src/utils/merge.js
var merge = __webpack_require__(7);
// EXTERNAL MODULE: ./src/utils/shared.js
var shared = __webpack_require__(16);
// CONCATENATED MODULE: ./node_modules/_babel-loader@7.1.5@babel-loader/lib!./node_modules/_vue-loader@15.9.8@vue-loader/lib??vue-loader-options!./packages/input/src/input.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var inputvue_type_script_lang_js_ = ({
name: 'YkInput',
componentName: 'YkInput',
mixins: [emitter["a" /* default */], migrating["a" /* default */]],
inheritAttrs: false,
inject: {
ykForm: {
default: ''
},
ykFormItem: {
default: ''
}
},
data: function data() {
return {
textareaCalcStyle: {},
hovering: false,
focused: false,
isComposing: false,
passwordVisible: false
};
},
props: {
value: [String, Number],
size: String,
resize: String,
form: String,
disabled: Boolean,
readonly: Boolean,
type: {
type: String,
default: 'text'
},
autosize: {
type: [Boolean, Object],
default: false
},
autocomplete: {
type: String,
default: 'off'
},
/** @Deprecated in next major version */
autoComplete: {
type: String,
validator: function validator(val) {
false && false;
return true;
}
},
validateEvent: {
type: Boolean,
default: true
},
suffixIcon: String,
prefixIcon: String,
label: String,
cle