@yongdall/model 0.3.3 → 0.5.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/index.d.mts CHANGED
@@ -13,14 +13,14 @@ export * from "imodel";
13
13
  * nullable?: false;
14
14
  * array?: false;
15
15
  * default?: ToType<T, false, false> | symbol;
16
- * } & FieldDefineOption & FieldDefineExtends} [options]
16
+ * } & FieldDefineOption & Field.Extends} [options]
17
17
  * @returns {FieldDefine<T, false, false>}
18
18
  */
19
19
  declare function createField<T extends MainFieldType>(type: T, options?: ({
20
20
  nullable?: false;
21
21
  array?: false;
22
22
  default?: ToType<T, false, false> | symbol;
23
- } & FieldDefineOption & FieldDefineExtends) | undefined): FieldDefine<T, false, false>;
23
+ } & FieldDefineOption & Field.Extends) | undefined): FieldDefine<T, false, false>;
24
24
  /**
25
25
  * @template {MainFieldType} T
26
26
  * @overload
@@ -29,14 +29,14 @@ declare function createField<T extends MainFieldType>(type: T, options?: ({
29
29
  * nullable?: false;
30
30
  * array: true;
31
31
  * default?: ToType<T, true, false> | symbol;
32
- * } & FieldDefineOption & FieldDefineExtends} options
32
+ * } & FieldDefineOption & Field.Extends} options
33
33
  * @returns {FieldDefine<T, true, false>}
34
34
  */
35
35
  declare function createField<T extends MainFieldType>(type: T, options: {
36
36
  nullable?: false;
37
37
  array: true;
38
38
  default?: ToType<T, true, false> | symbol;
39
- } & FieldDefineOption & FieldDefineExtends): FieldDefine<T, true, false>;
39
+ } & FieldDefineOption & Field.Extends): FieldDefine<T, true, false>;
40
40
  /**
41
41
  * @template {MainFieldType} T
42
42
  * @overload
@@ -45,14 +45,14 @@ declare function createField<T extends MainFieldType>(type: T, options: {
45
45
  * nullable: true;
46
46
  * array?: false;
47
47
  * default?: ToType<T, false, true> | symbol;
48
- * } & FieldDefineOption & FieldDefineExtends} options
48
+ * } & FieldDefineOption & Field.Extends} options
49
49
  * @returns {FieldDefine<T, false, true>}
50
50
  */
51
51
  declare function createField<T extends MainFieldType>(type: T, options: {
52
52
  nullable: true;
53
53
  array?: false;
54
54
  default?: ToType<T, false, true> | symbol;
55
- } & FieldDefineOption & FieldDefineExtends): FieldDefine<T, false, true>;
55
+ } & FieldDefineOption & Field.Extends): FieldDefine<T, false, true>;
56
56
  /**
57
57
  * @template {MainFieldType} T
58
58
  * @overload
@@ -61,14 +61,14 @@ declare function createField<T extends MainFieldType>(type: T, options: {
61
61
  * nullable: true;
62
62
  * array: true;
63
63
  * default?: ToType<T, true, true> | symbol;
64
- * } & FieldDefineOption & FieldDefineExtends} options
64
+ * } & FieldDefineOption & Field.Extends} options
65
65
  * @returns {FieldDefine<T, true, true>}
66
66
  */
67
67
  declare function createField<T extends MainFieldType>(type: T, options: {
68
68
  nullable: true;
69
69
  array: true;
70
70
  default?: ToType<T, true, true> | symbol;
71
- } & FieldDefineOption & FieldDefineExtends): FieldDefine<T, true, true>;
71
+ } & FieldDefineOption & Field.Extends): FieldDefine<T, true, true>;
72
72
  /**
73
73
  * @template {MainFieldType} T
74
74
  * @template {boolean} A
@@ -78,14 +78,14 @@ declare function createField<T extends MainFieldType>(type: T, options: {
78
78
  * nullable: true;
79
79
  * array: A;
80
80
  * default?: ToType<T, A, true> | symbol;
81
- * } & FieldDefineOption & FieldDefineExtends} options
81
+ * } & FieldDefineOption & Field.Extends} options
82
82
  * @returns {FieldDefine<T, A, true>}
83
83
  */
84
84
  declare function createField<T extends MainFieldType, A extends boolean>(type: T, options: {
85
85
  nullable: true;
86
86
  array: A;
87
87
  default?: ToType<T, A, true> | symbol;
88
- } & FieldDefineOption & FieldDefineExtends): FieldDefine<T, A, true>;
88
+ } & FieldDefineOption & Field.Extends): FieldDefine<T, A, true>;
89
89
  /**
90
90
  * @template {MainFieldType} T
91
91
  * @template {boolean} A
@@ -95,14 +95,14 @@ declare function createField<T extends MainFieldType, A extends boolean>(type: T
95
95
  * nullable?: false;
96
96
  * array: A;
97
97
  * default?: ToType<T, A, false> | symbol;
98
- * } & FieldDefineOption & FieldDefineExtends} options
98
+ * } & FieldDefineOption & Field.Extends} options
99
99
  * @returns {FieldDefine<T, A, false>}
100
100
  */
101
101
  declare function createField<T extends MainFieldType, A extends boolean>(type: T, options: {
102
102
  nullable?: false;
103
103
  array: A;
104
104
  default?: ToType<T, A, false> | symbol;
105
- } & FieldDefineOption & FieldDefineExtends): FieldDefine<T, A, false>;
105
+ } & FieldDefineOption & Field.Extends): FieldDefine<T, A, false>;
106
106
  /**
107
107
  * @template {MainFieldType} T
108
108
  * @template {boolean} N
@@ -112,14 +112,14 @@ declare function createField<T extends MainFieldType, A extends boolean>(type: T
112
112
  * nullable: N;
113
113
  * array?: false;
114
114
  * default?: ToType<T, false, N> | symbol;
115
- * } & FieldDefineOption & FieldDefineExtends} options
115
+ * } & FieldDefineOption & Field.Extends} options
116
116
  * @returns {FieldDefine<T, false, N>}
117
117
  */
118
118
  declare function createField<T extends MainFieldType, N extends boolean>(type: T, options: {
119
119
  nullable: N;
120
120
  array?: false;
121
121
  default?: ToType<T, false, N> | symbol;
122
- } & FieldDefineOption & FieldDefineExtends): FieldDefine<T, false, N>;
122
+ } & FieldDefineOption & Field.Extends): FieldDefine<T, false, N>;
123
123
  /**
124
124
  * @template {MainFieldType} T
125
125
  * @template {boolean} N
@@ -129,14 +129,14 @@ declare function createField<T extends MainFieldType, N extends boolean>(type: T
129
129
  * nullable: N;
130
130
  * array: true;
131
131
  * default?: ToType<T, true, N> | symbol;
132
- * } & FieldDefineOption & FieldDefineExtends} options
132
+ * } & FieldDefineOption & Field.Extends} options
133
133
  * @returns {FieldDefine<T, true, N>}
134
134
  */
135
135
  declare function createField<T extends MainFieldType, N extends boolean>(type: T, options: {
136
136
  nullable: N;
137
137
  array: true;
138
138
  default?: ToType<T, true, N> | symbol;
139
- } & FieldDefineOption & FieldDefineExtends): FieldDefine<T, true, N>;
139
+ } & FieldDefineOption & Field.Extends): FieldDefine<T, true, N>;
140
140
  /**
141
141
  * @template {MainFieldType} T
142
142
  * @template {boolean} A
@@ -147,14 +147,14 @@ declare function createField<T extends MainFieldType, N extends boolean>(type: T
147
147
  * nullable: N;
148
148
  * array: A;
149
149
  * default?: ToType<T, A, N> | symbol;
150
- * } & FieldDefineOption & FieldDefineExtends} options
150
+ * } & FieldDefineOption & Field.Extends} options
151
151
  * @returns {FieldDefine<T, A, N>}
152
152
  */
