Repository navigation
v6.0.0
See Upgrading to 6.x for what apps need to change.
Behaviour changes
- server: Patches check the values of
requiredproperties that they send, rejecting empty strings with 'is required'. - server:
UserMixinrejects empty passwords with a validation error, instead of setting the hash of''. - server: Values outside
rangeare reported asrangeerrors, "must be between 1 and 5", instead ofminimumormaximumerrors. - server: Removed, see Server:
app.compileValidator(): useapp.compileJsonSchema().- Hook keys that name actions by their keys, e.g.
'before:member:get tech-doc-:format', no longer match: use their identifiers, e.g.'before:member:get-tech-doc-format'. - The types
HTTPMethod,SelectModelProperties,SelectModelKeys,ExtractModelPropertiesandSelectModelPropertyKeys: useHttpMethod,SerializedModelandkeyof SerializedModel.
- admin: Removed schema options, see Schemas:
componentsof schemas, filters andshowDialog(): usefields, andfieldinstead ofcomponentin views.minandmax: useminimumandmaximum.rules: use the limits of fields, their types andvalidate().events: {}: use theon…handlers, e.g.onChange().type: 'computed','data'and'hidden': usetype: 'value'.
- admin:
formatofcolorfields is renamed tocolorFormat, and ofdate,datetimeandtimefields toformats. The old keys are ignored.format,parse,computeandprocessonly throw as 3.x value hooks when they're callbacks. - admin: HTML, see HTML:
- Strings returned by
render()of columns, lists, objects and uploads, and the messages ofconfirm(),prompt()andalert(), show as escaped text: create HTML withhtmlof@ditojs/utils. { html }objects,type: 'html'affixes and thehtmloption ofnotify()are removed: use thehtmltemplate.
- Strings returned by
- admin:
DitoFieldis removed: useDitoSchemaField.login.additionalComponentsis removed: uselogin.additionalFields. - admin: The deprecated TypeScript type aliases are removed, see TypeScript types.
- admin: Hidden fields, see Behaviour changes:
- Values of hidden fields (
iffalse, or in hidden sections, tabs or panels) aren't saved or copied. - Of several fields of the same value, only shown ones run
serializeValue()and display the value in item labels and table cells. Hidden fields still set their defaults. - A nested section whose fields are all hidden counts as hidden, together with its own value.
- An
ifthat throws is logged and its field treated as shown, instead of stopping validation.
- Values of hidden fields (
- admin: Item labels and table cells only display the values of the item itself, not of its nested sections.
- admin: Validation and errors:
- Fields validate on blur with the checks of all fields of the same value, as submits do.
- Collapsed schemas render their content hidden while it holds errors, and reveal the errors.
- The Validation Errors notification lists all errors that no mounted component displays, e.g. of nested forms that aren't open.
- Options given as an array no longer reject values that aren't among them: the server's
enumdecides. - The labels of
requiredfields are marked with*.
- admin: Data and defaults:
objectfields withnullable: falsestart as an object with the defaults of their form instead ofnull.- Copies hold only values that have a field, and drop the ids in nested sections, so pasting creates new records.
- Emptied text fields save their empty value,
null, or''withnullable: false, instead of theirdefault. - Uploads with
multiplecalldownloadUrl()andthumbnailUrl()with the context of each file, asvalueandvalueIndex.
- admin: Routes, see Routes of forms and Tabs:
- The URLs of routed forms contain the names of their tabs, sections and panels, e.g.
/admin/books/1/pricing/editions/0. - The selected tab is a segment of the URL path instead of the hash, e.g.
/admin/books/1/pricing. - Forms open through the sources that render them, also in collapsed sections, tabs and panels. Paths that no source claims lead back to the form or page.
- The forms of items of items open once their parent item exists.
- Views keep their components mounted, hidden, while an item's form is open, and route the forms of inlined lists and trees.
- Hidden sources load their data once shown, lists take their query back into the URL when forms close, and reload only if a form saved an item.
- The URLs of routed forms contain the names of their tabs, sections and panels, e.g.
- ui: Calendar states are modifiers:
dito-calendar-item-today,-active,-currentand-graybecomedito-calendar__item--today,--active,--currentand--gray. - ui: Fields show errors and disabled state by
--has-errorsand--disabledmodifiers of their own block instead of.dito-container--…classes. Custom blocks that extend%fieldor%inputneed to set them, see UI. - schema:
keywords._enumandkeywords.multipleOflosevalidate(), and theemptyformat losesvalidatesEmptyValues.
New
- server: The
decimalskeyword limits the decimal places of numbers, as in the admin, e.g.decimals: 2. - admin: Labels, item labels, info, affixes,
render()results, dialog messages andnotify()paragraphs takehtmlvalues, see Text and HTML. - admin: Forms with properties and widgets, see the guide and Widgets:
- Forms of
useDitoForm()can describe their data withpropertiesin the format of the server's model properties, plus the admin's keywords such asif,computedorvalidate(). - Widgets lay them out in
DitoSchemaForm, one per field type, e.g.DitoTextFieldorDitoSelectField, with the display options of the type as props. DitoSection,DitoListField,DitoObjectFieldandDitoTreeListFieldwithDitoTreeLevellay out sections, lists, objects and trees.DitoCustomFieldedits a property with the content of its slot, e.g.v-model="field.value".- Nested forms in schema views can use
propertiesinstead offields, see Nested forms in schema views. - Written properties support times with
{ type: 'string', format: 'iso-time' }.
- Forms of
- utils: The
htmltagged template creates HTML that the admin renders, escaping the values it includes.isHtml()recognizes it andasHtml()converts values, see HTML.
Fixes
- admin, fields:
- Options fields with
nullable: falseno longer fail on their empty value. context.getErrors()lists the errors of a value once, also when several fields edit it.- Nested forms take their component paths and field ids from their route, also on reload.
- Options fields with
- admin, forms:
- Forms of
useDitoForm()that create an item no longer fail with "Maximum call stack size exceeded" when items are added to their lists. - The form of
useDitoForm()in a page fills the view and keeps its buttons at its bottom. DitoSchemaFormoutside of pages, e.g. in dialogs, pads its content like forms in views.- Buttons that are all hidden take no space.
- Forms of
Internal
- admin:
RouteTreeonly holds menus and views, and setup names components, tabs and panels by their keys.