@element-plus/nightly 0.0.20220705 → 0.0.20220706

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 (275) hide show
  1. package/README.md +5 -0
  2. package/attributes.json +1 -1
  3. package/dist/index.full.js +2 -2
  4. package/dist/index.full.min.js +2 -2
  5. package/dist/index.full.min.js.map +1 -1
  6. package/dist/index.full.min.mjs +2 -2
  7. package/dist/index.full.min.mjs.map +1 -1
  8. package/dist/index.full.mjs +2 -2
  9. package/dist/locale/af.js +1 -1
  10. package/dist/locale/af.min.js +1 -1
  11. package/dist/locale/af.min.mjs +1 -1
  12. package/dist/locale/af.mjs +1 -1
  13. package/dist/locale/ar.js +1 -1
  14. package/dist/locale/ar.min.js +1 -1
  15. package/dist/locale/ar.min.mjs +1 -1
  16. package/dist/locale/ar.mjs +1 -1
  17. package/dist/locale/az.js +1 -1
  18. package/dist/locale/az.min.js +1 -1
  19. package/dist/locale/az.min.mjs +1 -1
  20. package/dist/locale/az.mjs +1 -1
  21. package/dist/locale/bg.js +1 -1
  22. package/dist/locale/bg.min.js +1 -1
  23. package/dist/locale/bg.min.mjs +1 -1
  24. package/dist/locale/bg.mjs +1 -1
  25. package/dist/locale/bn.js +1 -1
  26. package/dist/locale/bn.min.js +1 -1
  27. package/dist/locale/bn.min.mjs +1 -1
  28. package/dist/locale/bn.mjs +1 -1
  29. package/dist/locale/ca.js +1 -1
  30. package/dist/locale/ca.min.js +1 -1
  31. package/dist/locale/ca.min.mjs +1 -1
  32. package/dist/locale/ca.mjs +1 -1
  33. package/dist/locale/cs.js +1 -1
  34. package/dist/locale/cs.min.js +1 -1
  35. package/dist/locale/cs.min.mjs +1 -1
  36. package/dist/locale/cs.mjs +1 -1
  37. package/dist/locale/da.js +1 -1
  38. package/dist/locale/da.min.js +1 -1
  39. package/dist/locale/da.min.mjs +1 -1
  40. package/dist/locale/da.mjs +1 -1
  41. package/dist/locale/de.js +1 -1
  42. package/dist/locale/de.min.js +1 -1
  43. package/dist/locale/de.min.mjs +1 -1
  44. package/dist/locale/de.mjs +1 -1
  45. package/dist/locale/el.js +1 -1
  46. package/dist/locale/el.min.js +1 -1
  47. package/dist/locale/el.min.mjs +1 -1
  48. package/dist/locale/el.mjs +1 -1
  49. package/dist/locale/en.js +1 -1
  50. package/dist/locale/en.min.js +1 -1
  51. package/dist/locale/en.min.mjs +1 -1
  52. package/dist/locale/en.mjs +1 -1
  53. package/dist/locale/eo.js +1 -1
  54. package/dist/locale/eo.min.js +1 -1
  55. package/dist/locale/eo.min.mjs +1 -1
  56. package/dist/locale/eo.mjs +1 -1
  57. package/dist/locale/es.js +1 -1
  58. package/dist/locale/es.min.js +1 -1
  59. package/dist/locale/es.min.mjs +1 -1
  60. package/dist/locale/es.mjs +1 -1
  61. package/dist/locale/et.js +1 -1
  62. package/dist/locale/et.min.js +1 -1
  63. package/dist/locale/et.min.mjs +1 -1
  64. package/dist/locale/et.mjs +1 -1
  65. package/dist/locale/eu.js +1 -1
  66. package/dist/locale/eu.min.js +1 -1
  67. package/dist/locale/eu.min.mjs +1 -1
  68. package/dist/locale/eu.mjs +1 -1
  69. package/dist/locale/fa.js +1 -1
  70. package/dist/locale/fa.min.js +1 -1
  71. package/dist/locale/fa.min.mjs +1 -1
  72. package/dist/locale/fa.mjs +1 -1
  73. package/dist/locale/fi.js +1 -1
  74. package/dist/locale/fi.min.js +1 -1
  75. package/dist/locale/fi.min.mjs +1 -1
  76. package/dist/locale/fi.mjs +1 -1
  77. package/dist/locale/fr.js +1 -1
  78. package/dist/locale/fr.min.js +1 -1
  79. package/dist/locale/fr.min.mjs +1 -1
  80. package/dist/locale/fr.mjs +1 -1
  81. package/dist/locale/he.js +1 -1
  82. package/dist/locale/he.min.js +1 -1
  83. package/dist/locale/he.min.mjs +1 -1
  84. package/dist/locale/he.mjs +1 -1
  85. package/dist/locale/hr.js +1 -1
  86. package/dist/locale/hr.min.js +1 -1
  87. package/dist/locale/hr.min.mjs +1 -1
  88. package/dist/locale/hr.mjs +1 -1
  89. package/dist/locale/hu.js +1 -1
  90. package/dist/locale/hu.min.js +1 -1
  91. package/dist/locale/hu.min.mjs +1 -1
  92. package/dist/locale/hu.mjs +1 -1
  93. package/dist/locale/hy-am.js +1 -1
  94. package/dist/locale/hy-am.min.js +1 -1
  95. package/dist/locale/hy-am.min.mjs +1 -1
  96. package/dist/locale/hy-am.mjs +1 -1
  97. package/dist/locale/id.js +1 -1
  98. package/dist/locale/id.min.js +1 -1
  99. package/dist/locale/id.min.mjs +1 -1
  100. package/dist/locale/id.mjs +1 -1
  101. package/dist/locale/it.js +1 -1
  102. package/dist/locale/it.min.js +1 -1
  103. package/dist/locale/it.min.mjs +1 -1
  104. package/dist/locale/it.mjs +1 -1
  105. package/dist/locale/ja.js +1 -1
  106. package/dist/locale/ja.min.js +1 -1
  107. package/dist/locale/ja.min.mjs +1 -1
  108. package/dist/locale/ja.mjs +1 -1
  109. package/dist/locale/kk.js +1 -1
  110. package/dist/locale/kk.min.js +1 -1
  111. package/dist/locale/kk.min.mjs +1 -1
  112. package/dist/locale/kk.mjs +1 -1
  113. package/dist/locale/km.js +1 -1
  114. package/dist/locale/km.min.js +1 -1
  115. package/dist/locale/km.min.mjs +1 -1
  116. package/dist/locale/km.mjs +1 -1
  117. package/dist/locale/ko.js +1 -1
  118. package/dist/locale/ko.min.js +1 -1
  119. package/dist/locale/ko.min.mjs +1 -1
  120. package/dist/locale/ko.mjs +1 -1
  121. package/dist/locale/ku.js +1 -1
  122. package/dist/locale/ku.min.js +1 -1
  123. package/dist/locale/ku.min.mjs +1 -1
  124. package/dist/locale/ku.mjs +1 -1
  125. package/dist/locale/ky.js +1 -1
  126. package/dist/locale/ky.min.js +1 -1
  127. package/dist/locale/ky.min.mjs +1 -1
  128. package/dist/locale/ky.mjs +1 -1
  129. package/dist/locale/lt.js +1 -1
  130. package/dist/locale/lt.min.js +1 -1
  131. package/dist/locale/lt.min.mjs +1 -1
  132. package/dist/locale/lt.mjs +1 -1
  133. package/dist/locale/lv.js +1 -1
  134. package/dist/locale/lv.min.js +1 -1
  135. package/dist/locale/lv.min.mjs +1 -1
  136. package/dist/locale/lv.mjs +1 -1
  137. package/dist/locale/mg.js +1 -1
  138. package/dist/locale/mg.min.js +1 -1
  139. package/dist/locale/mg.min.mjs +1 -1
  140. package/dist/locale/mg.mjs +1 -1
  141. package/dist/locale/mn.js +1 -1
  142. package/dist/locale/mn.min.js +1 -1
  143. package/dist/locale/mn.min.mjs +1 -1
  144. package/dist/locale/mn.mjs +1 -1
  145. package/dist/locale/nb-no.js +1 -1
  146. package/dist/locale/nb-no.min.js +1 -1
  147. package/dist/locale/nb-no.min.mjs +1 -1
  148. package/dist/locale/nb-no.mjs +1 -1
  149. package/dist/locale/nl.js +1 -1
  150. package/dist/locale/nl.min.js +1 -1
  151. package/dist/locale/nl.min.mjs +1 -1
  152. package/dist/locale/nl.mjs +1 -1
  153. package/dist/locale/pa.js +1 -1
  154. package/dist/locale/pa.min.js +1 -1
  155. package/dist/locale/pa.min.mjs +1 -1
  156. package/dist/locale/pa.mjs +1 -1
  157. package/dist/locale/pl.js +1 -1
  158. package/dist/locale/pl.min.js +1 -1
  159. package/dist/locale/pl.min.mjs +1 -1
  160. package/dist/locale/pl.mjs +1 -1
  161. package/dist/locale/pt-br.js +1 -1
  162. package/dist/locale/pt-br.min.js +1 -1
  163. package/dist/locale/pt-br.min.mjs +1 -1
  164. package/dist/locale/pt-br.mjs +1 -1
  165. package/dist/locale/pt.js +1 -1
  166. package/dist/locale/pt.min.js +1 -1
  167. package/dist/locale/pt.min.mjs +1 -1
  168. package/dist/locale/pt.mjs +1 -1
  169. package/dist/locale/ro.js +1 -1
  170. package/dist/locale/ro.min.js +1 -1
  171. package/dist/locale/ro.min.mjs +1 -1
  172. package/dist/locale/ro.mjs +1 -1
  173. package/dist/locale/ru.js +1 -1
  174. package/dist/locale/ru.min.js +1 -1
  175. package/dist/locale/ru.min.mjs +1 -1
  176. package/dist/locale/ru.mjs +1 -1
  177. package/dist/locale/sk.js +1 -1
  178. package/dist/locale/sk.min.js +1 -1
  179. package/dist/locale/sk.min.mjs +1 -1
  180. package/dist/locale/sk.mjs +1 -1
  181. package/dist/locale/sl.js +1 -1
  182. package/dist/locale/sl.min.js +1 -1
  183. package/dist/locale/sl.min.mjs +1 -1
  184. package/dist/locale/sl.mjs +1 -1
  185. package/dist/locale/sr.js +1 -1
  186. package/dist/locale/sr.min.js +1 -1
  187. package/dist/locale/sr.min.mjs +1 -1
  188. package/dist/locale/sr.mjs +1 -1
  189. package/dist/locale/sv.js +1 -1
  190. package/dist/locale/sv.min.js +1 -1
  191. package/dist/locale/sv.min.mjs +1 -1
  192. package/dist/locale/sv.mjs +1 -1
  193. package/dist/locale/ta.js +1 -1
  194. package/dist/locale/ta.min.js +1 -1
  195. package/dist/locale/ta.min.mjs +1 -1
  196. package/dist/locale/ta.mjs +1 -1
  197. package/dist/locale/th.js +1 -1
  198. package/dist/locale/th.min.js +1 -1
  199. package/dist/locale/th.min.mjs +1 -1
  200. package/dist/locale/th.mjs +1 -1
  201. package/dist/locale/tk.js +1 -1
  202. package/dist/locale/tk.min.js +1 -1
  203. package/dist/locale/tk.min.mjs +1 -1
  204. package/dist/locale/tk.mjs +1 -1
  205. package/dist/locale/tr.js +1 -1
  206. package/dist/locale/tr.min.js +1 -1
  207. package/dist/locale/tr.min.mjs +1 -1
  208. package/dist/locale/tr.mjs +1 -1
  209. package/dist/locale/ug-cn.js +1 -1
  210. package/dist/locale/ug-cn.min.js +1 -1
  211. package/dist/locale/ug-cn.min.mjs +1 -1
  212. package/dist/locale/ug-cn.mjs +1 -1
  213. package/dist/locale/uk.js +1 -1
  214. package/dist/locale/uk.min.js +1 -1
  215. package/dist/locale/uk.min.mjs +1 -1
  216. package/dist/locale/uk.mjs +1 -1
  217. package/dist/locale/uz-uz.js +1 -1
  218. package/dist/locale/uz-uz.min.js +1 -1
  219. package/dist/locale/uz-uz.min.mjs +1 -1
  220. package/dist/locale/uz-uz.mjs +1 -1
  221. package/dist/locale/vi.js +1 -1
  222. package/dist/locale/vi.min.js +1 -1
  223. package/dist/locale/vi.min.mjs +1 -1
  224. package/dist/locale/vi.mjs +1 -1
  225. package/dist/locale/zh-cn.js +1 -1
  226. package/dist/locale/zh-cn.min.js +1 -1
  227. package/dist/locale/zh-cn.min.mjs +1 -1
  228. package/dist/locale/zh-cn.mjs +1 -1
  229. package/dist/locale/zh-tw.js +1 -1
  230. package/dist/locale/zh-tw.min.js +1 -1
  231. package/dist/locale/zh-tw.min.mjs +1 -1
  232. package/dist/locale/zh-tw.mjs +1 -1
  233. package/es/components/index.mjs +2 -2
  234. package/es/components/pagination/src/components/pager.mjs +207 -17
  235. package/es/components/pagination/src/components/pager.mjs.map +1 -1
  236. package/es/components/pagination/src/components/pager2.mjs +17 -207
  237. package/es/components/pagination/src/components/pager2.mjs.map +1 -1
  238. package/es/components/pagination/src/pagination.mjs +1 -1
  239. package/es/components/row/index.mjs +2 -2
  240. package/es/components/row/src/row.mjs +45 -30
  241. package/es/components/row/src/row.mjs.map +1 -1
  242. package/es/components/row/src/row2.mjs +30 -45
  243. package/es/components/row/src/row2.mjs.map +1 -1
  244. package/es/components/skeleton/index.mjs +2 -2
  245. package/es/components/skeleton/src/skeleton.mjs +49 -22
  246. package/es/components/skeleton/src/skeleton.mjs.map +1 -1
  247. package/es/components/skeleton/src/skeleton2.mjs +22 -49
  248. package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
  249. package/es/index.mjs +2 -2
  250. package/es/version.d.ts +1 -1
  251. package/es/version.mjs +1 -1
  252. package/es/version.mjs.map +1 -1
  253. package/lib/components/index.js +2 -2
  254. package/lib/components/pagination/src/components/pager.js +207 -17
  255. package/lib/components/pagination/src/components/pager.js.map +1 -1
  256. package/lib/components/pagination/src/components/pager2.js +17 -207
  257. package/lib/components/pagination/src/components/pager2.js.map +1 -1
  258. package/lib/components/pagination/src/pagination.js +1 -1
  259. package/lib/components/row/index.js +2 -2
  260. package/lib/components/row/src/row.js +45 -32
  261. package/lib/components/row/src/row.js.map +1 -1
  262. package/lib/components/row/src/row2.js +32 -45
  263. package/lib/components/row/src/row2.js.map +1 -1
  264. package/lib/components/skeleton/index.js +2 -2
  265. package/lib/components/skeleton/src/skeleton.js +49 -22
  266. package/lib/components/skeleton/src/skeleton.js.map +1 -1
  267. package/lib/components/skeleton/src/skeleton2.js +22 -49
  268. package/lib/components/skeleton/src/skeleton2.js.map +1 -1
  269. package/lib/index.js +2 -2
  270. package/lib/version.d.ts +1 -1
  271. package/lib/version.js +1 -1
  272. package/lib/version.js.map +1 -1
  273. package/package.json +2 -2
  274. package/tags.json +1 -1
  275. package/web-types.json +1 -1