153
153
  declare function createField<T extends MainFieldType, A extends boolean, N extends boolean>(type: T, options: {
154
154
  nullable: N;
155
155
  array: A;
156
156
  default?: ToType<T, A, N> | symbol;
157
- } & FieldDefineOption & FieldDefineExtends): FieldDefine<T, A, N>;
157
+ } & FieldDefineOption & Field.Extends): FieldDefine<T, A, N>;
158
158
  /**
159
159
  * @template {MainFieldType} T
160
160
  * @overload
@@ -163,92 +163,14 @@ declare function createField<T extends MainFieldType, A extends boolean, N exten
163
163
  * nullable?: boolean;
164
164
  * array?: boolean;
165
165
  * default?: ToType<T, boolean, boolean> | symbol;
166
- * } & FieldDefineOption & FieldDefineExtends} options
166
+ * } & FieldDefineOption & Field.Extends} options
167
167
  * @returns {FieldDefine<T, boolean, boolean>}
168
168
  */
169
169
  declare function createField<T extends MainFieldType>(type: T, options: {
170
170
  nullable?: boolean;
171
171
  array?: boolean;
172
172
  default?: ToType<T, boolean, boolean> | symbol;
173
- } & FieldDefineOption & FieldDefineExtends): FieldDefine<T, boolean, boolean>;
174
- type FieldDefineExtends = {
175
- /**
176
- * - 字段序号
177
- */
178
- no?: number | undefined;
179
- /**
180
- * - 字段的显示标签。
181
- */
182
- label?: string | undefined;
183
- /**
184
- * - 字段的详细描述信息,可用于提示或帮助文本。
185
- */
186
- description?: string | undefined;
187
- /**
188
- * - 输入框等控件的占位提示文字。
189
- */
190
- placeholder?: string | undefined;
191
- /**
192
- * - 数值输入时的步长(如用于 number 类型 input 的 step 属性)。
193
- */
194
- step?: number | undefined;
195
- /**
196
- * - 字段允许的最大值(常用于数值或日期类型校验)。
197
- */
198
- max?: number | undefined;
199
- /**
200
- * - 字段允许的最小值(常用于数值或日期类型校验)。
201
- */
202
- min?: number | undefined;
203
- /**
204
- * - 是否只读,用户可聚焦但不可修改内容。
205
- */
206
- readonly?: boolean | undefined;
207
- /**
208
- * - 是否为必填项,用于表单验证。
209
- */
210
- required?: boolean | undefined;
211
- /**
212
- * - 是否支持清空操作(如带“×”按钮的输入框或选择器)。
213
- */
214
- clearable?: boolean | undefined;
215
- /**
216
- * - 是否禁用,禁用状态下用户无法交互且通常视觉上置灰。
217
- */
218
- disabled?: boolean | undefined;
219
- /**
220
- * - 字段所属的逻辑分组名称,用于权限分组。
221
- */
222
- group?: string | undefined;
223
- /**
224
- * - 布局顺序
225
- */
226
- layoutOrder?: number | undefined;
227
- /**
228
- * - 渲染器配置数组
229
- */
230
- renderer?: string | {
231
- [k: string]: any;
232
- component: string;
233
- values?: any[];
234
- } | (string | {
235
- [k: string]: any;
236
- component: string;
237
- values?: any[];
238
- })[] | undefined;
239
- /**
240
- * - 脚本列表,可以是字符串或 [脚本名, 配置对象] 的元组
241
- */
242
- scripts?: (string | [string, object])[] | undefined;
243
- /**
244
- * - 布局信息
245
- */
246
- layout?: Field.Layout | undefined;
247
- /**
248
- * - 关联模型
249
- */
250
- model?: string | undefined;
251
- };
173
+ } & FieldDefineOption & Field.Extends): FieldDefine<T, boolean, boolean>;
252
174
  //#endregion
253
175
  //#region packages/model/createModel.d.mts
254
176
  /**
@@ -488,4 +410,4 @@ declare function getDefinePermission(v: any): _yongdall_types0.Permission[];
488
410
  */
489
411
  declare function getLabelPattern(v: any): any;
490
412
  //#endregion
491
- export { FieldDefineExtends, ModelOptions, ModelTable, clearable, createField, createModel, database, description, disabled, expandModel, getDefinePermission, getLabelPattern, getModelOptions, group, iconField, imageField, label, labelField, labelPattern, layout, max, min, page, permission, placeholder, readonly, renderer, required, script, step };
413
+ export { ModelOptions, ModelTable, clearable, createField, createModel, database, description, disabled, expandModel, getDefinePermission, getLabelPattern, getModelOptions, group, iconField, imageField, label, labelField, labelPattern, layout, max, min, page, permission, placeholder, readonly, renderer, required, script, step };
package/index.mjs CHANGED
@@ -6,26 +6,6 @@ export * from "imodel"
6
6
  /** @import { FieldDefine, FieldDefineOption, MainFieldType, ToType } from 'imodel' */
7
7
  /** @import { Field } from '@yongdall/types' */
8
8
  /**
9
- * @typedef {Object} FieldDefineExtends
10
- * @property {number} [no] - 字段序号
11
- * @property {string} [label] - 字段的显示标签。
12
- * @property {string} [description] - 字段的详细描述信息,可用于提示或帮助文本。
13
- * @property {string} [placeholder] - 输入框等控件的占位提示文字。
14
- * @property {number} [step] - 数值输入时的步长(如用于 number 类型 input 的 step 属性)。
15
- * @property {number} [max] - 字段允许的最大值(常用于数值或日期类型校验)。
16
- * @property {number} [min] - 字段允许的最小值(常用于数值或日期类型校验)。
17
- * @property {boolean} [readonly] - 是否只读,用户可聚焦但不可修改内容。
18
- * @property {boolean} [required] - 是否为必填项,用于表单验证。
19
- * @property {boolean} [clearable] - 是否支持清空操作(如带“×”按钮的输入框或选择器)。
20
- * @property {boolean} [disabled] - 是否禁用,禁用状态下用户无法交互且通常视觉上置灰。
21
- * @property {string} [group] - 字段所属的逻辑分组名称,用于权限分组。
22
- * @property {number} [layoutOrder] - 布局顺序
23
- * @property {({component: string; values?: any[]; [k: string]: any} | string)[] | {component: string; values?: any[]; [k: string]: any} | string} [renderer] - 渲染器配置数组
24
- * @property {(string | [string, object])[]} [scripts] - 脚本列表,可以是字符串或 [脚本名, 配置对象] 的元组
25
- * @property {Field.Layout} [layout] - 布局信息
26
- * @property {string} [model] - 关联模型
27
- */
28
- /**
29
9
  * @template {MainFieldType} T
30
10
  * @overload
31
11
  * @param {T} type
@@ -33,7 +13,7 @@ export * from "imodel"
33
13
  * nullable?: false;
34
14
  * array?: false;
35
15
  * default?: ToType<T, false, false> | symbol;
36
- * } & FieldDefineOption & FieldDefineExtends} [options]
16
+ * } & FieldDefineOption & Field.Extends} [options]
37
17
  * @returns {FieldDefine<T, false, false>}
38
18
  */
