yk-smart-ui-test
Version:
A Component Library for Vue.js.
1,772 lines (1,589 loc) • 79.2 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 = 109);
/******/ })
/************************************************************************/
/******/ ({
/***/ 0:
/***/ (function(module, exports) {
module.exports = require("vue");
/***/ }),
/***/ 109:
/***/ (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/calendar/src/main.vue?vue&type=template&id=6d9756be&
var render = function () {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c("div", { staticClass: "yk-calendar" }, [
_c("div", { staticClass: "yk-calendar__header" }, [
_c("div", { staticClass: "yk-calendar__title" }, [
_vm._v("\n " + _vm._s(_vm.i18nDate) + "\n "),
]),
_vm.validatedRange.length === 0
? _c(
"div",
{ staticClass: "yk-calendar__button-group" },
[
_c(
"yk-button-group",
[
_c(
"yk-button",
{
attrs: { type: "plain", size: "mini" },
on: {
click: function ($event) {
_vm.selectDate("prev-month")
},
},
},
[
_vm._v(
"\n " +
_vm._s(_vm.t("el.datepicker.prevMonth")) +
"\n "
),
]
),
_c(
"yk-button",
{
attrs: { type: "plain", size: "mini" },
on: {
click: function ($event) {
_vm.selectDate("today")
},
},
},
[
_vm._v(
"\n " +
_vm._s(_vm.t("el.datepicker.today")) +
"\n "
),
]
),
_c(
"yk-button",
{
attrs: { type: "plain", size: "mini" },
on: {
click: function ($event) {
_vm.selectDate("next-month")
},
},
},
[
_vm._v(
"\n " +
_vm._s(_vm.t("el.datepicker.nextMonth")) +
"\n "
),
]
),
],
1
),
],
1
)
: _vm._e(),
]),
_vm.validatedRange.length === 0
? _c(
"div",
{ key: "no-range", staticClass: "yk-calendar__body" },
[
_c("date-table", {
attrs: {
date: _vm.date,
"selected-day": _vm.realSelectedDay,
"first-day-of-week": _vm.realFirstDayOfWeek,
},
on: { pick: _vm.pickDay },
}),
],
1
)
: _c(
"div",
{ key: "has-range", staticClass: "yk-calendar__body" },
_vm._l(_vm.validatedRange, function (range, index) {
return _c("date-table", {
key: index,
attrs: {
date: range[0],
"selected-day": _vm.realSelectedDay,
range: range,
"hide-header": index !== 0,
"first-day-of-week": _vm.realFirstDayOfWeek,
},
on: { pick: _vm.pickDay },
})
}),
1
),
])
}
var staticRenderFns = []
render._withStripped = true
// CONCATENATED MODULE: ./packages/calendar/src/main.vue?vue&type=template&id=6d9756be&
// EXTERNAL MODULE: ./src/mixins/locale.js
var locale = __webpack_require__(13);
// EXTERNAL MODULE: ./src/utils/date.js
var utils_date = __webpack_require__(23);
var date_default = /*#__PURE__*/__webpack_require__.n(utils_date);
// EXTERNAL MODULE: ./packages/button/index.js + 5 modules
var packages_button = __webpack_require__(22);
// EXTERNAL MODULE: ./packages/button-group/index.js + 5 modules
var button_group = __webpack_require__(41);
// EXTERNAL MODULE: ./src/utils/date-util.js
var date_util = __webpack_require__(4);
// 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/calendar/src/date-table.vue?vue&type=script&lang=js&
/* harmony default export */ var date_tablevue_type_script_lang_js_ = ({
props: {
selectedDay: String, // formated date yyyy-MM-dd
range: {
type: Array,
validator: function validator(val) {
if (!(val && val.length)) return true;
var start = val[0],
end = val[1];
return Object(date_util["F" /* validateRangeInOneMonth */])(start, end);
}
},
date: Date,
hideHeader: Boolean,
firstDayOfWeek: Number
},
inject: ['ykCalendar'],
methods: {
toNestedArr: function toNestedArr(days) {
return Object(date_util["D" /* range */])(days.length / 7).map(function (_, index) {
var start = index * 7;
return days.slice(start, start + 7);
});
},
getFormateDate: function getFormateDate(day, type) {
if (!day || ['prev', 'current', 'next'].indexOf(type) === -1) {
throw new Error('invalid day or type');
}
var prefix = this.curMonthDatePrefix;
if (type === 'prev') {
prefix = this.prevMonthDatePrefix;
} else if (type === 'next') {
prefix = this.nextMonthDatePrefix;
}
day = ('00' + day).slice(-2);
return prefix + '-' + day;
},
getCellClass: function getCellClass(_ref) {
var text = _ref.text,
type = _ref.type;
var classes = [type];
if (type === 'current') {
var date = this.getFormateDate(text, type);
if (date === this.selectedDay) {
classes.push('is-selected');
}
if (date === this.formatedToday) {
classes.push('is-today');
}
}
return classes;
},
pickDay: function pickDay(_ref2) {
var text = _ref2.text,
type = _ref2.type;
var date = this.getFormateDate(text, type);
this.$emit('pick', date);
},
cellRenderProxy: function cellRenderProxy(_ref3) {
var text = _ref3.text,
type = _ref3.type;
var h = this.$createElement;
var render = this.ykCalendar.$scopedSlots.dateCell;
if (!render) return h('span', [text]);
var day = this.getFormateDate(text, type);
var date = new Date(day);
var data = {
isSelected: this.selectedDay === day,
type: type + '-month',
day: day
};
return render({ date: date, data: data });
}
},
computed: {
WEEK_DAYS: function WEEK_DAYS() {
return Object(date_util["j" /* getI18nSettings */])().dayNames;
},
prevMonthDatePrefix: function prevMonthDatePrefix() {
var temp = new Date(this.date.getTime());
temp.setDate(0);
return date_default.a.format(temp, 'yyyy-MM');
},
curMonthDatePrefix: function curMonthDatePrefix() {
return date_default.a.format(this.date, 'yyyy-MM');
},
nextMonthDatePrefix: function nextMonthDatePrefix() {
var temp = new Date(this.date.getFullYear(), this.date.getMonth() + 1, 1);
return date_default.a.format(temp, 'yyyy-MM');
},
formatedToday: function formatedToday() {
return this.ykCalendar.formatedToday;
},
isInRange: function isInRange() {
return this.range && this.range.length;
},
rows: function rows() {
var days = [];
// if range exists, should render days in range.
if (this.isInRange) {
var _range = this.range,
start = _range[0],
end = _range[1];
var currentMonthRange = Object(date_util["D" /* range */])(end.getDate() - start.getDate() + 1).map(function (_, index) {
return {
text: start.getDate() + index,
type: 'current'
};
});
var remaining = currentMonthRange.length % 7;
remaining = remaining === 0 ? 0 : 7 - remaining;
var nextMonthRange = Object(date_util["D" /* range */])(remaining).map(function (_, index) {
return {
text: index + 1,
type: 'next'
};
});
days = currentMonthRange.concat(nextMonthRange);
} else {
var date = this.date;
var firstDay = Object(date_util["i" /* getFirstDayOfMonth */])(date);
firstDay = firstDay === 0 ? 7 : firstDay;
var firstDayOfWeek = typeof this.firstDayOfWeek === 'number' ? this.firstDayOfWeek : 1;
var offset = (7 + firstDay - firstDayOfWeek) % 7;
var prevMonthDays = Object(date_util["l" /* getPrevMonthLastDays */])(date, offset).map(function (day) {
return {
text: day,
type: 'prev'
};
});
var currentMonthDays = Object(date_util["k" /* getMonthDays */])(date).map(function (day) {
return {
text: day,
type: 'current'
};
});
days = [].concat(prevMonthDays, currentMonthDays);
var nextMonthDays = Object(date_util["D" /* range */])(42 - days.length).map(function (_, index) {
return {
text: index + 1,
type: 'next'
};
});
days = days.concat(nextMonthDays);
}
return this.toNestedArr(days);
},
weekDays: function weekDays() {
var start = this.firstDayOfWeek;
var WEEK_DAYS = this.WEEK_DAYS;
if (typeof start !== 'number' || start === 0) {
return WEEK_DAYS.slice();
} else {
return WEEK_DAYS.slice(start).concat(WEEK_DAYS.slice(0, start));
}
}
},
render: function render() {
var _this = this;
var h = arguments[0];
var thead = this.hideHeader ? null : h('thead', [this.weekDays.map(function (day) {
return h(
'th',
{ key: day },
[day]
);
})]);
return h(
'table',
{
'class': {
'yk-calendar-table': true,
'is-range': this.isInRange
},
attrs: { cellspacing: '0',
cellpadding: '0' }
},
[thead, h('tbody', [this.rows.map(function (row, index) {
return h(
'tr',
{
'class': {
'yk-calendar-table__row': true,
'yk-calendar-table__row--hide-border': index === 0 && _this.hideHeader
},
key: index },
[row.map(function (cell, key) {
return h(
'td',
{ key: key,
'class': _this.getCellClass(cell),
on: {
'click': _this.pickDay.bind(_this, cell)
}
},
[h(
'div',
{ 'class': 'yk-calendar-day' },
[_this.cellRenderProxy(cell)]
)]
);
})]
);
})])]
);
}
});
// CONCATENATED MODULE: ./packages/calendar/src/date-table.vue?vue&type=script&lang=js&
/* harmony default export */ var src_date_tablevue_type_script_lang_js_ = (date_tablevue_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/calendar/src/date-table.vue
var date_table_render, date_table_staticRenderFns
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
src_date_tablevue_type_script_lang_js_,
date_table_render,
date_table_staticRenderFns,
false,
null,
null,
null
)
/* hot reload */
if (false) { var api; }
component.options.__file = "packages/calendar/src/date-table.vue"
/* harmony default export */ var date_table = (component.exports);
// 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/calendar/src/main.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
var validTypes = ['prev-month', 'today', 'next-month'];
var weekDays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
var oneDay = 86400000;
/* harmony default export */ var mainvue_type_script_lang_js_ = ({
name: 'YkCalendar',
mixins: [locale["a" /* default */]],
components: {
DateTable: date_table,
YkButton: packages_button["default"],
ElButtonGroup: button_group["default"]
},
props: {
value: [Date, String, Number],
range: {
type: Array,
validator: function validator(range) {
if (Array.isArray(range)) {
return range.length === 2 && range.every(function (item) {
return typeof item === 'string' || typeof item === 'number' || item instanceof Date;
});
} else {
return true;
}
}
},
firstDayOfWeek: {
type: Number,
default: 1
}
},
provide: function provide() {
return {
ykCalendar: this
};
},
methods: {
pickDay: function pickDay(day) {
this.realSelectedDay = day;
},
selectDate: function selectDate(type) {
if (validTypes.indexOf(type) === -1) {
throw new Error('invalid type ' + type);
}
var day = '';
if (type === 'prev-month') {
day = this.prevMonthDatePrefix + '-01';
} else if (type === 'next-month') {
day = this.nextMonthDatePrefix + '-01';
} else {
day = this.formatedToday;
}
if (day === this.formatedDate) return;
this.pickDay(day);
},
toDate: function toDate(val) {
if (!val) {
throw new Error('invalid val');
}
return val instanceof Date ? val : new Date(val);
},
rangeValidator: function rangeValidator(date, isStart) {
var firstDayOfWeek = this.realFirstDayOfWeek;
var expected = isStart ? firstDayOfWeek : firstDayOfWeek === 0 ? 6 : firstDayOfWeek - 1;
var message = (isStart ? 'start' : 'end') + ' of range should be ' + weekDays[expected] + '.';
if (date.getDay() !== expected) {
console.warn('[ElementCalendar]', message, 'Invalid range will be ignored.');
return false;
}
return true;
}
},
computed: {
prevMonthDatePrefix: function prevMonthDatePrefix() {
var temp = new Date(this.date.getTime());
temp.setDate(0);
return date_default.a.format(temp, 'yyyy-MM');
},
curMonthDatePrefix: function curMonthDatePrefix() {
return date_default.a.format(this.date, 'yyyy-MM');
},
nextMonthDatePrefix: function nextMonthDatePrefix() {
var temp = new Date(this.date.getFullYear(), this.date.getMonth() + 1, 1);
return date_default.a.format(temp, 'yyyy-MM');
},
formatedDate: function formatedDate() {
return date_default.a.format(this.date, 'yyyy-MM-dd');
},
i18nDate: function i18nDate() {
var year = this.date.getFullYear();
var month = this.date.getMonth() + 1;
return year + ' ' + this.t('el.datepicker.year') + ' ' + this.t('el.datepicker.month' + month);
},
formatedToday: function formatedToday() {
return date_default.a.format(this.now, 'yyyy-MM-dd');
},
realSelectedDay: {
get: function get() {
if (!this.value) return this.selectedDay;
return this.formatedDate;
},
set: function set(val) {
this.selectedDay = val;
var date = new Date(val);
this.$emit('input', date);
}
},
date: function date() {
if (!this.value) {
if (this.realSelectedDay) {
var d = this.selectedDay.split('-');
return new Date(d[0], d[1] - 1, d[2]);
} else if (this.validatedRange.length) {
return this.validatedRange[0][0];
}
return this.now;
} else {
return this.toDate(this.value);
}
},
// if range is valid, we get a two-digit array
validatedRange: function validatedRange() {
var _this = this;
var range = this.range;
if (!range) return [];
range = range.reduce(function (prev, val, index) {
var date = _this.toDate(val);
if (_this.rangeValidator(date, index === 0)) {
prev = prev.concat(date);
}
return prev;
}, []);
if (range.length === 2) {
var _range = range,
start = _range[0],
end = _range[1];
if (start > end) {
console.warn('[ElementCalendar]end time should be greater than start time');
return [];
}
// start time and end time in one month
if (Object(date_util["F" /* validateRangeInOneMonth */])(start, end)) {
return [[start, end]];
}
var data = [];
var startDay = new Date(start.getFullYear(), start.getMonth() + 1, 1);
var lastDay = this.toDate(startDay.getTime() - oneDay);
if (!Object(date_util["F" /* validateRangeInOneMonth */])(startDay, end)) {
console.warn('[ElementCalendar]start time and end time interval must not exceed two months');
return [];
}
// 第一个月的时间范围
data.push([start, lastDay]);
// 下一月的时间范围,需要计算一下该月的第一个周起始日
var firstDayOfWeek = this.realFirstDayOfWeek;
var nextMontFirstDay = startDay.getDay();
var interval = 0;
if (nextMontFirstDay !== firstDayOfWeek) {
if (firstDayOfWeek === 0) {
interval = 7 - nextMontFirstDay;
} else {
interval = firstDayOfWeek - nextMontFirstDay;
interval = interval > 0 ? interval : 7 + interval;
}
}
startDay = this.toDate(startDay.getTime() + interval * oneDay);
if (startDay.getDate() < end.getDate()) {
data.push([startDay, end]);
}
return data;
}
return [];
},
realFirstDayOfWeek: function realFirstDayOfWeek() {
if (this.firstDayOfWeek < 1 || this.firstDayOfWeek > 6) {
return 0;
}
return Math.floor(this.firstDayOfWeek);
}
},
data: function data() {
return {
selectedDay: '',
now: new Date()
};
}
});
// CONCATENATED MODULE: ./packages/calendar/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/calendar/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/calendar/src/main.vue"
/* harmony default export */ var main = (main_component.exports);
// CONCATENATED MODULE: ./packages/calendar/index.js
/* istanbul ignore next */
main.install = function (Vue) {
Vue.component(main.name, main);
};
/* harmony default export */ var calendar = __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 });
/***/ }),
/***/ 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);
}
}
});
/***/ }),
/***/ 17:
/***/ (function(module, exports) {
module.exports = require("deepmerge");
/***/ }),
/***/ 2:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
/* globals __VUE_SSR_CONTEXT__ */
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
// This module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle.
function normalizeComponent (
scriptExports,
render,
staticRenderFns,
functionalTemplate,
injectStyles,
scopeId,
moduleIdentifier, /* server only */
shadowMode /* vue-cli only */
) {
// Vue.extend constructor export interop
var options = typeof scriptExports === 'function'
? scriptExports.options
: scriptExports
// render functions
if (render) {
options.render = render
options.staticRenderFns = staticRenderFns
options._compiled = true
}
// functional template
if (functionalTemplate) {
options.functional = true
}
// scopedId
if (scopeId) {
options._scopeId = 'data-v-' + scopeId
}
var hook
if (moduleIdentifier) { // server build
hook = function (context) {
// 2.3 injection
context =
context || // cached call
(this.$vnode && this.$vnode.ssrContext) || // stateful
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
// 2.2 with runInNewContext: true
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
context = __VUE_SSR_CONTEXT__
}
// inject component styles
if (injectStyles) {
injectStyles.call(this, context)
}
// register component module identifier for async chunk inferrence
if (context && context._registeredComponents) {
context._registeredComponents.add(moduleIdentifier)
}
}
// used by ssr in case component is cached and beforeCreate
// never gets called
options._ssrRegister = hook
} else if (injectStyles) {
hook = shadowMode
? function () {
injectStyles.call(
this,
(options.functional ? this.parent : this).$root.$options.shadowRoot
)
}
: injectStyles
}
if (hook) {
if (options.functional) {
// for template-only hot-reload because in that case the render fn doesn't
// go through the normalizer
options._injectStyles = hook
// register for functional component in vue file
var originalRender = options.render
options.render = function renderWithStyleInjection (h, context) {
hook.call(context)
return originalRender(h, context)
}
} else {
// inject component registration as beforeCreate hook
var existing = options.beforeCreate
options.beforeCreate = existing
? [].concat(existing, hook)
: [hook]
}
}
return {
exports: scriptExports,
options: options
}
}
/***/ }),
/***/ 22:
/***/ (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/button/src/button.vue?vue&type=template&id=ca859fb4&
var render = function () {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c(
"button",
{
staticClass: "yk-button",
class: [
_vm.type ? "yk-button--" + _vm.type : "",
_vm.buttonSize ? "yk-button--" + _vm.buttonSize : "",
{
"is-disabled": _vm.buttonDisabled,
"is-loading": _vm.loading,
"is-plain": _vm.plain,
"is-round": _vm.round,
"is-circle": _vm.circle,
},
],
attrs: {
disabled: _vm.buttonDisabled || _vm.loading,
autofocus: _vm.autofocus,
type: _vm.nativeType,
},
on: { click: _vm.handleClick },
},
[
_vm.icon && !_vm.loading ? _c("i", { class: _vm.icon }) : _vm._e(),
_vm.$slots.default ? _c("span", [_vm._t("default")], 2) : _vm._e(),
_vm.loading
? _c("i", {
staticClass: "el-icon-loading",
staticStyle: { "margin-left": "7px" },
})
: _vm._e(),
]
)
}
var staticRenderFns = []
render._withStripped = true
// CONCATENATED MODULE: ./packages/button/src/button.vue?vue&type=template&id=ca859fb4&
// 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/button/src/button.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var buttonvue_type_script_lang_js_ = ({
name: 'YkButton',
inject: {
ykForm: {
default: ''
},
ykFormItem: {
default: ''
}
},
props: {
type: {
type: String,
default: 'default'
},
size: String,
icon: {
type: String,
default: ''
},
nativeType: {
type: String,
default: 'button'
},
loading: Boolean,
disabled: Boolean,
plain: Boolean,
autofocus: Boolean,
round: Boolean,
circle: Boolean
},
mounted: function mounted() {
this.setIconOnly();
this.setDropdown();
},
computed: {
_ykFormItemSize: function _ykFormItemSize() {
return (this.ykFormItem || {}).ykFormItemSize;
},
buttonSize: function buttonSize() {
return this.size || this._ykFormItemSize || (this.$ELEMENT || {}).size;
},
buttonDisabled: function buttonDisabled() {
return this.disabled || (this.ykForm || {}).disabled;
}
},
methods: {
handleClick: function handleClick(evt) {
this.$emit('click', evt);
},
setIconOnly: function setIconOnly() {
var ButtonList = document.querySelectorAll('.yk-button');
ButtonList.forEach(function (button) {
if (button.children.length === 1) {
var isIconOnly = false;
var el = button.children[0];
if (el.length === 0) {
isIconOnly = el.className.indexOf('icon') > -1;
} else {
if (el.children && el.children.length === 1) {
isIconOnly = el.children[0].className && el.children[0].className.indexOf('icon') > -1;
} else {
isIconOnly = el.className && el.className.indexOf('icon') > -1;
}
}
if (isIconOnly) button.classList.add('is-iconOnly');
}
});
},
setDropdown: function setDropdown() {
var ButtonList = document.querySelectorAll('.yk-button-group');
ButtonList.forEach(function (button) {
var ary = Array.from(button.children);
ary.map(function (child) {
if (child.className && child.className.indexOf('is-iconOnly') > -1) {
if (child.children[0] && child.children[0].className.indexOf('down') > -1) {
child.classList.add('is-downIcon');
}
if (child.children[0].children && child.children[0].children.length === 1) {
if (child.children[0].children[0].className.indexOf('down') > -1) {
child.classList.add('is-downIcon');
}
}
}
});
});
}
}
});
// CONCATENATED MODULE: ./packages/button/src/button.vue?vue&type=script&lang=js&
/* harmony default export */ var src_buttonvue_type_script_lang_js_ = (buttonvue_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/button/src/button.vue
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
src_buttonvue_type_script_lang_js_,
render,
staticRenderFns,
false,
null,
null,
null
)
/* hot reload */
if (false) { var api; }
component.options.__file = "packages/button/src/button.vue"
/* harmony default export */ var src_button = (component.exports);
// CONCATENATED MODULE: ./packages/button/index.js
/* istanbul ignore next */
src_button.install = function (Vue) {
Vue.component(src_button.name, src_button);
};
/* harmony default export */ var packages_button = __webpack_exports__["default"] = (src_button);
/***/ }),
/***/ 23:
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/* Modified from https://github.com/taylorhakes/fecha
*
* The MIT License (MIT)
*
* Copyright (c) 2015 Taylor Hakes
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/*eslint-disable*/
// 把 YYYY-MM-DD 改成了 yyyy-MM-dd
(function (main) {
'use strict';
/**
* Parse or format dates
* @class fecha
*/
var fecha = {};
var token = /d{1,4}|M{1,4}|yy(?:yy)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g;
var twoDigits = '\\d\\d?';
var threeDigits = '\\d{3}';
var fourDigits = '\\d{4}';
var word = '[^\\s]+';
var literal = /\[([^]*?)\]/gm;
var noop = function noop() {};
function regexEscape(str) {
return str.replace(/[|\\{()[^$+*?.-]/g, '\\$&');
}
function shorten(arr, sLen) {
var newArr = [];
for (var i = 0, len = arr.length; i < len; i++) {
newArr.push(arr[i].substr(0, sLen));
}
return newArr;
}
function monthUpdate(arrName) {
return function (d, v, i18n) {
var index = i18n[arrName].indexOf(v.charAt(0).toUpperCase() + v.substr(1).toLowerCase());
if (~index) {
d.month = index;
}
};
}
function pad(val, len) {
val = String(val);
len = len || 2;
while (val.length < len) {
val = '0' + val;
}
return val;
}
var dayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
var monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
var monthNamesShort = shorten(monthNames, 3);
var dayNamesShort = shorten(dayNames, 3);
fecha.i18n = {
dayNamesShort: dayNamesShort,
dayNames: dayNames,
monthNamesShort: monthNamesShort,
monthNames: monthNames,
amPm: ['am', 'pm'],
DoFn: function DoFn(D) {
return D + ['th', 'st', 'nd', 'rd'][D % 10 > 3 ? 0 : (D - D % 10 !== 10) * D % 10];
}
};
var formatFlags = {
D: function D(dateObj) {
return dateObj.getDay();
},
DD: function DD(dateObj) {
return pad(dateObj.getDay());
},
Do: function Do(dateObj, i18n) {
return i18n.DoFn(dateObj.getDate());
},
d: function d(dateObj) {
return dateObj.getDate();
},
dd: function dd(dateObj) {
return pad(dateObj.getDate());
},
ddd: function ddd(dateObj, i18n) {
return i18n.dayNamesShort[dateObj.getDay()];
},
dddd: function dddd(dateObj, i18n) {
return i18n.dayNames[dateObj.getDay()];
},
M: function M(dateObj) {
return dateObj.getMonth() + 1;
},
MM: function MM(dateObj) {
return pad(dateObj.getMonth() + 1);
},
MMM: function MMM(dateObj, i18n) {
return i18n.monthNamesShort[dateObj.getMonth()];
},
MMMM: function MMMM(dateObj, i18n) {
return i18n.monthNames[dateObj.getMonth()];
},
yy: function yy(dateObj) {
return pad(String(dateObj.getFullYear()), 4).substr(2);
},
yyyy: function yyyy(dateObj) {
return pad(dateObj.getFullYear(), 4);
},
h: function h(dateObj) {
return dateObj.getHours() % 12 || 12;
},
hh: function hh(dateObj) {
return pad(dateObj.getHours() % 12 || 12);
},
H: function H(dateObj) {
return dateObj.getHours();
},
HH: function HH(dateObj) {
return pad(dateObj.getHours());
},
m: function m(dateObj) {
return dateObj.getMinutes();
},
mm: function mm(dateObj) {
return pad(dateObj.getMinutes());
},
s: function s(dateObj) {
return dateObj.getSeconds();
},
ss: function ss(dateObj) {
return pad(dateObj.getSeconds());
},
S: function S(dateObj) {
return Math.round(dateObj.getMilliseconds() / 100);
},
SS: function SS(dateObj) {
return pad(Math.round(dateObj.getMilliseconds() / 10), 2);
},
SSS: function SSS(dateObj) {
return pad(dateObj.getMilliseconds(), 3);
},
a: function a(dateObj, i18n) {
return dateObj.getHours() < 12 ? i18n.amPm[0] : i18n.amPm[1];
},
A: function A(dateObj, i18n) {
return dateObj.getHours() < 12 ? i18n.amPm[0].toUpperCase() : i18n.amPm[1].toUpperCase();
},
ZZ: function ZZ(dateObj) {
var o = dateObj.getTimezoneOffset();
return (o > 0 ? '-' : '+') + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4);
}
};
var parseFlags = {
d: [twoDigits, function (d, v) {
d.day = v;
}],
Do: [twoDigits + word, function (d, v) {
d.day = parseInt(v, 10);
}],
M: [twoDigits, function (d, v) {
d.month = v - 1;
}],
yy: [twoDigits, function (d, v) {
var da = new Date(),
cent = +('' + da.getFullYear()).substr(0, 2);
d.year = '' + (v > 68 ? cent - 1 : cent) + v;
}],
h: [twoDigits, function (d, v) {
d.hour = v;
}],
m: [twoDigits, function (d, v) {
d.minute = v;
}],
s: [twoDigits, function (d, v) {
d.second = v;
}],
yyyy: [fourDigits, function (d, v) {
d.year = v;
}],
S: ['\\d', function (d, v) {
d.millisecond = v * 100;
}],
SS: ['\\d{2}', function (d, v) {
d.millisecond = v * 10;
}],
SSS: [threeDigits, function (d, v) {
d.millisecond = v;
}],
D: [twoDigits, noop],
ddd: [word, noop],
MMM: [word, monthUpdate('monthNamesShort')],
MMMM: [word, monthUpdate('monthNames')],
a: [word, function (d, v, i18n) {
var val = v.toLowerCase();
if (val === i18n.amPm[0]) {
d.isPm = false;
} else if (val === i18n.amPm[1]) {
d.isPm = true;
}
}],
ZZ: ['[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z', function (d, v) {
var parts = (v + '').match(/([+-]|\d\d)/gi),
minutes;
if (parts) {
minutes = +(parts[1] * 60) + parseInt(parts[2], 10);
d.timezoneOffset = parts[0] === '+' ? minutes : -minutes;
}
}]
};
parseFlags.dd = parseFlags.d;
parseFlags.dddd = parseFlags.ddd;
parseFlags.DD = parseFlags.D;
parseFlags.mm = parseFlags.m;
parseFlags.hh = parseFlags.H = parseFlags.HH = parseFlags.h;
parseFlags.MM = parseFlags.M;
parseFlags.ss = parseFlags.s;
parseFlags.A = parseFlags.a;
// Some common format strings
fecha.masks = {
default: 'ddd MMM dd yyyy HH:mm:ss',
shortDate: 'M/D/yy',
mediumDate: 'MMM d, yyyy',
longDate: 'MMMM d, yyyy',
fullDate: 'dddd, MMMM d, yyyy',
shortTime: 'HH:mm',
mediumTime: 'HH:mm:ss',
longTime: 'HH:mm:ss.SSS'
};
/***
* Format a date
* @method format
* @param {Date|number} dateObj
* @param {string} mask Format of the date, i.e. 'mm-dd-yy' or 'shortDate'
*/
fecha.format = function (dateObj, mask, i18nSettings) {
var i18n = i18nSettings || fecha.i18n;
if (typeof dateObj === 'number') {
dateObj = new Date(dateObj);
}
if (Object.prototype.toString.call(dateObj) !== '[object Date]' || isNaN(dateObj.getTime())) {
throw new Error('Invalid Date in fecha.format');
}
mask = fecha.masks[mask] || mask || fecha.masks['default'];
var literals = [];
// Make literals inactive by replacing them with ??
mask = mask.replace(literal, function ($0, $1) {
literals.push($1);
return '@@@';
});
// Apply formatting rules
mask = mask.replace(token, function ($0) {
return $0 in formatFlags ? formatFlags[$0](dateObj, i18n) : $0.slice(1, $0.length - 1);
});
// Inline literal values back into the formatted value
return mask.replace(/@@@/g, function () {
return literals.shift();
});
};
/**
* Parse a date string into an object, changes - into /
* @method parse
* @param {string} dateStr Date string
* @param {string} format Date parse format
* @returns {Date|boolean}
*/
fecha.parse = function (dateStr, format, i18nSettings) {
var i18n = i18nSettings || fecha.i18n;
if (typeof format !== 'string') {
throw new Error('Invalid format in fecha.parse');
}
format = fecha.masks[format] || format;
// Avoid regular expression denial of service, fail early for really long strings
// https://www.owasp.org/index.php/Regular_expression_Denial_of_Service_-_ReDoS
if (dateStr.length > 1000) {
return null;
}
var dateInfo = {};
var parseInfo = [];
var literals = [];
format = format.replace(literal, function ($0, $1) {
literals.push($1);
return '@@@';
});
var newFormat = regexEscape(format).replace(token, function ($0) {
if (parseFlags[$0]) {
var info = parseFlags[$0];
parseInfo.push(info[1]);
return '(' + info[0] + ')';
}
return $0;
});
newFormat = newFormat.replace(/@@@/g, function () {
return literals.shift();
});
var matches = dateStr.match(new RegExp(newFormat, 'i'));
if (!matches) {
return null;
}
for (var i = 1; i < matches.length; i++) {
parseInfo[i - 1](dateInfo, matches[i], i18n);
}
var today = new Date();
if (dateInfo.isPm === true && dateInfo.hour != null && +dateInfo.hour !== 12) {
dateInfo.hour = +dateInfo.hour + 12;
} else if (dateInfo.isPm === false && +dateInfo.hour === 12) {
dateInfo.hour = 0;
}
var date;
if (dateInfo.timezoneOffset != null) {
dateInfo.minute = +(dateInfo.minute || 0) - +dateInfo.timezoneOffset;
date = new Date(Date.UTC(dateInfo.year || today.getFullYear(), dateInfo.month || 0, dateInfo.day || 1, dateInfo.hour || 0, dateInfo.minute || 0, dateInfo.second || 0, dateInfo.millisecond || 0));
} else {
date = new Date(dateInfo.year || today.getFullYear(), dateInfo.month || 0, dateInfo.day || 1, dateInfo.hour || 0, dateInfo.minute || 0, dateInfo.second || 0, dateInfo.millisecond || 0);
}
return date;
};
/* istanbul ignore next */
if ( true && module.exports) {
module.exports = fecha;
} else if (true) {
!(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
return fecha;
}).call(exports, __webpack