@element-plus/nightly 0.0.20240214 → 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.
Files changed (319) hide show
  1. package/dist/index.full.js +2 -2
  2. package/dist/index.full.min.js +2 -2
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +2 -2
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +2 -2
  7. package/dist/locale/af.js +1 -1
  8. package/dist/locale/af.min.js +1 -1
  9. package/dist/locale/af.min.mjs +1 -1
  10. package/dist/locale/af.mjs +1 -1
  11. package/dist/locale/ar-eg.js +1 -1
  12. package/dist/locale/ar-eg.min.js +1 -1
  13. package/dist/locale/ar-eg.min.mjs +1 -1
  14. package/dist/locale/ar-eg.mjs +1 -1
  15. package/dist/locale/ar.js +1 -1
  16. package/dist/locale/ar.min.js +1 -1
  17. package/dist/locale/ar.min.mjs +1 -1
  18. package/dist/locale/ar.mjs +1 -1
  19. package/dist/locale/az.js +1 -1
  20. package/dist/locale/az.min.js +1 -1
  21. package/dist/locale/az.min.mjs +1 -1
  22. package/dist/locale/az.mjs +1 -1
  23. package/dist/locale/bg.js +1 -1
  24. package/dist/locale/bg.min.js +1 -1
  25. package/dist/locale/bg.min.mjs +1 -1
  26. package/dist/locale/bg.mjs +1 -1
  27. package/dist/locale/bn.js +1 -1
  28. package/dist/locale/bn.min.js +1 -1
  29. package/dist/locale/bn.min.mjs +1 -1
  30. package/dist/locale/bn.mjs +1 -1
  31. package/dist/locale/ca.js +1 -1
  32. package/dist/locale/ca.min.js +1 -1
  33. package/dist/locale/ca.min.mjs +1 -1
  34. package/dist/locale/ca.mjs +1 -1
  35. package/dist/locale/ckb.js +1 -1
  36. package/dist/locale/ckb.min.js +1 -1
  37. package/dist/locale/ckb.min.mjs +1 -1
  38. package/dist/locale/ckb.mjs +1 -1
  39. package/dist/locale/cs.js +1 -1
  40. package/dist/locale/cs.min.js +1 -1
  41. package/dist/locale/cs.min.mjs +1 -1
  42. package/dist/locale/cs.mjs +1 -1
  43. package/dist/locale/da.js +1 -1
  44. package/dist/locale/da.min.js +1 -1
  45. package/dist/locale/da.min.mjs +1 -1
  46. package/dist/locale/da.mjs +1 -1
  47. package/dist/locale/de.js +1 -1
  48. package/dist/locale/de.min.js +1 -1
  49. package/dist/locale/de.min.mjs +1 -1
  50. package/dist/locale/de.mjs +1 -1
  51. package/dist/locale/el.js +1 -1
  52. package/dist/locale/el.min.js +1 -1
  53. package/dist/locale/el.min.mjs +1 -1
  54. package/dist/locale/el.mjs +1 -1
  55. package/dist/locale/en.js +1 -1
  56. package/dist/locale/en.min.js +1 -1
  57. package/dist/locale/en.min.mjs +1 -1
  58. package/dist/locale/en.mjs +1 -1
  59. package/dist/locale/eo.js +1 -1
  60. package/dist/locale/eo.min.js +1 -1
  61. package/dist/locale/eo.min.mjs +1 -1
  62. package/dist/locale/eo.mjs +1 -1
  63. package/dist/locale/es.js +1 -1
  64. package/dist/locale/es.min.js +1 -1
  65. package/dist/locale/es.min.mjs +1 -1
  66. package/dist/locale/es.mjs +1 -1
  67. package/dist/locale/et.js +1 -1
  68. package/dist/locale/et.min.js +1 -1
  69. package/dist/locale/et.min.mjs +1 -1
  70. package/dist/locale/et.mjs +1 -1
  71. package/dist/locale/eu.js +1 -1
  72. package/dist/locale/eu.min.js +1 -1
  73. package/dist/locale/eu.min.mjs +1 -1
  74. package/dist/locale/eu.mjs +1 -1
  75. package/dist/locale/fa.js +1 -1
  76. package/dist/locale/fa.min.js +1 -1
  77. package/dist/locale/fa.min.mjs +1 -1
  78. package/dist/locale/fa.mjs +1 -1
  79. package/dist/locale/fi.js +1 -1
  80. package/dist/locale/fi.min.js +1 -1
  81. package/dist/locale/fi.min.mjs +1 -1
  82. package/dist/locale/fi.mjs +1 -1
  83. package/dist/locale/fr.js +1 -1
  84. package/dist/locale/fr.min.js +1 -1
  85. package/dist/locale/fr.min.mjs +1 -1
  86. package/dist/locale/fr.mjs +1 -1
  87. package/dist/locale/he.js +1 -1
  88. package/dist/locale/he.min.js +1 -1
  89. package/dist/locale/he.min.mjs +1 -1
  90. package/dist/locale/he.mjs +1 -1
  91. package/dist/locale/hr.js +1 -1
  92. package/dist/locale/hr.min.js +1 -1
  93. package/dist/locale/hr.min.mjs +1 -1
  94. package/dist/locale/hr.mjs +1 -1
  95. package/dist/locale/hu.js +1 -1
  96. package/dist/locale/hu.min.js +1 -1
  97. package/dist/locale/hu.min.mjs +1 -1
  98. package/dist/locale/hu.mjs +1 -1
  99. package/dist/locale/hy-am.js +1 -1
  100. package/dist/locale/hy-am.min.js +1 -1
  101. package/dist/locale/hy-am.min.mjs +1 -1
  102. package/dist/locale/hy-am.mjs +1 -1
  103. package/dist/locale/id.js +1 -1
  104. package/dist/locale/id.min.js +1 -1
  105. package/dist/locale/id.min.mjs +1 -1
  106. package/dist/locale/id.mjs +1 -1
  107. package/dist/locale/it.js +1 -1
  108. package/dist/locale/it.min.js +1 -1
  109. package/dist/locale/it.min.mjs +1 -1
  110. package/dist/locale/it.mjs +1 -1
  111. package/dist/locale/ja.js +1 -1
  112. package/dist/locale/ja.min.js +1 -1
  113. package/dist/locale/ja.min.mjs +1 -1
  114. package/dist/locale/ja.mjs +1 -1
  115. package/dist/locale/kk.js +1 -1
  116. package/dist/locale/kk.min.js +1 -1
  117. package/dist/locale/kk.min.mjs +1 -1
  118. package/dist/locale/kk.mjs +1 -1
  119. package/dist/locale/km.js +1 -1
  120. package/dist/locale/km.min.js +1 -1
  121. package/dist/locale/km.min.mjs +1 -1
  122. package/dist/locale/km.mjs +1 -1
  123. package/dist/locale/ko.js +1 -1
  124. package/dist/locale/ko.min.js +1 -1
  125. package/dist/locale/ko.min.mjs +1 -1
  126. package/dist/locale/ko.mjs +1 -1
  127. package/dist/locale/ku.js +1 -1
  128. package/dist/locale/ku.min.js +1 -1
  129. package/dist/locale/ku.min.mjs +1 -1
  130. package/dist/locale/ku.mjs +1 -1
  131. package/dist/locale/ky.js +1 -1
  132. package/dist/locale/ky.min.js +1 -1
  133. package/dist/locale/ky.min.mjs +1 -1
  134. package/dist/locale/ky.mjs +1 -1
  135. package/dist/locale/lt.js +1 -1
  136. package/dist/locale/lt.min.js +1 -1
  137. package/dist/locale/lt.min.mjs +1 -1
  138. package/dist/locale/lt.mjs +1 -1
  139. package/dist/locale/lv.js +1 -1
  140. package/dist/locale/lv.min.js +1 -1
  141. package/dist/locale/lv.min.mjs +1 -1
  142. package/dist/locale/lv.mjs +1 -1
  143. package/dist/locale/mg.js +1 -1
  144. package/dist/locale/mg.min.js +1 -1
  145. package/dist/locale/mg.min.mjs +1 -1
  146. package/dist/locale/mg.mjs +1 -1
  147. package/dist/locale/mn.js +1 -1
  148. package/dist/locale/mn.min.js +1 -1
  149. package/dist/locale/mn.min.mjs +1 -1
  150. package/dist/locale/mn.mjs +1 -1
  151. package/dist/locale/nb-no.js +1 -1
  152. package/dist/locale/nb-no.min.js +1 -1
  153. package/dist/locale/nb-no.min.mjs +1 -1
  154. package/dist/locale/nb-no.mjs +1 -1
  155. package/dist/locale/nl.js +1 -1
  156. package/dist/locale/nl.min.js +1 -1
  157. package/dist/locale/nl.min.mjs +1 -1
  158. package/dist/locale/nl.mjs +1 -1
  159. package/dist/locale/pa.js +1 -1
  160. package/dist/locale/pa.min.js +1 -1
  161. package/dist/locale/pa.min.mjs +1 -1
  162. package/dist/locale/pa.mjs +1 -1
  163. package/dist/locale/pl.js +1 -1
  164. package/dist/locale/pl.min.js +1 -1
  165. package/dist/locale/pl.min.mjs +1 -1
  166. package/dist/locale/pl.mjs +1 -1
  167. package/dist/locale/pt-br.js +1 -1
  168. package/dist/locale/pt-br.min.js +1 -1
  169. package/dist/locale/pt-br.min.mjs +1 -1
  170. package/dist/locale/pt-br.mjs +1 -1
  171. package/dist/locale/pt.js +1 -1
  172. package/dist/locale/pt.min.js +1 -1
  173. package/dist/locale/pt.min.mjs +1 -1
  174. package/dist/locale/pt.mjs +1 -1
  175. package/dist/locale/ro.js +1 -1
  176. package/dist/locale/ro.min.js +1 -1
  177. package/dist/locale/ro.min.mjs +1 -1
  178. package/dist/locale/ro.mjs +1 -1
  179. package/dist/locale/ru.js +1 -1
  180. package/dist/locale/ru.min.js +1 -1
  181. package/dist/locale/ru.min.mjs +1 -1
  182. package/dist/locale/ru.mjs +1 -1
  183. package/dist/locale/sk.js +1 -1
  184. package/dist/locale/sk.min.js +1 -1
  185. package/dist/locale/sk.min.mjs +1 -1
  186. package/dist/locale/sk.mjs +1 -1
  187. package/dist/locale/sl.js +1 -1
  188. package/dist/locale/sl.min.js +1 -1
  189. package/dist/locale/sl.min.mjs +1 -1
  190. package/dist/locale/sl.mjs +1 -1
  191. package/dist/locale/sr.js +1 -1
  192. package/dist/locale/sr.min.js +1 -1
  193. package/dist/locale/sr.min.mjs +1 -1
  194. package/dist/locale/sr.mjs +1 -1
  195. package/dist/locale/sv.js +1 -1
  196. package/dist/locale/sv.min.js +1 -1
  197. package/dist/locale/sv.min.mjs +1 -1
  198. package/dist/locale/sv.mjs +1 -1
  199. package/dist/locale/sw.js +1 -1
  200. package/dist/locale/sw.min.js +1 -1
  201. package/dist/locale/sw.min.mjs +1 -1
  202. package/dist/locale/sw.mjs +1 -1
  203. package/dist/locale/ta.js +1 -1
  204. package/dist/locale/ta.min.js +1 -1
  205. package/dist/locale/ta.min.mjs +1 -1
  206. package/dist/locale/ta.mjs +1 -1
  207. package/dist/locale/th.js +1 -1
  208. package/dist/locale/th.min.js +1 -1
  209. package/dist/locale/th.min.mjs +1 -1
  210. package/dist/locale/th.mjs +1 -1
  211. package/dist/locale/tk.js +1 -1
  212. package/dist/locale/tk.min.js +1 -1
  213. package/dist/locale/tk.min.mjs +1 -1
  214. package/dist/locale/tk.mjs +1 -1
  215. package/dist/locale/tr.js +1 -1
  216. package/dist/locale/tr.min.js +1 -1
  217. package/dist/locale/tr.min.mjs +1 -1
  218. package/dist/locale/tr.mjs +1 -1
  219. package/dist/locale/ug-cn.js +1 -1
  220. package/dist/locale/ug-cn.min.js +1 -1
  221. package/dist/locale/ug-cn.min.mjs +1 -1
  222. package/dist/locale/ug-cn.mjs +1 -1
  223. package/dist/locale/uk.js +1 -1
  224. package/dist/locale/uk.min.js +1 -1
  225. package/dist/locale/uk.min.mjs +1 -1
  226. package/dist/locale/uk.mjs +1 -1
  227. package/dist/locale/uz-uz.js +1 -1
  228. package/dist/locale/uz-uz.min.js +1 -1
  229. package/dist/locale/uz-uz.min.mjs +1 -1
  230. package/dist/locale/uz-uz.mjs +1 -1
  231. package/dist/locale/vi.js +1 -1
  232. package/dist/locale/vi.min.js +1 -1
  233. package/dist/locale/vi.min.mjs +1 -1
  234. package/dist/locale/vi.mjs +1 -1
  235. package/dist/locale/zh-cn.js +1 -1
  236. package/dist/locale/zh-cn.min.js +1 -1
  237. package/dist/locale/zh-cn.min.mjs +1 -1
  238. package/dist/locale/zh-cn.mjs +1 -1
  239. package/dist/locale/zh-tw.js +1 -1
  240. package/dist/locale/zh-tw.min.js +1 -1
  241. package/dist/locale/zh-tw.min.mjs +1 -1
  242. package/dist/locale/zh-tw.mjs +1 -1
  243. package/es/components/breadcrumb/index.mjs +2 -2
  244. package/es/components/breadcrumb/src/breadcrumb.mjs +11 -36
  245. package/es/components/breadcrumb/src/breadcrumb.mjs.map +1 -1
  246. package/es/components/breadcrumb/src/breadcrumb2.mjs +36 -11
  247. package/es/components/breadcrumb/src/breadcrumb2.mjs.map +1 -1
  248. package/es/components/button/index.mjs +1 -1
  249. package/es/components/button/src/button-group.mjs +6 -30
  250. package/es/components/button/src/button-group.mjs.map +1 -1
  251. package/es/components/button/src/button-group2.mjs +30 -6
  252. package/es/components/button/src/button-group2.mjs.map +1 -1
  253. package/es/components/calendar/index.mjs +2 -2
  254. package/es/components/calendar/src/calendar.mjs +131 -18
  255. package/es/components/calendar/src/calendar.mjs.map +1 -1
  256. package/es/components/calendar/src/calendar2.mjs +18 -131
  257. package/es/components/calendar/src/calendar2.mjs.map +1 -1
  258. package/es/components/index.mjs +3 -3
  259. package/es/components/popconfirm/index.mjs +2 -2
  260. package/es/components/popconfirm/src/popconfirm.mjs +110 -47
  261. package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
  262. package/es/components/popconfirm/src/popconfirm2.mjs +47 -110
  263. package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
  264. package/es/components/teleport/index.mjs +2 -2
  265. package/es/components/teleport/src/teleport.mjs +18 -44
  266. package/es/components/teleport/src/teleport.mjs.map +1 -1
  267. package/es/components/teleport/src/teleport2.mjs +44 -18
  268. package/es/components/teleport/src/teleport2.mjs.map +1 -1
  269. package/es/components/transfer/src/composables/use-check.mjs +1 -1
  270. package/es/components/transfer/src/transfer-panel.mjs +19 -128
  271. package/es/components/transfer/src/transfer-panel.mjs.map +1 -1
  272. package/es/components/transfer/src/transfer-panel2.mjs +128 -19
  273. package/es/components/transfer/src/transfer-panel2.mjs.map +1 -1
  274. package/es/components/transfer/src/transfer2.mjs +1 -1
  275. package/es/index.mjs +3 -3
  276. package/es/version.d.ts +1 -1
  277. package/es/version.mjs +1 -1
  278. package/es/version.mjs.map +1 -1
  279. package/lib/components/breadcrumb/index.js +2 -2
  280. package/lib/components/breadcrumb/src/breadcrumb.js +11 -36
  281. package/lib/components/breadcrumb/src/breadcrumb.js.map +1 -1
  282. package/lib/components/breadcrumb/src/breadcrumb2.js +36 -11
  283. package/lib/components/breadcrumb/src/breadcrumb2.js.map +1 -1
  284. package/lib/components/button/index.js +1 -1
  285. package/lib/components/button/src/button-group.js +6 -30
  286. package/lib/components/button/src/button-group.js.map +1 -1
  287. package/lib/components/button/src/button-group2.js +30 -6
  288. package/lib/components/button/src/button-group2.js.map +1 -1
  289. package/lib/components/calendar/index.js +2 -2
  290. package/lib/components/calendar/src/calendar.js +131 -19
  291. package/lib/components/calendar/src/calendar.js.map +1 -1
  292. package/lib/components/calendar/src/calendar2.js +19 -131
  293. package/lib/components/calendar/src/calendar2.js.map +1 -1
  294. package/lib/components/index.js +3 -3
  295. package/lib/components/popconfirm/index.js +2 -2
  296. package/lib/components/popconfirm/src/popconfirm.js +110 -48
  297. package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
  298. package/lib/components/popconfirm/src/popconfirm2.js +48 -110
  299. package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
  300. package/lib/components/teleport/index.js +2 -2
  301. package/lib/components/teleport/src/teleport.js +18 -44
  302. package/lib/components/teleport/src/teleport.js.map +1 -1
  303. package/lib/components/teleport/src/teleport2.js +44 -18
  304. package/lib/components/teleport/src/teleport2.js.map +1 -1
  305. package/lib/components/transfer/src/composables/use-check.js +1 -1
  306. package/lib/components/transfer/src/transfer-panel.js +21 -128
  307. package/lib/components/transfer/src/transfer-panel.js.map +1 -1
  308. package/lib/components/transfer/src/transfer-panel2.js +128 -21
  309. package/lib/components/transfer/src/transfer-panel2.js.map +1 -1
  310. package/lib/components/transfer/src/transfer2.js +1 -1
  311. package/lib/index.js +3 -3
  312. package/lib/version.d.ts +1 -1
  313. package/lib/version.js +1 -1
  314. package/lib/version.js.map +1 -1
  315. package/package.json +2 -2
  316. package/theme-chalk/src/dialog.scss +7 -4
  317. package/theme-chalk/src/message-box.scss +7 -4
  318. package/theme-chalk/src/tour.scss +7 -4
  319. package/web-types.json +1 -1
@@ -1,16 +1,41 @@
1
- import '../../../utils/index.mjs';
2
- import { buildProps } from '../../../utils/vue/props/runtime.mjs';
3
- import { iconPropType } from '../../../utils/vue/icon.mjs';
1
+ import { defineComponent, ref, provide, onMounted, openBlock, createElementBlock, normalizeClass, unref, renderSlot } from 'vue';
2
+ import '../../../hooks/index.mjs';
3
+ import { breadcrumbKey } from './constants.mjs';
4
+ import { breadcrumbProps } from './breadcrumb.mjs';
5
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
6
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
4
7
 
5
- const breadcrumbProps = buildProps({
6
- separator: {
7
- type: String,
8
- default: "/"
9
- },
10
- separatorIcon: {
11
- type: iconPropType
8
+ const __default__ = defineComponent({
9
+ name: "ElBreadcrumb"
10
+ });
11
+ const _sfc_main = /* @__PURE__ */ defineComponent({
12
+ ...__default__,
13
+ props: breadcrumbProps,
14
+ setup(__props) {
15
+ const props = __props;
16
+ const ns = useNamespace("breadcrumb");
17
+ const breadcrumb = ref();
18
+ provide(breadcrumbKey, props);
19
+ onMounted(() => {
20
+ const items = breadcrumb.value.querySelectorAll(`.${ns.e("item")}`);
21
+ if (items.length) {
22
+ items[items.length - 1].setAttribute("aria-current", "page");
23
+ }
24
+ });
25
+ return (_ctx, _cache) => {
26
+ return openBlock(), createElementBlock("div", {
27
+ ref_key: "breadcrumb",
28
+ ref: breadcrumb,
29
+ class: normalizeClass(unref(ns).b()),
30
+ "aria-label": "Breadcrumb",
31
+ role: "navigation"
32
+ }, [
33
+ renderSlot(_ctx.$slots, "default")
34
+ ], 2);
35
+ };
12
36
  }
13
37
  });
38
+ var Breadcrumb = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "breadcrumb.vue"]]);
14
39
 