39
19
  /**
@@ -44,7 +24,7 @@ export * from "imodel"
44
24
  * nullable?: false;
45
25
  * array: true;
46
26
  * default?: ToType<T, true, false> | symbol;
47
- * } & FieldDefineOption & FieldDefineExtends} options
27
+ * } & FieldDefineOption & Field.Extends} options
48
28
  * @returns {FieldDefine<T, true, false>}
49
29
  */
50
30
  /**
@@ -55,7 +35,7 @@ export * from "imodel"
55
35
  * nullable: true;
56
36
  * array?: false;
57
37
  * default?: ToType<T, false, true> | symbol;
58
- * } & FieldDefineOption & FieldDefineExtends} options
38
+ * } & FieldDefineOption & Field.Extends} options
59
39
  * @returns {FieldDefine<T, false, true>}
60
40
  */
61
41
  /**
@@ -66,7 +46,7 @@ export * from "imodel"
66
46
  * nullable: true;
67
47
  * array: true;
68
48
  * default?: ToType<T, true, true> | symbol;
69
- * } & FieldDefineOption & FieldDefineExtends} options
49
+ * } & FieldDefineOption & Field.Extends} options
70
50
  * @returns {FieldDefine<T, true, true>}
71
51
  */
72
52
  /**
@@ -78,7 +58,7 @@ export * from "imodel"
78
58
  * nullable: true;
79
59
  * array: A;
80
60
  * default?: ToType<T, A, true> | symbol;
81
- * } & FieldDefineOption & FieldDefineExtends} options
61
+ * } & FieldDefineOption & Field.Extends} options
82
62
  * @returns {FieldDefine<T, A, true>}
83
63
  */
84
64
  /**
@@ -90,7 +70,7 @@ export * from "imodel"
90
70
  * nullable?: false;
91
71
  * array: A;
92
72
  * default?: ToType<T, A, false> | symbol;
93
- * } & FieldDefineOption & FieldDefineExtends} options
73
+ * } & FieldDefineOption & Field.Extends} options
94
74
  * @returns {FieldDefine<T, A, false>}
95
75
  */
96
76
  /**
@@ -102,7 +82,7 @@ export * from "imodel"
102
82
  * nullable: N;
103
83
  * array?: false;
104
84
  * default?: ToType<T, false, N> | symbol;
105
- * } & FieldDefineOption & FieldDefineExtends} options
85
+ * } & FieldDefineOption & Field.Extends} options
106
86
  * @returns {FieldDefine<T, false, N>}
107
87
  */
108
88
  /**
@@ -114,7 +94,7 @@ export * from "imodel"
114
94
  * nullable: N;
115
95
  * array: true;
116
96
  * default?: ToType<T, true, N> | symbol;
117
- * } & FieldDefineOption & FieldDefineExtends} options
97
+ * } & FieldDefineOption & Field.Extends} options
118
98
  * @returns {FieldDefine<T, true, N>}
119
99
  */
120
100
  /**
@@ -127,7 +107,7 @@ export * from "imodel"
127
107
  * nullable: N;
128
108
  * array: A;
129
109
  * default?: ToType<T, A, N> | symbol;
130
- * } & FieldDefineOption & FieldDefineExtends} options
110
+ * } & FieldDefineOption & Field.Extends} options
131
111
  * @returns {FieldDefine<T, A, N>}
132
112
  */
133
113
  /**
@@ -138,7 +118,7 @@ export * from "imodel"
138
118
  * nullable?: boolean;
139
119
  * array?: boolean;
140
120
  * default?: ToType<T, boolean, boolean> | symbol;
141
- * } & FieldDefineOption & FieldDefineExtends} options
121
+ * } & FieldDefineOption & Field.Extends} options
142
122
  * @returns {FieldDefine<T, boolean, boolean>}
143
123
  */
