@element-plus/nightly 0.0.20220122 → 0.0.20220123

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 (260) hide show
  1. package/dist/index.full.js +29 -24
  2. package/dist/index.full.min.js +4 -4
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +5 -5
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +29 -24
  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.js +1 -1
  12. package/dist/locale/ar.min.js +1 -1
  13. package/dist/locale/ar.min.mjs +1 -1
  14. package/dist/locale/ar.mjs +1 -1
  15. package/dist/locale/bg.js +1 -1
  16. package/dist/locale/bg.min.js +1 -1
  17. package/dist/locale/bg.min.mjs +1 -1
  18. package/dist/locale/bg.mjs +1 -1
  19. package/dist/locale/bn.js +1 -1
  20. package/dist/locale/bn.min.js +1 -1
  21. package/dist/locale/bn.min.mjs +1 -1
  22. package/dist/locale/bn.mjs +1 -1
  23. package/dist/locale/ca.js +1 -1
  24. package/dist/locale/ca.min.js +1 -1
  25. package/dist/locale/ca.min.mjs +1 -1
  26. package/dist/locale/ca.mjs +1 -1
  27. package/dist/locale/cs.js +1 -1
  28. package/dist/locale/cs.min.js +1 -1
  29. package/dist/locale/cs.min.mjs +1 -1
  30. package/dist/locale/cs.mjs +1 -1
  31. package/dist/locale/da.js +1 -1
  32. package/dist/locale/da.min.js +1 -1
  33. package/dist/locale/da.min.mjs +1 -1
  34. package/dist/locale/da.mjs +1 -1
  35. package/dist/locale/de.js +1 -1
  36. package/dist/locale/de.min.js +1 -1
  37. package/dist/locale/de.min.mjs +1 -1
  38. package/dist/locale/de.mjs +1 -1
  39. package/dist/locale/el.js +1 -1
  40. package/dist/locale/el.min.js +1 -1
  41. package/dist/locale/el.min.mjs +1 -1
  42. package/dist/locale/el.mjs +1 -1
  43. package/dist/locale/en.js +1 -1
  44. package/dist/locale/en.min.js +1 -1
  45. package/dist/locale/en.min.mjs +1 -1
  46. package/dist/locale/en.mjs +1 -1
  47. package/dist/locale/eo.js +1 -1
  48. package/dist/locale/eo.min.js +1 -1
  49. package/dist/locale/eo.min.mjs +1 -1
  50. package/dist/locale/eo.mjs +1 -1
  51. package/dist/locale/es.js +1 -1
  52. package/dist/locale/es.min.js +1 -1
  53. package/dist/locale/es.min.mjs +1 -1
  54. package/dist/locale/es.mjs +1 -1
  55. package/dist/locale/et.js +1 -1
  56. package/dist/locale/et.min.js +1 -1
  57. package/dist/locale/et.min.mjs +1 -1
  58. package/dist/locale/et.mjs +1 -1
  59. package/dist/locale/eu.js +1 -1
  60. package/dist/locale/eu.min.js +1 -1
  61. package/dist/locale/eu.min.mjs +1 -1
  62. package/dist/locale/eu.mjs +1 -1
  63. package/dist/locale/fa.js +1 -1
  64. package/dist/locale/fa.min.js +1 -1
  65. package/dist/locale/fa.min.mjs +1 -1
  66. package/dist/locale/fa.mjs +1 -1
  67. package/dist/locale/fi.js +1 -1
  68. package/dist/locale/fi.min.js +1 -1
  69. package/dist/locale/fi.min.mjs +1 -1
  70. package/dist/locale/fi.mjs +1 -1
  71. package/dist/locale/fr.js +1 -1
  72. package/dist/locale/fr.min.js +1 -1
  73. package/dist/locale/fr.min.mjs +1 -1
  74. package/dist/locale/fr.mjs +1 -1
  75. package/dist/locale/he.js +1 -1
  76. package/dist/locale/he.min.js +1 -1
  77. package/dist/locale/he.min.mjs +1 -1
  78. package/dist/locale/he.mjs +1 -1
  79. package/dist/locale/hr.js +1 -1
  80. package/dist/locale/hr.min.js +1 -1
  81. package/dist/locale/hr.min.mjs +1 -1
  82. package/dist/locale/hr.mjs +1 -1
  83. package/dist/locale/hu.js +1 -1
  84. package/dist/locale/hu.min.js +1 -1
  85. package/dist/locale/hu.min.mjs +1 -1
  86. package/dist/locale/hu.mjs +1 -1
  87. package/dist/locale/hy-am.js +1 -1
  88. package/dist/locale/hy-am.min.js +1 -1
  89. package/dist/locale/hy-am.min.mjs +1 -1
  90. package/dist/locale/hy-am.mjs +1 -1
  91. package/dist/locale/id.js +1 -1
  92. package/dist/locale/id.min.js +1 -1
  93. package/dist/locale/id.min.mjs +1 -1
  94. package/dist/locale/id.mjs +1 -1
  95. package/dist/locale/it.js +1 -1
  96. package/dist/locale/it.min.js +1 -1
  97. package/dist/locale/it.min.mjs +1 -1
  98. package/dist/locale/it.mjs +1 -1
  99. package/dist/locale/ja.js +1 -1
  100. package/dist/locale/ja.min.js +1 -1
  101. package/dist/locale/ja.min.mjs +1 -1
  102. package/dist/locale/ja.mjs +1 -1
  103. package/dist/locale/kk.js +1 -1
  104. package/dist/locale/kk.min.js +1 -1
  105. package/dist/locale/kk.min.mjs +1 -1
  106. package/dist/locale/kk.mjs +1 -1
  107. package/dist/locale/km.js +1 -1
  108. package/dist/locale/km.min.js +1 -1
  109. package/dist/locale/km.min.mjs +1 -1
  110. package/dist/locale/km.mjs +1 -1
  111. package/dist/locale/ko.js +1 -1
  112. package/dist/locale/ko.min.js +1 -1
  113. package/dist/locale/ko.min.mjs +1 -1
  114. package/dist/locale/ko.mjs +1 -1
  115. package/dist/locale/ku.js +1 -1
  116. package/dist/locale/ku.min.js +1 -1
  117. package/dist/locale/ku.min.mjs +1 -1
  118. package/dist/locale/ku.mjs +1 -1
  119. package/dist/locale/ky.js +1 -1
  120. package/dist/locale/ky.min.js +1 -1
  121. package/dist/locale/ky.min.mjs +1 -1
  122. package/dist/locale/ky.mjs +1 -1
  123. package/dist/locale/lt.js +1 -1
  124. package/dist/locale/lt.min.js +1 -1
  125. package/dist/locale/lt.min.mjs +1 -1
  126. package/dist/locale/lt.mjs +1 -1
  127. package/dist/locale/lv.js +1 -1
  128. package/dist/locale/lv.min.js +1 -1
  129. package/dist/locale/lv.min.mjs +1 -1
  130. package/dist/locale/lv.mjs +1 -1
  131. package/dist/locale/mn.js +1 -1
  132. package/dist/locale/mn.min.js +1 -1
  133. package/dist/locale/mn.min.mjs +1 -1
  134. package/dist/locale/mn.mjs +1 -1
  135. package/dist/locale/nb-no.js +1 -1
  136. package/dist/locale/nb-no.min.js +1 -1
  137. package/dist/locale/nb-no.min.mjs +1 -1
  138. package/dist/locale/nb-no.mjs +1 -1
  139. package/dist/locale/nl.js +1 -1
  140. package/dist/locale/nl.min.js +1 -1
  141. package/dist/locale/nl.min.mjs +1 -1
  142. package/dist/locale/nl.mjs +1 -1
  143. package/dist/locale/pa.js +1 -1
  144. package/dist/locale/pa.min.js +1 -1
  145. package/dist/locale/pa.min.mjs +1 -1
  146. package/dist/locale/pa.mjs +1 -1
  147. package/dist/locale/pl.js +1 -1
  148. package/dist/locale/pl.min.js +1 -1
  149. package/dist/locale/pl.min.mjs +1 -1
  150. package/dist/locale/pl.mjs +1 -1
  151. package/dist/locale/pt-br.js +1 -1
  152. package/dist/locale/pt-br.min.js +1 -1
  153. package/dist/locale/pt-br.min.mjs +1 -1
  154. package/dist/locale/pt-br.mjs +1 -1
  155. package/dist/locale/pt.js +1 -1
  156. package/dist/locale/pt.min.js +1 -1
  157. package/dist/locale/pt.min.mjs +1 -1
  158. package/dist/locale/pt.mjs +1 -1
  159. package/dist/locale/ro.js +1 -1
  160. package/dist/locale/ro.min.js +1 -1
  161. package/dist/locale/ro.min.mjs +1 -1
  162. package/dist/locale/ro.mjs +1 -1
  163. package/dist/locale/ru.js +1 -1
  164. package/dist/locale/ru.min.js +1 -1
  165. package/dist/locale/ru.min.mjs +1 -1
  166. package/dist/locale/ru.mjs +1 -1
  167. package/dist/locale/sk.js +1 -1
  168. package/dist/locale/sk.min.js +1 -1
  169. package/dist/locale/sk.min.mjs +1 -1
  170. package/dist/locale/sk.mjs +1 -1
  171. package/dist/locale/sl.js +1 -1
  172. package/dist/locale/sl.min.js +1 -1
  173. package/dist/locale/sl.min.mjs +1 -1
  174. package/dist/locale/sl.mjs +1 -1
  175. package/dist/locale/sr.js +1 -1
  176. package/dist/locale/sr.min.js +1 -1
  177. package/dist/locale/sr.min.mjs +1 -1
  178. package/dist/locale/sr.mjs +1 -1
  179. package/dist/locale/sv.js +1 -1
  180. package/dist/locale/sv.min.js +1 -1
  181. package/dist/locale/sv.min.mjs +1 -1
  182. package/dist/locale/sv.mjs +1 -1
  183. package/dist/locale/ta.js +1 -1
  184. package/dist/locale/ta.min.js +1 -1
  185. package/dist/locale/ta.min.mjs +1 -1
  186. package/dist/locale/ta.mjs +1 -1
  187. package/dist/locale/th.js +1 -1
  188. package/dist/locale/th.min.js +1 -1
  189. package/dist/locale/th.min.mjs +1 -1
  190. package/dist/locale/th.mjs +1 -1
  191. package/dist/locale/tk.js +1 -1
  192. package/dist/locale/tk.min.js +1 -1
  193. package/dist/locale/tk.min.mjs +1 -1
  194. package/dist/locale/tk.mjs +1 -1
  195. package/dist/locale/tr.js +1 -1
  196. package/dist/locale/tr.min.js +1 -1
  197. package/dist/locale/tr.min.mjs +1 -1
  198. package/dist/locale/tr.mjs +1 -1
  199. package/dist/locale/ug-cn.js +1 -1
  200. package/dist/locale/ug-cn.min.js +1 -1
  201. package/dist/locale/ug-cn.min.mjs +1 -1
  202. package/dist/locale/ug-cn.mjs +1 -1
  203. package/dist/locale/uk.js +1 -1
  204. package/dist/locale/uk.min.js +1 -1
  205. package/dist/locale/uk.min.mjs +1 -1
  206. package/dist/locale/uk.mjs +1 -1
  207. package/dist/locale/uz-uz.js +1 -1
  208. package/dist/locale/uz-uz.min.js +1 -1
  209. package/dist/locale/uz-uz.min.mjs +1 -1
  210. package/dist/locale/uz-uz.mjs +1 -1
  211. package/dist/locale/vi.js +1 -1
  212. package/dist/locale/vi.min.js +1 -1
  213. package/dist/locale/vi.min.mjs +1 -1
  214. package/dist/locale/vi.mjs +1 -1
  215. package/dist/locale/zh-cn.js +1 -1
  216. package/dist/locale/zh-cn.min.js +1 -1
  217. package/dist/locale/zh-cn.min.mjs +1 -1
  218. package/dist/locale/zh-cn.mjs +1 -1
  219. package/dist/locale/zh-tw.js +1 -1
  220. package/dist/locale/zh-tw.min.js +1 -1
  221. package/dist/locale/zh-tw.min.mjs +1 -1
  222. package/dist/locale/zh-tw.mjs +1 -1
  223. package/es/components/autocomplete/index.d.ts +22 -0
  224. package/es/components/autocomplete/src/index.mjs +15 -15
  225. package/es/components/autocomplete/src/index.mjs.map +1 -1
  226. package/es/components/autocomplete/src/index.vue.d.ts +11 -0
  227. package/es/components/backtop/index.d.ts +11 -0
  228. package/es/components/backtop/src/backtop.vue.d.ts +11 -0
  229. package/es/components/backtop/src/backtop2.mjs +16 -8
  230. package/es/components/backtop/src/backtop2.mjs.map +1 -1
  231. package/es/components/index.mjs +1 -1
  232. package/es/components/popconfirm/index.mjs +2 -2
  233. package/es/components/popconfirm/src/popconfirm.mjs +104 -45
  234. package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
  235. package/es/components/popconfirm/src/popconfirm2.mjs +45 -104
  236. package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
  237. package/es/index.mjs +1 -1
  238. package/es/version.d.ts +1 -1
  239. package/es/version.mjs +1 -1
  240. package/es/version.mjs.map +1 -1
  241. package/lib/components/autocomplete/index.d.ts +22 -0
  242. package/lib/components/autocomplete/src/index.js +17 -17
  243. package/lib/components/autocomplete/src/index.js.map +1 -1
  244. package/lib/components/autocomplete/src/index.vue.d.ts +11 -0
  245. package/lib/components/backtop/index.d.ts +11 -0
  246. package/lib/components/backtop/src/backtop.vue.d.ts +11 -0
  247. package/lib/components/backtop/src/backtop2.js +15 -7
  248. package/lib/components/backtop/src/backtop2.js.map +1 -1
  249. package/lib/components/index.js +1 -1
  250. package/lib/components/popconfirm/index.js +2 -2
  251. package/lib/components/popconfirm/src/popconfirm.js +104 -45
  252. package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
  253. package/lib/components/popconfirm/src/popconfirm2.js +45 -104
  254. package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
  255. package/lib/index.js +1 -1
  256. package/lib/version.d.ts +1 -1
  257. package/lib/version.js +1 -1
  258. package/lib/version.js.map +1 -1
  259. package/package.json +2 -2
  260. package/web-types.json +1 -1
