@limetech/lime-web-components 6.6.0 → 6.8.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/CHANGELOG.md +17 -0
- package/dist/error/error.d.ts +15 -0
- package/dist/error/error.d.ts.map +1 -0
- package/dist/error/error.spec.d.ts +2 -0
- package/dist/error/error.spec.d.ts.map +1 -0
- package/dist/error/index.d.ts +2 -0
- package/dist/error/index.d.ts.map +1 -0
- package/dist/eventdispatcher/eventdispatcher.d.ts +76 -10
- package/dist/eventdispatcher/eventdispatcher.d.ts.map +1 -1
- package/dist/filter/decorator.d.ts +21 -3
- package/dist/filter/decorator.d.ts.map +1 -1
- package/dist/filter/repository.d.ts +84 -6
- package/dist/filter/repository.d.ts.map +1 -1
- package/dist/http/http.d.ts +244 -37
- package/dist/http/http.d.ts.map +1 -1
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +467 -333
- package/dist/index.esm.js.map +1 -1
- package/dist/keybindings/registry.d.ts +140 -27
- package/dist/keybindings/registry.d.ts.map +1 -1
- package/dist/logger/factory.d.ts +51 -0
- package/dist/logger/factory.d.ts.map +1 -0
- package/dist/logger/factory.spec.d.ts +2 -0
- package/dist/logger/factory.spec.d.ts.map +1 -0
- package/dist/logger/index.d.ts +1 -0
- package/dist/logger/index.d.ts.map +1 -1
- package/dist/problem/index.d.ts +6 -0
- package/dist/problem/index.d.ts.map +1 -0
- package/dist/problem/problem.d.ts +394 -0
- package/dist/problem/problem.d.ts.map +1 -0
- package/dist/problem/provider.d.ts +192 -0
- package/dist/problem/provider.d.ts.map +1 -0
- package/dist/problem/query.d.ts +312 -0
- package/dist/problem/query.d.ts.map +1 -0
- package/dist/problem/repository.d.ts +111 -0
- package/dist/problem/repository.d.ts.map +1 -0
- package/dist/problem/types.d.ts +15 -0
- package/dist/problem/types.d.ts.map +1 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
## [6.8.0](https://github.com/Lundalogik/lime-web-components/compare/v6.7.0...v6.8.0) (2026-01-28)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
* **problem:** add problem provider interfaces ([a4d003f](https://github.com/Lundalogik/lime-web-components/commit/a4d003f3a8665185c7ec7a99458ebf671d541641))
|
|
8
|
+
|
|
9
|
+
## [6.7.0](https://github.com/Lundalogik/lime-web-components/compare/v6.6.0...v6.7.0) (2026-01-14)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
* **error:** register Stencil error handler ([cdd24d4](https://github.com/Lundalogik/lime-web-components/commit/cdd24d45ea411d9c1e135da24b174d0a9af79609))
|
|
16
|
+
* **logger:** add package-aware logger factory ([ab45944](https://github.com/Lundalogik/lime-web-components/commit/ab459447747fc8751e4c56c262224c149b9c78c8))
|
|
17
|
+
|
|
1
18
|
## [6.6.0](https://github.com/Lundalogik/lime-web-components/compare/v6.5.0...v6.6.0) (2025-12-16)
|
|
2
19
|
|
|
3
20
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global error handler for uncaught errors in Stencil components.
|
|
3
|
+
* Logs the error using the Lime platform's logging system.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* This function is registered as the global error handler for Stencil
|
|
7
|
+
* components to capture uncaught errors and log them appropriately.
|
|
8
|
+
*
|
|
9
|
+
* @param err - The uncaught error object
|
|
10
|
+
* @param element - The Stencil component element where the error occurred
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare function errorHandler(err: unknown, element?: HTMLElement): void;
|
|
15
|
+
//# sourceMappingURL=error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/error/error.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,WAAW,QAkB/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.spec.d.ts","sourceRoot":"","sources":["../../src/error/error.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/error/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
@@ -1,28 +1,94 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Service for
|
|
2
|
+
* Service for application-wide event communication
|
|
3
|
+
*
|
|
4
|
+
* The {@link EventDispatcher} enables loosely-coupled communication between
|
|
5
|
+
* components through a publish-subscribe pattern.
|
|
6
|
+
*
|
|
7
|
+
* Components can dispatch custom events and subscribe to events from other
|
|
8
|
+
* components without direct coupling. This is particularly useful for:
|
|
9
|
+
* - Cross-component communication
|
|
10
|
+
* - Responding to platform-level events (navigation, data changes)
|
|
11
|
+
* - Notifying other components of state changes
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* Basic usage
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const eventDispatcher = platform.get(PlatformServiceName.EventDispatcher);
|
|
17
|
+
*
|
|
18
|
+
* // Dispatch an event
|
|
19
|
+
* eventDispatcher.dispatch('data-changed', { id: 123 });
|
|
20
|
+
*
|
|
21
|
+
* // Listen for events
|
|
22
|
+
* const handler = (event: CustomEvent<{ id: number }>) => {
|
|
23
|
+
* console.log('Data changed:', event.detail.id);
|
|
24
|
+
* };
|
|
25
|
+
* eventDispatcher.addListener('data-changed', handler);
|
|
26
|
+
*
|
|
27
|
+
* // Clean up
|
|
28
|
+
* eventDispatcher.removeListener('data-changed', handler);
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
3
31
|
* @public
|
|
4
32
|
* @group Event dispatching
|
|
5
33
|
*/
|
|
6
34
|
export interface EventDispatcher {
|
|
7
35
|
/**
|
|
8
|
-
* Dispatch a
|
|
36
|
+
* Dispatch a custom event to all registered listeners
|
|
9
37
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
38
|
+
* Creates and dispatches a `CustomEvent` with the provided data. All components
|
|
39
|
+
* that have registered listeners for this event name will be notified.
|
|
40
|
+
*
|
|
41
|
+
* @param eventName - Unique name identifying the event type
|
|
42
|
+
* @param data - Data payload to include in the event's `detail` property
|
|
43
|
+
* @returns The `CustomEvent` that was dispatched
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
* const eventDispatcher = platform.get(PlatformServiceName.EventDispatcher);
|
|
48
|
+
* eventDispatcher.dispatch('item-selected', { itemId: 42, name: 'Widget' });
|
|
49
|
+
* ```
|
|
12
50
|
*/
|
|
13
51
|
dispatch<T>(eventName: string, data: T): CustomEvent<T>;
|
|
14
52
|
/**
|
|
15
|
-
*
|
|
53
|
+
* Register a listener for a specific event type
|
|
54
|
+
*
|
|
55
|
+
* The listener function will be called whenever an event with the matching
|
|
56
|
+
* name is dispatched. The same listener can be registered multiple times,
|
|
57
|
+
* but should typically be registered only once per component instance.
|
|
58
|
+
*
|
|
59
|
+
* **Important:** Always remove listeners in `disconnectedCallback()` to
|
|
60
|
+
* prevent memory leaks.
|
|
16
61
|
*
|
|
17
|
-
* @param eventName -
|
|
18
|
-
* @param listener -
|
|
62
|
+
* @param eventName - Name of the event to listen for
|
|
63
|
+
* @param listener - Callback function to invoke when the event is dispatched
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```typescript
|
|
67
|
+
* eventDispatcher.addListener('message-received', (event) => {
|
|
68
|
+
* console.log('Message:', event.detail);
|
|
69
|
+
* });
|
|
70
|
+
* ```
|
|
19
71
|
*/
|
|
20
72
|
addListener<T>(eventName: string, listener: (event: CustomEvent<T>) => void): void;
|
|
21
73
|
/**
|
|
22
|
-
*
|
|
74
|
+
* Unregister a previously registered event listener
|
|
75
|
+
*
|
|
76
|
+
* Removes the specified listener function for the given event name. The
|
|
77
|
+
* listener reference must be the same function instance that was passed
|
|
78
|
+
* to {@link addListener}.
|
|
79
|
+
*
|
|
80
|
+
* Always call this in `disconnectedCallback()` to clean up listeners and
|
|
81
|
+
* prevent memory leaks.
|
|
82
|
+
*
|
|
83
|
+
* @param eventName - Name of the event to stop listening for
|
|
84
|
+
* @param listener - The exact listener function that was previously registered
|
|
23
85
|
*
|
|
24
|
-
* @
|
|
25
|
-
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```typescript
|
|
88
|
+
* const handler = (event: CustomEvent<string>) => console.log(event.detail);
|
|
89
|
+
* eventDispatcher.addListener('message-received', handler);
|
|
90
|
+
* eventDispatcher.removeListener('message-received', handler);
|
|
91
|
+
* ```
|
|
26
92
|
*/
|
|
27
93
|
removeListener<T>(eventName: string, listener: (event: CustomEvent<T>) => void): void;
|
|
28
94
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventdispatcher.d.ts","sourceRoot":"","sources":["../../src/eventdispatcher/eventdispatcher.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"eventdispatcher.d.ts","sourceRoot":"","sources":["../../src/eventdispatcher/eventdispatcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,WAAW,eAAe;IAC5B;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IAExD;;;;;;;;;;;;;;;;;;;OAmBG;IACH,WAAW,CAAC,CAAC,EACT,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,GAC1C,IAAI,CAAC;IAER;;;;;;;;;;;;;;;;;;;OAmBG;IACH,cAAc,CAAC,CAAC,EACZ,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,GAC1C,IAAI,CAAC;CACX"}
|
|
@@ -9,10 +9,28 @@ export interface SelectFiltersOptions extends StateOptions {
|
|
|
9
9
|
limetype?: string;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Decorator that subscribes to filters from the {@link FilterRepository}.
|
|
13
|
+
*
|
|
14
|
+
* This decorator automatically updates the decorated property whenever filters
|
|
15
|
+
* change in the platform. You can optionally filter by limetype or filter ID.
|
|
16
|
+
*
|
|
17
|
+
* @param options - Configuration including limetype/ID filtering and state transformation via {@link SelectFiltersOptions}
|
|
18
|
+
* @returns A PropertyDecorator that sets up automatic subscription to filters
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* @State()
|
|
23
|
+
* @SelectFilters()
|
|
24
|
+
* private filters: Filter[];
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* @State()
|
|
30
|
+
* @SelectFilters({ limetype: 'company' })
|
|
31
|
+
* private companyFilters: Filter[];
|
|
32
|
+
* ```
|
|
13
33
|
*
|
|
14
|
-
* @param options - state decorator options
|
|
15
|
-
* @returns state decorator
|
|
16
34
|
* @public
|
|
17
35
|
* @group Filters
|
|
18
36
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorator.d.ts","sourceRoot":"","sources":["../../src/filter/decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,YAAY,EAEf,MAAM,SAAS,CAAC;AAGjB;;;;GAIG;AACH,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACtD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED
|
|
1
|
+
{"version":3,"file":"decorator.d.ts","sourceRoot":"","sources":["../../src/filter/decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,YAAY,EAEf,MAAM,SAAS,CAAC;AAGjB;;;;GAIG;AACH,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACtD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,aAAa,CACzB,OAAO,GAAE,oBAAyB,GACnC,iBAAiB,CAMnB"}
|
|
@@ -1,22 +1,100 @@
|
|
|
1
1
|
import { Filter } from '../query';
|
|
2
2
|
import { StateRepository } from '../core';
|
|
3
3
|
/**
|
|
4
|
+
* Repository for managing saved filter definitions.
|
|
5
|
+
*
|
|
6
|
+
* {@link FilterRepository} provides methods to create, update, and delete {@link Filter}
|
|
7
|
+
* definitions. Filters are named, reusable query expressions that can be applied to
|
|
8
|
+
* limetypes to define subsets of objects (e.g., "My Active Deals", "High Priority Tickets").
|
|
9
|
+
*
|
|
10
|
+
* Filters can be:
|
|
11
|
+
* - System-wide (available to all users)
|
|
12
|
+
* - User-specific (private to a single user when `iduser` is set)
|
|
13
|
+
* - Referenced in {@link InFilterExpression}s for advanced queries
|
|
14
|
+
*
|
|
15
|
+
* The repository extends {@link StateRepository}, enabling:
|
|
16
|
+
* - Reactive subscriptions to filter changes
|
|
17
|
+
* - Automatic UI updates when filters are created or deleted
|
|
18
|
+
* - Integration with state decorators
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* Basic usage
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const repo = platform.get(PlatformServiceName.FilterRepository);
|
|
24
|
+
*
|
|
25
|
+
* const filter: Filter = {
|
|
26
|
+
* id: 'high_value_deals',
|
|
27
|
+
* limetype: 'deal',
|
|
28
|
+
* name: { 'en': 'High Value Deals' },
|
|
29
|
+
* filter: {
|
|
30
|
+
* op: Operator.AND,
|
|
31
|
+
* exp: [
|
|
32
|
+
* { key: 'status', op: Operator.EQUALS, exp: 'active' },
|
|
33
|
+
* { key: 'value', op: Operator.GREATER_OR_EQUAL, exp: 100000 }
|
|
34
|
+
* ]
|
|
35
|
+
* }
|
|
36
|
+
* };
|
|
37
|
+
*
|
|
38
|
+
* await repo.save(filter);
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
4
41
|
* @public
|
|
5
42
|
* @group Filters
|
|
43
|
+
* @see {@link Filter} for filter definition structure
|
|
44
|
+
* @see {@link Expression} for building filter expressions
|
|
45
|
+
* @see {@link InFilterExpression} for referencing filters in queries
|
|
46
|
+
* @see {@link StateRepository} for subscription patterns
|
|
6
47
|
*/
|
|
7
48
|
export interface FilterRepository extends StateRepository {
|
|
8
49
|
/**
|
|
9
|
-
*
|
|
50
|
+
* Save a filter definition to the database.
|
|
10
51
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
52
|
+
* Creates a new filter or updates an existing one. The filter will be stored
|
|
53
|
+
* persistently and become available for use in queries and filter expressions.
|
|
54
|
+
*
|
|
55
|
+
* If a filter with the same `id` already exists, it will be updated with the
|
|
56
|
+
* new values. Otherwise, a new filter is created.
|
|
57
|
+
*
|
|
58
|
+
* @param filter - The {@link Filter} definition to save
|
|
59
|
+
* @returns Promise that resolves when the filter is saved
|
|
60
|
+
* @throws Error if save fails due to validation or permission issues
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```typescript
|
|
64
|
+
* const repo = platform.get(PlatformServiceName.FilterRepository);
|
|
65
|
+
*
|
|
66
|
+
* const filter: Filter = {
|
|
67
|
+
* id: 'my_deals',
|
|
68
|
+
* limetype: 'deal',
|
|
69
|
+
* name: { 'en': 'My Deals' },
|
|
70
|
+
* filter: { key: 'owner', op: Operator.EQUALS, exp: currentUserId }
|
|
71
|
+
* };
|
|
72
|
+
*
|
|
73
|
+
* await repo.save(filter);
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @see {@link Filter} for the filter structure
|
|
77
|
+
* @see {@link Expression} for building filter expressions
|
|
78
|
+
* @see {@link delete} to remove a filter
|
|
13
79
|
*/
|
|
14
80
|
save(filter: Filter): Promise<void>;
|
|
15
81
|
/**
|
|
16
|
-
*
|
|
82
|
+
* Delete a filter from the database.
|
|
83
|
+
*
|
|
84
|
+
* Permanently removes the specified filter. This operation cannot be undone.
|
|
85
|
+
*
|
|
86
|
+
* @param filter - The {@link Filter} to delete
|
|
87
|
+
* @returns Promise that resolves when the filter is deleted
|
|
88
|
+
* @throws Error if deletion fails due to permissions or other issues
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```typescript
|
|
92
|
+
* const repo = platform.get(PlatformServiceName.FilterRepository);
|
|
93
|
+
* await repo.delete(filter);
|
|
94
|
+
* ```
|
|
17
95
|
*
|
|
18
|
-
* @
|
|
19
|
-
* @
|
|
96
|
+
* @see {@link Filter} for the filter structure
|
|
97
|
+
* @see {@link save} to create or update a filter
|
|
20
98
|
*/
|
|
21
99
|
delete(filter: Filter): Promise<void>;
|
|
22
100
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../src/filter/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C
|
|
1
|
+
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../src/filter/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpC;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzC"}
|