@synergy-client/types 0.1.26 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +16 -1
- package/dist/module-api.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type ViewType = 'list' | 'detail' | 'other' | 'worker' | 'static' | 'select' | 'component' | 'print';
|
|
2
|
-
export type ItemType = 'objectField' | 'field' | 'advancedComponent' | 'dynamic' | 'tabs' | 'tab' | 'radio' | 'file' | 'img' | 'text' | 'dynamicList' | 'dynamicTable' | 'group' | 'card' | 'progress' | 'calendar' | 'link' | 'button'
|
|
2
|
+
export type ItemType = 'objectField' | 'diagram' | 'field' | 'advancedComponent' | 'dynamic' | 'tabs' | 'tab' | 'radio' | 'file' | 'img' | 'text' | 'dynamicList' | 'dynamicTable' | 'group' | 'card' | 'progress' | 'calendar' | 'link' | 'button'
|
|
3
3
|
/** A button that opens a list of commands; on a command bar it is the bar's own `Lista rozwijana`. */
|
|
4
4
|
| 'dropdown'
|
|
5
5
|
/** A command the bar offers of itself, standing on the bar where the view put it. */
|
|
@@ -94,6 +94,12 @@ export interface ViewItem {
|
|
|
94
94
|
fieldTypePath?: string;
|
|
95
95
|
dataLinked?: boolean;
|
|
96
96
|
dataPath?: string;
|
|
97
|
+
/** A diagram: which way its arrows run — `TD` (top down, the default), `LR`, `BT`, `RL`. */
|
|
98
|
+
diagramDirection?: 'TD' | 'LR' | 'BT' | 'RL' | null;
|
|
99
|
+
/** A diagram the user can drag and zoom with the wheel; on unless switched off. */
|
|
100
|
+
zoomable?: boolean;
|
|
101
|
+
/** A field shown in the code editor (`fieldType: 'code'`): the language it is highlighted as. */
|
|
102
|
+
codeLanguage?: 'javascript' | 'json' | 'sql' | 'html' | 'css' | null;
|
|
97
103
|
defaultValue?: any;
|
|
98
104
|
/**
|
|
99
105
|
* The static text of a `text` or `link` element is written as HTML rather than as a plain string,
|
|
@@ -148,6 +154,15 @@ export interface ViewItem {
|
|
|
148
154
|
* loaded on demand: `(event, element, path, item)`, `path` being the index at every level.
|
|
149
155
|
*/
|
|
150
156
|
onItemExpand?: string | null;
|
|
157
|
+
/** A tree with a checkbox on every line, as a tree with marks in 1C. */
|
|
158
|
+
checkboxes?: boolean;
|
|
159
|
+
/** Path inside an element of a tree to its mark (`true` — checked); `checked` when unset. */
|
|
160
|
+
itemCheckField?: string | null;
|
|
161
|
+
/**
|
|
162
|
+
* Module function called when the checkbox of a line of a tree is clicked, the element already
|
|
163
|
+
* carrying the new mark: `(event, element, path, item)`.
|
|
164
|
+
*/
|
|
165
|
+
onItemCheck?: string | null;
|
|
151
166
|
/** Classes every element of the list is drawn with, before what an element sets for itself. */
|
|
152
167
|
itemClasses?: string | null;
|
|
153
168
|
/** Inline style every element of the list is drawn with, before what an element sets for itself. */
|
package/dist/module-api.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const moduleApiDts = "type ViewType = 'list' | 'detail' | 'other' | 'worker' | 'static' | 'select' | 'component' | 'print';\ntype ItemType = 'objectField' | 'field' | 'advancedComponent' | 'dynamic' | 'tabs' | 'tab' | 'radio' | 'file' | 'img' | 'text' | 'dynamicList' | 'dynamicTable' | 'group' | 'card' | 'progress' | 'calendar' | 'link' | 'button'\n/** A button that opens a list of commands; on a command bar it is the bar's own `Lista rozwijana`. */\n | 'dropdown'\n/** A command the bar offers of itself, standing on the bar where the view put it. */\n | 'toolbarCommand' | 'icon' | 'badge' | 'modal' | 'offcanvas' | 'spinner' | 'tablePart' | 'tableField' | 'tableTotal' | 'select' | 'viewList';\ntype FieldType = 'object' | 'text' | 'number' | 'enum' | 'boolean' | 'date' | 'datetime' | 'time' | 'textarea' | 'radio' | 'color'\n/** A boolean said with a mark instead of a switch: `itemIcon` where it is set, `falseIcon` where it is not. */\n | 'icon'\n/** A number dragged along a bar between `min` and `max`, by `step` at a time. */\n | 'range'\n/** Lines of text typed as something in particular — the input types of `BFormInput`. */\n | 'password' | 'email' | 'search' | 'url' | 'tel';\ntype ToolbarPosition = 'top' | 'bottom' | 'none';\ntype ToolbarButtonsPosition = 'left' | 'right' | 'middle' | 'none';\n/** A single entry of a field's choice list (configured in view settings). */\ninterface ChoiceOption {\n /** Value written to the object field. */\n value: any;\n /** Text shown to the user (falls back when no translation is set). */\n title: string;\n /** Per-language overrides: `{ title: { pl: '...', ua: '...' } }`. */\n lang?: any;\n}\n/** The resolved option shape passed to the rendered select/autocomplete. */\ninterface ChoiceListItem {\n value: any;\n text: string;\n}\n/**\n * Operators a selection parameter can use. `eq` is emitted as a plain equality\n * filter, everything else goes through the server's `quick` filter branch.\n */\ntype SelectParamOperator = 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'iLike' | 'inList' | 'notInList' | 'filled' | 'notFilled';\n/** Where a selection link reads its source value from. */\ntype SelectLinkScope = 'object' | 'row';\n/**\n * A constant restriction on what a reference/enum field offers for selection —\n * 1C's \"Parametry wyboru\". Applied to every list the field opens.\n */\ninterface SelectParam {\n id?: string;\n /** Field of the referenced object (its column name); `value` for an enum field. */\n field: string;\n operator: SelectParamOperator;\n value?: any;\n}\n/**\n * A dependency of a reference/enum field on another field of the same object —\n * 1C's \"Powiazania parametrow wyboru\". The source value narrows the selection\n * list; an empty source drops the condition, and a value already picked is\n * cleared whenever the source changes.\n */\ninterface SelectLink {\n id?: string;\n /** Field of the referenced object (its column name); `value` for an enum field. */\n field: string;\n /** Path the value is read from, within `scope`. */\n source: string;\n /** Header attribute (`object`) or the current table row (`row`). */\n sourceScope?: SelectLinkScope;\n}\n/**\n * Argument of a `beforeChoice` handler — the 1C-like hook that lets a module\n * replace a field's choice list at runtime.\n */\ninterface BeforeChoiceParams {\n /** Fill this to provide the options; only used when `standardProcessing` is false. */\n choiceList: ChoiceListItem[];\n /** Set to false to use `choiceList` instead of the configured options. */\n standardProcessing: boolean;\n /** The item being rendered. */\n item?: ViewItem;\n}\n/** A form element (field, group, table, button, ...). */\ninterface ViewItem {\n id: string;\n type: ItemType;\n name: string;\n label: string;\n labelPosition: 'left' | 'top' | 'none';\n groupType?: 'toolbar' | 'collapsible';\n /** How a group lays out what it holds: in lines (the default) or one under another. */\n direction?: 'horizontal' | 'vertical' | null;\n /** Where a group puts its items along the way it lays them out — Bootstrap's `justify-content-*`. */\n justifyContent?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly' | null;\n /** Where a group puts its items across the way it lays them out — Bootstrap's `align-items-*`. */\n alignItems?: 'start' | 'end' | 'center' | 'baseline' | 'stretch' | null;\n tagName?: string;\n tagRef?: any;\n multiType: boolean;\n multiTypeVariant: 'common' | 'objects';\n fieldPath: string;\n fieldTypePath?: string;\n dataLinked?: boolean;\n dataPath?: string;\n defaultValue?: any;\n /**\n * The static text of a `text` or `link` element is written as HTML rather than as a plain string,\n * so that parts of one text can be styled apart from the rest. The HTML stays in `defaultValue`,\n * and is cleaned before it is drawn. Only a text that is not bound to data can carry it.\n */\n richText?: boolean;\n fieldType: FieldType;\n valueTypes?: any;\n selectView?: any;\n viewAttribute: boolean;\n ref: string | string[] | null;\n required: boolean;\n visible: boolean;\n translate: boolean;\n newRow: boolean;\n noGreed?: boolean;\n fieldCols: number;\n labelCols: number;\n contentCols: number | null;\n itemOffset: number;\n dataType: 'string' | 'integer' | 'decimal' | 'date' | 'enum' | 'array';\n /**\n * How a view attribute holding an array is drawn: a list group (the default), a carousel with a\n * slide for every element, an accordion with an item for every element, or a tree.\n */\n listType?: 'listGroup' | 'carousel' | 'accordion' | 'tree';\n /** Path inside an element of a tree to the array of elements under it; `children` when unset. */\n itemChildrenField?: string | null;\n /** Path inside an element of the array to the text it is shown by; `presentation` when unset. */\n itemTextField?: string | null;\n /**\n * Path inside an element of the array to the settings it carries for itself — a variant, a link,\n * an image — cut down to the ones its `listType` knows; `itemParams` when unset.\n */\n itemParamsField?: string | null;\n /** A list group laying its elements out in a row. */\n horizontal?: boolean;\n /** A list group numbering its elements. */\n numbered?: boolean;\n /** A list group or an accordion drawn without its outer border. */\n flush?: boolean;\n /** Module function called on a click of an element of a list group: `(event, element, index, item)`. */\n onItemClick?: string | null;\n /**\n * Module function called when an element of a list group is chosen with a double click:\n * `(event, element, index, item)`.\n */\n onItemSelect?: string | null;\n /**\n * Module function called when a line of a tree is opened, to fill its children when they are\n * loaded on demand: `(event, element, path, item)`, `path` being the index at every level.\n */\n onItemExpand?: string | null;\n /** Classes every element of the list is drawn with, before what an element sets for itself. */\n itemClasses?: string | null;\n /** Inline style every element of the list is drawn with, before what an element sets for itself. */\n itemStyles?: string | null;\n /** A carousel with arrows to the previous and the next slide. */\n controls?: boolean;\n /** A carousel with a mark for every slide along its bottom. */\n indicators?: boolean;\n /** A carousel turning its slides by itself. */\n ride?: boolean;\n /** Milliseconds a carousel stands on one slide. */\n interval?: number | null;\n /** A carousel fading one slide into the next instead of sliding it. */\n fade?: boolean;\n /** A carousel stopping at its last slide instead of starting over. */\n noWrap?: boolean;\n /** An accordion that may hold several of its items open at once. */\n free?: boolean;\n /**\n * A `dynamicTable` standing for a view attribute of type `valueList`: its rows are\n * `{ value, presentation, check, picture }` and it offers the commands of a value list.\n */\n valueList?: boolean;\n /** What the values of a value list are — copied from the attribute, so the table can pick them. */\n valueType?: ValueListValueType | null;\n /** How a value list is drawn: as a table, or — not yet — as a field. */\n listView?: 'table' | 'field';\n /**\n * Where the search field of a `dynamicTable` stands: beside its command bar (the default), on a\n * line of its own above or below the rows, or nowhere.\n */\n searchPosition?: 'toolbar' | 'top' | 'bottom' | 'none';\n /**\n * Module functions a list calls — the list of a list view and a `dynamicList` alike: before its\n * rows are requested (handed the request params), after they came back, and on rows being picked.\n */\n beforeUpdate?: string | null;\n afterUpdate?: string | null;\n afterSelect?: string | null;\n dateType: 'date' | 'datetime' | 'time';\n detailView: any;\n disabled: boolean;\n /**\n * Take the height left over in the form. The layout becomes a column of lines, the line of this\n * item is handed the leftover height, and whatever stands below keeps its place at the bottom.\n */\n fillHeight?: boolean;\n /**\n * Draw the field as a caption instead of an input: an input or a textarea gets Bootstrap's\n * `plaintext` (no frame, read only), a select gets `plain`.\n */\n plaintext?: boolean;\n /** Render slot key (for slot-based group items). */\n slot?: string;\n options?: any;\n /** Render the field as a choice list instead of a plain input. */\n choiceList?: boolean;\n /** Statically configured entries of the choice list. */\n choiceOptions?: ChoiceOption[];\n /** Render the choice list as a searchable autocomplete instead of a select. */\n autocomplete?: boolean;\n /**\n * How a field of type `radio` — 1C's \"Przełącznik\" — draws its options: `default` as round buttons,\n * `buttons` as a row of buttons. Its options are `choiceOptions`, or, where there are none, every\n * value of its enum or every predefined record of its catalog.\n */\n radioPresentation?: 'default' | 'buttons' | null;\n /** A plain `radio` whose options stand one under another instead of in a row. */\n radioStacked?: boolean;\n /** Module function name that can replace the choice list at runtime. */\n beforeChoice?: string | null;\n format: string | null;\n filter?: any;\n filters?: any;\n /** Constant restrictions of the selection list (1C \"Parametry wyboru\"). */\n selectParams?: SelectParam[];\n /** Dependencies of the selection list on other fields (1C \"Powiazania parametrow wyboru\"). */\n selectLinks?: SelectLink[];\n /** Table part the item belongs to, for a field of a table row. */\n tableName?: string | null;\n lang: any;\n switch?: boolean;\n maxLength: string | null;\n numberPrecision: string | null;\n numberScale: string | null;\n onChange: string | null;\n placeholder: string | null;\n component?: any;\n icon: string;\n tooltip?: any;\n classes: string | null;\n styles: string | null;\n /**\n * How a `text` or `link` element is drawn, chosen in the Configurator instead of typed as CSS\n * into `classes`/`styles`. Each is optional and each turns into a Bootstrap utility class that\n * stands beside whatever `classes` the admin wrote by hand; left unset, the element is drawn the\n * way it always was.\n */\n bold?: boolean;\n italic?: boolean;\n underline?: boolean;\n /** Bootstrap font-size step, `fs-1` (largest) to `fs-6`. */\n fontSize?: '1' | '2' | '3' | '4' | '5' | '6' | null;\n /** Bootstrap contextual colour of the text itself, e.g. `primary` -> `text-primary`. */\n textColor?: string | null;\n textAlign?: 'start' | 'center' | 'end' | null;\n /**\n * The tag a `text` element is drawn with. A heading is written as a real `h1`..`h6` so that it\n * counts as a heading for a screen reader, not only as larger type.\n */\n textTag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'small' | null;\n /**\n * The dialog a button or a link opens, named by the `name` of a `modal` or `offcanvas` element in\n * the same view. It saves a view module having to be written for the commonest thing a button in\n * a form does; the dialog can still be driven from a module through its own `dataPath`.\n */\n openDialog?: string | null;\n /** Width of a `modal`: Bootstrap's own steps. */\n dialogSize?: 'sm' | 'md' | 'lg' | 'xl' | null;\n /** A `modal` standing in the middle of the screen rather than near its top. */\n centered?: boolean;\n /** A `modal` whose content scrolls inside it instead of growing past the screen. */\n scrollable?: boolean;\n /** A `modal` drawn without the row of buttons along its bottom. */\n noFooter?: boolean;\n /** A `modal` drawn without its title bar. */\n noHeader?: boolean;\n /** A `modal` whose title bar carries no cross to close it by. */\n noHeaderClose?: boolean;\n /** A `modal` that a click beside it does not close. */\n noCloseOnBackdrop?: boolean;\n /** A `modal` that the Escape key does not close. */\n noCloseOnEsc?: boolean;\n /** A `modal` offering one button to close it instead of accept-and-cancel. */\n okOnly?: boolean;\n /** Which edge an `offcanvas` slides in from; also where the strip of a `tabs` stands. */\n placement?: 'start' | 'end' | 'top' | 'bottom' | 'left' | null;\n /** An `offcanvas` that leaves the form behind it usable instead of shading it over. */\n noBackdrop?: boolean;\n /** How a `spinner` turns. */\n spinnerType?: 'border' | 'grow' | null;\n /** A `spinner` or a `badge` drawn at the smaller of its two sizes. */\n small?: boolean;\n /**\n * The look of the parts of an element that has a title and an input. `classes`/`styles` stay on\n * the box holding both; these reach inside it. The title is the label of a field or an attribute\n * and the title of a group; the input is the control itself — a text box, a select, a date picker,\n * a switch, a table. Left unset, the part is drawn as it always was.\n */\n labelClasses?: string | null;\n labelStyles?: string | null;\n inputClasses: string | null;\n inputStyles: string | null;\n browseText?: any;\n accept?: any;\n noDrop?: boolean;\n multiple?: boolean;\n appObjectId?: any;\n showTotals?: boolean;\n disableSorting?: boolean;\n disableRowset?: boolean;\n hideToolbar?: boolean;\n hideActions?: boolean;\n /** Draw the rows of a table without the row of captions above them. */\n hideHeader?: boolean;\n usePagination?: boolean;\n rowsLimit?: number;\n maxHeight?: number;\n selectBtn?: boolean;\n /**\n * Reference field offering its whole list on click, the way an enum select does:\n * the records are loaded up front and filtered in place, and the select button is gone.\n * Meant for small, enum-like catalogs.\n */\n quickSelect?: boolean;\n openBtn?: boolean;\n addBtn?: boolean;\n /**\n * Draw the field as a link rather than as a control. A reference opens the form of the record it\n * holds; a caption (`plaintext`) opens whatever `onClick` names, or the address it carries when\n * it is typed as a `url`, an `email` or a `tel`.\n */\n hyperLink?: boolean;\n /** Module function called on a click of a field drawn as a link, instead of what it would do. */\n onClick?: string | null;\n beforeSelect?: any;\n /** The element is handed to the view module as `refs.<name>.value` — the component it is drawn with. */\n useRef?: boolean;\n maxRows?: number;\n rowsCount?: number;\n /** A textarea that keeps the size the view gave it, with no handle to drag it bigger. */\n noResize?: boolean;\n variant?: string;\n pill?: boolean;\n squared?: boolean;\n block?: boolean;\n toggleGroup?: any;\n itemIcon?: any;\n /** The mark a boolean drawn as an icon wears where its value is not set; most often none. */\n falseIcon?: string | null;\n /** The bounds and the step of a field drawn as a slider (`range`). */\n min?: number | string | null;\n step?: number | string | null;\n max?: any;\n textVariant?: any;\n bgVariant?: any;\n attrs: any;\n /** Server function name invoked on select. */\n onSelect?: string | null;\n /** Detail-view route path for reference fields. */\n detailPath?: string | null;\n /** Referenced component id (for advancedComponent items). */\n componentId?: string;\n selectType?: string;\n /** Render key. */\n key?: string;\n /** Dynamic-parameter payload (advanced components). */\n parameter?: any;\n parameterId?: string;\n /** Totals row config (list/table parts). */\n isTotal?: boolean;\n totalFunc?: string | null;\n /**\n * The aggregate a total stands for. A column of a table takes the ones its footer offers\n * (`sum`, `min`, `max`, `average`, `static`, `calculated`); a `tableTotal` item takes `sum`\n * for a numeric field of the table and `count` for its number of rows.\n */\n totalExp?: string | null;\n /**\n * A `tableTotal` item is a form field showing an aggregate over the rows of one table — the\n * table part of the object, or the dynamic table `viewAttribute` says it is. The table is\n * named here, the field summed in `totalField` (null when the rows themselves are counted).\n * Nothing of it is stored with the record: the client recomputes it from the rows it holds.\n */\n totalTable?: string | null;\n totalField?: string | null;\n valueString?: any;\n valueNumber?: any;\n valueBoolean?: any;\n valueDate?: any;\n valueObject?: any;\n valueRef?: any;\n /** Nested items (for groups/tables). */\n items?: ViewItem[];\n}\n/**\n * The type of the values of a value list, 1C's `Typ wartości`: a data type, and for a reference or an\n * enum what it refers to.\n */\ninterface ValueListValueType {\n dataType?: string | null;\n ref?: string | null;\n typeOptions?: {\n length?: number | null;\n precision?: number | null;\n scale?: number | null;\n } | null;\n dateType?: string | null;\n}\n/** A view attribute (form-level field, not bound to the object). */\ninterface ViewAttribute {\n id: string;\n title: string;\n name: string;\n type: 'field' | 'tableField' | 'dynamicTable' | 'valueList' | 'dynamicList' | null;\n /** What the values of a `valueList` are. */\n valueType?: ValueListValueType | null;\n /**\n * A `dynamicList` lists the records of the app object named in `ref` (whose id is `appObjectId`),\n * opening a row in the view `detailView` names. With `customQuery` it lists the rows of `listQuery`\n * instead, which Core runs when the Client names the view and the list (`viewId` + `listName`).\n * `filters` always apply; at run time `attrs.<name>` holds the state of the list.\n */\n appObjectId?: string | null;\n detailView?: string | null;\n customQuery?: boolean;\n listQuery?: {\n sql: string;\n model: any;\n fields: any[];\n mainTable: {\n objectName: string;\n alias: string;\n } | null;\n params: any[];\n } | null;\n filters?: any[];\n dataType: string | null;\n standard?: boolean;\n multiType: boolean;\n multiTypeVariant: 'common' | 'objects';\n typeOptions?: any;\n dateType: string;\n defaultValue?: any;\n format: string | null;\n ref: string | string[] | null;\n lang?: any;\n tableName?: string | null;\n /** Constant restrictions of the selection list (1C \"Parametry wyboru\"). */\n selectParams?: SelectParam[];\n /** Dependencies of the selection list on other fields (1C \"Powiazania parametrow wyboru\"). */\n selectLinks?: SelectLink[];\n childs: ViewAttribute[];\n}\ninterface ViewAttributeTreeItem extends Omit<ViewAttribute, 'id' | 'childs'> {\n attrId: string;\n path: string;\n fullName: string;\n fullPath: string;\n fullTitle: string;\n expanded?: boolean;\n viewAttribute?: boolean;\n dependent: boolean;\n childs: ViewAttributeTreeItem[];\n}\n/** A field of an app object (catalog/document/register). */\ninterface ObjectField {\n id: string;\n name: string;\n title: string;\n ref: string | string[] | null;\n lang: any;\n type: string | null;\n filter: string | null;\n /**\n * Every form showing this field offers its whole list on click, the way an enum select\n * does. A view element may still say otherwise for itself.\n */\n quickSelect?: boolean;\n /** Constant restrictions of the selection list (1C \"Parametry wyboru\"). */\n selectParams?: SelectParam[];\n /** Dependencies of the selection list on other fields (1C \"Powiazania parametrow wyboru\"). */\n selectLinks?: SelectLink[];\n format: string | null;\n leadingAlias: any;\n primaryKey: boolean;\n leading: boolean;\n decryptable: boolean;\n multiType: boolean;\n multiTypeVariant: 'common' | 'objects';\n defaultValue: any;\n standard?: any;\n dbName: string;\n dateType: string;\n notNull: boolean;\n autoIncrement: boolean;\n unique: boolean;\n index: boolean;\n password: boolean;\n isTablePart: boolean;\n model?: string;\n role: string | null;\n fullSearch: boolean;\n fullName?: string;\n typeOptions: any;\n virtual: boolean;\n comment: string | null;\n confidential?: boolean;\n confidentialRoleId?: string | null;\n fields?: ObjectField[];\n get: any;\n set: any;\n}\n/** A toolbar button/group. */\ninterface ToolbarItem {\n id: string;\n title: string;\n icon?: string | null;\n presentation: string;\n variant: string;\n size: string;\n disabled: boolean;\n visible: boolean;\n systemDisabled: boolean;\n systemVisible: boolean;\n hidden: boolean;\n tooltip?: string;\n type?: string;\n click?: Function;\n /** Server function name invoked on click (resolved via serverFunc). */\n onClick?: string;\n /** i18n overrides (lang.title[langCode], ...). */\n lang?: any;\n items?: ToolbarItem[];\n}\ninterface Toolbar {\n position: ToolbarPosition;\n buttonsPosition: ToolbarButtonsPosition;\n classes: string | null;\n styles: string | null;\n items: ToolbarItem[];\n staticItems: ToolbarItem[];\n commonCommands: ToolbarItem[];\n}\ninterface SortBy {\n key: string;\n order?: 'asc' | 'desc' | string;\n sortByOrig?: any;\n}\n/** List/table view data (list and select forms). */\ninterface ListViewTable {\n items: any[];\n fields: any[];\n total: number;\n page: number;\n limit: number;\n filters: Record<string, any>;\n sort: SortBy[];\n folders: {\n items: any[];\n expanded: any[];\n };\n}\n/** Current route (vue-router). */\ninterface Route {\n path: string;\n fullPath: string;\n name?: string | symbol | null;\n params: Record<string, any>;\n query: Record<string, any>;\n hash: string;\n meta: Record<string, any>;\n}\n/** Router instance (vue-router). */\ninterface Router {\n push(to: any): Promise<any>;\n replace(to: any): Promise<any>;\n back(): void;\n forward(): void;\n go(delta: number): void;\n}\n/** onCreate / onMount / afterConfirm / afterMarkedToDelete / afterDelete / onBeforeDestroy. */\ntype ModuleHook = () => void | Promise<void>;\n/** beforeWrite / beforeConfirm / beforeMarkedToDelete / beforeDelete — set params.cancel to abort. */\ntype CancelableHook = (params: {\n cancel: boolean;\n}) => void | Promise<void>;\n/** afterWrite — receives { close } (optional; also called with no args). */\ntype AfterWriteHook = (options?: {\n close?: boolean;\n}) => void | Promise<void>;\n/** Entity data store (useStore('object'), or a view's `store`). */\ninterface Store {\n findByPk(payload?: any): Promise<any>;\n findAll(payload?: any): Promise<any>;\n count(payload?: any): Promise<number>;\n create(payload?: any): Promise<any>;\n createItem(payload?: any): Promise<any>;\n update(payload?: any): Promise<any>;\n updateItem(payload?: any): Promise<any>;\n delete(payload?: any): Promise<any>;\n deleteItem(payload?: any): Promise<any>;\n addNewItem(payload?: any): Promise<any>;\n changeDeletionMark(payload?: any): Promise<any>;\n getView(): {\n object: any;\n attrs: any;\n objectMeta: any;\n };\n}\n/** Control object passed to cancelable client `before*` hooks. Set `cancel` to abort the request. */\ninterface CancelParams {\n cancel: boolean;\n message?: string;\n}\n/**\n * `this` inside an object client-module EVENT hook (`events.*`).\n * The module receives no injected globals — the environment is reached through\n * these `$`-prefixed helpers on `this`.\n */\ninterface ObjectModuleContext {\n /** HTTP client (axios instance), e.g. `this.$axios.get('/products')`. */\n $axios: any;\n /** Get another object's data store by name. */\n $useStore(name: string): Store;\n /** i18n translation. */\n $t(key: string, ...args: any[]): string;\n /** Moment.js date helper. */\n $moment(input?: any): any;\n /** Lodash utilities. */\n $lodash: any;\n /** This object's views (ObjectView / ListView state). */\n views: any[];\n /** This object's metadata (blank-record template, fields). */\n objectMeta: any;\n /** Module actions merged into the store. */\n actions: Record<string, (...args: any[]) => any>;\n /** Module helper functions (`this.functions.x`). */\n functions: Record<string, (...args: any[]) => any>;\n /** Module getters. */\n getters: Record<string, any>;\n}\n/**\n * `this` inside an object client-module ACTION (`actions.*`) — the entity store\n * (all store methods + `views` / `objectMeta`). Overriding an action fully\n * replaces the built-in one (its `before*`/`after*` hooks are bypassed).\n */\ninterface ObjectModuleActionThis extends Store {\n views: any[];\n objectMeta: any;\n}";
|
|
1
|
+
export const moduleApiDts = "type ViewType = 'list' | 'detail' | 'other' | 'worker' | 'static' | 'select' | 'component' | 'print';\ntype ItemType = 'objectField' | 'diagram' | 'field' | 'advancedComponent' | 'dynamic' | 'tabs' | 'tab' | 'radio' | 'file' | 'img' | 'text' | 'dynamicList' | 'dynamicTable' | 'group' | 'card' | 'progress' | 'calendar' | 'link' | 'button'\n/** A button that opens a list of commands; on a command bar it is the bar's own `Lista rozwijana`. */\n | 'dropdown'\n/** A command the bar offers of itself, standing on the bar where the view put it. */\n | 'toolbarCommand' | 'icon' | 'badge' | 'modal' | 'offcanvas' | 'spinner' | 'tablePart' | 'tableField' | 'tableTotal' | 'select' | 'viewList';\ntype FieldType = 'object' | 'text' | 'number' | 'enum' | 'boolean' | 'date' | 'datetime' | 'time' | 'textarea' | 'radio' | 'color'\n/** A boolean said with a mark instead of a switch: `itemIcon` where it is set, `falseIcon` where it is not. */\n | 'icon'\n/** A number dragged along a bar between `min` and `max`, by `step` at a time. */\n | 'range'\n/** Lines of text typed as something in particular — the input types of `BFormInput`. */\n | 'password' | 'email' | 'search' | 'url' | 'tel';\ntype ToolbarPosition = 'top' | 'bottom' | 'none';\ntype ToolbarButtonsPosition = 'left' | 'right' | 'middle' | 'none';\n/** A single entry of a field's choice list (configured in view settings). */\ninterface ChoiceOption {\n /** Value written to the object field. */\n value: any;\n /** Text shown to the user (falls back when no translation is set). */\n title: string;\n /** Per-language overrides: `{ title: { pl: '...', ua: '...' } }`. */\n lang?: any;\n}\n/** The resolved option shape passed to the rendered select/autocomplete. */\ninterface ChoiceListItem {\n value: any;\n text: string;\n}\n/**\n * Operators a selection parameter can use. `eq` is emitted as a plain equality\n * filter, everything else goes through the server's `quick` filter branch.\n */\ntype SelectParamOperator = 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'iLike' | 'inList' | 'notInList' | 'filled' | 'notFilled';\n/** Where a selection link reads its source value from. */\ntype SelectLinkScope = 'object' | 'row';\n/**\n * A constant restriction on what a reference/enum field offers for selection —\n * 1C's \"Parametry wyboru\". Applied to every list the field opens.\n */\ninterface SelectParam {\n id?: string;\n /** Field of the referenced object (its column name); `value` for an enum field. */\n field: string;\n operator: SelectParamOperator;\n value?: any;\n}\n/**\n * A dependency of a reference/enum field on another field of the same object —\n * 1C's \"Powiazania parametrow wyboru\". The source value narrows the selection\n * list; an empty source drops the condition, and a value already picked is\n * cleared whenever the source changes.\n */\ninterface SelectLink {\n id?: string;\n /** Field of the referenced object (its column name); `value` for an enum field. */\n field: string;\n /** Path the value is read from, within `scope`. */\n source: string;\n /** Header attribute (`object`) or the current table row (`row`). */\n sourceScope?: SelectLinkScope;\n}\n/**\n * Argument of a `beforeChoice` handler — the 1C-like hook that lets a module\n * replace a field's choice list at runtime.\n */\ninterface BeforeChoiceParams {\n /** Fill this to provide the options; only used when `standardProcessing` is false. */\n choiceList: ChoiceListItem[];\n /** Set to false to use `choiceList` instead of the configured options. */\n standardProcessing: boolean;\n /** The item being rendered. */\n item?: ViewItem;\n}\n/** A form element (field, group, table, button, ...). */\ninterface ViewItem {\n id: string;\n type: ItemType;\n name: string;\n label: string;\n labelPosition: 'left' | 'top' | 'none';\n groupType?: 'toolbar' | 'collapsible';\n /** How a group lays out what it holds: in lines (the default) or one under another. */\n direction?: 'horizontal' | 'vertical' | null;\n /** Where a group puts its items along the way it lays them out — Bootstrap's `justify-content-*`. */\n justifyContent?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly' | null;\n /** Where a group puts its items across the way it lays them out — Bootstrap's `align-items-*`. */\n alignItems?: 'start' | 'end' | 'center' | 'baseline' | 'stretch' | null;\n tagName?: string;\n tagRef?: any;\n multiType: boolean;\n multiTypeVariant: 'common' | 'objects';\n fieldPath: string;\n fieldTypePath?: string;\n dataLinked?: boolean;\n dataPath?: string;\n /** A diagram: which way its arrows run — `TD` (top down, the default), `LR`, `BT`, `RL`. */\n diagramDirection?: 'TD' | 'LR' | 'BT' | 'RL' | null;\n /** A diagram the user can drag and zoom with the wheel; on unless switched off. */\n zoomable?: boolean;\n /** A field shown in the code editor (`fieldType: 'code'`): the language it is highlighted as. */\n codeLanguage?: 'javascript' | 'json' | 'sql' | 'html' | 'css' | null;\n defaultValue?: any;\n /**\n * The static text of a `text` or `link` element is written as HTML rather than as a plain string,\n * so that parts of one text can be styled apart from the rest. The HTML stays in `defaultValue`,\n * and is cleaned before it is drawn. Only a text that is not bound to data can carry it.\n */\n richText?: boolean;\n fieldType: FieldType;\n valueTypes?: any;\n selectView?: any;\n viewAttribute: boolean;\n ref: string | string[] | null;\n required: boolean;\n visible: boolean;\n translate: boolean;\n newRow: boolean;\n noGreed?: boolean;\n fieldCols: number;\n labelCols: number;\n contentCols: number | null;\n itemOffset: number;\n dataType: 'string' | 'integer' | 'decimal' | 'date' | 'enum' | 'array';\n /**\n * How a view attribute holding an array is drawn: a list group (the default), a carousel with a\n * slide for every element, an accordion with an item for every element, or a tree.\n */\n listType?: 'listGroup' | 'carousel' | 'accordion' | 'tree';\n /** Path inside an element of a tree to the array of elements under it; `children` when unset. */\n itemChildrenField?: string | null;\n /** Path inside an element of the array to the text it is shown by; `presentation` when unset. */\n itemTextField?: string | null;\n /**\n * Path inside an element of the array to the settings it carries for itself — a variant, a link,\n * an image — cut down to the ones its `listType` knows; `itemParams` when unset.\n */\n itemParamsField?: string | null;\n /** A list group laying its elements out in a row. */\n horizontal?: boolean;\n /** A list group numbering its elements. */\n numbered?: boolean;\n /** A list group or an accordion drawn without its outer border. */\n flush?: boolean;\n /** Module function called on a click of an element of a list group: `(event, element, index, item)`. */\n onItemClick?: string | null;\n /**\n * Module function called when an element of a list group is chosen with a double click:\n * `(event, element, index, item)`.\n */\n onItemSelect?: string | null;\n /**\n * Module function called when a line of a tree is opened, to fill its children when they are\n * loaded on demand: `(event, element, path, item)`, `path` being the index at every level.\n */\n onItemExpand?: string | null;\n /** A tree with a checkbox on every line, as a tree with marks in 1C. */\n checkboxes?: boolean;\n /** Path inside an element of a tree to its mark (`true` — checked); `checked` when unset. */\n itemCheckField?: string | null;\n /**\n * Module function called when the checkbox of a line of a tree is clicked, the element already\n * carrying the new mark: `(event, element, path, item)`.\n */\n onItemCheck?: string | null;\n /** Classes every element of the list is drawn with, before what an element sets for itself. */\n itemClasses?: string | null;\n /** Inline style every element of the list is drawn with, before what an element sets for itself. */\n itemStyles?: string | null;\n /** A carousel with arrows to the previous and the next slide. */\n controls?: boolean;\n /** A carousel with a mark for every slide along its bottom. */\n indicators?: boolean;\n /** A carousel turning its slides by itself. */\n ride?: boolean;\n /** Milliseconds a carousel stands on one slide. */\n interval?: number | null;\n /** A carousel fading one slide into the next instead of sliding it. */\n fade?: boolean;\n /** A carousel stopping at its last slide instead of starting over. */\n noWrap?: boolean;\n /** An accordion that may hold several of its items open at once. */\n free?: boolean;\n /**\n * A `dynamicTable` standing for a view attribute of type `valueList`: its rows are\n * `{ value, presentation, check, picture }` and it offers the commands of a value list.\n */\n valueList?: boolean;\n /** What the values of a value list are — copied from the attribute, so the table can pick them. */\n valueType?: ValueListValueType | null;\n /** How a value list is drawn: as a table, or — not yet — as a field. */\n listView?: 'table' | 'field';\n /**\n * Where the search field of a `dynamicTable` stands: beside its command bar (the default), on a\n * line of its own above or below the rows, or nowhere.\n */\n searchPosition?: 'toolbar' | 'top' | 'bottom' | 'none';\n /**\n * Module functions a list calls — the list of a list view and a `dynamicList` alike: before its\n * rows are requested (handed the request params), after they came back, and on rows being picked.\n */\n beforeUpdate?: string | null;\n afterUpdate?: string | null;\n afterSelect?: string | null;\n dateType: 'date' | 'datetime' | 'time';\n detailView: any;\n disabled: boolean;\n /**\n * Take the height left over in the form. The layout becomes a column of lines, the line of this\n * item is handed the leftover height, and whatever stands below keeps its place at the bottom.\n */\n fillHeight?: boolean;\n /**\n * Draw the field as a caption instead of an input: an input or a textarea gets Bootstrap's\n * `plaintext` (no frame, read only), a select gets `plain`.\n */\n plaintext?: boolean;\n /** Render slot key (for slot-based group items). */\n slot?: string;\n options?: any;\n /** Render the field as a choice list instead of a plain input. */\n choiceList?: boolean;\n /** Statically configured entries of the choice list. */\n choiceOptions?: ChoiceOption[];\n /** Render the choice list as a searchable autocomplete instead of a select. */\n autocomplete?: boolean;\n /**\n * How a field of type `radio` — 1C's \"Przełącznik\" — draws its options: `default` as round buttons,\n * `buttons` as a row of buttons. Its options are `choiceOptions`, or, where there are none, every\n * value of its enum or every predefined record of its catalog.\n */\n radioPresentation?: 'default' | 'buttons' | null;\n /** A plain `radio` whose options stand one under another instead of in a row. */\n radioStacked?: boolean;\n /** Module function name that can replace the choice list at runtime. */\n beforeChoice?: string | null;\n format: string | null;\n filter?: any;\n filters?: any;\n /** Constant restrictions of the selection list (1C \"Parametry wyboru\"). */\n selectParams?: SelectParam[];\n /** Dependencies of the selection list on other fields (1C \"Powiazania parametrow wyboru\"). */\n selectLinks?: SelectLink[];\n /** Table part the item belongs to, for a field of a table row. */\n tableName?: string | null;\n lang: any;\n switch?: boolean;\n maxLength: string | null;\n numberPrecision: string | null;\n numberScale: string | null;\n onChange: string | null;\n placeholder: string | null;\n component?: any;\n icon: string;\n tooltip?: any;\n classes: string | null;\n styles: string | null;\n /**\n * How a `text` or `link` element is drawn, chosen in the Configurator instead of typed as CSS\n * into `classes`/`styles`. Each is optional and each turns into a Bootstrap utility class that\n * stands beside whatever `classes` the admin wrote by hand; left unset, the element is drawn the\n * way it always was.\n */\n bold?: boolean;\n italic?: boolean;\n underline?: boolean;\n /** Bootstrap font-size step, `fs-1` (largest) to `fs-6`. */\n fontSize?: '1' | '2' | '3' | '4' | '5' | '6' | null;\n /** Bootstrap contextual colour of the text itself, e.g. `primary` -> `text-primary`. */\n textColor?: string | null;\n textAlign?: 'start' | 'center' | 'end' | null;\n /**\n * The tag a `text` element is drawn with. A heading is written as a real `h1`..`h6` so that it\n * counts as a heading for a screen reader, not only as larger type.\n */\n textTag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'small' | null;\n /**\n * The dialog a button or a link opens, named by the `name` of a `modal` or `offcanvas` element in\n * the same view. It saves a view module having to be written for the commonest thing a button in\n * a form does; the dialog can still be driven from a module through its own `dataPath`.\n */\n openDialog?: string | null;\n /** Width of a `modal`: Bootstrap's own steps. */\n dialogSize?: 'sm' | 'md' | 'lg' | 'xl' | null;\n /** A `modal` standing in the middle of the screen rather than near its top. */\n centered?: boolean;\n /** A `modal` whose content scrolls inside it instead of growing past the screen. */\n scrollable?: boolean;\n /** A `modal` drawn without the row of buttons along its bottom. */\n noFooter?: boolean;\n /** A `modal` drawn without its title bar. */\n noHeader?: boolean;\n /** A `modal` whose title bar carries no cross to close it by. */\n noHeaderClose?: boolean;\n /** A `modal` that a click beside it does not close. */\n noCloseOnBackdrop?: boolean;\n /** A `modal` that the Escape key does not close. */\n noCloseOnEsc?: boolean;\n /** A `modal` offering one button to close it instead of accept-and-cancel. */\n okOnly?: boolean;\n /** Which edge an `offcanvas` slides in from; also where the strip of a `tabs` stands. */\n placement?: 'start' | 'end' | 'top' | 'bottom' | 'left' | null;\n /** An `offcanvas` that leaves the form behind it usable instead of shading it over. */\n noBackdrop?: boolean;\n /** How a `spinner` turns. */\n spinnerType?: 'border' | 'grow' | null;\n /** A `spinner` or a `badge` drawn at the smaller of its two sizes. */\n small?: boolean;\n /**\n * The look of the parts of an element that has a title and an input. `classes`/`styles` stay on\n * the box holding both; these reach inside it. The title is the label of a field or an attribute\n * and the title of a group; the input is the control itself — a text box, a select, a date picker,\n * a switch, a table. Left unset, the part is drawn as it always was.\n */\n labelClasses?: string | null;\n labelStyles?: string | null;\n inputClasses: string | null;\n inputStyles: string | null;\n browseText?: any;\n accept?: any;\n noDrop?: boolean;\n multiple?: boolean;\n appObjectId?: any;\n showTotals?: boolean;\n disableSorting?: boolean;\n disableRowset?: boolean;\n hideToolbar?: boolean;\n hideActions?: boolean;\n /** Draw the rows of a table without the row of captions above them. */\n hideHeader?: boolean;\n usePagination?: boolean;\n rowsLimit?: number;\n maxHeight?: number;\n selectBtn?: boolean;\n /**\n * Reference field offering its whole list on click, the way an enum select does:\n * the records are loaded up front and filtered in place, and the select button is gone.\n * Meant for small, enum-like catalogs.\n */\n quickSelect?: boolean;\n openBtn?: boolean;\n addBtn?: boolean;\n /**\n * Draw the field as a link rather than as a control. A reference opens the form of the record it\n * holds; a caption (`plaintext`) opens whatever `onClick` names, or the address it carries when\n * it is typed as a `url`, an `email` or a `tel`.\n */\n hyperLink?: boolean;\n /** Module function called on a click of a field drawn as a link, instead of what it would do. */\n onClick?: string | null;\n beforeSelect?: any;\n /** The element is handed to the view module as `refs.<name>.value` — the component it is drawn with. */\n useRef?: boolean;\n maxRows?: number;\n rowsCount?: number;\n /** A textarea that keeps the size the view gave it, with no handle to drag it bigger. */\n noResize?: boolean;\n variant?: string;\n pill?: boolean;\n squared?: boolean;\n block?: boolean;\n toggleGroup?: any;\n itemIcon?: any;\n /** The mark a boolean drawn as an icon wears where its value is not set; most often none. */\n falseIcon?: string | null;\n /** The bounds and the step of a field drawn as a slider (`range`). */\n min?: number | string | null;\n step?: number | string | null;\n max?: any;\n textVariant?: any;\n bgVariant?: any;\n attrs: any;\n /** Server function name invoked on select. */\n onSelect?: string | null;\n /** Detail-view route path for reference fields. */\n detailPath?: string | null;\n /** Referenced component id (for advancedComponent items). */\n componentId?: string;\n selectType?: string;\n /** Render key. */\n key?: string;\n /** Dynamic-parameter payload (advanced components). */\n parameter?: any;\n parameterId?: string;\n /** Totals row config (list/table parts). */\n isTotal?: boolean;\n totalFunc?: string | null;\n /**\n * The aggregate a total stands for. A column of a table takes the ones its footer offers\n * (`sum`, `min`, `max`, `average`, `static`, `calculated`); a `tableTotal` item takes `sum`\n * for a numeric field of the table and `count` for its number of rows.\n */\n totalExp?: string | null;\n /**\n * A `tableTotal` item is a form field showing an aggregate over the rows of one table — the\n * table part of the object, or the dynamic table `viewAttribute` says it is. The table is\n * named here, the field summed in `totalField` (null when the rows themselves are counted).\n * Nothing of it is stored with the record: the client recomputes it from the rows it holds.\n */\n totalTable?: string | null;\n totalField?: string | null;\n valueString?: any;\n valueNumber?: any;\n valueBoolean?: any;\n valueDate?: any;\n valueObject?: any;\n valueRef?: any;\n /** Nested items (for groups/tables). */\n items?: ViewItem[];\n}\n/**\n * The type of the values of a value list, 1C's `Typ wartości`: a data type, and for a reference or an\n * enum what it refers to.\n */\ninterface ValueListValueType {\n dataType?: string | null;\n ref?: string | null;\n typeOptions?: {\n length?: number | null;\n precision?: number | null;\n scale?: number | null;\n } | null;\n dateType?: string | null;\n}\n/** A view attribute (form-level field, not bound to the object). */\ninterface ViewAttribute {\n id: string;\n title: string;\n name: string;\n type: 'field' | 'tableField' | 'dynamicTable' | 'valueList' | 'dynamicList' | null;\n /** What the values of a `valueList` are. */\n valueType?: ValueListValueType | null;\n /**\n * A `dynamicList` lists the records of the app object named in `ref` (whose id is `appObjectId`),\n * opening a row in the view `detailView` names. With `customQuery` it lists the rows of `listQuery`\n * instead, which Core runs when the Client names the view and the list (`viewId` + `listName`).\n * `filters` always apply; at run time `attrs.<name>` holds the state of the list.\n */\n appObjectId?: string | null;\n detailView?: string | null;\n customQuery?: boolean;\n listQuery?: {\n sql: string;\n model: any;\n fields: any[];\n mainTable: {\n objectName: string;\n alias: string;\n } | null;\n params: any[];\n } | null;\n filters?: any[];\n dataType: string | null;\n standard?: boolean;\n multiType: boolean;\n multiTypeVariant: 'common' | 'objects';\n typeOptions?: any;\n dateType: string;\n defaultValue?: any;\n format: string | null;\n ref: string | string[] | null;\n lang?: any;\n tableName?: string | null;\n /** Constant restrictions of the selection list (1C \"Parametry wyboru\"). */\n selectParams?: SelectParam[];\n /** Dependencies of the selection list on other fields (1C \"Powiazania parametrow wyboru\"). */\n selectLinks?: SelectLink[];\n childs: ViewAttribute[];\n}\ninterface ViewAttributeTreeItem extends Omit<ViewAttribute, 'id' | 'childs'> {\n attrId: string;\n path: string;\n fullName: string;\n fullPath: string;\n fullTitle: string;\n expanded?: boolean;\n viewAttribute?: boolean;\n dependent: boolean;\n childs: ViewAttributeTreeItem[];\n}\n/** A field of an app object (catalog/document/register). */\ninterface ObjectField {\n id: string;\n name: string;\n title: string;\n ref: string | string[] | null;\n lang: any;\n type: string | null;\n filter: string | null;\n /**\n * Every form showing this field offers its whole list on click, the way an enum select\n * does. A view element may still say otherwise for itself.\n */\n quickSelect?: boolean;\n /** Constant restrictions of the selection list (1C \"Parametry wyboru\"). */\n selectParams?: SelectParam[];\n /** Dependencies of the selection list on other fields (1C \"Powiazania parametrow wyboru\"). */\n selectLinks?: SelectLink[];\n format: string | null;\n leadingAlias: any;\n primaryKey: boolean;\n leading: boolean;\n decryptable: boolean;\n multiType: boolean;\n multiTypeVariant: 'common' | 'objects';\n defaultValue: any;\n standard?: any;\n dbName: string;\n dateType: string;\n notNull: boolean;\n autoIncrement: boolean;\n unique: boolean;\n index: boolean;\n password: boolean;\n isTablePart: boolean;\n model?: string;\n role: string | null;\n fullSearch: boolean;\n fullName?: string;\n typeOptions: any;\n virtual: boolean;\n comment: string | null;\n confidential?: boolean;\n confidentialRoleId?: string | null;\n fields?: ObjectField[];\n get: any;\n set: any;\n}\n/** A toolbar button/group. */\ninterface ToolbarItem {\n id: string;\n title: string;\n icon?: string | null;\n presentation: string;\n variant: string;\n size: string;\n disabled: boolean;\n visible: boolean;\n systemDisabled: boolean;\n systemVisible: boolean;\n hidden: boolean;\n tooltip?: string;\n type?: string;\n click?: Function;\n /** Server function name invoked on click (resolved via serverFunc). */\n onClick?: string;\n /** i18n overrides (lang.title[langCode], ...). */\n lang?: any;\n items?: ToolbarItem[];\n}\ninterface Toolbar {\n position: ToolbarPosition;\n buttonsPosition: ToolbarButtonsPosition;\n classes: string | null;\n styles: string | null;\n items: ToolbarItem[];\n staticItems: ToolbarItem[];\n commonCommands: ToolbarItem[];\n}\ninterface SortBy {\n key: string;\n order?: 'asc' | 'desc' | string;\n sortByOrig?: any;\n}\n/** List/table view data (list and select forms). */\ninterface ListViewTable {\n items: any[];\n fields: any[];\n total: number;\n page: number;\n limit: number;\n filters: Record<string, any>;\n sort: SortBy[];\n folders: {\n items: any[];\n expanded: any[];\n };\n}\n/** Current route (vue-router). */\ninterface Route {\n path: string;\n fullPath: string;\n name?: string | symbol | null;\n params: Record<string, any>;\n query: Record<string, any>;\n hash: string;\n meta: Record<string, any>;\n}\n/** Router instance (vue-router). */\ninterface Router {\n push(to: any): Promise<any>;\n replace(to: any): Promise<any>;\n back(): void;\n forward(): void;\n go(delta: number): void;\n}\n/** onCreate / onMount / afterConfirm / afterMarkedToDelete / afterDelete / onBeforeDestroy. */\ntype ModuleHook = () => void | Promise<void>;\n/** beforeWrite / beforeConfirm / beforeMarkedToDelete / beforeDelete — set params.cancel to abort. */\ntype CancelableHook = (params: {\n cancel: boolean;\n}) => void | Promise<void>;\n/** afterWrite — receives { close } (optional; also called with no args). */\ntype AfterWriteHook = (options?: {\n close?: boolean;\n}) => void | Promise<void>;\n/** Entity data store (useStore('object'), or a view's `store`). */\ninterface Store {\n findByPk(payload?: any): Promise<any>;\n findAll(payload?: any): Promise<any>;\n count(payload?: any): Promise<number>;\n create(payload?: any): Promise<any>;\n createItem(payload?: any): Promise<any>;\n update(payload?: any): Promise<any>;\n updateItem(payload?: any): Promise<any>;\n delete(payload?: any): Promise<any>;\n deleteItem(payload?: any): Promise<any>;\n addNewItem(payload?: any): Promise<any>;\n changeDeletionMark(payload?: any): Promise<any>;\n getView(): {\n object: any;\n attrs: any;\n objectMeta: any;\n };\n}\n/** Control object passed to cancelable client `before*` hooks. Set `cancel` to abort the request. */\ninterface CancelParams {\n cancel: boolean;\n message?: string;\n}\n/**\n * `this` inside an object client-module EVENT hook (`events.*`).\n * The module receives no injected globals — the environment is reached through\n * these `$`-prefixed helpers on `this`.\n */\ninterface ObjectModuleContext {\n /** HTTP client (axios instance), e.g. `this.$axios.get('/products')`. */\n $axios: any;\n /** Get another object's data store by name. */\n $useStore(name: string): Store;\n /** i18n translation. */\n $t(key: string, ...args: any[]): string;\n /** Moment.js date helper. */\n $moment(input?: any): any;\n /** Lodash utilities. */\n $lodash: any;\n /** This object's views (ObjectView / ListView state). */\n views: any[];\n /** This object's metadata (blank-record template, fields). */\n objectMeta: any;\n /** Module actions merged into the store. */\n actions: Record<string, (...args: any[]) => any>;\n /** Module helper functions (`this.functions.x`). */\n functions: Record<string, (...args: any[]) => any>;\n /** Module getters. */\n getters: Record<string, any>;\n}\n/**\n * `this` inside an object client-module ACTION (`actions.*`) — the entity store\n * (all store methods + `views` / `objectMeta`). Overriding an action fully\n * replaces the built-in one (its `before*`/`after*` hooks are bypassed).\n */\ninterface ObjectModuleActionThis extends Store {\n views: any[];\n objectMeta: any;\n}";
|
package/package.json
CHANGED