15
- export { breadcrumbProps };
40
+ export { Breadcrumb as default };
16
41
  //# sourceMappingURL=breadcrumb2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumb2.mjs","sources":["../../../../../../packages/components/breadcrumb/src/breadcrumb.ts"],"sourcesContent":["import { buildProps, iconPropType } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const breadcrumbProps = buildProps({\n /**\n * @description separator character\n */\n separator: {\n type: String,\n default: '/',\n },\n /**\n * @description icon component of icon separator\n */\n separatorIcon: {\n type: iconPropType,\n },\n} as const)\nexport type BreadcrumbProps = ExtractPropTypes<typeof breadcrumbProps>\n"],"names":[],"mappings":";;;;AACY,MAAC,eAAe,GAAG,UAAU,CAAC;AAC1C,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,YAAY;AACtB,GAAG;AACH,CAAC;;;;"}
1
+ {"version":3,"file":"breadcrumb2.mjs","sources":["../../../../../../packages/components/breadcrumb/src/breadcrumb.vue"],"sourcesContent":["<template>\n <div\n ref=\"breadcrumb\"\n :class=\"ns.b()\"\n aria-label=\"Breadcrumb\"\n role=\"navigation\"\n >\n <slot />\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { onMounted, provide, ref } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { breadcrumbKey } from './constants'\nimport { breadcrumbProps } from './breadcrumb'\n\ndefineOptions({\n name: 'ElBreadcrumb',\n})\n\nconst props = defineProps(breadcrumbProps)\n\nconst ns = useNamespace('breadcrumb')\nconst breadcrumb = ref<HTMLDivElement>()\n\nprovide(breadcrumbKey, props)\n\nonMounted(() => {\n const items = breadcrumb.value!.querySelectorAll(`.${ns.e('item')}`)\n if (items.length) {\n items[items.length - 1].setAttribute('aria-current', 'page')\n }\n})\n</script>\n"],"names":[],"mappings":";;;;;;;mCAiBc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAIA,IAAM,MAAA,EAAA,GAAK,aAAa,YAAY,CAAA,CAAA;AACpC,IAAA,MAAM,aAAa,GAAoB,EAAA,CAAA;AAEvC,IAAA,OAAA,CAAQ,eAAe,KAAK,CAAA,CAAA;AAE5B,IAAA,SAAA,CAAU,MAAM;AACd,MAAM,MAAA,KAAA,GAAQ,WAAW,KAAO,CAAA,gBAAA,CAAiB,IAAI,EAAG,CAAA,CAAA,CAAE,MAAM,CAAG,CAAA,CAAA,CAAA,CAAA;AACnE,MAAA,IAAI,MAAM,MAAQ,EAAA;AAChB,QAAA,KAAA,CAAM,KAAM,CAAA,MAAA,GAAS,CAAG,CAAA,CAAA,YAAA,CAAa,gBAAgB,MAAM,CAAA,CAAA;AAAA,OAC7D;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import '../../utils/index.mjs';
2
2
  import Button from './src/button2.mjs';
3
- import ButtonGroup from './src/button-group.mjs';
3
+ import ButtonGroup from './src/button-group2.mjs';
4
4
  export { buttonEmits, buttonNativeTypes, buttonProps, buttonTypes } from './src/button.mjs';
5
5
  export { buttonGroupContextKey } from './src/constants.mjs';
6
6
  import { withInstall, withNoopInstall } from '../../utils/vue/install.mjs';
@@ -1,33 +1,9 @@
1
- import { defineComponent, provide, reactive, toRef, openBlock, createElementBlock, normalizeClass, unref, renderSlot } from 'vue';
2
- import '../../../hooks/index.mjs';
3
- import { buttonGroupProps } from './button-group2.mjs';
4
- import { buttonGroupContextKey } from './constants.mjs';
5
- import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
6
- import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
1
+ import { buttonProps } from './button.mjs';
7
2
 
8
- const __default__ = defineComponent({
9
- name: "ElButtonGroup"
10
- });
11
- const _sfc_main = /* @__PURE__ */ defineComponent({
12
- ...__default__,
13
- props: buttonGroupProps,
14
- setup(__props) {
15
- const props = __props;
16
- provide(buttonGroupContextKey, reactive({
17
- size: toRef(props, "size"),
18
- type: toRef(props, "type")
19
- }));
20
- const ns = useNamespace("button");
21
- return (_ctx, _cache) => {
22
- return openBlock(), createElementBlock("div", {
23
- class: normalizeClass(`${unref(ns).b("group")}`)
24
- }, [
25
- renderSlot(_ctx.$slots, "default")
26
- ], 2);
27
- };
28
- }
29
- });
30
- var ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "button-group.vue"]]);
3
+ const buttonGroupProps = {
4
+ size: buttonProps.size,
5
+ type: buttonProps.type
6
+ };
31
7
 