@@ -2,54 +2,113 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- require('../../button/index.js');
6
- var iconsVue = require('@element-plus/icons-vue');
7
- var props = require('../../../utils/props.js');
8
- var button = require('../../button/src/button.js');
5
+ var vue = require('vue');
6
+ var index = require('../../button/index.js');
7
+ var index$2 = require('../../icon/index.js');
8
+ var index$1 = require('../../tooltip/index.js');
9
+ require('../../../hooks/index.js');
10
+ var popconfirm = require('./popconfirm2.js');
11
+ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
12
+ var index$3 = require('../../../hooks/use-locale/index.js');
9
13
 
10
- const popconfirmProps = props.buildProps({
11
- title: {
12
- type: String
14
+ const _sfc_main = vue.defineComponent({
15
+ name: "ElPopconfirm",
16
+ components: {
17
+ ElButton: index.ElButton,
18
+ ElTooltip: index$1.ElTooltip,
19
+ ElIcon: index$2.ElIcon
13
20
  },
14
- confirmButtonText: {
15
- type: String
16
- },
17
- cancelButtonText: {
18
- type: String
19
- },
20
- confirmButtonType: {
21
- type: String,
22
- values: button.buttonType,
23
- default: "primary"
24
- },
25
- cancelButtonType: {
26
- type: String,
27
- values: button.buttonType,
28
- default: "text"
29
- },
30
- icon: {
31
- type: props.definePropType([String, Object]),
32
- default: iconsVue.QuestionFilled
33
- },
34
- iconColor: {
35
- type: String,
36
- default: "#f90"
37
- },
38
- hideIcon: {
39
- type: Boolean,
40
- default: false
41
- },
42
- hideAfter: {
43
- type: Number,
44
- default: 200
45
- },
46
- onConfirm: {
47
- type: props.definePropType(Function)
48
- },
49
- onCancel: {
50
- type: props.definePropType(Function)
21
+ props: popconfirm.popconfirmProps,
22
+ setup(props) {
23
+ const { t } = index$3.useLocale();
24
+ const tooltipRef = vue.ref();
25
+ const hidePopper = () => {
26
+ vue.unref(tooltipRef)?.onClose?.();
27
+ };
28
+ const handleCallback = () => {
29
+ hidePopper();
30
+ };
31
+ const confirm = (e) => {
32
+ props.onConfirm?.(e);
33
+ handleCallback();
34
+ };
35
+ const cancel = (e) => {
36
+ props.onCancel?.(e);
37
+ handleCallback();
38
+ };
39
+ const finalConfirmButtonText = vue.computed(() => props.confirmButtonText || t("el.popconfirm.confirmButtonText"));
40
+ const finalCancelButtonText = vue.computed(() => props.cancelButtonText || t("el.popconfirm.cancelButtonText"));
41
+ return {
42
+ finalConfirmButtonText,
43
+ finalCancelButtonText,
44
+ tooltipRef,
45
+ confirm,
46
+ cancel
47
+ };
51
48
  }
52
49
  });
50
+ const _hoisted_1 = { class: "el-popconfirm" };
51
+ const _hoisted_2 = { class: "el-popconfirm__main" };
52
+ const _hoisted_3 = { class: "el-popconfirm__action" };
53
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
54
+ const _component_el_icon = vue.resolveComponent("el-icon");
55
+ const _component_el_button = vue.resolveComponent("el-button");
56
+ const _component_el_tooltip = vue.resolveComponent("el-tooltip");
57
+ return vue.openBlock(), vue.createBlock(_component_el_tooltip, vue.mergeProps({ ref: "tooltipRef" }, _ctx.$attrs, {
58
+ trigger: "click",
59
+ effect: "light",
60
+ "popper-class": "el-popover",
61
+ "append-to-body": "",
62
+ "fallback-placements": ["bottom", "top", "right", "left"],
63
+ "hide-after": _ctx.hideAfter,
64
+ persistent: ""
65
+ }), {
66
+ content: vue.withCtx(() => [
67
+ vue.createElementVNode("div", _hoisted_1, [
68
+ vue.createElementVNode("div", _hoisted_2, [
69
+ !_ctx.hideIcon && _ctx.icon ? (vue.openBlock(), vue.createBlock(_component_el_icon, {
70
+ key: 0,
71
+ class: "el-popconfirm__icon",
72
+ style: vue.normalizeStyle({ color: _ctx.iconColor })
73
+ }, {
74
+ default: vue.withCtx(() => [
75
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.icon)))
76
+ ]),
77
+ _: 1
78
+ }, 8, ["style"])) : vue.createCommentVNode("v-if", true),
79
+ vue.createTextVNode(" " + vue.toDisplayString(_ctx.title), 1)
80
+ ]),
81
+ vue.createElementVNode("div", _hoisted_3, [
82
+ vue.createVNode(_component_el_button, {
83
+ size: "small",
84
+ type: _ctx.cancelButtonType,
85
+ onClick: _ctx.cancel
86
+ }, {
87
+ default: vue.withCtx(() => [
88
+ vue.createTextVNode(vue.toDisplayString(_ctx.finalCancelButtonText), 1)
89
+ ]),
90
+ _: 1
91
+ }, 8, ["type", "onClick"]),
92
+ vue.createVNode(_component_el_button, {
93
+ size: "small",
94
+ type: _ctx.confirmButtonType,
95
+ onClick: _ctx.confirm
96
+ }, {
97
+ default: vue.withCtx(() => [
98
+ vue.createTextVNode(vue.toDisplayString(_ctx.finalConfirmButtonText), 1)
99
+ ]),
100
+ _: 1
101
+ }, 8, ["type", "onClick"])
102
+ ])
103
+ ])
104
+ ]),
105
+ default: vue.withCtx(() => [
106
+ _ctx.$slots.reference ? vue.renderSlot(_ctx.$slots, "reference", { key: 0 }) : vue.createCommentVNode("v-if", true)
107
+ ]),
108
+ _: 3
109
+ }, 16, ["hide-after"]);
110
+ }
111
+ var Popconfirm = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["render", _sfc_render]]);
53
112
 
