@element-plus/nightly 0.0.20240215 → 0.0.20240216
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 +2 -2
- package/dist/index.full.min.js +2 -2
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +2 -2
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +2 -2
- 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/calendar/index.mjs +2 -2
- package/es/components/calendar/src/calendar.mjs +131 -18
- package/es/components/calendar/src/calendar.mjs.map +1 -1
- package/es/components/calendar/src/calendar2.mjs +18 -131
- package/es/components/calendar/src/calendar2.mjs.map +1 -1
- package/es/components/index.mjs +2 -2
- package/es/components/popconfirm/index.mjs +2 -2
- package/es/components/popconfirm/src/popconfirm.mjs +110 -47
- package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
- package/es/components/popconfirm/src/popconfirm2.mjs +47 -110
- package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
- package/es/index.mjs +2 -2
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/calendar/index.js +2 -2
- package/lib/components/calendar/src/calendar.js +131 -19
- package/lib/components/calendar/src/calendar.js.map +1 -1
- package/lib/components/calendar/src/calendar2.js +19 -131
- package/lib/components/calendar/src/calendar2.js.map +1 -1
- package/lib/components/index.js +2 -2
- package/lib/components/popconfirm/index.js +2 -2
- package/lib/components/popconfirm/src/popconfirm.js +110 -48
- package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
- package/lib/components/popconfirm/src/popconfirm2.js +48 -110
- package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
- package/lib/index.js +2 -2
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -1,23 +1,136 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot, toDisplayString, createVNode, withCtx, createTextVNode, createCommentVNode, createSlots, normalizeProps, mergeProps, Fragment, renderList, createBlock } from 'vue';
|
|
2
|
+
import { ElButtonGroup, ElButton } from '../../button/index.mjs';
|
|
3
|
+
import '../../../hooks/index.mjs';
|
|
4
|
+
import DateTable from './date-table2.mjs';
|
|
5
|
+
import { useCalendar } from './use-calendar.mjs';
|
|
6
|
+
import { calendarProps, calendarEmits } from './calendar2.mjs';
|
|
7
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
8
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
9
|
+
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
6
10
|
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
const COMPONENT_NAME = "ElCalendar";
|
|
12
|
+
const __default__ = defineComponent({
|
|
13
|
+
name: COMPONENT_NAME
|
|
14
|
+
});
|
|
15
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
16
|
+
...__default__,
|
|
17
|
+
props: calendarProps,
|
|
18
|
+
emits: calendarEmits,
|
|
19
|
+
setup(__props, { expose, emit }) {
|
|
20
|
+
const props = __props;
|
|
21
|
+
const ns = useNamespace("calendar");
|
|
22
|
+
const {
|
|
23
|
+
calculateValidatedDateRange,
|
|
24
|
+
date,
|
|
25
|
+
pickDay,
|
|
26
|
+
realSelectedDay,
|
|
27
|
+
selectDate,
|
|
28
|
+
validatedRange
|
|
29
|
+
} = useCalendar(props, emit, COMPONENT_NAME);
|
|
30
|
+
const { t } = useLocale();
|
|
31
|
+
const i18nDate = computed(() => {
|
|
32
|
+
const pickedMonth = `el.datepicker.month${date.value.format("M")}`;
|
|
33
|
+
return `${date.value.year()} ${t("el.datepicker.year")} ${t(pickedMonth)}`;
|
|
34
|
+
});
|
|
35
|
+
expose({
|
|
36
|
+
selectedDay: realSelectedDay,
|
|
37
|
+
pickDay,
|
|
38
|
+
selectDate,
|
|
39
|
+
calculateValidatedDateRange
|
|
40
|
+
});
|
|
41
|
+
return (_ctx, _cache) => {
|
|
42
|
+
return openBlock(), createElementBlock("div", {
|
|
43
|
+
class: normalizeClass(unref(ns).b())
|
|
44
|
+
}, [
|
|
45
|
+
createElementVNode("div", {
|
|
46
|
+
class: normalizeClass(unref(ns).e("header"))
|
|
47
|
+
}, [
|
|
48
|
+
renderSlot(_ctx.$slots, "header", { date: unref(i18nDate) }, () => [
|
|
49
|
+
createElementVNode("div", {
|
|
50
|
+
class: normalizeClass(unref(ns).e("title"))
|
|
51
|
+
}, toDisplayString(unref(i18nDate)), 3),
|
|
52
|
+
unref(validatedRange).length === 0 ? (openBlock(), createElementBlock("div", {
|
|
53
|
+
key: 0,
|
|
54
|
+
class: normalizeClass(unref(ns).e("button-group"))
|
|
55
|
+
}, [
|
|
56
|
+
createVNode(unref(ElButtonGroup), null, {
|
|
57
|
+
default: withCtx(() => [
|
|
58
|
+
createVNode(unref(ElButton), {
|
|
59
|
+
size: "small",
|
|
60
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(selectDate)("prev-month"))
|
|
61
|
+
}, {
|
|
62
|
+
default: withCtx(() => [
|
|
63
|
+
createTextVNode(toDisplayString(unref(t)("el.datepicker.prevMonth")), 1)
|
|
64
|
+
]),
|
|
65
|
+
_: 1
|
|
66
|
+
}),
|
|
67
|
+
createVNode(unref(ElButton), {
|
|
68
|
+
size: "small",
|
|
69
|
+
onClick: _cache[1] || (_cache[1] = ($event) => unref(selectDate)("today"))
|
|
70
|
+
}, {
|
|
71
|
+
default: withCtx(() => [
|
|
72
|
+
createTextVNode(toDisplayString(unref(t)("el.datepicker.today")), 1)
|
|
73
|
+
]),
|
|
74
|
+
_: 1
|
|
75
|
+
}),
|
|
76
|
+
createVNode(unref(ElButton), {
|
|
77
|
+
size: "small",
|
|
78
|
+
onClick: _cache[2] || (_cache[2] = ($event) => unref(selectDate)("next-month"))
|
|
79
|
+
}, {
|
|
80
|
+
default: withCtx(() => [
|
|
81
|
+
createTextVNode(toDisplayString(unref(t)("el.datepicker.nextMonth")), 1)
|
|
82
|
+
]),
|
|
83
|
+
_: 1
|
|
84
|
+
})
|
|
85
|
+
]),
|
|
86
|
+
_: 1
|
|
87
|
+
})
|
|
88
|
+
], 2)) : createCommentVNode("v-if", true)
|
|
89
|
+
])
|
|
90
|
+
], 2),
|
|
91
|
+
unref(validatedRange).length === 0 ? (openBlock(), createElementBlock("div", {
|
|
92
|
+
key: 0,
|
|
93
|
+
class: normalizeClass(unref(ns).e("body"))
|
|
94
|
+
}, [
|
|
95
|
+
createVNode(DateTable, {
|
|
96
|
+
date: unref(date),
|
|
97
|
+
"selected-day": unref(realSelectedDay),
|
|
98
|
+
onPick: unref(pickDay)
|
|
99
|
+
}, createSlots({ _: 2 }, [
|
|
100
|
+
_ctx.$slots["date-cell"] || _ctx.$slots.dateCell ? {
|
|
101
|
+
name: "date-cell",
|
|
102
|
+
fn: withCtx((data) => [
|
|
103
|
+
_ctx.$slots["date-cell"] ? renderSlot(_ctx.$slots, "date-cell", normalizeProps(mergeProps({ key: 0 }, data))) : renderSlot(_ctx.$slots, "dateCell", normalizeProps(mergeProps({ key: 1 }, data)))
|
|
104
|
+
])
|
|
105
|
+
} : void 0
|
|
106
|
+
]), 1032, ["date", "selected-day", "onPick"])
|
|
107
|
+
], 2)) : (openBlock(), createElementBlock("div", {
|
|
108
|
+
key: 1,
|
|
109
|
+
class: normalizeClass(unref(ns).e("body"))
|
|
110
|
+
}, [
|
|
111
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(validatedRange), (range_, index) => {
|
|
112
|
+
return openBlock(), createBlock(DateTable, {
|
|
113
|
+
key: index,
|
|
114
|
+
date: range_[0],
|
|
115
|
+
"selected-day": unref(realSelectedDay),
|
|
116
|
+
range: range_,
|
|
117
|
+
"hide-header": index !== 0,
|
|
118
|
+
onPick: unref(pickDay)
|
|
119
|
+
}, createSlots({ _: 2 }, [
|
|
120
|
+
_ctx.$slots["date-cell"] || _ctx.$slots.dateCell ? {
|
|
121
|
+
name: "date-cell",
|
|
122
|
+
fn: withCtx((data) => [
|
|
123
|
+
_ctx.$slots["date-cell"] ? renderSlot(_ctx.$slots, "date-cell", normalizeProps(mergeProps({ key: 0 }, data))) : renderSlot(_ctx.$slots, "dateCell", normalizeProps(mergeProps({ key: 1 }, data)))
|
|
124
|
+
])
|
|
125
|
+
} : void 0
|
|
126
|
+
]), 1032, ["date", "selected-day", "range", "hide-header", "onPick"]);
|
|
127
|
+
}), 128))
|
|
128
|
+
], 2))
|
|
129
|
+
], 2);
|
|
130
|
+
};
|
|
15
131
|
}
|
|
16
132
|
});
|
|
17
|
-
|
|
18
|
-
[UPDATE_MODEL_EVENT]: (value) => isDate(value),
|
|
19
|
-
[INPUT_EVENT]: (value) => isDate(value)
|
|
20
|
-
};
|
|
133
|
+
var Calendar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "calendar.vue"]]);
|
|
21
134
|
|
|
22
|
-
export {
|
|
135
|
+
export { Calendar as default };
|
|
23
136
|
//# sourceMappingURL=calendar.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.mjs","sources":["../../../../../../packages/components/calendar/src/calendar.
|
|
1
|
+
{"version":3,"file":"calendar.mjs","sources":["../../../../../../packages/components/calendar/src/calendar.vue"],"sourcesContent":["<template>\n <div :class=\"ns.b()\">\n <div :class=\"ns.e('header')\">\n <slot name=\"header\" :date=\"i18nDate\">\n <div :class=\"ns.e('title')\">{{ i18nDate }}</div>\n <div v-if=\"validatedRange.length === 0\" :class=\"ns.e('button-group')\">\n <el-button-group>\n <el-button size=\"small\" @click=\"selectDate('prev-month')\">\n {{ t('el.datepicker.prevMonth') }}\n </el-button>\n <el-button size=\"small\" @click=\"selectDate('today')\">\n {{ t('el.datepicker.today') }}\n </el-button>\n <el-button size=\"small\" @click=\"selectDate('next-month')\">\n {{ t('el.datepicker.nextMonth') }}\n </el-button>\n </el-button-group>\n </div>\n </slot>\n </div>\n <div v-if=\"validatedRange.length === 0\" :class=\"ns.e('body')\">\n <date-table :date=\"date\" :selected-day=\"realSelectedDay\" @pick=\"pickDay\">\n <template\n v-if=\"$slots['date-cell'] || $slots.dateCell\"\n #date-cell=\"data\"\n >\n <slot v-if=\"$slots['date-cell']\" name=\"date-cell\" v-bind=\"data\" />\n <slot v-else name=\"dateCell\" v-bind=\"data\" />\n </template>\n </date-table>\n </div>\n <div v-else :class=\"ns.e('body')\">\n <date-table\n v-for=\"(range_, index) in validatedRange\"\n :key=\"index\"\n :date=\"range_[0]\"\n :selected-day=\"realSelectedDay\"\n :range=\"range_\"\n :hide-header=\"index !== 0\"\n @pick=\"pickDay\"\n >\n <template\n v-if=\"$slots['date-cell'] || $slots.dateCell\"\n #date-cell=\"data\"\n >\n <slot v-if=\"$slots['date-cell']\" name=\"date-cell\" v-bind=\"data\" />\n <slot v-else name=\"dateCell\" v-bind=\"data\" />\n </template>\n </date-table>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { ElButton, ElButtonGroup } from '@element-plus/components/button'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\n\nimport DateTable from './date-table.vue'\nimport { useCalendar } from './use-calendar'\nimport { calendarEmits, calendarProps } from './calendar'\n\nconst ns = useNamespace('calendar')\n\nconst COMPONENT_NAME = 'ElCalendar'\ndefineOptions({\n name: COMPONENT_NAME,\n})\n\nconst props = defineProps(calendarProps)\nconst emit = defineEmits(calendarEmits)\n\nconst {\n calculateValidatedDateRange,\n date,\n pickDay,\n realSelectedDay,\n selectDate,\n validatedRange,\n} = useCalendar(props, emit, COMPONENT_NAME)\n\nconst { t } = useLocale()\n\nconst i18nDate = computed(() => {\n const pickedMonth = `el.datepicker.month${date.value.format('M')}`\n return `${date.value.year()} ${t('el.datepicker.year')} ${t(pickedMonth)}`\n})\n\ndefineExpose({\n /** @description currently selected date */\n selectedDay: realSelectedDay,\n /** @description select a specific date */\n pickDay,\n /** @description select date */\n selectDate,\n /** @description Calculate the validate date range according to the start and end dates */\n calculateValidatedDateRange,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;mCAiEc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;;AALA,IAAM,MAAA,EAAA,GAAK,aAAa,UAAU,CAAA,CAAA;AAUlC,IAAM,MAAA;AAAA,MACJ,2BAAA;AAAA,MACA,IAAA;AAAA,MACA,OAAA;AAAA,MACA,eAAA;AAAA,MACA,UAAA;AAAA,MACA,cAAA;AAAA,KACE,GAAA,WAAA,CAAY,KAAO,EAAA,IAAA,EAAM,cAAc,CAAA,CAAA;AAE3C,IAAM,MAAA,EAAE,MAAM,SAAU,EAAA,CAAA;AAExB,IAAM,MAAA,QAAA,GAAW,SAAS,MAAM;AAC9B,MAAA,MAAM,WAAc,GAAA,CAAA,mBAAA,EAAsB,IAAK,CAAA,KAAA,CAAM,OAAO,GAAG,CAAA,CAAA,CAAA,CAAA;AAC/D,MAAO,OAAA,CAAA,EAAG,KAAK,KAAM,CAAA,IAAA,MAAU,CAAE,CAAA,oBAAoB,CAAK,CAAA,CAAA,EAAA,CAAA,CAAE,WAAW,CAAA,CAAA,CAAA,CAAA;AAAA,KACxE,CAAA,CAAA;AAED,IAAa,MAAA,CAAA;AAAA,MAEX,WAAa,EAAA,eAAA;AAAA,MAEb,OAAA;AAAA,MAEA,UAAA;AAAA,MAEA,2BAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,136 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import '
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { calendarProps, calendarEmits } from './calendar.mjs';
|
|
7
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
8
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
9
|
-
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
1
|
+
import '../../../utils/index.mjs';
|
|
2
|
+
import '../../../constants/index.mjs';
|
|
3
|
+
import { isArray, isDate } from '@vue/shared';
|
|
4
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
5
|
+
import { UPDATE_MODEL_EVENT, INPUT_EVENT } from '../../../constants/event.mjs';
|
|
10
6
|
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
setup(__props, { expose, emit }) {
|
|
20
|
-
const props = __props;
|
|
21
|
-
const ns = useNamespace("calendar");
|
|
22
|
-
const {
|
|
23
|
-
calculateValidatedDateRange,
|
|
24
|
-
date,
|
|
25
|
-
pickDay,
|
|
26
|
-
realSelectedDay,
|
|
27
|
-
selectDate,
|
|
28
|
-
validatedRange
|
|
29
|
-
} = useCalendar(props, emit, COMPONENT_NAME);
|
|
30
|
-
const { t } = useLocale();
|
|
31
|
-
const i18nDate = computed(() => {
|
|
32
|
-
const pickedMonth = `el.datepicker.month${date.value.format("M")}`;
|
|
33
|
-
return `${date.value.year()} ${t("el.datepicker.year")} ${t(pickedMonth)}`;
|
|
34
|
-
});
|
|
35
|
-
expose({
|
|
36
|
-
selectedDay: realSelectedDay,
|
|
37
|
-
pickDay,
|
|
38
|
-
selectDate,
|
|
39
|
-
calculateValidatedDateRange
|
|
40
|
-
});
|
|
41
|
-
return (_ctx, _cache) => {
|
|
42
|
-
return openBlock(), createElementBlock("div", {
|
|
43
|
-
class: normalizeClass(unref(ns).b())
|
|
44
|
-
}, [
|
|
45
|
-
createElementVNode("div", {
|
|
46
|
-
class: normalizeClass(unref(ns).e("header"))
|
|
47
|
-
}, [
|
|
48
|
-
renderSlot(_ctx.$slots, "header", { date: unref(i18nDate) }, () => [
|
|
49
|
-
createElementVNode("div", {
|
|
50
|
-
class: normalizeClass(unref(ns).e("title"))
|
|
51
|
-
}, toDisplayString(unref(i18nDate)), 3),
|
|
52
|
-
unref(validatedRange).length === 0 ? (openBlock(), createElementBlock("div", {
|
|
53
|
-
key: 0,
|
|
54
|
-
class: normalizeClass(unref(ns).e("button-group"))
|
|
55
|
-
}, [
|
|
56
|
-
createVNode(unref(ElButtonGroup), null, {
|
|
57
|
-
default: withCtx(() => [
|
|
58
|
-
createVNode(unref(ElButton), {
|
|
59
|
-
size: "small",
|
|
60
|
-
onClick: _cache[0] || (_cache[0] = ($event) => unref(selectDate)("prev-month"))
|
|
61
|
-
}, {
|
|
62
|
-
default: withCtx(() => [
|
|
63
|
-
createTextVNode(toDisplayString(unref(t)("el.datepicker.prevMonth")), 1)
|
|
64
|
-
]),
|
|
65
|
-
_: 1
|
|
66
|
-
}),
|
|
67
|
-
createVNode(unref(ElButton), {
|
|
68
|
-
size: "small",
|
|
69
|
-
onClick: _cache[1] || (_cache[1] = ($event) => unref(selectDate)("today"))
|
|
70
|
-
}, {
|
|
71
|
-
default: withCtx(() => [
|
|
72
|
-
createTextVNode(toDisplayString(unref(t)("el.datepicker.today")), 1)
|
|
73
|
-
]),
|
|
74
|
-
_: 1
|
|
75
|
-
}),
|
|
76
|
-
createVNode(unref(ElButton), {
|
|
77
|
-
size: "small",
|
|
78
|
-
onClick: _cache[2] || (_cache[2] = ($event) => unref(selectDate)("next-month"))
|
|
79
|
-
}, {
|
|
80
|
-
default: withCtx(() => [
|
|
81
|
-
createTextVNode(toDisplayString(unref(t)("el.datepicker.nextMonth")), 1)
|
|
82
|
-
]),
|
|
83
|
-
_: 1
|
|
84
|
-
})
|
|
85
|
-
]),
|
|
86
|
-
_: 1
|
|
87
|
-
})
|
|
88
|
-
], 2)) : createCommentVNode("v-if", true)
|
|
89
|
-
])
|
|
90
|
-
], 2),
|
|
91
|
-
unref(validatedRange).length === 0 ? (openBlock(), createElementBlock("div", {
|
|
92
|
-
key: 0,
|
|
93
|
-
class: normalizeClass(unref(ns).e("body"))
|
|
94
|
-
}, [
|
|
95
|
-
createVNode(DateTable, {
|
|
96
|
-
date: unref(date),
|
|
97
|
-
"selected-day": unref(realSelectedDay),
|
|
98
|
-
onPick: unref(pickDay)
|
|
99
|
-
}, createSlots({ _: 2 }, [
|
|
100
|
-
_ctx.$slots["date-cell"] || _ctx.$slots.dateCell ? {
|
|
101
|
-
name: "date-cell",
|
|
102
|
-
fn: withCtx((data) => [
|
|
103
|
-
_ctx.$slots["date-cell"] ? renderSlot(_ctx.$slots, "date-cell", normalizeProps(mergeProps({ key: 0 }, data))) : renderSlot(_ctx.$slots, "dateCell", normalizeProps(mergeProps({ key: 1 }, data)))
|
|
104
|
-
])
|
|
105
|
-
} : void 0
|
|
106
|
-
]), 1032, ["date", "selected-day", "onPick"])
|
|
107
|
-
], 2)) : (openBlock(), createElementBlock("div", {
|
|
108
|
-
key: 1,
|
|
109
|
-
class: normalizeClass(unref(ns).e("body"))
|
|
110
|
-
}, [
|
|
111
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(validatedRange), (range_, index) => {
|
|
112
|
-
return openBlock(), createBlock(DateTable, {
|
|
113
|
-
key: index,
|
|
114
|
-
date: range_[0],
|
|
115
|
-
"selected-day": unref(realSelectedDay),
|
|
116
|
-
range: range_,
|
|
117
|
-
"hide-header": index !== 0,
|
|
118
|
-
onPick: unref(pickDay)
|
|
119
|
-
}, createSlots({ _: 2 }, [
|
|
120
|
-
_ctx.$slots["date-cell"] || _ctx.$slots.dateCell ? {
|
|
121
|
-
name: "date-cell",
|
|
122
|
-
fn: withCtx((data) => [
|
|
123
|
-
_ctx.$slots["date-cell"] ? renderSlot(_ctx.$slots, "date-cell", normalizeProps(mergeProps({ key: 0 }, data))) : renderSlot(_ctx.$slots, "dateCell", normalizeProps(mergeProps({ key: 1 }, data)))
|
|
124
|
-
])
|
|
125
|
-
} : void 0
|
|
126
|
-
]), 1032, ["date", "selected-day", "range", "hide-header", "onPick"]);
|
|
127
|
-
}), 128))
|
|
128
|
-
], 2))
|
|
129
|
-
], 2);
|
|
130
|
-
};
|
|
7
|
+
const isValidRange = (range) => isArray(range) && range.length === 2 && range.every((item) => isDate(item));
|
|
8
|
+
const calendarProps = buildProps({
|
|
9
|
+
modelValue: {
|
|
10
|
+
type: Date
|
|
11
|
+
},
|
|
12
|
+
range: {
|
|
13
|
+
type: definePropType(Array),
|
|
14
|
+
validator: isValidRange
|
|
131
15
|
}
|
|
132
16
|
});
|
|
133
|
-
|
|
17
|
+
const calendarEmits = {
|
|
18
|
+
[UPDATE_MODEL_EVENT]: (value) => isDate(value),
|
|
19
|
+
[INPUT_EVENT]: (value) => isDate(value)
|
|
20
|
+
};
|
|
134
21
|
|
|
135
|
-
export {
|
|
22
|
+
export { calendarEmits, calendarProps };
|
|
136
23
|
//# sourceMappingURL=calendar2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar2.mjs","sources":["../../../../../../packages/components/calendar/src/calendar.
|
|
1
|
+
{"version":3,"file":"calendar2.mjs","sources":["../../../../../../packages/components/calendar/src/calendar.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n isArray,\n isDate,\n} from '@element-plus/utils'\nimport { INPUT_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport type { ExtractPropTypes } from 'vue'\n\nexport type CalendarDateType =\n | 'prev-month'\n | 'next-month'\n | 'prev-year'\n | 'next-year'\n | 'today'\n\nconst isValidRange = (range: unknown): range is [Date, Date] =>\n isArray(range) && range.length === 2 && range.every((item) => isDate(item))\n\nexport const calendarProps = buildProps({\n /**\n * @description binding value\n */\n modelValue: {\n type: Date,\n },\n /**\n * @description time range, including start time and end time.\n * Start time must be start day of week, end time must be end day of week, the time span cannot exceed two months.\n */\n range: {\n type: definePropType<[Date, Date]>(Array),\n validator: isValidRange,\n },\n} as const)\nexport type CalendarProps = ExtractPropTypes<typeof calendarProps>\n\nexport const calendarEmits = {\n [UPDATE_MODEL_EVENT]: (value: Date) => isDate(value),\n [INPUT_EVENT]: (value: Date) => isDate(value),\n}\nexport type CalendarEmits = typeof calendarEmits\n"],"names":[],"mappings":";;;;;;AAOA,MAAM,YAAY,GAAG,CAAC,KAAK,KAAK,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AAChG,MAAC,aAAa,GAAG,UAAU,CAAC;AACxC,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,IAAI;AACd,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,SAAS,EAAE,YAAY;AAC3B,GAAG;AACH,CAAC,EAAE;AACS,MAAC,aAAa,GAAG;AAC7B,EAAE,CAAC,kBAAkB,GAAG,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC;AAChD,EAAE,CAAC,WAAW,GAAG,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC;AACzC;;;;"}
|
package/es/components/index.mjs
CHANGED
|
@@ -88,7 +88,7 @@ export { breadcrumbItemProps } from './breadcrumb/src/breadcrumb-item.mjs';
|
|
|
88
88
|
export { breadcrumbKey } from './breadcrumb/src/constants.mjs';
|
|
89
89
|
export { buttonEmits, buttonNativeTypes, buttonProps, buttonTypes } from './button/src/button.mjs';
|
|
90
90
|
export { buttonGroupContextKey } from './button/src/constants.mjs';
|
|
91
|
-
export { calendarEmits, calendarProps } from './calendar/src/
|
|
91
|
+
export { calendarEmits, calendarProps } from './calendar/src/calendar2.mjs';
|
|
92
92
|
export { cardProps } from './card/src/card.mjs';
|
|
93
93
|
export { carouselEmits, carouselProps } from './carousel/src/carousel.mjs';
|
|
94
94
|
export { carouselItemProps } from './carousel/src/carousel-item.mjs';
|
|
@@ -140,7 +140,7 @@ export { overlayEmits, overlayProps } from './overlay/src/overlay.mjs';
|
|
|
140
140
|
export { pageHeaderEmits, pageHeaderProps } from './page-header/src/page-header.mjs';
|
|
141
141
|
export { paginationEmits, paginationProps } from './pagination/src/pagination.mjs';
|
|
142
142
|
export { elPaginationKey } from './pagination/src/constants.mjs';
|
|
143
|
-
export { popconfirmEmits, popconfirmProps } from './popconfirm/src/
|
|
143
|
+
export { popconfirmEmits, popconfirmProps } from './popconfirm/src/popconfirm2.mjs';
|
|
144
144
|
export { Effect, popperProps, roleTypes, usePopperProps } from './popper/src/popper.mjs';
|
|
145
145
|
export { popperTriggerProps, usePopperTriggerProps } from './popper/src/trigger.mjs';
|
|
146
146
|
export { popperContentEmits, popperContentProps, popperCoreConfigProps, usePopperContentEmits, usePopperContentProps, usePopperCoreConfigProps } from './popper/src/content.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../../utils/index.mjs';
|
|
2
|
-
import Popconfirm from './src/
|
|
3
|
-
export { popconfirmEmits, popconfirmProps } from './src/
|
|
2
|
+
import Popconfirm from './src/popconfirm.mjs';
|
|
3
|
+
export { popconfirmEmits, popconfirmProps } from './src/popconfirm2.mjs';
|
|
4
4
|
import { withInstall } from '../../utils/vue/install.mjs';
|
|
5
5
|
|
|
6
6
|
const ElPopconfirm = withInstall(Popconfirm);
|
|
@@ -1,53 +1,116 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent, ref, computed, openBlock, createBlock, unref, mergeProps, withCtx, createElementVNode, normalizeClass, normalizeStyle, resolveDynamicComponent, createCommentVNode, createTextVNode, toDisplayString, createVNode, renderSlot } from 'vue';
|
|
2
|
+
import { ElButton } from '../../button/index.mjs';
|
|
3
|
+
import { ElIcon } from '../../icon/index.mjs';
|
|
4
|
+
import { ElTooltip } from '../../tooltip/index.mjs';
|
|
5
|
+
import '../../../hooks/index.mjs';
|
|
3
6
|
import '../../../utils/index.mjs';
|
|
4
|
-
import '
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { popconfirmProps, popconfirmEmits } from './popconfirm2.mjs';
|
|
8
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
9
|
+
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
10
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
11
|
+
import { addUnit } from '../../../utils/dom/style.mjs';
|
|
9
12
|
|
|
10
|
-
const
|
|
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
|
-
|
|
13
|
+
const __default__ = defineComponent({
|
|
14
|
+
name: "ElPopconfirm"
|
|
15
|
+
});
|
|
16
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
|
+
...__default__,
|
|
18
|
+
props: popconfirmProps,
|
|
19
|
+
emits: popconfirmEmits,
|
|
20
|
+
setup(__props, { emit }) {
|
|
21
|
+
const props = __props;
|
|
22
|
+
const { t } = useLocale();
|
|
23
|
+
const ns = useNamespace("popconfirm");
|
|
24
|
+
const tooltipRef = ref();
|
|
25
|
+
const hidePopper = () => {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
(_b = (_a = tooltipRef.value) == null ? void 0 : _a.onClose) == null ? void 0 : _b.call(_a);
|
|
28
|
+
};
|
|
29
|
+
const style = computed(() => {
|
|
30
|
+
return {
|
|
31
|
+
width: addUnit(props.width)
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
const confirm = (e) => {
|
|
35
|
+
emit("confirm", e);
|
|
36
|
+
hidePopper();
|
|
37
|
+
};
|
|
38
|
+
const cancel = (e) => {
|
|
39
|
+
emit("cancel", e);
|
|
40
|
+
hidePopper();
|
|
41
|
+
};
|
|
42
|
+
const finalConfirmButtonText = computed(() => props.confirmButtonText || t("el.popconfirm.confirmButtonText"));
|
|
43
|
+
const finalCancelButtonText = computed(() => props.cancelButtonText || t("el.popconfirm.cancelButtonText"));
|
|
44
|
+
return (_ctx, _cache) => {
|
|
45
|
+
return openBlock(), createBlock(unref(ElTooltip), mergeProps({
|
|
46
|
+
ref_key: "tooltipRef",
|
|
47
|
+
ref: tooltipRef,
|
|
48
|
+
trigger: "click",
|
|
49
|
+
effect: "light"
|
|
50
|
+
}, _ctx.$attrs, {
|
|
51
|
+
"popper-class": `${unref(ns).namespace.value}-popover`,
|
|
52
|
+
"popper-style": unref(style),
|
|
53
|
+
teleported: _ctx.teleported,
|
|
54
|
+
"fallback-placements": ["bottom", "top", "right", "left"],
|
|
55
|
+
"hide-after": _ctx.hideAfter,
|
|
56
|
+
persistent: _ctx.persistent
|
|
57
|
+
}), {
|
|
58
|
+
content: withCtx(() => [
|
|
59
|
+
createElementVNode("div", {
|
|
60
|
+
class: normalizeClass(unref(ns).b())
|
|
61
|
+
}, [
|
|
62
|
+
createElementVNode("div", {
|
|
63
|
+
class: normalizeClass(unref(ns).e("main"))
|
|
64
|
+
}, [
|
|
65
|
+
!_ctx.hideIcon && _ctx.icon ? (openBlock(), createBlock(unref(ElIcon), {
|
|
66
|
+
key: 0,
|
|
67
|
+
class: normalizeClass(unref(ns).e("icon")),
|
|
68
|
+
style: normalizeStyle({ color: _ctx.iconColor })
|
|
69
|
+
}, {
|
|
70
|
+
default: withCtx(() => [
|
|
71
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.icon)))
|
|
72
|
+
]),
|
|
73
|
+
_: 1
|
|
74
|
+
}, 8, ["class", "style"])) : createCommentVNode("v-if", true),
|
|
75
|
+
createTextVNode(" " + toDisplayString(_ctx.title), 1)
|
|
76
|
+
], 2),
|
|
77
|
+
createElementVNode("div", {
|
|
78
|
+
class: normalizeClass(unref(ns).e("action"))
|
|
79
|
+
}, [
|
|
80
|
+
createVNode(unref(ElButton), {
|
|
81
|
+
size: "small",
|
|
82
|
+
type: _ctx.cancelButtonType === "text" ? "" : _ctx.cancelButtonType,
|
|
83
|
+
text: _ctx.cancelButtonType === "text",
|
|
84
|
+
onClick: cancel
|
|
85
|
+
}, {
|
|
86
|
+
default: withCtx(() => [
|
|
87
|
+
createTextVNode(toDisplayString(unref(finalCancelButtonText)), 1)
|
|
88
|
+
]),
|
|
89
|
+
_: 1
|
|
90
|
+
}, 8, ["type", "text"]),
|
|
91
|
+
createVNode(unref(ElButton), {
|
|
92
|
+
size: "small",
|
|
93
|
+
type: _ctx.confirmButtonType === "text" ? "" : _ctx.confirmButtonType,
|
|
94
|
+
text: _ctx.confirmButtonType === "text",
|
|
95
|
+
onClick: confirm
|
|
96
|
+
}, {
|
|
97
|
+
default: withCtx(() => [
|
|
98
|
+
createTextVNode(toDisplayString(unref(finalConfirmButtonText)), 1)
|
|
99
|
+
]),
|
|
100
|
+
_: 1
|
|
101
|
+
}, 8, ["type", "text"])
|
|
102
|
+
], 2)
|
|
103
|
+
], 2)
|
|
104
|
+
]),
|
|
105
|
+
default: withCtx(() => [
|
|
106
|
+
_ctx.$slots.reference ? renderSlot(_ctx.$slots, "reference", { key: 0 }) : createCommentVNode("v-if", true)
|
|
107
|
+
]),
|
|
108
|
+
_: 3
|
|
109
|
+
}, 16, ["popper-class", "popper-style", "teleported", "hide-after", "persistent"]);
|
|
110
|
+
};
|
|
45
111
|
}
|
|
46
112
|
});
|
|
47
|
-
|
|
48
|
-
confirm: (e) => e instanceof MouseEvent,
|
|
49
|
-
cancel: (e) => e instanceof MouseEvent
|
|
50
|
-
};
|
|
113
|
+
var Popconfirm = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "popconfirm.vue"]]);
|
|
51
114
|
|
|
52
|
-
export {
|
|
115
|
+
export { Popconfirm as default };
|
|
53
116
|
//# sourceMappingURL=popconfirm.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popconfirm.mjs","sources":["../../../../../../packages/components/popconfirm/src/popconfirm.
|
|
1
|
+
{"version":3,"file":"popconfirm.mjs","sources":["../../../../../../packages/components/popconfirm/src/popconfirm.vue"],"sourcesContent":["<template>\n <el-tooltip\n ref=\"tooltipRef\"\n trigger=\"click\"\n effect=\"light\"\n v-bind=\"$attrs\"\n :popper-class=\"`${ns.namespace.value}-popover`\"\n :popper-style=\"style\"\n :teleported=\"teleported\"\n :fallback-placements=\"['bottom', 'top', 'right', 'left']\"\n :hide-after=\"hideAfter\"\n :persistent=\"persistent\"\n >\n <template #content>\n <div :class=\"ns.b()\">\n <div :class=\"ns.e('main')\">\n <el-icon\n v-if=\"!hideIcon && icon\"\n :class=\"ns.e('icon')\"\n :style=\"{ color: iconColor }\"\n >\n <component :is=\"icon\" />\n </el-icon>\n {{ title }}\n </div>\n <div :class=\"ns.e('action')\">\n <el-button\n size=\"small\"\n :type=\"cancelButtonType === 'text' ? '' : cancelButtonType\"\n :text=\"cancelButtonType === 'text'\"\n @click=\"cancel\"\n >\n {{ finalCancelButtonText }}\n </el-button>\n <el-button\n size=\"small\"\n :type=\"confirmButtonType === 'text' ? '' : confirmButtonType\"\n :text=\"confirmButtonType === 'text'\"\n @click=\"confirm\"\n >\n {{ finalConfirmButtonText }}\n </el-button>\n </div>\n </div>\n </template>\n <template v-if=\"$slots.reference\">\n <slot name=\"reference\" />\n </template>\n </el-tooltip>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, ref } from 'vue'\nimport ElButton from '@element-plus/components/button'\nimport ElIcon from '@element-plus/components/icon'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport { addUnit } from '@element-plus/utils'\nimport { popconfirmEmits, popconfirmProps } from './popconfirm'\n\nimport type { TooltipInstance } from '@element-plus/components/tooltip'\n\ndefineOptions({\n name: 'ElPopconfirm',\n})\n\nconst props = defineProps(popconfirmProps)\nconst emit = defineEmits(popconfirmEmits)\n\nconst { t } = useLocale()\nconst ns = useNamespace('popconfirm')\nconst tooltipRef = ref<TooltipInstance>()\n\nconst hidePopper = () => {\n tooltipRef.value?.onClose?.()\n}\n\nconst style = computed(() => {\n return {\n width: addUnit(props.width),\n }\n})\n\nconst confirm = (e: MouseEvent) => {\n emit('confirm', e)\n hidePopper()\n}\nconst cancel = (e: MouseEvent) => {\n emit('cancel', e)\n hidePopper()\n}\n\nconst finalConfirmButtonText = computed(\n () => props.confirmButtonText || t('el.popconfirm.confirmButtonText')\n)\nconst finalCancelButtonText = computed(\n () => props.cancelButtonText || t('el.popconfirm.cancelButtonText')\n)\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;mCA8Dc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,EAAE,MAAM,SAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAK,aAAa,YAAY,CAAA,CAAA;AACpC,IAAA,MAAM,aAAa,GAAqB,EAAA,CAAA;AAExC,IAAA,MAAM,aAAa,MAAM;AACvB,MAAA,IAAA,EAAA,EAAA,EAAA,CAAW;AAAiB,MAC9B,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,UAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,OAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA;AAEA,KAAM,CAAA;AACJ,IAAO,MAAA,KAAA,GAAA,QAAA,CAAA,MAAA;AAAA,MACL,OAAA;AAA0B,QAC5B,KAAA,EAAA,OAAA,CAAA,KAAA,CAAA,KAAA,CAAA;AAAA,OACD,CAAA;AAED,KAAM,CAAA,CAAA;AACJ,IAAA,MAAA,YAAgB,KAAC;AACjB,MAAW,IAAA,CAAA,SAAA,EAAA,CAAA,CAAA,CAAA;AAAA,MACb,UAAA,EAAA,CAAA;AACA,KAAM,CAAA;AACJ,IAAA,MAAA,WAAe,KAAC;AAChB,MAAW,IAAA,CAAA,QAAA,EAAA,CAAA,CAAA,CAAA;AAAA,MACb,UAAA,EAAA,CAAA;AAEA,KAAA,CAAA;AAGA,IAAA,MAAM,yBACJ,QAAA,CAAA,WAAY,CAAoB,iBAAA,IAAE,mCACpC,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|