32
- export { ButtonGroup as default };
8
+ export { buttonGroupProps };
33
9
  //# sourceMappingURL=button-group.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"button-group.mjs","sources":["../../../../../../packages/components/button/src/button-group.vue"],"sourcesContent":["<template>\n <div :class=\"`${ns.b('group')}`\">\n <slot />\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { provide, reactive, toRef } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { buttonGroupProps } from './button-group'\nimport { buttonGroupContextKey } from './constants'\n\ndefineOptions({\n name: 'ElButtonGroup',\n})\nconst props = defineProps(buttonGroupProps)\nprovide(\n buttonGroupContextKey,\n reactive({\n size: toRef(props, 'size'),\n type: toRef(props, 'type'),\n })\n)\nconst ns = useNamespace('button')\n</script>\n"],"names":[],"mappings":";;;;;;;mCAWc,CAAA;AAAA,EACZ,IAAM,EAAA,eAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAEA,IAAA,OAAA,CACE,uBACA,QAAS,CAAA;AAAA,MACP,IAAA,EAAM,KAAM,CAAA,KAAA,EAAO,MAAM,CAAA;AAAA,MACzB,IAAA,EAAM,KAAM,CAAA,KAAA,EAAO,MAAM,CAAA;AAAA,KAC1B,CACH,CAAA,CAAA;AACA,IAAM,MAAA,EAAA,GAAK,aAAa,QAAQ,CAAA,CAAA;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"button-group.mjs","sources":["../../../../../../packages/components/button/src/button-group.ts"],"sourcesContent":["import { buttonProps } from './button'\n\nimport type { ExtractPropTypes } from 'vue'\n\nexport const buttonGroupProps = {\n /**\n * @description control the size of buttons in this button-group\n */\n size: buttonProps.size,\n /**\n * @description control the type of buttons in this button-group\n */\n type: buttonProps.type,\n} as const\nexport type ButtonGroupProps = ExtractPropTypes<typeof buttonGroupProps>\n"],"names":[],"mappings":";;AACY,MAAC,gBAAgB,GAAG;AAChC,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI;AACxB,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI;AACxB;;;;"}