54
- exports.popconfirmProps = popconfirmProps;
113
+ exports["default"] = Popconfirm;
55
114
  //# sourceMappingURL=popconfirm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"popconfirm.js","sources":["../../../../../../packages/components/popconfirm/src/popconfirm.ts"],"sourcesContent":["import { buttonType } from '@element-plus/components/button'\nimport { QuestionFilled } from '@element-plus/icons-vue'\nimport { buildProps, definePropType } from '@element-plus/utils/props'\n\nimport type { Component, ExtractPropTypes } from 'vue'\n\nexport const popconfirmProps = buildProps({\n title: {\n type: String,\n },\n confirmButtonText: {\n type: String,\n },\n cancelButtonText: {\n type: String,\n },\n confirmButtonType: {\n type: String,\n values: buttonType,\n default: 'primary',\n },\n cancelButtonType: {\n type: String,\n values: buttonType,\n default: 'text',\n },\n icon: {\n type: definePropType<string | Component>([String, Object]),\n default: QuestionFilled as any,\n },\n iconColor: {\n type: String,\n default: '#f90',\n },\n hideIcon: {\n type: Boolean,\n default: false,\n },\n hideAfter: {\n type: Number,\n default: 200,\n },\n onConfirm: {\n type: definePropType<(e: Event) => Promise<boolean> | boolean>(Function),\n },\n onCancel: {\n type: definePropType<(e: Event) => Promise<boolean> | boolean>(Function),\n },\n} as const)\nexport type PopconfirmProps = ExtractPropTypes<typeof popconfirmProps>\n"],"names":["buildProps","buttonType","definePropType","QuestionFilled"],"mappings":";;;;;;;;;AAGY,MAAC,eAAe,GAAGA,gBAAU,CAAC;AAC1C,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,EAAE,iBAAiB,EAAE;AACrB,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,EAAE,gBAAgB,EAAE;AACpB,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,EAAE,iBAAiB,EAAE;AACrB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAEC,iBAAU;AACtB,IAAI,OAAO,EAAE,SAAS;AACtB,GAAG;AACH,EAAE,gBAAgB,EAAE;AACpB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAEA,iBAAU;AACtB,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAEC,oBAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAEC,uBAAc;AAC3B,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAED,oBAAc,CAAC,QAAQ,CAAC;AAClC,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAEA,oBAAc,CAAC,QAAQ,CAAC;AAClC,GAAG;AACH,CAAC;;;;"}
1
+ {"version":3,"file":"popconfirm.js","sources":["../../../../../../packages/components/popconfirm/src/popconfirm.vue"],"sourcesContent":["<template>\n <el-tooltip\n ref=\"tooltipRef\"\n v-bind=\"$attrs\"\n trigger=\"click\"\n effect=\"light\"\n popper-class=\"el-popover\"\n append-to-body\n :fallback-placements=\"['bottom', 'top', 'right', 'left']\"\n :hide-after=\"hideAfter\"\n persistent\n >\n <template #content>\n <div class=\"el-popconfirm\">\n <div class=\"el-popconfirm__main\">\n <el-icon\n v-if=\"!hideIcon && icon\"\n class=\"el-popconfirm__icon\"\n :style=\"{ color: iconColor }\"\n >\n <component :is=\"icon\" />\n </el-icon>\n {{ title }}\n </div>\n <div class=\"el-popconfirm__action\">\n <el-button size=\"small\" :type=\"cancelButtonType\" @click=\"cancel\">\n {{ finalCancelButtonText }}\n </el-button>\n <el-button size=\"small\" :type=\"confirmButtonType\" @click=\"confirm\">\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\">\nimport { defineComponent, ref, computed, unref } 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 } from '@element-plus/hooks'\nimport { popconfirmProps } from './popconfirm'\n\nexport default defineComponent({\n name: 'ElPopconfirm',\n\n components: {\n ElButton,\n ElTooltip,\n ElIcon,\n },\n\n props: popconfirmProps,\n\n setup(props) {\n const { t } = useLocale()\n const tooltipRef = ref<{ onClose: () => void }>()\n\n const hidePopper = () => {\n unref(tooltipRef)?.onClose?.()\n }\n\n const handleCallback = () => {\n hidePopper()\n }\n\n const confirm = (e: Event) => {\n props.onConfirm?.(e)\n handleCallback()\n }\n const cancel = (e: Event) => {\n props.onCancel?.(e)\n handleCallback()\n }\n\n const finalConfirmButtonText = computed(\n () => props.confirmButtonText || t('el.popconfirm.confirmButtonText')\n )\n const finalCancelButtonText = computed(\n () => props.cancelButtonText || t('el.popconfirm.cancelButtonText')\n )\n\n return {\n finalConfirmButtonText,\n finalCancelButtonText,\n tooltipRef,\n\n confirm,\n cancel,\n }\n },\n})\n</script>\n"],"names":["defineComponent","ElButton","ElTooltip","ElIcon","popconfirmProps","useLocale","ref","computed","_openBlock","_createBlock","_withCtx"],"mappings":";;;;;;;;;;;;;AAgDA,MAAK,YAAaA,oBAAa;AAAA,EAC7B,MAAM;AAAA,EAEN,YAAY;AAAA,cACVC;AAAA,eACAC;AAAA,YACAC;AAAA;AAAA,EAGF,OAAOC;AAAA,EAEP,MAAM,OAAO;AACX,UAAM,EAAE,MAAMC;AACd,UAAM,aAAaC;AAEnB,UAAM,aAAa,MAAM;AACvB,gBAAM,aAAa;AAAA;AAGrB,UAAM,iBAAiB,MAAM;AAC3B;AAAA;AAGF,UAAM,UAAU,CAAC,MAAa;AAC5B,YAAM,YAAY;AAClB;AAAA;AAEF,UAAM,SAAS,CAAC,MAAa;AAC3B,YAAM,WAAW;AACjB;AAAA;AAGF,UAAM,yBAAyBC,aAC7B,MAAM,MAAM,qBAAqB,EAAE;AAErC,UAAM,wBAAwBA,aAC5B,MAAM,MAAM,oBAAoB,EAAE;AAGpC,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MAEA;AAAA,MACA;AAAA;AAAA;AAAA;qBA/EO,OAAM;qBAUN,OAAM;;;;;;SApBfC,iBAAeC;AAAA,IACf,SAAO;AAAA,IACP;AAAA,IACA,gBAAc;AAAA,IACb;AAAA,IACA,uBAAY,WAAS;AAAA,IACtB,cAAU;AAAA;MAEC;AAAA,aACTC,kBAmBM;AAAA,6BAlBJ,OASM;AAAA,+BAPa,OAAI,YAAI;AAAA,4BADzB;YAEE,KAAK;AAAA,YACJ,OAAK;AAAA;;iCAEN;AAAA;;;qDAEF;AAAA;;+BAKY;AAAA,0BAFI,sBAAO;AAAA,YAAE,MAAM;AAAA,YAAmB,WAAO;AAAA;;;;;;aAGzD,GAEY;AAAA,0BAFI,sBAAO;AAAA,YAAE,MAAM;AAAA,YAAoB,WAAO;AAAA;;;;;;;;;;aAMhDA,YAAO,MAAS;AAAA,WAC9B;;;;;;;;;"}
@@ -2,113 +2,54 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var vue = require('vue');
6
- var index = require('../../button/index.js');
7
- var index$2 = require('../../icon/index.js');
8
- var index$1 = require('../../tooltip/index.js');
9
- require('../../../hooks/index.js');
10
- var popconfirm = require('./popconfirm.js');
11
- var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
12
- var index$3 = require('../../../hooks/use-locale/index.js');
5
+ require('../../button/index.js');
6
+ var iconsVue = require('@element-plus/icons-vue');
7
+ var props = require('../../../utils/props.js');
8
+ var button = require('../../button/src/button.js');
13
9
 