@@ -2,214 +2,24 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var vue = require('vue');
6
- var iconsVue = require('@element-plus/icons-vue');
7
- require('../../../../hooks/index.js');
8
- var pager = require('./pager.js');
9
- var pluginVue_exportHelper = require('../../../../_virtual/plugin-vue_export-helper.js');
10
- var index = require('../../../../hooks/use-namespace/index.js');
5
+ require('../../../../utils/index.js');
6
+ var runtime = require('../../../../utils/vue/props/runtime.js');
11
7
 
12
- const _hoisted_1 = ["onKeyup"];
13
- const _hoisted_2 = ["aria-current", "tabindex"];
14
- const _hoisted_3 = ["tabindex"];
15
- const _hoisted_4 = ["aria-current", "tabindex"];
16
- const _hoisted_5 = ["tabindex"];
17
- const _hoisted_6 = ["aria-current", "tabindex"];
18
- const __default__ = {
19
- name: "ElPaginationPager"
20
- };
21
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
22
- ...__default__,
23
- props: pager.paginationPagerProps,
24
- emits: ["change"],
25
- setup(__props, { emit }) {
26
- const props = __props;
27
- const nsPager = index.useNamespace("pager");
28
- const nsIcon = index.useNamespace("icon");
29
- const showPrevMore = vue.ref(false);
30
- const showNextMore = vue.ref(false);
31
- const quickPrevHover = vue.ref(false);
32
- const quickNextHover = vue.ref(false);
33
- const quickPrevFocus = vue.ref(false);
34
- const quickNextFocus = vue.ref(false);
35
- const pagers = vue.computed(() => {
36
- const pagerCount = props.pagerCount;
37
- const halfPagerCount = (pagerCount - 1) / 2;
38
- const currentPage = Number(props.currentPage);
39
- const pageCount = Number(props.pageCount);
40
- let showPrevMore2 = false;
41
- let showNextMore2 = false;
42
- if (pageCount > pagerCount) {
43
- if (currentPage > pagerCount - halfPagerCount) {
44
- showPrevMore2 = true;
45
- }
46
- if (currentPage < pageCount - halfPagerCount) {
47
- showNextMore2 = true;
48
- }
49
- }
50
- const array = [];
51
- if (showPrevMore2 && !showNextMore2) {
52
- const startPage = pageCount - (pagerCount - 2);
53
- for (let i = startPage; i < pageCount; i++) {
54
- array.push(i);
55
- }
56
- } else if (!showPrevMore2 && showNextMore2) {
57
- for (let i = 2; i < pagerCount; i++) {
58
- array.push(i);
59
- }
60
- } else if (showPrevMore2 && showNextMore2) {
61
- const offset = Math.floor(pagerCount / 2) - 1;
62
- for (let i = currentPage - offset; i <= currentPage + offset; i++) {
63
- array.push(i);
64
- }
65
- } else {
66
- for (let i = 2; i < pageCount; i++) {
67
- array.push(i);
68
- }
69
- }
70
- return array;
71
- });
72
- const tabindex = vue.computed(() => props.disabled ? -1 : 0);
73
- vue.watchEffect(() => {
74
- const halfPagerCount = (props.pagerCount - 1) / 2;
75
- showPrevMore.value = false;
76
- showNextMore.value = false;
77
- if (props.pageCount > props.pagerCount) {
78
- if (props.currentPage > props.pagerCount - halfPagerCount) {
79
- showPrevMore.value = true;
80
- }
81
- if (props.currentPage < props.pageCount - halfPagerCount) {
82
- showNextMore.value = true;
83
- }
84
- }
85
- });
86
- function onMouseEnter(forward = false) {
87
- if (props.disabled)
88
- return;
89
- if (forward) {
90
- quickPrevHover.value = true;
91
- } else {
92
- quickNextHover.value = true;
93
- }
94
- }
95
- function onFocus(forward = false) {
96
- if (forward) {
97
- quickPrevFocus.value = true;
98
- } else {
99
- quickNextFocus.value = true;
100
- }
101
- }
102
- function onEnter(e) {
103
- const target = e.target;
104
- if (target.tagName.toLowerCase() === "li" && Array.from(target.classList).includes("number")) {
105
- const newPage = Number(target.textContent);
106
- if (newPage !== props.currentPage) {
107
- emit("change", newPage);
108
- }
109
- } else if (target.tagName.toLowerCase() === "li" && Array.from(target.classList).includes("more")) {
110
- onPagerClick(e);
111
- }
112
- }
113
- function onPagerClick(event) {
114
- const target = event.target;
115
- if (target.tagName.toLowerCase() === "ul" || props.disabled) {
116
- return;
117
- }
118
- let newPage = Number(target.textContent);
119
- const pageCount = props.pageCount;
120
- const currentPage = props.currentPage;
121
- const pagerCountOffset = props.pagerCount - 2;
122
- if (target.className.includes("more")) {
123
- if (target.className.includes("quickprev")) {
124
- newPage = currentPage - pagerCountOffset;
125
- } else if (target.className.includes("quicknext")) {
126
- newPage = currentPage + pagerCountOffset;
127
- }
128
- }
129
- if (!Number.isNaN(+newPage)) {
130
- if (newPage < 1) {
131
- newPage = 1;
132
- }
133
- if (newPage > pageCount) {
134
- newPage = pageCount;
135
- }
136
- }
137
- if (newPage !== currentPage) {
138
- emit("change", newPage);
139
- }
140
- }
141
- return (_ctx, _cache) => {
142
- return vue.openBlock(), vue.createElementBlock("ul", {
143
- class: vue.normalizeClass(vue.unref(nsPager).b()),
144
- onClick: onPagerClick,
145
- onKeyup: vue.withKeys(onEnter, ["enter"])
146
- }, [
147
- _ctx.pageCount > 0 ? (vue.openBlock(), vue.createElementBlock("li", {
148
- key: 0,
149
- class: vue.normalizeClass([[
150
- vue.unref(nsPager).is("active", _ctx.currentPage === 1),
151
- vue.unref(nsPager).is("disabled", _ctx.disabled)
152
- ], "number"]),
153
- "aria-current": _ctx.currentPage === 1,
154
- tabindex: vue.unref(tabindex)
155
- }, " 1 ", 10, _hoisted_2)) : vue.createCommentVNode("v-if", true),
156
- showPrevMore.value ? (vue.openBlock(), vue.createElementBlock("li", {
157
- key: 1,
158
- class: vue.normalizeClass([
159
- "more",
160
- "btn-quickprev",
161
- vue.unref(nsIcon).b(),
162
- vue.unref(nsPager).is("disabled", _ctx.disabled)
163
- ]),
164
- tabindex: vue.unref(tabindex),
165
- onMouseenter: _cache[0] || (_cache[0] = ($event) => onMouseEnter(true)),
166
- onMouseleave: _cache[1] || (_cache[1] = ($event) => quickPrevHover.value = false),
167
- onFocus: _cache[2] || (_cache[2] = ($event) => onFocus(true)),
168
- onBlur: _cache[3] || (_cache[3] = ($event) => quickPrevFocus.value = false)
169
- }, [
170
- quickPrevHover.value || quickPrevFocus.value ? (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.DArrowLeft), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.MoreFilled), { key: 1 }))
171
- ], 42, _hoisted_3)) : vue.createCommentVNode("v-if", true),
172
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(pagers), (pager) => {
173
- return vue.openBlock(), vue.createElementBlock("li", {
174
- key: pager,
175
- class: vue.normalizeClass([[
176
- vue.unref(nsPager).is("active", _ctx.currentPage === pager),
177
- vue.unref(nsPager).is("disabled", _ctx.disabled)
178
- ], "number"]),
179
- "aria-current": _ctx.currentPage === pager,
180
- tabindex: vue.unref(tabindex)
181
- }, vue.toDisplayString(pager), 11, _hoisted_4);
182
- }), 128)),
183
- showNextMore.value ? (vue.openBlock(), vue.createElementBlock("li", {
184
- key: 2,
185
- class: vue.normalizeClass([
186
- "more",
187
- "btn-quicknext",
188
- vue.unref(nsIcon).b(),
189
- vue.unref(nsPager).is("disabled", _ctx.disabled)
190
- ]),
191
- tabindex: vue.unref(tabindex),
192
- onMouseenter: _cache[4] || (_cache[4] = ($event) => onMouseEnter()),
193
- onMouseleave: _cache[5] || (_cache[5] = ($event) => quickNextHover.value = false),
194
- onFocus: _cache[6] || (_cache[6] = ($event) => onFocus()),
195
- onBlur: _cache[7] || (_cache[7] = ($event) => quickNextFocus.value = false)
196
- }, [
197
- quickNextHover.value || quickNextFocus.value ? (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.DArrowRight), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.MoreFilled), { key: 1 }))
198
- ], 42, _hoisted_5)) : vue.createCommentVNode("v-if", true),
199
- _ctx.pageCount > 1 ? (vue.openBlock(), vue.createElementBlock("li", {
200
- key: 3,
201
- class: vue.normalizeClass([[
202
- vue.unref(nsPager).is("active", _ctx.currentPage === _ctx.pageCount),
203
- vue.unref(nsPager).is("disabled", _ctx.disabled)
204
- ], "number"]),
205
- "aria-current": _ctx.currentPage === _ctx.pageCount,
206
- tabindex: vue.unref(tabindex)
207
- }, vue.toDisplayString(_ctx.pageCount), 11, _hoisted_6)) : vue.createCommentVNode("v-if", true)
208
- ], 42, _hoisted_1);
209
- };
210
- }
8
+ const paginationPagerProps = runtime.buildProps({
9
+ currentPage: {
10
+ type: Number,
11
+ default: 1
12
+ },
13
+ pageCount: {
14
+ type: Number,
15
+ required: true
16
+ },
17
+ pagerCount: {
18
+ type: Number,
19
+ default: 7
20
+ },
21
+ disabled: Boolean
211
22
  });
