UNPKG

kirbyuse

Version:

Collection of Vue Composition utilities for Kirby CMS

199 lines (198 loc) 4.1 kB
//#region src/props/_block.ts /** * @see https://github.com/getkirby/kirby/blob/main/panel/src/components/Forms/Blocks/Elements/BlockTitle.vue * @see https://github.com/getkirby/kirby/blob/main/panel/src/components/Forms/Blocks/Types/Default.vue */ const block = { /** * The block content is an object of values, * depending on the block type. */ content: { default: () => ({}), type: [Array, Object] }, /** * The fieldset definition with all fields, tabs, etc. */ fieldset: { default: () => ({}), type: Object }, /** * API endpoints * @value { field, model, section } */ endpoints: { default: () => ({}), type: [Array, Object] }, /** * A unique ID for the block */ id: String }; //#endregion //#region src/props/after.ts const after = { /** * Optional text that will be shown after the input */ after: String }; //#endregion //#region src/props/autocomplete.ts const autocomplete = { /** * Sets the HTML5 autocomplete mode for the input */ autocomplete: String }; //#endregion //#region src/props/autofocus.ts const autofocus = { /** * Sets the focus on this field when the form loads. Only the first field with this label gets */ autofocus: Boolean }; //#endregion //#region src/props/before.ts const before = { /** * Optional text that will be shown before the input */ before: String }; //#endregion //#region src/props/disabled.ts const disabled = { /** * If `true`, the field is no longer editable and will not be saved */ disabled: Boolean }; //#endregion //#region src/props/font.ts const font = { /** * Changes the font of the input to monospace or sans */ font: String }; //#endregion //#region src/props/help.ts const help = { /** * Optional help text below the field */ help: String }; //#endregion //#region src/props/icon.ts const icon = { icon: { /** * Changes the icon to something custom. Use one of the icon names from our icon library or a plugin. */ type: String } }; //#endregion //#region src/props/id.ts const id = { /** * A unique ID. The component `_uid` will be used as default. */ id: { type: [Number, String], default() { return this._uid; } } }; //#endregion //#region src/props/label.ts const label = { /** * A descriptive label for the field */ label: String }; //#endregion //#region src/props/layout.ts const layout = { /** * Display layout * @values "list", "cards", "cardlets", "table" */ layout: { type: String, default: "list" } }; //#endregion //#region src/props/maxlength.ts const maxlength = { /** * Maximum number of allowed characters */ maxlength: Number }; //#endregion //#region src/props/minlength.ts const minlength = { /** * Minimum number of required characters */ minlength: Number }; //#endregion //#region src/props/name.ts const name = { /** * A unique name for the input */ name: [Number, String] }; //#endregion //#region src/props/options.ts const options = { /** * An array of option objects * @value { value, text, info } */ options: { default: () => [], type: Array } }; //#endregion //#region src/props/pattern.ts const pattern = { /** * A regular expression, which will be used to validate the input */ pattern: String }; //#endregion //#region src/props/placeholder.ts const placeholder = { /** * Custom placeholder text, when the field is empty */ placeholder: [Number, String] }; //#endregion //#region src/props/required.ts const required = { /** * If `true`, the field has to be filled in correctly to be submitted */ required: Boolean }; //#endregion //#region src/props/section.ts const section = { blueprint: String, lock: [Boolean, Object], help: String, name: String, parent: String, timestamp: Number }; //#endregion //#region src/props/spellcheck.ts const spellcheck = { /** * If false, spellchecking will be disabled */ spellcheck: { type: Boolean, default: true } }; //#endregion //#region src/props/type.ts const type = { type: String }; //#endregion export { after, autocomplete, autofocus, before, block, disabled, font, help, icon, id, label, layout, maxlength, minlength, name, options, pattern, placeholder, required, section, spellcheck, type };