14
- const _sfc_main = vue.defineComponent({
15
- name: "ElPopconfirm",
16
- components: {
17
- ElButton: index.ElButton,
18
- ElTooltip: index$1.ElTooltip,
19
- ElIcon: index$2.ElIcon
10
+ const popconfirmProps = props.buildProps({
11
+ title: {
12
+ type: String
20
13
  },
21
- props: popconfirm.popconfirmProps,
22
- setup(props) {
23
- const { t } = index$3.useLocale();
24
- const tooltipRef = vue.ref();
25
- const hidePopper = () => {
26
- vue.unref(tooltipRef)?.onClose?.();
27
- };
28
- const handleCallback = () => {
29
- hidePopper();
30
- };
31
- const confirm = (e) => {
32
- props.onConfirm?.(e);
33
- handleCallback();
34
- };
35
- const cancel = (e) => {
36
- props.onCancel?.(e);
37
- handleCallback();
38
- };
39
- const finalConfirmButtonText = vue.computed(() => props.confirmButtonText || t("el.popconfirm.confirmButtonText"));
40
- const finalCancelButtonText = vue.computed(() => props.cancelButtonText || t("el.popconfirm.cancelButtonText"));
41
- return {
42
- finalConfirmButtonText,
43
- finalCancelButtonText,
44
- tooltipRef,
45
- confirm,
46
- cancel
47
- };
14
+ confirmButtonText: {
15
+ type: String
16
+ },
17
+ cancelButtonText: {
18
+ type: String
19
+ },
20
+ confirmButtonType: {
21
+ type: String,
22
+ values: button.buttonType,
23
+ default: "primary"
24
+ },
25
+ cancelButtonType: {
26
+ type: String,
27
+ values: button.buttonType,
28
+ default: "text"
29
+ },
30
+ icon: {
31
+ type: props.definePropType([String, Object]),
32
+ default: iconsVue.QuestionFilled
33
+ },
34
+ iconColor: {
35
+ type: String,
36
+ default: "#f90"
37
+ },
38
+ hideIcon: {
39
+ type: Boolean,
40
+ default: false
41
+ },
42
+ hideAfter: {
43
+ type: Number,
44
+ default: 200
45
+ },
46
+ onConfirm: {
47
+ type: props.definePropType(Function)
48
+ },
49
+ onCancel: {
50
+ type: props.definePropType(Function)
48
51
  }
49
52
  });
50
- const _hoisted_1 = { class: "el-popconfirm" };
51
- const _hoisted_2 = { class: "el-popconfirm__main" };
52
- const _hoisted_3 = { class: "el-popconfirm__action" };
53
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
54
- const _component_el_icon = vue.resolveComponent("el-icon");
55
- const _component_el_button = vue.resolveComponent("el-button");
56
- const _component_el_tooltip = vue.resolveComponent("el-tooltip");
57
- return vue.openBlock(), vue.createBlock(_component_el_tooltip, vue.mergeProps({ ref: "tooltipRef" }, _ctx.$attrs, {
58
- trigger: "click",
59
- effect: "light",
60
- "popper-class": "el-popover",
61
- "append-to-body": "",
62
- "fallback-placements": ["bottom", "top", "right", "left"],
63
- "hide-after": _ctx.hideAfter,
64
- persistent: ""
65
- }), {
66
- content: vue.withCtx(() => [
67
- vue.createElementVNode("div", _hoisted_1, [
68
- vue.createElementVNode("div", _hoisted_2, [
69
- !_ctx.hideIcon && _ctx.icon ? (vue.openBlock(), vue.createBlock(_component_el_icon, {
70
- key: 0,
71
- class: "el-popconfirm__icon",
72
- style: vue.normalizeStyle({ color: _ctx.iconColor })
73
- }, {
74
- default: vue.withCtx(() => [
75
- (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.icon)))
76
- ]),
77
- _: 1
78
- }, 8, ["style"])) : vue.createCommentVNode("v-if", true),
79
- vue.createTextVNode(" " + vue.toDisplayString(_ctx.title), 1)
80
- ]),
81
- vue.createElementVNode("div", _hoisted_3, [
82
- vue.createVNode(_component_el_button, {
83
- size: "small",
84
- type: _ctx.cancelButtonType,
85
- onClick: _ctx.cancel
86
- }, {
87
- default: vue.withCtx(() => [
88
- vue.createTextVNode(vue.toDisplayString(_ctx.finalCancelButtonText), 1)
89
- ]),
90
- _: 1
91
- }, 8, ["type", "onClick"]),
92
- vue.createVNode(_component_el_button, {
93
- size: "small",
94
- type: _ctx.confirmButtonType,
95
- onClick: _ctx.confirm
96
- }, {
97
- default: vue.withCtx(() => [
98
- vue.createTextVNode(vue.toDisplayString(_ctx.finalConfirmButtonText), 1)
99
- ]),
100
- _: 1
101
- }, 8, ["type", "onClick"])
102
- ])
103
- ])
104
- ]),
105
- default: vue.withCtx(() => [
106
- _ctx.$slots.reference ? vue.renderSlot(_ctx.$slots, "reference", { key: 0 }) : vue.createCommentVNode("v-if", true)
107
- ]),
108
- _: 3
109
- }, 16, ["hide-after"]);
110
- }
111
- var Popconfirm = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["render", _sfc_render]]);
112
53
 