212
- var Pager = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/pager.vue"]]);
213
23
 
214
- exports["default"] = Pager;
24
+ exports.paginationPagerProps = paginationPagerProps;
215
25
  //# sourceMappingURL=pager2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pager2.js","sources":["../../../../../../../packages/components/pagination/src/components/pager.vue"],"sourcesContent":["<template>\n <ul :class=\"nsPager.b()\" @click=\"onPagerClick\" @keyup.enter=\"onEnter\">\n <li\n v-if=\"pageCount > 0\"\n :class=\"[\n nsPager.is('active', currentPage === 1),\n nsPager.is('disabled', disabled),\n ]\"\n class=\"number\"\n :aria-current=\"currentPage === 1\"\n :tabindex=\"tabindex\"\n >\n 1\n </li>\n <li\n v-if=\"showPrevMore\"\n :class=\"[\n 'more',\n 'btn-quickprev',\n nsIcon.b(),\n nsPager.is('disabled', disabled),\n ]\"\n :tabindex=\"tabindex\"\n @mouseenter=\"onMouseEnter(true)\"\n @mouseleave=\"quickPrevHover = false\"\n @focus=\"onFocus(true)\"\n @blur=\"quickPrevFocus = false\"\n >\n <d-arrow-left v-if=\"quickPrevHover || quickPrevFocus\" />\n <more-filled v-else />\n </li>\n <li\n v-for=\"pager in pagers\"\n :key=\"pager\"\n :class=\"[\n nsPager.is('active', currentPage === pager),\n nsPager.is('disabled', disabled),\n ]\"\n class=\"number\"\n :aria-current=\"currentPage === pager\"\n :tabindex=\"tabindex\"\n >\n {{ pager }}\n </li>\n <li\n v-if=\"showNextMore\"\n :class=\"[\n 'more',\n 'btn-quicknext',\n nsIcon.b(),\n nsPager.is('disabled', disabled),\n ]\"\n :tabindex=\"tabindex\"\n @mouseenter=\"onMouseEnter()\"\n @mouseleave=\"quickNextHover = false\"\n @focus=\"onFocus()\"\n @blur=\"quickNextFocus = false\"\n >\n <d-arrow-right v-if=\"quickNextHover || quickNextFocus\" />\n <more-filled v-else />\n </li>\n <li\n v-if=\"pageCount > 1\"\n :class=\"[\n nsPager.is('active', currentPage === pageCount),\n nsPager.is('disabled', disabled),\n ]\"\n class=\"number\"\n :aria-current=\"currentPage === pageCount\"\n :tabindex=\"tabindex\"\n >\n {{ pageCount }}\n </li>\n </ul>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, ref, watchEffect } from 'vue'\nimport { DArrowLeft, DArrowRight, MoreFilled } from '@element-plus/icons-vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { paginationPagerProps } from './pager'\ndefineOptions({\n name: 'ElPaginationPager',\n})\nconst props = defineProps(paginationPagerProps)\nconst emit = defineEmits(['change'])\nconst nsPager = useNamespace('pager')\nconst nsIcon = useNamespace('icon')\nconst showPrevMore = ref(false)\nconst showNextMore = ref(false)\nconst quickPrevHover = ref(false)\nconst quickNextHover = ref(false)\nconst quickPrevFocus = ref(false)\nconst quickNextFocus = ref(false)\nconst pagers = computed(() => {\n const pagerCount = props.pagerCount\n const halfPagerCount = (pagerCount - 1) / 2\n const currentPage = Number(props.currentPage)\n const pageCount = Number(props.pageCount)\n let showPrevMore = false\n let showNextMore = false\n if (pageCount > pagerCount) {\n if (currentPage > pagerCount - halfPagerCount) {\n showPrevMore = true\n }\n if (currentPage < pageCount - halfPagerCount) {\n showNextMore = true\n }\n }\n const array: number[] = []\n if (showPrevMore && !showNextMore) {\n const startPage = pageCount - (pagerCount - 2)\n for (let i = startPage; i < pageCount; i++) {\n array.push(i)\n }\n } else if (!showPrevMore && showNextMore) {\n for (let i = 2; i < pagerCount; i++) {\n array.push(i)\n }\n } else if (showPrevMore && showNextMore) {\n const offset = Math.floor(pagerCount / 2) - 1\n for (let i = currentPage - offset; i <= currentPage + offset; i++) {\n array.push(i)\n }\n } else {\n for (let i = 2; i < pageCount; i++) {\n array.push(i)\n }\n }\n return array\n})\nconst tabindex = computed(() => (props.disabled ? -1 : 0))\nwatchEffect(() => {\n const halfPagerCount = (props.pagerCount - 1) / 2\n showPrevMore.value = false\n showNextMore.value = false\n if (props.pageCount! > props.pagerCount) {\n if (props.currentPage > props.pagerCount - halfPagerCount) {\n showPrevMore.value = true\n }\n if (props.currentPage < props.pageCount! - halfPagerCount) {\n showNextMore.value = true\n }\n }\n})\nfunction onMouseEnter(forward = false) {\n if (props.disabled) return\n if (forward) {\n quickPrevHover.value = true\n } else {\n quickNextHover.value = true\n }\n}\nfunction onFocus(forward = false) {\n if (forward) {\n quickPrevFocus.value = true\n } else {\n quickNextFocus.value = true\n }\n}\nfunction onEnter(e: UIEvent) {\n const target = e.target as HTMLElement\n if (\n target.tagName.toLowerCase() === 'li' &&\n Array.from(target.classList).includes('number')\n ) {\n const newPage = Number(target.textContent)\n if (newPage !== props.currentPage) {\n emit('change', newPage)\n }\n } else if (\n target.tagName.toLowerCase() === 'li' &&\n Array.from(target.classList).includes('more')\n ) {\n onPagerClick(e)\n }\n}\nfunction onPagerClick(event: UIEvent) {\n const target = event.target as HTMLElement\n if (target.tagName.toLowerCase() === 'ul' || props.disabled) {\n return\n }\n let newPage = Number(target.textContent)\n const pageCount = props.pageCount!\n const currentPage = props.currentPage\n const pagerCountOffset = props.pagerCount - 2\n if (target.className.includes('more')) {\n if (target.className.includes('quickprev')) {\n newPage = currentPage - pagerCountOffset\n } else if (target.className.includes('quicknext')) {\n newPage = currentPage + pagerCountOffset\n }\n }\n if (!Number.isNaN(+newPage)) {\n if (newPage < 1) {\n newPage = 1\n }\n if (newPage > pageCount) {\n newPage = pageCount\n }\n }\n if (newPage !== currentPage) {\n emit('change', newPage)\n }\n}\n</script>\n"],"names":["useNamespace","ref","computed","watchEffect"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAqFA,IAAA,MAAA,OAAA,GAAAA,mBAAA,OAAA,CAAA,CAAA;AACA,IAAA,MAAA,MAAA,GAAAA,mBAAA,MAAA,CAAA,CAAA;AACA,IAAA,MAAA,YAAA,GAAAC,QAAA,KAAA,CAAA,CAAA;AACA,IAAA,MAAA,YAAA,GAAAA,QAAA,KAAA,CAAA,CAAA;AACA,IAAA,MAAA,cAAA,GAAAA,QAAA,KAAA,CAAA,CAAA;AACA,IAAA,MAAA,cAAA,GAAAA,QAAA,KAAA,CAAA,CAAA;AACA,IAAA,MAAA,cAAA,GAAAA,QAAA,KAAA,CAAA,CAAA;AACA,IAAA,MAAA,cAAA,GAAAA,QAAA,KAAA,CAAA,CAAA;AACA,IAAA,MAAA,MAAA,GAAAC,aAAA,MAAA;AACA,MAAA,MAAA,aAAA,KAAA,CAAA,UAAA,CAAA;AACA,MAAA,MAAA,cAAA,GAAA,cAAA,CAAA,IAAA,CAAA,CAAA;AACA,MAAA,MAAA,WAAA,GAAA,MAAA,CAAA,KAAA,CAAA,WAAA,CAAA,CAAA;AACA,MAAA,MAAA,SAAA,GAAA,MAAA,CAAA,KAAA,CAAA,SAAA,CAAA,CAAA;AACA,MAAA,IAAA,aAAA,GAAA,KAAA,CAAA;AACA,MAAA,IAAA,aAAA,GAAA,KAAA,CAAA;AACA,MAA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AAA;AACA,UAAA,OAAA,GAAA,WAAA,GAAA,gBAAA,CAAA;AAAA,SACA;AAAA,OACA;AACA,MAAA,IAAA,CAAA,MAAA,CAAA,KAAA,CAAA,CAAA,OAAA,CAAA,EAAA;AACA,QAAA,IAAA,UAAA,CAAA,EAAA;AACA,UAAA,OAAA,GAAA,CAAA,CAAA;AAAA,SACA;AACA,QAAA,IAAA,UAAA,SAAA,EAAA;AACA,UAAA,OAAA,GAAA,SAAA,CAAA;AAAA,SACA;AAAA,OACA;AACA,MAAA,IAAA,YAAA,WAAA,EAAA;AACA,QAAA,IAAA,CAAA,UAAA,OAAA,CAAA,CAAA;AAAA,OACA;AAAA,KACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"pager2.js","sources":["../../../../../../../packages/components/pagination/src/components/pager.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Pager from './pager.vue'\n\nexport const paginationPagerProps = buildProps({\n currentPage: {\n type: Number,\n default: 1,\n },\n pageCount: {\n type: Number,\n required: true,\n },\n pagerCount: {\n type: Number,\n default: 7,\n },\n disabled: Boolean,\n} as const)\n\nexport type PaginationPagerProps = ExtractPropTypes<typeof paginationPagerProps>\n\nexport type PagerInstance = InstanceType<typeof Pager>\n"],"names":["buildProps"],"mappings":";;;;;;;AACY,MAAC,oBAAoB,GAAGA,kBAAU,CAAC;AAC/C,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,QAAQ,EAAE,IAAI;AAClB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,CAAC;;;;"}
