@limetech/lime-crm-building-blocks 1.96.0 → 1.98.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-lime-query-builder.cjs.entry.js +378 -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 +20 -61
- 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/collection/collection-manifest.json +10 -0
- 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 +253 -27
- 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/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/get.js +2 -1
- package/dist/components/isEqual.js +35 -0
- package/dist/components/isSymbol.js +28 -0
- 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-lime-query-builder.js +437 -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 +7 -48
- 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/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-lime-query-builder.entry.js +375 -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 +7 -48
- 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/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/{p-88c64360.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-0957b2a6.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-85b7291c.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-5a6d2e7f.js +1 -0
- package/dist/lime-crm-building-blocks/p-60971d64.js +1 -0
- 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-7e6fb4af.js +1 -0
- package/dist/lime-crm-building-blocks/{p-8664381a.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-a659d55a.js +1 -0
- package/dist/lime-crm-building-blocks/p-baf4e428.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-d298b34e.js +1 -0
- package/dist/lime-crm-building-blocks/{p-7c4bdc1b.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-8064cbfb.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-c9126885.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-fe2b91d9.js +1 -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 +40 -7
- 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 +1587 -114
- package/package.json +1 -1
- package/dist/lime-crm-building-blocks/p-00e7e0d4.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-11ac105b.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-5abe3fff.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
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Get normalized properties for a limetype
|
|
5
|
+
* Adds system properties (_id, _timestamp, etc.) that map to the actual limeobject attributes
|
|
6
|
+
* @param limetype The limetype to normalize
|
|
7
|
+
* @returns Normalized properties with system properties prefixed with underscore
|
|
8
|
+
*/
|
|
9
|
+
function getNormalizedProperties(limetype) {
|
|
10
|
+
if (!(limetype === null || limetype === void 0 ? void 0 : limetype.properties)) {
|
|
11
|
+
return {};
|
|
12
|
+
}
|
|
13
|
+
const properties = Object.assign({}, limetype.properties);
|
|
14
|
+
// System properties that are exposed by the backend
|
|
15
|
+
// Map from internal property name to API property name
|
|
16
|
+
const systemProperties = {
|
|
17
|
+
id: '_id',
|
|
18
|
+
timestamp: '_timestamp',
|
|
19
|
+
descriptive: '_descriptive',
|
|
20
|
+
createduser: '_createduser',
|
|
21
|
+
createdtime: '_createdtime',
|
|
22
|
+
updateduser: '_updateduser',
|
|
23
|
+
};
|
|
24
|
+
// Find and normalize system properties by name
|
|
25
|
+
for (const [propName, systemPropName] of Object.entries(systemProperties)) {
|
|
26
|
+
const property = properties[propName];
|
|
27
|
+
if (property) {
|
|
28
|
+
properties[systemPropName] = property;
|
|
29
|
+
delete properties[propName];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return properties;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Get property from limetype by path (e.g., "company.name")
|
|
36
|
+
* Supports relation traversal with dot-notation
|
|
37
|
+
* @param limetypes
|
|
38
|
+
* @param limetype
|
|
39
|
+
* @param path
|
|
40
|
+
*/
|
|
41
|
+
function getPropertyFromPath(limetypes, limetype, path) {
|
|
42
|
+
if (!path || !limetype || !limetypes) {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
const parts = path.split('.');
|
|
46
|
+
let currentType = limetypes[limetype];
|
|
47
|
+
let property;
|
|
48
|
+
for (const part of parts) {
|
|
49
|
+
if (!currentType) {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
const normalizedProperties = getNormalizedProperties(currentType);
|
|
53
|
+
property = normalizedProperties[part];
|
|
54
|
+
if (!property) {
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
// If this is a relation, get the related limetype for next iteration
|
|
58
|
+
if (property.relation) {
|
|
59
|
+
currentType = property.relation.getLimetype();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return property;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
exports.getNormalizedProperties = getNormalizedProperties;
|
|
66
|
+
exports.getPropertyFromPath = getPropertyFromPath;
|
|
@@ -28,6 +28,16 @@
|
|
|
28
28
|
"components/kanban/kanban-group/kanban-group.js",
|
|
29
29
|
"components/kanban/kanban-item/kanban-item.js",
|
|
30
30
|
"components/lime-query-builder/lime-query-builder.js",
|
|
31
|
+
"components/lime-query-builder/response-format-editor.js",
|
|
32
|
+
"components/lime-query-builder/response-format-item.js",
|
|
33
|
+
"components/lime-query-builder/expressions/lime-query-filter-and.js",
|
|
34
|
+
"components/lime-query-builder/expressions/lime-query-filter-comparison.js",
|
|
35
|
+
"components/lime-query-builder/expressions/lime-query-filter-expression.js",
|
|
36
|
+
"components/lime-query-builder/expressions/lime-query-filter-not.js",
|
|
37
|
+
"components/lime-query-builder/expressions/lime-query-filter-or.js",
|
|
38
|
+
"components/lime-query-builder/expressions/lime-query-value-input.js",
|
|
39
|
+
"components/lime-query-builder/limetype-field/limetype-field.js",
|
|
40
|
+
"components/lime-query-builder/property-selector/property-selector.js",
|
|
31
41
|
"components/limeobject/file-viewer/file-viewer.js",
|
|
32
42
|
"components/limeobject/file-viewer/live-docs-info.js",
|
|
33
43
|
"components/loader/loader.js",
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
/**
|
|
3
|
+
* Note! This file is exported to `dist/scss/` in the published
|
|
4
|
+
* node module, for consumer projects to import.
|
|
5
|
+
* That means this file cannot import from any file that isn't
|
|
6
|
+
* also exported, keeping the same relative path.
|
|
7
|
+
*
|
|
8
|
+
* Or, just don't import anything, that works too.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* This mixin will mask out the content that is close to
|
|
15
|
+
* the edges of a scrollable area.
|
|
16
|
+
* - If the scrollable content has `overflow-y`, use `vertically`
|
|
17
|
+
* as an argument for `$direction`.
|
|
18
|
+
- If the scrollable content has `overflow-x`, use `horizontally`
|
|
19
|
+
* as an argument for `$direction`.
|
|
20
|
+
*
|
|
21
|
+
* For the visual effect to work smoothly, we need to make sure that
|
|
22
|
+
* the size of the fade-out edge effect is the same as the
|
|
23
|
+
* internal paddings of the scrollable area. Otherwise, content of a
|
|
24
|
+
* scrollable area that does not have a padding will fade out before
|
|
25
|
+
* any scrolling has been done.
|
|
26
|
+
* This is why this mixin already adds paddings, which automatically
|
|
27
|
+
* default to the size of the fade-out effect.
|
|
28
|
+
* This size defaults to `1rem`, but to override the size use
|
|
29
|
+
* `--limel-top-edge-fade-height` & `--limel-bottom-edge-fade-height`
|
|
30
|
+
* when `vertically` argument is set, and use
|
|
31
|
+
* `--limel-left-edge-fade-width` & `--limel-right-edge-fade-width`
|
|
32
|
+
* when `horizontally` argument is set.
|
|
33
|
+
* Of course you can also programmatically increase and decrease the
|
|
34
|
+
* size of these variables for each edge, based on the amount of
|
|
35
|
+
* scrolling that has been done by the user. In this case, make sure
|
|
36
|
+
* to add a custom padding where the mixin is used, to override
|
|
37
|
+
* the paddings that are automatically added by the mixin in the
|
|
38
|
+
* compiled CSS code.
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* This mixin will add an animated underline to the bottom of an `a` elements.
|
|
42
|
+
* Note that you may need to add `all: unset;` –depending on your use case–
|
|
43
|
+
* before using this mixin.
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* This mixin creates a cross-browser font stack.
|
|
47
|
+
* - `sans-serif` can be used for the UI of the components.
|
|
48
|
+
* - `monospace` can be used for code.
|
|
49
|
+
*
|
|
50
|
+
* ⚠️ If we change the font stacks, we need to update
|
|
51
|
+
* 1. the consumer documentation in `README.md`, and
|
|
52
|
+
* 2. the CSS variables of `--kompendium-example-font-family`
|
|
53
|
+
* in the `<style>` tag of `index.html`.
|
|
54
|
+
*/
|
|
55
|
+
/**
|
|
56
|
+
* This mixin is a hack, using old CSS syntax
|
|
57
|
+
* to enable you to truncate a piece of text,
|
|
58
|
+
* after a certain number of lines.
|
|
59
|
+
*/
|
|
60
|
+
/**
|
|
61
|
+
* This mixin will add a chessboard background pattern,
|
|
62
|
+
* typically used to visualize transparency.
|
|
63
|
+
*/
|
|
64
|
+
/**
|
|
65
|
+
* Make a container resizable by the user.
|
|
66
|
+
* This is used in the documentations and examples
|
|
67
|
+
* of some components, to demonstrate how the component
|
|
68
|
+
* behaves in a resizable container.
|
|
69
|
+
*/
|
|
70
|
+
/**
|
|
71
|
+
* The breakpoints below are used to create responsive designs
|
|
72
|
+
* in Lime's products. Therefore, they are here to get distributed
|
|
73
|
+
* to all components in other private repos, which rely on this `mixins`
|
|
74
|
+
* file, to create consistent styles.
|
|
75
|
+
*
|
|
76
|
+
* :::important
|
|
77
|
+
* In very rare cases you should used media queries!
|
|
78
|
+
* Nowadays, there are many better ways of achieving responsive design
|
|
79
|
+
* without media queries. For example, using CSS Grid, Flexbox, and their features.
|
|
80
|
+
* :::
|
|
81
|
+
*/
|
|
82
|
+
/**
|
|
83
|
+
* Media query mixins for responsive design based on screen width.
|
|
84
|
+
* Note that these mixins do not detect the device type!
|
|
85
|
+
*/
|
|
86
|
+
/**
|
|
87
|
+
* @mixin action-bar-interactions($item-selector)
|
|
88
|
+
* This mixin applies styles for the action bar interactions.
|
|
89
|
+
* For example, it animates the height of the action bar from `0` to `auto`.
|
|
90
|
+
*
|
|
91
|
+
* :::note
|
|
92
|
+
* The consumer should set:
|
|
93
|
+
* `--limebb-promoted-action-bar-grid-template-rows: 0fr;`
|
|
94
|
+
* when the action bar is not supposed to be visible.
|
|
95
|
+
* :::
|
|
96
|
+
*
|
|
97
|
+
* @param {string} $item-selector - The consumer component's tag name for the item that displays the action bar.
|
|
98
|
+
*/
|
|
99
|
+
.expression {
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-direction: column;
|
|
102
|
+
margin-bottom: 1rem;
|
|
103
|
+
gap: 0;
|
|
104
|
+
background-color: rgb(var(--contrast-100));
|
|
105
|
+
border: 1px solid rgb(var(--contrast-500));
|
|
106
|
+
border-radius: 0.75rem;
|
|
107
|
+
}
|
|
108
|
+
.expression > ul {
|
|
109
|
+
margin-top: 0;
|
|
110
|
+
margin-right: 1rem;
|
|
111
|
+
margin-bottom: 1rem;
|
|
112
|
+
margin-left: 1rem;
|
|
113
|
+
padding-left: 1rem;
|
|
114
|
+
list-style: disc;
|
|
115
|
+
}
|
|
116
|
+
.expression > ul li {
|
|
117
|
+
margin-top: 1rem;
|
|
118
|
+
}
|
|
119
|
+
.expression > ul li.add-button {
|
|
120
|
+
list-style: none;
|
|
121
|
+
}
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { isEqual } from "lodash-es";
|
|
3
|
+
/**
|
|
4
|
+
* Lime Query Filter AND Component
|
|
5
|
+
*
|
|
6
|
+
* Renders a group of filter expressions where **all conditions must be true**.
|
|
7
|
+
* Users can add multiple child expressions, and a record must match all of them
|
|
8
|
+
* to be included in the result set.
|
|
9
|
+
*
|
|
10
|
+
* This component displays:
|
|
11
|
+
* - A header with "All of these conditions are true" when there are multiple conditions
|
|
12
|
+
* - A list of child expressions (which can be comparisons or nested AND/OR/NOT groups)
|
|
13
|
+
* - An "Add another condition" button to add more expressions
|
|
14
|
+
*
|
|
15
|
+
* Clicking the trash icon on a child expression removes it from the AND group.
|
|
16
|
+
*
|
|
17
|
+
* @private
|
|
18
|
+
*/
|
|
19
|
+
export class LimeQueryFilterAndComponent {
|
|
20
|
+
constructor() {
|
|
21
|
+
/**
|
|
22
|
+
* The AND expression containing child expressions
|
|
23
|
+
*/
|
|
24
|
+
this.expression = {
|
|
25
|
+
filter_type: 'AND',
|
|
26
|
+
expressions: [],
|
|
27
|
+
};
|
|
28
|
+
this.renderChildExpression = (expression, childIndex) => (h("li", null, h("limebb-lime-query-filter-expression", { platform: this.platform, context: this.context, limetype: this.limetype, activeLimetype: this.activeLimetype, expression: expression, onExpressionChange: this.handleExpressionChange(childIndex) })));
|
|
29
|
+
this.handleAddChildExpression = () => {
|
|
30
|
+
const updatedExpressionsList = [
|
|
31
|
+
...this.expression.expressions,
|
|
32
|
+
{
|
|
33
|
+
filter_type: 'OR',
|
|
34
|
+
expressions: [
|
|
35
|
+
{
|
|
36
|
+
filter_type: '',
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
this.expressionChange.emit({
|
|
42
|
+
filter_type: 'AND',
|
|
43
|
+
expressions: updatedExpressionsList,
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
this.handleExpressionChange = (updatedChildIndex) => (event) => {
|
|
47
|
+
event.stopPropagation();
|
|
48
|
+
const updatedExpression = event.detail;
|
|
49
|
+
const expressions = [...this.expression.expressions];
|
|
50
|
+
const missingExpression = {
|
|
51
|
+
filter_type: '',
|
|
52
|
+
};
|
|
53
|
+
if (isEqual(updatedExpression, missingExpression)) {
|
|
54
|
+
expressions.splice(updatedChildIndex, 1);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
expressions[updatedChildIndex] = updatedExpression;
|
|
58
|
+
}
|
|
59
|
+
if (expressions.length === 0) {
|
|
60
|
+
this.expressionChange.emit(missingExpression);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
this.expressionChange.emit({
|
|
64
|
+
filter_type: 'AND',
|
|
65
|
+
expressions: expressions,
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
render() {
|
|
70
|
+
let subheading = 'All of these conditions are true';
|
|
71
|
+
if (this.expression.expressions.length <= 1) {
|
|
72
|
+
subheading = '';
|
|
73
|
+
}
|
|
74
|
+
return (h("div", { key: 'b58b7c54e8f1ded42a965f430cc103e6a344dfbf', class: "expression" }, (this.label || subheading) && (h("limel-header", { key: 'd5c38eef732ccbfff6baec25f007a9accdabdec0', heading: this.label, subheading: subheading })), h("ul", { key: 'aee3cc6799ae69c1df334a826cd708a9b6cf2be6' }, this.expression.expressions.map(this.renderChildExpression), h("li", { key: 'f120182c92d6b9a0b35b21be2d3308f6e62e36ab', class: "add-button" }, this.renderAddChildExpression()))));
|
|
75
|
+
}
|
|
76
|
+
renderAddChildExpression() {
|
|
77
|
+
return (h("limel-button", { label: this.getAddButtonLabel(), icon: "plus_math", onClick: this.handleAddChildExpression }));
|
|
78
|
+
}
|
|
79
|
+
getAddButtonLabel() {
|
|
80
|
+
if (this.expression.expressions.length === 0) {
|
|
81
|
+
return 'Add a condition';
|
|
82
|
+
}
|
|
83
|
+
return 'Add another condition';
|
|
84
|
+
}
|
|
85
|
+
static get is() { return "limebb-lime-query-filter-and"; }
|
|
86
|
+
static get encapsulation() { return "shadow"; }
|
|
87
|
+
static get originalStyleUrls() {
|
|
88
|
+
return {
|
|
89
|
+
"$": ["lime-query-filter-and.scss"]
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
static get styleUrls() {
|
|
93
|
+
return {
|
|
94
|
+
"$": ["lime-query-filter-and.css"]
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
static get properties() {
|
|
98
|
+
return {
|
|
99
|
+
"platform": {
|
|
100
|
+
"type": "unknown",
|
|
101
|
+
"mutable": false,
|
|
102
|
+
"complexType": {
|
|
103
|
+
"original": "LimeWebComponentPlatform",
|
|
104
|
+
"resolved": "LimeWebComponentPlatform",
|
|
105
|
+
"references": {
|
|
106
|
+
"LimeWebComponentPlatform": {
|
|
107
|
+
"location": "import",
|
|
108
|
+
"path": "@limetech/lime-web-components",
|
|
109
|
+
"id": "node_modules::LimeWebComponentPlatform"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"required": false,
|
|
114
|
+
"optional": false,
|
|
115
|
+
"docs": {
|
|
116
|
+
"tags": [],
|
|
117
|
+
"text": "Platform service provider"
|
|
118
|
+
},
|
|
119
|
+
"getter": false,
|
|
120
|
+
"setter": false
|
|
121
|
+
},
|
|
122
|
+
"context": {
|
|
123
|
+
"type": "unknown",
|
|
124
|
+
"mutable": false,
|
|
125
|
+
"complexType": {
|
|
126
|
+
"original": "LimeWebComponentContext",
|
|
127
|
+
"resolved": "LimeWebComponentContext",
|
|
128
|
+
"references": {
|
|
129
|
+
"LimeWebComponentContext": {
|
|
130
|
+
"location": "import",
|
|
131
|
+
"path": "@limetech/lime-web-components",
|
|
132
|
+
"id": "node_modules::LimeWebComponentContext"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"required": false,
|
|
137
|
+
"optional": false,
|
|
138
|
+
"docs": {
|
|
139
|
+
"tags": [],
|
|
140
|
+
"text": "Component context"
|
|
141
|
+
},
|
|
142
|
+
"getter": false,
|
|
143
|
+
"setter": false
|
|
144
|
+
},
|
|
145
|
+
"label": {
|
|
146
|
+
"type": "string",
|
|
147
|
+
"mutable": false,
|
|
148
|
+
"complexType": {
|
|
149
|
+
"original": "string",
|
|
150
|
+
"resolved": "string",
|
|
151
|
+
"references": {}
|
|
152
|
+
},
|
|
153
|
+
"required": false,
|
|
154
|
+
"optional": false,
|
|
155
|
+
"docs": {
|
|
156
|
+
"tags": [],
|
|
157
|
+
"text": "Optional label for the AND group"
|
|
158
|
+
},
|
|
159
|
+
"getter": false,
|
|
160
|
+
"setter": false,
|
|
161
|
+
"attribute": "label",
|
|
162
|
+
"reflect": false
|
|
163
|
+
},
|
|
164
|
+
"limetype": {
|
|
165
|
+
"type": "string",
|
|
166
|
+
"mutable": false,
|
|
167
|
+
"complexType": {
|
|
168
|
+
"original": "string",
|
|
169
|
+
"resolved": "string",
|
|
170
|
+
"references": {}
|
|
171
|
+
},
|
|
172
|
+
"required": false,
|
|
173
|
+
"optional": false,
|
|
174
|
+
"docs": {
|
|
175
|
+
"tags": [],
|
|
176
|
+
"text": "The limetype being queried (e.g., \"deal\", \"company\")"
|
|
177
|
+
},
|
|
178
|
+
"getter": false,
|
|
179
|
+
"setter": false,
|
|
180
|
+
"attribute": "limetype",
|
|
181
|
+
"reflect": false
|
|
182
|
+
},
|
|
183
|
+
"activeLimetype": {
|
|
184
|
+
"type": "string",
|
|
185
|
+
"mutable": false,
|
|
186
|
+
"complexType": {
|
|
187
|
+
"original": "string",
|
|
188
|
+
"resolved": "string | undefined",
|
|
189
|
+
"references": {}
|
|
190
|
+
},
|
|
191
|
+
"required": false,
|
|
192
|
+
"optional": true,
|
|
193
|
+
"docs": {
|
|
194
|
+
"tags": [],
|
|
195
|
+
"text": "The limetype of the active object (for %activeObject% placeholders)"
|
|
196
|
+
},
|
|
197
|
+
"getter": false,
|
|
198
|
+
"setter": false,
|
|
199
|
+
"attribute": "active-limetype",
|
|
200
|
+
"reflect": false
|
|
201
|
+
},
|
|
202
|
+
"expression": {
|
|
203
|
+
"type": "unknown",
|
|
204
|
+
"mutable": false,
|
|
205
|
+
"complexType": {
|
|
206
|
+
"original": "LimeQueryFilterAnd",
|
|
207
|
+
"resolved": "LimeQueryFilterAnd",
|
|
208
|
+
"references": {
|
|
209
|
+
"LimeQueryFilterAnd": {
|
|
210
|
+
"location": "import",
|
|
211
|
+
"path": "../lime-query.types",
|
|
212
|
+
"id": "src/components/lime-query-builder/lime-query.types.ts::LimeQueryFilterAnd"
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
"required": false,
|
|
217
|
+
"optional": false,
|
|
218
|
+
"docs": {
|
|
219
|
+
"tags": [],
|
|
220
|
+
"text": "The AND expression containing child expressions"
|
|
221
|
+
},
|
|
222
|
+
"getter": false,
|
|
223
|
+
"setter": false,
|
|
224
|
+
"defaultValue": "{\n filter_type: 'AND',\n expressions: [],\n }"
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
static get events() {
|
|
229
|
+
return [{
|
|
230
|
+
"method": "expressionChange",
|
|
231
|
+
"name": "expressionChange",
|
|
232
|
+
"bubbles": true,
|
|
233
|
+
"cancelable": true,
|
|
234
|
+
"composed": true,
|
|
235
|
+
"docs": {
|
|
236
|
+
"tags": [],
|
|
237
|
+
"text": "Emitted when the AND expression changes (expressions added/removed/modified)"
|
|
238
|
+
},
|
|
239
|
+
"complexType": {
|
|
240
|
+
"original": "LimeQueryFilterAnd | LimeQueryFilterMissing",
|
|
241
|
+
"resolved": "LimeQueryFilterAnd | LimeQueryFilterMissing",
|
|
242
|
+
"references": {
|
|
243
|
+
"LimeQueryFilterAnd": {
|
|
244
|
+
"location": "import",
|
|
245
|
+
"path": "../lime-query.types",
|
|
246
|
+
"id": "src/components/lime-query-builder/lime-query.types.ts::LimeQueryFilterAnd"
|
|
247
|
+
},
|
|
248
|
+
"LimeQueryFilterMissing": {
|
|
249
|
+
"location": "import",
|
|
250
|
+
"path": "../lime-query.types",
|
|
251
|
+
"id": "src/components/lime-query-builder/lime-query.types.ts::LimeQueryFilterMissing"
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}];
|
|
256
|
+
}
|
|
257
|
+
}
|
package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-comparison.css
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
.expression-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: row;
|
|
4
|
+
align-items: flex-start;
|
|
5
|
+
gap: 1rem;
|
|
6
|
+
flex-wrap: wrap;
|
|
7
|
+
}
|
|
8
|
+
.expression-container > * {
|
|
9
|
+
flex-grow: 2;
|
|
10
|
+
width: 30%;
|
|
11
|
+
max-width: calc(100% - 3.25rem);
|
|
12
|
+
}
|
|
13
|
+
.expression-container > .operator {
|
|
14
|
+
flex-grow: 1;
|
|
15
|
+
width: calc(30% + 1rem);
|
|
16
|
+
min-width: 4rem;
|
|
17
|
+
}
|
|
18
|
+
.expression-container > .remove {
|
|
19
|
+
flex-grow: 0;
|
|
20
|
+
width: auto;
|
|
21
|
+
margin-left: auto;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@media (max-width: 768px) {
|
|
25
|
+
.expression-container {
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
}
|
|
28
|
+
.expression-container > * {
|
|
29
|
+
width: 100%;
|
|
30
|
+
max-width: 100%;
|
|
31
|
+
}
|
|
32
|
+
.expression-container > .operator {
|
|
33
|
+
width: 100%;
|
|
34
|
+
}
|
|
35
|
+
.expression-container > .remove {
|
|
36
|
+
margin-left: 0;
|
|
37
|
+
align-self: flex-end;
|
|
38
|
+
}
|
|
39
|
+
}
|