Page MenuHomeSealhub

boolean.ts
No OneTemporary

boolean.ts

import {
FieldHandler,
FieldHandlerResult,
} from "../shared-crud-form-fields.js";
export const boolean_handler: FieldHandler<
FieldHandlerResult,
Partial<FieldHandlerResult>
> = async (_, { name }, ___, { is_required_expr, fields_var }) => ({
field: `${name}: new Fields.Boolean(${is_required_expr})`,
controls: `new Controls.Checkbox(${fields_var}.${name}, { label: "${name}" })`,
initial_value_edit: {
fallback_value: `"false"`,
parsed_value: `String(item.get("${name}"))`,
},
main_value_sealious: `!!data.${name}`,
fallback_value_sealious: "false",
});

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 24, 14:04 (12 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
557275
Default Alt Text
boolean.ts (572 B)

Event Timeline