@@ -11,7 +11,7 @@ var next = require('./components/next2.js');
11
11
  var sizes = require('./components/sizes2.js');
12
12
  var jumper = require('./components/jumper.js');
13
13
  var total = require('./components/total2.js');
14
- var pager = require('./components/pager2.js');
14
+ var pager = require('./components/pager.js');
15
15
  var runtime = require('../../../utils/vue/props/runtime.js');
16
16
  var typescript = require('../../../utils/typescript.js');
17
17
  var index = require('../../../hooks/use-locale/index.js');
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  require('../../utils/index.js');
6
- var row$1 = require('./src/row2.js');
7
- var row = require('./src/row.js');
6
+ var row$1 = require('./src/row.js');
7
+ var row = require('./src/row2.js');
8
8
  var install = require('../../utils/vue/install.js');
9
9
 
10
10
  const ElRow = install.withInstall(row$1["default"]);
@@ -2,40 +2,53 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- require('../../../utils/index.js');
6
- var runtime = require('../../../utils/vue/props/runtime.js');
5
+ var vue = require('vue');
6
+ require('../../../hooks/index.js');
7
+ require('../../../tokens/index.js');
8
+ var row = require('./row2.js');
9
+ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
10
+ var index = require('../../../hooks/use-namespace/index.js');
11
+ var row$1 = require('../../../tokens/row.js');
7
12
 