@@ -1,9 +1,33 @@
1
- import { buttonProps } from './button.mjs';
1
+ import { defineComponent, provide, reactive, toRef, openBlock, createElementBlock, normalizeClass, unref, renderSlot } from 'vue';
2
+ import '../../../hooks/index.mjs';
3
+ import { buttonGroupProps } from './button-group.mjs';
4
+ import { buttonGroupContextKey } from './constants.mjs';
5
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
6
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
2
7
 
3
- const buttonGroupProps = {
4
- size: buttonProps.size,
5
- type: buttonProps.type
6
- };
8
+ const __default__ = defineComponent({
9
+ name: "ElButtonGroup"
10
+ });
11
+ const _sfc_main = /* @__PURE__ */ defineComponent({
12
+ ...__default__,
13
+ props: buttonGroupProps,
14
+ setup(__props) {
15
+ const props = __props;
16
+ provide(buttonGroupContextKey, reactive({
17
+ size: toRef(props, "size"),
18
+ type: toRef(props, "type")
19
+ }));
20
+ const ns = useNamespace("button");
21
+ return (_ctx, _cache) => {
22
+ return openBlock(), createElementBlock("div", {
23
+ class: normalizeClass(`${unref(ns).b("group")}`)
24
+ }, [
25
+ renderSlot(_ctx.$slots, "default")
26
+ ], 2);
27
+ };
28
+ }
29
+ });
30
+ var ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "button-group.vue"]]);
7
31
 
