@webx-ui/module-catalog-properties 0.1.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/LICENSE +21 -0
- package/README.md +46 -0
- package/dist/CategoryPropertiesField.d.ts +2 -0
- package/dist/IntervalsField.d.ts +2 -0
- package/dist/MergeDialog.d.ts +7 -0
- package/dist/NumberExample.d.ts +2 -0
- package/dist/ProductPropertiesField.d.ts +11 -0
- package/dist/PropertiesPage.d.ts +7 -0
- package/dist/PropertyCreateDialog.d.ts +4 -0
- package/dist/PropertyEditorPage.d.ts +7 -0
- package/dist/TypeField.d.ts +15 -0
- package/dist/ValueDialog.d.ts +18 -0
- package/dist/ValueRow.d.ts +7 -0
- package/dist/ValueSelect.d.ts +18 -0
- package/dist/ValueTreeSelect.d.ts +18 -0
- package/dist/ValuesField.d.ts +2 -0
- package/dist/api.d.ts +48 -0
- package/dist/editor.d.ts +22 -0
- package/dist/format.d.ts +27 -0
- package/dist/i18n.d.ts +4 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +2418 -0
- package/dist/index.js.map +1 -0
- package/dist/messages.d.ts +8 -0
- package/dist/module.d.ts +22 -0
- package/dist/style.css +1 -0
- package/dist/types.d.ts +124 -0
- package/package.json +72 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { LocalizedValue } from '@webx-ui/core';
|
|
2
|
+
import { ScreenModel } from '@webx-ui/schema';
|
|
3
|
+
/** Chosen once, when the property is made (decision 1): the products' values have its shape. */
|
|
4
|
+
export type PropertyType = 'select' | 'number' | 'text' | 'bool';
|
|
5
|
+
export type FilterMode = 'slider' | 'intervals';
|
|
6
|
+
export type ValueOrder = 'alpha' | 'manual';
|
|
7
|
+
/** A map of languages as the server keeps it; empty where nothing was written. */
|
|
8
|
+
export type Words = LocalizedValue | [] | null;
|
|
9
|
+
/** One property as the API spells it (§7.3 of the properties spec, `Resources::property`). */
|
|
10
|
+
export interface PropertyRow {
|
|
11
|
+
id: number;
|
|
12
|
+
title: Words;
|
|
13
|
+
code: Words;
|
|
14
|
+
type: PropertyType;
|
|
15
|
+
group: {
|
|
16
|
+
id: number;
|
|
17
|
+
title: Words;
|
|
18
|
+
} | null;
|
|
19
|
+
is_multiple: boolean;
|
|
20
|
+
is_tree: boolean;
|
|
21
|
+
leaves_only: boolean;
|
|
22
|
+
is_filterable: boolean;
|
|
23
|
+
is_indexable: boolean;
|
|
24
|
+
is_searchable: boolean;
|
|
25
|
+
in_card: boolean;
|
|
26
|
+
on_page: boolean;
|
|
27
|
+
in_list: boolean;
|
|
28
|
+
has_color: boolean;
|
|
29
|
+
has_image: boolean;
|
|
30
|
+
unit_prefix: Words;
|
|
31
|
+
unit_suffix: Words;
|
|
32
|
+
precision: number;
|
|
33
|
+
filter_mode: FilterMode | null;
|
|
34
|
+
value_order: ValueOrder;
|
|
35
|
+
toggle_slug: Words;
|
|
36
|
+
seo_pattern: Words;
|
|
37
|
+
position: number;
|
|
38
|
+
products_count: number;
|
|
39
|
+
deleted_at: string | null;
|
|
40
|
+
}
|
|
41
|
+
/** A value of a reference book (`Resources::value`), one node of its tree. */
|
|
42
|
+
export interface PropertyValue {
|
|
43
|
+
id: number;
|
|
44
|
+
parent_id: number | null;
|
|
45
|
+
title: Words;
|
|
46
|
+
slug: Words;
|
|
47
|
+
color: string | null;
|
|
48
|
+
image: {
|
|
49
|
+
id: number;
|
|
50
|
+
url: string;
|
|
51
|
+
thumb: string | null;
|
|
52
|
+
} | null;
|
|
53
|
+
depth: number;
|
|
54
|
+
has_children: boolean;
|
|
55
|
+
products_count: number;
|
|
56
|
+
/** Only when asked by id: the path down to it, the root first. */
|
|
57
|
+
ancestors?: PropertyValue[];
|
|
58
|
+
}
|
|
59
|
+
/** A value as a node of `WxTree`, which keeps the children it has loaded on the node itself. */
|
|
60
|
+
export interface ValueNode extends PropertyValue {
|
|
61
|
+
/** The name in the panel's language, which the tree reads by key. */
|
|
62
|
+
label: string;
|
|
63
|
+
children?: ValueNode[];
|
|
64
|
+
leaf: boolean;
|
|
65
|
+
[key: string]: unknown;
|
|
66
|
+
}
|
|
67
|
+
/** One interval of a number's filter: `[min, max)`, either end open (§2). */
|
|
68
|
+
export interface PropertyInterval {
|
|
69
|
+
id?: number | null;
|
|
70
|
+
title: Words;
|
|
71
|
+
slug: Words;
|
|
72
|
+
min: number | null;
|
|
73
|
+
max: number | null;
|
|
74
|
+
position?: number;
|
|
75
|
+
}
|
|
76
|
+
/** A property as its editor opens it: the row, the values of its screen, its intervals. */
|
|
77
|
+
export interface PropertyDetail {
|
|
78
|
+
property: PropertyRow;
|
|
79
|
+
values: ScreenModel;
|
|
80
|
+
intervals: PropertyInterval[];
|
|
81
|
+
}
|
|
82
|
+
/** The list, as Laravel's paginator answers it. */
|
|
83
|
+
export interface PropertiesPage {
|
|
84
|
+
data: PropertyRow[];
|
|
85
|
+
current_page: number;
|
|
86
|
+
last_page: number;
|
|
87
|
+
per_page: number;
|
|
88
|
+
total: number;
|
|
89
|
+
}
|
|
90
|
+
export interface PropertyQuery {
|
|
91
|
+
q?: string;
|
|
92
|
+
type?: PropertyType | '';
|
|
93
|
+
group?: number | null;
|
|
94
|
+
ids?: number[];
|
|
95
|
+
trashed?: boolean;
|
|
96
|
+
page?: number;
|
|
97
|
+
per_page?: number;
|
|
98
|
+
}
|
|
99
|
+
/** A category's «Properties» tab: what it inherits and from whom, and what it adds itself. */
|
|
100
|
+
export interface CategorySet {
|
|
101
|
+
inherited: {
|
|
102
|
+
property: PropertyRow;
|
|
103
|
+
from: {
|
|
104
|
+
id: number;
|
|
105
|
+
name: string;
|
|
106
|
+
};
|
|
107
|
+
}[];
|
|
108
|
+
own: PropertyRow[];
|
|
109
|
+
}
|
|
110
|
+
/** The set in force for a product's form, cut by the groups of the card. */
|
|
111
|
+
export interface EffectiveSet {
|
|
112
|
+
groups: {
|
|
113
|
+
group: {
|
|
114
|
+
id: number;
|
|
115
|
+
title: Words;
|
|
116
|
+
} | null;
|
|
117
|
+
properties: PropertyRow[];
|
|
118
|
+
}[];
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* What a product holds of one property (§3.1): a value's id or a list of them, a number, `true`,
|
|
122
|
+
* or a text in every language. `null` in what is sent takes the value away.
|
|
123
|
+
*/
|
|
124
|
+
export type HeldValue = number | number[] | true | LocalizedValue | null;
|
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@webx-ui/module-catalog-properties",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Properties of products for the catalogue of the WebX UI admin panel: reference books with colours and pictures, numbers with units, texts and yes/no, sets inherited down the categories, the specifications tab of the product form and columns of the list.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": [
|
|
8
|
+
"*.css"
|
|
9
|
+
],
|
|
10
|
+
"keywords": [
|
|
11
|
+
"webx-ui",
|
|
12
|
+
"vue",
|
|
13
|
+
"admin",
|
|
14
|
+
"cms",
|
|
15
|
+
"catalog",
|
|
16
|
+
"e-commerce",
|
|
17
|
+
"properties",
|
|
18
|
+
"attributes",
|
|
19
|
+
"specifications",
|
|
20
|
+
"facets"
|
|
21
|
+
],
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/webx-ui/webx-ui.git",
|
|
25
|
+
"directory": "packages/module-catalog-properties"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://github.com/webx-ui/webx-ui/tree/main/packages/module-catalog-properties",
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist"
|
|
33
|
+
],
|
|
34
|
+
"main": "./dist/index.js",
|
|
35
|
+
"module": "./dist/index.js",
|
|
36
|
+
"types": "./dist/index.d.ts",
|
|
37
|
+
"exports": {
|
|
38
|
+
".": {
|
|
39
|
+
"types": "./dist/index.d.ts",
|
|
40
|
+
"import": "./dist/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./style.css": "./dist/style.css",
|
|
43
|
+
"./dist/style.css": "./dist/style.css",
|
|
44
|
+
"./package.json": "./package.json"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"vue": "^3.5.0",
|
|
48
|
+
"vue-router": "^4.5.0"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@webx-ui/core": "^0.34.3",
|
|
52
|
+
"@webx-ui/module-admin": "^0.22.0",
|
|
53
|
+
"@webx-ui/module-catalog": "^0.5.0",
|
|
54
|
+
"@webx-ui/module-media": "^0.8.20",
|
|
55
|
+
"@webx-ui/schema": "^0.7.0"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@types/node": "^24.10.1",
|
|
59
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
60
|
+
"typescript": "^5.9.3",
|
|
61
|
+
"vite": "^7.1.14",
|
|
62
|
+
"vite-plugin-dts": "^4.5.4",
|
|
63
|
+
"vue": "^3.5.24",
|
|
64
|
+
"vue-router": "^4.5.1",
|
|
65
|
+
"vue-tsc": "^3.1.3"
|
|
66
|
+
},
|
|
67
|
+
"scripts": {
|
|
68
|
+
"build": "vite build",
|
|
69
|
+
"dev": "vite build --watch",
|
|
70
|
+
"typecheck": "vue-tsc -p tsconfig.json --noEmit"
|
|
71
|
+
}
|
|
72
|
+
}
|