8
- const RowJustify = [
9
- "start",
10
- "center",
11
- "end",
12
- "space-around",
13
- "space-between",
14
- "space-evenly"
15
- ];
16
- const RowAlign = ["top", "middle", "bottom"];
17
- const rowProps = runtime.buildProps({
18
- tag: {
19
- type: String,
20
- default: "div"
21
- },
22
- gutter: {
23
- type: Number,
24
- default: 0
25
- },
26
- justify: {
27
- type: String,
28
- values: RowJustify,
29
- default: "start"
30
- },
31
- align: {
32
- type: String,
33
- values: RowAlign,
34
- default: "top"
13
+ const __default__ = {
14
+ name: "ElRow"
15
+ };
16
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
17
+ ...__default__,
18
+ props: row.rowProps,
19
+ setup(__props) {
20
+ const props = __props;
21
+ const ns = index.useNamespace("row");
22
+ const gutter = vue.computed(() => props.gutter);
23
+ vue.provide(row$1.rowContextKey, {
24
+ gutter
25
+ });
26
+ const style = vue.computed(() => {
27
+ const styles = {};
28
+ if (!props.gutter) {
29
+ return styles;
30
+ }
31
+ styles.marginRight = styles.marginLeft = `-${props.gutter / 2}px`;
32
+ return styles;
33
+ });
34
+ return (_ctx, _cache) => {
35
+ return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.tag), {
36
+ class: vue.normalizeClass([
37
+ vue.unref(ns).b(),
38
+ vue.unref(ns).is(`justify-${props.justify}`, _ctx.justify !== "start"),
39
+ vue.unref(ns).is(`align-${props.align}`, _ctx.align !== "top")
40
+ ]),
41
+ style: vue.normalizeStyle(vue.unref(style))
42
+ }, {
43
+ default: vue.withCtx(() => [
44
+ vue.renderSlot(_ctx.$slots, "default")
45
+ ]),
46
+ _: 3
47
+ }, 8, ["class", "style"]);
48
+ };
35
49
  }
36
50
  });
