@limetech/lime-web-components 5.14.0 → 5.15.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/dist/conditionregistry/conditionregistry.d.ts +58 -0
- package/dist/conditionregistry/conditionregistry.d.ts.map +1 -0
- package/dist/conditionregistry/conditionregistry.js +1 -0
- package/dist/conditionregistry/index.d.ts +3 -0
- package/dist/conditionregistry/index.d.ts.map +1 -0
- package/dist/conditionregistry/index.js +2 -0
- package/dist/conditionregistry/types.d.ts +15 -0
- package/dist/conditionregistry/types.d.ts.map +1 -0
- package/dist/conditionregistry/types.js +3 -0
- package/dist/es5/conditionregistry/conditionregistry.js +2 -0
- package/dist/es5/conditionregistry/index.js +5 -0
- package/dist/es5/conditionregistry/types.js +5 -0
- package/dist/es5/index.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This interface defines callbacks intended to be registered to the {@link Condition} registry
|
|
3
|
+
*
|
|
4
|
+
* @alpha
|
|
5
|
+
* @group Conditions
|
|
6
|
+
*/
|
|
7
|
+
export type Condition<T = unknown> = {
|
|
8
|
+
/**
|
|
9
|
+
* The condition type, describing what to evaluate the condition for, for example "limeobject"
|
|
10
|
+
*/
|
|
11
|
+
type: string;
|
|
12
|
+
evaluate: (subject: T, params: any) => boolean;
|
|
13
|
+
id: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Service for adding and retrieving, and checking {@link Condition}s to and from the condition registry
|
|
17
|
+
*
|
|
18
|
+
* @alpha
|
|
19
|
+
* @group Conditions
|
|
20
|
+
*/
|
|
21
|
+
export interface ConditionRegistry {
|
|
22
|
+
/**
|
|
23
|
+
* Add a {@link Condition} to the registry
|
|
24
|
+
*
|
|
25
|
+
* @param condition - the condition to pass to the registry
|
|
26
|
+
* @throws error if the id already exists in the registry
|
|
27
|
+
*/
|
|
28
|
+
addCondition(condition: Condition): any;
|
|
29
|
+
/**
|
|
30
|
+
* Remove a {@link Condition} from the registry
|
|
31
|
+
*
|
|
32
|
+
* @param condition - the condition to remove
|
|
33
|
+
* @throws error if the id does not exist in the registry
|
|
34
|
+
*/
|
|
35
|
+
removeCondition(condition: Condition): any;
|
|
36
|
+
/**
|
|
37
|
+
* Checks if a {@link Condition} exists on the registry
|
|
38
|
+
*
|
|
39
|
+
* @param id - id of the condition
|
|
40
|
+
* @returns true if it exists, false otherwise
|
|
41
|
+
*/
|
|
42
|
+
hasCondition(id: string): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Gets all {@link Condition}s
|
|
45
|
+
*
|
|
46
|
+
* @returns a list of all existing conditions
|
|
47
|
+
*/
|
|
48
|
+
getConditions(): Condition[];
|
|
49
|
+
/**
|
|
50
|
+
* Gets a {@link Condition} by id
|
|
51
|
+
*
|
|
52
|
+
* @param id - id of the condition
|
|
53
|
+
* @throws error if no condition was found with the specified id
|
|
54
|
+
* @returns the condition with the specified id
|
|
55
|
+
*/
|
|
56
|
+
getCondition(id: string): Condition;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=conditionregistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditionregistry.d.ts","sourceRoot":"","sources":["../../src/conditionregistry/conditionregistry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,GAAG,OAAO,IAAI;IACjC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAWb,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC;IAK/C,EAAE,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAC9B;;;;;OAKG;IACH,YAAY,CAAC,SAAS,EAAE,SAAS,OAAE;IAEnC;;;;;OAKG;IACH,eAAe,CAAC,SAAS,EAAE,SAAS,OAAE;IAEtC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IAElC;;;;OAIG;IACH,aAAa,IAAI,SAAS,EAAE,CAAC;IAE7B;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/conditionregistry/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ConditionRegistry as Service } from './conditionregistry';
|
|
2
|
+
declare const SERVICE_NAME = "conditionRegistry";
|
|
3
|
+
declare module '../core/platform' {
|
|
4
|
+
interface PlatformServiceNameType {
|
|
5
|
+
/**
|
|
6
|
+
* @see {@link Service | ConditionRegistry}
|
|
7
|
+
*/
|
|
8
|
+
ConditionRegistry: typeof SERVICE_NAME;
|
|
9
|
+
}
|
|
10
|
+
interface LimeWebComponentPlatform {
|
|
11
|
+
get(name: PlatformServiceNameType['ConditionRegistry']): Service;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/conditionregistry/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,IAAI,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnE,QAAA,MAAM,YAAY,sBAAsB,CAAC;AAIzC,OAAO,QAAQ,kBAAkB,CAAC;IAC9B,UAAU,uBAAuB;QAC7B;;WAEG;QACH,iBAAiB,EAAE,OAAO,YAAY,CAAC;KAC1C;IACD,UAAU,wBAAwB;QAC9B,GAAG,CAAC,IAAI,EAAE,uBAAuB,CAAC,mBAAmB,CAAC,GAAG,OAAO,CAAC;KACpE;CACJ"}
|
package/dist/es5/index.js
CHANGED
|
@@ -22,3 +22,4 @@ tslib_1.__exportStar(require("./userdata"), exports);
|
|
|
22
22
|
tslib_1.__exportStar(require("./application"), exports);
|
|
23
23
|
tslib_1.__exportStar(require("./userpreferences"), exports);
|
|
24
24
|
tslib_1.__exportStar(require("./datetimeformatter"), exports);
|
|
25
|
+
tslib_1.__exportStar(require("./conditionregistry"), exports);
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED