kirbyuse
Version:
Collection of Vue Composition utilities for Kirby CMS
196 lines (173 loc) • 3.22 kB
JavaScript
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
};
const after = {
/**
* Optional text that will be shown after the input
*/
after: String
};
const autocomplete = {
/**
* Sets the HTML5 autocomplete mode for the input
*/
autocomplete: String
};
const autofocus = {
/**
* Sets the focus on this field when the form loads. Only the first field with this label gets
*/
autofocus: Boolean
};
const before = {
/**
* Optional text that will be shown before the input
*/
before: String
};
const disabled = {
/**
* If `true`, the field is no longer editable and will not be saved
*/
disabled: Boolean
};
const font = {
/**
* Changes the font of the input to monospace or sans
*/
font: String
};
const help = {
/**
* Optional help text below the field
*/
help: String
};
const icon = {
icon: {
/**
* Changes the icon to something custom. Use one of the icon names from our icon library or a plugin.
*/
type: String
}
};
const id = {
/**
* A unique ID. The component `_uid` will be used as default.
*/
id: {
type: [Number, String],
default() {
return this._uid;
}
}
};
const label = {
/**
* A descriptive label for the field
*/
label: String
};
const layout = {
/**
* Display layout
* @values "list", "cards", "cardlets", "table"
*/
layout: {
type: String,
default: "list"
}
};
const maxlength = {
/**
* Maximum number of allowed characters
*/
maxlength: Number
};
const minlength = {
/**
* Minimum number of required characters
*/
minlength: Number
};
const name = {
/**
* A unique name for the input
*/
name: [Number, String]
};
const options = {
/**
* An array of option objects
* @value { value, text, info }
*/
options: {
default: () => [],
type: Array
}
};
const pattern = {
/**
* A regular expression, which will be used to validate the input
*/
pattern: String
};
const placeholder = {
/**
* Custom placeholder text, when the field is empty
*/
placeholder: [Number, String]
};
const required = {
/**
* If `true`, the field has to be filled in correctly to be submitted
*/
required: Boolean
};
const section = {
blueprint: String,
lock: [Boolean, Object],
help: String,
name: String,
parent: String,
timestamp: Number
};
const spellcheck = {
/**
* If false, spellchecking will be disabled
*/
spellcheck: {
type: Boolean,
default: true
}
};
const type = {
type: String
};
export { after, autocomplete, autofocus, before, block, disabled, font, help, icon, id, label, layout, maxlength, minlength, name, options, pattern, placeholder, required, section, spellcheck, type };