51
+ var Row = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/row/src/row.vue"]]);
37
52
 
38
- exports.RowAlign = RowAlign;
39
- exports.RowJustify = RowJustify;
40
- exports.rowProps = rowProps;
53
+ exports["default"] = Row;
41
54
  //# sourceMappingURL=row.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"row.js","sources":["../../../../../../packages/components/row/src/row.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Row from './row.vue'\n\nexport const RowJustify = [\n 'start',\n 'center',\n 'end',\n 'space-around',\n 'space-between',\n 'space-evenly',\n] as const\n\nexport const RowAlign = ['top', 'middle', 'bottom'] as const\n\nexport const rowProps = buildProps({\n tag: {\n type: String,\n default: 'div',\n },\n gutter: {\n type: Number,\n default: 0,\n },\n justify: {\n type: String,\n values: RowJustify,\n default: 'start',\n },\n align: {\n type: String,\n values: RowAlign,\n default: 'top',\n },\n} as const)\n\nexport type RowProps = ExtractPropTypes<typeof rowProps>\nexport type RowInstance = InstanceType<typeof Row>\n"],"names":["buildProps"],"mappings":";;;;;;;AACY,MAAC,UAAU,GAAG;AAC1B,EAAE,OAAO;AACT,EAAE,QAAQ;AACV,EAAE,KAAK;AACP,EAAE,cAAc;AAChB,EAAE,eAAe;AACjB,EAAE,cAAc;AAChB,EAAE;AACU,MAAC,QAAQ,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE;AACxC,MAAC,QAAQ,GAAGA,kBAAU,CAAC;AACnC,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,UAAU;AACtB,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,QAAQ;AACpB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,CAAC;;;;;;"}
