@limetech/lime-crm-building-blocks 1.86.2 → 1.87.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 +7 -0
- package/dist/cjs/{highlight-item.handler-99d5a0b6.js → highlight-item.handler-584ab58a.js} +2 -2
- package/dist/cjs/{index-3da101cc.js → index-ff255a0d.js} +3 -28
- package/dist/cjs/{index.esm-d6513e37.js → index.esm-9effb196.js} +1 -1
- package/dist/cjs/lime-crm-building-blocks.cjs.js +1 -1
- package/dist/cjs/limebb-browser.cjs.entry.js +2 -2
- package/dist/cjs/limebb-chat-item_2.cjs.entry.js +8 -3
- package/dist/cjs/limebb-chat-list.cjs.entry.js +34 -16
- package/dist/cjs/limebb-component-config.cjs.entry.js +5 -3
- package/dist/cjs/limebb-component-picker.cjs.entry.js +2 -2
- package/dist/cjs/limebb-currency-picker.cjs.entry.js +3 -3
- package/dist/cjs/limebb-dashboard-widget.cjs.entry.js +1 -1
- package/dist/cjs/limebb-date-picker.cjs.entry.js +5 -5
- package/dist/cjs/limebb-date-range.cjs.entry.js +1 -1
- package/dist/cjs/limebb-empty-state.cjs.entry.js +1 -1
- package/dist/cjs/limebb-feed-timeline-item.cjs.entry.js +4 -5
- package/dist/cjs/limebb-feed.cjs.entry.js +4 -4
- package/dist/cjs/limebb-icon-picker.cjs.entry.js +10 -6
- package/dist/cjs/limebb-info-tile-currency-format.cjs.entry.js +1 -1
- package/dist/cjs/limebb-info-tile-date-format.cjs.entry.js +2 -2
- package/dist/cjs/limebb-info-tile-decimal-format.cjs.entry.js +1 -1
- package/dist/cjs/limebb-info-tile-format.cjs.entry.js +2 -1
- package/dist/cjs/limebb-info-tile-relative-date-format.cjs.entry.js +1 -1
- package/dist/cjs/limebb-info-tile-unit-format.cjs.entry.js +2 -2
- package/dist/cjs/limebb-info-tile.cjs.entry.js +21 -22
- package/dist/cjs/limebb-kanban-group.cjs.entry.js +3 -3
- package/dist/cjs/limebb-kanban-item.cjs.entry.js +3 -3
- package/dist/cjs/limebb-kanban.cjs.entry.js +1 -1
- package/dist/cjs/limebb-limeobject-file-viewer.cjs.entry.js +4 -4
- package/dist/cjs/limebb-loader.cjs.entry.js +3 -3
- package/dist/cjs/limebb-locale-picker.cjs.entry.js +14 -6
- package/dist/cjs/limebb-mention-group-counter.cjs.entry.js +1 -1
- package/dist/cjs/limebb-mention.cjs.entry.js +5 -6
- package/dist/cjs/limebb-navigation-button_2.cjs.entry.js +5 -5
- package/dist/cjs/limebb-notification-item.cjs.entry.js +2 -2
- package/dist/cjs/limebb-notification-list.cjs.entry.js +31 -14
- package/dist/cjs/limebb-percentage-visualizer.cjs.entry.js +7 -8
- package/dist/cjs/limebb-text-editor-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-text-editor.cjs.entry.js +42 -39
- package/dist/cjs/limebb-trend-indicator.cjs.entry.js +8 -8
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{non-null-b8d9b4b4.js → non-null-3bf14aa1.js} +5 -0
- package/dist/cjs/{percentage-class-9decca4f.js → percentage-class-e4f0a52d.js} +2 -2
- package/dist/collection/components/chat-list/chat-item/chat-item.css +4 -0
- package/dist/collection/components/chat-list/chat-item/chat-item.js +5 -0
- package/dist/collection/components/chat-list/chat-list.js +11 -7
- package/dist/collection/components/chat-list/{processChatItems.js → process-chat-items.js} +22 -8
- package/dist/collection/components/component-command-picker/component-config/component-config.js +3 -1
- package/dist/collection/components/date-picker/to-server-date.js +3 -3
- package/dist/collection/components/feed/feed-item/feed-timeline-item.css +4 -4
- package/dist/collection/components/feed/feed-item/feed-timeline-item.js +1 -2
- package/dist/collection/components/feed/feed.js +1 -1
- package/dist/collection/components/feed/highlight-item/highlight-item.handler.js +2 -2
- package/dist/collection/components/icon-picker/search.js +9 -0
- package/dist/collection/components/info-tile/format/config/info-tile-date-format.js +1 -1
- package/dist/collection/components/info-tile/format/config/info-tile-format.js +1 -0
- package/dist/collection/components/info-tile/format/config/info-tile-unit-format.js +1 -1
- package/dist/collection/components/info-tile/format/date-time.js +12 -11
- package/dist/collection/components/info-tile/format/number.js +3 -3
- package/dist/collection/components/info-tile/format/relative-date-time.js +2 -4
- package/dist/collection/components/info-tile/info-tile.js +2 -2
- package/dist/collection/components/kanban/kanban-group/kanban-group.css +4 -4
- package/dist/collection/components/kanban/kanban-item/kanban-item.css +4 -4
- package/dist/collection/components/limeobject/file-viewer/file-viewer.js +2 -2
- package/dist/collection/components/locale-picker/language.js +10 -1
- package/dist/collection/components/locale-picker/locale-picker.js +2 -3
- package/dist/collection/components/mention/mention.js +0 -1
- package/dist/collection/components/navigation-button/navigation-button.css +4 -3
- package/dist/collection/components/notification-list/notification-list.css +2 -2
- package/dist/collection/components/notification-list/notification-list.js +7 -4
- package/dist/collection/components/notification-list/{processNotificationItems.js → process-notification-items.js} +22 -8
- package/dist/collection/components/percentage-visualizer/percentage-visualizer.js +5 -6
- package/dist/collection/components/summary-popover/summary-popover.js +3 -3
- package/dist/collection/components/text-editor/mentions.js +6 -8
- package/dist/collection/components/text-editor/text-editor.js +2 -4
- package/dist/collection/components/text-editor/uploader/building-blocks-upload-handler.js +8 -9
- package/dist/collection/components/text-editor/uploader/building-blocks-uploader.js +1 -1
- package/dist/collection/components/text-editor/utils/searcher-utils.js +5 -0
- package/dist/collection/components/trend-indicator/trend-indicator.js +6 -6
- package/dist/collection/util/dom.js +3 -3
- package/dist/collection/util/limetype.js +11 -11
- package/dist/collection/util/non-null.js +5 -0
- package/dist/collection/util/percentage-class.js +2 -2
- package/dist/collection/util/random-string.js +6 -3
- package/dist/components/chat-item.js +6 -1
- package/dist/components/date-picker.js +3 -3
- package/dist/components/feed-timeline-item.js +2 -3
- package/dist/components/highlight-item.handler.js +2 -2
- package/dist/components/kanban-group.js +1 -1
- package/dist/components/kanban-item.js +1 -1
- package/dist/components/limebb-chat-list.js +32 -14
- package/dist/components/limebb-component-config.js +3 -1
- package/dist/components/limebb-feed.js +1 -1
- package/dist/components/limebb-icon-picker.js +9 -5
- package/dist/components/limebb-info-tile-date-format.js +1 -1
- package/dist/components/limebb-info-tile-format.js +1 -0
- package/dist/components/limebb-info-tile-unit-format.js +1 -1
- package/dist/components/limebb-info-tile.js +19 -20
- package/dist/components/limebb-limeobject-file-viewer.js +2 -2
- package/dist/components/limebb-locale-picker.js +12 -4
- package/dist/components/limebb-mention.js +3 -4
- package/dist/components/limebb-notification-list.js +29 -12
- package/dist/components/limebb-percentage-visualizer.js +5 -6
- package/dist/components/limebb-text-editor.js +39 -36
- package/dist/components/limebb-trend-indicator.js +6 -6
- package/dist/components/navigation-button.js +1 -1
- package/dist/components/non-null.js +5 -0
- package/dist/components/percentage-class.js +2 -2
- package/dist/components/summary-popover.js +3 -3
- package/dist/esm/{highlight-item.handler-96b59c20.js → highlight-item.handler-dfbf11c0.js} +2 -2
- package/dist/esm/{index-cdbbc18d.js → index-96dd111f.js} +3 -28
- package/dist/esm/{index.esm-5e14dac9.js → index.esm-10a8f67c.js} +1 -1
- package/dist/esm/lime-crm-building-blocks.js +2 -2
- package/dist/esm/limebb-browser.entry.js +2 -2
- package/dist/esm/limebb-chat-item_2.entry.js +8 -3
- package/dist/esm/limebb-chat-list.entry.js +34 -16
- package/dist/esm/limebb-component-config.entry.js +5 -3
- package/dist/esm/limebb-component-picker.entry.js +2 -2
- package/dist/esm/limebb-currency-picker.entry.js +3 -3
- package/dist/esm/limebb-dashboard-widget.entry.js +1 -1
- package/dist/esm/limebb-date-picker.entry.js +5 -5
- package/dist/esm/limebb-date-range.entry.js +1 -1
- package/dist/esm/limebb-empty-state.entry.js +1 -1
- package/dist/esm/limebb-feed-timeline-item.entry.js +4 -5
- package/dist/esm/limebb-feed.entry.js +4 -4
- package/dist/esm/limebb-icon-picker.entry.js +10 -6
- package/dist/esm/limebb-info-tile-currency-format.entry.js +1 -1
- package/dist/esm/limebb-info-tile-date-format.entry.js +2 -2
- package/dist/esm/limebb-info-tile-decimal-format.entry.js +1 -1
- package/dist/esm/limebb-info-tile-format.entry.js +2 -1
- package/dist/esm/limebb-info-tile-relative-date-format.entry.js +1 -1
- package/dist/esm/limebb-info-tile-unit-format.entry.js +2 -2
- package/dist/esm/limebb-info-tile.entry.js +21 -22
- package/dist/esm/limebb-kanban-group.entry.js +3 -3
- package/dist/esm/limebb-kanban-item.entry.js +3 -3
- package/dist/esm/limebb-kanban.entry.js +1 -1
- package/dist/esm/limebb-limeobject-file-viewer.entry.js +4 -4
- package/dist/esm/limebb-loader.entry.js +3 -3
- package/dist/esm/limebb-locale-picker.entry.js +14 -6
- package/dist/esm/limebb-mention-group-counter.entry.js +1 -1
- package/dist/esm/limebb-mention.entry.js +5 -6
- package/dist/esm/limebb-navigation-button_2.entry.js +5 -5
- package/dist/esm/limebb-notification-item.entry.js +2 -2
- package/dist/esm/limebb-notification-list.entry.js +31 -14
- package/dist/esm/limebb-percentage-visualizer.entry.js +7 -8
- package/dist/esm/limebb-text-editor-picker.entry.js +1 -1
- package/dist/esm/limebb-text-editor.entry.js +42 -39
- package/dist/esm/limebb-trend-indicator.entry.js +8 -8
- package/dist/esm/loader.js +2 -2
- package/dist/esm/non-null-5a66a269.js +10 -0
- package/dist/esm/{percentage-class-78377c1e.js → percentage-class-1e4748e8.js} +2 -2
- package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/{p-38eec842.entry.js → p-013b852a.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-01cff04f.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-ccc748a1.entry.js → p-0f925b3d.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-29e90714.entry.js → p-10ac8b3e.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-1556b545.js +2 -0
- package/dist/lime-crm-building-blocks/p-1ff94c41.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-b8d49d3e.entry.js → p-218b7f38.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-235aec61.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-ebbd8784.entry.js → p-25e1a434.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-e38afb31.entry.js → p-292631ea.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-67e1ea69.entry.js → p-302e0feb.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-305a14bf.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-99be75d5.entry.js → p-3a406a20.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-3dce616c.entry.js → p-3bd02e86.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-ca79dc23.entry.js → p-4aac81ef.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-eab00e3c.entry.js → p-4caa8bbe.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-d0ce5a35.entry.js → p-568b7520.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-0a331c84.entry.js → p-5f0d0df3.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-66352a1e.js +1 -0
- package/dist/lime-crm-building-blocks/p-6b1a6487.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-6c56121c.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-1eb8fb75.entry.js → p-70ab5db7.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-75abe3ad.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-58faab30.entry.js → p-8491aaa1.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-8bf72bb4.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-8e316957.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-3b9766cc.js → p-9b6ec98b.js} +1 -1
- package/dist/lime-crm-building-blocks/p-a9b0d2e5.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-ad52e723.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-af8c22c4.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-b107fe24.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-27786967.entry.js → p-b5f15f73.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-af6e6696.entry.js → p-c45be80e.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-c5d79dd5.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-adcb57c6.entry.js → p-dd0370cd.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-0779e2b4.entry.js → p-e1e5f461.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-bf322752.entry.js → p-e2128caf.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-f820c983.entry.js +1 -0
- package/dist/test/setup.js +15 -5
- package/dist/types/components/chat-list/{processChatItems.d.ts → process-chat-items.d.ts} +17 -5
- package/dist/types/components/date-picker/to-server-date.d.ts +3 -3
- package/dist/types/components/icon-picker/search.d.ts +9 -0
- package/dist/types/components/locale-picker/language.d.ts +9 -0
- package/dist/types/components/notification-list/{processNotificationItems.d.ts → process-notification-items.d.ts} +17 -5
- package/dist/types/components/text-editor/mentions.d.ts +2 -2
- package/dist/types/components/text-editor/uploader/building-blocks-upload-handler.d.ts +8 -8
- package/dist/types/components/text-editor/utils/searcher-utils.d.ts +5 -0
- package/dist/types/home/runner/work/lime-crm-building-blocks/lime-crm-building-blocks/.stencil/test/setup.d.ts +10 -0
- package/dist/types/util/dom.d.ts +3 -3
- package/dist/types/util/limetype.d.ts +11 -11
- package/dist/types/util/non-null.d.ts +4 -0
- package/dist/types/util/percentage-class.d.ts +2 -2
- package/package.json +8 -25
- package/dist/esm/non-null-d9b0b630.js +0 -5
- package/dist/lime-crm-building-blocks/p-06839012.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-10452278.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-2b8bfe92.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-2e496d18.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-31a55daa.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-37e0254e.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-3d961c1b.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-43c76027.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-46bf22fa.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-506dfcff.js +0 -1
- package/dist/lime-crm-building-blocks/p-51e87162.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-a581f635.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-acce6160.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-c4e6dcf4.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-cf06416b.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-d312f578.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-d736c794.js +0 -2
- /package/dist/lime-crm-building-blocks/{p-2b0ec58c.js → p-10e16feb.js} +0 -0
- /package/dist/lime-crm-building-blocks/{p-6fd28e32.js → p-1484e300.js} +0 -0
package/dist/test/setup.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
/* eslint-disable unicorn/prefer-module */
|
|
1
2
|
import { PlatformServiceName, } from "@limetech/lime-web-components";
|
|
2
3
|
import { TestClient, } from "@lundalogik/limeclient.js/testing";
|
|
3
|
-
import { readFile } from "fs/promises";
|
|
4
|
+
import { readFile } from "node:fs/promises";
|
|
4
5
|
export let testClient;
|
|
5
6
|
let limetypesFixtures;
|
|
6
7
|
let limeobjectsFixtures;
|
|
@@ -12,21 +13,24 @@ const defaultSession = {
|
|
|
12
13
|
admin: true,
|
|
13
14
|
features: {},
|
|
14
15
|
id: '4A2D987FFC5244CD927AE9FE97E325E2DW0000',
|
|
15
|
-
// eslint-disable-next-line camelcase
|
|
16
16
|
user_id: 2901,
|
|
17
17
|
};
|
|
18
18
|
beforeAll(async () => {
|
|
19
19
|
const path = `${__dirname}/../src/components/docs-app/fixtures`;
|
|
20
20
|
limetypesFixtures = await readFile(`${path}/limetypes.yaml`, {
|
|
21
|
-
encoding: '
|
|
21
|
+
encoding: 'utf8',
|
|
22
22
|
});
|
|
23
23
|
limeobjectsFixtures = await readFile(`${path}/limeobjects.yaml`, {
|
|
24
|
-
encoding: '
|
|
24
|
+
encoding: 'utf8',
|
|
25
25
|
});
|
|
26
26
|
translationFixtures = await readFile(`${path}/translations.yaml`, {
|
|
27
|
-
encoding: '
|
|
27
|
+
encoding: 'utf8',
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @param session
|
|
33
|
+
*/
|
|
30
34
|
export function createPlatform(session = {}) {
|
|
31
35
|
testClient = new TestClient({
|
|
32
36
|
fixtures: {
|
|
@@ -38,6 +42,12 @@ export function createPlatform(session = {}) {
|
|
|
38
42
|
});
|
|
39
43
|
return testClient.createPlatform('LimeCRMWebClient');
|
|
40
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
* @param platform
|
|
48
|
+
* @param limetype
|
|
49
|
+
* @param id
|
|
50
|
+
*/
|
|
41
51
|
export async function loadLimeObject(platform, limetype, id) {
|
|
42
52
|
const repository = platform.get(PlatformServiceName.LimeObjectRepository);
|
|
43
53
|
await repository.loadObject(limetype, id);
|
|
@@ -27,11 +27,11 @@ export type ChatGroup = {
|
|
|
27
27
|
/**
|
|
28
28
|
* Processes a list of notifications by adding date headers and a "new items" indicator.
|
|
29
29
|
*
|
|
30
|
-
* @param
|
|
31
|
-
* @param
|
|
32
|
-
* @param
|
|
30
|
+
* @param items - The list of notification items to process. These items must be pre-sorted by their `timestamp` in descending order.
|
|
31
|
+
* @param dateTimeFormatter - A service used to format dates for the date headers.
|
|
32
|
+
* @param lastVisitedTimestamp - The timestamp of the user's last visit. This is used to determine where the "new items" indicator should be placed.
|
|
33
33
|
*
|
|
34
|
-
* @returns
|
|
34
|
+
* @returns An array of processed items, including notifications, date headers, and a "new items" indicator if applicable.
|
|
35
35
|
*
|
|
36
36
|
* @example
|
|
37
37
|
* const processedItems = processNotificationItems(
|
|
@@ -59,8 +59,20 @@ interface ProcessorContext {
|
|
|
59
59
|
lastProcessedDate: string | null;
|
|
60
60
|
hasUnseenNotifications: boolean;
|
|
61
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
* @param context
|
|
65
|
+
*/
|
|
62
66
|
export declare function insertNotifications(context: ProcessorContext): ProcessorContext;
|
|
67
|
+
/**
|
|
68
|
+
*
|
|
69
|
+
* @param context
|
|
70
|
+
*/
|
|
63
71
|
export declare function insertNewItemIndicator(context: ProcessorContext): ProcessorContext;
|
|
72
|
+
/**
|
|
73
|
+
*
|
|
74
|
+
* @param context
|
|
75
|
+
*/
|
|
64
76
|
export declare function insertDateGroups(context: ProcessorContext): ProcessorContext;
|
|
65
77
|
export {};
|
|
66
|
-
//# sourceMappingURL=
|
|
78
|
+
//# sourceMappingURL=process-chat-items.d.ts.map
|
|
@@ -7,9 +7,9 @@ import { DateType } from '@limetech/lime-elements';
|
|
|
7
7
|
* input: 2020-01-01T00:00:00+02:00
|
|
8
8
|
* output: 2020-01-01T00:00:00Z
|
|
9
9
|
*
|
|
10
|
-
* @param
|
|
11
|
-
* @param
|
|
12
|
-
* @returns
|
|
10
|
+
* @param changedDate The date to convert
|
|
11
|
+
* @param type The type of date
|
|
12
|
+
* @returns The converted date
|
|
13
13
|
*/
|
|
14
14
|
export declare function toServerDate(changedDate: Date, type: DateType): Date;
|
|
15
15
|
//# sourceMappingURL=to-server-date.d.ts.map
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { ListItem } from '@limetech/lime-elements';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param query
|
|
5
|
+
* @param icons
|
|
6
|
+
*/
|
|
2
7
|
export declare function findIcons(query: string, icons: Icon[]): Icon[];
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param icon
|
|
11
|
+
*/
|
|
3
12
|
export declare function createListItem(icon: Icon): ListItem;
|
|
4
13
|
export interface Icon {
|
|
5
14
|
id: string;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { HttpClient } from '@limetech/lime-web-components';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param languageCode
|
|
5
|
+
* @param sessionLanguage
|
|
6
|
+
*/
|
|
2
7
|
export declare function getLanguageTitle(languageCode: string, sessionLanguage: string): string;
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param http
|
|
11
|
+
*/
|
|
3
12
|
export declare function getAllLanguages(http: HttpClient): Promise<string[]>;
|
|
4
13
|
//# sourceMappingURL=language.d.ts.map
|
|
@@ -27,11 +27,11 @@ export type NotificationGroup = {
|
|
|
27
27
|
/**
|
|
28
28
|
* Processes a list of notifications by adding date headers and a "new items" indicator.
|
|
29
29
|
*
|
|
30
|
-
* @param
|
|
31
|
-
* @param
|
|
32
|
-
* @param
|
|
30
|
+
* @param items - The list of notification items to process. These items must be pre-sorted by their `timestamp` in descending order.
|
|
31
|
+
* @param dateTimeFormatter - A service used to format dates for the date headers.
|
|
32
|
+
* @param lastVisitedTimestamp - The timestamp of the user's last visit. This is used to determine where the "new items" indicator should be placed.
|
|
33
33
|
*
|
|
34
|
-
* @returns
|
|
34
|
+
* @returns An array of processed items, including notifications, date headers, and a "new items" indicator if applicable.
|
|
35
35
|
*
|
|
36
36
|
* @example
|
|
37
37
|
* const processedItems = processNotificationItems(
|
|
@@ -59,8 +59,20 @@ interface ProcessorContext {
|
|
|
59
59
|
lastProcessedDate: string | null;
|
|
60
60
|
hasUnseenNotifications: boolean;
|
|
61
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
* @param context
|
|
65
|
+
*/
|
|
62
66
|
export declare function insertNotifications(context: ProcessorContext): ProcessorContext;
|
|
67
|
+
/**
|
|
68
|
+
*
|
|
69
|
+
* @param context
|
|
70
|
+
*/
|
|
63
71
|
export declare function insertNewItemIndicator(context: ProcessorContext): ProcessorContext;
|
|
72
|
+
/**
|
|
73
|
+
*
|
|
74
|
+
* @param context
|
|
75
|
+
*/
|
|
64
76
|
export declare function insertDateGroups(context: ProcessorContext): ProcessorContext;
|
|
65
77
|
export {};
|
|
66
|
-
//# sourceMappingURL=
|
|
78
|
+
//# sourceMappingURL=process-notification-items.d.ts.map
|
|
@@ -4,8 +4,8 @@ import { TriggerCharacter } from '@limetech/lime-elements';
|
|
|
4
4
|
/**
|
|
5
5
|
* Get the limetypes that should be available for mentions
|
|
6
6
|
*
|
|
7
|
-
* @param
|
|
8
|
-
* @returns
|
|
7
|
+
* @param limetypes all limetypes
|
|
8
|
+
* @returns mention limetypes
|
|
9
9
|
*/
|
|
10
10
|
export declare function getMentionLimetypes(limetypes: Record<string, LimeType>): LimeType[];
|
|
11
11
|
export declare class MentionsService {
|
|
@@ -7,8 +7,8 @@ export declare class UploadHandler {
|
|
|
7
7
|
/**
|
|
8
8
|
* Handles image paste events in the text editor
|
|
9
9
|
*
|
|
10
|
-
* @param
|
|
11
|
-
* @returns
|
|
10
|
+
* @param imageInserter - The image inserter with the file info
|
|
11
|
+
* @returns Promise resolving to the uploaded file wrapper or undefined if upload fails
|
|
12
12
|
*/
|
|
13
13
|
handleImagePasted(imageInserter: ImageInserter): Promise<FileWrapper | undefined>;
|
|
14
14
|
/**
|
|
@@ -17,8 +17,8 @@ export declare class UploadHandler {
|
|
|
17
17
|
* This function parses a URL to find a file ID that appears before
|
|
18
18
|
* '/contents/' at the end of the URL.
|
|
19
19
|
*
|
|
20
|
-
* @param
|
|
21
|
-
* @returns
|
|
20
|
+
* @param src - The URL string to parse
|
|
21
|
+
* @returns The extracted file ID or undefined if no match is found
|
|
22
22
|
*
|
|
23
23
|
* @example
|
|
24
24
|
* // Returns 123
|
|
@@ -36,15 +36,15 @@ export declare class UploadHandler {
|
|
|
36
36
|
/**
|
|
37
37
|
* Validates that the image file size is within limits
|
|
38
38
|
*
|
|
39
|
-
* @param
|
|
40
|
-
* @returns
|
|
39
|
+
* @param fileInfo - The file info to validate
|
|
40
|
+
* @returns True if file size is valid, false otherwise
|
|
41
41
|
*/
|
|
42
42
|
private validateImageSize;
|
|
43
43
|
/**
|
|
44
44
|
* Creates and uploads a file
|
|
45
45
|
*
|
|
46
|
-
* @param
|
|
47
|
-
* @returns
|
|
46
|
+
* @param fileInfo - The file info to upload
|
|
47
|
+
* @returns Promise resolving to the uploaded file wrapper or undefined if upload fails
|
|
48
48
|
*/
|
|
49
49
|
private createFileUpload;
|
|
50
50
|
private get http();
|
|
@@ -10,5 +10,10 @@ export interface ResponseObject {
|
|
|
10
10
|
_id: number;
|
|
11
11
|
}
|
|
12
12
|
export declare const getItemIndex: (direction: typeof ARROW_UP | typeof ARROW_DOWN, currentItemIndex: number, numberOfItems: number) => number;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param items
|
|
16
|
+
* @param highlightedItemIndex
|
|
17
|
+
*/
|
|
13
18
|
export declare function getUpdatedItems(items: Array<ListItem | ListSeparator>, highlightedItemIndex: number): Array<ListItem | ListSeparator>;
|
|
14
19
|
//# sourceMappingURL=searcher-utils.d.ts.map
|
|
@@ -12,6 +12,16 @@ declare module '@limetech/lime-web-components' {
|
|
|
12
12
|
load(): Promise<void>;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @param session
|
|
18
|
+
*/
|
|
15
19
|
export declare function createPlatform(session?: Partial<TestClientOptions['session']>): BaseLimeWebComponentPlatform;
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @param platform
|
|
23
|
+
* @param limetype
|
|
24
|
+
* @param id
|
|
25
|
+
*/
|
|
16
26
|
export declare function loadLimeObject(platform: BaseLimeWebComponentPlatform, limetype: string, id: number): Promise<LimeObject | undefined>;
|
|
17
27
|
//# sourceMappingURL=setup.d.ts.map
|
package/dist/types/util/dom.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Find the closest parent element matching the given predicate
|
|
3
3
|
*
|
|
4
|
-
* @param
|
|
4
|
+
* @param element - the element to check if it matches the given
|
|
5
5
|
* predicate
|
|
6
|
-
* @param
|
|
7
|
-
* @returns
|
|
6
|
+
* @param predicate - predicate function
|
|
7
|
+
* @returns the matching element if it is found
|
|
8
8
|
*/
|
|
9
9
|
export declare function findParentElement<T = any>(element: HTMLElement, predicate: (e: any) => e is T): (HTMLElement & T) | undefined;
|
|
10
10
|
//# sourceMappingURL=dom.d.ts.map
|
|
@@ -2,33 +2,33 @@ import { LimeProperty, LimeType } from '@limetech/lime-web-components';
|
|
|
2
2
|
/**
|
|
3
3
|
* Whether the given object has the given label or not.
|
|
4
4
|
*
|
|
5
|
-
* @param
|
|
6
|
-
* @param
|
|
7
|
-
* @returns
|
|
5
|
+
* @param object the object to check label for
|
|
6
|
+
* @param label the label to check for
|
|
7
|
+
* @returns true if the object has the label
|
|
8
8
|
*/
|
|
9
9
|
export declare function hasLabel(object: LimeType | LimeProperty, label: string): boolean;
|
|
10
10
|
/**
|
|
11
11
|
* Whether the given property is a hasmany relation or not.
|
|
12
12
|
*
|
|
13
|
-
* @param
|
|
14
|
-
* @returns
|
|
13
|
+
* @param property the property to check
|
|
14
|
+
* @returns true if the property is a hasmany relation
|
|
15
15
|
*/
|
|
16
16
|
export declare function isManyRelation(property: LimeProperty): boolean;
|
|
17
17
|
/**
|
|
18
18
|
* Finds a relation property on the given limetype that is related to a
|
|
19
19
|
* limetype with the given label.
|
|
20
20
|
*
|
|
21
|
-
* @param
|
|
22
|
-
* @param
|
|
23
|
-
* @returns
|
|
21
|
+
* @param limetype the limetype to search for the relation property
|
|
22
|
+
* @param label the label of the target limetype to match
|
|
23
|
+
* @returns the relation property or undefined
|
|
24
24
|
*/
|
|
25
25
|
export declare function getRelationProperty(limetype: LimeType, label: string): LimeProperty | undefined;
|
|
26
26
|
/**
|
|
27
27
|
* Whether the limetype has a hasmany relation of a limetype with the given label
|
|
28
28
|
*
|
|
29
|
-
* @param
|
|
30
|
-
* @param
|
|
31
|
-
* @returns
|
|
29
|
+
* @param limetype the limetype
|
|
30
|
+
* @param relatedLabel the label of the related limetype
|
|
31
|
+
* @returns true if the limetype has the hasmany relation
|
|
32
32
|
*/
|
|
33
33
|
export declare function hasHasManyRelation(limetype: LimeType, relatedLabel: string): boolean;
|
|
34
34
|
//# sourceMappingURL=limetype.d.ts.map
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
* The returned class names can be used in CSS to apply different colors,
|
|
17
17
|
* transformations, or other visual treatments based on the percentage range.
|
|
18
18
|
*
|
|
19
|
-
* @param
|
|
19
|
+
* @param value - The percentage value to classify,
|
|
20
20
|
* can be positive, negative, or zero
|
|
21
|
-
* @returns
|
|
21
|
+
* @returns A class name string representing the percentage range,
|
|
22
22
|
* or an empty string if value is null
|
|
23
23
|
*/
|
|
24
24
|
export declare function getPercentageClass(value: number | null): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@limetech/lime-crm-building-blocks",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.87.0",
|
|
4
4
|
"description": "A home for shared components meant for use with Lime CRM",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -17,16 +17,9 @@
|
|
|
17
17
|
"scripts": {
|
|
18
18
|
"build": "stencil build --config stencil.config.dist.ts",
|
|
19
19
|
"docs:build": "stencil build --docs",
|
|
20
|
-
"docs:publish": "node publish-docs.
|
|
21
|
-
"lint": "
|
|
22
|
-
"lint:fix": "
|
|
23
|
-
"lint:prod": "npm run lint:src:prod && npm run lint:scss:prod",
|
|
24
|
-
"lint:src": "eslint \"**/*.{ts,tsx,js,cjs,mjs}\" --max-warnings=0 && prettier -l \"{!(package*).json,.prettierrc}\"",
|
|
25
|
-
"lint:src:fix": "eslint \"**/*.{ts,tsx,js,cjs,mjs}\" --fix --max-warnings=0 --quiet && prettier --write \"{!(package*).json,.prettierrc}\"",
|
|
26
|
-
"lint:src:prod": "eslint \"**/*.{ts,tsx,js,cjs,mjs}\" --rule \"linebreak-style: [error, unix]\" --max-warnings=0 && prettier -c --end-of-line lf \"{!(package*).json,.prettierrc}\"",
|
|
27
|
-
"lint:scss": "prettier -c --ignore-path ./.gitignore **/*.scss",
|
|
28
|
-
"lint:scss:fix": "prettier --write --ignore-path ./.gitignore **/*.scss",
|
|
29
|
-
"lint:scss:prod": "prettier -c --end-of-line lf --ignore-path ./.gitignore **/*.scss",
|
|
20
|
+
"docs:publish": "node publish-docs.cjs",
|
|
21
|
+
"lint": "eslint --max-warnings=0 && prettier -c --ignore-path .gitignore **/*.scss",
|
|
22
|
+
"lint:fix": "eslint --max-warnings=0 --fix && prettier --write --ignore-path .gitignore **/*.scss",
|
|
30
23
|
"start": "stencil build --dev --watch --serve --docs",
|
|
31
24
|
"test": "cross-env-shell TZ=Europe/Stockholm \"stencil test --spec --e2e --collect-coverage\"",
|
|
32
25
|
"test:watch": "cross-env-shell TZ=Europe/Stockholm \"stencil test --spec --e2e --watchAll\"",
|
|
@@ -41,31 +34,21 @@
|
|
|
41
34
|
"access": "public"
|
|
42
35
|
},
|
|
43
36
|
"devDependencies": {
|
|
44
|
-
"@eslint
|
|
45
|
-
"@
|
|
46
|
-
"@limetech/lime-elements": "^38.19.0",
|
|
37
|
+
"@limetech/eslint-config": "^3.0.1",
|
|
38
|
+
"@limetech/lime-elements": "^38.22.0",
|
|
47
39
|
"@limetech/lime-web-components": "^6.3.0",
|
|
48
40
|
"@limetech/lime-web-components-testing": "^1.0.0",
|
|
49
|
-
"@lundalogik/lime-icons8": "^2.35.
|
|
41
|
+
"@lundalogik/lime-icons8": "^2.35.2",
|
|
50
42
|
"@lundalogik/limeclient.js": "^1.81.0",
|
|
51
43
|
"@stencil/core": "^4.27.2",
|
|
52
44
|
"@stencil/sass": "^3.1.9",
|
|
53
45
|
"@types/jest": "^29.5.14",
|
|
54
46
|
"@types/json-schema": "^7.0.15",
|
|
55
47
|
"@types/lodash-es": "^4.17.12",
|
|
56
|
-
"@typescript-eslint/eslint-plugin": "^8.23.0",
|
|
57
|
-
"@typescript-eslint/parser": "^8.23.0",
|
|
58
48
|
"cross-env": "^7.0.3",
|
|
59
49
|
"currency-codes": "^2.2.0",
|
|
60
50
|
"date-fns": "^3.6.0",
|
|
61
|
-
"eslint": "^9.
|
|
62
|
-
"eslint-config-prettier": "^10.0.1",
|
|
63
|
-
"eslint-plugin-ban": "^2.0.0",
|
|
64
|
-
"eslint-plugin-jsdoc": "^50.6.3",
|
|
65
|
-
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
66
|
-
"eslint-plugin-prettier": "^5.2.3",
|
|
67
|
-
"eslint-plugin-react": "^7.37.4",
|
|
68
|
-
"eslint-plugin-sonarjs": "^3.0.1",
|
|
51
|
+
"eslint": "^9.30.0",
|
|
69
52
|
"fs": "^0.0.1-security",
|
|
70
53
|
"globals": "^16.0.0",
|
|
71
54
|
"jest": "^29.7.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as e}from"./p-d736c794.js";import{c as i,Y as r,K as s,W as n}from"./p-3b9766cc.js";import{i as o,a,b as l,c as u,g as h,d as c,e as f}from"./p-5322fd19.js";import{i as d}from"./p-b31772c8.js";var v=Object.prototype.hasOwnProperty;class p{constructor(t,e=[]){this.platform=t,this.filters=e}async load(t,e){let i;return i=this.isObjectIdentifier(e)?await this.loadLimeObjectInfoTile(t,e):await this.loadBasicInfoTile(t),i}async loadBasicInfoTile(t){const e=this.getFilter(t.filter);if(!e)throw new Error(`Filter "${t.filter}" not found`);return(await this.query.execute({limetype:e.limetype,responseFormat:{aggregates:{infotiles:{value:{op:t.operator,key:t.name}}}},filter:e.filter})).aggregates.infotiles[0].value}async loadLimeObjectInfoTile(t,e){await this.objectRepository.loadObject(e.limetype,e.id,{properties:[t]});const i=this.objectRepository.getObject(e.limetype,e.id);return null==i?void 0:i.getValue([t.name,t.key].join("."))}isObjectIdentifier(t){return Boolean((null==t?void 0:t.limetype)&&(null==t?void 0:t.id))}getFilter(t){return this.filters.find((e=>e.id===t))}get query(){return this.platform.get(i.Query)}get objectRepository(){return this.platform.get(i.LimeObjectRepository)}}class b{constructor(t){this.locale=t}format(t){let e=String(t);return"number"==typeof t?e=new Intl.NumberFormat(this.locale).format(t):new Date(t).getTime()&&(e=new Intl.DateTimeFormat(this.locale).format(new Date(t))),{value:e}}}class g{constructor(t){this.locale=t}format(t,e){const i=new Date(t);return{prefix:this.formatAffix("prefix",i,e),value:this.formatValue(i,e),suffix:this.formatAffix("suffix",i,e)}}formatValue(t,e){var i,r;const s=Object.assign({},e.options);return null===(i=e.prefix)||void 0===i||i.forEach((t=>{delete s[t]})),null===(r=e.suffix)||void 0===r||r.forEach((t=>{delete s[t]})),new Intl.DateTimeFormat(this.locale,s).format(t)}formatAffix(t,e,i){const r=Object.assign({},i.options);if(Object.keys(r).forEach((e=>{"hour12"!==e&&((i[t]||[]).includes(e)||delete r[e])})),0!==Object.values(r).filter(Boolean).length)return new Intl.DateTimeFormat(this.locale,r).format(e)}}class m{constructor(t){this.locale=t}format(t,e){const i=new Intl.NumberFormat(this.locale,e.options),r=i.formatToParts(t);let s="",n="",o="";return r.forEach((t=>{var i,r;(null===(i=e.prefix)||void 0===i?void 0:i.includes(t.type))?s+=t.value:(null===(r=e.suffix)||void 0===r?void 0:r.includes(t.type))?o+=t.value:n+=t.value})),n||(n=i.format(t),s="",o=""),{prefix:s,value:n,suffix:o}}}class w{constructor(t){this.locale=t}format(t,e){const i=new Intl.RelativeTimeFormat(this.locale,e.options),{value:r,unit:s}=this.getRelativeTime(t),n=i.formatToParts(r,s);let o="",a="",l="";return n.forEach((t=>{"literal"!==t.type||a?"literal"===t.type&&a?l+=t.value:a+=t.value:o+=t.value})),a||(a=o||l,o="",l=""),{prefix:o,value:a,suffix:l}}getRelativeTime(t){const e=new Date(t),i=new Date,r=e.getTime()-i.getTime(),s=[{unit:"year",value:31536e6},{unit:"month",value:2592e6},{unit:"week",value:6048e5},{unit:"day",value:864e5},{unit:"hour",value:36e5},{unit:"minute",value:6e4},{unit:"second",value:1e3}];for(const t of s){const e=r/t.value;if(Math.abs(e)>=1)return{value:Math.round(e),unit:t.unit}}return{value:0,unit:"second"}}}class y{constructor(t){this.locale=t}createFormatter(t,e){return"number"===(null==t?void 0:t.type)&&"number"==typeof e?new m(this.locale):"date"===(null==t?void 0:t.type)&&"string"==typeof e?new g(this.locale):"relative-date"===(null==t?void 0:t.type)&&"string"==typeof e?new w(this.locale):new b(this.locale)}}var j=function(t,e,i,r){var s,n=arguments.length,o=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,i,o):s(e,i))||o);return n>3&&o&&Object.defineProperty(e,i,o),o};const O=class{constructor(e){t(this,e),this.aggregateOperator=n.Count,this.loading=!1,this.error=!1}componentWillLoad(){this.loadInfoTileValue()}watchFilterId(){this.loadInfoTileValue()}watchPropertyName(){this.loadInfoTileValue()}watchAggregateOperator(){this.loadInfoTileValue()}async loadInfoTileValue(){if(this.loading=!0,this.error=!1,this.getFilter()){try{const t={key:this.getKey(),name:this.propertyName,operator:this.aggregateOperator,filter:this.filterId};this.value=await this.loader.load(t,this.context)}catch(t){console.error(t),this.error=!0}this.loading=!1}else this.error=!0}getKey(){return Math.random().toString(36).slice(2)}render(){var t,i;const r=this.getFilter(),s=this.getFormattedValue(),n={disabled:this.disabled,icon:this.icon,prefix:(null===(t=null==s?void 0:s.prefix)||void 0===t?void 0:t.trim())||this.prefix,suffix:(null===(i=null==s?void 0:s.suffix)||void 0===i?void 0:i.trim())||this.suffix},o=Object.assign(Object.assign({},n),{icon:"error",prefix:"ERROR",loading:!0,label:this.getLabel(r)}),a=Object.assign(Object.assign({},n),{label:this.getLabel(r),link:this.getLink(r),loading:this.loading,value:null==s?void 0:s.value.trim()});return e("limel-info-tile",Object.assign({key:"43a5d8a0eb0b877f607c549900593f98e68396ed",class:{error:!r||this.error}},!r||this.error?o:a))}getFormattedValue(){if(!this.value&&0!==this.value)return{value:""};try{return this.getFormatter(this.value).format(this.value,this.format)}catch(t){return new b(this.language).format(this.value)}}getLabel(t){return t?"string"==typeof this.label?this.translator.get(this.label):this.getLocalizedString(this.label&&"object"==typeof this.label?this.label:t.name):"No filter set is selected"}getLocalizedString(t){if(function(t){if(null==t)return!0;if(o(t)&&(d(t)||"string"==typeof t||"function"==typeof t.splice||a(t)||l(t)||u(t)))return!t.length;var e=h(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(c(t))return!f(t).length;for(var i in t)if(v.call(t,i))return!1;return!0}(t))return"";let e=t[this.language];return e||(e=t.en||t.en_us||Object.values(null!=e?e:{}).find((t=>!!t))),null!=e?e:""}getLink(t){return t?{href:["explorer",t.limetype,t.id].join("/")}:{href:"#"}}getFilter(){var t;return null===(t=this.filters)||void 0===t?void 0:t.find((t=>t.id===this.filterId))}getFormatter(t){return new y(this.language).createFormatter(this.format,t)}get translator(){return this.platform.get(i.Translate)}get language(){return this.platform.get(i.Application).getLanguage()}get loader(){return new p(this.platform,this.filters)}static get watchers(){return{filterId:["watchFilterId"],propertyName:["watchPropertyName"],aggregateOperator:["watchAggregateOperator"]}}};j([r({})],O.prototype,"config",void 0),j([s()],O.prototype,"filters",void 0),O.style=":host(limebb-info-tile){display:block;overflow:visible !important;background-color:transparent !important}limel-info-tile.error{--info-tile-icon-color:rgb(var(--color-red-dark));border:1px dashed rgb(var(--contrast-500));border-radius:var(--info-tile-border-radius, 1rem)}";export{O as limebb_info_tile}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as i}from"./p-d736c794.js";const n=["acre","bit","byte","celsius","centimeter","day","degree","fahrenheit","fluid-ounce","foot","gallon","gigabit","gigabyte","gram","hectare","hour","inch","kilobit","kilobyte","kilogram","kilometer","liter","megabit","megabyte","meter","microsecond","mile","mile-scandinavian","milliliter","millimeter","millisecond","minute","month","nanosecond","ounce","percent","petabyte","pound","second","stone","terabit","terabyte","week","yard","year"],l=class{constructor(i){t(this,i),this.change=e(this,"change",7),this.getOptionValue=t=>t.value,this.getAffixValue=t=>{if(t.length)return t.map((t=>t.value))},this.handleChangeOptions=(t,e=(t=>t))=>i=>{i.stopPropagation(),this.change.emit(Object.assign(Object.assign({},this.value),{options:Object.assign(Object.assign({},this.value.options),{[t]:e(i.detail)||void 0})}))},this.handleChangeAffix=t=>e=>{e.stopPropagation(),this.change.emit(Object.assign(Object.assign({},this.value),{[t]:this.getAffixValue(e.detail)}))}}render(){return[this.renderNotation(),this.renderUnit(),this.renderUnitDisplay(),this.renderCompactDisplay(),this.renderAffix("prefix"),this.renderAffix("suffix")]}renderUnit(){const t=n.map((t=>({value:t,text:this.getUnitName(t)}))).filter((t=>t.text)),e=t.find((t=>{var e;return t.value===(null===(e=this.value.options)||void 0===e?void 0:e.unit)}));return i("limel-select",{label:"Unit",options:t,value:e,onChange:this.handleChangeOptions("unit",this.getOptionValue)})}getUnitName(t){var e,i;return null!==(i=null===(e=Intl.NumberFormat("en",{style:"unit",unit:t,unitDisplay:"long"}).formatToParts(1).find((t=>"unit"===t.type)))||void 0===e?void 0:e.value)&&void 0!==i?i:""}renderUnitDisplay(){const t=[{value:"short",text:"Short"},{value:"long",text:"Long"}],e=t.find((t=>{var e;return t.value===(null===(e=this.value.options)||void 0===e?void 0:e.unitDisplay)}));return i("limel-select",{label:"Unit display",helperText:"The unit formatting style to use in unit formatting",options:t,value:e,onChange:this.handleChangeOptions("unitDisplay",this.getOptionValue)})}renderNotation(){const t=[{text:"Standard",value:"standard"},{text:"Compact",value:"compact"}],e=t.find((t=>{var e;return t.value===(null===(e=this.value.options)||void 0===e?void 0:e.notation)}));return i("limel-select",{label:"Notation",helperText:"The formatting that should be displayed for the number",options:t,value:e,onChange:this.handleChangeOptions("notation",this.getOptionValue)})}renderCompactDisplay(){const t=[{text:"Short",value:"short"},{text:"Long",value:"long"}],e=t.find((t=>{var e;return t.value===(null===(e=this.value.options)||void 0===e?void 0:e.compactDisplay)}));return i("limel-select",{label:"Compact display",options:t,value:e,onChange:this.handleChangeOptions("compactDisplay",this.getOptionValue)})}renderAffix(t){const e=[{text:"Compact notation",value:"compact"},{text:"Unit",value:"unit"}],n=e.filter((e=>{var i;return null===(i=this.value[t])||void 0===i?void 0:i.includes(e.value)}));return i("limel-select",{multiple:!0,label:t.charAt(0).toUpperCase()+t.slice(1),options:e,value:n,onChange:this.handleChangeAffix(t)})}};export{l as limebb_info_tile_unit_format}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as i}from"./p-d736c794.js";const r=class{constructor(i){e(this,i),this.change=t(this,"change",7),this.getOptionValue=e=>e.value||void 0,this.getAffixValue=e=>e.length?e.map((e=>e.value)):[],this.handleChangeOptions=(e,t=(e=>e))=>i=>{i.stopPropagation(),this.change.emit(Object.assign(Object.assign({},this.value),{options:Object.assign(Object.assign({},this.value.options),{[e]:t(i.detail)||void 0})}))},this.handleChangeAffix=e=>t=>{t.stopPropagation(),this.change.emit(Object.assign(Object.assign({},this.value),{[e]:this.getAffixValue(t.detail)}))},this.handleChangeHour12=e=>{e.stopPropagation();let t=JSON.parse(e.detail.value);null===t&&(t=void 0),this.change.emit(Object.assign(Object.assign({},this.value),{options:Object.assign(Object.assign({},this.value.options),{hour12:t})}))}}render(){return[this.renderDate(),this.renderTime(),this.renderAffix("prefix"),this.renderAffix("suffix")]}renderDate(){return i("limel-header",{icon:"calendar",heading:"Date settings"},i("section",null,this.renderDay(),this.renderMonth(),this.renderYear(),this.renderWeekday()))}renderDay(){const e=[{value:"",text:""},{value:"2-digit",text:"2 digit"},{value:"numeric",text:"Numeric"}],t=e.find((e=>{var t;return e.value&&e.value===(null===(t=this.value.options)||void 0===t?void 0:t.day)}));return i("limel-select",{label:"Day",options:e,value:t,onChange:this.handleChangeOptions("day",this.getOptionValue)})}renderMonth(){const e=[{value:"",text:""},{value:"long",text:"Long"},{value:"narrow",text:"Narrow"},{value:"short",text:"Short"},{value:"2-digit",text:"2 digit"},{value:"numeric",text:"Numeric"}],t=e.find((e=>{var t;return e.value&&e.value===(null===(t=this.value.options)||void 0===t?void 0:t.month)}));return i("limel-select",{label:"Month",options:e,value:t,onChange:this.handleChangeOptions("month",this.getOptionValue)})}renderYear(){const e=[{value:"",text:""},{value:"2-digit",text:"2 digit"},{value:"numeric",text:"Numeric"}],t=e.find((e=>{var t;return e.value&&e.value===(null===(t=this.value.options)||void 0===t?void 0:t.year)}));return i("limel-select",{label:"Year",options:e,value:t,onChange:this.handleChangeOptions("year",this.getOptionValue)})}renderWeekday(){const e=[{value:"",text:""},{value:"long",text:"Long"},{value:"narrow",text:"Narrow"},{value:"short",text:"Short"}],t=e.find((e=>{var t;return e.value&&e.value===(null===(t=this.value.options)||void 0===t?void 0:t.weekday)}));return i("limel-select",{label:"Weekday",options:e,value:t,onChange:this.handleChangeOptions("weekday",this.getOptionValue)})}renderTime(){return i("limel-header",{icon:"clock",heading:"Time settings"},i("section",null,this.renderHour(),this.renderMinute(),this.renderSecond(),this.renderHour12()))}renderHour(){const e=[{value:"",text:""},{value:"2-digit",text:"2 digit"},{value:"numeric",text:"Numeric"}],t=e.find((e=>{var t;return e.value&&e.value===(null===(t=this.value.options)||void 0===t?void 0:t.hour)}));return i("limel-select",{label:"Hour",options:e,value:t,onChange:this.handleChangeOptions("hour",this.getOptionValue)})}renderMinute(){const e=[{value:"",text:""},{value:"2-digit",text:"2 digit"},{value:"numeric",text:"Numeric"}],t=e.find((e=>{var t;return e.value&&e.value===(null===(t=this.value.options)||void 0===t?void 0:t.minute)}));return i("limel-select",{label:"Minute",options:e,value:t,onChange:this.handleChangeOptions("minute",this.getOptionValue)})}renderSecond(){const e=[{value:"",text:""},{value:"2-digit",text:"2 digit"},{value:"numeric",text:"Numeric"}],t=e.find((e=>{var t;return e.value&&e.value===(null===(t=this.value.options)||void 0===t?void 0:t.second)}));return i("limel-select",{label:"Second",options:e,value:t,onChange:this.handleChangeOptions("second",this.getOptionValue)})}renderHour12(){const e=[{value:"null",text:"Default",secondaryText:"Locale dependent"},{value:"true",text:"12 hour"},{value:"false",text:"24 hour"}],t=e.find((e=>{var t,i;return e.value===String(null===(t=this.value.options)||void 0===t?void 0:t.hour12)||"null"===e.value&&void 0===(null===(i=this.value.options)||void 0===i?void 0:i.hour12)}));return i("limel-select",{label:"Clock format",options:e,value:t,onChange:this.handleChangeHour12})}renderAffix(e){const t=[{text:"Weekday",value:"weekday"},{text:"Day",value:"day"},{text:"Month",value:"month"},{text:"Year",value:"year"},{text:"Hour",value:"hour"},{text:"Minute",value:"minute"},{text:"Second",value:"second"}].map((e=>Object.assign(Object.assign({},e),{disabled:!Object.keys(this.value.options||{}).includes(e.value)}))),r=t.filter((t=>{var i;return t.value&&(null===(i=this.value[e])||void 0===i?void 0:i.includes(t.value))}));return i("limel-select",{multiple:!0,label:e.charAt(0).toUpperCase()+e.slice(1),options:t,value:r,onChange:this.handleChangeAffix(e)})}};r.style="*{box-sizing:border-box}:host(limebb-info-tile-date-format){display:grid;gap:0.5rem;grid-template-columns:1fr 1fr !important}limel-header{flex-wrap:wrap;grid-column:1/-1;overflow:hidden;border-radius:0.7rem;border:1px solid rgb(var(--contrast-100))}limel-header section{width:100%;padding:0.5rem;display:grid;gap:0.5rem;grid-template-columns:repeat(auto-fit, minmax(8rem, 1fr))}";export{r as limebb_info_tile_date_format}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as o,c as t}from"./p-d736c794.js";const r={expand:"expand",minimize:"minus_math",maximize:"minus_math",newTab:"up_right_arrow",back:"left_arrow",close:"multiply",shrink:"compress",float:"rectangle"},i=class{constructor(t){e(this,t),this.renderAsLink=()=>o("a",{class:this.getContainerClassList(),id:"tooltipId","aria-label":this.tooltipLabel&&this.tooltipHelperLabel,href:this.href,target:"newTab"===this.type?"_blank":void 0},this.renderType(),this.renderTooltip()),this.renderAsButton=()=>o("button",{class:this.getContainerClassList(),id:"tooltipId","aria-label":this.tooltipLabel&&this.tooltipHelperLabel},this.renderType(),this.renderTooltip()),this.getContainerClassList=()=>({"navigation-button":!0,[this.type]:!0})}render(){return this.href?this.renderAsLink():this.renderAsButton()}renderType(){return this.renderIcon(r[this.type])}renderTooltip(){if(this.tooltipLabel)return o("limel-tooltip",{label:this.tooltipLabel,helperLabel:this.tooltipHelperLabel,elementId:"tooltipId"})}renderIcon(e){return o("limel-icon",{name:e})}static get delegatesFocus(){return!0}};i.style='@charset "UTF-8";.navigation-button{all:unset;isolation:isolate;position:relative;display:flex;justify-content:center;align-items:center;height:1.875rem;width:1.875rem;border-radius:50%;transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--mdc-theme-on-surface);background-color:var(--navigation-button-background-color, var(--lime-elevated-surface-background-color))}.navigation-button:hover,.navigation-button:focus,.navigation-button:focus-visible{will-change:color, background-color, box-shadow, transform}.navigation-button:hover{transform:translate3d(0, 0.01rem, 0);color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}.navigation-button:active{--limel-clickable-transform-timing-function:cubic-bezier(\n 0.83,\n -0.15,\n 0.49,\n 1.16\n );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.navigation-button:hover,.navigation-button:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.navigation-button:focus{outline:none}.navigation-button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.navigation-button limel-icon{transition:color 0.2s ease, transform 0.2s cubic-bezier(0.84, 0.15, 0.52, 1.42);color:var(--header-menu-icon-color);width:1.25rem}.newTab limel-icon{transition:transform 0.2s ease;transform:scale(0.8);z-index:3}.newTab:before{z-index:2}.newTab::after{z-index:1}.newTab:before,.newTab:after{content:"";transition:transform 0.2s ease, border-color 0.2s ease;position:absolute;width:0.875rem;height:0.875rem;border:1px solid rgb(var(--contrast-900));background-color:var(--navigation-button-background-color, rgb(var(--contrast-100)))}.newTab:hover limel-icon{color:var(--mdc-theme-primary);transform:translate3d(-0.1rem, 0.1rem, 0) scale(1)}.newTab:hover:before{transform:translate3d(0.125rem, -0.125rem, 0);border-color:rgb(var(--contrast-1000));box-shadow:var(--shadow-depth-8)}.newTab:hover:after{transform:translate3d(-0.15rem, 0.15rem, 0) scale(0.9);border-color:rgb(var(--contrast-700))}.expand:after{transition:transform 0.2s ease;content:"";position:absolute;z-index:1;background-color:var(--navigation-button-background-color, rgb(var(--contrast-100)));width:0.75rem;height:0.75rem}.expand:hover limel-icon{color:var(--mdc-theme-primary)}.expand:hover:after{transform:scale(0.5)}.expand:hover limel-icon{transform:scale(1.18)}.minimize:before,.minimize:after,.maximize:before,.maximize:after{content:"";transition:transform 0.3s ease-out 0.15s, background-color 0.1s ease}.minimize limel-icon,.maximize limel-icon{transition:transform 0.2s ease 0.1s}.minimize:before,.maximize:after,.maximize:hover:before{transform:scaleY(1) scaleX(1);z-index:-1;box-sizing:border-box;position:absolute;width:70%;height:60%;border-radius:0.25rem;transform-origin:bottom}.minimize:hover:before,.maximize:before{transition:transform 0.3s ease-out 0.15s, background-color 0.1s ease;transform:scaleY(0.3) scaleX(0.7);background-color:rgb(var(--contrast-500))}.minimize:hover limel-icon,.maximize limel-icon{transform:scaleX(0.8) translate3d(0, 0.4rem, 0)}.maximize limel-icon{color:rgb(var(--contrast-900))}.maximize:hover limel-icon{color:currentColor;transform:scaleX(1.1) translate3d(0, -0.1rem, 0)}.maximize:after{z-index:-2;border:1px dashed rgb(var(--contrast-800))}.close limel-icon{transition:transform 0.2s ease, color 0.2s ease}.close:before,.close:after{transition-delay:0.1s;content:"";position:absolute;inset:0;border-radius:50%;opacity:0}.close:before{transition:transform 0.3s ease, opacity 0.3s ease;background-color:rgb(var(--color-orange-dark))}.close:after{transition:transform 0.6s ease, opacity 0.6s ease;background-color:rgb(var(--color-orange-light))}.close:hover limel-icon{color:rgb(var(--color-white));transform:scale(0.7) rotate(90deg)}.close:hover:before{opacity:1;transform:scale(0.4)}.close:hover:after{opacity:0.4;transform:scale(0.6)}.float:after{transition:width 0.2s ease-out, opacity 0.2s ease;content:"";position:absolute;inset:0 0.5rem 0 auto;border-radius:1px;opacity:0.8;transform:translate3d(0, 0, 0);background-color:rgb(var(--contrast-800));width:0.125rem;height:0.6rem;margin:auto}.float:hover:after{width:0.4rem;opacity:1;transform:translate3d(0, 0, 0)}';const a=class{constructor(o){e(this,o),this.actionSelected=t(this,"actionSelected",7),this.triggerDelay=600,this.openDirection="top",this.popoverMaxWidth="20rem",this.popoverMaxHeight="min(35rem, calc(100vh - 2rem))",this.actions=[],this.isPopoverOpen=!1,this.openPopoverWithDelay=e=>{e.stopPropagation(),clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>{a.currentOpenPopover&&a.currentOpenPopover!==this&&(a.currentOpenPopover.isPopoverOpen=!1),a.currentOpenPopover=this,this.isPopoverOpen=!0}),this.triggerDelay)},this.resetTimeout=()=>{this.isPopoverOpen||clearTimeout(this.hoverTimeout)},this.onPopoverClose=e=>{e.stopPropagation(),this.isPopoverOpen=!1,a.currentOpenPopover===this&&(a.currentOpenPopover=null)},this.handleCloseClick=e=>{e.stopPropagation(),this.isPopoverOpen=!1},this.handleSelected=e=>{this.actionSelected.emit(e.detail)}}render(){return o("limel-popover",{key:"74e4b8de041fc9cc7b3399981a7d31a5410c5256",style:{"--limebb-summary-popover-timeout":`${this.triggerDelay}ms`},open:this.isPopoverOpen,onClose:this.onPopoverClose,openDirection:this.openDirection},o("div",{key:"3e0c73d427cfa2e3c00676b14b53426599223ed2",slot:"trigger",tabIndex:0,onMouseEnter:this.openPopoverWithDelay,onMouseLeave:this.resetTimeout,onFocus:this.openPopoverWithDelay},o("slot",{key:"f84cd9504c8707e00d98bac74efdcf570a72c3fd",name:"trigger"}),o("div",{key:"3d106b4033246c3db9d27ae251f18f346366f29f",class:"opening-countdown-indicator"})),o("limel-card",{key:"f23a6ee9b08ff10b270cb411a5ec2e212a3bd3ab",style:{"max-width":this.popoverMaxWidth,"max-height":this.popoverMaxHeight,"min-width":"7rem","min-height":"3rem"},orientation:"landscape",heading:this.heading,subheading:this.subheading,icon:this.icon,value:this.value,image:this.image,actions:this.actions,onActionSelected:this.handleSelected},o("limebb-navigation-button",{key:"015c7e0054a544de06554b2b9c86db40262e800f",slot:"component",type:"close",style:{"--navigation-button-background-color":"rgb(var(--contrast-100), 0.8)",position:"absolute",top:"0.125rem",right:"0.125rem"},tooltipLabel:"Close",tooltipHelperLabel:"Esc",onClick:this.handleCloseClick})))}};a.currentOpenPopover=null,a.style="limel-popover{--popover-border-radius:0.95rem;--popover-body-background-color:transparent;--popover-box-shadow:var(--shadow-depth-8)}div[slot=trigger]{position:relative;display:flex;align-items:center;justify-content:center}div[slot=trigger] *{min-width:0;min-height:0}.opening-countdown-indicator{position:absolute;inset:auto 0 -0.25rem 0;margin:0 auto;height:0.125rem;border-radius:1rem;transition:width ease-out, opacity ease;transition-duration:120ms;opacity:0;width:0%;background-color:var(--mdc-theme-primary)}div[slot=trigger]:not([aria-expanded=true]):hover .opening-countdown-indicator{transition-duration:var(--limebb-summary-popover-timeout);opacity:1;width:100%}";export{i as limebb_navigation_button,a as limebb_summary_popover}
|