@webx-ui/module-admin 0.17.0 → 0.18.1
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/ScreenHead.d.ts +6 -2
- package/dist/collections/api.d.ts +29 -2
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1566 -1273
- 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 +3 -0
- package/dist/style.css +1 -1
- package/package.json +3 -3
package/dist/ScreenHead.d.ts
CHANGED
|
@@ -38,8 +38,12 @@ type __VLS_Props = {
|
|
|
38
38
|
* The way out of the screen. A route draws a link; `true` draws the same arrow and emits
|
|
39
39
|
* `back` instead, which is what a pane inside `WxListDetail` needs — on a phone the drawer
|
|
40
40
|
* carries no close of its own and the pane has to bring one (CLAUDE.md §4).
|
|
41
|
+
*
|
|
42
|
+
* `string` and `object` are spelled out beside `RouteLocationRaw` for the compiler: it
|
|
43
|
+
* cannot resolve the router's type, drops it and leaves `Boolean` alone as the runtime
|
|
44
|
+
* type, so every editor passing its list's path warned "Expected Boolean, got String".
|
|
41
45
|
*/
|
|
42
|
-
back?: RouteLocationRaw | boolean;
|
|
46
|
+
back?: RouteLocationRaw | string | object | boolean;
|
|
43
47
|
/** What the arrow's tooltip says. The panel's own word for it when not given. */
|
|
44
48
|
backLabel?: string;
|
|
45
49
|
/** `2` for a screen, `3` for a pane standing inside one. */
|
|
@@ -95,7 +99,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
95
99
|
title: string;
|
|
96
100
|
actions: ScreenAction[];
|
|
97
101
|
subtitle: string;
|
|
98
|
-
back: RouteLocationRaw | boolean;
|
|
102
|
+
back: RouteLocationRaw | string | object | boolean;
|
|
99
103
|
backLabel: string;
|
|
100
104
|
level: HeadingLevel;
|
|
101
105
|
collapseBelow: number;
|
|
@@ -12,11 +12,35 @@ export interface CollectionSourceInfo {
|
|
|
12
12
|
categories: string | null;
|
|
13
13
|
/** Whether it can mark its records up for search engines. */
|
|
14
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;
|
|
15
37
|
}
|
|
16
38
|
/** What a `wx-collection` field keeps: the choice, never the records. */
|
|
17
39
|
export interface CollectionValue {
|
|
18
40
|
/** Empty — all of them. */
|
|
19
41
|
categories: number[];
|
|
42
|
+
/** `null` — not narrowed by relations. */
|
|
43
|
+
related: CollectionRelated | null;
|
|
20
44
|
/** `null` — all of them. */
|
|
21
45
|
limit: number | null;
|
|
22
46
|
filter: boolean;
|
|
@@ -26,7 +50,10 @@ export interface CollectionValue {
|
|
|
26
50
|
/** The server's ceiling for `limit` (`Selection::MAX_LIMIT`). */
|
|
27
51
|
export declare const COLLECTION_MAX_LIMIT = 100;
|
|
28
52
|
export declare function collectionSources(admin: AdminContext): Promise<CollectionSourceInfo[]>;
|
|
29
|
-
/** Whatever arrived, as the
|
|
53
|
+
/** Whatever arrived, as the five keys the server writes — the same `Selection::normalise()` does. */
|
|
30
54
|
export declare function normaliseCollection(value: unknown): CollectionValue;
|
|
31
|
-
/**
|
|
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
|
+
*/
|
|
32
59
|
export declare function defaultMarkup(value: CollectionValue): boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +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 CollectionSourceInfo, type CollectionValue, } from './collections/api';
|
|
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';
|
|
15
16
|
export type { AdminModule, AdminStatus, AdminUser, Manifest, ManifestModule, NavEntry, PickedImage, RowAction, ScreenAction, AppliedFilter, } from './types';
|
|
16
17
|
export { default as AdminShell } from './AdminShell';
|
|
17
18
|
export { default as AdminNav } from './AdminNav';
|
|
@@ -37,6 +38,7 @@ export { default as WxCategoryCreateDialog } from './categories/CategoryCreateDi
|
|
|
37
38
|
export { default as WxCategoryEditorPage } from './categories/CategoryEditorPage';
|
|
38
39
|
export { default as WxCategoriesField } from './categories/CategoriesField';
|
|
39
40
|
export { default as WxCollectionField } from './collections/CollectionField';
|
|
41
|
+
export { default as WxRelationsField } from './relations/RelationsField';
|
|
40
42
|
export { default as WxSlugField } from './SlugField';
|
|
41
43
|
/** The shared address field under the name it was released with. */
|
|
42
44
|
export { default as WxCategorySlug } from './SlugField';
|