144
124
  /**
package/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../packages/model/createField.mjs","../../packages/model/metadata.mjs","../../packages/model/createModel.mjs","../../packages/model/decorators.mjs","../../packages/model/expandModel.mjs","../../packages/model/get.mjs"],"sourcesContent":["/** @import { FieldDefine, FieldDefineOption, MainFieldType, ToType } from 'imodel' */\n/** @import { Field } from '@yongdall/types' */\nimport { define } from 'imodel';\n\n\n/**\n * @typedef {Object} FieldDefineExtends\n * @property {number} [no] - 字段序号\n * @property {string} [label] - 字段的显示标签。\n * @property {string} [description] - 字段的详细描述信息,可用于提示或帮助文本。\n * @property {string} [placeholder] - 输入框等控件的占位提示文字。\n * @property {number} [step] - 数值输入时的步长(如用于 number 类型 input 的 step 属性)。\n * @property {number} [max] - 字段允许的最大值(常用于数值或日期类型校验)。\n * @property {number} [min] - 字段允许的最小值(常用于数值或日期类型校验)。\n * @property {boolean} [readonly] - 是否只读,用户可聚焦但不可修改内容。\n * @property {boolean} [required] - 是否为必填项,用于表单验证。\n * @property {boolean} [clearable] - 是否支持清空操作(如带“×”按钮的输入框或选择器)。\n * @property {boolean} [disabled] - 是否禁用,禁用状态下用户无法交互且通常视觉上置灰。\n * @property {string} [group] - 字段所属的逻辑分组名称,用于权限分组。\n * @property {number} [layoutOrder] - 布局顺序\n * @property {({component: string; values?: any[]; [k: string]: any} | string)[] | {component: string; values?: any[]; [k: string]: any} | string} [renderer] - 渲染器配置数组\n * @property {(string | [string, object])[]} [scripts] - 脚本列表,可以是字符串或 [脚本名, 配置对象] 的元组\n * @property {Field.Layout} [layout] - 布局信息\n * @property {string} [model] - 关联模型\n */\n\n/**\n * @template {MainFieldType} T\n * @overload\n * @param {T} type\n * @param {{\n * \tnullable?: false;\n * \tarray?: false;\n * \tdefault?: ToType<T, false, false> | symbol;\n * } & FieldDefineOption & FieldDefineExtends} [options]\n * @returns {FieldDefine<T, false, false>}\n */\n/**\n * @template {MainFieldType} T\n * @overload\n * @param {T} type\n * @param {{\n * \tnullable?: false;\n * \tarray: true;\n * \tdefault?: ToType<T, true, false> | symbol;\n * } & FieldDefineOption & FieldDefineExtends} options\n * @returns {FieldDefine<T, true, false>}\n */\n\n/**\n * @template {MainFieldType} T\n * @overload\n * @param {T} type\n * @param {{\n * \tnullable: true;\n * \tarray?: false;\n * \tdefault?: ToType<T, false, true> | symbol;\n * } & FieldDefineOption & FieldDefineExtends} options\n * @returns {FieldDefine<T, false, true>}\n */\n/**\n * @template {MainFieldType} T\n * @overload\n * @param {T} type\n * @param {{\n * \tnullable: true;\n * \tarray: true;\n * \tdefault?: ToType<T, true, true> | symbol;\n * } & FieldDefineOption & FieldDefineExtends} options\n * @returns {FieldDefine<T, true, true>}\n */\n\n/**\n * @template {MainFieldType} T\n * @template {boolean} A\n * @overload\n * @param {T} type\n * @param {{\n * \tnullable: true;\n * \tarray: A;\n * \tdefault?: ToType<T, A, true> | symbol;\n * } & FieldDefineOption & FieldDefineExtends} options\n * @returns {FieldDefine<T, A, true>}\n */\n/**\n * @template {MainFieldType} T\n * @template {boolean} A\n * @overload\n * @param {T} type\n * @param {{\n * \tnullable?: false;\n * \tarray: A;\n * \tdefault?: ToType<T, A, false> | symbol;\n * } & FieldDefineOption & FieldDefineExtends} options\n * @returns {FieldDefine<T, A, false>}\n */\n\n/**\n * @template {MainFieldType} T\n * @template {boolean} N\n * @overload\n * @param {T} type\n * @param {{\n * \tnullable: N;\n * \tarray?: false;\n * \tdefault?: ToType<T, false, N> | symbol;\n * } & FieldDefineOption & FieldDefineExtends} options\n * @returns {FieldDefine<T, false, N>}\n */\n/**\n * @template {MainFieldType} T\n * @template {boolean} N\n * @overload\n * @param {T} type\n * @param {{\n * \tnullable: N;\n * \tarray: true;\n * \tdefault?: ToType<T, true, N> | symbol;\n * } & FieldDefineOption & FieldDefineExtends} options\n * @returns {FieldDefine<T, true, N>}\n */\n\n/**\n * @template {MainFieldType} T\n * @template {boolean} A\n * @template {boolean} N\n * @overload\n * @param {T} type\n * @param {{\n * \tnullable: N;\n * \tarray: A;\n * \tdefault?: ToType<T, A, N> | symbol;\n * } & FieldDefineOption & FieldDefineExtends} options\n * @returns {FieldDefine<T, A, N>}\n */\n\n/**\n * @template {MainFieldType} T\n * @overload\n * @param {T} type\n * @param {{\n * \tnullable?: boolean;\n * \tarray?: boolean;\n * \tdefault?: ToType<T, boolean, boolean> | symbol;\n * } & FieldDefineOption & FieldDefineExtends} options\n * @returns {FieldDefine<T, boolean, boolean>}\n */\n\n/**\n * @param {MainFieldType} type\n * @param {any} [options]\n * @returns {any}\n */\nexport function createField(type, options) {\n\treturn define(type, options)\n}\n","/** @import { ModelOptions } from './createModel.mjs' */\nconst KEY = Symbol();\n/**\n * \n * @param {any} metadata \n * @returns {Omit<ModelOptions, 'pseudo' | 'indexes' | 'hooks' | 'databaseId'>}\n */\nexport function getMetadataExpand(metadata) {\n\treturn metadata[KEY] ||= {};\n}\n/**\n * \n * @param {any} model \n * @returns {Omit<ModelOptions, 'pseudo' | 'indexes' | 'hooks' | 'databaseId'>}\n */\nexport function getExpandMetadata(model) {\n\tif (!model) { return {}; }\n\tif (typeof model !== 'function' && typeof model !== 'object') { return {}; }\n\treturn getMetadataExpand(model[Symbol.metadata] ||= {});\n}\n/**\n * @template T\n * @param {T} model \n * @param {any} options \n * @returns {T}\n */\nexport function setExpandMetadata(model, options) {\n\tif (!model) { return model; }\n\tif (typeof model !== 'function' && typeof model !== 'object') { return model; }\n\t// @ts-ignore\n\tconst metadata = model[Symbol.metadata] ||= {};\n\tmetadata[KEY] ||= options;\n\treturn model;\n}\n","/** @import { Fields, Hooks, IndexInfo, VirtualTable, TableDefine } from 'imodel' */\n/** @import { Permission } from '@yongdall/types' */\n\n/**\n * 表定义配置接口\n * @typedef {Object} ModelOptions\n * @property {string} [pseudo] - 是否启用软删除\n * @property {IndexInfo[]} [indexes] - 索引信息\n * @property {Partial<Hooks>} [hooks] - 钩子函数集合\n * @property {string?} [databaseId] 权限配置\n * @property {string?} [label] \n * @property {string?} [iconField] 图标字段\n * @property {string?} [imageField] 图像字段\n * @property {string?} [labelField] 标签字段\n * @property {string?} [labelPattern] 标签命名规则\n * @property {Permission[]} [permissions] 权限配置\n * @property {(string | [string, object])[] | null} [scripts] 关联前端脚本\n * @property {Record<string, string | object | null> | null} [pages] 关联默认页面\n */\n/**\n * @template {Fields} [T=Fields]\n * @template {string | VirtualTable | undefined} [TT=string | VirtualTable | undefined]\n * @typedef {TableDefine<T, TT> & {databaseId?: string?}} ModelTable\n */\nimport { setExpandMetadata } from './metadata.mjs';\n\n/**\n * \n * @template {string | VirtualTable} [TT=string | VirtualTable]\n * @template {Fields} [TF=Fields]\n * @param {TT} table \n * @param {TF} fields \n * @param {ModelOptions} [options] \n * @returns {ModelTable<TF, TT>}\n */\nexport function createModel(table, fields, {pseudo, indexes, hooks, databaseId, ...options} = {}) {\n\treturn setExpandMetadata({\n\t\ttable, fields, pseudo, indexes, hooks, databaseId,\n\t}, options);\n}\n","/** @import { ClassDecorator, FieldDecorator } from 'imodel' */\n/** @import { Permission } from '@yongdall/types' */\n/** @import { Field } from '@yongdall/types' */\n/** @import { ModelOptions } from './createModel.mjs' */\nimport { prop } from 'imodel';\nimport { getMetadataExpand } from './metadata.mjs';\n\n/**\n * @template {Exclude<keyof ModelOptions, \"pseudo\" | \"indexes\" | \"hooks\" | 'databaseId'>} T\n * @param {T} key\n * @param {ModelOptions[T]} value\n * @returns {ClassDecorator}\n */\nfunction modelOption(key, value) {\n\treturn (v, c) => {\n\t\tif (c.kind === 'class') {\n\t\t\tgetMetadataExpand(c.metadata)[key] = value;\n\t\t}\n\t};\n\n}\n\n/** @param {string} value */\nexport function imageField(value) {\n\treturn modelOption('imageField', value);\n}\n\n/** @param {string} value */\nexport function iconField(value) {\n\treturn modelOption('iconField', value);\n}\n\n/** @param {string} value */\nexport function labelField(value) {\n\treturn modelOption('labelField', value);\n}\n/** @param {string} value */\nexport function labelPattern(value) {\n\treturn modelOption('labelPattern', value);\n}\n\n/**\n * @param {string?} value\n * @returns {ClassDecorator}\n */\nexport function database(value) {\n\treturn (Model, ctx) => {\n\t\tif (ctx.kind !== 'class') { return; }\n\t\tctx.addInitializer(function () {\n\t\t\tObject.defineProperty(this, 'databaseId', {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue,\n\t\t\t});\n\t\t});\n\t};\n}\n\n/**\n * \n * @overload\n * @param {Record<string, string | object | boolean>} pages \n * @returns {FieldDecorator<any> & ClassDecorator}\n */\n/**\n * \n * @overload\n * @param {string} page \n * @param {string | object | null} widget \n * @returns {FieldDecorator<any> & ClassDecorator}\n */\n/**\n * \n * @overload\n * @param {string | Record<string, string | object | boolean>} page \n * @param {string | object | null} [widget] \n * @returns {FieldDecorator<any> & ClassDecorator}\n */\n/**\n * \n * @param {string | Record<string, string | object | boolean>} page \n * @param {string | object | null} [widget] \n * @returns {FieldDecorator<any> & ClassDecorator}\n */\nexport function page(page, widget) {\n\tif (page && typeof page === 'object') {\n\t\t/** @type {string | [string, object]} */\n\t\treturn (Model, ctx) => {\n\t\t\tif (ctx.kind !== 'class') { return; }\n\t\t\tconst pages = getMetadataExpand(ctx.metadata).pages ||= {};\n\t\t\tObject.assign(pages, page);\n\t\t};\n\t}\n\t/** @type {string | [string, object]} */\n\treturn (Model, ctx) => {\n\t\tif (ctx.kind !== 'class') { return; }\n\t\tconst pages = getMetadataExpand(ctx.metadata).pages ||= {};\n\t\tpages[page] = widget ?? null;\n\t};\n}\n\n/**\n * \n * @param {...Permission | Permission[]} permissions \n * @returns {ClassDecorator}\n */\nexport function permission(...permissions) {\n\tconst allPermissions = permissions.flat();\n\treturn (Model, ctx) => {\n\t\tif (!allPermissions.length) { return; }\n\n\t\tconst list = getMetadataExpand(ctx.metadata).permissions ||= [];\n\t\tfor (const p of allPermissions) {\n\t\t\tlist.push(p);\n\t\t}\n\t};\n}\n\n\n\n/**\n * \n * @param {string} label \n * @returns {FieldDecorator<any> & ClassDecorator}\n */\nexport function label(label) {\n\treturn (v, c) => {\n\t\tif (c.kind === 'class') {\n\t\t\tgetMetadataExpand(c.metadata).label = label;\n\t\t} else {\n\t\t\t// @ts-ignore\n\t\t\treturn prop('label', label)(v, c);\n\t\t}\n\t};\n}\n\n/**\n * \n * @param {string} script \n * @param {Record<string, any>} [options] \n * @returns {FieldDecorator<any> & ClassDecorator}\n */\nexport function script(script, options) {\n\t/** @type {string | [string, object]} */\n\tconst item = options && typeof options === 'object' ? [script, options] : script;\n\treturn (Model, ctx) => {\n\t\tif (ctx.kind === 'class') {\n\t\t\tconst list = getMetadataExpand(ctx.metadata).scripts ||= [];\n\t\t\tlist.push(item);\n\t\t} else {\n\t\t\t// @ts-ignore\n\t\t\treturn prop('scripts', item, true)(Model, ctx);\n\t\t}\n\t};\n}\n\n\n/**\n * \n * @param {string} component\n * @param {Record<string, any> | any[]} [options] \n * @returns {FieldDecorator<any>}\n */\nexport function renderer(component, options) {\n\tif (component && typeof component === 'string') {\n\t\tif (Array.isArray(options)) {\n\t\t\treturn prop('renderer', { values: options, component }, true);\n\t\t} else if (options && typeof options === 'object') {\n\t\t\treturn prop('renderer', { ...options, component }, true);\n\t\t} else {\n\t\t\treturn prop('renderer', { component }, true);\n\t\t}\n\t}\n\tthrow new Error(`无效的渲染组件名: ${component}`);\n}\n\n/**\n * \n * @param {Field.Layout} layout\n * @returns {FieldDecorator<any>}\n */\nexport function layout(layout) {\n\treturn prop('layout', layout);\n}\n\n/**\n * \n * @param {string} group\n * @returns {FieldDecorator<any>}\n */\nexport function group(group) {\n\treturn prop('group', group);\n}\n\n/**\n * \n * @param {string} description\n * @returns {FieldDecorator<any>}\n */\nexport function description(description) {\n\treturn prop('description', description);\n}\n\n/**\n * \n * @param {string} placeholder\n * @returns {FieldDecorator<any>}\n */\nexport function placeholder(placeholder) {\n\treturn prop('placeholder', placeholder);\n}\n\n/**\n * \n * @param {number} step\n * @returns {FieldDecorator<any>}\n */\nexport function step(step) {\n\treturn prop('step', step);\n}\n\n/**\n * \n * @param {number} max\n * @returns {FieldDecorator<any>}\n */\nexport function max(max) {\n\treturn prop('max', max);\n}\n\n/**\n * \n * @param {number} min\n * @returns {FieldDecorator<any>}\n */\nexport function min(min) {\n\treturn prop('min', min);\n}\n\n\n/**\n * \n * @param {boolean} [readonly]\n * @returns {FieldDecorator<any>}\n */\nexport function readonly(readonly) {\n\treturn prop('readonly', typeof readonly === 'boolean' ? readonly : true);\n}\n\n/**\n * \n * @param {boolean} [required]\n * @returns {FieldDecorator<any>}\n */\nexport function required(required) {\n\treturn prop('required', typeof required === 'boolean' ? required : true);\n}\n\n/**\n * \n * @param {boolean} [clearable]\n * @returns {FieldDecorator<any>}\n */\nexport function clearable(clearable) {\n\treturn prop('clearable', typeof clearable === 'boolean' ? clearable : true);\n}\n\n/**\n * \n * @param {boolean} [disabled]\n * @returns {FieldDecorator<any>}\n */\nexport function disabled(disabled) {\n\treturn prop('disabled', typeof disabled === 'boolean' ? disabled : true);\n}\n","/** @import { Fields, TableDefine } from 'imodel' */\n/** @import { ModelTable } from './createModel.mjs' */\n\n\n\n/**\n * \n * @template {Fields<TableDefine>} [TF=Fields<TableDefine>]\n * @param {ModelTable} model \n * @param {TF} fields \n * @returns {ModelTable}\n */\nexport function expandModel(model, fields) {\n\tconst expands = Object.entries(fields).filter(([k, v]) => {\n\t\tif (!v || typeof v !== 'object') { return; }\n\t\tconst type = v.type;\n\t\tif (!type || typeof type !== 'object') { return; }\n\t\treturn type.table;\n\t})\n\tif (!expands.length) { return model; }\n\treturn {\n\t\t...model,\n\t\tdatabaseId: model.databaseId,\n\t\tfields: {\n\t\t\t...model.fields,\n\t\t\t...Object.fromEntries(expands.map(([k,v]) => [`$${k}`, v])),\n\t\t},\n\t\tpseudo: model.pseudo,\n\t\tindexes: model.indexes,\n\t\thooks: model.hooks,\n\t\ttable: model.table,\n\t\t// @ts-ignore\n\t\t[Symbol.metadata]: model[Symbol.metadata],\n\t}\n}\n","import { getExpandMetadata } from './metadata.mjs';\n\n/**\n * \n * @param {any} v \n */\nexport function getModelOptions(v) {\n\tconst metadata = getExpandMetadata(v);\n\treturn {\n\t\tget pages() {\n\t\t\treturn getExpandMetadata(v).pages || null;\n\t\t},\n\t\tget label() {\n\t\t\treturn getExpandMetadata(v).label || '';\n\t\t},\n\t\tget iconField() {\n\t\t\treturn getExpandMetadata(v).iconField || '';\n\t\t},\n\t\tget imageField() {\n\t\t\treturn getExpandMetadata(v).imageField || '';\n\t\t},\n\t\tget labelPattern() {\n\t\t\tconst labelPattern = metadata.labelPattern || v.labelPattern;\n\t\t\tif (labelPattern) { return labelPattern; }\n\t\t\tconst labelField = metadata.labelField || v.labelField;\n\t\t\tif (labelField) {\n\t\t\t\treturn `{${labelField}}`;\n\t\t\t}\n\t\t\treturn '';\n\t\t},\n\t\tget permissions() {\n\t\t\treturn getExpandMetadata(v).permissions || [];\n\t\t},\n\t\tget scripts() {\n\t\t\treturn getExpandMetadata(v).scripts || [];\n\t\t},\n\t\t\n\t};\n\n}\n\n\n/**\n * \n * @param {any} v \n */\nexport function getDefinePermission(v) {\n\treturn getModelOptions(v).permissions;\n}\n\n/**\n * \n * @param {any} v \n */\nexport function getLabelPattern(v) {\n\treturn getModelOptions(v).labelPattern;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyJA,SAAgB,YAAY,MAAM,SAAS;AAC1C,QAAO,OAAO,MAAM,QAAQ;;;;;;ACzJ7B,MAAM,MAAM,QAAQ;;;;;;AAMpB,SAAgB,kBAAkB,UAAU;AAC3C,QAAO,SAAS,SAAS,EAAE;;;;;;;AAO5B,SAAgB,kBAAkB,OAAO;AACxC,KAAI,CAAC,MAAS,QAAO,EAAE;AACvB,KAAI,OAAO,UAAU,cAAc,OAAO,UAAU,SAAY,QAAO,EAAE;AACzE,QAAO,kBAAkB,MAAM,OAAO,cAAc,EAAE,CAAC;;;;;;;;AAQxD,SAAgB,kBAAkB,OAAO,SAAS;AACjD,KAAI,CAAC,MAAS,QAAO;AACrB,KAAI,OAAO,UAAU,cAAc,OAAO,UAAU,SAAY,QAAO;CAEvE,MAAM,WAAW,MAAM,OAAO,cAAc,EAAE;AAC9C,UAAS,SAAS;AAClB,QAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACGR,SAAgB,YAAY,OAAO,QAAQ,EAAC,QAAQ,SAAS,OAAO,YAAY,GAAG,YAAW,EAAE,EAAE;AACjG,QAAO,kBAAkB;EACxB;EAAO;EAAQ;EAAQ;EAAS;EAAO;EACvC,EAAE,QAAQ;;;;;;;;;;;;;;;ACzBZ,SAAS,YAAY,KAAK,OAAO;AAChC,SAAQ,GAAG,MAAM;AAChB,MAAI,EAAE,SAAS,QACd,mBAAkB,EAAE,SAAS,CAAC,OAAO;;;;AAOxC,SAAgB,WAAW,OAAO;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AI,cAAc;AACjB,UAAO,kBAAkB,EAAE,CAAC,eAAe,EAAE;;EAE9C,IAAI,UAAU;AACb,UAAO,kBAAkB,EAAE,CAAC,WAAW,EAAE;;EAG1C;;;;;;AASF,SAAgB,oBAAoB,GAAG;AACtC,QAAO,gBAAgB,EAAE,CAAC;;;;;;AAO3B,SAAgB,gBAAgB,GAAG;AAClC,QAAO,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../packages/model/createField.mjs","../../packages/model/metadata.mjs","../../packages/model/createModel.mjs","../../packages/model/decorators.mjs","../../packages/model/expandModel.mjs","../../packages/model/get.mjs"],"sourcesContent":["/** @import { FieldDefine, FieldDefineOption, MainFieldType, ToType } from 'imodel' */\n/** @import { Field } from '@yongdall/types' */\nimport { define } from 'imodel';\n\n\n/**\n * @template {MainFieldType} T\n * @overload\n * @param {T} type\n * @param {{\n * \tnullable?: false;\n * \tarray?: false;\n * \tdefault?: ToType<T, false, false> | symbol;\n * } & FieldDefineOption & Field.Extends} [options]\n * @returns {FieldDefine<T, false, false>}\n */\n/**\n * @template {MainFieldType} T\n * @overload\n * @param {T} type\n * @param {{\n * \tnullable?: false;\n * \tarray: true;\n * \tdefault?: ToType<T, true, false> | symbol;\n * } & FieldDefineOption & Field.Extends} options\n * @returns {FieldDefine<T, true, false>}\n */\n\n/**\n * @template {MainFieldType} T\n * @overload\n * @param {T} type\n * @param {{\n * \tnullable: true;\n * \tarray?: false;\n * \tdefault?: ToType<T, false, true> | symbol;\n * } & FieldDefineOption & Field.Extends} options\n * @returns {FieldDefine<T, false, true>}\n */\n/**\n * @template {MainFieldType} T\n * @overload\n * @param {T} type\n * @param {{\n * \tnullable: true;\n * \tarray: true;\n * \tdefault?: ToType<T, true, true> | symbol;\n * } & FieldDefineOption & Field.Extends} options\n * @returns {FieldDefine<T, true, true>}\n */\n\n/**\n * @template {MainFieldType} T\n * @template {boolean} A\n * @overload\n * @param {T} type\n * @param {{\n * \tnullable: true;\n * \tarray: A;\n * \tdefault?: ToType<T, A, true> | symbol;\n * } & FieldDefineOption & Field.Extends} options\n * @returns {FieldDefine<T, A, true>}\n */\n/**\n * @template {MainFieldType} T\n * @template {boolean} A\n * @overload\n * @param {T} type\n * @param {{\n * \tnullable?: false;\n * \tarray: A;\n * \tdefault?: ToType<T, A, false> | symbol;\n * } & FieldDefineOption & Field.Extends} options\n * @returns {FieldDefine<T, A, false>}\n */\n\n/**\n * @template {MainFieldType} T\n * @template {boolean} N\n * @overload\n * @param {T} type\n * @param {{\n * \tnullable: N;\n * \tarray?: false;\n * \tdefault?: ToType<T, false, N> | symbol;\n * } & FieldDefineOption & Field.Extends} options\n * @returns {FieldDefine<T, false, N>}\n */\n/**\n * @template {MainFieldType} T\n * @template {boolean} N\n * @overload\n * @param {T} type\n * @param {{\n * \tnullable: N;\n * \tarray: true;\n * \tdefault?: ToType<T, true, N> | symbol;\n * } & FieldDefineOption & Field.Extends} options\n * @returns {FieldDefine<T, true, N>}\n */\n\n/**\n * @template {MainFieldType} T\n * @template {boolean} A\n * @template {boolean} N\n * @overload\n * @param {T} type\n * @param {{\n * \tnullable: N;\n * \tarray: A;\n * \tdefault?: ToType<T, A, N> | symbol;\n * } & FieldDefineOption & Field.Extends} options\n * @returns {FieldDefine<T, A, N>}\n */\n\n/**\n * @template {MainFieldType} T\n * @overload\n * @param {T} type\n * @param {{\n * \tnullable?: boolean;\n * \tarray?: boolean;\n * \tdefault?: ToType<T, boolean, boolean> | symbol;\n * } & FieldDefineOption & Field.Extends} options\n * @returns {FieldDefine<T, boolean, boolean>}\n */\n\n/**\n * @param {MainFieldType} type\n * @param {any} [options]\n * @returns {any}\n */\nexport function createField(type, options) {\n\treturn define(type, options)\n}\n","/** @import { ModelOptions } from './createModel.mjs' */\nconst KEY = Symbol();\n/**\n * \n * @param {any} metadata \n * @returns {Omit<ModelOptions, 'pseudo' | 'indexes' | 'hooks' | 'databaseId'>}\n */\nexport function getMetadataExpand(metadata) {\n\treturn metadata[KEY] ||= {};\n}\n/**\n * \n * @param {any} model \n * @returns {Omit<ModelOptions, 'pseudo' | 'indexes' | 'hooks' | 'databaseId'>}\n */\nexport function getExpandMetadata(model) {\n\tif (!model) { return {}; }\n\tif (typeof model !== 'function' && typeof model !== 'object') { return {}; }\n\treturn getMetadataExpand(model[Symbol.metadata] ||= {});\n}\n/**\n * @template T\n * @param {T} model \n * @param {any} options \n * @returns {T}\n */\nexport function setExpandMetadata(model, options) {\n\tif (!model) { return model; }\n\tif (typeof model !== 'function' && typeof model !== 'object') { return model; }\n\t// @ts-ignore\n\tconst metadata = model[Symbol.metadata] ||= {};\n\tmetadata[KEY] ||= options;\n\treturn model;\n}\n","/** @import { Fields, Hooks, IndexInfo, VirtualTable, TableDefine } from 'imodel' */\n/** @import { Permission } from '@yongdall/types' */\n\n/**\n * 表定义配置接口\n * @typedef {Object} ModelOptions\n * @property {string} [pseudo] - 是否启用软删除\n * @property {IndexInfo[]} [indexes] - 索引信息\n * @property {Partial<Hooks>} [hooks] - 钩子函数集合\n * @property {string?} [databaseId] 权限配置\n * @property {string?} [label] \n * @property {string?} [iconField] 图标字段\n * @property {string?} [imageField] 图像字段\n * @property {string?} [labelField] 标签字段\n * @property {string?} [labelPattern] 标签命名规则\n * @property {Permission[]} [permissions] 权限配置\n * @property {(string | [string, object])[] | null} [scripts] 关联前端脚本\n * @property {Record<string, string | object | null> | null} [pages] 关联默认页面\n */\n/**\n * @template {Fields} [T=Fields]\n * @template {string | VirtualTable | undefined} [TT=string | VirtualTable | undefined]\n * @typedef {TableDefine<T, TT> & {databaseId?: string?}} ModelTable\n */\nimport { setExpandMetadata } from './metadata.mjs';\n\n/**\n * \n * @template {string | VirtualTable} [TT=string | VirtualTable]\n * @template {Fields} [TF=Fields]\n * @param {TT} table \n * @param {TF} fields \n * @param {ModelOptions} [options] \n * @returns {ModelTable<TF, TT>}\n */\nexport function createModel(table, fields, {pseudo, indexes, hooks, databaseId, ...options} = {}) {\n\treturn setExpandMetadata({\n\t\ttable, fields, pseudo, indexes, hooks, databaseId,\n\t}, options);\n}\n","/** @import { ClassDecorator, FieldDecorator } from 'imodel' */\n/** @import { Permission } from '@yongdall/types' */\n/** @import { Field } from '@yongdall/types' */\n/** @import { ModelOptions } from './createModel.mjs' */\nimport { prop } from 'imodel';\nimport { getMetadataExpand } from './metadata.mjs';\n\n/**\n * @template {Exclude<keyof ModelOptions, \"pseudo\" | \"indexes\" | \"hooks\" | 'databaseId'>} T\n * @param {T} key\n * @param {ModelOptions[T]} value\n * @returns {ClassDecorator}\n */\nfunction modelOption(key, value) {\n\treturn (v, c) => {\n\t\tif (c.kind === 'class') {\n\t\t\tgetMetadataExpand(c.metadata)[key] = value;\n\t\t}\n\t};\n\n}\n\n/** @param {string} value */\nexport function imageField(value) {\n\treturn modelOption('imageField', value);\n}\n\n/** @param {string} value */\nexport function iconField(value) {\n\treturn modelOption('iconField', value);\n}\n\n/** @param {string} value */\nexport function labelField(value) {\n\treturn modelOption('labelField', value);\n}\n/** @param {string} value */\nexport function labelPattern(value) {\n\treturn modelOption('labelPattern', value);\n}\n\n/**\n * @param {string?} value\n * @returns {ClassDecorator}\n */\nexport function database(value) {\n\treturn (Model, ctx) => {\n\t\tif (ctx.kind !== 'class') { return; }\n\t\tctx.addInitializer(function () {\n\t\t\tObject.defineProperty(this, 'databaseId', {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue,\n\t\t\t});\n\t\t});\n\t};\n}\n\n/**\n * \n * @overload\n * @param {Record<string, string | object | boolean>} pages \n * @returns {FieldDecorator<any> & ClassDecorator}\n */\n/**\n * \n * @overload\n * @param {string} page \n * @param {string | object | null} widget \n * @returns {FieldDecorator<any> & ClassDecorator}\n */\n/**\n * \n * @overload\n * @param {string | Record<string, string | object | boolean>} page \n * @param {string | object | null} [widget] \n * @returns {FieldDecorator<any> & ClassDecorator}\n */\n/**\n * \n * @param {string | Record<string, string | object | boolean>} page \n * @param {string | object | null} [widget] \n * @returns {FieldDecorator<any> & ClassDecorator}\n */\nexport function page(page, widget) {\n\tif (page && typeof page === 'object') {\n\t\t/** @type {string | [string, object]} */\n\t\treturn (Model, ctx) => {\n\t\t\tif (ctx.kind !== 'class') { return; }\n\t\t\tconst pages = getMetadataExpand(ctx.metadata).pages ||= {};\n\t\t\tObject.assign(pages, page);\n\t\t};\n\t}\n\t/** @type {string | [string, object]} */\n\treturn (Model, ctx) => {\n\t\tif (ctx.kind !== 'class') { return; }\n\t\tconst pages = getMetadataExpand(ctx.metadata).pages ||= {};\n\t\tpages[page] = widget ?? null;\n\t};\n}\n\n/**\n * \n * @param {...Permission | Permission[]} permissions \n * @returns {ClassDecorator}\n */\nexport function permission(...permissions) {\n\tconst allPermissions = permissions.flat();\n\treturn (Model, ctx) => {\n\t\tif (!allPermissions.length) { return; }\n\n\t\tconst list = getMetadataExpand(ctx.metadata).permissions ||= [];\n\t\tfor (const p of allPermissions) {\n\t\t\tlist.push(p);\n\t\t}\n\t};\n}\n\n\n\n/**\n * \n * @param {string} label \n * @returns {FieldDecorator<any> & ClassDecorator}\n */\nexport function label(label) {\n\treturn (v, c) => {\n\t\tif (c.kind === 'class') {\n\t\t\tgetMetadataExpand(c.metadata).label = label;\n\t\t} else {\n\t\t\t// @ts-ignore\n\t\t\treturn prop('label', label)(v, c);\n\t\t}\n\t};\n}\n\n/**\n * \n * @param {string} script \n * @param {Record<string, any>} [options] \n * @returns {FieldDecorator<any> & ClassDecorator}\n */\nexport function script(script, options) {\n\t/** @type {string | [string, object]} */\n\tconst item = options && typeof options === 'object' ? [script, options] : script;\n\treturn (Model, ctx) => {\n\t\tif (ctx.kind === 'class') {\n\t\t\tconst list = getMetadataExpand(ctx.metadata).scripts ||= [];\n\t\t\tlist.push(item);\n\t\t} else {\n\t\t\t// @ts-ignore\n\t\t\treturn prop('scripts', item, true)(Model, ctx);\n\t\t}\n\t};\n}\n\n\n/**\n * \n * @param {string} component\n * @param {Record<string, any> | any[]} [options] \n * @returns {FieldDecorator<any>}\n */\nexport function renderer(component, options) {\n\tif (component && typeof component === 'string') {\n\t\tif (Array.isArray(options)) {\n\t\t\treturn prop('renderer', { values: options, component }, true);\n\t\t} else if (options && typeof options === 'object') {\n\t\t\treturn prop('renderer', { ...options, component }, true);\n\t\t} else {\n\t\t\treturn prop('renderer', { component }, true);\n\t\t}\n\t}\n\tthrow new Error(`无效的渲染组件名: ${component}`);\n}\n\n/**\n * \n * @param {Field.Layout} layout\n * @returns {FieldDecorator<any>}\n */\nexport function layout(layout) {\n\treturn prop('layout', layout);\n}\n\n/**\n * \n * @param {string} group\n * @returns {FieldDecorator<any>}\n */\nexport function group(group) {\n\treturn prop('group', group);\n}\n\n/**\n * \n * @param {string} description\n * @returns {FieldDecorator<any>}\n */\nexport function description(description) {\n\treturn prop('description', description);\n}\n\n/**\n * \n * @param {string} placeholder\n * @returns {FieldDecorator<any>}\n */\nexport function placeholder(placeholder) {\n\treturn prop('placeholder', placeholder);\n}\n\n/**\n * \n * @param {number} step\n * @returns {FieldDecorator<any>}\n */\nexport function step(step) {\n\treturn prop('step', step);\n}\n\n/**\n * \n * @param {number} max\n * @returns {FieldDecorator<any>}\n */\nexport function max(max) {\n\treturn prop('max', max);\n}\n\n/**\n * \n * @param {number} min\n * @returns {FieldDecorator<any>}\n */\nexport function min(min) {\n\treturn prop('min', min);\n}\n\n\n/**\n * \n * @param {boolean} [readonly]\n * @returns {FieldDecorator<any>}\n */\nexport function readonly(readonly) {\n\treturn prop('readonly', typeof readonly === 'boolean' ? readonly : true);\n}\n\n/**\n * \n * @param {boolean} [required]\n * @returns {FieldDecorator<any>}\n */\nexport function required(required) {\n\treturn prop('required', typeof required === 'boolean' ? required : true);\n}\n\n/**\n * \n * @param {boolean} [clearable]\n * @returns {FieldDecorator<any>}\n */\nexport function clearable(clearable) {\n\treturn prop('clearable', typeof clearable === 'boolean' ? clearable : true);\n}\n\n/**\n * \n * @param {boolean} [disabled]\n * @returns {FieldDecorator<any>}\n */\nexport function disabled(disabled) {\n\treturn prop('disabled', typeof disabled === 'boolean' ? disabled : true);\n}\n","/** @import { Fields, TableDefine } from 'imodel' */\n/** @import { ModelTable } from './createModel.mjs' */\n\n\n\n/**\n * \n * @template {Fields<TableDefine>} [TF=Fields<TableDefine>]\n * @param {ModelTable} model \n * @param {TF} fields \n * @returns {ModelTable}\n */\nexport function expandModel(model, fields) {\n\tconst expands = Object.entries(fields).filter(([k, v]) => {\n\t\tif (!v || typeof v !== 'object') { return; }\n\t\tconst type = v.type;\n\t\tif (!type || typeof type !== 'object') { return; }\n\t\treturn type.table;\n\t})\n\tif (!expands.length) { return model; }\n\treturn {\n\t\t...model,\n\t\tdatabaseId: model.databaseId,\n\t\tfields: {\n\t\t\t...model.fields,\n\t\t\t...Object.fromEntries(expands.map(([k,v]) => [`$${k}`, v])),\n\t\t},\n\t\tpseudo: model.pseudo,\n\t\tindexes: model.indexes,\n\t\thooks: model.hooks,\n\t\ttable: model.table,\n\t\t// @ts-ignore\n\t\t[Symbol.metadata]: model[Symbol.metadata],\n\t}\n}\n","import { getExpandMetadata } from './metadata.mjs';\n\n/**\n * \n * @param {any} v \n */\nexport function getModelOptions(v) {\n\tconst metadata = getExpandMetadata(v);\n\treturn {\n\t\tget pages() {\n\t\t\treturn getExpandMetadata(v).pages || null;\n\t\t},\n\t\tget label() {\n\t\t\treturn getExpandMetadata(v).label || '';\n\t\t},\n\t\tget iconField() {\n\t\t\treturn getExpandMetadata(v).iconField || '';\n\t\t},\n\t\tget imageField() {\n\t\t\treturn getExpandMetadata(v).imageField || '';\n\t\t},\n\t\tget labelPattern() {\n\t\t\tconst labelPattern = metadata.labelPattern || v.labelPattern;\n\t\t\tif (labelPattern) { return labelPattern; }\n\t\t\tconst labelField = metadata.labelField || v.labelField;\n\t\t\tif (labelField) {\n\t\t\t\treturn `{${labelField}}`;\n\t\t\t}\n\t\t\treturn '';\n\t\t},\n\t\tget permissions() {\n\t\t\treturn getExpandMetadata(v).permissions || [];\n\t\t},\n\t\tget scripts() {\n\t\t\treturn getExpandMetadata(v).scripts || [];\n\t\t},\n\t\t\n\t};\n\n}\n\n\n/**\n * \n * @param {any} v \n */\nexport function getDefinePermission(v) {\n\treturn getModelOptions(v).permissions;\n}\n\n/**\n * \n * @param {any} v \n */\nexport function getLabelPattern(v) {\n\treturn getModelOptions(v).labelPattern;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoIA,SAAgB,YAAY,MAAM,SAAS;AAC1C,QAAO,OAAO,MAAM,QAAQ;;;;;;ACpI7B,MAAM,MAAM,QAAQ;;;;;;AAMpB,SAAgB,kBAAkB,UAAU;AAC3C,QAAO,SAAS,SAAS,EAAE;;;;;;;AAO5B,SAAgB,kBAAkB,OAAO;AACxC,KAAI,CAAC,MAAS,QAAO,EAAE;AACvB,KAAI,OAAO,UAAU,cAAc,OAAO,UAAU,SAAY,QAAO,EAAE;AACzE,QAAO,kBAAkB,MAAM,OAAO,cAAc,EAAE,CAAC;;;;;;;;AAQxD,SAAgB,kBAAkB,OAAO,SAAS;AACjD,KAAI,CAAC,MAAS,QAAO;AACrB,KAAI,OAAO,UAAU,cAAc,OAAO,UAAU,SAAY,QAAO;CAEvE,MAAM,WAAW,MAAM,OAAO,cAAc,EAAE;AAC9C,UAAS,SAAS;AAClB,QAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACGR,SAAgB,YAAY,OAAO,QAAQ,EAAC,QAAQ,SAAS,OAAO,YAAY,GAAG,YAAW,EAAE,EAAE;AACjG,QAAO,kBAAkB;EACxB;EAAO;EAAQ;EAAQ;EAAS;EAAO;EACvC,EAAE,QAAQ;;;;;;;;;;;;;;;ACzBZ,SAAS,YAAY,KAAK,OAAO;AAChC,SAAQ,GAAG,MAAM;AAChB,MAAI,EAA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SAAS,cAAc,EAAE;AAC5C,OAAI,WACH,QAAO,IAAI,WAAW;AAEvB,UAAO;;EAER,IAAI,cAAc;AACjB,UAAO,kBAAkB,EAAE,CAAC,eAAe,EAAE;;EAE9C,IAAI,UAAU;AACb,UAAO,kBAAkB,EAAE,CAAC,WAAW,EAAE;;EAG1C;;;;;;AASF,SAAgB,oBAAoB,GAAG;AACtC,QAAO,gBAAgB,EAAE,CAAC;;;;;;AAO3B,SAAgB,gBAAgB,GAAG;AAClC,QAAO,gBAAgB,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yongdall/model",
3
- "version": "0.3.3",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "main": "./index.mjs",
6
6
  "exports": {
@@ -14,6 +14,6 @@
14
14
  "imodel": "^0.19.0"
15
15
  },
16
16
  "devDependencies": {
17
- "@yongdall/types": "^0.3.0"
17
+ "@yongdall/types": "^0.5.0"
18
18
  }
19
19
  }