8
- export { buttonGroupProps };
32
+ export { ButtonGroup as default };
9
33
  //# sourceMappingURL=button-group2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"button-group2.mjs","sources":["../../../../../../packages/components/button/src/button-group.ts"],"sourcesContent":["import { buttonProps } from './button'\n\nimport type { ExtractPropTypes } from 'vue'\n\nexport const buttonGroupProps = {\n /**\n * @description control the size of buttons in this button-group\n */\n size: buttonProps.size,\n /**\n * @description control the type of buttons in this button-group\n */\n type: buttonProps.type,\n} as const\nexport type ButtonGroupProps = ExtractPropTypes<typeof buttonGroupProps>\n"],"names":[],"mappings":";;AACY,MAAC,gBAAgB,GAAG;AAChC,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI;AACxB,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI;AACxB;;;;"}
1
+ {"version":3,"file":"button-group2.mjs","sources":["../../../../../../packages/components/button/src/button-group.vue"],"sourcesContent":["<template>\n <div :class=\"`${ns.b('group')}`\">\n <slot />\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { provide, reactive, toRef } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { buttonGroupProps } from './button-group'\nimport { buttonGroupContextKey } from './constants'\n\ndefineOptions({\n name: 'ElButtonGroup',\n})\nconst props = defineProps(buttonGroupProps)\nprovide(\n buttonGroupContextKey,\n reactive({\n size: toRef(props, 'size'),\n type: toRef(props, 'type'),\n })\n)\nconst ns = useNamespace('button')\n</script>\n"],"names":[],"mappings":";;;;;;;mCAWc,CAAA;AAAA,EACZ,IAAM,EAAA,eAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAEA,IAAA,OAAA,CACE,uBACA,QAAS,CAAA;AAAA,MACP,IAAA,EAAM,KAAM,CAAA,KAAA,EAAO,MAAM,CAAA;AAAA,MACzB,IAAA,EAAM,KAAM,CAAA,KAAA,EAAO,MAAM,CAAA;AAAA,KAC1B,CACH,CAAA,CAAA;AACA,IAAM,MAAA,EAAA,GAAK,aAAa,QAAQ,CAAA,CAAA;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import '../../utils/index.mjs';
2
- import Calendar from './src/calendar2.mjs';
3
- export { calendarEmits, calendarProps } from './src/calendar.mjs';
2
+ import Calendar from './src/calendar.mjs';
3
+ export { calendarEmits, calendarProps } from './src/calendar2.mjs';
4
4
  import { withInstall } from '../../utils/vue/install.mjs';
5
5
 
6
6
  const ElCalendar = withInstall(Calendar);
@@ -1,23 +1,136 @@
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';
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 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
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
- const calendarEmits = {
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 { calendarEmits, calendarProps };
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.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;;;;"}
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 { 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 './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 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
- };
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
- var Calendar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "calendar.vue"]]);
17
+ const calendarEmits = {
18
+ [UPDATE_MODEL_EVENT]: (value) => isDate(value),
19
+ [INPUT_EVENT]: (value) => isDate(value)
20
+ };
134
21
 
135
- export { Calendar as default };
22
+ export { calendarEmits, calendarProps };
136
23
  //# sourceMappingURL=calendar2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"calendar2.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
+ {"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;;;;"}
@@ -83,12 +83,12 @@ export { autocompleteEmits, autocompleteProps } from './autocomplete/src/autocom
83
83
  export { avatarEmits, avatarProps } from './avatar/src/avatar.mjs';
84
84
  export { backtopEmits, backtopProps } from './backtop/src/backtop.mjs';
85
85
  export { badgeProps } from './badge/src/badge.mjs';
86
- export { breadcrumbProps } from './breadcrumb/src/breadcrumb2.mjs';
86
+ export { breadcrumbProps } from './breadcrumb/src/breadcrumb.mjs';
87
87
  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/calendar.mjs';
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/popconfirm.mjs';
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/popconfirm2.mjs';
3
- export { popconfirmEmits, popconfirmProps } from './src/popconfirm.mjs';
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);