@element-plus/nightly 0.0.20240427 → 0.0.20240429
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.full.js +4 -4
- package/dist/index.full.min.js +3 -3
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +3 -3
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +4 -4
- 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-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.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/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.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/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.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/autocomplete/src/autocomplete.mjs +1 -1
- package/es/components/calendar/src/calendar2.mjs +1 -1
- package/es/components/calendar/src/date-table.mjs +33 -87
- package/es/components/calendar/src/date-table.mjs.map +1 -1
- package/es/components/calendar/src/date-table2.mjs +87 -33
- package/es/components/calendar/src/date-table2.mjs.map +1 -1
- package/es/components/calendar/src/use-date-table.mjs +1 -1
- package/es/components/cascader/src/cascader.mjs +1 -1
- package/es/components/col/index.mjs +2 -2
- package/es/components/col/src/col.mjs +43 -66
- package/es/components/col/src/col.mjs.map +1 -1
- package/es/components/col/src/col2.mjs +66 -43
- package/es/components/col/src/col2.mjs.map +1 -1
- package/es/components/color-picker/src/color-picker.mjs +1 -1
- package/es/components/drawer/index.mjs +2 -2
- package/es/components/drawer/src/drawer.mjs +27 -181
- package/es/components/drawer/src/drawer.mjs.map +1 -1
- package/es/components/drawer/src/drawer2.mjs +181 -27
- package/es/components/drawer/src/drawer2.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown.mjs +1 -1
- package/es/components/empty/index.mjs +2 -2
- package/es/components/empty/src/empty.mjs +11 -55
- package/es/components/empty/src/empty.mjs.map +1 -1
- package/es/components/empty/src/empty2.mjs +55 -11
- package/es/components/empty/src/empty2.mjs.map +1 -1
- package/es/components/index.mjs +4 -4
- package/es/components/message-box/src/message-box.type.d.ts +1 -1
- package/es/components/pagination/src/components/jumper2.mjs +2 -2
- package/es/components/pagination/src/components/jumper2.mjs.map +1 -1
- package/es/components/popconfirm/src/popconfirm.mjs +1 -1
- package/es/components/popover/src/popover.mjs +1 -1
- package/es/components/select/src/select.mjs +1 -1
- package/es/components/select-v2/src/defaults.mjs +1 -1
- package/es/components/tooltip/index.mjs +1 -1
- package/es/components/tooltip/src/content.mjs +177 -32
- package/es/components/tooltip/src/content.mjs.map +1 -1
- package/es/components/tooltip/src/content2.mjs +32 -177
- package/es/components/tooltip/src/content2.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip.mjs +1 -1
- package/es/components/tooltip/src/tooltip2.mjs +1 -1
- package/es/index.mjs +4 -4
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/autocomplete/src/autocomplete.js +1 -1
- package/lib/components/calendar/src/calendar2.js +1 -1
- package/lib/components/calendar/src/date-table.js +37 -87
- package/lib/components/calendar/src/date-table.js.map +1 -1
- package/lib/components/calendar/src/date-table2.js +87 -37
- package/lib/components/calendar/src/date-table2.js.map +1 -1
- package/lib/components/calendar/src/use-date-table.js +1 -1
- package/lib/components/cascader/src/cascader.js +1 -1
- package/lib/components/col/index.js +2 -2
- package/lib/components/col/src/col.js +43 -66
- package/lib/components/col/src/col.js.map +1 -1
- package/lib/components/col/src/col2.js +66 -43
- package/lib/components/col/src/col2.js.map +1 -1
- package/lib/components/color-picker/src/color-picker.js +1 -1
- package/lib/components/drawer/index.js +2 -2
- package/lib/components/drawer/src/drawer.js +28 -181
- package/lib/components/drawer/src/drawer.js.map +1 -1
- package/lib/components/drawer/src/drawer2.js +181 -28
- package/lib/components/drawer/src/drawer2.js.map +1 -1
- package/lib/components/dropdown/src/dropdown.js +1 -1
- package/lib/components/empty/index.js +2 -2
- package/lib/components/empty/src/empty.js +11 -55
- package/lib/components/empty/src/empty.js.map +1 -1
- package/lib/components/empty/src/empty2.js +55 -11
- package/lib/components/empty/src/empty2.js.map +1 -1
- package/lib/components/index.js +4 -4
- package/lib/components/message-box/src/message-box.type.d.ts +1 -1
- package/lib/components/pagination/src/components/jumper2.js +2 -2
- package/lib/components/pagination/src/components/jumper2.js.map +1 -1
- package/lib/components/popconfirm/src/popconfirm.js +1 -1
- package/lib/components/popover/src/popover.js +1 -1
- package/lib/components/select/src/select.js +1 -1
- package/lib/components/select-v2/src/defaults.js +1 -1
- package/lib/components/tooltip/index.js +1 -1
- package/lib/components/tooltip/src/content.js +177 -32
- package/lib/components/tooltip/src/content.js.map +1 -1
- package/lib/components/tooltip/src/content2.js +32 -177
- package/lib/components/tooltip/src/content2.js.map +1 -1
- package/lib/components/tooltip/src/tooltip.js +1 -1
- package/lib/components/tooltip/src/tooltip2.js +1 -1
- package/lib/index.js +4 -4
- 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/web-types.json +1 -1
|
@@ -1,93 +1,39 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
1
|
+
import '../../../utils/index.mjs';
|
|
2
|
+
import '../../time-picker/index.mjs';
|
|
3
|
+
import { rangeArr } from '../../time-picker/src/utils.mjs';
|
|
4
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
5
|
+
import { isObject } from '@vue/shared';
|
|
7
6
|
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
const getPrevMonthLastDays = (date, count) => {
|
|
8
|
+
const lastDay = date.subtract(1, "month").endOf("month").date();
|
|
9
|
+
return rangeArr(count).map((_, index) => lastDay - (count - index - 1));
|
|
10
|
+
};
|
|
11
|
+
const getMonthDays = (date) => {
|
|
12
|
+
const days = date.daysInMonth();
|
|
13
|
+
return rangeArr(days).map((_, index) => index + 1);
|
|
14
|
+
};
|
|
15
|
+
const toNestedArr = (days) => rangeArr(days.length / 7).map((index) => {
|
|
16
|
+
const start = index * 7;
|
|
17
|
+
return days.slice(start, start + 7);
|
|
12
18
|
});
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
getSlotData
|
|
27
|
-
} = useDateTable(props, emit);
|
|
28
|
-
const nsTable = useNamespace("calendar-table");
|
|
29
|
-
const nsDay = useNamespace("calendar-day");
|
|
30
|
-
const getCellClass = ({ text, type }) => {
|
|
31
|
-
const classes = [type];
|
|
32
|
-
if (type === "current") {
|
|
33
|
-
const date = getFormattedDate(text, type);
|
|
34
|
-
if (date.isSame(props.selectedDay, "day")) {
|
|
35
|
-
classes.push(nsDay.is("selected"));
|
|
36
|
-
}
|
|
37
|
-
if (date.isSame(now, "day")) {
|
|
38
|
-
classes.push(nsDay.is("today"));
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return classes;
|
|
42
|
-
};
|
|
43
|
-
expose({
|
|
44
|
-
getFormattedDate
|
|
45
|
-
});
|
|
46
|
-
return (_ctx, _cache) => {
|
|
47
|
-
return openBlock(), createElementBlock("table", {
|
|
48
|
-
class: normalizeClass([unref(nsTable).b(), unref(nsTable).is("range", unref(isInRange))]),
|
|
49
|
-
cellspacing: "0",
|
|
50
|
-
cellpadding: "0"
|
|
51
|
-
}, [
|
|
52
|
-
!_ctx.hideHeader ? (openBlock(), createElementBlock("thead", _hoisted_1, [
|
|
53
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(weekDays), (day) => {
|
|
54
|
-
return openBlock(), createElementBlock("th", { key: day }, toDisplayString(day), 1);
|
|
55
|
-
}), 128))
|
|
56
|
-
])) : createCommentVNode("v-if", true),
|
|
57
|
-
createElementVNode("tbody", null, [
|
|
58
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(rows), (row, index) => {
|
|
59
|
-
return openBlock(), createElementBlock("tr", {
|
|
60
|
-
key: index,
|
|
61
|
-
class: normalizeClass({
|
|
62
|
-
[unref(nsTable).e("row")]: true,
|
|
63
|
-
[unref(nsTable).em("row", "hide-border")]: index === 0 && _ctx.hideHeader
|
|
64
|
-
})
|
|
65
|
-
}, [
|
|
66
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(row, (cell, key) => {
|
|
67
|
-
return openBlock(), createElementBlock("td", {
|
|
68
|
-
key,
|
|
69
|
-
class: normalizeClass(getCellClass(cell)),
|
|
70
|
-
onClick: ($event) => unref(handlePickDay)(cell)
|
|
71
|
-
}, [
|
|
72
|
-
createElementVNode("div", {
|
|
73
|
-
class: normalizeClass(unref(nsDay).b())
|
|
74
|
-
}, [
|
|
75
|
-
renderSlot(_ctx.$slots, "date-cell", {
|
|
76
|
-
data: unref(getSlotData)(cell)
|
|
77
|
-
}, () => [
|
|
78
|
-
createElementVNode("span", null, toDisplayString(cell.text), 1)
|
|
79
|
-
])
|
|
80
|
-
], 2)
|
|
81
|
-
], 10, _hoisted_2);
|
|
82
|
-
}), 128))
|
|
83
|
-
], 2);
|
|
84
|
-
}), 128))
|
|
85
|
-
])
|
|
86
|
-
], 2);
|
|
87
|
-
};
|
|
19
|
+
const dateTableProps = buildProps({
|
|
20
|
+
selectedDay: {
|
|
21
|
+
type: definePropType(Object)
|
|
22
|
+
},
|
|
23
|
+
range: {
|
|
24
|
+
type: definePropType(Array)
|
|
25
|
+
},
|
|
26
|
+
date: {
|
|
27
|
+
type: definePropType(Object),
|
|
28
|
+
required: true
|
|
29
|
+
},
|
|
30
|
+
hideHeader: {
|
|
31
|
+
type: Boolean
|
|
88
32
|
}
|
|
89
33
|
});
|
|
90
|
-
|
|
34
|
+
const dateTableEmits = {
|
|
35
|
+
pick: (value) => isObject(value)
|
|
36
|
+
};
|
|
91
37
|
|
|
92
|
-
export {
|
|
38
|
+
export { dateTableEmits, dateTableProps, getMonthDays, getPrevMonthLastDays, toNestedArr };
|
|
93
39
|
//# sourceMappingURL=date-table.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-table.mjs","sources":["../../../../../../packages/components/calendar/src/date-table.
|
|
1
|
+
{"version":3,"file":"date-table.mjs","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'\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"],"names":[],"mappings":";;;;;;AAEY,MAAC,oBAAoB,GAAG,CAAC,IAAI,EAAE,KAAK,KAAK;AACrD,EAAE,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;AAClE,EAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,OAAO,IAAI,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;AAC1E,EAAE;AACU,MAAC,YAAY,GAAG,CAAC,IAAI,KAAK;AACtC,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;AAClC,EAAE,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC;AACrD,EAAE;AACU,MAAC,WAAW,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK;AAC9E,EAAE,MAAM,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC;AAC1B,EAAE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;AACtC,CAAC,EAAE;AACS,MAAC,cAAc,GAAG,UAAU,CAAC;AACzC,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,IAAI,QAAQ,EAAE,IAAI;AAClB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,OAAO;AACjB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,cAAc,GAAG;AAC9B,EAAE,IAAI,EAAE,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC;AAClC;;;;"}
|
|
@@ -1,39 +1,93 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, Fragment, renderList, toDisplayString, createCommentVNode, createElementVNode, renderSlot } from 'vue';
|
|
2
|
+
import '../../../hooks/index.mjs';
|
|
3
|
+
import { dateTableProps, dateTableEmits } from './date-table.mjs';
|
|
4
|
+
import { useDateTable } from './use-date-table.mjs';
|
|
5
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
6
7
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const getMonthDays = (date) => {
|
|
12
|
-
const days = date.daysInMonth();
|
|
13
|
-
return rangeArr(days).map((_, index) => index + 1);
|
|
14
|
-
};
|
|
15
|
-
const toNestedArr = (days) => rangeArr(days.length / 7).map((index) => {
|
|
16
|
-
const start = index * 7;
|
|
17
|
-
return days.slice(start, start + 7);
|
|
8
|
+
const _hoisted_1 = { key: 0 };
|
|
9
|
+
const _hoisted_2 = ["onClick"];
|
|
10
|
+
const __default__ = defineComponent({
|
|
11
|
+
name: "DateTable"
|
|
18
12
|
});
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
13
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
|
+
...__default__,
|
|
15
|
+
props: dateTableProps,
|
|
16
|
+
emits: dateTableEmits,
|
|
17
|
+
setup(__props, { expose, emit }) {
|
|
18
|
+
const props = __props;
|
|
19
|
+
const {
|
|
20
|
+
isInRange,
|
|
21
|
+
now,
|
|
22
|
+
rows,
|
|
23
|
+
weekDays,
|
|
24
|
+
getFormattedDate,
|
|
25
|
+
handlePickDay,
|
|
26
|
+
getSlotData
|
|
27
|
+
} = useDateTable(props, emit);
|
|
28
|
+
const nsTable = useNamespace("calendar-table");
|
|
29
|
+
const nsDay = useNamespace("calendar-day");
|
|
30
|
+
const getCellClass = ({ text, type }) => {
|
|
31
|
+
const classes = [type];
|
|
32
|
+
if (type === "current") {
|
|
33
|
+
const date = getFormattedDate(text, type);
|
|
34
|
+
if (date.isSame(props.selectedDay, "day")) {
|
|
35
|
+
classes.push(nsDay.is("selected"));
|
|
36
|
+
}
|
|
37
|
+
if (date.isSame(now, "day")) {
|
|
38
|
+
classes.push(nsDay.is("today"));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return classes;
|
|
42
|
+
};
|
|
43
|
+
expose({
|
|
44
|
+
getFormattedDate
|
|
45
|
+
});
|
|
46
|
+
return (_ctx, _cache) => {
|
|
47
|
+
return openBlock(), createElementBlock("table", {
|
|
48
|
+
class: normalizeClass([unref(nsTable).b(), unref(nsTable).is("range", unref(isInRange))]),
|
|
49
|
+
cellspacing: "0",
|
|
50
|
+
cellpadding: "0"
|
|
51
|
+
}, [
|
|
52
|
+
!_ctx.hideHeader ? (openBlock(), createElementBlock("thead", _hoisted_1, [
|
|
53
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(weekDays), (day) => {
|
|
54
|
+
return openBlock(), createElementBlock("th", { key: day }, toDisplayString(day), 1);
|
|
55
|
+
}), 128))
|
|
56
|
+
])) : createCommentVNode("v-if", true),
|
|
57
|
+
createElementVNode("tbody", null, [
|
|
58
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(rows), (row, index) => {
|
|
59
|
+
return openBlock(), createElementBlock("tr", {
|
|
60
|
+
key: index,
|
|
61
|
+
class: normalizeClass({
|
|
62
|
+
[unref(nsTable).e("row")]: true,
|
|
63
|
+
[unref(nsTable).em("row", "hide-border")]: index === 0 && _ctx.hideHeader
|
|
64
|
+
})
|
|
65
|
+
}, [
|
|
66
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(row, (cell, key) => {
|
|
67
|
+
return openBlock(), createElementBlock("td", {
|
|
68
|
+
key,
|
|
69
|
+
class: normalizeClass(getCellClass(cell)),
|
|
70
|
+
onClick: ($event) => unref(handlePickDay)(cell)
|
|
71
|
+
}, [
|
|
72
|
+
createElementVNode("div", {
|
|
73
|
+
class: normalizeClass(unref(nsDay).b())
|
|
74
|
+
}, [
|
|
75
|
+
renderSlot(_ctx.$slots, "date-cell", {
|
|
76
|
+
data: unref(getSlotData)(cell)
|
|
77
|
+
}, () => [
|
|
78
|
+
createElementVNode("span", null, toDisplayString(cell.text), 1)
|
|
79
|
+
])
|
|
80
|
+
], 2)
|
|
81
|
+
], 10, _hoisted_2);
|
|
82
|
+
}), 128))
|
|
83
|
+
], 2);
|
|
84
|
+
}), 128))
|
|
85
|
+
])
|
|
86
|
+
], 2);
|
|
87
|
+
};
|
|
32
88
|
}
|
|
33
89
|
});
|
|
34
|
-
|
|
35
|
-
pick: (value) => isObject(value)
|
|
36
|
-
};
|
|
90
|
+
var DateTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "date-table.vue"]]);
|
|
37
91
|
|
|
38
|
-
export {
|
|
92
|
+
export { DateTable as default };
|
|
39
93
|
//# sourceMappingURL=date-table2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-table2.mjs","sources":["../../../../../../packages/components/calendar/src/date-table.
|
|
1
|
+
{"version":3,"file":"date-table2.mjs","sources":["../../../../../../packages/components/calendar/src/date-table.vue"],"sourcesContent":["<template>\n <table\n :class=\"[nsTable.b(), nsTable.is('range', isInRange)]\"\n cellspacing=\"0\"\n cellpadding=\"0\"\n >\n <thead v-if=\"!hideHeader\">\n <th v-for=\"day in weekDays\" :key=\"day\">{{ day }}</th>\n </thead>\n\n <tbody>\n <tr\n v-for=\"(row, index) in rows\"\n :key=\"index\"\n :class=\"{\n [nsTable.e('row')]: true,\n [nsTable.em('row', 'hide-border')]: index === 0 && hideHeader,\n }\"\n >\n <td\n v-for=\"(cell, key) in row\"\n :key=\"key\"\n :class=\"getCellClass(cell)\"\n @click=\"handlePickDay(cell)\"\n >\n <div :class=\"nsDay.b()\">\n <slot name=\"date-cell\" :data=\"getSlotData(cell)\">\n <span>{{ cell.text }}</span>\n </slot>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useNamespace } from '@element-plus/hooks'\nimport { dateTableEmits, dateTableProps } from './date-table'\nimport { useDateTable } from './use-date-table'\n\nimport type { CalendarDateCell } from './date-table'\n\ndefineOptions({\n name: 'DateTable',\n})\n\nconst props = defineProps(dateTableProps)\nconst emit = defineEmits(dateTableEmits)\n\nconst {\n isInRange,\n now,\n rows,\n weekDays,\n getFormattedDate,\n handlePickDay,\n getSlotData,\n} = useDateTable(props, emit)\n\nconst nsTable = useNamespace('calendar-table')\nconst nsDay = useNamespace('calendar-day')\n\nconst getCellClass = ({ text, type }: CalendarDateCell) => {\n const classes: string[] = [type]\n if (type === 'current') {\n const date = getFormattedDate(text, type)\n if (date.isSame(props.selectedDay, 'day')) {\n classes.push(nsDay.is('selected'))\n }\n if (date.isSame(now, 'day')) {\n classes.push(nsDay.is('today'))\n }\n }\n return classes\n}\n\ndefineExpose({\n /** @description toggle date panel */\n getFormattedDate,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;mCA2Cc,CAAA;AAAA,EACZ,IAAM,EAAA,WAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA;AAAA,MACJ,SAAA;AAAA,MACA,GAAA;AAAA,MACA,IAAA;AAAA,MACA,QAAA;AAAA,MACA,gBAAA;AAAA,MACA,aAAA;AAAA,MACA,WAAA;AAAA,KACE,GAAA,YAAA,CAAa,OAAO,IAAI,CAAA,CAAA;AAE5B,IAAM,MAAA,OAAA,GAAU,aAAa,gBAAgB,CAAA,CAAA;AAC7C,IAAM,MAAA,KAAA,GAAQ,aAAa,cAAc,CAAA,CAAA;AAEzC,IAAA,MAAM,YAAe,GAAA,CAAC,EAAE,IAAA,EAAM,IAA6B,EAAA,KAAA;AACzD,MAAM,MAAA,OAAA,GAAoB,CAAC,IAAI,CAAA,CAAA;AAC/B,MAAA,IAAI,SAAS,SAAW,EAAA;AACtB,QAAM,MAAA,IAAA,GAAO,gBAAiB,CAAA,IAAA,EAAM,IAAI,CAAA,CAAA;AACxC,QAAA,IAAI,IAAK,CAAA,MAAA,CAAO,KAAM,CAAA,WAAA,EAAa,KAAK,CAAG,EAAA;AACzC,UAAA,OAAA,CAAQ,IAAK,CAAA,KAAA,CAAM,EAAG,CAAA,UAAU,CAAC,CAAA,CAAA;AAAA,SACnC;AACA,QAAA,IAAI,IAAK,CAAA,MAAA,CAAO,GAAK,EAAA,KAAK,CAAG,EAAA;AAC3B,UAAA,OAAA,CAAQ,IAAK,CAAA,KAAA,CAAM,EAAG,CAAA,OAAO,CAAC,CAAA,CAAA;AAAA,SAChC;AAAA,OACF;AACA,MAAO,OAAA,OAAA,CAAA;AAAA,KACT,CAAA;AAEA,IAAa,MAAA,CAAA;AAAA,MAEX,gBAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -4,7 +4,7 @@ import localeData from 'dayjs/plugin/localeData.js';
|
|
|
4
4
|
import '../../../hooks/index.mjs';
|
|
5
5
|
import '../../time-picker/index.mjs';
|
|
6
6
|
import '../../../constants/index.mjs';
|
|
7
|
-
import { getPrevMonthLastDays, getMonthDays, toNestedArr } from './date-
|
|
7
|
+
import { getPrevMonthLastDays, getMonthDays, toNestedArr } from './date-table.mjs';
|
|
8
8
|
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
9
9
|
import { rangeArr } from '../../time-picker/src/utils.mjs';
|
|
10
10
|
import { WEEK_DAYS } from '../../../constants/date.mjs';
|
|
@@ -7,7 +7,7 @@ import '../../../constants/index.mjs';
|
|
|
7
7
|
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
8
8
|
import { CommonProps } from '../../cascader-panel/src/config.mjs';
|
|
9
9
|
import { useSizeProp } from '../../../hooks/use-size/index.mjs';
|
|
10
|
-
import { useTooltipContentProps } from '../../tooltip/src/
|
|
10
|
+
import { useTooltipContentProps } from '../../tooltip/src/content2.mjs';
|
|
11
11
|
import { tagProps } from '../../tag/src/tag.mjs';
|
|
12
12
|
import { useEmptyValuesProps } from '../../../hooks/use-empty-values/index.mjs';
|
|
13
13
|
import { UPDATE_MODEL_EVENT, CHANGE_EVENT } from '../../../constants/event.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../../utils/index.mjs';
|
|
2
|
-
import Col from './src/
|
|
3
|
-
export { colProps } from './src/
|
|
2
|
+
import Col from './src/col2.mjs';
|
|
3
|
+
export { colProps } from './src/col.mjs';
|
|
4
4
|
import { withInstall } from '../../utils/vue/install.mjs';
|
|
5
5
|
|
|
6
6
|
const ElCol = withInstall(Col);
|
|
@@ -1,72 +1,49 @@
|
|
|
1
|
-
import { defineComponent, inject, computed, openBlock, createBlock, resolveDynamicComponent, normalizeClass, unref, normalizeStyle, withCtx, renderSlot } from 'vue';
|
|
2
1
|
import '../../../utils/index.mjs';
|
|
3
|
-
import '../../../
|
|
4
|
-
import '
|
|
5
|
-
import { colProps } from './col2.mjs';
|
|
6
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
7
|
-
import { rowContextKey } from '../../row/src/constants.mjs';
|
|
8
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
9
|
-
import { isNumber } from '../../../utils/types.mjs';
|
|
10
|
-
import { isObject } from '@vue/shared';
|
|
2
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
3
|
+
import { mutable } from '../../../utils/typescript.mjs';
|
|
11
4
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
classes.push(ns.is("guttered"));
|
|
53
|
-
}
|
|
54
|
-
return [ns.b(), classes];
|
|
55
|
-
});
|
|
56
|
-
return (_ctx, _cache) => {
|
|
57
|
-
return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
|
|
58
|
-
class: normalizeClass(unref(colKls)),
|
|
59
|
-
style: normalizeStyle(unref(style))
|
|
60
|
-
}, {
|
|
61
|
-
default: withCtx(() => [
|
|
62
|
-
renderSlot(_ctx.$slots, "default")
|
|
63
|
-
]),
|
|
64
|
-
_: 3
|
|
65
|
-
}, 8, ["class", "style"]);
|
|
66
|
-
};
|
|
5
|
+
const colProps = buildProps({
|
|
6
|
+
tag: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: "div"
|
|
9
|
+
},
|
|
10
|
+
span: {
|
|
11
|
+
type: Number,
|
|
12
|
+
default: 24
|
|
13
|
+
},
|
|
14
|
+
offset: {
|
|
15
|
+
type: Number,
|
|
16
|
+
default: 0
|
|
17
|
+
},
|
|
18
|
+
pull: {
|
|
19
|
+
type: Number,
|
|
20
|
+
default: 0
|
|
21
|
+
},
|
|
22
|
+
push: {
|
|
23
|
+
type: Number,
|
|
24
|
+
default: 0
|
|
25
|
+
},
|
|
26
|
+
xs: {
|
|
27
|
+
type: definePropType([Number, Object]),
|
|
28
|
+
default: () => mutable({})
|
|
29
|
+
},
|
|
30
|
+
sm: {
|
|
31
|
+
type: definePropType([Number, Object]),
|
|
32
|
+
default: () => mutable({})
|
|
33
|
+
},
|
|
34
|
+
md: {
|
|
35
|
+
type: definePropType([Number, Object]),
|
|
36
|
+
default: () => mutable({})
|
|
37
|
+
},
|
|
38
|
+
lg: {
|
|
39
|
+
type: definePropType([Number, Object]),
|
|
40
|
+
default: () => mutable({})
|
|
41
|
+
},
|
|
42
|
+
xl: {
|
|
43
|
+
type: definePropType([Number, Object]),
|
|
44
|
+
default: () => mutable({})
|
|
67
45
|
}
|
|
68
46
|
});
|
|
69
|
-
var Col = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "col.vue"]]);
|
|
70
47
|
|
|
71
|
-
export {
|
|
48
|
+
export { colProps };
|
|
72
49
|
//# sourceMappingURL=col.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"col.mjs","sources":["../../../../../../packages/components/col/src/col.
|
|
1
|
+
{"version":3,"file":"col.mjs","sources":["../../../../../../packages/components/col/src/col.ts"],"sourcesContent":["import { buildProps, definePropType, mutable } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Col from './col.vue'\n\nexport type ColSizeObject = {\n span?: number\n offset?: number\n pull?: number\n push?: number\n}\nexport type ColSize = number | ColSizeObject\n\nexport const colProps = buildProps({\n /**\n * @description custom element tag\n */\n tag: {\n type: String,\n default: 'div',\n },\n /**\n * @description number of column the grid spans\n */\n span: {\n type: Number,\n default: 24,\n },\n /**\n * @description number of spacing on the left side of the grid\n */\n offset: {\n type: Number,\n default: 0,\n },\n /**\n * @description number of columns that grid moves to the left\n */\n pull: {\n type: Number,\n default: 0,\n },\n /**\n * @description number of columns that grid moves to the right\n */\n push: {\n type: Number,\n default: 0,\n },\n /**\n * @description `<768px` Responsive columns or column props object\n */\n xs: {\n type: definePropType<ColSize>([Number, Object]),\n default: () => mutable({} as const),\n },\n /**\n * @description `≥768px` Responsive columns or column props object\n */\n sm: {\n type: definePropType<ColSize>([Number, Object]),\n default: () => mutable({} as const),\n },\n /**\n * @description `≥992px` Responsive columns or column props object\n */\n md: {\n type: definePropType<ColSize>([Number, Object]),\n default: () => mutable({} as const),\n },\n /**\n * @description `≥1200px` Responsive columns or column props object\n */\n lg: {\n type: definePropType<ColSize>([Number, Object]),\n default: () => mutable({} as const),\n },\n /**\n * @description `≥1920px` Responsive columns or column props object\n */\n xl: {\n type: definePropType<ColSize>([Number, Object]),\n default: () => mutable({} as const),\n },\n} as const)\nexport type ColProps = ExtractPropTypes<typeof colProps>\nexport type ColInstance = InstanceType<typeof Col>\n"],"names":[],"mappings":";;;;AACY,MAAC,QAAQ,GAAG,UAAU,CAAC;AACnC,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,MAAM,OAAO,CAAC,EAAE,CAAC;AAC9B,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,MAAM,OAAO,CAAC,EAAE,CAAC;AAC9B,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,MAAM,OAAO,CAAC,EAAE,CAAC;AAC9B,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,MAAM,OAAO,CAAC,EAAE,CAAC;AAC9B,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,MAAM,OAAO,CAAC,EAAE,CAAC;AAC9B,GAAG;AACH,CAAC;;;;"}
|
|
@@ -1,49 +1,72 @@
|
|
|
1
|
+
import { defineComponent, inject, computed, openBlock, createBlock, resolveDynamicComponent, normalizeClass, unref, normalizeStyle, withCtx, renderSlot } from 'vue';
|
|
1
2
|
import '../../../utils/index.mjs';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
3
|
+
import '../../../hooks/index.mjs';
|
|
4
|
+
import '../../row/index.mjs';
|
|
5
|
+
import { colProps } from './col.mjs';
|
|
6
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
7
|
+
import { rowContextKey } from '../../row/src/constants.mjs';
|
|
8
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
9
|
+
import { isNumber } from '../../../utils/types.mjs';
|
|
10
|
+
import { isObject } from '@vue/shared';
|
|
4
11
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
12
|
+
const __default__ = defineComponent({
|
|
13
|
+
name: "ElCol"
|
|
14
|
+
});
|
|
15
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
16
|
+
...__default__,
|
|
17
|
+
props: colProps,
|
|
18
|
+
setup(__props) {
|
|
19
|
+
const props = __props;
|
|
20
|
+
const { gutter } = inject(rowContextKey, { gutter: computed(() => 0) });
|
|
21
|
+
const ns = useNamespace("col");
|
|
22
|
+
const style = computed(() => {
|
|
23
|
+
const styles = {};
|
|
24
|
+
if (gutter.value) {
|
|
25
|
+
styles.paddingLeft = styles.paddingRight = `${gutter.value / 2}px`;
|
|
26
|
+
}
|
|
27
|
+
return styles;
|
|
28
|
+
});
|
|
29
|
+
const colKls = computed(() => {
|
|
30
|
+
const classes = [];
|
|
31
|
+
const pos = ["span", "offset", "pull", "push"];
|
|
32
|
+
pos.forEach((prop) => {
|
|
33
|
+
const size = props[prop];
|
|
34
|
+
if (isNumber(size)) {
|
|
35
|
+
if (prop === "span")
|
|
36
|
+
classes.push(ns.b(`${props[prop]}`));
|
|
37
|
+
else if (size > 0)
|
|
38
|
+
classes.push(ns.b(`${prop}-${props[prop]}`));
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
const sizes = ["xs", "sm", "md", "lg", "xl"];
|
|
42
|
+
sizes.forEach((size) => {
|
|
43
|
+
if (isNumber(props[size])) {
|
|
44
|
+
classes.push(ns.b(`${size}-${props[size]}`));
|
|
45
|
+
} else if (isObject(props[size])) {
|
|
46
|
+
Object.entries(props[size]).forEach(([prop, sizeProp]) => {
|
|
47
|
+
classes.push(prop !== "span" ? ns.b(`${size}-${prop}-${sizeProp}`) : ns.b(`${size}-${sizeProp}`));
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
if (gutter.value) {
|
|
52
|
+
classes.push(ns.is("guttered"));
|
|
53
|
+
}
|
|
54
|
+
return [ns.b(), classes];
|
|
55
|
+
});
|
|
56
|
+
return (_ctx, _cache) => {
|
|
57
|
+
return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
|
|
58
|
+
class: normalizeClass(unref(colKls)),
|
|
59
|
+
style: normalizeStyle(unref(style))
|
|
60
|
+
}, {
|
|
61
|
+
default: withCtx(() => [
|
|
62
|
+
renderSlot(_ctx.$slots, "default")
|
|
63
|
+
]),
|
|
64
|
+
_: 3
|
|
65
|
+
}, 8, ["class", "style"]);
|
|
66
|
+
};
|
|
45
67
|
}
|
|
46
68
|
});
|
|
69
|
+
var Col = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "col.vue"]]);
|
|
47
70
|
|
|
48
|
-
export {
|
|
71
|
+
export { Col as default };
|
|
49
72
|
//# sourceMappingURL=col2.mjs.map
|