@element-plus/nightly 0.0.20220819 → 0.0.20220822
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/dist/index.css +1 -1
- package/dist/index.full.js +163 -122
- package/dist/index.full.min.js +11 -11
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +12 -12
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +163 -122
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/calendar/src/calendar2.mjs +1 -1
- package/es/components/calendar/src/date-table.mjs +153 -31
- package/es/components/calendar/src/date-table.mjs.map +1 -1
- package/es/components/calendar/src/date-table2.mjs +31 -153
- package/es/components/calendar/src/date-table2.mjs.map +1 -1
- package/es/components/message-box/src/message-box.type.d.ts +1 -1
- package/es/components/message-box/src/messageBox.mjs +10 -9
- package/es/components/message-box/src/messageBox.mjs.map +1 -1
- package/es/components/page-header/index.d.ts +46 -0
- package/es/components/page-header/src/page-header.vue.d.ts +46 -0
- package/es/components/page-header/src/page-header2.mjs +70 -28
- package/es/components/page-header/src/page-header2.mjs.map +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/calendar/src/calendar2.js +1 -1
- package/lib/components/calendar/src/date-table.js +158 -35
- package/lib/components/calendar/src/date-table.js.map +1 -1
- package/lib/components/calendar/src/date-table2.js +35 -158
- package/lib/components/calendar/src/date-table2.js.map +1 -1
- package/lib/components/message-box/src/message-box.type.d.ts +1 -1
- package/lib/components/message-box/src/messageBox.js +10 -9
- package/lib/components/message-box/src/messageBox.js.map +1 -1
- package/lib/components/page-header/index.d.ts +46 -0
- package/lib/components/page-header/src/page-header.vue.d.ts +46 -0
- package/lib/components/page-header/src/page-header2.js +69 -27
- package/lib/components/page-header/src/page-header2.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/theme-chalk/el-page-header.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/page-header.scss +40 -26
- package/web-types.json +1 -1
|
@@ -2,169 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
var dayjs = require('dayjs');
|
|
7
|
-
var localeData = require('dayjs/plugin/localeData.js');
|
|
8
|
-
require('../../../hooks/index.js');
|
|
5
|
+
require('../../../utils/index.js');
|
|
9
6
|
require('../../time-picker/index.js');
|
|
10
|
-
require('../../../constants/index.js');
|
|
11
|
-
var dateTable = require('./date-table.js');
|
|
12
|
-
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
13
|
-
var index = require('../../../hooks/use-locale/index.js');
|
|
14
|
-
var index$1 = require('../../../hooks/use-namespace/index.js');
|
|
15
7
|
var utils = require('../../time-picker/src/utils.js');
|
|
16
|
-
var
|
|
8
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
9
|
+
var shared = require('@vue/shared');
|
|
17
10
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
const __default__ = {
|
|
26
|
-
name: "DateTable"
|
|
11
|
+
const getPrevMonthLastDays = (date, count) => {
|
|
12
|
+
const lastDay = date.subtract(1, "month").endOf("month").date();
|
|
13
|
+
return utils.rangeArr(count).map((_, index) => lastDay - (count - index - 1));
|
|
14
|
+
};
|
|
15
|
+
const getMonthDays = (date) => {
|
|
16
|
+
const days = date.daysInMonth();
|
|
17
|
+
return utils.rangeArr(days).map((_, index) => index + 1);
|
|
27
18
|
};
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const currentMonthRange = utils.rangeArr(end.date() - start.date() + 1).map((index) => ({
|
|
46
|
-
text: start.date() + index,
|
|
47
|
-
type: "current"
|
|
48
|
-
}));
|
|
49
|
-
let remaining = currentMonthRange.length % 7;
|
|
50
|
-
remaining = remaining === 0 ? 0 : 7 - remaining;
|
|
51
|
-
const nextMonthRange = utils.rangeArr(remaining).map((_, index) => ({
|
|
52
|
-
text: index + 1,
|
|
53
|
-
type: "next"
|
|
54
|
-
}));
|
|
55
|
-
days = currentMonthRange.concat(nextMonthRange);
|
|
56
|
-
} else {
|
|
57
|
-
const firstDay = props.date.startOf("month").day();
|
|
58
|
-
const prevMonthDays = dateTable.getPrevMonthLastDays(props.date, firstDay - firstDayOfWeek).map((day) => ({
|
|
59
|
-
text: day,
|
|
60
|
-
type: "prev"
|
|
61
|
-
}));
|
|
62
|
-
const currentMonthDays = dateTable.getMonthDays(props.date).map((day) => ({
|
|
63
|
-
text: day,
|
|
64
|
-
type: "current"
|
|
65
|
-
}));
|
|
66
|
-
days = [...prevMonthDays, ...currentMonthDays];
|
|
67
|
-
const remaining = 7 - (days.length % 7 || 7);
|
|
68
|
-
const nextMonthDays = utils.rangeArr(remaining).map((_, index) => ({
|
|
69
|
-
text: index + 1,
|
|
70
|
-
type: "next"
|
|
71
|
-
}));
|
|
72
|
-
days = days.concat(nextMonthDays);
|
|
73
|
-
}
|
|
74
|
-
return dateTable.toNestedArr(days);
|
|
75
|
-
});
|
|
76
|
-
const weekDays = vue.computed(() => {
|
|
77
|
-
const start = firstDayOfWeek;
|
|
78
|
-
if (start === 0) {
|
|
79
|
-
return date.WEEK_DAYS.map((_) => t(`el.datepicker.weeks.${_}`));
|
|
80
|
-
} else {
|
|
81
|
-
return date.WEEK_DAYS.slice(start).concat(date.WEEK_DAYS.slice(0, start)).map((_) => t(`el.datepicker.weeks.${_}`));
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
const getFormattedDate = (day, type) => {
|
|
85
|
-
switch (type) {
|
|
86
|
-
case "prev":
|
|
87
|
-
return props.date.startOf("month").subtract(1, "month").date(day);
|
|
88
|
-
case "next":
|
|
89
|
-
return props.date.startOf("month").add(1, "month").date(day);
|
|
90
|
-
case "current":
|
|
91
|
-
return props.date.date(day);
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
const getCellClass = ({ text, type }) => {
|
|
95
|
-
const classes = [type];
|
|
96
|
-
if (type === "current") {
|
|
97
|
-
const date = getFormattedDate(text, type);
|
|
98
|
-
if (date.isSame(props.selectedDay, "day")) {
|
|
99
|
-
classes.push(nsDay.is("selected"));
|
|
100
|
-
}
|
|
101
|
-
if (date.isSame(now, "day")) {
|
|
102
|
-
classes.push(nsDay.is("today"));
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return classes;
|
|
106
|
-
};
|
|
107
|
-
const handlePickDay = ({ text, type }) => {
|
|
108
|
-
const date = getFormattedDate(text, type);
|
|
109
|
-
emit("pick", date);
|
|
110
|
-
};
|
|
111
|
-
const getSlotData = ({ text, type }) => {
|
|
112
|
-
const day = getFormattedDate(text, type);
|
|
113
|
-
return {
|
|
114
|
-
isSelected: day.isSame(props.selectedDay),
|
|
115
|
-
type: `${type}-month`,
|
|
116
|
-
day: day.format("YYYY-MM-DD"),
|
|
117
|
-
date: day.toDate()
|
|
118
|
-
};
|
|
119
|
-
};
|
|
120
|
-
expose({
|
|
121
|
-
getFormattedDate
|
|
122
|
-
});
|
|
123
|
-
return (_ctx, _cache) => {
|
|
124
|
-
return vue.openBlock(), vue.createElementBlock("table", {
|
|
125
|
-
class: vue.normalizeClass([vue.unref(nsTable).b(), vue.unref(nsTable).is("range", vue.unref(isInRange))]),
|
|
126
|
-
cellspacing: "0",
|
|
127
|
-
cellpadding: "0"
|
|
128
|
-
}, [
|
|
129
|
-
!_ctx.hideHeader ? (vue.openBlock(), vue.createElementBlock("thead", _hoisted_1, [
|
|
130
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(weekDays), (day) => {
|
|
131
|
-
return vue.openBlock(), vue.createElementBlock("th", { key: day }, vue.toDisplayString(day), 1);
|
|
132
|
-
}), 128))
|
|
133
|
-
])) : vue.createCommentVNode("v-if", true),
|
|
134
|
-
vue.createElementVNode("tbody", null, [
|
|
135
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(rows), (row, index) => {
|
|
136
|
-
return vue.openBlock(), vue.createElementBlock("tr", {
|
|
137
|
-
key: index,
|
|
138
|
-
class: vue.normalizeClass({
|
|
139
|
-
[vue.unref(nsTable).e("row")]: true,
|
|
140
|
-
[vue.unref(nsTable).em("row", "hide-border")]: index === 0 && _ctx.hideHeader
|
|
141
|
-
})
|
|
142
|
-
}, [
|
|
143
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(row, (cell, key) => {
|
|
144
|
-
return vue.openBlock(), vue.createElementBlock("td", {
|
|
145
|
-
key,
|
|
146
|
-
class: vue.normalizeClass(getCellClass(cell)),
|
|
147
|
-
onClick: ($event) => handlePickDay(cell)
|
|
148
|
-
}, [
|
|
149
|
-
vue.createElementVNode("div", {
|
|
150
|
-
class: vue.normalizeClass(vue.unref(nsDay).b())
|
|
151
|
-
}, [
|
|
152
|
-
vue.renderSlot(_ctx.$slots, "dateCell", {
|
|
153
|
-
data: getSlotData(cell)
|
|
154
|
-
}, () => [
|
|
155
|
-
vue.createElementVNode("span", null, vue.toDisplayString(cell.text), 1)
|
|
156
|
-
])
|
|
157
|
-
], 2)
|
|
158
|
-
], 10, _hoisted_2);
|
|
159
|
-
}), 128))
|
|
160
|
-
], 2);
|
|
161
|
-
}), 128))
|
|
162
|
-
])
|
|
163
|
-
], 2);
|
|
164
|
-
};
|
|
19
|
+
const toNestedArr = (days) => utils.rangeArr(days.length / 7).map((index) => {
|
|
20
|
+
const start = index * 7;
|
|
21
|
+
return days.slice(start, start + 7);
|
|
22
|
+
});
|
|
23
|
+
const dateTableProps = runtime.buildProps({
|
|
24
|
+
selectedDay: {
|
|
25
|
+
type: runtime.definePropType(Object)
|
|
26
|
+
},
|
|
27
|
+
range: {
|
|
28
|
+
type: runtime.definePropType(Array)
|
|
29
|
+
},
|
|
30
|
+
date: {
|
|
31
|
+
type: runtime.definePropType(Object),
|
|
32
|
+
required: true
|
|
33
|
+
},
|
|
34
|
+
hideHeader: {
|
|
35
|
+
type: Boolean
|
|
165
36
|
}
|
|
166
37
|
});
|
|
167
|
-
|
|
38
|
+
const dateTableEmits = {
|
|
39
|
+
pick: (value) => shared.isObject(value)
|
|
40
|
+
};
|
|
168
41
|
|
|
169
|
-
exports
|
|
42
|
+
exports.dateTableEmits = dateTableEmits;
|
|
43
|
+
exports.dateTableProps = dateTableProps;
|
|
44
|
+
exports.getMonthDays = getMonthDays;
|
|
45
|
+
exports.getPrevMonthLastDays = getPrevMonthLastDays;
|
|
46
|
+
exports.toNestedArr = toNestedArr;
|
|
170
47
|
//# sourceMappingURL=date-table2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-table2.js","sources":["../../../../../../packages/components/calendar/src/date-table.
|
|
1
|
+
{"version":3,"file":"date-table2.js","sources":["../../../../../../packages/components/calendar/src/date-table.ts"],"sourcesContent":["import { buildProps, definePropType, isObject } from '@element-plus/utils'\nimport { rangeArr } from '@element-plus/components/time-picker'\nimport type { ExtractPropTypes } from 'vue'\nimport type { Dayjs } from 'dayjs'\nimport type DateTable from './date-table.vue'\n\nexport type CalendarDateCellType = 'next' | 'prev' | 'current'\nexport type CalendarDateCell = {\n text: number\n type: CalendarDateCellType\n}\n\nexport const getPrevMonthLastDays = (date: Dayjs, count: number) => {\n const lastDay = date.subtract(1, 'month').endOf('month').date()\n return rangeArr(count).map((_, index) => lastDay - (count - index - 1))\n}\n\nexport const getMonthDays = (date: Dayjs) => {\n const days = date.daysInMonth()\n return rangeArr(days).map((_, index) => index + 1)\n}\n\nexport const toNestedArr = (days: CalendarDateCell[]) =>\n rangeArr(days.length / 7).map((index) => {\n const start = index * 7\n return days.slice(start, start + 7)\n })\n\nexport const dateTableProps = buildProps({\n selectedDay: {\n type: definePropType<Dayjs>(Object),\n },\n range: {\n type: definePropType<[Dayjs, Dayjs]>(Array),\n },\n date: {\n type: definePropType<Dayjs>(Object),\n required: true,\n },\n hideHeader: {\n type: Boolean,\n },\n} as const)\nexport type DateTableProps = ExtractPropTypes<typeof dateTableProps>\n\nexport const dateTableEmits = {\n pick: (value: Dayjs) => isObject(value),\n}\nexport type DateTableEmits = typeof dateTableEmits\n\nexport type DateTableInstance = InstanceType<typeof DateTable>\n"],"names":["rangeArr","buildProps","definePropType","isObject"],"mappings":";;;;;;;;;;AAEY,MAAC,oBAAoB,G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AACjB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,cAAc,GAAG;AAC9B,EAAE,IAAI,EAAE,CAAC,KAAK,KAAKC,eAAQ,CAAC,KAAK,CAAC;AAClC;;;;;;;;"}
|
|
@@ -76,7 +76,7 @@ export interface ElMessageBoxOptions {
|
|
|
76
76
|
/** Content of the MessageBox */
|
|
77
77
|
message?: string | VNode;
|
|
78
78
|
/** Title of the MessageBox */
|
|
79
|
-
title?: string;
|
|
79
|
+
title?: string | ElMessageBoxOptions;
|
|
80
80
|
/** Message type, used for icon display */
|
|
81
81
|
type?: MessageType;
|
|
82
82
|
/** Message box type */
|
|
@@ -95,21 +95,22 @@ const MESSAGE_BOX_DEFAULT_OPTS = {
|
|
|
95
95
|
prompt: { showCancelButton: true, showInput: true }
|
|
96
96
|
};
|
|
97
97
|
MESSAGE_BOX_VARIANTS.forEach((boxType) => {
|
|
98
|
+
;
|
|
98
99
|
MessageBox[boxType] = messageBoxFactory(boxType);
|
|
99
100
|
});
|
|
100
101
|
function messageBoxFactory(boxType) {
|
|
101
|
-
return (message,
|
|
102
|
-
let
|
|
103
|
-
if (shared.isObject(
|
|
104
|
-
options =
|
|
105
|
-
|
|
106
|
-
} else if (types.isUndefined(
|
|
107
|
-
|
|
102
|
+
return (message, title, options, appContext) => {
|
|
103
|
+
let titleOrOpts = "";
|
|
104
|
+
if (shared.isObject(title)) {
|
|
105
|
+
options = title;
|
|
106
|
+
titleOrOpts = "";
|
|
107
|
+
} else if (types.isUndefined(title)) {
|
|
108
|
+
titleOrOpts = "";
|
|
108
109
|
} else {
|
|
109
|
-
|
|
110
|
+
titleOrOpts = title;
|
|
110
111
|
}
|
|
111
112
|
return MessageBox(Object.assign({
|
|
112
|
-
title,
|
|
113
|
+
title: titleOrOpts,
|
|
113
114
|
message,
|
|
114
115
|
type: "",
|
|
115
116
|
...MESSAGE_BOX_DEFAULT_OPTS[boxType]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageBox.js","sources":["../../../../../../packages/components/message-box/src/messageBox.ts"],"sourcesContent":["// @ts-nocheck\nimport { h, render, watch } from 'vue'\nimport { isClient } from '@vueuse/core'\nimport {\n hasOwn,\n isObject,\n isString,\n isUndefined,\n isVNode,\n} from '@element-plus/utils'\nimport MessageBoxConstructor from './index.vue'\n\nimport type { AppContext, ComponentPublicInstance, VNode } from 'vue'\nimport type {\n Action,\n Callback,\n ElMessageBoxOptions,\n IElMessageBox,\n MessageBoxData,\n MessageBoxState,\n} from './message-box.type'\n\n// component default merge props & data\n\nconst messageInstance = new Map<\n ComponentPublicInstance<{ doClose: () => void }>, // marking doClose as function\n {\n options: any\n callback: Callback\n resolve: (res: any) => void\n reject: (reason?: any) => void\n }\n>()\n\nconst initInstance = (\n props: any,\n container: HTMLElement,\n appContext: AppContext | null = null\n) => {\n const vnode = h(MessageBoxConstructor, props)\n vnode.appContext = appContext\n render(vnode, container)\n document.body.appendChild(container.firstElementChild!)\n return vnode.component\n}\n\nconst genContainer = () => {\n return document.createElement('div')\n}\n\nconst showMessage = (options: any, appContext?: AppContext | null) => {\n const container = genContainer()\n // Adding destruct method.\n // when transition leaves emitting `vanish` evt. so that we can do the clean job.\n options.onVanish = () => {\n // not sure if this causes mem leak, need proof to verify that.\n // maybe calling out like 1000 msg-box then close them all.\n render(null, container)\n messageInstance.delete(vm) // Remove vm to avoid mem leak.\n // here we were suppose to call document.body.removeChild(container.firstElementChild)\n // but render(null, container) did that job for us. so that we do not call that directly\n }\n\n options.onAction = (action: Action) => {\n const currentMsg = messageInstance.get(vm)!\n let resolve: Action | { value: string; action: Action }\n if (options.showInput) {\n resolve = { value: vm.inputValue, action }\n } else {\n resolve = action\n }\n if (options.callback) {\n options.callback(resolve, instance.proxy)\n } else {\n if (action === 'cancel' || action === 'close') {\n if (options.distinguishCancelAndClose && action !== 'cancel') {\n currentMsg.reject('close')\n } else {\n currentMsg.reject('cancel')\n }\n } else {\n currentMsg.resolve(resolve)\n }\n }\n }\n\n const instance = initInstance(options, container, appContext)!\n\n // This is how we use message box programmably.\n // Maybe consider releasing a template version?\n // get component instance like v2.\n const vm = instance.proxy as ComponentPublicInstance<\n {\n visible: boolean\n doClose: () => void\n } & MessageBoxState\n >\n\n for (const prop in options) {\n if (hasOwn(options, prop) && !hasOwn(vm.$props, prop)) {\n vm[prop as string] = options[prop]\n }\n }\n\n watch(\n () => vm.message,\n (newVal, oldVal) => {\n if (isVNode(newVal)) {\n // Override slots since message is vnode type.\n instance.slots.default = () => [newVal]\n } else if (isVNode(oldVal) && !isVNode(newVal)) {\n delete instance.slots.default\n }\n },\n {\n immediate: true,\n }\n )\n\n // change visibility after everything is settled\n vm.visible = true\n return vm\n}\n\nasync function MessageBox(\n options: ElMessageBoxOptions,\n appContext?: AppContext | null\n): Promise<MessageBoxData>\nfunction MessageBox(\n options: ElMessageBoxOptions | string | VNode,\n appContext: AppContext | null = null\n): Promise<{ value: string; action: Action } | Action> {\n if (!isClient) return Promise.reject()\n let callback\n if (isString(options) || isVNode(options)) {\n options = {\n message: options,\n }\n } else {\n callback = options.callback\n }\n\n return new Promise((resolve, reject) => {\n const vm = showMessage(options, appContext ?? MessageBox._context)\n // collect this vm in order to handle upcoming events.\n messageInstance.set(vm, {\n options,\n callback,\n resolve,\n reject,\n })\n })\n}\n\nconst MESSAGE_BOX_VARIANTS = ['alert', 'confirm', 'prompt'] as const\nconst MESSAGE_BOX_DEFAULT_OPTS: Record<\n typeof MESSAGE_BOX_VARIANTS[number],\n Partial<ElMessageBoxOptions>\n> = {\n alert: { closeOnPressEscape: false, closeOnClickModal: false },\n confirm: { showCancelButton: true },\n prompt: { showCancelButton: true, showInput: true },\n}\n\nMESSAGE_BOX_VARIANTS.forEach((boxType) => {\n MessageBox[boxType] = messageBoxFactory(boxType)\n})\n\nfunction messageBoxFactory(boxType: typeof MESSAGE_BOX_VARIANTS[number]) {\n return (\n message: string,\n titleOrOpts: string | ElMessageBoxOptions,\n options?: ElMessageBoxOptions,\n appContext?: AppContext | null\n ) => {\n let title: string\n if (isObject(titleOrOpts)) {\n options = titleOrOpts\n title = ''\n } else if (isUndefined(titleOrOpts)) {\n title = ''\n } else {\n title = titleOrOpts\n }\n\n return MessageBox(\n Object.assign(\n {\n title,\n message,\n type: '',\n ...MESSAGE_BOX_DEFAULT_OPTS[boxType],\n },\n options,\n {\n boxType,\n }\n ),\n appContext\n )\n }\n}\n\nMessageBox.close = () => {\n // instance.setupInstall.doClose()\n // instance.setupInstall.state.visible = false\n\n messageInstance.forEach((_, vm) => {\n vm.doClose()\n })\n\n messageInstance.clear()\n}\n\nMessageBox._context = null\n\nexport default MessageBox as IElMessageBox\n"],"names":["h","MessageBoxConstructor","render","hasOwn","watch","isVNode","isClient","isString","isObject","isUndefined"],"mappings":";;;;;;;;;;;AAUA,MAAM,eAAe,mBAAmB,IAAI,GAAG,EAAE,CAAC;AAClD,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU,GAAG,IAAI,KAAK;AAC9D,EAAE,MAAM,KAAK,GAAGA,KAAC,CAACC,gBAAqB,EAAE,KAAK,CAAC,CAAC;AAChD,EAAE,KAAK,CAAC,UAAU,GAAG,UAAU,CAAC;AAChC,EAAEC,UAAM,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAC3B,EAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;AACzD,EAAE,OAAO,KAAK,CAAC,SAAS,CAAC;AACzB,CAAC,CAAC;AACF,MAAM,YAAY,GAAG,MAAM;AAC3B,EAAE,OAAO,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AACvC,CAAC,CAAC;AACF,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,UAAU,KAAK;AAC7C,EAAE,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;AACnC,EAAE,OAAO,CAAC,QAAQ,GAAG,MAAM;AAC3B,IAAIA,UAAM,CAAC,IAAI,EAAE,SAAS,C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,EAAE,EAAE;AACd,MAAM,GAAG,wBAAwB,CAAC,OAAO,CAAC;AAC1C,KAAK,EAAE,OAAO,EAAE;AAChB,MAAM,OAAO;AACb,KAAK,CAAC,EAAE,UAAU,CAAC,CAAC;AACpB,GAAG,CAAC;AACJ,CAAC;AACD,UAAU,CAAC,KAAK,GAAG,MAAM;AACzB,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK;AACrC,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;AACjB,GAAG,CAAC,CAAC;AACL,EAAE,eAAe,CAAC,KAAK,EAAE,CAAC;AAC1B,CAAC,CAAC;AACF,UAAU,CAAC,QAAQ,GAAG,IAAI;;;;"}
|
|
1
|
+
{"version":3,"file":"messageBox.js","sources":["../../../../../../packages/components/message-box/src/messageBox.ts"],"sourcesContent":["import { h, render, watch } from 'vue'\nimport { isClient } from '@vueuse/core'\nimport {\n hasOwn,\n isObject,\n isString,\n isUndefined,\n isVNode,\n} from '@element-plus/utils'\nimport MessageBoxConstructor from './index.vue'\n\nimport type { AppContext, ComponentPublicInstance, VNode } from 'vue'\nimport type {\n Action,\n Callback,\n ElMessageBoxOptions,\n ElMessageBoxShortcutMethod,\n IElMessageBox,\n MessageBoxData,\n MessageBoxState,\n} from './message-box.type'\n\n// component default merge props & data\n\nconst messageInstance = new Map<\n ComponentPublicInstance<{ doClose: () => void }>, // marking doClose as function\n {\n options: any\n callback: Callback | undefined\n resolve: (res: any) => void\n reject: (reason?: any) => void\n }\n>()\n\nconst initInstance = (\n props: any,\n container: HTMLElement,\n appContext: AppContext | null = null\n) => {\n const vnode = h(MessageBoxConstructor, props)\n vnode.appContext = appContext\n render(vnode, container)\n document.body.appendChild(container.firstElementChild!)\n return vnode.component\n}\n\nconst genContainer = () => {\n return document.createElement('div')\n}\n\nconst showMessage = (options: any, appContext?: AppContext | null) => {\n const container = genContainer()\n // Adding destruct method.\n // when transition leaves emitting `vanish` evt. so that we can do the clean job.\n options.onVanish = () => {\n // not sure if this causes mem leak, need proof to verify that.\n // maybe calling out like 1000 msg-box then close them all.\n render(null, container)\n messageInstance.delete(vm) // Remove vm to avoid mem leak.\n // here we were suppose to call document.body.removeChild(container.firstElementChild)\n // but render(null, container) did that job for us. so that we do not call that directly\n }\n\n options.onAction = (action: Action) => {\n const currentMsg = messageInstance.get(vm)!\n let resolve: Action | { value: string; action: Action }\n if (options.showInput) {\n resolve = { value: vm.inputValue, action }\n } else {\n resolve = action\n }\n if (options.callback) {\n options.callback(resolve, instance.proxy)\n } else {\n if (action === 'cancel' || action === 'close') {\n if (options.distinguishCancelAndClose && action !== 'cancel') {\n currentMsg.reject('close')\n } else {\n currentMsg.reject('cancel')\n }\n } else {\n currentMsg.resolve(resolve)\n }\n }\n }\n\n const instance = initInstance(options, container, appContext)!\n\n // This is how we use message box programmably.\n // Maybe consider releasing a template version?\n // get component instance like v2.\n const vm = instance.proxy as ComponentPublicInstance<\n {\n visible: boolean\n doClose: () => void\n } & MessageBoxState\n >\n\n for (const prop in options) {\n if (hasOwn(options, prop) && !hasOwn(vm.$props, prop)) {\n vm[prop as keyof ComponentPublicInstance] = options[prop]\n }\n }\n\n watch(\n () => vm.message,\n (newVal, oldVal) => {\n if (isVNode(newVal)) {\n // Override slots since message is vnode type.\n instance.slots.default = () => [newVal]\n } else if (isVNode(oldVal) && !isVNode(newVal)) {\n delete instance.slots.default\n }\n },\n {\n immediate: true,\n }\n )\n\n // change visibility after everything is settled\n vm.visible = true\n return vm\n}\n\nasync function MessageBox(\n options: ElMessageBoxOptions,\n appContext?: AppContext | null\n): Promise<MessageBoxData>\nfunction MessageBox(\n options: ElMessageBoxOptions | string | VNode,\n appContext: AppContext | null = null\n): Promise<{ value: string; action: Action } | Action> {\n if (!isClient) return Promise.reject()\n let callback: Callback | undefined\n if (isString(options) || isVNode(options)) {\n options = {\n message: options,\n }\n } else {\n callback = options.callback\n }\n\n return new Promise((resolve, reject) => {\n const vm = showMessage(\n options,\n appContext ?? (MessageBox as IElMessageBox)._context\n )\n // collect this vm in order to handle upcoming events.\n messageInstance.set(vm, {\n options,\n callback,\n resolve,\n reject,\n })\n })\n}\n\nconst MESSAGE_BOX_VARIANTS = ['alert', 'confirm', 'prompt'] as const\nconst MESSAGE_BOX_DEFAULT_OPTS: Record<\n typeof MESSAGE_BOX_VARIANTS[number],\n Partial<ElMessageBoxOptions>\n> = {\n alert: { closeOnPressEscape: false, closeOnClickModal: false },\n confirm: { showCancelButton: true },\n prompt: { showCancelButton: true, showInput: true },\n}\n\nMESSAGE_BOX_VARIANTS.forEach((boxType) => {\n ;(MessageBox as IElMessageBox)[boxType] = messageBoxFactory(\n boxType\n ) as ElMessageBoxShortcutMethod\n})\n\nfunction messageBoxFactory(boxType: typeof MESSAGE_BOX_VARIANTS[number]) {\n return (\n message: string | VNode,\n title: string | ElMessageBoxOptions,\n options?: ElMessageBoxOptions,\n appContext?: AppContext | null\n ) => {\n let titleOrOpts = ''\n if (isObject(title)) {\n options = title as ElMessageBoxOptions\n titleOrOpts = ''\n } else if (isUndefined(title)) {\n titleOrOpts = ''\n } else {\n titleOrOpts = title as string\n }\n\n return MessageBox(\n Object.assign(\n {\n title: titleOrOpts,\n message,\n type: '',\n ...MESSAGE_BOX_DEFAULT_OPTS[boxType],\n },\n options,\n {\n boxType,\n }\n ),\n appContext\n )\n }\n}\n\nMessageBox.close = () => {\n // instance.setupInstall.doClose()\n // instance.setupInstall.state.visible = false\n\n messageInstance.forEach((_, vm) => {\n vm.doClose()\n })\n\n messageInstance.clear()\n}\n;(MessageBox as IElMessageBox)._context = null\n\nexport default MessageBox as IElMessageBox\n"],"names":["h","MessageBoxConstructor","render","hasOwn","watch","isVNode","isClient","isString","isObject","isUndefined"],"mappings":";;;;;;;;;;;AAUA,MAAM,eAAe,mBAAmB,IAAI,GAAG,EAAE,CAAC;AAClD,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU,GAAG,IAAI,KAAK;AAC9D,EAAE,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AAC;AACH,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;AACnD,CAAC,CAAC,CAAC;AACH,SAAS,iBAAiB,CAAC,OAAO,EAAE;AACpC,EAAE,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,KAAK;AAClD,IAAI,IAAI,WAAW,GAAG,EAAE,CAAC;AACzB,IAAI,IAAIG,eAAQ,CAAC,KAAK,CAAC,EAAE;AACzB,MAAM,OAAO,GAAG,KAAK,CAAC;AACtB,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB,KAAK,MAAM,IAAIC,iBAAW,CAAC,KAAK,CAAC,EAAE;AACnC,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB,KAAK,MAAM;AACX,MAAM,WAAW,GAAG,KAAK,CAAC;AAC1B,KAAK;AACL,IAAI,OAAO,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC;AACpC,MAAM,KAAK,EAAE,WAAW;AACxB,MAAM,OAAO;AACb,MAAM,IAAI,EAAE,EAAE;AACd,MAAM,GAAG,wBAAwB,CAAC,OAAO,CAAC;AAC1C,KAAK,EAAE,OAAO,EAAE;AAChB,MAAM,OAAO;AACb,KAAK,CAAC,EAAE,UAAU,CAAC,CAAC;AACpB,GAAG,CAAC;AACJ,CAAC;AACD,UAAU,CAAC,KAAK,GAAG,MAAM;AACzB,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK;AACrC,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;AACjB,GAAG,CAAC,CAAC;AACL,EAAE,eAAe,CAAC,KAAK,EAAE,CAAC;AAC1B,CAAC,CAAC;AACF,UAAU,CAAC,QAAQ,GAAG,IAAI;;;;"}
|
|
@@ -4,6 +4,9 @@ export declare const ElPageHeader: import("element-plus/es/utils").SFCWithInstal
|
|
|
4
4
|
readonly content: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
5
5
|
}, {
|
|
6
6
|
emit: (event: "back") => void;
|
|
7
|
+
slots: Readonly<{
|
|
8
|
+
[name: string]: import("vue").Slot | undefined;
|
|
9
|
+
}>;
|
|
7
10
|
t: import("../..").Translator;
|
|
8
11
|
ns: {
|
|
9
12
|
namespace: import("vue").ComputedRef<string>;
|
|
@@ -23,6 +26,9 @@ export declare const ElPageHeader: import("element-plus/es/utils").SFCWithInstal
|
|
|
23
26
|
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
24
27
|
cssVarBlockName: (name: string) => string;
|
|
25
28
|
};
|
|
29
|
+
kls: import("vue").ComputedRef<(string | {
|
|
30
|
+
[x: string]: boolean;
|
|
31
|
+
})[]>;
|
|
26
32
|
handleClick: () => void;
|
|
27
33
|
ElIcon: import("element-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
28
34
|
readonly size: {
|
|
@@ -87,6 +93,46 @@ export declare const ElPageHeader: import("element-plus/es/utils").SFCWithInstal
|
|
|
87
93
|
__epPropKey: true;
|
|
88
94
|
};
|
|
89
95
|
}>>, {}>> & Record<string, any>;
|
|
96
|
+
ElDivider: import("element-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
97
|
+
readonly direction: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "vertical" | "horizontal", unknown, "horizontal", boolean>;
|
|
98
|
+
readonly contentPosition: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "left" | "right" | "center", unknown, "center", boolean>;
|
|
99
|
+
readonly borderStyle: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string & {}) | (() => string) | ((new (...args: any[]) => string & {}) | (() => string))[], unknown, unknown, "solid", boolean>;
|
|
100
|
+
}, {
|
|
101
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
102
|
+
readonly direction: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "vertical" | "horizontal", unknown, "horizontal", boolean>;
|
|
103
|
+
readonly contentPosition: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "left" | "right" | "center", unknown, "center", boolean>;
|
|
104
|
+
readonly borderStyle: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string & {}) | (() => string) | ((new (...args: any[]) => string & {}) | (() => string))[], unknown, unknown, "solid", boolean>;
|
|
105
|
+
}>> & {
|
|
106
|
+
[x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
107
|
+
}>>;
|
|
108
|
+
ns: {
|
|
109
|
+
namespace: import("vue").ComputedRef<string>;
|
|
110
|
+
b: (blockSuffix?: string) => string;
|
|
111
|
+
e: (element?: string | undefined) => string;
|
|
112
|
+
m: (modifier?: string | undefined) => string;
|
|
113
|
+
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
114
|
+
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
115
|
+
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
116
|
+
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
117
|
+
is: {
|
|
118
|
+
(name: string, state: boolean | undefined): string;
|
|
119
|
+
(name: string): string;
|
|
120
|
+
};
|
|
121
|
+
cssVar: (object: Record<string, string>) => Record<string, string>;
|
|
122
|
+
cssVarName: (name: string) => string;
|
|
123
|
+
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
124
|
+
cssVarBlockName: (name: string) => string;
|
|
125
|
+
};
|
|
126
|
+
dividerStyle: import("vue").ComputedRef<import("vue").CSSProperties>;
|
|
127
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
128
|
+
readonly direction: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "vertical" | "horizontal", unknown, "horizontal", boolean>;
|
|
129
|
+
readonly contentPosition: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "left" | "right" | "center", unknown, "center", boolean>;
|
|
130
|
+
readonly borderStyle: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string & {}) | (() => string) | ((new (...args: any[]) => string & {}) | (() => string))[], unknown, unknown, "solid", boolean>;
|
|
131
|
+
}>>, {
|
|
132
|
+
readonly direction: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "vertical" | "horizontal", unknown>;
|
|
133
|
+
readonly borderStyle: string;
|
|
134
|
+
readonly contentPosition: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "left" | "right" | "center", unknown>;
|
|
135
|
+
}>> & Record<string, any>;
|
|
90
136
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
91
137
|
back: () => boolean;
|
|
92
138
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -4,6 +4,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
4
4
|
readonly content: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
5
5
|
}, {
|
|
6
6
|
emit: (event: "back") => void;
|
|
7
|
+
slots: Readonly<{
|
|
8
|
+
[name: string]: import("vue").Slot | undefined;
|
|
9
|
+
}>;
|
|
7
10
|
t: import("element-plus/es/hooks").Translator;
|
|
8
11
|
ns: {
|
|
9
12
|
namespace: import("vue").ComputedRef<string>;
|
|
@@ -23,6 +26,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
23
26
|
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
24
27
|
cssVarBlockName: (name: string) => string;
|
|
25
28
|
};
|
|
29
|
+
kls: import("vue").ComputedRef<(string | {
|
|
30
|
+
[x: string]: boolean;
|
|
31
|
+
})[]>;
|
|
26
32
|
handleClick: () => void;
|
|
27
33
|
ElIcon: import("../../../utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
28
34
|
readonly size: {
|
|
@@ -87,6 +93,46 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
87
93
|
__epPropKey: true;
|
|
88
94
|
};
|
|
89
95
|
}>>, {}>> & Record<string, any>;
|
|
96
|
+
ElDivider: import("../../../utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
97
|
+
readonly direction: import("../../../utils").EpPropFinalized<StringConstructor, "vertical" | "horizontal", unknown, "horizontal", boolean>;
|
|
98
|
+
readonly contentPosition: import("../../../utils").EpPropFinalized<StringConstructor, "left" | "right" | "center", unknown, "center", boolean>;
|
|
99
|
+
readonly borderStyle: import("../../../utils").EpPropFinalized<(new (...args: any[]) => string & {}) | (() => string) | ((new (...args: any[]) => string & {}) | (() => string))[], unknown, unknown, "solid", boolean>;
|
|
100
|
+
}, {
|
|
101
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
102
|
+
readonly direction: import("../../../utils").EpPropFinalized<StringConstructor, "vertical" | "horizontal", unknown, "horizontal", boolean>;
|
|
103
|
+
readonly contentPosition: import("../../../utils").EpPropFinalized<StringConstructor, "left" | "right" | "center", unknown, "center", boolean>;
|
|
104
|
+
readonly borderStyle: import("../../../utils").EpPropFinalized<(new (...args: any[]) => string & {}) | (() => string) | ((new (...args: any[]) => string & {}) | (() => string))[], unknown, unknown, "solid", boolean>;
|
|
105
|
+
}>> & {
|
|
106
|
+
[x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
107
|
+
}>>;
|
|
108
|
+
ns: {
|
|
109
|
+
namespace: import("vue").ComputedRef<string>;
|
|
110
|
+
b: (blockSuffix?: string) => string;
|
|
111
|
+
e: (element?: string | undefined) => string;
|
|
112
|
+
m: (modifier?: string | undefined) => string;
|
|
113
|
+
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
114
|
+
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
115
|
+
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
116
|
+
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
117
|
+
is: {
|
|
118
|
+
(name: string, state: boolean | undefined): string;
|
|
119
|
+
(name: string): string;
|
|
120
|
+
};
|
|
121
|
+
cssVar: (object: Record<string, string>) => Record<string, string>;
|
|
122
|
+
cssVarName: (name: string) => string;
|
|
123
|
+
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
124
|
+
cssVarBlockName: (name: string) => string;
|
|
125
|
+
};
|
|
126
|
+
dividerStyle: import("vue").ComputedRef<import("vue").CSSProperties>;
|
|
127
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
128
|
+
readonly direction: import("../../../utils").EpPropFinalized<StringConstructor, "vertical" | "horizontal", unknown, "horizontal", boolean>;
|
|
129
|
+
readonly contentPosition: import("../../../utils").EpPropFinalized<StringConstructor, "left" | "right" | "center", unknown, "center", boolean>;
|
|
130
|
+
readonly borderStyle: import("../../../utils").EpPropFinalized<(new (...args: any[]) => string & {}) | (() => string) | ((new (...args: any[]) => string & {}) | (() => string))[], unknown, unknown, "solid", boolean>;
|
|
131
|
+
}>>, {
|
|
132
|
+
readonly direction: import("../../../utils").EpPropMergeType<StringConstructor, "vertical" | "horizontal", unknown>;
|
|
133
|
+
readonly borderStyle: string;
|
|
134
|
+
readonly contentPosition: import("../../../utils").EpPropMergeType<StringConstructor, "left" | "right" | "center", unknown>;
|
|
135
|
+
}>> & Record<string, any>;
|
|
90
136
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
91
137
|
back: () => boolean;
|
|
92
138
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -4,12 +4,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var vue = require('vue');
|
|
6
6
|
var index$2 = require('../../icon/index.js');
|
|
7
|
+
var index$3 = require('../../divider/index.js');
|
|
7
8
|
require('../../../hooks/index.js');
|
|
8
9
|
var pageHeader = require('./page-header.js');
|
|
9
10
|
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
10
11
|
var index = require('../../../hooks/use-locale/index.js');
|
|
11
12
|
var index$1 = require('../../../hooks/use-namespace/index.js');
|
|
12
13
|
|
|
14
|
+
const _hoisted_1 = ["aria-label"];
|
|
13
15
|
const __default__ = {
|
|
14
16
|
name: "ElPageHeader"
|
|
15
17
|
};
|
|
@@ -18,47 +20,87 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
18
20
|
props: pageHeader.pageHeaderProps,
|
|
19
21
|
emits: pageHeader.pageHeaderEmits,
|
|
20
22
|
setup(__props, { emit }) {
|
|
23
|
+
const slots = vue.useSlots();
|
|
21
24
|
const { t } = index.useLocale();
|
|
22
25
|
const ns = index$1.useNamespace("page-header");
|
|
26
|
+
const kls = vue.computed(() => {
|
|
27
|
+
return [
|
|
28
|
+
ns.b(),
|
|
29
|
+
{
|
|
30
|
+
[ns.m("has-breadcrumb")]: !!slots.breadcrumb,
|
|
31
|
+
[ns.m("has-extra")]: !!slots.extra,
|
|
32
|
+
[ns.is("contentful")]: !!slots.default
|
|
33
|
+
}
|
|
34
|
+
];
|
|
35
|
+
});
|
|
23
36
|
function handleClick() {
|
|
24
37
|
emit("back");
|
|
25
38
|
}
|
|
26
39
|
return (_ctx, _cache) => {
|
|
27
40
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
28
|
-
class: vue.normalizeClass(vue.unref(
|
|
41
|
+
class: vue.normalizeClass(vue.unref(kls))
|
|
29
42
|
}, [
|
|
30
43
|
vue.createElementVNode("div", {
|
|
31
|
-
class: vue.normalizeClass(vue.unref(ns).e("
|
|
32
|
-
|
|
44
|
+
class: vue.normalizeClass(vue.unref(ns).e("breadcrumb"))
|
|
45
|
+
}, [
|
|
46
|
+
vue.renderSlot(_ctx.$slots, "breadcrumb")
|
|
47
|
+
], 2),
|
|
48
|
+
vue.createElementVNode("div", {
|
|
49
|
+
class: vue.normalizeClass(vue.unref(ns).e("header"))
|
|
33
50
|
}, [
|
|
34
|
-
_ctx.icon || _ctx.$slots.icon ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
35
|
-
key: 0,
|
|
36
|
-
class: vue.normalizeClass(vue.unref(ns).e("icon"))
|
|
37
|
-
}, [
|
|
38
|
-
vue.renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
39
|
-
_ctx.icon ? (vue.openBlock(), vue.createBlock(vue.unref(index$2.ElIcon), { key: 0 }, {
|
|
40
|
-
default: vue.withCtx(() => [
|
|
41
|
-
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.icon)))
|
|
42
|
-
]),
|
|
43
|
-
_: 1
|
|
44
|
-
})) : vue.createCommentVNode("v-if", true)
|
|
45
|
-
])
|
|
46
|
-
], 2)) : vue.createCommentVNode("v-if", true),
|
|
47
51
|
vue.createElementVNode("div", {
|
|
48
|
-
class: vue.normalizeClass(vue.unref(ns).e("
|
|
52
|
+
class: vue.normalizeClass(vue.unref(ns).e("left"))
|
|
53
|
+
}, [
|
|
54
|
+
vue.createElementVNode("div", {
|
|
55
|
+
class: vue.normalizeClass(vue.unref(ns).e("back")),
|
|
56
|
+
role: "button",
|
|
57
|
+
tabindex: "0",
|
|
58
|
+
onClick: handleClick
|
|
59
|
+
}, [
|
|
60
|
+
_ctx.icon || _ctx.$slots.icon ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
61
|
+
key: 0,
|
|
62
|
+
"aria-label": _ctx.title || vue.unref(t)("el.pageHeader.title"),
|
|
63
|
+
class: vue.normalizeClass(vue.unref(ns).e("icon"))
|
|
64
|
+
}, [
|
|
65
|
+
vue.renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
66
|
+
_ctx.icon ? (vue.openBlock(), vue.createBlock(vue.unref(index$2.ElIcon), { key: 0 }, {
|
|
67
|
+
default: vue.withCtx(() => [
|
|
68
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.icon)))
|
|
69
|
+
]),
|
|
70
|
+
_: 1
|
|
71
|
+
})) : vue.createCommentVNode("v-if", true)
|
|
72
|
+
])
|
|
73
|
+
], 10, _hoisted_1)) : vue.createCommentVNode("v-if", true),
|
|
74
|
+
vue.createElementVNode("div", {
|
|
75
|
+
class: vue.normalizeClass(vue.unref(ns).e("title"))
|
|
76
|
+
}, [
|
|
77
|
+
vue.renderSlot(_ctx.$slots, "title", {}, () => [
|
|
78
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.title || vue.unref(t)("el.pageHeader.title")), 1)
|
|
79
|
+
])
|
|
80
|
+
], 2)
|
|
81
|
+
], 2),
|
|
82
|
+
vue.createVNode(vue.unref(index$3.ElDivider), { direction: "vertical" }),
|
|
83
|
+
vue.createElementVNode("div", {
|
|
84
|
+
class: vue.normalizeClass(vue.unref(ns).e("content"))
|
|
85
|
+
}, [
|
|
86
|
+
vue.renderSlot(_ctx.$slots, "content", {}, () => [
|
|
87
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.content), 1)
|
|
88
|
+
])
|
|
89
|
+
], 2)
|
|
90
|
+
], 2),
|
|
91
|
+
_ctx.$slots.extra ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
92
|
+
key: 0,
|
|
93
|
+
class: vue.normalizeClass(vue.unref(ns).e("extra"))
|
|
49
94
|
}, [
|
|
50
|
-
vue.renderSlot(_ctx.$slots, "
|
|
51
|
-
|
|
52
|
-
])
|
|
53
|
-
], 2)
|
|
95
|
+
vue.renderSlot(_ctx.$slots, "extra")
|
|
96
|
+
], 2)) : vue.createCommentVNode("v-if", true)
|
|
54
97
|
], 2),
|
|
55
|
-
vue.
|
|
56
|
-
|
|
98
|
+
_ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
99
|
+
key: 0,
|
|
100
|
+
class: vue.normalizeClass(vue.unref(ns).e("main"))
|
|
57
101
|
}, [
|
|
58
|
-
vue.renderSlot(_ctx.$slots, "
|
|
59
|
-
|
|
60
|
-
])
|
|
61
|
-
], 2)
|
|
102
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
103
|
+
], 2)) : vue.createCommentVNode("v-if", true)
|
|
62
104
|
], 2);
|
|
63
105
|
};
|
|
64
106
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-header2.js","sources":["../../../../../../packages/components/page-header/src/page-header.vue"],"sourcesContent":["<template>\n <div :class=\"ns.
|
|
1
|
+
{"version":3,"file":"page-header2.js","sources":["../../../../../../packages/components/page-header/src/page-header.vue"],"sourcesContent":["<template>\n <div :class=\"kls\">\n <div :class=\"ns.e('breadcrumb')\">\n <slot name=\"breadcrumb\" />\n </div>\n <div :class=\"ns.e('header')\">\n <div :class=\"ns.e('left')\">\n <div\n :class=\"ns.e('back')\"\n role=\"button\"\n tabindex=\"0\"\n @click=\"handleClick\"\n >\n <div\n v-if=\"icon || $slots.icon\"\n :aria-label=\"title || t('el.pageHeader.title')\"\n :class=\"ns.e('icon')\"\n >\n <slot name=\"icon\">\n <el-icon v-if=\"icon\">\n <component :is=\"icon\" />\n </el-icon>\n </slot>\n </div>\n <div :class=\"ns.e('title')\">\n <slot name=\"title\">{{ title || t('el.pageHeader.title') }}</slot>\n </div>\n </div>\n <el-divider direction=\"vertical\" />\n <div :class=\"ns.e('content')\">\n <slot name=\"content\">{{ content }}</slot>\n </div>\n </div>\n\n <div v-if=\"$slots.extra\" :class=\"ns.e('extra')\">\n <slot name=\"extra\" />\n </div>\n </div>\n\n <div v-if=\"$slots.default\" :class=\"ns.e('main')\">\n <slot />\n </div>\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, useSlots } from 'vue'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { ElDivider } from '@element-plus/components/divider'\n\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport { pageHeaderEmits, pageHeaderProps } from './page-header'\n\ndefineOptions({\n name: 'ElPageHeader',\n})\n\ndefineProps(pageHeaderProps)\nconst emit = defineEmits(pageHeaderEmits)\nconst slots = useSlots()\n\nconst { t } = useLocale()\nconst ns = useNamespace('page-header')\nconst kls = computed(() => {\n return [\n ns.b(),\n {\n [ns.m('has-breadcrumb')]: !!slots.breadcrumb,\n [ns.m('has-extra')]: !!slots.extra,\n [ns.is('contentful')]: !!slots.default,\n },\n ]\n})\n\nfunction handleClick() {\n emit('back')\n}\n</script>\n"],"names":["useSlots","useLocale","useNamespace","computed"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA0DA,IAAA,MAAA,QAAAA,YAAA,EAAA,CAAA;AAEA,IAAA,MAAA,EAAA,MAAAC,eAAA,EAAA,CAAA;AACA,IAAA,MAAA,EAAA,GAAAC,qBAAA,aAAA,CAAA,CAAA;AACA,IAAA,MAAA,GAAA,GAAAC,aAAA,MAAA;AACA,MAAA,OAAA;AAAA,QACA,GAAA,CAAA,EAAA;AAAA,QACA;AAAA,UACA,CAAA,EAAA,CAAA,CAAA,CAAA,gBAAA,CAAA,GAAA,CAAA,CAAA,KAAA,CAAA,UAAA;AAAA,UACA,CAAA,EAAA,CAAA,CAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,KAAA,CAAA,KAAA;AAAA,UACA,CAAA,EAAA,CAAA,EAAA,CAAA,YAAA,CAAA,GAAA,CAAA,CAAA,KAAA,CAAA,OAAA;AAAA,SACA;AAAA,OACA,CAAA;AAAA,KACA,CAAA,CAAA;AAEA,IAAA,SAAA,WAAA,GAAA;AACA,MAAA,IAAA,CAAA,MAAA,CAAA,CAAA;AAAA,KACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|