@v-c/pagination 1.1.1 → 1.1.2

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.
@@ -4,7 +4,7 @@ import isEnterOrSpaceKey from "./isEnterOrSpaceKey.js";
4
4
  import locale from "./locale/zh_CN.js";
5
5
  import { computed, createTextVNode, createVNode, defineComponent, h, isVNode, mergeProps, ref, toRef, watchEffect } from "vue";
6
6
  import KeyCode from "@v-c/util/dist/KeyCode";
7
- import { classNames } from "@v-c/util";
7
+ import { classNames, isVueRenderable } from "@v-c/util";
8
8
  import useMergedState from "@v-c/util/dist/hooks/useMergedState";
9
9
  import pickAttrs from "@v-c/util/dist/pickAttrs";
10
10
  import { getAttrStyleAndClass } from "@v-c/util/dist/props-util";
@@ -74,7 +74,7 @@ var Pagination = /* @__PURE__ */ defineComponent((props, { attrs }) => {
74
74
  }
75
75
  function getItemIcon(icon, _label, title) {
76
76
  const prefixCls = mergedPrefixCls.value;
77
- let iconNode = icon || createVNode("button", {
77
+ let iconNode = isVueRenderable(icon) ? icon : createVNode("button", {
78
78
  "type": "button",
79
79
  "tabindex": -1,
80
80
  "aria-hidden": "true",
@@ -211,7 +211,7 @@ var Pagination = /* @__PURE__ */ defineComponent((props, { attrs }) => {
211
211
  const itemClassName = paginationClassNames?.item;
212
212
  const itemStyle = styles?.item;
213
213
  let prev = renderPrev(prevPage.value);
214
- if (prev) {
214
+ if (isVueRenderable(prev)) {
215
215
  const prevDisabled = !hasPrev.value || !allPages.value;
216
216
  (function() {
217
217
  return prev;
@@ -228,7 +228,7 @@ var Pagination = /* @__PURE__ */ defineComponent((props, { attrs }) => {
228
228
  }, [prev]);
229
229
  }
230
230
  let next = renderNext(nextPage.value);
231
- if (next) {
231
+ if (isVueRenderable(next)) {
232
232
  let nextDisabled, nextTabIndex;
233
233
  if (simple) {
234
234
  nextDisabled = !hasNext.value;
@@ -326,21 +326,21 @@ var Pagination = /* @__PURE__ */ defineComponent((props, { attrs }) => {
326
326
  let jumpPrev = null;
327
327
  let jumpNext = null;
328
328
  if (showPrevNextJumpers) {
329
- jumpPrev = jumpPrevContent ? createVNode("li", {
329
+ jumpPrev = isVueRenderable(jumpPrevContent) ? createVNode("li", {
330
330
  "key": "prev",
331
331
  "onClick": jumpPrevHandle,
332
332
  "tabindex": 0,
333
333
  "onKeydown": runIfEnterJumpPrev,
334
- "class": classNames(`${prefixCls}-jump-prev`, { [`${prefixCls}-jump-prev-custom-icon`]: !!jumpPrevIcon }),
334
+ "class": classNames(`${prefixCls}-jump-prev`, { [`${prefixCls}-jump-prev-custom-icon`]: isVueRenderable(jumpPrevIcon) }),
335
335
  "role": "button",
336
336
  "aria-label": prevItemTitle
337
337
  }, [jumpPrevContent]) : null;
338
- jumpNext = jumpNextContent ? createVNode("li", {
338
+ jumpNext = isVueRenderable(jumpNextContent) ? createVNode("li", {
339
339
  "key": "next",
340
340
  "onClick": jumpNextHandle,
341
341
  "tabindex": 0,
342
342
  "onKeydown": runIfEnterJumpNext,
343
- "class": classNames(`${prefixCls}-jump-next`, { [`${prefixCls}-jump-next-custom-icon`]: !!jumpNextIcon }),
343
+ "class": classNames(`${prefixCls}-jump-next`, { [`${prefixCls}-jump-next-custom-icon`]: isVueRenderable(jumpNextIcon) }),
344
344
  "role": "button",
345
345
  "aria-label": nextItemTitle
346
346
  }, [jumpNextContent]) : null;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@v-c/pagination",
3
3
  "type": "module",
4
- "version": "1.1.1",
4
+ "version": "1.1.2",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/antdv-next/vue-components/tree/next/packages/pagination",
7
7
  "repository": {
@@ -49,7 +49,7 @@
49
49
  "vue": "^3.0.0"
50
50
  },
51
51
  "dependencies": {
52
- "@v-c/util": "^1.1.0"
52
+ "@v-c/util": "^1.2.0"
53
53
  },
54
54
  "scripts": {
55
55
  "build": "vite build",