#

all-props

// src/app/piying/page/component/field-control/input/example/all-props/content.ts
import * as v from 'valibot';
import { actions } from '@piying/view-angular-core';
import { safeDefine } from '@@piying-define';
export default v.pipe(
  v.tuple([
    v.pipe(
      v.string(),
      safeDefine.setComponent('input', (actions) => {
        return [
          actions.inputs.patch({
            type: 'text',
            size: 'lg',
            color: 'primary',
          }),
        ];
      }),
    ),
  ]),
  actions.wrappers.patch(['div']),
  actions.class.top('flex gap-4'),
);
content_copy
#

base

// src/app/piying/page/component/field-control/input/example/base/content.ts
import * as v from 'valibot';
import { actions } from '@piying/view-angular-core';
import { safeDefine } from '@@piying-define';
export default v.pipe(
  v.tuple([
    v.pipe(
      v.string(),
      safeDefine.setComponent('input', (actions) => {
        return [actions.inputs.patch({})];
      }),
    ),
  ]),
  actions.wrappers.patch(['div']),
  actions.class.top('flex gap-4'),
);
content_copy
#

color

// src/app/piying/page/component/field-control/input/example/color/content.ts
import * as v from 'valibot';
import { actions } from '@piying/view-angular-core';
import { safeDefine } from '@@piying-define';
export default v.pipe(
  v.tuple([
    v.pipe(
      v.string(),
      safeDefine.setComponent('input', (actions) => {
        return [actions.inputs.patch({ color: 'primary' })];
      }),
    ),
    v.pipe(
      v.string(),
      safeDefine.setComponent('input', (actions) => {
        return [actions.inputs.patch({ color: 'secondary' })];
      }),
    ),
    v.pipe(
      v.string(),
      safeDefine.setComponent('input', (actions) => {
        return [actions.inputs.patch({ color: 'accent' })];
      }),
    ),
    v.pipe(
      v.string(),
      safeDefine.setComponent('input', (actions) => {
        return [actions.inputs.patch({ color: 'neutral' })];
      }),
    ),
  ]),
  actions.wrappers.patch(['div']),
  actions.class.top('flex gap-4 flex-wrap'),
);
content_copy
#

disabled

// src/app/piying/page/component/field-control/input/example/disabled/content.ts
import * as v from 'valibot';
import { actions, formConfig } from '@piying/view-angular-core';
import { safeDefine } from '@@piying-define';
export default v.pipe(
  v.tuple([
    v.pipe(
      v.string(),
      safeDefine.setComponent('input', (actions) => {
        return [];
      }),
    ),
    v.pipe(
      v.string(),
      safeDefine.setComponent('input', (actions) => {
        return [];
      }),
      formConfig({ disabled: true }),
    ),
  ]),
  actions.wrappers.patch(['div']),
  actions.class.top('flex gap-4 flex-wrap'),
);
content_copy
#

size

// src/app/piying/page/component/field-control/input/example/size/content.ts
import * as v from 'valibot';
import { actions } from '@piying/view-angular-core';
import { safeDefine } from '@@piying-define';
export default v.pipe(
  v.tuple([
    v.pipe(
      v.string(),
      safeDefine.setComponent('input', (actions) => {
        return [actions.inputs.patch({ size: 'xs' })];
      }),
    ),
    v.pipe(
      v.string(),
      safeDefine.setComponent('input', (actions) => {
        return [actions.inputs.patch({ size: 'sm' })];
      }),
    ),
    v.pipe(
      v.string(),
      safeDefine.setComponent('input', (actions) => {
        return [actions.inputs.patch({ size: 'md' })];
      }),
    ),
    v.pipe(
      v.string(),
      safeDefine.setComponent('input', (actions) => {
        return [actions.inputs.patch({ size: 'lg' })];
      }),
    ),
  ]),
  actions.wrappers.patch(['div']),
  actions.class.top('flex gap-4 flex-wrap'),
);
content_copy
#

type

// src/app/piying/page/component/field-control/input/example/type/content.ts
import * as v from 'valibot';
import { actions } from '@piying/view-angular-core';
import { safeDefine } from '@@piying-define';
export default v.pipe(
  v.tuple([
    v.pipe(
      v.string(),
      safeDefine.setComponent('input', (actions) => {
        return [actions.inputs.patch({ type: 'text' })];
      }),
    ),
    v.pipe(
      v.string(),
      safeDefine.setComponent('input', (actions) => {
        return [actions.inputs.patch({ type: 'email' })];
      }),
    ),
    v.pipe(
      v.string(),
      safeDefine.setComponent('input', (actions) => {
        return [actions.inputs.patch({ type: 'password' })];
      }),
    ),
    v.pipe(
      v.number(),
      safeDefine.setComponent('input', (actions) => {
        return [actions.inputs.patch({ type: 'number' })];
      }),
    ),
    v.pipe(
      v.date(),
      safeDefine.setComponent('input', (actions) => {
        return [actions.inputs.patch({ type: 'date' })];
      }),
    ),
  ]),
  actions.wrappers.patch(['div']),
  actions.class.top('flex gap-4 flex-wrap'),
);
content_copy