// src/app/piying/page/component/extension/pagination/example/count/content.ts
import * as v from 'valibot';
import { actions, NFCSchema } from '@piying/view-angular-core';
import { safeDefine } from '@@piying-define';
export default v.pipe(
v.tuple([
v.pipe(
NFCSchema,
safeDefine.setComponent('pagination', (actions) => {
return [
actions.inputs.patch({
count: 500,
value: { index: 0, size: 10 },
}),
];
}),
),
]),
actions.wrappers.patch(['div']),
actions.class.top('flex gap-4'),
);
// src/app/piying/page/component/extension/pagination/example/direction/content.ts
import * as v from 'valibot';
import { actions, NFCSchema } from '@piying/view-angular-core';
import { safeDefine } from '@@piying-define';
export default v.pipe(
v.tuple([
v.pipe(
NFCSchema,
safeDefine.setComponent('pagination', (actions) => {
return [
actions.inputs.patch({
direction: 'vertical',
count: 100,
value: { index: 0, size: 10 },
}),
];
}),
),
]),
actions.wrappers.patch(['div']),
actions.class.top('flex gap-4'),
);
// src/app/piying/page/component/extension/pagination/example/optionsLabel/content.ts
import * as v from 'valibot';
import { actions, NFCSchema } from '@piying/view-angular-core';
import { safeDefine } from '@@piying-define';
export default v.pipe(
v.tuple([
v.pipe(
NFCSchema,
safeDefine.setComponent('pagination', (actions) => {
return [
actions.inputs.patch({
optionsLabel: (size: number, index: number, count: number) => `${size} 条/页`,
count: 150,
value: { index: 0, size: 10 },
}),
];
}),
),
]),
actions.wrappers.patch(['div']),
actions.class.top('flex gap-4'),
);
// src/app/piying/page/component/extension/pagination/example/sizeOptions/content.ts
import * as v from 'valibot';
import { actions, NFCSchema } from '@piying/view-angular-core';
import { safeDefine } from '@@piying-define';
export default v.pipe(
v.tuple([
v.pipe(
NFCSchema,
safeDefine.setComponent('pagination', (actions) => {
return [
actions.inputs.patch({
sizeOptions: [10, 20, 50, 100],
count: 200,
value: { index: 0, size: 20 },
}),
];
}),
),
]),
actions.wrappers.patch(['div']),
actions.class.top('flex gap-4'),
);