113
- exports["default"] = Popconfirm;
54
+ exports.popconfirmProps = popconfirmProps;
114
55
  //# sourceMappingURL=popconfirm2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"popconfirm2.js","sources":["../../../../../../packages/components/popconfirm/src/popconfirm.vue"],"sourcesContent":["<template>\n <el-tooltip\n ref=\"tooltipRef\"\n v-bind=\"$attrs\"\n trigger=\"click\"\n effect=\"light\"\n popper-class=\"el-popover\"\n append-to-body\n :fallback-placements=\"['bottom', 'top', 'right', 'left']\"\n :hide-after=\"hideAfter\"\n persistent\n >\n <template #content>\n <div class=\"el-popconfirm\">\n <div class=\"el-popconfirm__main\">\n <el-icon\n v-if=\"!hideIcon && icon\"\n class=\"el-popconfirm__icon\"\n :style=\"{ color: iconColor }\"\n >\n <component :is=\"icon\" />\n </el-icon>\n {{ title }}\n </div>\n <div class=\"el-popconfirm__action\">\n <el-button size=\"small\" :type=\"cancelButtonType\" @click=\"cancel\">\n {{ finalCancelButtonText }}\n </el-button>\n <el-button size=\"small\" :type=\"confirmButtonType\" @click=\"confirm\">\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\">\nimport { defineComponent, ref, computed, unref } 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 } from '@element-plus/hooks'\nimport { popconfirmProps } from './popconfirm'\n\nexport default defineComponent({\n name: 'ElPopconfirm',\n\n components: {\n ElButton,\n ElTooltip,\n ElIcon,\n },\n\n props: popconfirmProps,\n\n setup(props) {\n const { t } = useLocale()\n const tooltipRef = ref<{ onClose: () => void }>()\n\n const hidePopper = () => {\n unref(tooltipRef)?.onClose?.()\n }\n\n const handleCallback = () => {\n hidePopper()\n }\n\n const confirm = (e: Event) => {\n props.onConfirm?.(e)\n handleCallback()\n }\n const cancel = (e: Event) => {\n props.onCancel?.(e)\n handleCallback()\n }\n\n const finalConfirmButtonText = computed(\n () => props.confirmButtonText || t('el.popconfirm.confirmButtonText')\n )\n const finalCancelButtonText = computed(\n () => props.cancelButtonText || t('el.popconfirm.cancelButtonText')\n )\n\n return {\n finalConfirmButtonText,\n finalCancelButtonText,\n tooltipRef,\n\n confirm,\n cancel,\n }\n },\n})\n</script>\n"],"names":["defineComponent","ElButton","ElTooltip","ElIcon","popconfirmProps","useLocale","ref","computed","_openBlock","_createBlock","_withCtx"],"mappings":";;;;;;;;;;;;;AAgDA,MAAK,YAAaA,oBAAa;AAAA,EAC7B,MAAM;AAAA,EAEN,YAAY;AAAA,cACVC;AAAA,eACAC;AAAA,YACAC;AAAA;AAAA,EAGF,OAAOC;AAAA,EAEP,MAAM,OAAO;AACX,UAAM,EAAE,MAAMC;AACd,UAAM,aAAaC;AAEnB,UAAM,aAAa,MAAM;AACvB,gBAAM,aAAa;AAAA;AAGrB,UAAM,iBAAiB,MAAM;AAC3B;AAAA;AAGF,UAAM,UAAU,CAAC,MAAa;AAC5B,YAAM,YAAY;AAClB;AAAA;AAEF,UAAM,SAAS,CAAC,MAAa;AAC3B,YAAM,WAAW;AACjB;AAAA;AAGF,UAAM,yBAAyBC,aAC7B,MAAM,MAAM,qBAAqB,EAAE;AAErC,UAAM,wBAAwBA,aAC5B,MAAM,MAAM,oBAAoB,EAAE;AAGpC,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MAEA;AAAA,MACA;AAAA;AAAA;AAAA;qBA/EO,OAAM;qBAUN,OAAM;;;;;;SApBfC,iBAAeC;AAAA,IACf,SAAO;AAAA,IACP;AAAA,IACA,gBAAc;AAAA,IACb;AAAA,IACA,uBAAY,WAAS;AAAA,IACtB,cAAU;AAAA;MAEC;AAAA,aACTC,kBAmBM;AAAA,6BAlBJ,OASM;AAAA,+BAPa,OAAI,YAAI;AAAA,4BADzB;YAEE,KAAK;AAAA,YACJ,OAAK;AAAA;;iCAEN;AAAA;;;qDAEF;AAAA;;+BAKY;AAAA,0BAFI,sBAAO;AAAA,YAAE,MAAM;AAAA,YAAmB,WAAO;AAAA;;;;;;aAGzD,GAEY;AAAA,0BAFI,sBAAO;AAAA,YAAE,MAAM;AAAA,YAAoB,WAAO;AAAA;;;;;;;;;;aAMhDA,YAAO,MAAS;AAAA,WAC9B;;;;;;;;;"}
