@limetech/lime-crm-building-blocks 1.100.0 → 1.101.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/lime-crm-building-blocks.cjs.js +1 -1
- package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +177 -204
- package/dist/cjs/{limebb-lime-query-filter-builder_3.cjs.entry.js → limebb-lime-query-filter-builder_4.cjs.entry.js} +86 -1
- package/dist/cjs/limebb-lime-query-filter-comparison_2.cjs.entry.js +147 -0
- package/dist/cjs/{limebb-lime-query-filter-comparison_5.cjs.entry.js → limebb-lime-query-filter-group_3.cjs.entry.js} +5 -333
- package/dist/cjs/limebb-lime-query-order-by-item.cjs.entry.js +51 -0
- package/dist/cjs/limebb-live-docs-info.cjs.entry.js +2 -2
- package/dist/cjs/limebb-locale-picker.cjs.entry.js +1 -1
- 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-text-editor.cjs.entry.js +1 -1
- package/dist/cjs/limebb-trend-indicator.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-comparison.js +1 -1
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.js +1 -1
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-not.js +1 -1
- package/dist/collection/components/lime-query-builder/expressions/lime-query-value-input.js +7 -7
- package/dist/collection/components/lime-query-builder/lime-query-builder.css +2 -5
- package/dist/collection/components/lime-query-builder/lime-query-builder.js +19 -19
- package/dist/collection/components/lime-query-builder/lime-query-validation.js +160 -26
- package/dist/collection/components/lime-query-builder/lime-query.types.js +1 -57
- package/dist/collection/components/lime-query-builder/limetype-field/limetype-field.js +1 -1
- package/dist/collection/components/lime-query-builder/order-by/order-by-editor.css +72 -0
- package/dist/collection/components/lime-query-builder/order-by/order-by-editor.js +252 -0
- package/dist/collection/components/lime-query-builder/order-by/order-by-item.css +45 -0
- package/dist/collection/components/lime-query-builder/order-by/order-by-item.js +173 -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/lime-query-filter-comparison.js +1 -1
- package/dist/components/lime-query-filter-expression.js +2 -2
- package/dist/components/lime-query-value-input.js +3 -3
- package/dist/components/limebb-lime-query-builder.js +201 -215
- package/dist/components/limebb-lime-query-order-by-editor.d.ts +11 -0
- package/dist/components/limebb-lime-query-order-by-editor.js +6 -0
- package/dist/components/limebb-lime-query-order-by-item.d.ts +11 -0
- package/dist/components/limebb-lime-query-order-by-item.js +6 -0
- 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 +1 -1
- package/dist/components/live-docs-info.js +2 -2
- package/dist/components/notification-item.js +1 -1
- package/dist/components/order-by-editor.js +123 -0
- package/dist/components/order-by-item.js +73 -0
- package/dist/components/property-selector.js +1 -1
- package/dist/components/summary-popover.js +3 -3
- package/dist/esm/lime-crm-building-blocks.js +1 -1
- package/dist/esm/limebb-lime-query-builder.entry.js +179 -206
- package/dist/esm/{limebb-lime-query-filter-builder_3.entry.js → limebb-lime-query-filter-builder_4.entry.js} +86 -2
- package/dist/esm/limebb-lime-query-filter-comparison_2.entry.js +142 -0
- package/dist/esm/{limebb-lime-query-filter-comparison_5.entry.js → limebb-lime-query-filter-group_3.entry.js} +7 -333
- package/dist/esm/limebb-lime-query-order-by-item.entry.js +47 -0
- package/dist/esm/limebb-live-docs-info.entry.js +2 -2
- package/dist/esm/limebb-locale-picker.entry.js +1 -1
- 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-text-editor.entry.js +1 -1
- package/dist/esm/limebb-trend-indicator.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{property-resolution-fde2375e.js → property-resolution-c21a1369.js} +1 -1
- package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/{p-631ca5a5.entry.js → p-0cd036ed.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-2725671e.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-9cac4de2.entry.js → p-425eaba2.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-e8946134.entry.js → p-5cf4898d.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-67c174d0.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-6aa216ec.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-93cadc1e.entry.js → p-8601eab5.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-b9b954d9.entry.js → p-8c2fb1c9.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-3122ea05.entry.js → p-92dfc5f8.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-569c86b5.entry.js → p-a1ee8990.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-abfc7815.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-e0ab1554.js → p-b748c770.js} +1 -1
- package/dist/lime-crm-building-blocks/p-ccf34631.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-36ea13c0.entry.js → p-d84874dc.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-f9efca1d.entry.js +1 -0
- package/dist/types/components/lime-query-builder/expressions/lime-query-value-input.d.ts +2 -3
- package/dist/types/components/lime-query-builder/lime-query-builder.d.ts +9 -6
- package/dist/types/components/lime-query-builder/lime-query.types.d.ts +0 -72
- package/dist/types/components/lime-query-builder/order-by/order-by-editor.d.ts +58 -0
- package/dist/types/components/lime-query-builder/order-by/order-by-item.d.ts +37 -0
- package/dist/types/components.d.ts +165 -205
- package/package.json +1 -1
- package/dist/cjs/limebb-lime-query-filter-and.cjs.entry.js +0 -80
- package/dist/cjs/limebb-lime-query-filter-expression.cjs.entry.js +0 -45
- package/dist/cjs/limebb-lime-query-filter-or.cjs.entry.js +0 -68
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-and.css +0 -121
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-and.js +0 -249
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-or.css +0 -123
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-or.js +0 -237
- package/dist/collection/components/lime-query-builder/filter-conversion.js +0 -255
- package/dist/components/limebb-lime-query-filter-and.d.ts +0 -11
- package/dist/components/limebb-lime-query-filter-and.js +0 -135
- package/dist/components/limebb-lime-query-filter-or.d.ts +0 -11
- package/dist/components/limebb-lime-query-filter-or.js +0 -123
- package/dist/esm/limebb-lime-query-filter-and.entry.js +0 -76
- package/dist/esm/limebb-lime-query-filter-expression.entry.js +0 -41
- package/dist/esm/limebb-lime-query-filter-or.entry.js +0 -64
- package/dist/lime-crm-building-blocks/p-24aeb928.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-422f6d51.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-67dbaa4c.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-6d119dab.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-91732502.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-b198194a.entry.js +0 -1
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-and.d.ts +0 -57
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-or.d.ts +0 -56
- package/dist/types/components/lime-query-builder/filter-conversion.d.ts +0 -31
|
@@ -1,174 +1,16 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { T as Te } from './index.esm.js';
|
|
3
|
-
import { g as
|
|
4
|
-
import { d as defineCustomElement$
|
|
5
|
-
import { d as defineCustomElement$
|
|
6
|
-
import { d as defineCustomElement$
|
|
2
|
+
import { Z as Zt, T as Te } from './index.esm.js';
|
|
3
|
+
import { g as getPropertyFromPath, a as getNormalizedProperties, d as defineCustomElement$4 } from './property-selector.js';
|
|
4
|
+
import { d as defineCustomElement$d } from './lime-query-filter-builder.js';
|
|
5
|
+
import { d as defineCustomElement$c } from './lime-query-filter-comparison.js';
|
|
6
|
+
import { d as defineCustomElement$9, a as defineCustomElement$a, b as defineCustomElement$b } from './lime-query-filter-expression.js';
|
|
7
|
+
import { d as defineCustomElement$8 } from './order-by-editor.js';
|
|
8
|
+
import { d as defineCustomElement$7 } from './order-by-item.js';
|
|
7
9
|
import { d as defineCustomElement$6 } from './lime-query-value-input.js';
|
|
8
10
|
import { d as defineCustomElement$5 } from './limetype-field.js';
|
|
9
11
|
import { d as defineCustomElement$3 } from './response-format-editor.js';
|
|
10
12
|
import { d as defineCustomElement$2 } from './response-format-item.js';
|
|
11
13
|
|
|
12
|
-
/**
|
|
13
|
-
* TypeScript type definitions for Lime Query DSL
|
|
14
|
-
*
|
|
15
|
-
* These types represent the structure of Lime Query as defined in:
|
|
16
|
-
* - lime-core/lime_query/schema.py
|
|
17
|
-
* - lime-core/lime_filter/schema.py
|
|
18
|
-
*/
|
|
19
|
-
/**
|
|
20
|
-
* Available operators with display metadata
|
|
21
|
-
*/
|
|
22
|
-
const LIME_QUERY_OPERATORS = [
|
|
23
|
-
{ value: '=', label: 'Equals', icon: 'equals' },
|
|
24
|
-
{ value: '!=', label: 'Not Equals', icon: 'not-equal' },
|
|
25
|
-
{
|
|
26
|
-
value: '>',
|
|
27
|
-
label: 'Greater Than',
|
|
28
|
-
icon: 'greater-than',
|
|
29
|
-
applicableTypes: ['integer', 'decimal', 'date', 'time'],
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
value: '>=',
|
|
33
|
-
label: 'Greater or Equal',
|
|
34
|
-
icon: 'greater-or-equal',
|
|
35
|
-
applicableTypes: ['integer', 'decimal', 'date', 'time'],
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
value: '<',
|
|
39
|
-
label: 'Less Than',
|
|
40
|
-
icon: 'less-than',
|
|
41
|
-
applicableTypes: ['integer', 'decimal', 'date', 'time'],
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
value: '<=',
|
|
45
|
-
label: 'Less or Equal',
|
|
46
|
-
icon: 'less-or-equal',
|
|
47
|
-
applicableTypes: ['integer', 'decimal', 'date', 'time'],
|
|
48
|
-
},
|
|
49
|
-
{ value: 'IN', label: 'In List', icon: 'list' },
|
|
50
|
-
{
|
|
51
|
-
value: '?',
|
|
52
|
-
label: 'Contains',
|
|
53
|
-
icon: '-lime-filter-contain',
|
|
54
|
-
applicableTypes: ['string', 'text'],
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
value: '=?',
|
|
58
|
-
label: 'Begins With',
|
|
59
|
-
icon: '-lime-filter-begin',
|
|
60
|
-
applicableTypes: ['string', 'text'],
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
value: '=$',
|
|
64
|
-
label: 'Ends With',
|
|
65
|
-
icon: '-lime-filter-end',
|
|
66
|
-
applicableTypes: ['string', 'text'],
|
|
67
|
-
},
|
|
68
|
-
];
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Validate and convert a FilterExpression (comparison filter)
|
|
72
|
-
* @param filter
|
|
73
|
-
*/
|
|
74
|
-
function validateAndConvertFilterExpression(filter) {
|
|
75
|
-
// Validate required properties exist
|
|
76
|
-
if (!('op' in filter) || !('exp' in filter)) {
|
|
77
|
-
throw new Error('Invalid filter: comparison must have key, op, and exp properties');
|
|
78
|
-
}
|
|
79
|
-
// Validate operator is supported
|
|
80
|
-
const supportedOps = LIME_QUERY_OPERATORS.map((o) => o.value);
|
|
81
|
-
if (!supportedOps.includes(filter.op)) {
|
|
82
|
-
throw new Error(`Unsupported filter operator: ${filter.op}`);
|
|
83
|
-
}
|
|
84
|
-
// Check for unexpected properties
|
|
85
|
-
// Note: 'type' property is allowed for filter references
|
|
86
|
-
const knownProps = new Set(['key', 'op', 'exp', 'type']);
|
|
87
|
-
const unexpectedProps = Object.keys(filter).filter((k) => !knownProps.has(k));
|
|
88
|
-
if (unexpectedProps.length > 0) {
|
|
89
|
-
throw new Error(`Unexpected properties in filter comparison: ${unexpectedProps.join(', ')}`);
|
|
90
|
-
}
|
|
91
|
-
return {
|
|
92
|
-
filter_type: 'comparison',
|
|
93
|
-
property: filter.key,
|
|
94
|
-
operator: filter.op,
|
|
95
|
-
value: filter.exp,
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Validate and convert a FilterGroup (AND/OR/NOT filter)
|
|
100
|
-
* @param filter
|
|
101
|
-
*/
|
|
102
|
-
function validateAndConvertFilterGroup(filter) {
|
|
103
|
-
// Validate it has 'op' property
|
|
104
|
-
if (!('op' in filter)) {
|
|
105
|
-
throw new Error('Invalid filter: filter group must have op property');
|
|
106
|
-
}
|
|
107
|
-
// Validate it has 'exp' property
|
|
108
|
-
if (!('exp' in filter)) {
|
|
109
|
-
throw new Error('Invalid filter: filter group must have exp property');
|
|
110
|
-
}
|
|
111
|
-
// Check for unexpected properties in filter groups
|
|
112
|
-
const knownGroupProps = new Set(['op', 'exp']);
|
|
113
|
-
const unexpectedGroupProps = Object.keys(filter).filter((k) => !knownGroupProps.has(k));
|
|
114
|
-
if (unexpectedGroupProps.length > 0) {
|
|
115
|
-
throw new Error(`Unexpected properties in filter group: ${unexpectedGroupProps.join(', ')}`);
|
|
116
|
-
}
|
|
117
|
-
if (filter.op === '!') {
|
|
118
|
-
// NOT filter: exp should be a single expression (not array)
|
|
119
|
-
if (Array.isArray(filter.exp)) {
|
|
120
|
-
throw new TypeError('Invalid NOT filter: exp should be a single expression, not an array');
|
|
121
|
-
}
|
|
122
|
-
return {
|
|
123
|
-
filter_type: 'NOT',
|
|
124
|
-
expression: limeQueryToGuiFilter(filter.exp),
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
if (filter.op === 'AND') {
|
|
128
|
-
// AND filter: exp should be an array
|
|
129
|
-
if (!Array.isArray(filter.exp)) {
|
|
130
|
-
throw new TypeError('Invalid AND filter: exp must be an array');
|
|
131
|
-
}
|
|
132
|
-
return {
|
|
133
|
-
filter_type: 'AND',
|
|
134
|
-
expressions: filter.exp.map(limeQueryToGuiFilter),
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
if (filter.op === 'OR') {
|
|
138
|
-
// OR filter: exp should be an array
|
|
139
|
-
if (!Array.isArray(filter.exp)) {
|
|
140
|
-
throw new TypeError('Invalid OR filter: exp must be an array');
|
|
141
|
-
}
|
|
142
|
-
return {
|
|
143
|
-
filter_type: 'OR',
|
|
144
|
-
expressions: filter.exp.map(limeQueryToGuiFilter),
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
// If we reach here, the operator is unsupported
|
|
148
|
-
throw new Error(`Unsupported filter operator: ${filter.op}`);
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Convert Lime Query filter to UI filter representation
|
|
152
|
-
* Throws errors for unsupported filter structures
|
|
153
|
-
* @param filter
|
|
154
|
-
*/
|
|
155
|
-
function limeQueryToGuiFilter(filter) {
|
|
156
|
-
if (!filter) {
|
|
157
|
-
// Return empty AND instead of missing expression
|
|
158
|
-
// This ensures users see the "Add a condition" button
|
|
159
|
-
return {
|
|
160
|
-
filter_type: 'AND',
|
|
161
|
-
expressions: [],
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
// Check if it's a FilterExpression (has 'key' property)
|
|
165
|
-
if ('key' in filter) {
|
|
166
|
-
return validateAndConvertFilterExpression(filter);
|
|
167
|
-
}
|
|
168
|
-
// It's a FilterGroup
|
|
169
|
-
return validateAndConvertFilterGroup(filter);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
14
|
/**
|
|
173
15
|
* Dynamic filter values and placeholders that are valid in Lime Query
|
|
174
16
|
*/
|
|
@@ -416,6 +258,49 @@ function validatePropertySelection(selection, limetypes, limetype, guiModeEnable
|
|
|
416
258
|
}
|
|
417
259
|
return allGuiLimitations;
|
|
418
260
|
}
|
|
261
|
+
/**
|
|
262
|
+
* Validate a comparison expression (has 'key' property)
|
|
263
|
+
* @param filter
|
|
264
|
+
* @param activeLimetype
|
|
265
|
+
* @param limetypes
|
|
266
|
+
*/
|
|
267
|
+
function validateComparisonExpression(filter, activeLimetype, limetypes) {
|
|
268
|
+
// Validate operator
|
|
269
|
+
const allValidOperators = Object.values(Zt);
|
|
270
|
+
if (!allValidOperators.includes(filter.op)) {
|
|
271
|
+
throw new Error(`Unsupported filter operator: ${filter.op}`);
|
|
272
|
+
}
|
|
273
|
+
// Validate placeholder
|
|
274
|
+
const result = validatePlaceholder(filter.exp, activeLimetype, limetypes);
|
|
275
|
+
if (!result.valid) {
|
|
276
|
+
throw new Error(`Invalid placeholder in filter '${filter.key}': ${result.error}`);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Validate a group expression (AND/OR/NOT)
|
|
281
|
+
* @param filter
|
|
282
|
+
* @param activeLimetype
|
|
283
|
+
* @param limetypes
|
|
284
|
+
* @param guiModeEnabled
|
|
285
|
+
*/
|
|
286
|
+
function validateGroupExpression(filter, activeLimetype, limetypes, guiModeEnabled) {
|
|
287
|
+
// Validate operator
|
|
288
|
+
if (filter.op !== Zt.AND &&
|
|
289
|
+
filter.op !== Zt.OR &&
|
|
290
|
+
filter.op !== Zt.NOT) {
|
|
291
|
+
throw new Error(`Unsupported group operator: ${filter.op}`);
|
|
292
|
+
}
|
|
293
|
+
// Recursively validate children
|
|
294
|
+
if (filter.op === Zt.NOT) {
|
|
295
|
+
validateFilterPlaceholders(filter.exp, activeLimetype, limetypes, guiModeEnabled);
|
|
296
|
+
}
|
|
297
|
+
else if (filter.op === Zt.AND || filter.op === Zt.OR) {
|
|
298
|
+
const expressions = filter.exp;
|
|
299
|
+
for (const expr of expressions) {
|
|
300
|
+
validateFilterPlaceholders(expr, activeLimetype, limetypes, guiModeEnabled);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
419
304
|
/**
|
|
420
305
|
* Validate placeholders in a filter expression
|
|
421
306
|
* @param filter Filter expression to validate
|
|
@@ -427,27 +312,12 @@ function validateFilterPlaceholders(filter, activeLimetype, limetypes, guiModeEn
|
|
|
427
312
|
if (!filter) {
|
|
428
313
|
return;
|
|
429
314
|
}
|
|
430
|
-
// Check if it's a FilterExpression (has 'key' property)
|
|
431
315
|
if ('key' in filter) {
|
|
432
|
-
|
|
433
|
-
if (!result.valid) {
|
|
434
|
-
throw new Error(`Invalid placeholder in filter '${filter.key}': ${result.error}`);
|
|
435
|
-
}
|
|
316
|
+
validateComparisonExpression(filter, activeLimetype, limetypes);
|
|
436
317
|
return;
|
|
437
318
|
}
|
|
438
|
-
// It's a FilterGroup - recursively validate children
|
|
439
319
|
if ('exp' in filter) {
|
|
440
|
-
|
|
441
|
-
// NOT has a single expression
|
|
442
|
-
validateFilterPlaceholders(filter.exp, activeLimetype, limetypes, guiModeEnabled);
|
|
443
|
-
}
|
|
444
|
-
else if (filter.op === 'AND' || filter.op === 'OR') {
|
|
445
|
-
// AND/OR have array of expressions
|
|
446
|
-
const expressions = filter.exp;
|
|
447
|
-
for (const expr of expressions) {
|
|
448
|
-
validateFilterPlaceholders(expr, activeLimetype, limetypes, guiModeEnabled);
|
|
449
|
-
}
|
|
450
|
-
}
|
|
320
|
+
validateGroupExpression(filter, activeLimetype, limetypes, guiModeEnabled);
|
|
451
321
|
}
|
|
452
322
|
}
|
|
453
323
|
/**
|
|
@@ -461,7 +331,6 @@ function validateFilterPlaceholders(filter, activeLimetype, limetypes, guiModeEn
|
|
|
461
331
|
function validateLimeQueryFilterInternal(filter, activeLimetype, limetypes, guiModeEnabled) {
|
|
462
332
|
const errors = [];
|
|
463
333
|
try {
|
|
464
|
-
limeQueryToGuiFilter(filter);
|
|
465
334
|
validateFilterPlaceholders(filter, activeLimetype, limetypes, guiModeEnabled);
|
|
466
335
|
}
|
|
467
336
|
catch (error) {
|
|
@@ -469,6 +338,113 @@ function validateLimeQueryFilterInternal(filter, activeLimetype, limetypes, guiM
|
|
|
469
338
|
}
|
|
470
339
|
return errors;
|
|
471
340
|
}
|
|
341
|
+
/**
|
|
342
|
+
* Validate orderBy specification
|
|
343
|
+
* @param orderBy Array of orderBy items to validate
|
|
344
|
+
* @param limetypes Record of all available limetypes
|
|
345
|
+
* @param limetype The limetype for this Lime Query
|
|
346
|
+
* @returns Array of validation error messages
|
|
347
|
+
*/
|
|
348
|
+
function validateOrderBy(orderBy, limetypes, limetype) {
|
|
349
|
+
const errors = [];
|
|
350
|
+
if (!Array.isArray(orderBy)) {
|
|
351
|
+
errors.push('orderBy must be an array');
|
|
352
|
+
return errors;
|
|
353
|
+
}
|
|
354
|
+
if (!limetype || !limetypes[limetype]) {
|
|
355
|
+
// Can't validate property paths without limetype
|
|
356
|
+
return errors;
|
|
357
|
+
}
|
|
358
|
+
for (const [index, item] of orderBy.entries()) {
|
|
359
|
+
const itemErrors = validateOrderByItem(item, index, limetypes, limetype);
|
|
360
|
+
errors.push(...itemErrors);
|
|
361
|
+
}
|
|
362
|
+
return errors;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Validate a single orderBy item
|
|
366
|
+
* @param item The orderBy item to validate
|
|
367
|
+
* @param index The index of the item in the array (for error messages)
|
|
368
|
+
* @param limetypes Record of all available limetypes
|
|
369
|
+
* @param limetype The limetype for this Lime Query
|
|
370
|
+
* @returns Array of validation error messages for this item
|
|
371
|
+
*/
|
|
372
|
+
function validateOrderByItem(item, index, limetypes, limetype) {
|
|
373
|
+
const errors = [];
|
|
374
|
+
const objectError = validateOrderByItemIsObject(item, index);
|
|
375
|
+
if (objectError) {
|
|
376
|
+
return [objectError];
|
|
377
|
+
}
|
|
378
|
+
const keys = Object.keys(item);
|
|
379
|
+
const keyError = validateOrderByItemHasSingleKey(keys, index);
|
|
380
|
+
if (keyError) {
|
|
381
|
+
return [keyError];
|
|
382
|
+
}
|
|
383
|
+
const propertyPath = keys[0];
|
|
384
|
+
const direction = item[propertyPath];
|
|
385
|
+
const directionError = validateOrderByDirection(direction, index);
|
|
386
|
+
if (directionError) {
|
|
387
|
+
errors.push(directionError);
|
|
388
|
+
}
|
|
389
|
+
const pathError = validateOrderByPropertyPath(propertyPath, limetypes, limetype, index);
|
|
390
|
+
if (pathError) {
|
|
391
|
+
errors.push(pathError);
|
|
392
|
+
}
|
|
393
|
+
return errors;
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Validate that the orderBy item is an object
|
|
397
|
+
* @param item
|
|
398
|
+
* @param index
|
|
399
|
+
*/
|
|
400
|
+
function validateOrderByItemIsObject(item, index) {
|
|
401
|
+
if (typeof item !== 'object' || item === null) {
|
|
402
|
+
return `orderBy[${index}] must be an object`;
|
|
403
|
+
}
|
|
404
|
+
return null;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Validate that the orderBy item has exactly one property key
|
|
408
|
+
* @param keys
|
|
409
|
+
* @param index
|
|
410
|
+
*/
|
|
411
|
+
function validateOrderByItemHasSingleKey(keys, index) {
|
|
412
|
+
if (keys.length === 0) {
|
|
413
|
+
return `orderBy[${index}] must have a property path`;
|
|
414
|
+
}
|
|
415
|
+
if (keys.length > 1) {
|
|
416
|
+
return `orderBy[${index}] must have exactly one property, got ${keys.length}`;
|
|
417
|
+
}
|
|
418
|
+
return null;
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Validate that the sort direction is either ASC or DESC
|
|
422
|
+
* @param direction
|
|
423
|
+
* @param index
|
|
424
|
+
*/
|
|
425
|
+
function validateOrderByDirection(direction, index) {
|
|
426
|
+
if (direction !== 'ASC' && direction !== 'DESC') {
|
|
427
|
+
return `orderBy[${index}]: direction must be 'ASC' or 'DESC', got '${direction}'`;
|
|
428
|
+
}
|
|
429
|
+
return null;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Validate that the property path exists on the limetype
|
|
433
|
+
* @param propertyPath
|
|
434
|
+
* @param limetypes
|
|
435
|
+
* @param limetype
|
|
436
|
+
* @param index
|
|
437
|
+
*/
|
|
438
|
+
function validateOrderByPropertyPath(propertyPath, limetypes, limetype, index) {
|
|
439
|
+
if (!propertyPath || propertyPath === '') {
|
|
440
|
+
return null;
|
|
441
|
+
}
|
|
442
|
+
const property = getPropertyFromPath(limetypes, limetype, propertyPath);
|
|
443
|
+
if (!property) {
|
|
444
|
+
return `orderBy[${index}]: property path '${propertyPath}' does not exist on limetype '${limetype}'`;
|
|
445
|
+
}
|
|
446
|
+
return null;
|
|
447
|
+
}
|
|
472
448
|
/**
|
|
473
449
|
* Validate Lime Query response format and collect errors/limitations
|
|
474
450
|
* @param responseFormat The response format to validate
|
|
@@ -518,14 +494,14 @@ function isLimeQuerySupported(limeQuery, limetypes, activeLimetype, guiModeEnabl
|
|
|
518
494
|
if (limeQuery.offset !== undefined && !limeQuery.orderBy) {
|
|
519
495
|
validationErrors.push('offset requires orderBy to be specified');
|
|
520
496
|
}
|
|
497
|
+
// Validate orderBy
|
|
498
|
+
if (limeQuery.orderBy) {
|
|
499
|
+
const orderByErrors = validateOrderBy(limeQuery.orderBy, limetypes, limeQuery.limetype);
|
|
500
|
+
validationErrors.push(...orderByErrors);
|
|
501
|
+
}
|
|
521
502
|
// Check for GUI-unsupported top-level properties
|
|
522
|
-
if (guiModeEnabled) {
|
|
523
|
-
|
|
524
|
-
guiLimitations.push('orderBy is not yet supported in GUI mode');
|
|
525
|
-
}
|
|
526
|
-
if (limeQuery.offset !== undefined) {
|
|
527
|
-
guiLimitations.push('offset is not yet supported in GUI mode');
|
|
528
|
-
}
|
|
503
|
+
if (guiModeEnabled && limeQuery.offset !== undefined) {
|
|
504
|
+
guiLimitations.push('offset is not yet supported in GUI mode');
|
|
529
505
|
}
|
|
530
506
|
// Validate filter
|
|
531
507
|
if (limeQuery.filter) {
|
|
@@ -546,7 +522,7 @@ function isLimeQuerySupported(limeQuery, limetypes, activeLimetype, guiModeEnabl
|
|
|
546
522
|
};
|
|
547
523
|
}
|
|
548
524
|
|
|
549
|
-
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:
|
|
525
|
+
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:flex;flex-direction:column;gap:1rem}@media (max-width: 768px){.lime-query-builder{gap:1.5rem}}";
|
|
550
526
|
const LimebbLimeQueryBuilderStyle0 = limeQueryBuilderCss;
|
|
551
527
|
|
|
552
528
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -598,6 +574,11 @@ const LimeQueryBuilder = /*@__PURE__*/ proxyCustomElement(class LimeQueryBuilder
|
|
|
598
574
|
this.limit = value ? Number.parseInt(value, 10) : undefined;
|
|
599
575
|
this.emitChange();
|
|
600
576
|
};
|
|
577
|
+
this.handleOrderByChange = (event) => {
|
|
578
|
+
event.stopPropagation();
|
|
579
|
+
this.orderBy = event.detail;
|
|
580
|
+
this.emitChange();
|
|
581
|
+
};
|
|
601
582
|
this.switchToGui = () => {
|
|
602
583
|
// Validate JSON before switching
|
|
603
584
|
try {
|
|
@@ -613,6 +594,7 @@ const LimeQueryBuilder = /*@__PURE__*/ proxyCustomElement(class LimeQueryBuilder
|
|
|
613
594
|
this.filter = parsed.filter;
|
|
614
595
|
this.internalResponseFormat = parsed.responseFormat;
|
|
615
596
|
this.limit = parsed.limit;
|
|
597
|
+
this.orderBy = parsed.orderBy;
|
|
616
598
|
this.mode = 'gui';
|
|
617
599
|
this.change.emit(parsed);
|
|
618
600
|
}
|
|
@@ -654,6 +636,7 @@ const LimeQueryBuilder = /*@__PURE__*/ proxyCustomElement(class LimeQueryBuilder
|
|
|
654
636
|
this.filter = this.value.filter;
|
|
655
637
|
this.internalResponseFormat = this.value.responseFormat;
|
|
656
638
|
this.limit = this.value.limit;
|
|
639
|
+
this.orderBy = this.value.orderBy;
|
|
657
640
|
}
|
|
658
641
|
// Initialize code value from prop
|
|
659
642
|
this.updateCodeValue();
|
|
@@ -666,7 +649,7 @@ const LimeQueryBuilder = /*@__PURE__*/ proxyCustomElement(class LimeQueryBuilder
|
|
|
666
649
|
render() {
|
|
667
650
|
const guiSupported = this.checkGuiSupport();
|
|
668
651
|
const showCodeMode = !this.guiModeEnabled || this.mode === 'code';
|
|
669
|
-
return (h("div", { key: '
|
|
652
|
+
return (h("div", { key: 'f51ae0459c1c7f482f3a790abb4cc3bd60b83e70', class: "lime-query-builder" }, this.renderLabel(), this.renderModeControls(guiSupported), showCodeMode
|
|
670
653
|
? this.renderCodeMode(guiSupported)
|
|
671
654
|
: this.renderGuiMode()));
|
|
672
655
|
}
|
|
@@ -678,27 +661,16 @@ const LimeQueryBuilder = /*@__PURE__*/ proxyCustomElement(class LimeQueryBuilder
|
|
|
678
661
|
if (!this.limetype) {
|
|
679
662
|
return;
|
|
680
663
|
}
|
|
681
|
-
|
|
682
|
-
const responseFormat = this.internalResponseFormat || {
|
|
683
|
-
object: {
|
|
684
|
-
_id: null,
|
|
685
|
-
},
|
|
686
|
-
};
|
|
687
|
-
const limeQuery = {
|
|
688
|
-
limetype: this.limetype,
|
|
689
|
-
responseFormat: responseFormat,
|
|
690
|
-
filter: this.filter,
|
|
691
|
-
};
|
|
692
|
-
if (this.limit !== undefined && this.limit > 0) {
|
|
693
|
-
limeQuery.limit = this.limit;
|
|
694
|
-
}
|
|
695
|
-
this.change.emit(limeQuery);
|
|
664
|
+
this.change.emit(this.buildLimeQuery());
|
|
696
665
|
}
|
|
697
666
|
updateCodeValue() {
|
|
698
667
|
if (!this.limetype) {
|
|
699
668
|
this.codeValue = JSON.stringify(this.value || {}, null, 2);
|
|
700
669
|
return;
|
|
701
670
|
}
|
|
671
|
+
this.codeValue = JSON.stringify(this.buildLimeQuery(), null, 2);
|
|
672
|
+
}
|
|
673
|
+
buildLimeQuery() {
|
|
702
674
|
// Use internal state, then default to returning just _id
|
|
703
675
|
const responseFormat = this.internalResponseFormat || {
|
|
704
676
|
object: {
|
|
@@ -713,7 +685,10 @@ const LimeQueryBuilder = /*@__PURE__*/ proxyCustomElement(class LimeQueryBuilder
|
|
|
713
685
|
if (this.limit !== undefined && this.limit > 0) {
|
|
714
686
|
limeQuery.limit = this.limit;
|
|
715
687
|
}
|
|
716
|
-
this.
|
|
688
|
+
if (this.orderBy && this.orderBy.length > 0) {
|
|
689
|
+
limeQuery.orderBy = this.orderBy;
|
|
690
|
+
}
|
|
691
|
+
return limeQuery;
|
|
717
692
|
}
|
|
718
693
|
checkGuiSupport() {
|
|
719
694
|
if (!this.limetypes) {
|
|
@@ -798,7 +773,7 @@ const LimeQueryBuilder = /*@__PURE__*/ proxyCustomElement(class LimeQueryBuilder
|
|
|
798
773
|
if (!this.limetype) {
|
|
799
774
|
return;
|
|
800
775
|
}
|
|
801
|
-
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 }))));
|
|
776
|
+
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 }), h("limebb-lime-query-order-by-editor", { platform: this.platform, context: this.context, limetype: this.limetype, value: this.orderBy, onChange: this.handleOrderByChange }))));
|
|
802
777
|
}
|
|
803
778
|
renderGuiMode() {
|
|
804
779
|
return (h("div", { class: "gui-mode" }, this.renderLimetypeSection(), this.renderResponseFormatSection(), this.renderFilterSection(), this.renderQueryOptionsSection()));
|
|
@@ -831,7 +806,8 @@ const LimeQueryBuilder = /*@__PURE__*/ proxyCustomElement(class LimeQueryBuilder
|
|
|
831
806
|
"limetype": [32],
|
|
832
807
|
"filter": [32],
|
|
833
808
|
"internalResponseFormat": [32],
|
|
834
|
-
"limit": [32]
|
|
809
|
+
"limit": [32],
|
|
810
|
+
"orderBy": [32]
|
|
835
811
|
}]);
|
|
836
812
|
__decorate([
|
|
837
813
|
Te()
|
|
@@ -840,7 +816,7 @@ function defineCustomElement$1() {
|
|
|
840
816
|
if (typeof customElements === "undefined") {
|
|
841
817
|
return;
|
|
842
818
|
}
|
|
843
|
-
const components = ["limebb-lime-query-builder", "limebb-lime-query-filter-builder", "limebb-lime-query-filter-comparison", "limebb-lime-query-filter-expression", "limebb-lime-query-filter-group", "limebb-lime-query-filter-not", "limebb-lime-query-value-input", "limebb-limetype-field", "limebb-property-selector", "limebb-response-format-editor", "limebb-response-format-item"];
|
|
819
|
+
const components = ["limebb-lime-query-builder", "limebb-lime-query-filter-builder", "limebb-lime-query-filter-comparison", "limebb-lime-query-filter-expression", "limebb-lime-query-filter-group", "limebb-lime-query-filter-not", "limebb-lime-query-order-by-editor", "limebb-lime-query-order-by-item", "limebb-lime-query-value-input", "limebb-limetype-field", "limebb-property-selector", "limebb-response-format-editor", "limebb-response-format-item"];
|
|
844
820
|
components.forEach(tagName => { switch (tagName) {
|
|
845
821
|
case "limebb-lime-query-builder":
|
|
846
822
|
if (!customElements.get(tagName)) {
|
|
@@ -849,25 +825,35 @@ function defineCustomElement$1() {
|
|
|
849
825
|
break;
|
|
850
826
|
case "limebb-lime-query-filter-builder":
|
|
851
827
|
if (!customElements.get(tagName)) {
|
|
852
|
-
defineCustomElement$
|
|
828
|
+
defineCustomElement$d();
|
|
853
829
|
}
|
|
854
830
|
break;
|
|
855
831
|
case "limebb-lime-query-filter-comparison":
|
|
856
832
|
if (!customElements.get(tagName)) {
|
|
857
|
-
defineCustomElement$
|
|
833
|
+
defineCustomElement$c();
|
|
858
834
|
}
|
|
859
835
|
break;
|
|
860
836
|
case "limebb-lime-query-filter-expression":
|
|
861
837
|
if (!customElements.get(tagName)) {
|
|
862
|
-
defineCustomElement$
|
|
838
|
+
defineCustomElement$b();
|
|
863
839
|
}
|
|
864
840
|
break;
|
|
865
841
|
case "limebb-lime-query-filter-group":
|
|
866
842
|
if (!customElements.get(tagName)) {
|
|
867
|
-
defineCustomElement$
|
|
843
|
+
defineCustomElement$a();
|
|
868
844
|
}
|
|
869
845
|
break;
|
|
870
846
|
case "limebb-lime-query-filter-not":
|
|
847
|
+
if (!customElements.get(tagName)) {
|
|
848
|
+
defineCustomElement$9();
|
|
849
|
+
}
|
|
850
|
+
break;
|
|
851
|
+
case "limebb-lime-query-order-by-editor":
|
|
852
|
+
if (!customElements.get(tagName)) {
|
|
853
|
+
defineCustomElement$8();
|
|
854
|
+
}
|
|
855
|
+
break;
|
|
856
|
+
case "limebb-lime-query-order-by-item":
|
|
871
857
|
if (!customElements.get(tagName)) {
|
|
872
858
|
defineCustomElement$7();
|
|
873
859
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface LimebbLimeQueryOrderByEditor extends Components.LimebbLimeQueryOrderByEditor, HTMLElement {}
|
|
4
|
+
export const LimebbLimeQueryOrderByEditor: {
|
|
5
|
+
prototype: LimebbLimeQueryOrderByEditor;
|
|
6
|
+
new (): LimebbLimeQueryOrderByEditor;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface LimebbLimeQueryOrderByItem extends Components.LimebbLimeQueryOrderByItem, HTMLElement {}
|
|
4
|
+
export const LimebbLimeQueryOrderByItem: {
|
|
5
|
+
prototype: LimebbLimeQueryOrderByItem;
|
|
6
|
+
new (): LimebbLimeQueryOrderByItem;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -1131,7 +1131,7 @@ const LocalePicker = /*@__PURE__*/ proxyCustomElement(class LocalePicker extends
|
|
|
1131
1131
|
const value = this.value;
|
|
1132
1132
|
selectedOptions = options.find((option) => option.value === value);
|
|
1133
1133
|
}
|
|
1134
|
-
return (h("limel-select", { key: '
|
|
1134
|
+
return (h("limel-select", { key: 'f0be5c869ed7ad1a32e2c0604584f26cc5a40522', value: selectedOptions, options: sortBy$1(options, 'text'), helperText: this.helperText, label: this.label, required: this.required, disabled: this.disabled, readonly: this.readonly, onChange: this.handleChange, multiple: this.multipleChoice }));
|
|
1135
1135
|
}
|
|
1136
1136
|
}, [1, "limebb-locale-picker", {
|
|
1137
1137
|
"platform": [16],
|
|
@@ -13,8 +13,8 @@ const MentionGroupCounter = /*@__PURE__*/ proxyCustomElement(class MentionGroupC
|
|
|
13
13
|
render() {
|
|
14
14
|
const label = this.getLabel();
|
|
15
15
|
return [
|
|
16
|
-
h("span", { key: '
|
|
17
|
-
h("limel-tooltip", { key: '
|
|
16
|
+
h("span", { key: 'bb868b62f71fe65927d1cd9bad6ee08648a33c73', id: this.tooltipId }, label),
|
|
17
|
+
h("limel-tooltip", { key: '5018e97cb9d5522b91ed1c55643ad33c3d7fd51d', elementId: this.tooltipId, label: label, helperLabel: this.helperLabel }),
|
|
18
18
|
];
|
|
19
19
|
}
|
|
20
20
|
getLabel() {
|
|
@@ -76,11 +76,11 @@ const PercentageVisualizer = /*@__PURE__*/ proxyCustomElement(class PercentageVi
|
|
|
76
76
|
render() {
|
|
77
77
|
const normalizedValue = this.getNormalizedValue();
|
|
78
78
|
const zeroPoint = this.getZeroPointPosition();
|
|
79
|
-
return (h(Host, { key: '
|
|
79
|
+
return (h(Host, { key: '728bef6c27bd5879d971411f812db124c3ac53b3', class: this.getContainerClassList(), style: {
|
|
80
80
|
'--limebb-percentage-visualizer-zero-point-position': `${zeroPoint}%`,
|
|
81
81
|
'--limebb-percentage-visualizer-width': `${Math.abs(normalizedValue)}%`,
|
|
82
82
|
'--limebb-percentage-visualizer-rotate': `${normalizedValue >= 0 ? '0deg' : '180deg'}`,
|
|
83
|
-
} }, h("limel-notched-outline", { key: '
|
|
83
|
+
} }, h("limel-notched-outline", { key: '0cf575a7e896955572000dd906d98441dec808b1', tabIndex: 0, role: "meter", "aria-valuemin": this.rangeMin, "aria-valuemax": this.rangeMax, "aria-valuenow": this.numValue, "aria-labelledby": this.labelId, "aria-describedby": this.helperTextId, label: this.label, labelId: this.labelId, invalid: this.invalid, required: this.required, hasValue: true, hasFloatingLabel: true, "aria-controls": this.helperTextId }, h("div", { key: '6dc2beefea4d1a5b0a967fd1087db3fe88c8cdf5', slot: "content" }, this.renderVisualization())), this.renderHelperLine()));
|
|
84
84
|
}
|
|
85
85
|
renderVisualization() {
|
|
86
86
|
if (this.reducePresence && (this.numValue === 0 || !this.hasValue())) {
|
|
@@ -1774,7 +1774,7 @@ const LimeBBTextEditor = /*@__PURE__*/ proxyCustomElement(class LimeBBTextEditor
|
|
|
1774
1774
|
}
|
|
1775
1775
|
render() {
|
|
1776
1776
|
return [
|
|
1777
|
-
h("limel-text-editor", { key: '
|
|
1777
|
+
h("limel-text-editor", { key: '3ad4c2bac61f34439bf94b42e0aa7ccceeff9c33', ref: (el) => (this.textEditor = el), tabindex: this.disabled ? -1 : 0, value: this.value, contentType: this.contentType, customElements: this.registeredCustomElements, "aria-disabled": this.disabled, language: this.language, triggers: this.registeredTriggers, onTriggerStart: this.handleTriggerStart, onTriggerStop: this.handleTriggerStop, onTriggerChange: this.handleTriggerChange, onImagePasted: this.handleImagePasted, onMetadataChange: this.handleMetadataChange, ui: this.ui, allowResize: this.allowResize, required: this.required, disabled: this.disabled, readonly: this.readonly, helperText: this.helperText, placeholder: this.placeholder, label: this.label, invalid: this.invalid }),
|
|
1778
1778
|
this.renderPicker(),
|
|
1779
1779
|
];
|
|
1780
1780
|
}
|
|
@@ -37,7 +37,7 @@ const TrendIndicator = /*@__PURE__*/ proxyCustomElement(class TrendIndicator ext
|
|
|
37
37
|
this.numValue = this.parseValue(this.value);
|
|
38
38
|
}
|
|
39
39
|
render() {
|
|
40
|
-
return (h(Host, { key: '
|
|
40
|
+
return (h(Host, { key: '976bce0393bfff47ba599dc0d534ec9992cec3f8', class: this.getContainerClassList() }, h("limel-notched-outline", { key: '86a89b3773d2fbf3aa9009fd27ce9cb2410f03b5', id: this.tooltipId, label: this.label, labelId: this.labelId, invalid: this.invalid, required: this.required, hasValue: true, hasFloatingLabel: true, "aria-labelledby": this.labelId, "aria-describedby": this.helperTextId, "aria-controls": this.helperTextId }, h("div", { key: '0b9e048eeea62c452671b74db468aa5587e8ddbf', slot: "content", tabIndex: 0 }, this.renderVisualization())), this.renderHelperLine(), this.renderTooltip()));
|
|
41
41
|
}
|
|
42
42
|
renderVisualization() {
|
|
43
43
|
if (this.reducePresence && (this.numValue === 0 || !this.hasValue())) {
|