@limetech/lime-crm-building-blocks 1.95.0 → 1.97.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 +14 -0
- package/dist/cjs/{_MapCache-2e84a981.js → _MapCache-8b125fbb.js} +0 -26
- package/dist/cjs/{_Uint8Array-1e99726d.js → _Uint8Array-95263550.js} +1 -12
- package/dist/cjs/_baseIsEqual-cb7951b0.js +496 -0
- package/dist/cjs/_defineProperty-40a6ad5d.js +15 -0
- package/dist/cjs/{get-1acf79ce.js → get-932b213e.js} +5 -4
- package/dist/cjs/isEqual-e77cce75.js +37 -0
- package/dist/cjs/isSymbol-5b36aeee.js +30 -0
- package/dist/cjs/lime-crm-building-blocks.cjs.js +1 -1
- package/dist/cjs/lime-query.types-bcb63a22.js +61 -0
- package/dist/cjs/limebb-component-config.cjs.entry.js +3 -2
- package/dist/cjs/limebb-document-item.cjs.entry.js +174 -0
- package/dist/cjs/limebb-document-picker.cjs.entry.js +82 -0
- package/dist/cjs/limebb-feed-item-thumbnail-file-info.cjs.entry.js +1 -1
- package/dist/cjs/limebb-feed-timeline-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-feed.cjs.entry.js +1 -1
- package/dist/cjs/limebb-icon-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-info-tile-format.cjs.entry.js +1 -1
- package/dist/cjs/limebb-info-tile.cjs.entry.js +1 -1
- package/dist/cjs/limebb-kanban-group.cjs.entry.js +1 -1
- package/dist/cjs/limebb-kanban-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +382 -150
- package/dist/cjs/limebb-lime-query-filter-and_5.cjs.entry.js +278 -0
- package/dist/cjs/limebb-lime-query-value-input.cjs.entry.js +239 -0
- package/dist/cjs/limebb-limetype-field_2.cjs.entry.js +406 -0
- package/dist/cjs/limebb-live-docs-info.cjs.entry.js +2 -2
- package/dist/cjs/limebb-locale-picker.cjs.entry.js +13 -498
- package/dist/cjs/limebb-mention-group-counter.cjs.entry.js +2 -2
- package/dist/cjs/limebb-navigation-button_2.cjs.entry.js +3 -3
- package/dist/cjs/limebb-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-percentage-visualizer.cjs.entry.js +2 -2
- package/dist/cjs/limebb-property-selector.cjs.entry.js +234 -0
- package/dist/cjs/limebb-response-format-item.cjs.entry.js +80 -0
- package/dist/cjs/limebb-text-editor.cjs.entry.js +22 -83
- package/dist/cjs/limebb-trend-indicator.cjs.entry.js +1 -1
- package/dist/cjs/limetype-1fe0207f.js +90 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/property-resolution-fb42a46b.js +66 -0
- package/dist/cjs/random-string-aac0a74b.js +24 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/document-picker/document-item/document-item.css +64 -0
- package/dist/collection/components/document-picker/document-item/document-item.js +265 -0
- package/dist/collection/components/document-picker/document-item/document-item.types.js +1 -0
- package/dist/collection/components/document-picker/document-picker.css +139 -0
- package/dist/collection/components/document-picker/document-picker.js +304 -0
- package/dist/collection/components/document-picker/document.types.js +1 -0
- package/dist/collection/components/feed/feed-item/feed-timeline-item.js +1 -1
- package/dist/collection/components/feed/feed-item-thumbnail-file-info/feed-item-thumbnail-file-info.js +1 -1
- package/dist/collection/components/feed/feed.js +1 -1
- package/dist/collection/components/icon-picker/icon-picker.js +1 -1
- package/dist/collection/components/info-tile/format/config/info-tile-format.js +1 -1
- package/dist/collection/components/info-tile/info-tile.js +1 -1
- package/dist/collection/components/kanban/kanban-group/kanban-group.js +1 -1
- package/dist/collection/components/kanban/kanban-item/kanban-item.js +1 -1
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-and.css +121 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-and.js +257 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-comparison.css +39 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-comparison.js +246 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-expression.css +104 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-expression.js +220 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-not.css +107 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-not.js +212 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-or.css +123 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-or.js +237 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-value-input.css +48 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-value-input.js +457 -0
- package/dist/collection/components/lime-query-builder/filter-conversion.js +118 -21
- package/dist/collection/components/lime-query-builder/lime-query-builder.css +30 -17
- package/dist/collection/components/lime-query-builder/lime-query-builder.js +233 -28
- package/dist/collection/components/lime-query-builder/limetype-field/limetype-field.js +435 -0
- package/dist/collection/components/lime-query-builder/property-selection-format.js +158 -0
- package/dist/collection/components/lime-query-builder/property-selector/property-selector.css +8 -0
- package/dist/collection/components/lime-query-builder/property-selector/property-selector.js +422 -0
- package/dist/collection/components/lime-query-builder/response-format-editor.css +72 -0
- package/dist/collection/components/lime-query-builder/response-format-editor.js +249 -0
- package/dist/collection/components/lime-query-builder/response-format-item.css +61 -0
- package/dist/collection/components/lime-query-builder/response-format-item.js +208 -0
- package/dist/collection/components/limeobject/file-viewer/live-docs-info.js +2 -2
- package/dist/collection/components/locale-picker/locale-picker.js +1 -1
- package/dist/collection/components/notification-list/notification-item/notification-item.js +1 -1
- package/dist/collection/components/percentage-visualizer/percentage-visualizer.js +2 -2
- package/dist/collection/components/summary-popover/summary-popover.js +3 -3
- package/dist/collection/components/text-editor/mention-group-counter.js +2 -2
- package/dist/collection/components/text-editor/text-editor.js +1 -1
- package/dist/collection/components/trend-indicator/trend-indicator.js +1 -1
- package/dist/collection/util/format-bytes.js +36 -0
- package/dist/components/_MapCache.js +2 -27
- package/dist/components/_Uint8Array.js +2 -12
- package/dist/components/_baseIsEqual.js +494 -0
- package/dist/components/_defineProperty.js +13 -0
- package/dist/components/document-item.js +190 -0
- package/dist/components/feed-item-thumbnail-file-info.js +1 -1
- package/dist/components/feed-timeline-item.js +1 -1
- package/dist/components/get.js +2 -1
- package/dist/components/isEqual.js +35 -0
- package/dist/components/isSymbol.js +28 -0
- package/dist/components/kanban-group.js +1 -1
- package/dist/components/kanban-item.js +1 -1
- package/dist/components/lime-query-filter-and.js +408 -0
- package/dist/components/lime-query-filter-comparison.js +152 -0
- package/dist/components/lime-query-value-input.js +266 -0
- package/dist/components/limebb-document-item.d.ts +11 -0
- package/dist/components/limebb-document-item.js +6 -0
- package/dist/components/limebb-document-picker.d.ts +11 -0
- package/dist/components/limebb-document-picker.js +111 -0
- package/dist/components/limebb-feed.js +1 -1
- package/dist/components/limebb-icon-picker.js +1 -1
- package/dist/components/limebb-info-tile-format.js +1 -1
- package/dist/components/limebb-info-tile.js +1 -1
- package/dist/components/limebb-lime-query-builder.js +441 -149
- package/dist/components/limebb-lime-query-filter-and.d.ts +11 -0
- package/dist/components/limebb-lime-query-filter-and.js +6 -0
- package/dist/components/limebb-lime-query-filter-comparison.d.ts +11 -0
- package/dist/components/limebb-lime-query-filter-comparison.js +6 -0
- package/dist/components/limebb-lime-query-filter-expression.d.ts +11 -0
- package/dist/components/limebb-lime-query-filter-expression.js +6 -0
- package/dist/components/limebb-lime-query-filter-not.d.ts +11 -0
- package/dist/components/limebb-lime-query-filter-not.js +6 -0
- package/dist/components/limebb-lime-query-filter-or.d.ts +11 -0
- package/dist/components/limebb-lime-query-filter-or.js +6 -0
- package/dist/components/limebb-lime-query-value-input.d.ts +11 -0
- package/dist/components/limebb-lime-query-value-input.js +6 -0
- package/dist/components/limebb-limetype-field.d.ts +11 -0
- package/dist/components/limebb-limetype-field.js +6 -0
- package/dist/components/limebb-locale-picker.js +8 -493
- package/dist/components/limebb-mention-group-counter.js +2 -2
- package/dist/components/limebb-percentage-visualizer.js +2 -2
- package/dist/components/limebb-property-selector.d.ts +11 -0
- package/dist/components/limebb-property-selector.js +6 -0
- package/dist/components/limebb-response-format-editor.d.ts +11 -0
- package/dist/components/limebb-response-format-editor.js +6 -0
- package/dist/components/limebb-response-format-item.d.ts +11 -0
- package/dist/components/limebb-response-format-item.js +6 -0
- package/dist/components/limebb-text-editor.js +8 -69
- package/dist/components/limebb-trend-indicator.js +1 -1
- package/dist/components/limetype-field.js +184 -0
- package/dist/components/limetype.js +85 -0
- package/dist/components/live-docs-info.js +2 -2
- package/dist/components/notification-item.js +1 -1
- package/dist/components/property-selector.js +317 -0
- package/dist/components/random-string.js +22 -0
- package/dist/components/response-format-editor.js +278 -0
- package/dist/components/response-format-item.js +104 -0
- package/dist/components/summary-popover.js +3 -3
- package/dist/esm/{_MapCache-6484495d.js → _MapCache-af496e9d.js} +2 -27
- package/dist/esm/{_Uint8Array-e5cac922.js → _Uint8Array-d6ebd526.js} +3 -13
- package/dist/esm/_baseIsEqual-28053b81.js +494 -0
- package/dist/esm/_defineProperty-e6a185c3.js +13 -0
- package/dist/esm/{get-f9e0b2e1.js → get-3e42932b.js} +2 -1
- package/dist/esm/isEqual-57d0c223.js +35 -0
- package/dist/esm/isSymbol-1c5f65cc.js +28 -0
- package/dist/esm/lime-crm-building-blocks.js +1 -1
- package/dist/esm/lime-query.types-f72355e1.js +59 -0
- package/dist/esm/limebb-component-config.entry.js +3 -2
- package/dist/esm/limebb-document-item.entry.js +170 -0
- package/dist/esm/limebb-document-picker.entry.js +78 -0
- package/dist/esm/limebb-feed-item-thumbnail-file-info.entry.js +1 -1
- package/dist/esm/limebb-feed-timeline-item.entry.js +1 -1
- package/dist/esm/limebb-feed.entry.js +1 -1
- package/dist/esm/limebb-icon-picker.entry.js +1 -1
- package/dist/esm/limebb-info-tile-format.entry.js +1 -1
- package/dist/esm/limebb-info-tile.entry.js +1 -1
- package/dist/esm/limebb-kanban-group.entry.js +1 -1
- package/dist/esm/limebb-kanban-item.entry.js +1 -1
- package/dist/esm/limebb-lime-query-builder.entry.js +379 -147
- package/dist/esm/limebb-lime-query-filter-and_5.entry.js +270 -0
- package/dist/esm/limebb-lime-query-value-input.entry.js +235 -0
- package/dist/esm/limebb-limetype-field_2.entry.js +401 -0
- package/dist/esm/limebb-live-docs-info.entry.js +2 -2
- package/dist/esm/limebb-locale-picker.entry.js +9 -494
- package/dist/esm/limebb-mention-group-counter.entry.js +2 -2
- package/dist/esm/limebb-navigation-button_2.entry.js +3 -3
- package/dist/esm/limebb-notification-item.entry.js +1 -1
- package/dist/esm/limebb-percentage-visualizer.entry.js +2 -2
- package/dist/esm/limebb-property-selector.entry.js +230 -0
- package/dist/esm/limebb-response-format-item.entry.js +76 -0
- package/dist/esm/limebb-text-editor.entry.js +8 -69
- package/dist/esm/limebb-trend-indicator.entry.js +1 -1
- package/dist/esm/limetype-6e7552a7.js +85 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/property-resolution-fde2375e.js +63 -0
- package/dist/esm/random-string-f6ef6fbf.js +22 -0
- package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/{p-85e11ff7.entry.js → p-00da9b24.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-02c0cc04.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-123190c3.js +1 -0
- package/dist/lime-crm-building-blocks/p-244ee55b.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-35897ec3.js +1 -0
- package/dist/lime-crm-building-blocks/{p-d6a07ea4.entry.js → p-3932077b.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-3b0a15ec.js +1 -0
- package/dist/lime-crm-building-blocks/p-4a82410e.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-a694aae5.entry.js → p-50d3d61a.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-5a6d2e7f.js +1 -0
- package/dist/lime-crm-building-blocks/p-60971d64.js +1 -0
- package/dist/lime-crm-building-blocks/{p-a44f543c.entry.js → p-61282e1a.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-6c1146ca.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-70a28b93.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-16199127.entry.js → p-79d4668a.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-7e6fb4af.js +1 -0
- package/dist/lime-crm-building-blocks/{p-88cc5b66.entry.js → p-82d33d43.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-7db8652e.entry.js → p-8c4eb49f.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-96beaabc.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-9d25ed5a.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-8dce83ad.entry.js → p-9d9f25da.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-a659d55a.js +1 -0
- package/dist/lime-crm-building-blocks/p-b7c72179.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-baf4e428.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-516210d4.entry.js → p-beb0d164.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-d298b34e.js +1 -0
- package/dist/lime-crm-building-blocks/{p-047c89de.entry.js → p-d89c44ad.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-e0ab1554.js +1 -0
- package/dist/lime-crm-building-blocks/{p-46d2f604.entry.js → p-e35299e0.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-8ef39ab8.entry.js → p-e9d23ef7.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-ef8a5266.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-abf1c197.entry.js → p-f52125a0.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-f99c611d.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-fbda77a7.js +1 -0
- package/dist/lime-crm-building-blocks/p-fe2b91d9.js +1 -0
- package/dist/lime-crm-building-blocks/{p-d6af09a8.entry.js → p-ff0b244b.entry.js} +1 -1
- package/dist/types/components/document-picker/document-item/document-item.d.ts +46 -0
- package/dist/types/components/document-picker/document-item/document-item.types.d.ts +37 -0
- package/dist/types/components/document-picker/document-picker.d.ts +80 -0
- package/dist/types/components/document-picker/document.types.d.ts +2 -0
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-and.d.ts +56 -0
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-comparison.d.ts +64 -0
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-expression.d.ts +53 -0
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-not.d.ts +54 -0
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-or.d.ts +55 -0
- package/dist/types/components/lime-query-builder/expressions/lime-query-value-input.d.ts +92 -0
- package/dist/types/components/lime-query-builder/filter-conversion.d.ts +18 -0
- package/dist/types/components/lime-query-builder/lime-query-builder.d.ts +30 -8
- package/dist/types/components/lime-query-builder/limetype-field/limetype-field.d.ts +96 -0
- package/dist/types/components/lime-query-builder/property-selection-format.d.ts +23 -0
- package/dist/types/components/lime-query-builder/property-selector/property-selector.d.ts +71 -0
- package/dist/types/components/lime-query-builder/response-format-editor.d.ts +57 -0
- package/dist/types/components/lime-query-builder/response-format-item.d.ts +46 -0
- package/dist/types/components.d.ts +1795 -114
- package/dist/types/util/format-bytes.d.ts +20 -0
- package/package.json +2 -2
- package/dist/lime-crm-building-blocks/p-29346b1a.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-4ccce5cc.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-7ef3bace.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-8044ffbd.js +0 -1
- package/dist/lime-crm-building-blocks/p-92ec9205.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-bcc23575.js +0 -1
- package/dist/lime-crm-building-blocks/p-c40a3f4b.js +0 -1
|
@@ -1,146 +1,68 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { T as Te } from './index.esm.js';
|
|
3
|
+
import { L as LIME_QUERY_OPERATORS, d as defineCustomElement$a } from './lime-query-filter-comparison.js';
|
|
4
|
+
import { g as getNormalizedProperties, a as getPropertyFromPath, d as defineCustomElement$4 } from './property-selector.js';
|
|
5
|
+
import { d as defineCustomElement$7, a as defineCustomElement$8, b as defineCustomElement$9, c as defineCustomElement$b } from './lime-query-filter-and.js';
|
|
6
|
+
import { d as defineCustomElement$6 } from './lime-query-value-input.js';
|
|
7
|
+
import { d as defineCustomElement$5 } from './limetype-field.js';
|
|
8
|
+
import { d as defineCustomElement$3 } from './response-format-editor.js';
|
|
9
|
+
import { d as defineCustomElement$2 } from './response-format-item.js';
|
|
3
10
|
|
|
4
11
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @param limetype The limetype to normalize
|
|
8
|
-
* @returns Normalized properties with system properties prefixed with underscore
|
|
9
|
-
*/
|
|
10
|
-
function getNormalizedProperties(limetype) {
|
|
11
|
-
if (!(limetype === null || limetype === void 0 ? void 0 : limetype.properties)) {
|
|
12
|
-
return {};
|
|
13
|
-
}
|
|
14
|
-
const properties = Object.assign({}, limetype.properties);
|
|
15
|
-
// System properties that are exposed by the backend
|
|
16
|
-
// Map from internal property name to API property name
|
|
17
|
-
const systemProperties = {
|
|
18
|
-
id: '_id',
|
|
19
|
-
timestamp: '_timestamp',
|
|
20
|
-
descriptive: '_descriptive',
|
|
21
|
-
createduser: '_createduser',
|
|
22
|
-
createdtime: '_createdtime',
|
|
23
|
-
updateduser: '_updateduser',
|
|
24
|
-
};
|
|
25
|
-
// Find and normalize system properties by name
|
|
26
|
-
for (const [propName, systemPropName] of Object.entries(systemProperties)) {
|
|
27
|
-
const property = properties[propName];
|
|
28
|
-
if (property) {
|
|
29
|
-
properties[systemPropName] = property;
|
|
30
|
-
delete properties[propName];
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return properties;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Get property from limetype by path (e.g., "company.name")
|
|
37
|
-
* Supports relation traversal with dot-notation
|
|
38
|
-
* @param limetypes
|
|
39
|
-
* @param limetype
|
|
40
|
-
* @param path
|
|
12
|
+
* Convert UI filter representation to Lime Query filter format
|
|
13
|
+
* @param filter
|
|
41
14
|
*/
|
|
42
|
-
function
|
|
43
|
-
if (
|
|
15
|
+
function guiFilterToLimeQuery(filter) {
|
|
16
|
+
if (filter.filter_type === '') {
|
|
44
17
|
return undefined;
|
|
45
18
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
19
|
+
if (filter.filter_type === 'comparison') {
|
|
20
|
+
return {
|
|
21
|
+
key: filter.property,
|
|
22
|
+
op: filter.operator,
|
|
23
|
+
exp: filter.value,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
if (filter.filter_type === 'AND') {
|
|
27
|
+
const expressions = filter.expressions
|
|
28
|
+
.map(guiFilterToLimeQuery)
|
|
29
|
+
.filter((f) => f !== undefined);
|
|
30
|
+
if (expressions.length === 0) {
|
|
51
31
|
return undefined;
|
|
52
32
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
33
|
+
if (expressions.length === 1) {
|
|
34
|
+
return expressions[0];
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
op: 'AND',
|
|
38
|
+
exp: expressions,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
if (filter.filter_type === 'OR') {
|
|
42
|
+
const expressions = filter.expressions
|
|
43
|
+
.map(guiFilterToLimeQuery)
|
|
44
|
+
.filter((f) => f !== undefined);
|
|
45
|
+
if (expressions.length === 0) {
|
|
56
46
|
return undefined;
|
|
57
47
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
currentType = property.relation.getLimetype();
|
|
48
|
+
if (expressions.length === 1) {
|
|
49
|
+
return expressions[0];
|
|
61
50
|
}
|
|
62
|
-
}
|
|
63
|
-
return property;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* TypeScript type definitions for Lime Query DSL
|
|
68
|
-
*
|
|
69
|
-
* These types represent the structure of Lime Query as defined in:
|
|
70
|
-
* - lime-core/lime_query/schema.py
|
|
71
|
-
* - lime-core/lime_filter/schema.py
|
|
72
|
-
*/
|
|
73
|
-
/**
|
|
74
|
-
* Available operators with display metadata
|
|
75
|
-
*/
|
|
76
|
-
const LIME_QUERY_OPERATORS = [
|
|
77
|
-
{ value: '=', label: 'Equals', icon: 'equals' },
|
|
78
|
-
{ value: '!=', label: 'Not Equals', icon: 'not-equal' },
|
|
79
|
-
{
|
|
80
|
-
value: '>',
|
|
81
|
-
label: 'Greater Than',
|
|
82
|
-
icon: 'greater-than',
|
|
83
|
-
applicableTypes: ['integer', 'decimal', 'date', 'time'],
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
value: '>=',
|
|
87
|
-
label: 'Greater or Equal',
|
|
88
|
-
icon: 'greater-or-equal',
|
|
89
|
-
applicableTypes: ['integer', 'decimal', 'date', 'time'],
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
value: '<',
|
|
93
|
-
label: 'Less Than',
|
|
94
|
-
icon: 'less-than',
|
|
95
|
-
applicableTypes: ['integer', 'decimal', 'date', 'time'],
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
value: '<=',
|
|
99
|
-
label: 'Less or Equal',
|
|
100
|
-
icon: 'less-or-equal',
|
|
101
|
-
applicableTypes: ['integer', 'decimal', 'date', 'time'],
|
|
102
|
-
},
|
|
103
|
-
{ value: 'IN', label: 'In List', icon: 'list' },
|
|
104
|
-
{
|
|
105
|
-
value: '?',
|
|
106
|
-
label: 'Contains',
|
|
107
|
-
icon: '-lime-filter-contain',
|
|
108
|
-
applicableTypes: ['string', 'text'],
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
value: '=?',
|
|
112
|
-
label: 'Begins With',
|
|
113
|
-
icon: '-lime-filter-begin',
|
|
114
|
-
applicableTypes: ['string', 'text'],
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
value: '=$',
|
|
118
|
-
label: 'Ends With',
|
|
119
|
-
icon: '-lime-filter-end',
|
|
120
|
-
applicableTypes: ['string', 'text'],
|
|
121
|
-
},
|
|
122
|
-
];
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Convert Lime Query filter to UI filter representation
|
|
126
|
-
* Throws errors for unsupported filter structures
|
|
127
|
-
* @param filter
|
|
128
|
-
*/
|
|
129
|
-
function limeQueryToGuiFilter(filter) {
|
|
130
|
-
if (!filter) {
|
|
131
|
-
// Return empty AND instead of missing expression
|
|
132
|
-
// This ensures users see the "Add a condition" button
|
|
133
51
|
return {
|
|
134
|
-
|
|
135
|
-
|
|
52
|
+
op: 'OR',
|
|
53
|
+
exp: expressions,
|
|
136
54
|
};
|
|
137
55
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
56
|
+
if (filter.filter_type === 'NOT') {
|
|
57
|
+
const innerFilter = guiFilterToLimeQuery(filter.expression);
|
|
58
|
+
if (innerFilter) {
|
|
59
|
+
return {
|
|
60
|
+
op: '!',
|
|
61
|
+
exp: innerFilter,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
141
64
|
}
|
|
142
|
-
|
|
143
|
-
return validateAndConvertFilterGroup(filter);
|
|
65
|
+
return undefined;
|
|
144
66
|
}
|
|
145
67
|
/**
|
|
146
68
|
* Validate and convert a FilterExpression (comparison filter)
|
|
@@ -222,6 +144,124 @@ function validateAndConvertFilterGroup(filter) {
|
|
|
222
144
|
// If we reach here, the operator is unsupported
|
|
223
145
|
throw new Error(`Unsupported filter operator: ${filter.op}`);
|
|
224
146
|
}
|
|
147
|
+
/**
|
|
148
|
+
* Convert Lime Query filter to UI filter representation
|
|
149
|
+
* Throws errors for unsupported filter structures
|
|
150
|
+
* @param filter
|
|
151
|
+
*/
|
|
152
|
+
function limeQueryToGuiFilter(filter) {
|
|
153
|
+
if (!filter) {
|
|
154
|
+
// Return empty AND instead of missing expression
|
|
155
|
+
// This ensures users see the "Add a condition" button
|
|
156
|
+
return {
|
|
157
|
+
filter_type: 'AND',
|
|
158
|
+
expressions: [],
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
// Check if it's a FilterExpression (has 'key' property)
|
|
162
|
+
if ('key' in filter) {
|
|
163
|
+
return validateAndConvertFilterExpression(filter);
|
|
164
|
+
}
|
|
165
|
+
// It's a FilterGroup
|
|
166
|
+
return validateAndConvertFilterGroup(filter);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Normalize filter for GUI mode by ensuring proper AND/OR wrapper structure.
|
|
170
|
+
* GUI mode requires filters to be wrapped in AND([OR(...)]) so users have
|
|
171
|
+
* access to add/remove buttons on the AND and OR components.
|
|
172
|
+
*
|
|
173
|
+
* This function ensures that:
|
|
174
|
+
* - Single comparisons are wrapped in AND([OR([comparison])])
|
|
175
|
+
* - OR groups are wrapped in AND([OR group])
|
|
176
|
+
* - AND groups have their comparison children wrapped in OR
|
|
177
|
+
* - Empty/undefined filters become AND([])
|
|
178
|
+
*
|
|
179
|
+
* When converting back to Lime Query JSON, limeQueryFilterToLimeQuery()
|
|
180
|
+
* automatically unwraps single-item AND/OR groups.
|
|
181
|
+
*
|
|
182
|
+
* @param filter The filter expression from limeQueryToLimeQueryFilter
|
|
183
|
+
* @returns Normalized filter suitable for GUI editing
|
|
184
|
+
*/
|
|
185
|
+
function normalizeLimeQueryFilterForGui(filter) {
|
|
186
|
+
// Empty AND is already correct for GUI
|
|
187
|
+
if (filter.filter_type === 'AND' && filter.expressions.length === 0) {
|
|
188
|
+
return filter;
|
|
189
|
+
}
|
|
190
|
+
// Single comparison needs wrapping
|
|
191
|
+
if (filter.filter_type === 'comparison') {
|
|
192
|
+
return {
|
|
193
|
+
filter_type: 'AND',
|
|
194
|
+
expressions: [
|
|
195
|
+
{
|
|
196
|
+
filter_type: 'OR',
|
|
197
|
+
expressions: [filter],
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
// OR needs wrapping in AND
|
|
203
|
+
if (filter.filter_type === 'OR') {
|
|
204
|
+
return {
|
|
205
|
+
filter_type: 'AND',
|
|
206
|
+
expressions: [filter],
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
// NOT needs wrapping
|
|
210
|
+
if (filter.filter_type === 'NOT') {
|
|
211
|
+
return {
|
|
212
|
+
filter_type: 'AND',
|
|
213
|
+
expressions: [
|
|
214
|
+
{
|
|
215
|
+
filter_type: 'OR',
|
|
216
|
+
expressions: [filter],
|
|
217
|
+
},
|
|
218
|
+
],
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
// AND group - check if children need OR wrappers
|
|
222
|
+
if (filter.filter_type === 'AND') {
|
|
223
|
+
const normalizedChildren = filter.expressions.map((child) => {
|
|
224
|
+
// If child is already OR, keep it
|
|
225
|
+
if (child.filter_type === 'OR') {
|
|
226
|
+
return child;
|
|
227
|
+
}
|
|
228
|
+
// If child is NOT, keep it (NOT can be a direct child of AND)
|
|
229
|
+
if (child.filter_type === 'NOT') {
|
|
230
|
+
return child;
|
|
231
|
+
}
|
|
232
|
+
// If child is comparison, wrap in OR
|
|
233
|
+
if (child.filter_type === 'comparison') {
|
|
234
|
+
return {
|
|
235
|
+
filter_type: 'OR',
|
|
236
|
+
expressions: [child],
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
// If child is nested AND, recursively normalize and wrap in OR
|
|
240
|
+
if (child.filter_type === 'AND') {
|
|
241
|
+
return {
|
|
242
|
+
filter_type: 'OR',
|
|
243
|
+
expressions: [normalizeLimeQueryFilterForGui(child)],
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
// Unknown filter type, keep as is
|
|
247
|
+
return child;
|
|
248
|
+
});
|
|
249
|
+
return {
|
|
250
|
+
filter_type: 'AND',
|
|
251
|
+
expressions: normalizedChildren,
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
// Fallback: wrap in AND/OR structure
|
|
255
|
+
return {
|
|
256
|
+
filter_type: 'AND',
|
|
257
|
+
expressions: [
|
|
258
|
+
{
|
|
259
|
+
filter_type: 'OR',
|
|
260
|
+
expressions: [filter],
|
|
261
|
+
},
|
|
262
|
+
],
|
|
263
|
+
};
|
|
264
|
+
}
|
|
225
265
|
|
|
226
266
|
/**
|
|
227
267
|
* Dynamic filter values and placeholders that are valid in Lime Query
|
|
@@ -600,7 +640,7 @@ function isLimeQuerySupported(limeQuery, limetypes, activeLimetype, guiModeEnabl
|
|
|
600
640
|
};
|
|
601
641
|
}
|
|
602
642
|
|
|
603
|
-
const limeQueryBuilderCss = ":host(limebb-lime-query-builder){display:block;width:100%}.lime-query-builder{display:flex;flex-direction:column;gap:2rem}.mode-controls{display:flex;align-items:center;gap:0.5rem;padding:0.5rem
|
|
643
|
+
const limeQueryBuilderCss = ":host(limebb-lime-lime-query-builder){display:block;width:100%}.lime-query-builder{display:flex;flex-direction:column;gap:2rem}.mode-controls{display:flex;align-items:center;gap:0.5rem;padding:0.5rem}.mode-switch{display:flex;align-items:center;gap:0.5rem}.mode-switch limel-button{min-width:5rem}.mode-switch limel-helper-text{margin-left:1rem;color:rgb(var(--color-red-default))}.gui-mode,.code-mode{display:block}.code-editor-container{--code-editor-max-height:70vh;display:flex;flex-direction:column;gap:1rem}.code-editor-container .validation-errors{padding:0.75rem 1rem;color:rgb(var(--color-red-default));background-color:rgb(var(--color-red-lighter));border-left:0.25rem solid rgb(var(--color-red-default));border-radius:0.25rem;font-size:0.875rem}.code-editor-container .validation-errors strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-editor-container .validation-errors ul{margin:0;padding-left:1.5rem}.code-editor-container .validation-errors li{margin:0.25rem 0}.code-editor-container .gui-limitations{padding:0.75rem 1rem;color:rgb(var(--color-blue-dark));background-color:rgb(var(--color-blue-lighter));border-left:0.25rem solid rgb(var(--color-blue-default));border-radius:0.25rem;font-size:0.875rem}.code-editor-container .gui-limitations strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-editor-container .gui-limitations ul{margin:0;padding-left:1.5rem}.code-editor-container .gui-limitations li{margin:0.25rem 0}.lime-query-builder-label{margin:0;font-size:1.5rem;font-weight:600;color:rgb(var(--contrast-1100))}.limetype-section{display:flex;flex-direction:column}.filter-section,.query-options-section{display:flex;flex-direction:column;gap:1rem}.section-label{margin:0;font-size:1.125rem;font-weight:600;color:rgb(var(--contrast-1000))}.query-options-controls{display:grid;grid-template-columns:repeat(auto-fit, minmax(200px, 1fr));gap:1rem}@media (max-width: 768px){.lime-query-builder{gap:1.5rem}.query-options-controls{grid-template-columns:1fr}}";
|
|
604
644
|
const LimebbLimeQueryBuilderStyle0 = limeQueryBuilderCss;
|
|
605
645
|
|
|
606
646
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -621,10 +661,80 @@ const LimeQueryBuilder = /*@__PURE__*/ proxyCustomElement(class LimeQueryBuilder
|
|
|
621
661
|
this.change = createEvent(this, "change", 7);
|
|
622
662
|
this.mode = 'gui';
|
|
623
663
|
this.codeValue = '';
|
|
664
|
+
this.limetype = '';
|
|
665
|
+
this.filter = {
|
|
666
|
+
filter_type: 'AND',
|
|
667
|
+
expressions: [],
|
|
668
|
+
};
|
|
669
|
+
this.handleLimetypeChange = (event) => {
|
|
670
|
+
event.stopPropagation();
|
|
671
|
+
this.limetype = event.detail;
|
|
672
|
+
// Reset filter when limetype changes
|
|
673
|
+
this.filter = {
|
|
674
|
+
filter_type: 'AND',
|
|
675
|
+
expressions: [],
|
|
676
|
+
};
|
|
677
|
+
// Reset response format when limetype changes
|
|
678
|
+
this.internalResponseFormat = {
|
|
679
|
+
object: {
|
|
680
|
+
_id: null,
|
|
681
|
+
},
|
|
682
|
+
};
|
|
683
|
+
this.emitChange();
|
|
684
|
+
};
|
|
685
|
+
this.handleFilterChange = (event) => {
|
|
686
|
+
event.stopPropagation();
|
|
687
|
+
// Convert missing expression back to empty AND to keep the UI consistent
|
|
688
|
+
if (event.detail.filter_type === '') {
|
|
689
|
+
this.filter = {
|
|
690
|
+
filter_type: 'AND',
|
|
691
|
+
expressions: [],
|
|
692
|
+
};
|
|
693
|
+
}
|
|
694
|
+
else {
|
|
695
|
+
this.filter = event.detail;
|
|
696
|
+
}
|
|
697
|
+
this.emitChange();
|
|
698
|
+
};
|
|
699
|
+
this.handleResponseFormatChange = (event) => {
|
|
700
|
+
event.stopPropagation();
|
|
701
|
+
this.internalResponseFormat = event.detail;
|
|
702
|
+
this.emitChange();
|
|
703
|
+
};
|
|
704
|
+
this.handleLimitChange = (event) => {
|
|
705
|
+
event.stopPropagation();
|
|
706
|
+
const value = event.detail;
|
|
707
|
+
this.limit = value ? Number.parseInt(value, 10) : undefined;
|
|
708
|
+
this.emitChange();
|
|
709
|
+
};
|
|
710
|
+
this.handleActiveLimetypeChange = (event) => {
|
|
711
|
+
event.stopPropagation();
|
|
712
|
+
this.activeLimetype = event.detail || undefined;
|
|
713
|
+
};
|
|
624
714
|
this.switchToGui = () => {
|
|
625
|
-
|
|
715
|
+
// Validate JSON before switching
|
|
716
|
+
try {
|
|
717
|
+
const parsed = JSON.parse(this.codeValue);
|
|
718
|
+
// Check if it's supported in GUI
|
|
719
|
+
const support = this.checkGuiSupport();
|
|
720
|
+
if (!support.guiSupported) {
|
|
721
|
+
// Don't switch if GUI can't render this query
|
|
722
|
+
return;
|
|
723
|
+
}
|
|
724
|
+
// Update internal state from parsed query
|
|
725
|
+
this.limetype = parsed.limetype || '';
|
|
726
|
+
this.filter = normalizeLimeQueryFilterForGui(limeQueryToGuiFilter(parsed.filter));
|
|
727
|
+
this.internalResponseFormat = parsed.responseFormat;
|
|
728
|
+
this.limit = parsed.limit;
|
|
729
|
+
this.mode = 'gui';
|
|
730
|
+
this.change.emit(parsed);
|
|
731
|
+
}
|
|
732
|
+
catch (_a) {
|
|
733
|
+
// Don't switch if JSON is invalid (linter will show the error)
|
|
734
|
+
}
|
|
626
735
|
};
|
|
627
736
|
this.switchToCode = () => {
|
|
737
|
+
this.updateCodeValue();
|
|
628
738
|
this.mode = 'code';
|
|
629
739
|
};
|
|
630
740
|
this.handleCodeChange = (event) => {
|
|
@@ -645,43 +755,130 @@ const LimeQueryBuilder = /*@__PURE__*/ proxyCustomElement(class LimeQueryBuilder
|
|
|
645
755
|
return ((_c = (_b = (_a = this.platform) === null || _a === void 0 ? void 0 : _a.isFeatureEnabled) === null || _b === void 0 ? void 0 : _b.call(_a, 'useLimeQueryBuilderGuiMode')) !== null && _c !== void 0 ? _c : false);
|
|
646
756
|
}
|
|
647
757
|
componentWillLoad() {
|
|
648
|
-
// Initialize code value from input prop
|
|
649
|
-
this.codeValue = JSON.stringify(this.value || {}, null, 2);
|
|
650
758
|
// Force code mode if GUI is disabled
|
|
651
759
|
if (!this.guiModeEnabled) {
|
|
652
760
|
this.mode = 'code';
|
|
761
|
+
// Initialize code value from prop
|
|
762
|
+
this.updateCodeValue();
|
|
763
|
+
return;
|
|
764
|
+
}
|
|
765
|
+
if (this.value) {
|
|
766
|
+
this.limetype = this.value.limetype || '';
|
|
767
|
+
this.filter = normalizeLimeQueryFilterForGui(limeQueryToGuiFilter(this.value.filter));
|
|
768
|
+
this.internalResponseFormat = this.value.responseFormat;
|
|
769
|
+
this.limit = this.value.limit;
|
|
770
|
+
}
|
|
771
|
+
// Initialize code value from prop
|
|
772
|
+
this.updateCodeValue();
|
|
773
|
+
// Check if GUI mode is supported
|
|
774
|
+
const support = this.checkGuiSupport();
|
|
775
|
+
if (!support.guiSupported) {
|
|
776
|
+
this.mode = 'code';
|
|
653
777
|
}
|
|
654
778
|
}
|
|
655
779
|
render() {
|
|
656
780
|
const guiSupported = this.checkGuiSupport();
|
|
657
|
-
|
|
781
|
+
const showCodeMode = !this.guiModeEnabled || this.mode === 'code';
|
|
782
|
+
return (h("div", { key: 'd179549c02b40689f61a47f327c9b4ab3e578258', class: "lime-query-builder" }, this.renderLabel(), this.renderModeControls(guiSupported), showCodeMode
|
|
783
|
+
? this.renderCodeMode(guiSupported)
|
|
784
|
+
: this.renderGuiMode()));
|
|
785
|
+
}
|
|
786
|
+
emitChange() {
|
|
787
|
+
// Only emit in GUI mode
|
|
788
|
+
if (this.mode === 'code') {
|
|
789
|
+
return;
|
|
790
|
+
}
|
|
791
|
+
if (!this.limetype) {
|
|
792
|
+
return;
|
|
793
|
+
}
|
|
794
|
+
// Use internal state, then default to returning just _id
|
|
795
|
+
const responseFormat = this.internalResponseFormat || {
|
|
796
|
+
object: {
|
|
797
|
+
_id: null,
|
|
798
|
+
},
|
|
799
|
+
};
|
|
800
|
+
const limeQuery = {
|
|
801
|
+
limetype: this.limetype,
|
|
802
|
+
responseFormat: responseFormat,
|
|
803
|
+
filter: guiFilterToLimeQuery(this.filter),
|
|
804
|
+
};
|
|
805
|
+
if (this.limit !== undefined && this.limit > 0) {
|
|
806
|
+
limeQuery.limit = this.limit;
|
|
807
|
+
}
|
|
808
|
+
this.change.emit(limeQuery);
|
|
809
|
+
}
|
|
810
|
+
updateCodeValue() {
|
|
811
|
+
if (!this.limetype) {
|
|
812
|
+
this.codeValue = JSON.stringify(this.value || {}, null, 2);
|
|
813
|
+
return;
|
|
814
|
+
}
|
|
815
|
+
// Use internal state, then default to returning just _id
|
|
816
|
+
const responseFormat = this.internalResponseFormat || {
|
|
817
|
+
object: {
|
|
818
|
+
_id: null,
|
|
819
|
+
},
|
|
820
|
+
};
|
|
821
|
+
const limeQuery = {
|
|
822
|
+
limetype: this.limetype,
|
|
823
|
+
responseFormat: responseFormat,
|
|
824
|
+
filter: guiFilterToLimeQuery(this.filter),
|
|
825
|
+
};
|
|
826
|
+
if (this.limit !== undefined && this.limit > 0) {
|
|
827
|
+
limeQuery.limit = this.limit;
|
|
828
|
+
}
|
|
829
|
+
this.codeValue = JSON.stringify(limeQuery, null, 2);
|
|
658
830
|
}
|
|
659
831
|
checkGuiSupport() {
|
|
660
|
-
if (!this.limetypes
|
|
832
|
+
if (!this.limetypes) {
|
|
661
833
|
// Can't validate yet, assume all is good
|
|
662
834
|
return {
|
|
663
835
|
valid: true,
|
|
664
|
-
guiSupported:
|
|
836
|
+
guiSupported: true,
|
|
665
837
|
validationErrors: [],
|
|
666
838
|
guiLimitations: [],
|
|
667
839
|
};
|
|
668
840
|
}
|
|
669
|
-
//
|
|
670
|
-
let
|
|
671
|
-
|
|
672
|
-
|
|
841
|
+
// When in code mode, validate the parsed code value instead of current state
|
|
842
|
+
let queryToCheck;
|
|
843
|
+
if (this.mode === 'code' && this.codeValue) {
|
|
844
|
+
try {
|
|
845
|
+
queryToCheck = JSON.parse(this.codeValue);
|
|
846
|
+
}
|
|
847
|
+
catch (_a) {
|
|
848
|
+
return {
|
|
849
|
+
valid: false,
|
|
850
|
+
guiSupported: false,
|
|
851
|
+
validationErrors: ['Invalid JSON'],
|
|
852
|
+
guiLimitations: [],
|
|
853
|
+
};
|
|
854
|
+
}
|
|
673
855
|
}
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
856
|
+
else {
|
|
857
|
+
// Build query from current GUI state
|
|
858
|
+
if (!this.limetype) {
|
|
859
|
+
return {
|
|
860
|
+
valid: true,
|
|
861
|
+
guiSupported: true,
|
|
862
|
+
validationErrors: [],
|
|
863
|
+
guiLimitations: [],
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
const responseFormat = this
|
|
867
|
+
.internalResponseFormat || {
|
|
868
|
+
object: {
|
|
869
|
+
_id: null,
|
|
870
|
+
},
|
|
871
|
+
};
|
|
872
|
+
queryToCheck = {
|
|
873
|
+
limetype: this.limetype,
|
|
874
|
+
responseFormat: responseFormat,
|
|
875
|
+
filter: guiFilterToLimeQuery(this.filter),
|
|
680
876
|
};
|
|
877
|
+
if (this.limit !== undefined && this.limit > 0) {
|
|
878
|
+
queryToCheck.limit = this.limit;
|
|
879
|
+
}
|
|
681
880
|
}
|
|
682
|
-
|
|
683
|
-
// Pass undefined since it's not needed for code mode validation
|
|
684
|
-
return isLimeQuerySupported(limeQueryToCheck, this.limetypes, undefined, this.guiModeEnabled);
|
|
881
|
+
return isLimeQuerySupported(queryToCheck, this.limetypes, this.activeLimetype, this.guiModeEnabled);
|
|
685
882
|
}
|
|
686
883
|
renderModeSwitch(support) {
|
|
687
884
|
const guiDisabled = !support.guiSupported;
|
|
@@ -694,6 +891,46 @@ const LimeQueryBuilder = /*@__PURE__*/ proxyCustomElement(class LimeQueryBuilder
|
|
|
694
891
|
!guiSupported.guiSupported &&
|
|
695
892
|
guiSupported.guiLimitations.length > 0 && (h("div", { class: "gui-limitations" }, h("strong", null, "Cannot switch to GUI mode:"), h("ul", null, guiSupported.guiLimitations.map((limitation) => (h("li", null, limitation))))))));
|
|
696
893
|
}
|
|
894
|
+
renderLimetypeSection() {
|
|
895
|
+
return (h("div", { class: "limetype-section" }, h("limebb-limetype-field", { platform: this.platform, context: this.context, label: "Object Type", value: this.limetype, required: true, fieldName: "limetype", helperText: "Select the type of object you want to query", onChange: this.handleLimetypeChange })));
|
|
896
|
+
}
|
|
897
|
+
renderResponseFormatSection() {
|
|
898
|
+
if (!this.limetype) {
|
|
899
|
+
return;
|
|
900
|
+
}
|
|
901
|
+
return (h("div", { class: "response-format-section" }, h("limebb-response-format-editor", { platform: this.platform, context: this.context, limetype: this.limetype, value: this.internalResponseFormat, onChange: this.handleResponseFormatChange })));
|
|
902
|
+
}
|
|
903
|
+
renderFilterSection() {
|
|
904
|
+
if (!this.limetype) {
|
|
905
|
+
return;
|
|
906
|
+
}
|
|
907
|
+
return (h("div", { class: "filter-section" }, h("h4", { class: "section-label" }, "Filter Conditions"), h("limebb-lime-query-filter-expression", { platform: this.platform, context: this.context, limetype: this.limetype, activeLimetype: this.activeLimetype, expression: this.filter, onExpressionChange: this.handleFilterChange })));
|
|
908
|
+
}
|
|
909
|
+
renderQueryOptionsSection() {
|
|
910
|
+
var _a;
|
|
911
|
+
if (!this.limetype) {
|
|
912
|
+
return;
|
|
913
|
+
}
|
|
914
|
+
return (h("div", { class: "query-options-section" }, h("h4", { class: "section-label" }, "Query Options"), h("div", { class: "query-options-controls" }, h("limebb-limetype-field", { platform: this.platform, context: this.context, label: "Active Object Type", value: this.activeLimetype, required: false, fieldName: "activeLimetype", helperText: "Limetype of the active object (for %activeObject% placeholders)", onChange: this.handleActiveLimetypeChange }), h("limel-input-field", { label: "Limit", type: "number", value: ((_a = this.limit) === null || _a === void 0 ? void 0 : _a.toString()) || '', placeholder: "No limit", helperText: "Maximum number of results", onChange: this.handleLimitChange }))));
|
|
915
|
+
}
|
|
916
|
+
renderGuiMode() {
|
|
917
|
+
return (h("div", { class: "gui-mode" }, this.renderLimetypeSection(), this.renderResponseFormatSection(), this.renderFilterSection(), this.renderQueryOptionsSection()));
|
|
918
|
+
}
|
|
919
|
+
renderLabel() {
|
|
920
|
+
if (!this.label) {
|
|
921
|
+
return;
|
|
922
|
+
}
|
|
923
|
+
return h("h3", { class: "lime-query-builder-label" }, this.label);
|
|
924
|
+
}
|
|
925
|
+
renderModeControls(support) {
|
|
926
|
+
if (!this.guiModeEnabled) {
|
|
927
|
+
return;
|
|
928
|
+
}
|
|
929
|
+
return (h("div", { class: "mode-controls" }, this.renderModeSwitch(support)));
|
|
930
|
+
}
|
|
931
|
+
renderCodeMode(support) {
|
|
932
|
+
return h("div", { class: "code-mode" }, this.renderCodeEditor(support));
|
|
933
|
+
}
|
|
697
934
|
static get style() { return LimebbLimeQueryBuilderStyle0; }
|
|
698
935
|
}, [1, "limebb-lime-query-builder", {
|
|
699
936
|
"platform": [16],
|
|
@@ -702,7 +939,12 @@ const LimeQueryBuilder = /*@__PURE__*/ proxyCustomElement(class LimeQueryBuilder
|
|
|
702
939
|
"label": [1],
|
|
703
940
|
"limetypes": [32],
|
|
704
941
|
"mode": [32],
|
|
705
|
-
"codeValue": [32]
|
|
942
|
+
"codeValue": [32],
|
|
943
|
+
"limetype": [32],
|
|
944
|
+
"filter": [32],
|
|
945
|
+
"internalResponseFormat": [32],
|
|
946
|
+
"limit": [32],
|
|
947
|
+
"activeLimetype": [32]
|
|
706
948
|
}]);
|
|
707
949
|
__decorate([
|
|
708
950
|
Te()
|
|
@@ -711,13 +953,63 @@ function defineCustomElement$1() {
|
|
|
711
953
|
if (typeof customElements === "undefined") {
|
|
712
954
|
return;
|
|
713
955
|
}
|
|
714
|
-
const components = ["limebb-lime-query-builder"];
|
|
956
|
+
const components = ["limebb-lime-query-builder", "limebb-lime-query-filter-and", "limebb-lime-query-filter-comparison", "limebb-lime-query-filter-expression", "limebb-lime-query-filter-not", "limebb-lime-query-filter-or", "limebb-lime-query-value-input", "limebb-limetype-field", "limebb-property-selector", "limebb-response-format-editor", "limebb-response-format-item"];
|
|
715
957
|
components.forEach(tagName => { switch (tagName) {
|
|
716
958
|
case "limebb-lime-query-builder":
|
|
717
959
|
if (!customElements.get(tagName)) {
|
|
718
960
|
customElements.define(tagName, LimeQueryBuilder);
|
|
719
961
|
}
|
|
720
962
|
break;
|
|
963
|
+
case "limebb-lime-query-filter-and":
|
|
964
|
+
if (!customElements.get(tagName)) {
|
|
965
|
+
defineCustomElement$b();
|
|
966
|
+
}
|
|
967
|
+
break;
|
|
968
|
+
case "limebb-lime-query-filter-comparison":
|
|
969
|
+
if (!customElements.get(tagName)) {
|
|
970
|
+
defineCustomElement$a();
|
|
971
|
+
}
|
|
972
|
+
break;
|
|
973
|
+
case "limebb-lime-query-filter-expression":
|
|
974
|
+
if (!customElements.get(tagName)) {
|
|
975
|
+
defineCustomElement$9();
|
|
976
|
+
}
|
|
977
|
+
break;
|
|
978
|
+
case "limebb-lime-query-filter-not":
|
|
979
|
+
if (!customElements.get(tagName)) {
|
|
980
|
+
defineCustomElement$8();
|
|
981
|
+
}
|
|
982
|
+
break;
|
|
983
|
+
case "limebb-lime-query-filter-or":
|
|
984
|
+
if (!customElements.get(tagName)) {
|
|
985
|
+
defineCustomElement$7();
|
|
986
|
+
}
|
|
987
|
+
break;
|
|
988
|
+
case "limebb-lime-query-value-input":
|
|
989
|
+
if (!customElements.get(tagName)) {
|
|
990
|
+
defineCustomElement$6();
|
|
991
|
+
}
|
|
992
|
+
break;
|
|
993
|
+
case "limebb-limetype-field":
|
|
994
|
+
if (!customElements.get(tagName)) {
|
|
995
|
+
defineCustomElement$5();
|
|
996
|
+
}
|
|
997
|
+
break;
|
|
998
|
+
case "limebb-property-selector":
|
|
999
|
+
if (!customElements.get(tagName)) {
|
|
1000
|
+
defineCustomElement$4();
|
|
1001
|
+
}
|
|
1002
|
+
break;
|
|
1003
|
+
case "limebb-response-format-editor":
|
|
1004
|
+
if (!customElements.get(tagName)) {
|
|
1005
|
+
defineCustomElement$3();
|
|
1006
|
+
}
|
|
1007
|
+
break;
|
|
1008
|
+
case "limebb-response-format-item":
|
|
1009
|
+
if (!customElements.get(tagName)) {
|
|
1010
|
+
defineCustomElement$2();
|
|
1011
|
+
}
|
|
1012
|
+
break;
|
|
721
1013
|
} });
|
|
722
1014
|
}
|
|
723
1015
|
|