1
+ {"version":3,"file":"popconfirm2.js","sources":["../../../../../../packages/components/popconfirm/src/popconfirm.ts"],"sourcesContent":["import { buttonType } from '@element-plus/components/button'\nimport { QuestionFilled } from '@element-plus/icons-vue'\nimport { buildProps, definePropType } from '@element-plus/utils/props'\n\nimport type { Component, ExtractPropTypes } from 'vue'\n\nexport const popconfirmProps = buildProps({\n title: {\n type: String,\n },\n confirmButtonText: {\n type: String,\n },\n cancelButtonText: {\n type: String,\n },\n confirmButtonType: {\n type: String,\n values: buttonType,\n default: 'primary',\n },\n cancelButtonType: {\n type: String,\n values: buttonType,\n default: 'text',\n },\n icon: {\n type: definePropType<string | Component>([String, Object]),\n default: QuestionFilled as any,\n },\n iconColor: {\n type: String,\n default: '#f90',\n },\n hideIcon: {\n type: Boolean,\n default: false,\n },\n hideAfter: {\n type: Number,\n default: 200,\n },\n onConfirm: {\n type: definePropType<(e: Event) => Promise<boolean> | boolean>(Function),\n },\n onCancel: {\n type: definePropType<(e: Event) => Promise<boolean> | boolean>(Function),\n },\n} as const)\nexport type PopconfirmProps = ExtractPropTypes<typeof popconfirmProps>\n"],"names":["buildProps","buttonType","definePropType","QuestionFilled"],"mappings":";;;;;;;;;AAGY,MAAC,eAAe,GAAGA,gBAAU,CAAC;AAC1C,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,EAAE,iBAAiB,EAAE;AACrB,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,EAAE,gBAAgB,EAAE;AACpB,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,EAAE,iBAAiB,EAAE;AACrB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAEC,iBAAU;AACtB,IAAI,OAAO,EAAE,SAAS;AACtB,GAAG;AACH,EAAE,gBAAgB,EAAE;AACpB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAEA,iBAAU;AACtB,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAEC,oBAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAEC,uBAAc;AAC3B,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAED,oBAAc,CAAC,QAAQ,CAAC;AAClC,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAEA,oBAAc,CAAC,QAAQ,CAAC;AAClC,GAAG;AACH,CAAC;;;;"}
package/lib/index.js CHANGED
@@ -81,7 +81,7 @@ var pageHeader = require('./components/page-header/src/page-header.js');
81
81
  var index$B = require('./components/page-header/index.js');
