Files
mixtape/zero.Backoffice.UI/app/editor/_wip/editorFieldProxy.ts
T
2021-12-09 10:51:10 +01:00

18 lines
552 B
TypeScript

import { EditorField } from "zero/editor";
export const fieldTypes: Record<string, any> = {};
export const proxy = new Proxy(fieldTypes, {
get(target, handler)
{
console.info({ target, handler });
return target[handler];
}
}) as EditorField;
//fieldTypes.number = (maxLength?: number, placeholder?: string | Function) => console.log(`number() called with maxLength: ${maxLength}, placeholder: ${placeholder}`);
//proxy.number({ maxLength: 17, placeholder: 'Enter your number...' });
//var field = editor.field('name').text("hallo");