1
+ {"version":3,"file":"row.js","sources":["../../../../../../packages/components/row/src/row.vue"],"sourcesContent":["<template>\n <component\n :is=\"tag\"\n :class=\"[\n ns.b(),\n ns.is(`justify-${props.justify}`, justify !== 'start'),\n ns.is(`align-${props.align}`, align !== 'top'),\n ]\"\n :style=\"style\"\n >\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, provide } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { rowContextKey } from '@element-plus/tokens'\nimport { rowProps } from './row'\nimport type { CSSProperties } from 'vue'\n\ndefineOptions({\n name: 'ElRow',\n})\n\nconst props = defineProps(rowProps)\n\nconst ns = useNamespace('row')\nconst gutter = computed(() => props.gutter)\n\nprovide(rowContextKey, {\n gutter,\n})\n\nconst style = computed(() => {\n const styles: CSSProperties = {}\n if (!props.gutter) {\n return styles\n }\n\n styles.marginRight = styles.marginLeft = `-${props.gutter / 2}px`\n return styles\n})\n</script>\n"],"names":["useNamespace","computed","provide","rowContextKey"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2BA,IAAA,MAAA,EAAA,GAAAA,mBAAA,KAAA,CAAA,CAAA;AACA,IAAA,MAAA,MAAA,GAAAC,YAAA,CAAA,MAAA,KAAA,CAAA,MAAA,CAAA,CAAA;AAEA,IAAAC,WAAA,CAAAC,mBAAA,EAAA;AAAA,MACA,MAAA;AAAA,KACA,CAAA,CAAA;AAEA,IAAA,MAAA,KAAA,GAAAF,aAAA,MAAA;AACA,MAAA,MAAA,SAAA,EAAA,CAAA;AACA,MAAA,IAAA,CAAA,MAAA,MAAA,EAAA;AACA,QAAA,OAAA,MAAA,CAAA;AAAA,OACA;AAEA,MAAA,MAAA,CAAA,WAAA,GAAA,MAAA,CAAA,UAAA,GAAA,CAAA,CAAA,EAAA,MAAA,MAAA,GAAA,CAAA,CAAA,EAAA,CAAA,CAAA;AACA,MAAA,OAAA,MAAA,CAAA;AAAA,KACA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,53 +2,40 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var vue = require('vue');
6
- require('../../../hooks/index.js');
7
- require('../../../tokens/index.js');
8
- var row = require('./row.js');
9
- var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
10
- var index = require('../../../hooks/use-namespace/index.js');
11
- var row$1 = require('../../../tokens/row.js');
5
+ require('../../../utils/index.js');
6
+ var runtime = require('../../../utils/vue/props/runtime.js');
12
7
 
13
- const __default__ = {
14
- name: "ElRow"
15
- };
16
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
17
- ...__default__,
18
- props: row.rowProps,
19
- setup(__props) {
20
- const props = __props;
21
- const ns = index.useNamespace("row");
22
- const gutter = vue.computed(() => props.gutter);
23
- vue.provide(row$1.rowContextKey, {
24
- gutter
25
- });
26
- const style = vue.computed(() => {
27
- const styles = {};
28
- if (!props.gutter) {
29
- return styles;
30
- }
31
- styles.marginRight = styles.marginLeft = `-${props.gutter / 2}px`;
32
- return styles;
33
- });
34
- return (_ctx, _cache) => {
35
- return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.tag), {
36
- class: vue.normalizeClass([
37
- vue.unref(ns).b(),
38
- vue.unref(ns).is(`justify-${props.justify}`, _ctx.justify !== "start"),
39
- vue.unref(ns).is(`align-${props.align}`, _ctx.align !== "top")
40
- ]),
41
- style: vue.normalizeStyle(vue.unref(style))
42
- }, {
43
- default: vue.withCtx(() => [
44
- vue.renderSlot(_ctx.$slots, "default")
45
- ]),
46
- _: 3
47
- }, 8, ["class", "style"]);
48
- };
8
+ const RowJustify = [
9
+ "start",
10
+ "center",
11
+ "end",
12
+ "space-around",
13
+ "space-between",
14
+ "space-evenly"
15
+ ];
16
+ const RowAlign = ["top", "middle", "bottom"];
17
+ const rowProps = runtime.buildProps({
18
+ tag: {
19
+ type: String,
20
+ default: "div"
21
+ },
22
+ gutter: {
23
+ type: Number,
24
+ default: 0
25
+ },
26
+ justify: {
27
+ type: String,
28
+ values: RowJustify,
29
+ default: "start"
30
+ },
31
+ align: {
32
+ type: String,
33
+ values: RowAlign,
34
+ default: "top"
49
35
  }
50
36
  });
51
- var Row = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/row/src/row.vue"]]);
52
37
 
53
- exports["default"] = Row;
38
+ exports.RowAlign = RowAlign;
39
+ exports.RowJustify = RowJustify;
40
+ exports.rowProps = rowProps;
54
41
  //# sourceMappingURL=row2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"row2.js","sources":["../../../../../../packages/components/row/src/row.vue"],"sourcesContent":["<template>\n <component\n :is=\"tag\"\n :class=\"[\n ns.b(),\n ns.is(`justify-${props.justify}`, justify !== 'start'),\n ns.is(`align-${props.align}`, align !== 'top'),\n ]\"\n :style=\"style\"\n >\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, provide } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { rowContextKey } from '@element-plus/tokens'\nimport { rowProps } from './row'\nimport type { CSSProperties } from 'vue'\n\ndefineOptions({\n name: 'ElRow',\n})\n\nconst props = defineProps(rowProps)\n\nconst ns = useNamespace('row')\nconst gutter = computed(() => props.gutter)\n\nprovide(rowContextKey, {\n gutter,\n})\n\nconst style = computed(() => {\n const styles: CSSProperties = {}\n if (!props.gutter) {\n return styles\n }\n\n styles.marginRight = styles.marginLeft = `-${props.gutter / 2}px`\n return styles\n})\n</script>\n"],"names":["useNamespace","computed","provide","rowContextKey"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2BA,IAAA,MAAA,EAAA,GAAAA,mBAAA,KAAA,CAAA,CAAA;AACA,IAAA,MAAA,MAAA,GAAAC,YAAA,CAAA,MAAA,KAAA,CAAA,MAAA,CAAA,CAAA;AAEA,IAAAC,WAAA,CAAAC,mBAAA,EAAA;AAAA,MACA,MAAA;AAAA,KACA,CAAA,CAAA;AAEA,IAAA,MAAA,KAAA,GAAAF,aAAA,MAAA;AACA,MAAA,MAAA,SAAA,EAAA,CAAA;AACA,MAAA,IAAA,CAAA,MAAA,MAAA,EAAA;AACA,QAAA,OAAA,MAAA,CAAA;AAAA,OACA;AAEA,MAAA,MAAA,CAAA,WAAA,GAAA,MAAA,CAAA,UAAA,GAAA,CAAA,CAAA,EAAA,MAAA,MAAA,GAAA,CAAA,CAAA,EAAA,CAAA,CAAA;AACA,MAAA,OAAA,MAAA,CAAA;AAAA,KACA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"row2.js","sources":["../../../../../../packages/components/row/src/row.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Row from './row.vue'\n\nexport const RowJustify = [\n 'start',\n 'center',\n 'end',\n 'space-around',\n 'space-between',\n 'space-evenly',\n] as const\n\nexport const RowAlign = ['top', 'middle', 'bottom'] as const\n\nexport const rowProps = buildProps({\n tag: {\n type: String,\n default: 'div',\n },\n gutter: {\n type: Number,\n default: 0,\n },\n justify: {\n type: String,\n values: RowJustify,\n default: 'start',\n },\n align: {\n type: String,\n values: RowAlign,\n default: 'top',\n },\n} as const)\n\nexport type RowProps = ExtractPropTypes<typeof rowProps>\nexport type RowInstance = InstanceType<typeof Row>\n"],"names":["buildProps"],"mappings":";;;;;;;AACY,MAAC,UAAU,GAAG;AAC1B,EAAE,OAAO;AACT,EAAE,QAAQ;AACV,EAAE,KAAK;AACP,EAAE,cAAc;AAChB,EAAE,eAAe;AACjB,EAAE,cAAc;AAChB,EAAE;AACU,MAAC,QAAQ,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE;AACxC,MAAC,QAAQ,GAAGA,kBAAU,CAAC;AACnC,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,UAAU;AACtB,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,QAAQ;AACpB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,CAAC;;;;;;"}
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  require('../../utils/index.js');
6
- var skeleton$1 = require('./src/skeleton2.js');
6
+ var skeleton$1 = require('./src/skeleton.js');
7
7
  var skeletonItem$1 = require('./src/skeleton-item2.js');
8
- var skeleton = require('./src/skeleton.js');
8
+ var skeleton = require('./src/skeleton2.js');
9
9
  var skeletonItem = require('./src/skeleton-item.js');
10
10
  var install = require('../../utils/vue/install.js');
11
11
 
@@ -2,30 +2,57 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- require('../../../utils/index.js');
6
- var runtime = require('../../../utils/vue/props/runtime.js');
5
+ var vue = require('vue');
6
+ require('../../../hooks/index.js');
7
+ var skeleton = require('./skeleton2.js');
8
+ var skeletonItem = require('./skeleton-item2.js');
9
+ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
10
+ var index = require('../../../hooks/use-namespace/index.js');
11
+ var index$1 = require('../../../hooks/use-throttle-render/index.js');
7
12
 
8
- const skeletonProps = runtime.buildProps({
9
- animated: {
10
- type: Boolean,
11
- default: false
12
- },
13
- count: {
14
- type: Number,
15
- default: 1
16
- },
17
- rows: {
18
- type: Number,
19
- default: 3
20
- },
21
- loading: {
22
- type: Boolean,
23
- default: true
24
- },
25
- throttle: {
26
- type: Number
13
+ const __default__ = {
14
+ name: "ElSkeleton"
15
+ };
16
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
17
+ ...__default__,
18
+ props: skeleton.skeletonProps,
19
+ setup(__props, { expose }) {
20
+ const props = __props;
21
+ const ns = index.useNamespace("skeleton");
22
+ const uiLoading = index$1.useThrottleRender(vue.toRef(props, "loading"), props.throttle);
23
+ expose({
24
+ uiLoading
25
+ });
26
+ return (_ctx, _cache) => {
27
+ return vue.unref(uiLoading) ? (vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
28
+ key: 0,
29
+ class: [vue.unref(ns).b(), vue.unref(ns).is("animated", _ctx.animated)]
30
+ }, _ctx.$attrs), [
31
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.count, (i) => {
32
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: i }, [
33
+ _ctx.loading ? vue.renderSlot(_ctx.$slots, "template", { key: i }, () => [
34
+ vue.createVNode(skeletonItem["default"], {
35
+ class: vue.normalizeClass(vue.unref(ns).is("first")),
36
+ variant: "p"
37
+ }, null, 8, ["class"]),
38
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.rows, (item) => {
39
+ return vue.openBlock(), vue.createBlock(skeletonItem["default"], {
40
+ key: item,
41
+ class: vue.normalizeClass([
42
+ vue.unref(ns).e("paragraph"),
43
+ vue.unref(ns).is("last", item === _ctx.rows && _ctx.rows > 1)
44
+ ]),
45
+ variant: "p"
46
+ }, null, 8, ["class"]);
47
+ }), 128))
48
+ ]) : vue.createCommentVNode("v-if", true)
49
+ ], 64);
50
+ }), 128))
51
+ ], 16)) : vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.mergeProps({ key: 1 }, _ctx.$attrs)));
52
+ };
27
53
  }
