@limetech/lime-crm-building-blocks 1.97.0 → 1.99.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/{index.esm-a894ac76.js → index.esm-d785eb6e.js} +2 -0
- package/dist/cjs/lime-crm-building-blocks.cjs.js +1 -1
- package/dist/cjs/limebb-browser.cjs.entry.js +1 -1
- package/dist/cjs/limebb-chat-item_2.cjs.entry.js +1 -1
- package/dist/cjs/limebb-chat-list.cjs.entry.js +1 -1
- package/dist/cjs/limebb-component-config.cjs.entry.js +1 -1
- package/dist/cjs/limebb-component-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-currency-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-date-picker.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-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 +90 -174
- package/dist/cjs/limebb-lime-query-filter-and.cjs.entry.js +80 -0
- package/dist/cjs/limebb-lime-query-filter-comparison_2.cjs.entry.js +147 -0
- package/dist/cjs/limebb-lime-query-filter-group_4.cjs.entry.js +603 -0
- package/dist/cjs/limebb-lime-query-filter-or.cjs.entry.js +68 -0
- package/dist/cjs/limebb-limeobject-file-viewer.cjs.entry.js +1 -1
- package/dist/cjs/limebb-limetype-field_2.cjs.entry.js +37 -6
- package/dist/cjs/limebb-live-docs-info.cjs.entry.js +2 -2
- package/dist/cjs/limebb-loader.cjs.entry.js +1 -1
- package/dist/cjs/limebb-locale-picker.cjs.entry.js +2 -2
- package/dist/cjs/limebb-mention-group-counter.cjs.entry.js +2 -2
- package/dist/cjs/limebb-mention.cjs.entry.js +1 -1
- package/dist/cjs/limebb-navigation-button_2.cjs.entry.js +3 -3
- package/dist/cjs/limebb-notification-item.cjs.entry.js +2 -2
- package/dist/cjs/limebb-notification-list.cjs.entry.js +1 -1
- package/dist/cjs/limebb-percentage-visualizer.cjs.entry.js +2 -2
- package/dist/cjs/limebb-text-editor.cjs.entry.js +3 -3
- package/dist/cjs/limebb-trend-indicator.cjs.entry.js +1 -1
- package/dist/cjs/{limetype-1fe0207f.js → limetype-f2e4376e.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-and.js +41 -49
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-comparison.js +77 -41
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-expression.js +35 -46
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.css +130 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.js +269 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-not.js +19 -25
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-or.js +34 -34
- package/dist/collection/components/lime-query-builder/lime-query-builder.js +60 -24
- package/dist/collection/components/lime-query-builder/limetype-field/limetype-field.js +1 -1
- 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/index.esm.js +2 -1
- package/dist/components/lime-query-filter-comparison.js +32 -45
- package/dist/components/lime-query-filter-expression.js +315 -0
- package/dist/components/limebb-lime-query-builder.js +96 -184
- package/dist/components/limebb-lime-query-filter-and.js +130 -1
- package/dist/components/limebb-lime-query-filter-comparison.js +1 -1
- package/dist/components/limebb-lime-query-filter-expression.js +1 -1
- package/dist/components/limebb-lime-query-filter-group.d.ts +11 -0
- package/dist/components/limebb-lime-query-filter-group.js +6 -0
- package/dist/components/limebb-lime-query-filter-not.js +1 -1
- package/dist/components/limebb-lime-query-filter-or.js +118 -1
- package/dist/components/limebb-locale-picker.js +1 -1
- package/dist/components/limebb-mention-group-counter.js +2 -2
- package/dist/components/limebb-percentage-visualizer.js +2 -2
- package/dist/components/limebb-text-editor.js +1 -1
- package/dist/components/limebb-trend-indicator.js +1 -1
- package/dist/components/limetype-field.js +34 -2
- package/dist/components/live-docs-info.js +2 -2
- package/dist/components/notification-item.js +1 -1
- package/dist/components/summary-popover.js +3 -3
- package/dist/esm/{index.esm-d8fdeb18.js → index.esm-bb569663.js} +2 -1
- package/dist/esm/lime-crm-building-blocks.js +1 -1
- package/dist/esm/limebb-browser.entry.js +1 -1
- package/dist/esm/limebb-chat-item_2.entry.js +1 -1
- package/dist/esm/limebb-chat-list.entry.js +1 -1
- package/dist/esm/limebb-component-config.entry.js +1 -1
- package/dist/esm/limebb-component-picker.entry.js +1 -1
- package/dist/esm/limebb-currency-picker.entry.js +1 -1
- package/dist/esm/limebb-date-picker.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-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 +89 -173
- package/dist/esm/limebb-lime-query-filter-and.entry.js +76 -0
- package/dist/esm/limebb-lime-query-filter-comparison_2.entry.js +142 -0
- package/dist/esm/limebb-lime-query-filter-group_4.entry.js +596 -0
- package/dist/esm/limebb-lime-query-filter-or.entry.js +64 -0
- package/dist/esm/limebb-limeobject-file-viewer.entry.js +1 -1
- package/dist/esm/limebb-limetype-field_2.entry.js +36 -5
- package/dist/esm/limebb-live-docs-info.entry.js +2 -2
- package/dist/esm/limebb-loader.entry.js +1 -1
- package/dist/esm/limebb-locale-picker.entry.js +2 -2
- package/dist/esm/limebb-mention-group-counter.entry.js +2 -2
- package/dist/esm/limebb-mention.entry.js +1 -1
- package/dist/esm/limebb-navigation-button_2.entry.js +3 -3
- package/dist/esm/limebb-notification-item.entry.js +2 -2
- package/dist/esm/limebb-notification-list.entry.js +1 -1
- package/dist/esm/limebb-percentage-visualizer.entry.js +2 -2
- package/dist/esm/limebb-text-editor.entry.js +3 -3
- package/dist/esm/limebb-trend-indicator.entry.js +1 -1
- package/dist/esm/{limetype-6e7552a7.js → limetype-c0e041f7.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/p-03accd53.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-a1818969.entry.js → p-03af0e66.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-f402184f.entry.js → p-098ee6c1.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-42e52b50.entry.js → p-1be0eec7.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-2aa18c2b.entry.js → p-206575e4.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-20bfca36.js +1 -0
- package/dist/lime-crm-building-blocks/{p-82d33d43.entry.js → p-2faaacbc.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-d4016891.entry.js → p-2fdcb868.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-f52125a0.entry.js → p-3122ea05.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-baf4e428.entry.js → p-3175883d.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-8c8b7115.entry.js → p-32534eb7.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-6c1146ca.entry.js → p-36ea13c0.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-4715210d.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-1fba0ade.js → p-4838284a.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-5e4ba110.entry.js → p-5464f0de.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-e9d23ef7.entry.js → p-569c86b5.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-90e1716a.entry.js → p-5dc574a3.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-5f7644b5.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-00da9b24.entry.js → p-631ca5a5.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-67dbaa4c.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-beb0d164.entry.js → p-7271f47a.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-34357744.entry.js → p-9031f136.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-91732502.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-8c4eb49f.entry.js → p-93cadc1e.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-3932077b.entry.js → p-9cac4de2.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-79d4668a.entry.js → p-a200954f.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-aa646df7.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-d89c44ad.entry.js → p-b9b954d9.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-3a620226.entry.js → p-cfa1a4ad.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-ef8a5266.entry.js → p-e8946134.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-9d9f25da.entry.js → p-eb81bceb.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-50d3d61a.entry.js → p-ee1b00b9.entry.js} +1 -1
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-and.d.ts +5 -4
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-comparison.d.ts +6 -4
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-expression.d.ts +10 -14
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-group.d.ts +60 -0
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-not.d.ts +4 -4
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-or.d.ts +5 -4
- package/dist/types/components/lime-query-builder/lime-query-builder.d.ts +19 -2
- package/dist/types/components/lime-query-builder/lime-query.types.d.ts +2 -1
- package/dist/types/components.d.ts +209 -65
- package/package.json +1 -1
- package/dist/cjs/isEqual-e77cce75.js +0 -37
- package/dist/cjs/lime-query.types-bcb63a22.js +0 -61
- package/dist/cjs/limebb-lime-query-filter-and_5.cjs.entry.js +0 -278
- package/dist/cjs/limebb-lime-query-value-input.cjs.entry.js +0 -239
- package/dist/cjs/limebb-property-selector.cjs.entry.js +0 -234
- package/dist/components/isEqual.js +0 -35
- package/dist/components/lime-query-filter-and.js +0 -408
- package/dist/esm/isEqual-57d0c223.js +0 -35
- package/dist/esm/lime-query.types-f72355e1.js +0 -59
- package/dist/esm/limebb-lime-query-filter-and_5.entry.js +0 -270
- package/dist/esm/limebb-lime-query-value-input.entry.js +0 -235
- package/dist/esm/limebb-property-selector.entry.js +0 -230
- package/dist/lime-crm-building-blocks/p-02c0cc04.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-3b0a15ec.js +0 -1
- package/dist/lime-crm-building-blocks/p-5a6d2e7f.js +0 -1
- package/dist/lime-crm-building-blocks/p-60971d64.js +0 -1
- package/dist/lime-crm-building-blocks/p-70a28b93.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-96beaabc.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-b7c72179.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-f99c611d.entry.js +0 -1
|
@@ -1,64 +1,65 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-96dd111f.js';
|
|
2
|
-
import { T as Te } from './index.esm-
|
|
3
|
-
import { L as LIME_QUERY_OPERATORS } from './lime-query.types-f72355e1.js';
|
|
2
|
+
import { T as Te, Z as Zt } from './index.esm-bb569663.js';
|
|
4
3
|
import { g as getNormalizedProperties, a as getPropertyFromPath } from './property-resolution-fde2375e.js';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* TypeScript type definitions for Lime Query DSL
|
|
7
|
+
*
|
|
8
|
+
* These types represent the structure of Lime Query as defined in:
|
|
9
|
+
* - lime-core/lime_query/schema.py
|
|
10
|
+
* - lime-core/lime_filter/schema.py
|
|
9
11
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
12
|
+
/**
|
|
13
|
+
* Available operators with display metadata
|
|
14
|
+
*/
|
|
15
|
+
const LIME_QUERY_OPERATORS = [
|
|
16
|
+
{ value: '=', label: 'Equals', icon: 'equals' },
|
|
17
|
+
{ value: '!=', label: 'Not Equals', icon: 'not-equal' },
|
|
18
|
+
{
|
|
19
|
+
value: '>',
|
|
20
|
+
label: 'Greater Than',
|
|
21
|
+
icon: 'greater-than',
|
|
22
|
+
applicableTypes: ['integer', 'decimal', 'date', 'time'],
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
value: '>=',
|
|
26
|
+
label: 'Greater or Equal',
|
|
27
|
+
icon: 'greater-or-equal',
|
|
28
|
+
applicableTypes: ['integer', 'decimal', 'date', 'time'],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
value: '<',
|
|
32
|
+
label: 'Less Than',
|
|
33
|
+
icon: 'less-than',
|
|
34
|
+
applicableTypes: ['integer', 'decimal', 'date', 'time'],
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
value: '<=',
|
|
38
|
+
label: 'Less or Equal',
|
|
39
|
+
icon: 'less-or-equal',
|
|
40
|
+
applicableTypes: ['integer', 'decimal', 'date', 'time'],
|
|
41
|
+
},
|
|
42
|
+
{ value: 'IN', label: 'In List', icon: 'list' },
|
|
43
|
+
{
|
|
44
|
+
value: '?',
|
|
45
|
+
label: 'Contains',
|
|
46
|
+
icon: '-lime-filter-contain',
|
|
47
|
+
applicableTypes: ['string', 'text'],
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
value: '=?',
|
|
51
|
+
label: 'Begins With',
|
|
52
|
+
icon: '-lime-filter-begin',
|
|
53
|
+
applicableTypes: ['string', 'text'],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
value: '=$',
|
|
57
|
+
label: 'Ends With',
|
|
58
|
+
icon: '-lime-filter-end',
|
|
59
|
+
applicableTypes: ['string', 'text'],
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
|
|
62
63
|
/**
|
|
63
64
|
* Validate and convert a FilterExpression (comparison filter)
|
|
64
65
|
* @param filter
|
|
@@ -160,103 +161,6 @@ function limeQueryToGuiFilter(filter) {
|
|
|
160
161
|
// It's a FilterGroup
|
|
161
162
|
return validateAndConvertFilterGroup(filter);
|
|
162
163
|
}
|
|
163
|
-
/**
|
|
164
|
-
* Normalize filter for GUI mode by ensuring proper AND/OR wrapper structure.
|
|
165
|
-
* GUI mode requires filters to be wrapped in AND([OR(...)]) so users have
|
|
166
|
-
* access to add/remove buttons on the AND and OR components.
|
|
167
|
-
*
|
|
168
|
-
* This function ensures that:
|
|
169
|
-
* - Single comparisons are wrapped in AND([OR([comparison])])
|
|
170
|
-
* - OR groups are wrapped in AND([OR group])
|
|
171
|
-
* - AND groups have their comparison children wrapped in OR
|
|
172
|
-
* - Empty/undefined filters become AND([])
|
|
173
|
-
*
|
|
174
|
-
* When converting back to Lime Query JSON, limeQueryFilterToLimeQuery()
|
|
175
|
-
* automatically unwraps single-item AND/OR groups.
|
|
176
|
-
*
|
|
177
|
-
* @param filter The filter expression from limeQueryToLimeQueryFilter
|
|
178
|
-
* @returns Normalized filter suitable for GUI editing
|
|
179
|
-
*/
|
|
180
|
-
function normalizeLimeQueryFilterForGui(filter) {
|
|
181
|
-
// Empty AND is already correct for GUI
|
|
182
|
-
if (filter.filter_type === 'AND' && filter.expressions.length === 0) {
|
|
183
|
-
return filter;
|
|
184
|
-
}
|
|
185
|
-
// Single comparison needs wrapping
|
|
186
|
-
if (filter.filter_type === 'comparison') {
|
|
187
|
-
return {
|
|
188
|
-
filter_type: 'AND',
|
|
189
|
-
expressions: [
|
|
190
|
-
{
|
|
191
|
-
filter_type: 'OR',
|
|
192
|
-
expressions: [filter],
|
|
193
|
-
},
|
|
194
|
-
],
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
// OR needs wrapping in AND
|
|
198
|
-
if (filter.filter_type === 'OR') {
|
|
199
|
-
return {
|
|
200
|
-
filter_type: 'AND',
|
|
201
|
-
expressions: [filter],
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
// NOT needs wrapping
|
|
205
|
-
if (filter.filter_type === 'NOT') {
|
|
206
|
-
return {
|
|
207
|
-
filter_type: 'AND',
|
|
208
|
-
expressions: [
|
|
209
|
-
{
|
|
210
|
-
filter_type: 'OR',
|
|
211
|
-
expressions: [filter],
|
|
212
|
-
},
|
|
213
|
-
],
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
// AND group - check if children need OR wrappers
|
|
217
|
-
if (filter.filter_type === 'AND') {
|
|
218
|
-
const normalizedChildren = filter.expressions.map((child) => {
|
|
219
|
-
// If child is already OR, keep it
|
|
220
|
-
if (child.filter_type === 'OR') {
|
|
221
|
-
return child;
|
|
222
|
-
}
|
|
223
|
-
// If child is NOT, keep it (NOT can be a direct child of AND)
|
|
224
|
-
if (child.filter_type === 'NOT') {
|
|
225
|
-
return child;
|
|
226
|
-
}
|
|
227
|
-
// If child is comparison, wrap in OR
|
|
228
|
-
if (child.filter_type === 'comparison') {
|
|
229
|
-
return {
|
|
230
|
-
filter_type: 'OR',
|
|
231
|
-
expressions: [child],
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
// If child is nested AND, recursively normalize and wrap in OR
|
|
235
|
-
if (child.filter_type === 'AND') {
|
|
236
|
-
return {
|
|
237
|
-
filter_type: 'OR',
|
|
238
|
-
expressions: [normalizeLimeQueryFilterForGui(child)],
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
// Unknown filter type, keep as is
|
|
242
|
-
return child;
|
|
243
|
-
});
|
|
244
|
-
return {
|
|
245
|
-
filter_type: 'AND',
|
|
246
|
-
expressions: normalizedChildren,
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
// Fallback: wrap in AND/OR structure
|
|
250
|
-
return {
|
|
251
|
-
filter_type: 'AND',
|
|
252
|
-
expressions: [
|
|
253
|
-
{
|
|
254
|
-
filter_type: 'OR',
|
|
255
|
-
expressions: [filter],
|
|
256
|
-
},
|
|
257
|
-
],
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
164
|
|
|
261
165
|
/**
|
|
262
166
|
* Dynamic filter values and placeholders that are valid in Lime Query
|
|
@@ -656,16 +560,16 @@ const LimeQueryBuilder = class {
|
|
|
656
560
|
this.codeValue = '';
|
|
657
561
|
this.limetype = '';
|
|
658
562
|
this.filter = {
|
|
659
|
-
|
|
660
|
-
|
|
563
|
+
op: Zt.AND,
|
|
564
|
+
exp: [],
|
|
661
565
|
};
|
|
662
566
|
this.handleLimetypeChange = (event) => {
|
|
663
567
|
event.stopPropagation();
|
|
664
568
|
this.limetype = event.detail;
|
|
665
569
|
// Reset filter when limetype changes
|
|
666
570
|
this.filter = {
|
|
667
|
-
|
|
668
|
-
|
|
571
|
+
op: Zt.AND,
|
|
572
|
+
exp: [],
|
|
669
573
|
};
|
|
670
574
|
// Reset response format when limetype changes
|
|
671
575
|
this.internalResponseFormat = {
|
|
@@ -677,15 +581,15 @@ const LimeQueryBuilder = class {
|
|
|
677
581
|
};
|
|
678
582
|
this.handleFilterChange = (event) => {
|
|
679
583
|
event.stopPropagation();
|
|
680
|
-
|
|
681
|
-
if (
|
|
584
|
+
const expression = event.detail;
|
|
585
|
+
if (expression === undefined) {
|
|
682
586
|
this.filter = {
|
|
683
|
-
|
|
684
|
-
|
|
587
|
+
op: Zt.AND,
|
|
588
|
+
exp: [],
|
|
685
589
|
};
|
|
686
590
|
}
|
|
687
591
|
else {
|
|
688
|
-
this.filter =
|
|
592
|
+
this.filter = expression;
|
|
689
593
|
}
|
|
690
594
|
this.emitChange();
|
|
691
595
|
};
|
|
@@ -700,10 +604,6 @@ const LimeQueryBuilder = class {
|
|
|
700
604
|
this.limit = value ? Number.parseInt(value, 10) : undefined;
|
|
701
605
|
this.emitChange();
|
|
702
606
|
};
|
|
703
|
-
this.handleActiveLimetypeChange = (event) => {
|
|
704
|
-
event.stopPropagation();
|
|
705
|
-
this.activeLimetype = event.detail || undefined;
|
|
706
|
-
};
|
|
707
607
|
this.switchToGui = () => {
|
|
708
608
|
// Validate JSON before switching
|
|
709
609
|
try {
|
|
@@ -716,7 +616,7 @@ const LimeQueryBuilder = class {
|
|
|
716
616
|
}
|
|
717
617
|
// Update internal state from parsed query
|
|
718
618
|
this.limetype = parsed.limetype || '';
|
|
719
|
-
this.filter =
|
|
619
|
+
this.filter = this.normalizeFilter(parsed.filter);
|
|
720
620
|
this.internalResponseFormat = parsed.responseFormat;
|
|
721
621
|
this.limit = parsed.limit;
|
|
722
622
|
this.mode = 'gui';
|
|
@@ -757,7 +657,7 @@ const LimeQueryBuilder = class {
|
|
|
757
657
|
}
|
|
758
658
|
if (this.value) {
|
|
759
659
|
this.limetype = this.value.limetype || '';
|
|
760
|
-
this.filter =
|
|
660
|
+
this.filter = this.normalizeFilter(this.value.filter);
|
|
761
661
|
this.internalResponseFormat = this.value.responseFormat;
|
|
762
662
|
this.limit = this.value.limit;
|
|
763
663
|
}
|
|
@@ -772,10 +672,26 @@ const LimeQueryBuilder = class {
|
|
|
772
672
|
render() {
|
|
773
673
|
const guiSupported = this.checkGuiSupport();
|
|
774
674
|
const showCodeMode = !this.guiModeEnabled || this.mode === 'code';
|
|
775
|
-
return (h("div", { key: '
|
|
675
|
+
return (h("div", { key: '5ff70a352e3e57ff4c51d44627bd4b5ed367fff4', class: "lime-query-builder" }, this.renderLabel(), this.renderModeControls(guiSupported), showCodeMode
|
|
776
676
|
? this.renderCodeMode(guiSupported)
|
|
777
677
|
: this.renderGuiMode()));
|
|
778
678
|
}
|
|
679
|
+
/**
|
|
680
|
+
* Normalize filter to ensure top-level is an AND group.
|
|
681
|
+
* This ensures Add buttons are available in the UI.
|
|
682
|
+
* @param filter
|
|
683
|
+
*/
|
|
684
|
+
normalizeFilter(filter) {
|
|
685
|
+
if (!filter) {
|
|
686
|
+
return { op: Zt.AND, exp: [] };
|
|
687
|
+
}
|
|
688
|
+
// If it's already an AND at the top level, keep it
|
|
689
|
+
if ('op' in filter && filter.op === Zt.AND) {
|
|
690
|
+
return filter;
|
|
691
|
+
}
|
|
692
|
+
// Otherwise wrap in AND
|
|
693
|
+
return { op: Zt.AND, exp: [filter] };
|
|
694
|
+
}
|
|
779
695
|
emitChange() {
|
|
780
696
|
// Only emit in GUI mode
|
|
781
697
|
if (this.mode === 'code') {
|
|
@@ -793,7 +709,7 @@ const LimeQueryBuilder = class {
|
|
|
793
709
|
const limeQuery = {
|
|
794
710
|
limetype: this.limetype,
|
|
795
711
|
responseFormat: responseFormat,
|
|
796
|
-
filter:
|
|
712
|
+
filter: this.filter,
|
|
797
713
|
};
|
|
798
714
|
if (this.limit !== undefined && this.limit > 0) {
|
|
799
715
|
limeQuery.limit = this.limit;
|
|
@@ -814,7 +730,7 @@ const LimeQueryBuilder = class {
|
|
|
814
730
|
const limeQuery = {
|
|
815
731
|
limetype: this.limetype,
|
|
816
732
|
responseFormat: responseFormat,
|
|
817
|
-
filter:
|
|
733
|
+
filter: this.filter,
|
|
818
734
|
};
|
|
819
735
|
if (this.limit !== undefined && this.limit > 0) {
|
|
820
736
|
limeQuery.limit = this.limit;
|
|
@@ -865,7 +781,7 @@ const LimeQueryBuilder = class {
|
|
|
865
781
|
queryToCheck = {
|
|
866
782
|
limetype: this.limetype,
|
|
867
783
|
responseFormat: responseFormat,
|
|
868
|
-
filter:
|
|
784
|
+
filter: this.filter,
|
|
869
785
|
};
|
|
870
786
|
if (this.limit !== undefined && this.limit > 0) {
|
|
871
787
|
queryToCheck.limit = this.limit;
|
|
@@ -904,7 +820,7 @@ const LimeQueryBuilder = class {
|
|
|
904
820
|
if (!this.limetype) {
|
|
905
821
|
return;
|
|
906
822
|
}
|
|
907
|
-
return (h("div", { class: "query-options-section" }, h("h4", { class: "section-label" }, "Query Options"), h("div", { class: "query-options-controls" }, h("
|
|
823
|
+
return (h("div", { class: "query-options-section" }, h("h4", { class: "section-label" }, "Query Options"), h("div", { class: "query-options-controls" }, 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 }))));
|
|
908
824
|
}
|
|
909
825
|
renderGuiMode() {
|
|
910
826
|
return (h("div", { class: "gui-mode" }, this.renderLimetypeSection(), this.renderResponseFormatSection(), this.renderFilterSection(), this.renderQueryOptionsSection()));
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-96dd111f.js';
|
|
2
|
+
import { Z as Zt } from './index.esm-bb569663.js';
|
|
3
|
+
|
|
4
|
+
const limeQueryFilterAndCss = "@charset \"UTF-8\";.expression{display:flex;flex-direction:column;margin-bottom:1rem;gap:0;background-color:rgb(var(--contrast-100));border:1px solid rgb(var(--contrast-500));border-radius:0.75rem}.expression>ul{margin-top:0;margin-right:1rem;margin-bottom:1rem;margin-left:1rem;padding-left:1rem;list-style:disc}.expression>ul li{margin-top:1rem}.expression>ul li.add-button{list-style:none}";
|
|
5
|
+
const LimebbLimeQueryFilterAndStyle0 = limeQueryFilterAndCss;
|
|
6
|
+
|
|
7
|
+
const LimeQueryFilterAndComponent = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
this.expressionChange = createEvent(this, "expressionChange", 7);
|
|
11
|
+
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) })));
|
|
12
|
+
this.handleAddChildExpression = () => {
|
|
13
|
+
const newOrGroup = {
|
|
14
|
+
op: Zt.OR,
|
|
15
|
+
exp: [
|
|
16
|
+
{
|
|
17
|
+
key: '',
|
|
18
|
+
op: Zt.EQUALS,
|
|
19
|
+
exp: '',
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
};
|
|
23
|
+
const updatedExpressionsList = [
|
|
24
|
+
...this.expression.exp,
|
|
25
|
+
newOrGroup,
|
|
26
|
+
];
|
|
27
|
+
this.expressionChange.emit({
|
|
28
|
+
op: Zt.AND,
|
|
29
|
+
exp: updatedExpressionsList,
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
this.handleExpressionChange = (updatedChildIndex) => (event) => {
|
|
33
|
+
var _a;
|
|
34
|
+
event.stopPropagation();
|
|
35
|
+
const updatedExpression = (_a = event.detail) !== null && _a !== void 0 ? _a : undefined;
|
|
36
|
+
const expressions = [...this.expression.exp];
|
|
37
|
+
if (updatedExpression === undefined) {
|
|
38
|
+
expressions.splice(updatedChildIndex, 1);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
expressions[updatedChildIndex] = updatedExpression;
|
|
42
|
+
}
|
|
43
|
+
if (expressions.length === 0) {
|
|
44
|
+
this.expressionChange.emit(undefined);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (expressions.length === 1) {
|
|
48
|
+
this.expressionChange.emit(expressions[0]);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
this.expressionChange.emit({
|
|
52
|
+
op: Zt.AND,
|
|
53
|
+
exp: expressions,
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
render() {
|
|
58
|
+
let subheading = 'All of these conditions are true';
|
|
59
|
+
if (this.expression.exp.length <= 1) {
|
|
60
|
+
subheading = '';
|
|
61
|
+
}
|
|
62
|
+
return (h("div", { key: 'f07c53808d6be8d846f5a45223abb5c94b1a0b16', class: "expression" }, (this.label || subheading) && (h("limel-header", { key: '229f0d58ff15743fbb12da53ad9c593bfba801d1', heading: this.label, subheading: subheading })), h("ul", { key: '2600c2bee2b958036ea606141bcfcac0e277114c' }, this.expression.exp.map(this.renderChildExpression), h("li", { key: '6395e605ee8f454a820ac73601da89b19686187a', class: "add-button" }, this.renderAddChildExpression()))));
|
|
63
|
+
}
|
|
64
|
+
renderAddChildExpression() {
|
|
65
|
+
return (h("limel-button", { label: this.getAddButtonLabel(), icon: "plus_math", onClick: this.handleAddChildExpression }));
|
|
66
|
+
}
|
|
67
|
+
getAddButtonLabel() {
|
|
68
|
+
if (this.expression.exp.length === 0) {
|
|
69
|
+
return 'Add a condition';
|
|
70
|
+
}
|
|
71
|
+
return 'Add another condition';
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
LimeQueryFilterAndComponent.style = LimebbLimeQueryFilterAndStyle0;
|
|
75
|
+
|
|
76
|
+
export { LimeQueryFilterAndComponent as limebb_lime_query_filter_and };
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-96dd111f.js';
|
|
2
|
+
import { Z as Zt } from './index.esm-bb569663.js';
|
|
3
|
+
|
|
4
|
+
const limeQueryFilterComparisonCss = ".expression-container{display:flex;flex-direction:row;align-items:flex-start;gap:1rem;flex-wrap:wrap}.expression-container>*{flex-grow:2;width:30%;max-width:calc(100% - 3.25rem)}.expression-container>.operator{flex-grow:1;width:calc(30% + 1rem);min-width:4rem}.expression-container>.remove{flex-grow:0;width:auto;margin-left:auto}@media (max-width: 768px){.expression-container{flex-direction:column}.expression-container>*{width:100%;max-width:100%}.expression-container>.operator{width:100%}.expression-container>.remove{margin-left:0;align-self:flex-end}}";
|
|
5
|
+
const LimebbLimeQueryFilterComparisonStyle0 = limeQueryFilterComparisonCss;
|
|
6
|
+
|
|
7
|
+
const LIME_QUERY_OPERATORS = [
|
|
8
|
+
{ value: Zt.EQUALS, label: 'Equals', icon: 'equals' },
|
|
9
|
+
{ value: Zt.NOT_EQUALS, label: 'Not Equals', icon: 'not-equal' },
|
|
10
|
+
{
|
|
11
|
+
value: Zt.GREATER,
|
|
12
|
+
label: 'Greater Than',
|
|
13
|
+
icon: 'greater-than',
|
|
14
|
+
applicableTypes: ['integer', 'decimal', 'date', 'time'],
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
value: Zt.GREATER_OR_EQUAL,
|
|
18
|
+
label: 'Greater or Equal',
|
|
19
|
+
icon: 'greater-or-equal',
|
|
20
|
+
applicableTypes: ['integer', 'decimal', 'date', 'time'],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
value: Zt.LESS,
|
|
24
|
+
label: 'Less Than',
|
|
25
|
+
icon: 'less-than',
|
|
26
|
+
applicableTypes: ['integer', 'decimal', 'date', 'time'],
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
value: Zt.LESS_OR_EQUAL,
|
|
30
|
+
label: 'Less or Equal',
|
|
31
|
+
icon: 'less-or-equal',
|
|
32
|
+
applicableTypes: ['integer', 'decimal', 'date', 'time'],
|
|
33
|
+
},
|
|
34
|
+
{ value: Zt.IN, label: 'In List', icon: 'list' },
|
|
35
|
+
{
|
|
36
|
+
value: Zt.LIKE,
|
|
37
|
+
label: 'Contains',
|
|
38
|
+
icon: '-lime-filter-contain',
|
|
39
|
+
applicableTypes: ['string', 'text'],
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
value: Zt.BEGINS,
|
|
43
|
+
label: 'Begins With',
|
|
44
|
+
icon: '-lime-filter-begin',
|
|
45
|
+
applicableTypes: ['string', 'text'],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
value: Zt.ENDS,
|
|
49
|
+
label: 'Ends With',
|
|
50
|
+
icon: '-lime-filter-end',
|
|
51
|
+
applicableTypes: ['string', 'text'],
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
const LimeQueryFilterComparisonComponent = class {
|
|
55
|
+
constructor(hostRef) {
|
|
56
|
+
registerInstance(this, hostRef);
|
|
57
|
+
this.expressionChange = createEvent(this, "expressionChange", 7);
|
|
58
|
+
this.handlePropertyChange = (event) => {
|
|
59
|
+
event.stopPropagation();
|
|
60
|
+
this.expressionChange.emit(Object.assign(Object.assign({}, this.expression), { key: event.detail }));
|
|
61
|
+
};
|
|
62
|
+
this.handleOperatorChange = (event) => {
|
|
63
|
+
event.stopPropagation();
|
|
64
|
+
// TODO: Clear value when switching between IN and other operators
|
|
65
|
+
// since array values are incompatible with single-value operators
|
|
66
|
+
this.expressionChange.emit({
|
|
67
|
+
key: this.expression.key,
|
|
68
|
+
op: event.detail.value,
|
|
69
|
+
exp: this.expression.exp,
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
this.handleValueChange = (event) => {
|
|
73
|
+
event.stopPropagation();
|
|
74
|
+
this.expressionChange.emit(Object.assign(Object.assign({}, this.expression), { exp: event.detail }));
|
|
75
|
+
};
|
|
76
|
+
this.removeExpression = () => {
|
|
77
|
+
this.expressionChange.emit(undefined);
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
render() {
|
|
81
|
+
return (h("div", { key: '668e0f05bdb1fb25ffd652ea650c34e5431a3332', class: "expression" }, this.label && h("limel-header", { key: '5034070b58afe31cf90699dd2a27f884e647f540', heading: this.label }), h("div", { key: '14a2b1270e5e6d7e158e29ebc5f61051e5670e80', class: "expression-container" }, this.renderPropertySelector(), this.renderOperator(), this.renderValueInput(), h("limel-icon-button", { key: 'b69bde6e88c40d2623ef015794db28cec3676c73', class: "remove", icon: "trash", label: "Remove condition", onClick: this.removeExpression }))));
|
|
82
|
+
}
|
|
83
|
+
renderPropertySelector() {
|
|
84
|
+
return (h("limebb-property-selector", { platform: this.platform, context: this.context, label: "Property", limetype: this.limetype, value: this.expression.key, required: true, onChange: this.handlePropertyChange }));
|
|
85
|
+
}
|
|
86
|
+
renderOperator() {
|
|
87
|
+
const operatorHasBeenSet = !!this.expression.op;
|
|
88
|
+
const options = LIME_QUERY_OPERATORS.map((op) => ({
|
|
89
|
+
text: op.label,
|
|
90
|
+
value: op.value,
|
|
91
|
+
icon: op.icon ? { name: op.icon } : undefined,
|
|
92
|
+
}));
|
|
93
|
+
const selectedOption = options.find((o) => o.value === this.expression.op);
|
|
94
|
+
return (h("limel-select", { class: "operator", label: "Operator", value: selectedOption, options: options, disabled: !operatorHasBeenSet && !this.expression.key, onChange: this.handleOperatorChange }));
|
|
95
|
+
}
|
|
96
|
+
renderValueInput() {
|
|
97
|
+
if (!this.expression.op) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
return (h("limebb-lime-query-value-input", { platform: this.platform, context: this.context, limetype: this.limetype, activeLimetype: this.activeLimetype, propertyPath: this.expression.key, operator: this.expression.op, value: this.expression.exp, onChange: this.handleValueChange }));
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
LimeQueryFilterComparisonComponent.style = LimebbLimeQueryFilterComparisonStyle0;
|
|
104
|
+
|
|
105
|
+
const limeQueryFilterExpressionCss = "@charset \"UTF-8\";.expression{display:flex;flex-direction:column;margin-bottom:1rem;gap:1rem}";
|
|
106
|
+
const LimebbLimeQueryFilterExpressionStyle0 = limeQueryFilterExpressionCss;
|
|
107
|
+
|
|
108
|
+
const LimeQueryFilterExpressionComponent = class {
|
|
109
|
+
constructor(hostRef) {
|
|
110
|
+
registerInstance(this, hostRef);
|
|
111
|
+
this.expressionChange = createEvent(this, "expressionChange", 7);
|
|
112
|
+
this.handleExpressionChange = (event) => {
|
|
113
|
+
event.stopPropagation();
|
|
114
|
+
this.expressionChange.emit(event.detail);
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
render() {
|
|
118
|
+
if (!this.expression) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const props = {
|
|
122
|
+
platform: this.platform,
|
|
123
|
+
context: this.context,
|
|
124
|
+
label: this.label,
|
|
125
|
+
limetype: this.limetype,
|
|
126
|
+
activeLimetype: this.activeLimetype,
|
|
127
|
+
};
|
|
128
|
+
if ('key' in this.expression) {
|
|
129
|
+
return (h("limebb-lime-query-filter-comparison", Object.assign({}, props, { expression: this.expression, onExpressionChange: this.handleExpressionChange })));
|
|
130
|
+
}
|
|
131
|
+
if (this.expression.op === Zt.AND ||
|
|
132
|
+
this.expression.op === Zt.OR) {
|
|
133
|
+
return (h("limebb-lime-query-filter-group", Object.assign({}, props, { expression: this.expression, onExpressionChange: this.handleExpressionChange })));
|
|
134
|
+
}
|
|
135
|
+
if (this.expression.op === Zt.NOT) {
|
|
136
|
+
return (h("limebb-lime-query-filter-not", Object.assign({}, props, { expression: this.expression, onExpressionChange: this.handleExpressionChange })));
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
LimeQueryFilterExpressionComponent.style = LimebbLimeQueryFilterExpressionStyle0;
|
|
141
|
+
|
|
142
|
+
export { LimeQueryFilterComparisonComponent as limebb_lime_query_filter_comparison, LimeQueryFilterExpressionComponent as limebb_lime_query_filter_expression };
|