cy-element-ui 1.1.16 → 1.1.17
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/README.md +8 -8
- package/lib/{alert.js → Alert.js} +2 -2
- package/lib/{aside.js → Aside.js} +2 -2
- package/lib/Autocomplete.js +2051 -0
- package/lib/{avatar.js → Avatar.js} +2 -2
- package/lib/{backtop.js → Backtop.js} +4 -4
- package/lib/{badge.js → Badge.js} +2 -2
- package/lib/{breadcrumb.js → Breadcrumb.js} +2 -2
- package/lib/{breadcrumb-item.js → BreadcrumbItem.js} +2 -2
- package/lib/{button.js → Button.js} +2 -2
- package/lib/{button-group.js → ButtonGroup.js} +2 -2
- package/lib/{calendar.js → Calendar.js} +238 -25
- package/lib/{card.js → Card.js} +2 -2
- package/lib/{carousel.js → Carousel.js} +12 -12
- package/lib/{carousel-item.js → CarouselItem.js} +2 -2
- package/lib/Cascader.js +4641 -0
- package/lib/{cascader-panel.js → CascaderPanel.js} +1101 -57
- package/lib/{checkbox.js → Checkbox.js} +9 -9
- package/lib/{checkbox-button.js → CheckboxButton.js} +2 -2
- package/lib/{checkbox-group.js → CheckboxGroup.js} +9 -9
- package/lib/{col.js → Col.js} +2 -2
- package/lib/{collapse.js → Collapse.js} +2 -2
- package/lib/{collapse-item.js → CollapseItem.js} +4 -4
- package/lib/{color-picker.js → ColorPicker.js} +967 -25
- package/lib/{container.js → Container.js} +2 -2
- package/lib/{selectDisplayInput.js → CySelectDisplayInput.js} +8 -8
- package/lib/{subTitle.js → CySubTitle.js} +8 -8
- package/lib/{tabDialog.js → CyTabDialog.js} +26 -26
- package/lib/{treeSelect.js → CyTreeSelect.js} +3161 -3169
- package/lib/{date-picker.js → DatePicker.js} +1372 -139
- package/lib/{descriptions.js → Descriptions.js} +4 -4
- package/lib/{descriptions-item.js → DescriptionsItem.js} +2 -2
- package/lib/{dialog.js → Dialog.js} +12 -12
- package/lib/{divider.js → Divider.js} +2 -2
- package/lib/{drawer.js → Drawer.js} +4 -4
- package/lib/{dropdown.js → Dropdown.js} +244 -31
- package/lib/{dropdown-item.js → DropdownItem.js} +2 -2
- package/lib/{dropdown-menu.js → DropdownMenu.js} +2 -2
- package/lib/{empty.js → Empty.js} +4 -4
- package/lib/{footer.js → Footer.js} +2 -2
- package/lib/{form.js → Form.js} +10 -10
- package/lib/{form-item.js → FormItem.js} +12 -12
- package/lib/{header.js → Header.js} +2 -2
- package/lib/{icon.js → Icon.js} +2 -2
- package/lib/{image.js → Image.js} +22 -22
- package/lib/{infinite-scroll.js → InfiniteScroll.js} +16 -16
- package/lib/{input.js → Input.js} +27 -26
- package/lib/InputNumber.js +1552 -0
- package/lib/{link.js → Link.js} +2 -2
- package/lib/{loading.js → Loading.js} +15 -15
- package/lib/{main.js → Main.js} +2 -2
- package/lib/{menu.js → Menu.js} +10 -10
- package/lib/{menu-item.js → MenuItem.js} +339 -12
- package/lib/{menu-item-group.js → MenuItemGroup.js} +2 -2
- package/lib/{message.js → Message.js} +16 -16
- package/lib/{message-box.js → MessageBox.js} +973 -31
- package/lib/{notification.js → Notification.js} +11 -11
- package/lib/{option.js → Option.js} +11 -11
- package/lib/{option-group.js → OptionGroup.js} +2 -2
- package/lib/{page-header.js → PageHeader.js} +4 -4
- package/lib/Pagination.js +4123 -0
- package/lib/Popconfirm.js +1025 -0
- package/lib/{popover.js → Popover.js} +6 -6
- package/lib/{progress.js → Progress.js} +2 -2
- package/lib/{radio.js → Radio.js} +9 -9
- package/lib/{radio-button.js → RadioButton.js} +2 -2
- package/lib/{radio-group.js → RadioGroup.js} +2 -2
- package/lib/{rate.js → Rate.js} +20 -20
- package/lib/{result.js → Result.js} +2 -2
- package/lib/{row.js → Row.js} +2 -2
- package/lib/{scrollbar.js → Scrollbar.js} +26 -26
- package/lib/{select.js → Select.js} +1371 -170
- package/lib/{skeleton.js → Skeleton.js} +2 -2
- package/lib/{skeleton-item.js → SkeletonItem.js} +2 -2
- package/lib/Slider.js +2854 -0
- package/lib/{spinner.js → Spinner.js} +2 -2
- package/lib/{statistic.js → Statistic.js} +4 -4
- package/lib/{step.js → Step.js} +2 -2
- package/lib/{steps.js → Steps.js} +4 -4
- package/lib/{submenu.js → Submenu.js} +13 -13
- package/lib/{switch.js → Switch.js} +10 -10
- package/lib/{tab-pane.js → TabPane.js} +2 -2
- package/lib/{table.js → Table.js} +1231 -121
- package/lib/{table-column.js → TableColumn.js} +824 -295
- package/lib/{tabs.js → Tabs.js} +4 -4
- package/lib/{tag.js → Tag.js} +2 -2
- package/lib/{time-picker.js → TimePicker.js} +1183 -91
- package/lib/{time-select.js → TimeSelect.js} +1132 -26
- package/lib/{timeline.js → Timeline.js} +2 -2
- package/lib/{timeline-item.js → TimelineItem.js} +2 -2
- package/lib/{tooltip.js → Tooltip.js} +27 -27
- package/lib/Transfer.js +2557 -0
- package/lib/{tree.js → Tree.js} +436 -19
- package/lib/{upload.js → Upload.js} +411 -19
- package/lib/directives/mousewheel.js +26 -0
- package/lib/directives/repeat-click.js +33 -0
- package/lib/element-ui.common.js +32181 -32331
- package/lib/index.js +1 -1
- package/lib/locale/format.js +55 -0
- package/lib/locale/index.js +63 -0
- package/lib/locale/lang/zh-CN.js +126 -0
- package/lib/mixins/emitter.js +36 -0
- package/lib/mixins/focus.js +15 -0
- package/lib/mixins/locale.js +17 -0
- package/lib/mixins/migrating.js +69 -0
- package/lib/theme-chalk/BreadcrumbItem.css +0 -0
- package/lib/theme-chalk/ButtonGroup.css +0 -0
- package/lib/theme-chalk/CarouselItem.css +0 -0
- package/lib/theme-chalk/CascaderPanel.css +0 -0
- package/lib/theme-chalk/CheckboxButton.css +0 -0
- package/lib/theme-chalk/CheckboxGroup.css +0 -0
- package/lib/theme-chalk/CollapseItem.css +0 -0
- package/lib/theme-chalk/ColorPicker.css +0 -0
- package/lib/theme-chalk/DatePicker.css +0 -0
- package/lib/theme-chalk/DescriptionsItem.css +0 -0
- package/lib/theme-chalk/DropdownItem.css +0 -0
- package/lib/theme-chalk/DropdownMenu.css +0 -0
- package/lib/theme-chalk/FormItem.css +0 -0
- package/lib/theme-chalk/InputNumber.css +0 -0
- package/lib/theme-chalk/MenuItem.css +0 -0
- package/lib/theme-chalk/MenuItemGroup.css +0 -0
- package/lib/theme-chalk/MessageBox.css +0 -0
- package/lib/theme-chalk/OptionGroup.css +0 -0
- package/lib/theme-chalk/PageHeader.css +0 -0
- package/lib/theme-chalk/RadioButton.css +0 -0
- package/lib/theme-chalk/RadioGroup.css +0 -0
- package/lib/theme-chalk/SkeletonItem.css +0 -0
- package/lib/theme-chalk/TabPane.css +0 -0
- package/lib/theme-chalk/TableColumn.css +0 -0
- package/lib/theme-chalk/TimePicker.css +0 -0
- package/lib/theme-chalk/TimeSelect.css +0 -0
- package/lib/theme-chalk/TimelineItem.css +0 -0
- package/lib/transitions/collapse-transition.js +91 -0
- package/lib/utils/after-leave.js +35 -0
- package/lib/utils/aria-dialog.js +104 -0
- package/lib/utils/aria-utils.js +126 -0
- package/lib/utils/clickoutside.js +79 -0
- package/lib/utils/date-util.js +310 -0
- package/lib/utils/date.js +369 -0
- package/lib/utils/dom.js +234 -0
- package/lib/utils/lodash.js +9421 -0
- package/lib/utils/menu/aria-menubar.js +24 -0
- package/lib/utils/menu/aria-menuitem.js +62 -0
- package/lib/utils/menu/aria-submenu.js +69 -0
- package/lib/utils/merge.js +21 -0
- package/lib/utils/popper.js +1261 -0
- package/lib/utils/popup/index.js +233 -0
- package/lib/utils/popup/popup-manager.js +205 -0
- package/lib/utils/resize-event.js +59 -0
- package/lib/utils/scroll-into-view.js +38 -0
- package/lib/utils/scrollbar-width.js +39 -0
- package/lib/utils/shared.js +12 -0
- package/lib/utils/types.js +52 -0
- package/lib/utils/util.js +272 -0
- package/lib/utils/vdom.js +13 -0
- package/lib/utils/vue-popper.js +202 -0
- package/package.json +6 -23
- package/packages/{tabDialog → cy/tabDialog}/src/main.vue +1 -1
- package/packages/{treeSelect → cy/treeSelect}/src/main.vue +4 -4
- package/packages/theme-chalk/src/BreadcrumbItem.scss +0 -0
- package/packages/theme-chalk/src/ButtonGroup.scss +0 -0
- package/packages/theme-chalk/src/CarouselItem.scss +0 -0
- package/packages/theme-chalk/src/CascaderPanel.scss +0 -0
- package/packages/theme-chalk/src/CheckboxButton.scss +0 -0
- package/packages/theme-chalk/src/CheckboxGroup.scss +0 -0
- package/packages/theme-chalk/src/CollapseItem.scss +0 -0
- package/packages/theme-chalk/src/ColorPicker.scss +0 -0
- package/packages/theme-chalk/src/DatePicker.scss +0 -0
- package/packages/theme-chalk/src/DescriptionsItem.scss +0 -0
- package/packages/theme-chalk/src/DropdownItem.scss +0 -0
- package/packages/theme-chalk/src/DropdownMenu.scss +0 -0
- package/packages/theme-chalk/src/FormItem.scss +0 -0
- package/packages/theme-chalk/src/InputNumber.scss +0 -0
- package/packages/theme-chalk/src/MenuItem.scss +0 -0
- package/packages/theme-chalk/src/MenuItemGroup.scss +0 -0
- package/packages/theme-chalk/src/MessageBox.scss +0 -0
- package/packages/theme-chalk/src/OptionGroup.scss +0 -0
- package/packages/theme-chalk/src/PageHeader.scss +0 -0
- package/packages/theme-chalk/src/RadioButton.scss +0 -0
- package/packages/theme-chalk/src/RadioGroup.scss +0 -0
- package/packages/theme-chalk/src/SkeletonItem.scss +0 -0
- package/packages/theme-chalk/src/TabPane.scss +0 -0
- package/packages/theme-chalk/src/TableColumn.scss +0 -0
- package/packages/theme-chalk/src/TimePicker.scss +0 -0
- package/packages/theme-chalk/src/TimeSelect.scss +0 -0
- package/packages/theme-chalk/src/TimelineItem.scss +0 -0
- package/packages/theme-chalk/src/index.scss +89 -87
- package/src/index.js +15 -15
- package/types/cy/cy-element-ui.d.ts +31 -0
- package/types/cy/cy-select-display-input.d.ts +7 -0
- package/types/cy/cy-sub-title.d.ts +7 -0
- package/types/cy/cy-tab-dialog.d.ts +7 -0
- package/types/cy/cy-tree-select.d.ts +7 -0
- package/types/cy/index.d.ts +1 -0
- package/types/cy/select-display-input.d.ts +19 -0
- package/types/cy/sub-title.d.ts +10 -0
- package/types/cy/tab-dialog.d.ts +51 -0
- package/types/cy/tree-select.d.ts +44 -0
- package/types/index.d.ts +1 -0
- package/lib/autocomplete.js +0 -952
- package/lib/cascader.js +0 -1439
- package/lib/input-number.js +0 -757
- package/lib/pagination.js +0 -950
- package/lib/popconfirm.js +0 -457
- package/lib/slider.js +0 -1199
- package/lib/transfer.js +0 -1102
- package/lib/umd/locale/en.js +0 -142
- package/lib/umd/locale/zh-TW.js +0 -142
- package/src/locale/lang/en.js +0 -123
- package/src/locale/lang/zh-TW.js +0 -123
- /package/packages/{selectDisplayInput → cy/selectDisplayInput}/index.js +0 -0
- /package/packages/{selectDisplayInput → cy/selectDisplayInput}/src/main.vue +0 -0
- /package/packages/{subTitle → cy/subTitle}/index.js +0 -0
- /package/packages/{subTitle → cy/subTitle}/src/main.vue +0 -0
- /package/packages/{tabDialog → cy/tabDialog}/index.js +0 -0
- /package/packages/{tabDialog → cy/tabDialog}/src/dialog/drag.js +0 -0
- /package/packages/{tabDialog → cy/tabDialog}/src/dialog/dragHeight.js +0 -0
- /package/packages/{tabDialog → cy/tabDialog}/src/dialog/dragWidth.js +0 -0
- /package/packages/{treeSelect → cy/treeSelect}/index.js +0 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
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; };
|
|
6
|
+
|
|
7
|
+
exports.default = function (Vue) {
|
|
8
|
+
/**
|
|
9
|
+
* template
|
|
10
|
+
*
|
|
11
|
+
* @param {String} string
|
|
12
|
+
* @param {Array} ...args
|
|
13
|
+
* @return {String}
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
function template(string) {
|
|
17
|
+
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
18
|
+
args[_key - 1] = arguments[_key];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (args.length === 1 && _typeof(args[0]) === 'object') {
|
|
22
|
+
args = args[0];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (!args || !args.hasOwnProperty) {
|
|
26
|
+
args = {};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return string.replace(RE_NARGS, function (match, prefix, i, index) {
|
|
30
|
+
var result = void 0;
|
|
31
|
+
|
|
32
|
+
if (string[index - 1] === '{' && string[index + match.length] === '}') {
|
|
33
|
+
return i;
|
|
34
|
+
} else {
|
|
35
|
+
result = (0, _util.hasOwn)(args, i) ? args[i] : null;
|
|
36
|
+
if (result === null || result === undefined) {
|
|
37
|
+
return '';
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return template;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
var _util = require('element-ui/lib/utils/util');
|
|
49
|
+
|
|
50
|
+
var RE_NARGS = /(%|)\{([0-9a-zA-Z_]+)\}/g;
|
|
51
|
+
/**
|
|
52
|
+
* String format template
|
|
53
|
+
* - Inspired:
|
|
54
|
+
* https://github.com/Matt-Esch/string-template/index.js
|
|
55
|
+
*/
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.i18n = exports.use = exports.t = undefined;
|
|
5
|
+
|
|
6
|
+
var _zhCN = require('element-ui/lib/locale/lang/zh-CN');
|
|
7
|
+
|
|
8
|
+
var _zhCN2 = _interopRequireDefault(_zhCN);
|
|
9
|
+
|
|
10
|
+
var _vue = require('vue');
|
|
11
|
+
|
|
12
|
+
var _vue2 = _interopRequireDefault(_vue);
|
|
13
|
+
|
|
14
|
+
var _deepmerge = require('deepmerge');
|
|
15
|
+
|
|
16
|
+
var _deepmerge2 = _interopRequireDefault(_deepmerge);
|
|
17
|
+
|
|
18
|
+
var _format = require('./format');
|
|
19
|
+
|
|
20
|
+
var _format2 = _interopRequireDefault(_format);
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
24
|
+
var format = (0, _format2.default)(_vue2.default);
|
|
25
|
+
var lang = _zhCN2.default;
|
|
26
|
+
var merged = false;
|
|
27
|
+
var i18nHandler = function i18nHandler() {
|
|
28
|
+
var vuei18n = Object.getPrototypeOf(this || _vue2.default).$t;
|
|
29
|
+
if (typeof vuei18n === 'function' && !!_vue2.default.locale) {
|
|
30
|
+
if (!merged) {
|
|
31
|
+
merged = true;
|
|
32
|
+
_vue2.default.locale(_vue2.default.config.lang, (0, _deepmerge2.default)(lang, _vue2.default.locale(_vue2.default.config.lang) || {}, { clone: true }));
|
|
33
|
+
}
|
|
34
|
+
return vuei18n.apply(this, arguments);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
var t = exports.t = function t(path, options) {
|
|
39
|
+
var value = i18nHandler.apply(this, arguments);
|
|
40
|
+
if (value !== null && value !== undefined) return value;
|
|
41
|
+
|
|
42
|
+
var array = path.split('.');
|
|
43
|
+
var current = lang;
|
|
44
|
+
|
|
45
|
+
for (var i = 0, j = array.length; i < j; i++) {
|
|
46
|
+
var property = array[i];
|
|
47
|
+
value = current[property];
|
|
48
|
+
if (i === j - 1) return format(value, options);
|
|
49
|
+
if (!value) return '';
|
|
50
|
+
current = value;
|
|
51
|
+
}
|
|
52
|
+
return '';
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
var use = exports.use = function use(l) {
|
|
56
|
+
lang = l || lang;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
var i18n = exports.i18n = function i18n(fn) {
|
|
60
|
+
i18nHandler = fn || i18nHandler;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
exports.default = { use: use, t: t, i18n: i18n };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = {
|
|
5
|
+
el: {
|
|
6
|
+
colorpicker: {
|
|
7
|
+
confirm: '确定',
|
|
8
|
+
clear: '清空'
|
|
9
|
+
},
|
|
10
|
+
datepicker: {
|
|
11
|
+
now: '此刻',
|
|
12
|
+
today: '今天',
|
|
13
|
+
cancel: '取消',
|
|
14
|
+
clear: '清空',
|
|
15
|
+
confirm: '确定',
|
|
16
|
+
selectDate: '选择日期',
|
|
17
|
+
selectTime: '选择时间',
|
|
18
|
+
startDate: '开始日期',
|
|
19
|
+
startTime: '开始时间',
|
|
20
|
+
endDate: '结束日期',
|
|
21
|
+
endTime: '结束时间',
|
|
22
|
+
prevYear: '前一年',
|
|
23
|
+
nextYear: '后一年',
|
|
24
|
+
prevMonth: '上个月',
|
|
25
|
+
nextMonth: '下个月',
|
|
26
|
+
year: '年',
|
|
27
|
+
month1: '1 月',
|
|
28
|
+
month2: '2 月',
|
|
29
|
+
month3: '3 月',
|
|
30
|
+
month4: '4 月',
|
|
31
|
+
month5: '5 月',
|
|
32
|
+
month6: '6 月',
|
|
33
|
+
month7: '7 月',
|
|
34
|
+
month8: '8 月',
|
|
35
|
+
month9: '9 月',
|
|
36
|
+
month10: '10 月',
|
|
37
|
+
month11: '11 月',
|
|
38
|
+
month12: '12 月',
|
|
39
|
+
// week: '周次',
|
|
40
|
+
weeks: {
|
|
41
|
+
sun: '日',
|
|
42
|
+
mon: '一',
|
|
43
|
+
tue: '二',
|
|
44
|
+
wed: '三',
|
|
45
|
+
thu: '四',
|
|
46
|
+
fri: '五',
|
|
47
|
+
sat: '六'
|
|
48
|
+
},
|
|
49
|
+
months: {
|
|
50
|
+
jan: '一月',
|
|
51
|
+
feb: '二月',
|
|
52
|
+
mar: '三月',
|
|
53
|
+
apr: '四月',
|
|
54
|
+
may: '五月',
|
|
55
|
+
jun: '六月',
|
|
56
|
+
jul: '七月',
|
|
57
|
+
aug: '八月',
|
|
58
|
+
sep: '九月',
|
|
59
|
+
oct: '十月',
|
|
60
|
+
nov: '十一月',
|
|
61
|
+
dec: '十二月'
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
select: {
|
|
65
|
+
loading: '加载中',
|
|
66
|
+
noMatch: '无匹配数据',
|
|
67
|
+
noData: '无数据',
|
|
68
|
+
placeholder: '请选择'
|
|
69
|
+
},
|
|
70
|
+
cascader: {
|
|
71
|
+
noMatch: '无匹配数据',
|
|
72
|
+
loading: '加载中',
|
|
73
|
+
placeholder: '请选择',
|
|
74
|
+
noData: '暂无数据'
|
|
75
|
+
},
|
|
76
|
+
pagination: {
|
|
77
|
+
goto: '前往',
|
|
78
|
+
pagesize: '条/页',
|
|
79
|
+
total: '共 {total} 条',
|
|
80
|
+
pageClassifier: '页'
|
|
81
|
+
},
|
|
82
|
+
messagebox: {
|
|
83
|
+
title: '提示',
|
|
84
|
+
confirm: '确定',
|
|
85
|
+
cancel: '取消',
|
|
86
|
+
error: '输入的数据不合法!'
|
|
87
|
+
},
|
|
88
|
+
upload: {
|
|
89
|
+
deleteTip: '按 delete 键可删除',
|
|
90
|
+
delete: '删除',
|
|
91
|
+
preview: '查看图片',
|
|
92
|
+
continue: '继续上传'
|
|
93
|
+
},
|
|
94
|
+
table: {
|
|
95
|
+
emptyText: '暂无数据',
|
|
96
|
+
confirmFilter: '筛选',
|
|
97
|
+
resetFilter: '重置',
|
|
98
|
+
clearFilter: '全部',
|
|
99
|
+
sumText: '合计'
|
|
100
|
+
},
|
|
101
|
+
tree: {
|
|
102
|
+
emptyText: '暂无数据'
|
|
103
|
+
},
|
|
104
|
+
transfer: {
|
|
105
|
+
noMatch: '无匹配数据',
|
|
106
|
+
noData: '无数据',
|
|
107
|
+
titles: ['列表 1', '列表 2'],
|
|
108
|
+
filterPlaceholder: '请输入搜索内容',
|
|
109
|
+
noCheckedFormat: '共 {total} 项',
|
|
110
|
+
hasCheckedFormat: '已选 {checked}/{total} 项'
|
|
111
|
+
},
|
|
112
|
+
image: {
|
|
113
|
+
error: '加载失败'
|
|
114
|
+
},
|
|
115
|
+
pageHeader: {
|
|
116
|
+
title: '返回'
|
|
117
|
+
},
|
|
118
|
+
popconfirm: {
|
|
119
|
+
confirmButtonText: '确定',
|
|
120
|
+
cancelButtonText: '取消'
|
|
121
|
+
},
|
|
122
|
+
empty: {
|
|
123
|
+
description: '暂无数据'
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
function _broadcast(componentName, eventName, params) {
|
|
5
|
+
this.$children.forEach(function (child) {
|
|
6
|
+
var name = child.$options.componentName;
|
|
7
|
+
|
|
8
|
+
if (name === componentName) {
|
|
9
|
+
child.$emit.apply(child, [eventName].concat(params));
|
|
10
|
+
} else {
|
|
11
|
+
_broadcast.apply(child, [componentName, eventName].concat([params]));
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
exports.default = {
|
|
16
|
+
methods: {
|
|
17
|
+
dispatch: function dispatch(componentName, eventName, params) {
|
|
18
|
+
var parent = this.$parent || this.$root;
|
|
19
|
+
var name = parent.$options.componentName;
|
|
20
|
+
|
|
21
|
+
while (parent && (!name || name !== componentName)) {
|
|
22
|
+
parent = parent.$parent;
|
|
23
|
+
|
|
24
|
+
if (parent) {
|
|
25
|
+
name = parent.$options.componentName;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (parent) {
|
|
29
|
+
parent.$emit.apply(parent, [eventName].concat(params));
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
broadcast: function broadcast(componentName, eventName, params) {
|
|
33
|
+
_broadcast.call(this, componentName, eventName, params);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
var _locale = require('element-ui/lib/locale');
|
|
6
|
+
|
|
7
|
+
exports.default = {
|
|
8
|
+
methods: {
|
|
9
|
+
t: function t() {
|
|
10
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
11
|
+
args[_key] = arguments[_key];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return _locale.t.apply(this, args);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
var _util = require('element-ui/lib/utils/util');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Show migrating guide in browser console.
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* import Migrating from 'element-ui/src/mixins/migrating';
|
|
12
|
+
*
|
|
13
|
+
* mixins: [Migrating]
|
|
14
|
+
*
|
|
15
|
+
* add getMigratingConfig method for your component.
|
|
16
|
+
* getMigratingConfig() {
|
|
17
|
+
* return {
|
|
18
|
+
* props: {
|
|
19
|
+
* 'allow-no-selection': 'allow-no-selection is removed.',
|
|
20
|
+
* 'selection-mode': 'selection-mode is removed.'
|
|
21
|
+
* },
|
|
22
|
+
* events: {
|
|
23
|
+
* selectionchange: 'selectionchange is renamed to selection-change.'
|
|
24
|
+
* }
|
|
25
|
+
* };
|
|
26
|
+
* },
|
|
27
|
+
*/
|
|
28
|
+
exports.default = {
|
|
29
|
+
mounted: function mounted() {
|
|
30
|
+
if (process.env.NODE_ENV === 'production') return;
|
|
31
|
+
if (!this.$vnode) return;
|
|
32
|
+
|
|
33
|
+
var _getMigratingConfig = this.getMigratingConfig(),
|
|
34
|
+
_getMigratingConfig$p = _getMigratingConfig.props,
|
|
35
|
+
props = _getMigratingConfig$p === undefined ? {} : _getMigratingConfig$p,
|
|
36
|
+
_getMigratingConfig$e = _getMigratingConfig.events,
|
|
37
|
+
events = _getMigratingConfig$e === undefined ? {} : _getMigratingConfig$e;
|
|
38
|
+
|
|
39
|
+
var _$vnode = this.$vnode,
|
|
40
|
+
data = _$vnode.data,
|
|
41
|
+
componentOptions = _$vnode.componentOptions;
|
|
42
|
+
|
|
43
|
+
var definedProps = data.attrs || {};
|
|
44
|
+
var definedEvents = componentOptions.listeners || {};
|
|
45
|
+
|
|
46
|
+
for (var propName in definedProps) {
|
|
47
|
+
propName = (0, _util.kebabCase)(propName); // compatible with camel case
|
|
48
|
+
if (props[propName]) {
|
|
49
|
+
console.warn('[Element Migrating][' + this.$options.name + '][Attribute]: ' + props[propName]);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
for (var eventName in definedEvents) {
|
|
54
|
+
eventName = (0, _util.kebabCase)(eventName); // compatible with camel case
|
|
55
|
+
if (events[eventName]) {
|
|
56
|
+
console.warn('[Element Migrating][' + this.$options.name + '][Event]: ' + events[eventName]);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
methods: {
|
|
62
|
+
getMigratingConfig: function getMigratingConfig() {
|
|
63
|
+
return {
|
|
64
|
+
props: {},
|
|
65
|
+
events: {}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
var _dom = require('element-ui/lib/utils/dom');
|
|
6
|
+
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
+
|
|
9
|
+
var Transition = function () {
|
|
10
|
+
function Transition() {
|
|
11
|
+
_classCallCheck(this, Transition);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
Transition.prototype.beforeEnter = function beforeEnter(el) {
|
|
15
|
+
(0, _dom.addClass)(el, 'collapse-transition');
|
|
16
|
+
if (!el.dataset) el.dataset = {};
|
|
17
|
+
|
|
18
|
+
el.dataset.oldPaddingTop = el.style.paddingTop;
|
|
19
|
+
el.dataset.oldPaddingBottom = el.style.paddingBottom;
|
|
20
|
+
|
|
21
|
+
el.style.height = '0';
|
|
22
|
+
el.style.paddingTop = 0;
|
|
23
|
+
el.style.paddingBottom = 0;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
Transition.prototype.enter = function enter(el) {
|
|
27
|
+
el.dataset.oldOverflow = el.style.overflow;
|
|
28
|
+
if (el.scrollHeight !== 0) {
|
|
29
|
+
el.style.height = el.scrollHeight + 'px';
|
|
30
|
+
el.style.paddingTop = el.dataset.oldPaddingTop;
|
|
31
|
+
el.style.paddingBottom = el.dataset.oldPaddingBottom;
|
|
32
|
+
} else {
|
|
33
|
+
el.style.height = '';
|
|
34
|
+
el.style.paddingTop = el.dataset.oldPaddingTop;
|
|
35
|
+
el.style.paddingBottom = el.dataset.oldPaddingBottom;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
el.style.overflow = 'hidden';
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
Transition.prototype.afterEnter = function afterEnter(el) {
|
|
42
|
+
// for safari: remove class then reset height is necessary
|
|
43
|
+
(0, _dom.removeClass)(el, 'collapse-transition');
|
|
44
|
+
el.style.height = '';
|
|
45
|
+
el.style.overflow = el.dataset.oldOverflow;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
Transition.prototype.beforeLeave = function beforeLeave(el) {
|
|
49
|
+
if (!el.dataset) el.dataset = {};
|
|
50
|
+
el.dataset.oldPaddingTop = el.style.paddingTop;
|
|
51
|
+
el.dataset.oldPaddingBottom = el.style.paddingBottom;
|
|
52
|
+
el.dataset.oldOverflow = el.style.overflow;
|
|
53
|
+
|
|
54
|
+
el.style.height = el.scrollHeight + 'px';
|
|
55
|
+
el.style.overflow = 'hidden';
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
Transition.prototype.leave = function leave(el) {
|
|
59
|
+
if (el.scrollHeight !== 0) {
|
|
60
|
+
// for safari: add class after set height, or it will jump to zero height suddenly, weired
|
|
61
|
+
(0, _dom.addClass)(el, 'collapse-transition');
|
|
62
|
+
el.style.height = 0;
|
|
63
|
+
el.style.paddingTop = 0;
|
|
64
|
+
el.style.paddingBottom = 0;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
Transition.prototype.afterLeave = function afterLeave(el) {
|
|
69
|
+
(0, _dom.removeClass)(el, 'collapse-transition');
|
|
70
|
+
el.style.height = '';
|
|
71
|
+
el.style.overflow = el.dataset.oldOverflow;
|
|
72
|
+
el.style.paddingTop = el.dataset.oldPaddingTop;
|
|
73
|
+
el.style.paddingBottom = el.dataset.oldPaddingBottom;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
return Transition;
|
|
77
|
+
}();
|
|
78
|
+
|
|
79
|
+
exports.default = {
|
|
80
|
+
name: 'ElCollapseTransition',
|
|
81
|
+
functional: true,
|
|
82
|
+
render: function render(h, _ref) {
|
|
83
|
+
var children = _ref.children;
|
|
84
|
+
|
|
85
|
+
var data = {
|
|
86
|
+
on: new Transition()
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
return h('transition', data, children);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
exports.default = function (instance, callback) {
|
|
6
|
+
var speed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 300;
|
|
7
|
+
var once = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
8
|
+
|
|
9
|
+
if (!instance || !callback) throw new Error('instance & callback is required');
|
|
10
|
+
var called = false;
|
|
11
|
+
var afterLeaveCallback = function afterLeaveCallback() {
|
|
12
|
+
if (called) return;
|
|
13
|
+
called = true;
|
|
14
|
+
if (callback) {
|
|
15
|
+
callback.apply(null, arguments);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
if (once) {
|
|
19
|
+
instance.$once('after-leave', afterLeaveCallback);
|
|
20
|
+
} else {
|
|
21
|
+
instance.$on('after-leave', afterLeaveCallback);
|
|
22
|
+
}
|
|
23
|
+
setTimeout(function () {
|
|
24
|
+
afterLeaveCallback();
|
|
25
|
+
}, speed + 100);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
; /**
|
|
29
|
+
* Bind after-leave event for vue instance. Make sure after-leave is called in any browsers.
|
|
30
|
+
*
|
|
31
|
+
* @param {Vue} instance Vue instance.
|
|
32
|
+
* @param {Function} callback callback of after-leave event
|
|
33
|
+
* @param {Number} speed the speed of transition, default value is 300ms
|
|
34
|
+
* @param {Boolean} once weather bind after-leave once. default value is false.
|
|
35
|
+
*/
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
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; };
|
|
6
|
+
|
|
7
|
+
var _ariaUtils = require('./aria-utils');
|
|
8
|
+
|
|
9
|
+
var _ariaUtils2 = _interopRequireDefault(_ariaUtils);
|
|
10
|
+
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @constructor
|
|
15
|
+
* @desc Dialog object providing modal focus management.
|
|
16
|
+
*
|
|
17
|
+
* Assumptions: The element serving as the dialog container is present in the
|
|
18
|
+
* DOM and hidden. The dialog container has role='dialog'.
|
|
19
|
+
*
|
|
20
|
+
* @param dialogId
|
|
21
|
+
* The ID of the element serving as the dialog container.
|
|
22
|
+
* @param focusAfterClosed
|
|
23
|
+
* Either the DOM node or the ID of the DOM node to focus when the
|
|
24
|
+
* dialog closes.
|
|
25
|
+
* @param focusFirst
|
|
26
|
+
* Optional parameter containing either the DOM node or the ID of the
|
|
27
|
+
* DOM node to focus when the dialog opens. If not specified, the
|
|
28
|
+
* first focusable element in the dialog will receive focus.
|
|
29
|
+
*/
|
|
30
|
+
var aria = aria || {};
|
|
31
|
+
var tabEvent;
|
|
32
|
+
|
|
33
|
+
aria.Dialog = function (dialog, focusAfterClosed, focusFirst) {
|
|
34
|
+
var _this = this;
|
|
35
|
+
|
|
36
|
+
this.dialogNode = dialog;
|
|
37
|
+
if (this.dialogNode === null || this.dialogNode.getAttribute('role') !== 'dialog') {
|
|
38
|
+
throw new Error('Dialog() requires a DOM element with ARIA role of dialog.');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (typeof focusAfterClosed === 'string') {
|
|
42
|
+
this.focusAfterClosed = document.getElementById(focusAfterClosed);
|
|
43
|
+
} else if ((typeof focusAfterClosed === 'undefined' ? 'undefined' : _typeof(focusAfterClosed)) === 'object') {
|
|
44
|
+
this.focusAfterClosed = focusAfterClosed;
|
|
45
|
+
} else {
|
|
46
|
+
this.focusAfterClosed = null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (typeof focusFirst === 'string') {
|
|
50
|
+
this.focusFirst = document.getElementById(focusFirst);
|
|
51
|
+
} else if ((typeof focusFirst === 'undefined' ? 'undefined' : _typeof(focusFirst)) === 'object') {
|
|
52
|
+
this.focusFirst = focusFirst;
|
|
53
|
+
} else {
|
|
54
|
+
this.focusFirst = null;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (this.focusFirst) {
|
|
58
|
+
this.focusFirst.focus();
|
|
59
|
+
} else {
|
|
60
|
+
_ariaUtils2.default.focusFirstDescendant(this.dialogNode);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
this.lastFocus = document.activeElement;
|
|
64
|
+
tabEvent = function tabEvent(e) {
|
|
65
|
+
_this.trapFocus(e);
|
|
66
|
+
};
|
|
67
|
+
this.addListeners();
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
aria.Dialog.prototype.addListeners = function () {
|
|
71
|
+
document.addEventListener('focus', tabEvent, true);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
aria.Dialog.prototype.removeListeners = function () {
|
|
75
|
+
document.removeEventListener('focus', tabEvent, true);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
aria.Dialog.prototype.closeDialog = function () {
|
|
79
|
+
var _this2 = this;
|
|
80
|
+
|
|
81
|
+
this.removeListeners();
|
|
82
|
+
if (this.focusAfterClosed) {
|
|
83
|
+
setTimeout(function () {
|
|
84
|
+
_this2.focusAfterClosed.focus();
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
aria.Dialog.prototype.trapFocus = function (event) {
|
|
90
|
+
if (_ariaUtils2.default.IgnoreUtilFocusChanges) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (this.dialogNode.contains(event.target)) {
|
|
94
|
+
this.lastFocus = event.target;
|
|
95
|
+
} else {
|
|
96
|
+
_ariaUtils2.default.focusFirstDescendant(this.dialogNode);
|
|
97
|
+
if (this.lastFocus === document.activeElement) {
|
|
98
|
+
_ariaUtils2.default.focusLastDescendant(this.dialogNode);
|
|
99
|
+
}
|
|
100
|
+
this.lastFocus = document.activeElement;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
exports.default = aria.Dialog;
|