@webx-ui/module-admin 0.16.1 → 0.18.0
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/RenameButton.d.ts +1 -1
- package/dist/collections/CollectionField.d.ts +17 -0
- package/dist/collections/api.d.ts +59 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1870 -1391
- package/dist/index.js.map +1 -1
- package/dist/relations/RelationsField.d.ts +25 -0
- package/dist/relations/api.d.ts +45 -0
- package/dist/screenTypes.d.ts +6 -0
- package/dist/style.css +1 -1
- package/package.json +2 -2
package/dist/RenameButton.d.ts
CHANGED
|
@@ -148,7 +148,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
148
148
|
onClear?: (() => any) | undefined;
|
|
149
149
|
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
150
150
|
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
151
|
-
}>, "disabled" | "type" | "id" | "size" | "clearable" | "placeholder" | "status" | "ariaLabel" | "input" | "select" | "readonly" | "
|
|
151
|
+
}>, "disabled" | "type" | "id" | "size" | "clearable" | "placeholder" | "status" | "ariaLabel" | "input" | "select" | "readonly" | "focus" | "blur" | "maxlength" | "showCount" | "autocomplete" | "localized"> & {
|
|
152
152
|
focus: () => void | undefined;
|
|
153
153
|
blur: () => void | undefined;
|
|
154
154
|
select: () => void | undefined;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CollectionValue } from './api';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** The source's key, as the server registered it: `faq`. */
|
|
4
|
+
source: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_PublicProps = {
|
|
8
|
+
modelValue?: CollectionValue | null;
|
|
9
|
+
} & __VLS_Props;
|
|
10
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
|
+
"update:modelValue": (value: CollectionValue | null) => any;
|
|
12
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
13
|
+
"onUpdate:modelValue"?: ((value: CollectionValue | null) => any) | undefined;
|
|
14
|
+
}>, {
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { AdminContext } from '../admin';
|
|
2
|
+
/**
|
|
3
|
+
* One section a block can show records from, as `GET /api/cms/collections` describes it
|
|
4
|
+
* (`WebxUi\Admin\Collections\CollectionSource` on the server).
|
|
5
|
+
*/
|
|
6
|
+
export interface CollectionSourceInfo {
|
|
7
|
+
/** What a block schema writes in `props.source`: `faq`. */
|
|
8
|
+
key: string;
|
|
9
|
+
/** Already in the panel's language. */
|
|
10
|
+
title: string;
|
|
11
|
+
/** The path its categories answer at (`faq/categories`); `null` — a source without them. */
|
|
12
|
+
categories: string | null;
|
|
13
|
+
/** Whether it can mark its records up for search engines. */
|
|
14
|
+
markup: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* The targets its records can be related to (`CollectionSource::relations()`, §3.6 of the
|
|
17
|
+
* recipes spec) — empty for a source without relations, which has no "only related to".
|
|
18
|
+
*/
|
|
19
|
+
relations: CollectionRelationTarget[];
|
|
20
|
+
}
|
|
21
|
+
/** A target a source's records point at, named for the choice "only related to …". */
|
|
22
|
+
export interface CollectionRelationTarget {
|
|
23
|
+
/** Its key in the server's registry of targets: `service`. */
|
|
24
|
+
key: string;
|
|
25
|
+
/** Already in the panel's language. */
|
|
26
|
+
title: string;
|
|
27
|
+
}
|
|
28
|
+
/** "Only the records related to these": one target, and the ones of it that were chosen. */
|
|
29
|
+
export interface CollectionRelated {
|
|
30
|
+
type: string;
|
|
31
|
+
ids: number[];
|
|
32
|
+
/**
|
|
33
|
+
* "Related to the record of the page the block stands on" — written only when on, and then
|
|
34
|
+
* `ids` is always empty: the record is the page's, not a choice.
|
|
35
|
+
*/
|
|
36
|
+
current?: true;
|
|
37
|
+
}
|
|
38
|
+
/** What a `wx-collection` field keeps: the choice, never the records. */
|
|
39
|
+
export interface CollectionValue {
|
|
40
|
+
/** Empty — all of them. */
|
|
41
|
+
categories: number[];
|
|
42
|
+
/** `null` — not narrowed by relations. */
|
|
43
|
+
related: CollectionRelated | null;
|
|
44
|
+
/** `null` — all of them. */
|
|
45
|
+
limit: number | null;
|
|
46
|
+
filter: boolean;
|
|
47
|
+
/** `null` — the default: on when no category is chosen (decision 8 of the FAQ spec). */
|
|
48
|
+
markup: boolean | null;
|
|
49
|
+
}
|
|
50
|
+
/** The server's ceiling for `limit` (`Selection::MAX_LIMIT`). */
|
|
51
|
+
export declare const COLLECTION_MAX_LIMIT = 100;
|
|
52
|
+
export declare function collectionSources(admin: AdminContext): Promise<CollectionSourceInfo[]>;
|
|
53
|
+
/** Whatever arrived, as the five keys the server writes — the same `Selection::normalise()` does. */
|
|
54
|
+
export declare function normaliseCollection(value: unknown): CollectionValue;
|
|
55
|
+
/**
|
|
56
|
+
* What `markup: null` means for this choice: on for the whole collection, off for a part of it —
|
|
57
|
+
* and "the recipes of this service" is a part as much as a category is.
|
|
58
|
+
*/
|
|
59
|
+
export declare function defaultMarkup(value: CollectionValue): boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ export { createLinksApi, emptyLink, type LinkCandidate, type LinkRel, type LinkS
|
|
|
11
11
|
export { createHttp, readCookie, HttpError, type Http, type HttpOptions, type RequestOptions, } from './http';
|
|
12
12
|
export { adminTypes } from './screenTypes';
|
|
13
13
|
export { categoryRoutes, createCategoriesApi, itemOrderMode, reorderItems, useCategoryEditor, useCategoryWords, useItemOrder, type CategoriesApi, type CategoriesOptions, type CategoriesPayload, type CategoryDetail, type CategoryEditorContext, type CategoryRow, type CategoryWord, type ItemOrder, type ItemOrderMode, type ItemOrderState, } from './categories';
|
|
14
|
+
export { COLLECTION_MAX_LIMIT, collectionSources, defaultMarkup, normaliseCollection, type CollectionRelated, type CollectionRelationTarget, type CollectionSourceInfo, type CollectionValue, } from './collections/api';
|
|
15
|
+
export { createRelationsApi, normaliseRelations, provideRelationOwner, relationOwnerKey, useRelationOwner, type RelationCandidate, type RelationOwner, type RelationsApi, } from './relations/api';
|
|
14
16
|
export type { AdminModule, AdminStatus, AdminUser, Manifest, ManifestModule, NavEntry, PickedImage, RowAction, ScreenAction, AppliedFilter, } from './types';
|
|
15
17
|
export { default as AdminShell } from './AdminShell';
|
|
16
18
|
export { default as AdminNav } from './AdminNav';
|
|
@@ -35,6 +37,8 @@ export { default as WxCategoriesPage } from './categories/CategoriesPage';
|
|
|
35
37
|
export { default as WxCategoryCreateDialog } from './categories/CategoryCreateDialog';
|
|
36
38
|
export { default as WxCategoryEditorPage } from './categories/CategoryEditorPage';
|
|
37
39
|
export { default as WxCategoriesField } from './categories/CategoriesField';
|
|
40
|
+
export { default as WxCollectionField } from './collections/CollectionField';
|
|
41
|
+
export { default as WxRelationsField } from './relations/RelationsField';
|
|
38
42
|
export { default as WxSlugField } from './SlugField';
|
|
39
43
|
/** The shared address field under the name it was released with. */
|
|
40
44
|
export { default as WxCategorySlug } from './SlugField';
|