82
82
  var pagination = require('./components/pagination/src/pagination.js');
83
83
  var index$C = require('./components/pagination/index.js');
84
- var popconfirm = require('./components/popconfirm/src/popconfirm.js');
84
+ var popconfirm = require('./components/popconfirm/src/popconfirm2.js');
85
85
  var index$D = require('./components/popconfirm/index.js');
86
86
  var arrow = require('./components/popper/src/arrow.js');
87
87
  var trigger = require('./components/popper/src/trigger.js');
package/lib/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "0.0.20220122";
1
+ export declare const version = "0.0.20220123";
package/lib/version.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const version = "0.0.20220122";
5
+ const version = "0.0.20220123";
6
6
 
7
7
  exports.version = version;
8
8
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20220122'\n"],"names":[],"mappings":";;;;AAAY,MAAC,OAAO,GAAG;;;;"}
1
+ {"version":3,"file":"version.js","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20220123'\n"],"names":[],"mappings":";;;;AAAY,MAAC,OAAO,GAAG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@element-plus/nightly",
3
- "version": "0.0.20220122",
3
+ "version": "0.0.20220123",
4
4
  "description": "A Component Library for Vue 3",
5
5
  "homepage": "https://element-plus.org/",
6
6
  "keywords": [
@@ -73,5 +73,5 @@
73
73
  "not ie 11",
74
74
  "not op_mini all"
75
75
  ],
76
- "gitHead": "3a87484202a6d564ca17b12b89bcce50246ae22b"
76
+ "gitHead": "845bfdf0e045aea2b45c70a3243f0565f027f32a"
77
77
  }