28
54
  });
55
+ var Skeleton = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/skeleton/src/skeleton.vue"]]);
29
56
 
30
- exports.skeletonProps = skeletonProps;
57
+ exports["default"] = Skeleton;
31
58
  //# sourceMappingURL=skeleton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"skeleton.js","sources":["../../../../../../packages/components/skeleton/src/skeleton.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport type Skeleton from './skeleton.vue'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const skeletonProps = buildProps({\n animated: {\n type: Boolean,\n default: false,\n },\n count: {\n type: Number,\n default: 1,\n },\n rows: {\n type: Number,\n default: 3,\n },\n loading: {\n type: Boolean,\n default: true,\n },\n throttle: {\n type: Number,\n },\n} as const)\nexport type SkeletonProps = ExtractPropTypes<typeof skeletonProps>\n\nexport type SkeletonInstance = InstanceType<typeof Skeleton>\n"],"names":["buildProps"],"mappings":";;;;;;;AACY,MAAC,aAAa,GAAGA,kBAAU,CAAC;AACxC,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,CAAC;;;;"}
1
+ {"version":3,"file":"skeleton.js","sources":["../../../../../../packages/components/skeleton/src/skeleton.vue"],"sourcesContent":["<template>\n <template v-if=\"uiLoading\">\n <div :class=\"[ns.b(), ns.is('animated', animated)]\" v-bind=\"$attrs\">\n <template v-for=\"i in count\" :key=\"i\">\n <slot v-if=\"loading\" :key=\"i\" name=\"template\">\n <el-skeleton-item :class=\"ns.is('first')\" variant=\"p\" />\n <el-skeleton-item\n v-for=\"item in rows\"\n :key=\"item\"\n :class=\"[\n ns.e('paragraph'),\n ns.is('last', item === rows && rows > 1),\n ]\"\n variant=\"p\"\n />\n </slot>\n </template>\n </div>\n </template>\n <template v-else>\n <slot v-bind=\"$attrs\" />\n </template>\n</template>\n\n<script lang=\"ts\" setup>\nimport { toRef } from 'vue'\nimport { useNamespace, useThrottleRender } from '@element-plus/hooks'\nimport { skeletonProps } from './skeleton'\nimport ElSkeletonItem from './skeleton-item.vue'\n\ndefineOptions({\n name: 'ElSkeleton',\n})\nconst props = defineProps(skeletonProps)\n\nconst ns = useNamespace('skeleton')\nconst uiLoading = useThrottleRender(toRef(props, 'loading'), props.throttle)\n\ndefineExpose({\n /** @description loading state */\n uiLoading,\n})\n</script>\n"],"names":["useNamespace","useThrottleRender","toRef"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmCA,IAAA,MAAA,EAAA,GAAAA,mBAAA,UAAA,CAAA,CAAA;AACA,IAAA,MAAA,YAAAC,yBAAA,CAAAC,SAAA,CAAA,OAAA,SAAA,CAAA,EAAA,MAAA,QAAA,CAAA,CAAA;AAEA,IAAA,MAAA,CAAA;AAAA,MAEA,SAAA;AAAA,KACA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}