feat: migrate Pagination Header and InputOTP with field and event regressions

This commit is contained in:
maoyingjie
2026-10-23 13:49:44 +08:00
parent b2525bb04d
commit 1fa2929a24
72 changed files with 5784 additions and 16 deletions
@@ -0,0 +1,45 @@
<script lang="ts">
import { defineComponent, h, useAttrs, type VNodeChild } from "vue";
import PaginationChevronRightIcon from "./PaginationChevronRightIcon.vue";
function hasContent(nodes: VNodeChild[] | undefined): boolean {
if (!nodes || nodes.length === 0) return false;
return nodes.some((node) => {
if (node == null || node === false || node === true) return false;
if (typeof node === "string") return node.trim() !== "";
if (typeof node === "number") return true;
return true;
});
}
export default defineComponent({
name: "PaginationNextIcon",
inheritAttrs: false,
props: {
/** Render the icon wrapper as a custom element instead of `span`. */
as: {
type: String,
default: "span",
},
},
setup(props, { slots }) {
const attrs = useAttrs();
function render() {
const content = slots.default?.() as VNodeChild[] | undefined;
return h(
props.as,
{
...attrs,
class: attrs.class,
"aria-hidden": "true",
"data-slot": "pagination-next-icon",
},
hasContent(content) ? content : [h(PaginationChevronRightIcon)],
);
}
return render;
},
});
</script>