@ailife-dev-vue/uiplus-dev 0.0.1 → 0.0.2
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/index.css +1 -1
- package/dist/index.d.ts +193 -7
- package/dist/index.mjs +20335 -19709
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -259,11 +259,18 @@ export declare interface Characteristic {
|
|
|
259
259
|
max?: string;
|
|
260
260
|
step?: number;
|
|
261
261
|
unit?: string;
|
|
262
|
+
/** 为 1 时按 min/max(及可选 divisor)换算为百分比展示 */
|
|
263
|
+
percent?: number;
|
|
264
|
+
/** 百分比换算时除数;真值才对 min/max 做除法 */
|
|
265
|
+
divisor?: string | number;
|
|
262
266
|
method?: string;
|
|
263
267
|
permission?: string;
|
|
264
268
|
report?: number;
|
|
265
269
|
}
|
|
266
270
|
|
|
271
|
+
/** 展示值就近钳到数值区间(不写 state) */
|
|
272
|
+
export declare const clampDisplayToEnableRange: (raw: number, enable: EnableConstraint | null | undefined) => number;
|
|
273
|
+
|
|
267
274
|
/** 与 StatusBar 一致:`minute`→00:00,`second`→00:00:00;作用于左下 int/float */
|
|
268
275
|
export declare type CommonBannerNewMiddleTimeUnit = DurationTimeUnit;
|
|
269
276
|
|
|
@@ -399,6 +406,18 @@ export declare type CommonInfoViewItem = {
|
|
|
399
406
|
router?: PageRouterTarget;
|
|
400
407
|
};
|
|
401
408
|
|
|
409
|
+
export declare type ComponentRuleSupportEntry = {
|
|
410
|
+
component: string;
|
|
411
|
+
supported: boolean;
|
|
412
|
+
ruleAnchors: RuleAnchor[];
|
|
413
|
+
effectScope: 'whole' | 'partial';
|
|
414
|
+
effectTarget?: string;
|
|
415
|
+
ignoresSecondaryFeature?: boolean;
|
|
416
|
+
notes?: string;
|
|
417
|
+
rules: Record<RuleTypeFlag, boolean>;
|
|
418
|
+
enableBehavior: RuleEnableBehavior;
|
|
419
|
+
};
|
|
420
|
+
|
|
402
421
|
declare const _default: {
|
|
403
422
|
install: (app: App) => void;
|
|
404
423
|
};
|
|
@@ -455,11 +474,27 @@ export declare interface DeviceInfoBase {
|
|
|
455
474
|
/** 时间展示枚举:`minute`→00:00,`second`→00:00:00(仅做数值换算,不约定上报单位) */
|
|
456
475
|
export declare type DurationTimeUnit = 'minute' | 'second';
|
|
457
476
|
|
|
477
|
+
export declare const emptyRuleUiSnapshot: () => RuleUiSnapshot;
|
|
478
|
+
|
|
479
|
+
/** enableRule 解析后的 UI 约束(不写回 state) */
|
|
480
|
+
export declare type EnableConstraint = {
|
|
481
|
+
kind: 'enumWhitelist';
|
|
482
|
+
values: Array<string | number>;
|
|
483
|
+
} | {
|
|
484
|
+
kind: 'numberRange';
|
|
485
|
+
min: number;
|
|
486
|
+
max: number;
|
|
487
|
+
} | {
|
|
488
|
+
kind: 'boolGate';
|
|
489
|
+
allowed: Array<string | number | boolean>;
|
|
490
|
+
};
|
|
491
|
+
|
|
458
492
|
/**
|
|
459
493
|
* 设备产品档案模型与规则判定工具:
|
|
460
494
|
* - 定义 profile/services/characteristics/state 的核心类型;
|
|
461
495
|
* - 提供按 (sid,cid) 读取特征与状态值的方法;
|
|
462
|
-
* -
|
|
496
|
+
* - 按规格评估 hide/disable/readOnly/enable(and>or、作用域、last-win)。
|
|
497
|
+
* 需求:docs/sdd/specs/rule-response-logic-spec.md
|
|
463
498
|
*/
|
|
464
499
|
export declare interface EnumItem {
|
|
465
500
|
descEn: string;
|
|
@@ -980,6 +1015,34 @@ export declare const enUS: {
|
|
|
980
1015
|
};
|
|
981
1016
|
};
|
|
982
1017
|
|
|
1018
|
+
/**
|
|
1019
|
+
* 评估 dependGroup.expressList。
|
|
1020
|
+
* 注意:宿主 profile **无** `dependGroup.operator`(历史误抄),块间连接词取各 express 首条 characteristic 的 operator。
|
|
1021
|
+
*/
|
|
1022
|
+
export declare const evaluateDependGroup: (state: ProductState, dependGroup: ProductRuleItem["dependGroup"] | undefined) => boolean;
|
|
1023
|
+
|
|
1024
|
+
/**
|
|
1025
|
+
* 中缀 and/or 求值(**and 优先于 or**,非左折叠)。
|
|
1026
|
+
* `terms[i].op`:连接 `terms[i-1]` 与 `terms[i]`(i≥1);等价于先算 and 段再 or。
|
|
1027
|
+
*/
|
|
1028
|
+
export declare const evaluateInfixAndOr: (terms: Array<{
|
|
1029
|
+
matched: boolean;
|
|
1030
|
+
op: "and" | "or";
|
|
1031
|
+
}>) => boolean;
|
|
1032
|
+
|
|
1033
|
+
/** 业务【D|R|H】对多个锚点分别评估后 OR 合并;用于 TimeSwitch 双锚点、Timer 卡片双 cid 等 */
|
|
1034
|
+
export declare const evaluateRuleFlagsOrForAnchors: (profile: Pick<ProductProfile, "rules" | "services">, state: ProductState, anchors: Array<{
|
|
1035
|
+
sid: string;
|
|
1036
|
+
cid: string;
|
|
1037
|
+
}>) => Pick<RuleUiSnapshot, "hidden" | "disabled" | "readOnly">;
|
|
1038
|
+
|
|
1039
|
+
/**
|
|
1040
|
+
* 按组件锚点 `(sid,cid)` 评估完整规则快照(实例认领自身属性时调用)。
|
|
1041
|
+
* - 同类型按 `rules[]` 顺序 **last-win**(仅条件成立且作用域命中者参与)
|
|
1042
|
+
* - hide / disable / readOnly / enable **独立**,互不覆盖
|
|
1043
|
+
*/
|
|
1044
|
+
export declare const evaluateRulesForAnchor: (profile: Pick<ProductProfile, "rules" | "services">, state: ProductState, sid: string, cid: string) => RuleUiSnapshot;
|
|
1045
|
+
|
|
983
1046
|
export declare type FirmwareUpdatesCardSize = 'full' | 'half';
|
|
984
1047
|
|
|
985
1048
|
export declare type FirmwareUpdatesEmits = {
|
|
@@ -1205,6 +1268,8 @@ export declare type GeneralEnumTileDisplayItem = {
|
|
|
1205
1268
|
label: string;
|
|
1206
1269
|
isPlaceholder?: boolean;
|
|
1207
1270
|
isMore?: boolean;
|
|
1271
|
+
/** enableRule 白名单外:保留展示但不可点(optionReadonly) */
|
|
1272
|
+
enableReadonly?: boolean;
|
|
1208
1273
|
};
|
|
1209
1274
|
|
|
1210
1275
|
export declare type GeneralEnumTileOptionConfig = {
|
|
@@ -1612,6 +1677,20 @@ export declare type GeneralWheelSubscribeData = {
|
|
|
1612
1677
|
showSector?: boolean;
|
|
1613
1678
|
} & Record<WheelZoneKey, WheelZoneConfig>;
|
|
1614
1679
|
|
|
1680
|
+
/** 按导出组件名(如 UpGeneralEnumTile)查询支持条目;未登记视为不支持 */
|
|
1681
|
+
export declare const getComponentRuleSupport: (componentName: string) => ComponentRuleSupportEntry | null;
|
|
1682
|
+
|
|
1683
|
+
/**
|
|
1684
|
+
* 业务【E】enable 约束下是否仍有可用取值(Timer timerServices 入口守卫等)。
|
|
1685
|
+
* 无 enable 视为可用;boolGate 看 allowed 非空;enum/int 看裁剪后是否仍有交集。
|
|
1686
|
+
*/
|
|
1687
|
+
export declare const hasUsableValueUnderEnableConstraint: (enable: EnableConstraint | null | undefined, opts: {
|
|
1688
|
+
characteristicType: string;
|
|
1689
|
+
enumValues?: Array<string | number>;
|
|
1690
|
+
intMin?: number;
|
|
1691
|
+
intMax?: number;
|
|
1692
|
+
}) => boolean;
|
|
1693
|
+
|
|
1615
1694
|
export declare interface HilinkDevHistoryParams {
|
|
1616
1695
|
devId: string;
|
|
1617
1696
|
pageNo?: string;
|
|
@@ -1646,6 +1725,27 @@ export declare type HilinkSetDeviceInfoWithoutCallbackFn = (deviceId: string, pa
|
|
|
1646
1725
|
/** 与宿主约定:`setTitleVisible(visible, callbackName)`,`true` 显示原生标题栏,`false` 隐藏。 */
|
|
1647
1726
|
export declare type HilinkSetTitleVisibleFn = (visible: boolean, callbackName: string) => void;
|
|
1648
1727
|
|
|
1728
|
+
/**
|
|
1729
|
+
* boolGate:当前值是否落在 enable 允许集合内。
|
|
1730
|
+
* 未命中时组件应局部只读(禁止切换),并保持当前视觉态(勿走 disable 强制关)。
|
|
1731
|
+
*/
|
|
1732
|
+
export declare const isBoolValueEnabledByConstraint: (value: unknown, enable: EnableConstraint | null | undefined) => boolean;
|
|
1733
|
+
|
|
1734
|
+
/** 组件是否消费任一规则类型 */
|
|
1735
|
+
export declare const isComponentRuleSupported: (componentName: string) => boolean;
|
|
1736
|
+
|
|
1737
|
+
/** 组件是否支持指定规则类型 */
|
|
1738
|
+
export declare const isComponentRuleTypeSupported: (componentName: string, ruleType: RuleTypeFlag) => boolean;
|
|
1739
|
+
|
|
1740
|
+
/** 枚举值是否在 enable 白名单内;无 enable 或非白名单约束时视为可用 */
|
|
1741
|
+
export declare const isEnumValueEnabledByConstraint: (enumVal: string | number, enable: EnableConstraint | null | undefined) => boolean;
|
|
1742
|
+
|
|
1743
|
+
/**
|
|
1744
|
+
* 判断指定 (sid,cid) 的规则是否生效(兼容旧 API)。
|
|
1745
|
+
* 内部走 evaluateRulesForAnchor;enableRule 有约束即视为 active。
|
|
1746
|
+
*/
|
|
1747
|
+
export declare const isRuleActive: (profile: ProductProfile, state: ProductState, sid: string, cid: string, ruleName: string) => boolean;
|
|
1748
|
+
|
|
1649
1749
|
/** 与 `sendHilinkDeviceControl` 约定一致 */
|
|
1650
1750
|
export declare type LampCCTCommandPayload = HilinkDeviceControlPayload;
|
|
1651
1751
|
|
|
@@ -1689,6 +1789,9 @@ export declare interface Language {
|
|
|
1689
1789
|
*/
|
|
1690
1790
|
export declare const localeContextKey: InjectionKey<Ref<Language>>;
|
|
1691
1791
|
|
|
1792
|
+
/** 业务【D|R|H】多锚点按 OR 合并(任一命中即真);【E】不合并,由调用方按锚点单独取 */
|
|
1793
|
+
export declare const mergeRuleFlagsOr: (...snapshots: RuleUiSnapshot[]) => Pick<RuleUiSnapshot, "hidden" | "disabled" | "readOnly">;
|
|
1794
|
+
|
|
1692
1795
|
export declare type NumericInputFieldEmits = {
|
|
1693
1796
|
(e: 'update:modelValue', value: string): void;
|
|
1694
1797
|
(e: 'input'): void;
|
|
@@ -1859,30 +1962,50 @@ export declare interface ProductProfile {
|
|
|
1859
1962
|
services: Service[];
|
|
1860
1963
|
}
|
|
1861
1964
|
|
|
1862
|
-
declare interface ProductRule {
|
|
1965
|
+
export declare interface ProductRule {
|
|
1863
1966
|
id: string;
|
|
1864
1967
|
name?: string;
|
|
1865
1968
|
rules?: ProductRuleItem[];
|
|
1866
1969
|
}
|
|
1867
1970
|
|
|
1971
|
+
/**
|
|
1972
|
+
* 条件条目。
|
|
1973
|
+
* - `operator`:与**前一词项**的连接词(and/or),首项不参与连接
|
|
1974
|
+
* - `order`:仅定位中缀表达式中的左右位置,不表示布尔优先级
|
|
1975
|
+
*/
|
|
1868
1976
|
declare interface ProductRuleCharacteristic {
|
|
1869
1977
|
characteristic: string;
|
|
1870
|
-
symbol
|
|
1871
|
-
value
|
|
1978
|
+
symbol?: string;
|
|
1979
|
+
value?: unknown;
|
|
1980
|
+
operator?: 'and' | 'or' | string;
|
|
1981
|
+
characterType?: string;
|
|
1982
|
+
order?: number | string;
|
|
1872
1983
|
}
|
|
1873
1984
|
|
|
1874
1985
|
declare interface ProductRuleDepend {
|
|
1875
1986
|
dependId: string;
|
|
1876
|
-
characteristicList
|
|
1987
|
+
characteristicList?: ProductRuleCharacteristic[];
|
|
1877
1988
|
}
|
|
1878
1989
|
|
|
1879
|
-
declare interface ProductRuleItem {
|
|
1990
|
+
export declare interface ProductRuleItem {
|
|
1880
1991
|
name: string;
|
|
1881
1992
|
dependGroup?: {
|
|
1882
1993
|
expressList?: ProductRuleDepend[];
|
|
1994
|
+
/** 历史误抄字段:忽略,不参与计算 */
|
|
1995
|
+
operator?: string;
|
|
1996
|
+
};
|
|
1997
|
+
resultGroup?: {
|
|
1998
|
+
expressList?: ProductRuleResultExpress[];
|
|
1883
1999
|
};
|
|
1884
2000
|
}
|
|
1885
2001
|
|
|
2002
|
+
declare interface ProductRuleResultExpress {
|
|
2003
|
+
characteristic?: string;
|
|
2004
|
+
characterType?: string;
|
|
2005
|
+
symbol?: string;
|
|
2006
|
+
value?: unknown;
|
|
2007
|
+
}
|
|
2008
|
+
|
|
1886
2009
|
export declare type ProductState = Record<string, any>;
|
|
1887
2010
|
|
|
1888
2011
|
declare interface ProductSubscribe {
|
|
@@ -1905,6 +2028,56 @@ export declare type ResolvedSecondaryItem = {
|
|
|
1905
2028
|
unit: string;
|
|
1906
2029
|
};
|
|
1907
2030
|
|
|
2031
|
+
export declare type RuleAnchor = RuleAnchorProp | RuleAnchorFixed | RuleAnchorResolved;
|
|
2032
|
+
|
|
2033
|
+
declare type RuleAnchorFixed = {
|
|
2034
|
+
source: 'fixed';
|
|
2035
|
+
sid: string;
|
|
2036
|
+
cid: string;
|
|
2037
|
+
};
|
|
2038
|
+
|
|
2039
|
+
declare type RuleAnchorProp = {
|
|
2040
|
+
source: 'prop';
|
|
2041
|
+
prop: string;
|
|
2042
|
+
index?: number;
|
|
2043
|
+
};
|
|
2044
|
+
|
|
2045
|
+
declare type RuleAnchorResolved = {
|
|
2046
|
+
source: 'resolved';
|
|
2047
|
+
candidates: Array<{
|
|
2048
|
+
sid: string;
|
|
2049
|
+
cid: string;
|
|
2050
|
+
}>;
|
|
2051
|
+
notes?: string;
|
|
2052
|
+
};
|
|
2053
|
+
|
|
2054
|
+
/** enableRule 命中后的选项/范围表现编码(与 JSON enableBehaviorCodes 一致) */
|
|
2055
|
+
export declare type RuleEnableBehavior = 'none' | 'optionReadonly' | 'optionHide' | 'segmentHide' | 'rangeClampNearest' | 'rangeClampNearestDisablePresets' | 'boolGate' | 'timerServiceOptionHide';
|
|
2056
|
+
|
|
2057
|
+
export declare type RuleResponseSupportTable = {
|
|
2058
|
+
version: number;
|
|
2059
|
+
description: string;
|
|
2060
|
+
ruleTypes: RuleTypeFlag[];
|
|
2061
|
+
enableBehaviorCodes: Record<string, string>;
|
|
2062
|
+
components: ComponentRuleSupportEntry[];
|
|
2063
|
+
unsupportedPolicy: string;
|
|
2064
|
+
};
|
|
2065
|
+
|
|
2066
|
+
/** 组件规则支持登记表(只读) */
|
|
2067
|
+
export declare const ruleResponseSupportTable: RuleResponseSupportTable;
|
|
2068
|
+
|
|
2069
|
+
export declare type RuleTypeFlag = 'hideRule' | 'disableRule' | 'readOnlyRule' | 'enableRule';
|
|
2070
|
+
|
|
2071
|
+
export declare type RuleTypeName = 'hideRule' | 'disableRule' | 'readOnlyRule' | 'enableRule';
|
|
2072
|
+
|
|
2073
|
+
/** 锚点上四类独立规则快照 */
|
|
2074
|
+
export declare interface RuleUiSnapshot {
|
|
2075
|
+
hidden: boolean;
|
|
2076
|
+
disabled: boolean;
|
|
2077
|
+
readOnly: boolean;
|
|
2078
|
+
enable: EnableConstraint | null;
|
|
2079
|
+
}
|
|
2080
|
+
|
|
1908
2081
|
export declare type SecondaryZone = 'slider' | 'list' | 'schedule';
|
|
1909
2082
|
|
|
1910
2083
|
export declare interface Service {
|
|
@@ -2455,6 +2628,16 @@ declare interface TimerFunctionOption {
|
|
|
2455
2628
|
intStep?: number;
|
|
2456
2629
|
/** `characteristicType=int` 时展示在数值后的单位;优先 `timerServices[].unit`,否则特征 `unit`,再否则 `%` */
|
|
2457
2630
|
intUnit?: string;
|
|
2631
|
+
/** 规则:hide 命中(通常已从选择列表过滤) */
|
|
2632
|
+
ruleHidden?: boolean;
|
|
2633
|
+
/** 规则:disable → 列表保留置灰不可选 */
|
|
2634
|
+
ruleDisabled?: boolean;
|
|
2635
|
+
/** 规则:readOnly → 同常规 readonly 样式,不可选 */
|
|
2636
|
+
ruleReadOnly?: boolean;
|
|
2637
|
+
/** 规则:enable 导致内部取值全部不可用 */
|
|
2638
|
+
ruleEnableBlocked?: boolean;
|
|
2639
|
+
/** 当前是否可选(未 hide/disable/readOnly/enable 挡掉) */
|
|
2640
|
+
isSelectable?: boolean;
|
|
2458
2641
|
}
|
|
2459
2642
|
export { TimerFunctionOption }
|
|
2460
2643
|
export { TimerFunctionOption as TimerNewFunctionOption }
|
|
@@ -3517,7 +3700,10 @@ export declare const UpCommonBannerNew: {
|
|
|
3517
3700
|
centerImageUrl: string;
|
|
3518
3701
|
logo: string;
|
|
3519
3702
|
showBottomWhenOff: boolean;
|
|
3520
|
-
}, true, {}, {}, GlobalComponents, GlobalDirectives, string, {
|
|
3703
|
+
}, true, {}, {}, GlobalComponents, GlobalDirectives, string, {
|
|
3704
|
+
topLeftRef: HTMLDivElement;
|
|
3705
|
+
bottomLeftRef: HTMLDivElement;
|
|
3706
|
+
}, HTMLDivElement, ComponentProvideOptions, {
|
|
3521
3707
|
P: {};
|
|
3522
3708
|
B: {};
|
|
3523
3709
|
D: {};
|