@byteluck-fe/model-driven-controls 7.1.0-beta.2 → 7.1.0-beta.3
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/README.md +1 -1
- package/dist/catalog/index.js +2 -2
- package/dist/catalog/index.mjs +2 -2
- package/dist/esm/catalog/generated/control-catalog.v1.json +6 -3
- package/dist/esm/catalog/query.js +130 -3
- package/dist/esm/listControls/SubTable/property.js +6 -0
- package/dist/index.umd.js +4 -4
- package/dist/types/catalog/query.d.ts +19 -1
- package/dist/types/catalog/types.d.ts +15 -0
- package/dist/types/listControls/SubTable/property.d.ts +7 -0
- package/package.json +5 -5
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ControlCatalogInfo, ControlDefinition, ControlLocaleMessageFact, ControlSavedPropertyFact, ControlSettingFact } from './types';
|
|
1
|
+
import { ControlCatalogInfo, ControlDefinition, ControlLocaleMessageFact, ResolvedControlSavedPropertyValue, ControlSavedPropertyFact, ControlSettingFact } from './types';
|
|
2
|
+
import { JsonObject } from '@byteluck-fe/model-driven-core/contracts';
|
|
2
3
|
/** 返回独立副本,避免调用方污染进程内共享 catalog。 */
|
|
3
4
|
export declare function getControlDefinition(type: string): ControlDefinition | undefined;
|
|
4
5
|
/** 控件列表按 type 稳定排序,生成器与运行时查询顺序保持一致。 */
|
|
@@ -15,6 +16,23 @@ export declare function getControlSettingFacts(type: string): ControlSettingFact
|
|
|
15
16
|
* propertyNameMap 与 defaultProps,才能作为控件切换时的能力证据。
|
|
16
17
|
*/
|
|
17
18
|
export declare function getControlSavedPropertyFact(type: string, savedPropertyKey: string): ControlSavedPropertyFact | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* 解析一个保存属性的有效值,仅在 catalog 已登记历史缺失语义时补值。
|
|
21
|
+
*
|
|
22
|
+
* `null` 是显式 JSON 值,不能与缺失/undefined 混为一谈。调用方可传 camelCase
|
|
23
|
+
* 构造态或 snake_case 保存态 props,返回值始终指出公共构造属性名。
|
|
24
|
+
*/
|
|
25
|
+
export declare function resolveControlSavedPropertyValue(input: {
|
|
26
|
+
controlType: string;
|
|
27
|
+
savedPropertyKey: string;
|
|
28
|
+
props: JsonObject;
|
|
29
|
+
}): ResolvedControlSavedPropertyValue | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* 为 Designer 等构造态消费者补齐 Runtime 已核实的历史缺失语义。
|
|
32
|
+
*
|
|
33
|
+
* 未命中时保留原对象引用;命中时只浅拷贝 props 并写入公共属性名,不修改保存态原对象。
|
|
34
|
+
*/
|
|
35
|
+
export declare function applyControlRuntimeAbsentDefaults(controlType: string, props: JsonObject): JsonObject;
|
|
18
36
|
/** headless 按稳定 key 窄查消息事实,避免复制整份 catalog。 */
|
|
19
37
|
export declare function getControlLocaleMessageFact(key: string): ControlLocaleMessageFact | undefined;
|
|
20
38
|
export declare function getControlCatalogInfo(): ControlCatalogInfo;
|
|
@@ -16,11 +16,24 @@ export interface ControlSettingFact {
|
|
|
16
16
|
* 才会产生此事实。它只证明目标控件支持该保存属性,不自动授权跨控件继承或任意写入。
|
|
17
17
|
*/
|
|
18
18
|
export interface ControlSavedPropertyFact {
|
|
19
|
+
/** 新建控件时由真实 Designer 工厂物化的默认值。 */
|
|
19
20
|
controlType: string;
|
|
20
21
|
defaultValue: JsonValue;
|
|
22
|
+
/**
|
|
23
|
+
* 历史保存态缺少该属性时,当前 Runtime 实际采用的值。
|
|
24
|
+
*
|
|
25
|
+
* 该字段只描述已经核实的兼容语义;未登记时调用方不得猜测或套用创建默认值。
|
|
26
|
+
*/
|
|
27
|
+
absentRuntimeValue?: JsonValue;
|
|
21
28
|
propertyKey: string;
|
|
22
29
|
savedPropertyKey: string;
|
|
23
30
|
}
|
|
31
|
+
export interface ResolvedControlSavedPropertyValue {
|
|
32
|
+
propertyKey: string;
|
|
33
|
+
savedPropertyKey: string;
|
|
34
|
+
value: JsonValue;
|
|
35
|
+
source: 'explicit' | 'absent_runtime_value';
|
|
36
|
+
}
|
|
24
37
|
/** 由 i18n_messages 发布生成的紧凑文案事实,不包含运行时 i18n 实例。 */
|
|
25
38
|
export interface ControlLocaleMessageFact {
|
|
26
39
|
key: string;
|
|
@@ -92,6 +105,8 @@ export interface ControlDefinition {
|
|
|
92
105
|
/** 显式构造存在无法确定性表达的副作用,headless 对这些输入 fail-closed。 */
|
|
93
106
|
unsupportedExplicitProps: string[];
|
|
94
107
|
propertyNameMap: Record<string, string>;
|
|
108
|
+
/** 仅登记已核实的“保存属性缺失时 Runtime 如何解释”事实。 */
|
|
109
|
+
absentRuntimeDefaults?: Record<string, JsonValue>;
|
|
95
110
|
settings: JsonObject[];
|
|
96
111
|
settingFacts: ControlSettingFact[];
|
|
97
112
|
eventKeys: string[];
|
|
@@ -246,6 +246,13 @@ interface SubTablePropertyInterface<Mode extends MODE | 'Schema', Control extend
|
|
|
246
246
|
}
|
|
247
247
|
declare class SubTableControlProperty<Mode extends MODE | 'Schema', Control extends object = ControlType<Mode>> extends ListControlProperty<Mode, Control> implements SubTablePropertyInterface<Mode, Control> {
|
|
248
248
|
static readonly Rules: typeof SubTableControlPropertyRules;
|
|
249
|
+
/**
|
|
250
|
+
* 历史页面未保存 label_position 时,Runtime 一直按左右布局解释。
|
|
251
|
+
* 新建控件仍使用构造器中的 top;catalog 将两类语义分开发布,供 Designer 对齐历史运行态。
|
|
252
|
+
*/
|
|
253
|
+
static readonly catalogAbsentRuntimeDefaults: {
|
|
254
|
+
readonly labelPosition: "left";
|
|
255
|
+
};
|
|
249
256
|
static readonly RuntimeRules: typeof SubtableControlRuntimeRules;
|
|
250
257
|
/**
|
|
251
258
|
* 标题
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byteluck-fe/model-driven-controls",
|
|
3
|
-
"version": "7.1.0-beta.
|
|
3
|
+
"version": "7.1.0-beta.3",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "郝晨光 <2293885211@qq.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"postpublish": "node ../../scripts/postpublish.js"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@byteluck-fe/model-driven-core": "7.1.0-beta.
|
|
53
|
-
"@byteluck-fe/model-driven-settings": "7.1.0-beta.
|
|
54
|
-
"@byteluck-fe/model-driven-shared": "7.1.0-beta.
|
|
52
|
+
"@byteluck-fe/model-driven-core": "7.1.0-beta.3",
|
|
53
|
+
"@byteluck-fe/model-driven-settings": "7.1.0-beta.3",
|
|
54
|
+
"@byteluck-fe/model-driven-shared": "7.1.0-beta.3",
|
|
55
55
|
"async-validator": "3.5.1"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "7adfb426676013d0daa1ece71a415ef840b8f92e"
|
|
58
58
|
}
|