component Checkbox { outputs { input(payload: { value?: string | number | boolean | null; values?: Array; sourceEvent?: Event; [key: string]: string | number | boolean | null | object } | string | number | boolean | null) change(payload: { value?: string | number | boolean | null; values?: Array; sourceEvent?: Event; [key: string]: string | number | boolean | null | object } | string | number | boolean | null) focus(payload: { sourceEvent?: Event; [key: string]: string | number | boolean | null | object }) blur(payload: { sourceEvent?: Event; [key: string]: string | number | boolean | null | object }) invalid(payload: { message?: string; value: string | number | boolean | null | object; sourceEvent?: Event; [key: string]: string | number | boolean | null | object }) } props { size: string = "default" color: string = "primary" id: string = "" name: string = "" label: string = "Checkbox" hiddenLabel: boolean = false placeholder: string = "" variant: string = "normal" icon: string = "" iconPosition: string = "start" value: string = "on" values: unknown[] = [] options: unknown[] = [] checked: boolean = false indeterminate: boolean = false orientation: string = "vertical" card: boolean = false rightAligned: boolean = false list: boolean = false helperText: string = "" cornerHint: string = "" error: string = "" inline: boolean = false readonly: boolean = false disabled: boolean = false required: boolean = false class: string = "" } functions { client function emitField(nameEvent, sourceEvent) { sourceEvent.stopPropagation(); output[nameEvent]({ checked: sourceEvent.currentTarget.checked, value: sourceEvent.currentTarget.value, values: values, name: name, sourceEvent: sourceEvent }) } client function preventReadonly(sourceEvent) { if (readonly) sourceEvent.preventDefault() } } view {
{#if options.length || cornerHint} {label} {#if cornerHint} {cornerHint} {/if} {/if}
{#if options.length}
{#each options as option} {/each}
{:else}
{/if} {#if helperText} {helperText} {/if} {error}
} style { .wire-next__checkbox-content { display: grid; width: 100%; min-width: 0; align-items: start; grid-template-columns: minmax(0, 1fr); } .wire-next__checkbox-slot { display: block; min-width: 0; flex: 1 1 auto; color: var(--wire-color-muted); font-size: 0.75rem; line-height: 1.45; } .wire-next__checkbox-slot:empty { display: none; } .wire-next__checkbox-slot :is(a, button) { color: var(--wire-field-color); } } }