@limetech/lime-crm-building-blocks 1.103.0 → 1.103.2
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 +20 -0
- package/dist/cjs/lime-crm-building-blocks.cjs.js +1 -1
- package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +21 -15
- package/dist/cjs/limebb-lime-query-filter-builder_3.cjs.entry.js +4 -1
- package/dist/cjs/limebb-lime-query-filter-group_3.cjs.entry.js +42 -70
- package/dist/cjs/limebb-lime-query-response-format-builder.cjs.entry.js +3 -1
- package/dist/cjs/limebb-lime-query-response-format-editor_2.cjs.entry.js +51 -12
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/lime-query-builder/expressions/filter-group-logic.js +2 -32
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-builder.js +4 -1
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.css +0 -7
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.js +45 -38
- package/dist/collection/components/lime-query-builder/lime-query-builder.css +26 -36
- package/dist/collection/components/lime-query-builder/lime-query-builder.js +21 -15
- package/dist/collection/components/lime-query-builder/response-format/response-format-editor.css +13 -18
- package/dist/collection/components/lime-query-builder/response-format/response-format-editor.js +51 -12
- package/dist/collection/components/lime-query-builder/response-format/response-format-helpers.js +6 -2
- package/dist/components/lime-query-filter-builder.js +4 -1
- package/dist/components/lime-query-filter-expression.js +44 -71
- package/dist/components/limebb-lime-query-builder.js +22 -16
- package/dist/components/limebb-lime-query-response-format-builder.js +3 -1
- package/dist/components/response-format-editor.js +51 -12
- package/dist/esm/lime-crm-building-blocks.js +1 -1
- package/dist/esm/limebb-lime-query-builder.entry.js +22 -16
- package/dist/esm/limebb-lime-query-filter-builder_3.entry.js +4 -1
- package/dist/esm/limebb-lime-query-filter-group_3.entry.js +42 -70
- package/dist/esm/limebb-lime-query-response-format-builder.entry.js +3 -1
- package/dist/esm/limebb-lime-query-response-format-editor_2.entry.js +51 -12
- 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-81dbda15.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-91074d93.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-d18697e3.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-d724b3c6.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-f92ca0b8.entry.js +1 -0
- package/dist/types/components/lime-query-builder/expressions/filter-group-logic.d.ts +0 -16
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-group.d.ts +5 -5
- package/dist/types/components/lime-query-builder/lime-query-builder.d.ts +2 -1
- package/dist/types/components/lime-query-builder/response-format/response-format-editor.d.ts +1 -0
- package/package.json +1 -1
- package/dist/lime-crm-building-blocks/p-1f76540e.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-2d5f83bc.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-3384f1ee.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-8917c472.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-9167bc6c.entry.js +0 -1
|
@@ -16,38 +16,8 @@ function getFilterGroupSubheading(operator, expressionCount) {
|
|
|
16
16
|
return '';
|
|
17
17
|
}
|
|
18
18
|
return operator === Zt.AND
|
|
19
|
-
? 'All of these conditions are
|
|
20
|
-
: 'Any of these conditions are
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Get the label for the "Add condition" button
|
|
24
|
-
*
|
|
25
|
-
* @param operator - The group's operator (AND or OR)
|
|
26
|
-
* @param expressionCount - Number of child expressions
|
|
27
|
-
* @returns Appropriate button label based on context
|
|
28
|
-
*/
|
|
29
|
-
function getAddConditionButtonLabel(operator, expressionCount) {
|
|
30
|
-
if (expressionCount === 0) {
|
|
31
|
-
return 'Add a condition';
|
|
32
|
-
}
|
|
33
|
-
return operator === Zt.AND
|
|
34
|
-
? 'Add another condition'
|
|
35
|
-
: 'Add alternative';
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Get the label for the "Add group" button
|
|
39
|
-
*
|
|
40
|
-
* @param operator - The group's operator (AND or OR)
|
|
41
|
-
* @param expressionCount - Number of child expressions
|
|
42
|
-
* @returns Appropriate button label based on context
|
|
43
|
-
*/
|
|
44
|
-
function getAddGroupButtonLabel(operator, expressionCount) {
|
|
45
|
-
if (expressionCount === 0) {
|
|
46
|
-
return 'Add a group';
|
|
47
|
-
}
|
|
48
|
-
return operator === Zt.AND
|
|
49
|
-
? 'Add another group'
|
|
50
|
-
: 'Add alternative group';
|
|
19
|
+
? 'All of these conditions are met'
|
|
20
|
+
: 'Any of these conditions are met';
|
|
51
21
|
}
|
|
52
22
|
/**
|
|
53
23
|
* Create a new empty comparison expression
|
|
@@ -223,7 +193,7 @@ function defineCustomElement$2() {
|
|
|
223
193
|
} });
|
|
224
194
|
}
|
|
225
195
|
|
|
226
|
-
const limeQueryFilterGroupCss = "@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
|
|
196
|
+
const limeQueryFilterGroupCss = "@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{list-style:none;margin-top:0;margin-right:1rem;margin-bottom:1rem;padding-left:1rem;list-style:disc}.expression>ul li{list-style:none;margin-top:1rem}.expression>ul li.add-button{list-style:none;display:flex;gap:0.5rem}";
|
|
227
197
|
const LimebbLimeQueryFilterGroupStyle0 = limeQueryFilterGroupCss;
|
|
228
198
|
|
|
229
199
|
const LimeQueryFilterGroupComponent = /*@__PURE__*/ proxyCustomElement(class LimeQueryFilterGroupComponent extends HTMLElement {
|
|
@@ -232,13 +202,29 @@ const LimeQueryFilterGroupComponent = /*@__PURE__*/ proxyCustomElement(class Lim
|
|
|
232
202
|
this.__registerHost();
|
|
233
203
|
this.__attachShadow();
|
|
234
204
|
this.expressionChange = createEvent(this, "expressionChange", 7);
|
|
235
|
-
this.
|
|
236
|
-
|
|
237
|
-
|
|
205
|
+
this.options = [
|
|
206
|
+
{
|
|
207
|
+
text: 'All',
|
|
208
|
+
secondaryText: 'AND operator',
|
|
209
|
+
value: 'and',
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
text: 'Any',
|
|
213
|
+
secondaryText: 'OR operator',
|
|
214
|
+
value: 'or',
|
|
215
|
+
},
|
|
216
|
+
];
|
|
238
217
|
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) })));
|
|
239
|
-
this.handleToggleOperator = () => {
|
|
240
|
-
const
|
|
241
|
-
|
|
218
|
+
this.handleToggleOperator = (event) => {
|
|
219
|
+
const selectedOption = Array.isArray(event.detail)
|
|
220
|
+
? event.detail[0]
|
|
221
|
+
: event.detail;
|
|
222
|
+
this.value = selectedOption;
|
|
223
|
+
const newOp = selectedOption.value === 'and' ? Zt.AND : Zt.OR;
|
|
224
|
+
if (newOp !== this.expression.op) {
|
|
225
|
+
const newGroup = toggleGroupOperator(this.expression);
|
|
226
|
+
this.expressionChange.emit(newGroup);
|
|
227
|
+
}
|
|
242
228
|
};
|
|
243
229
|
this.handleAddChildExpression = () => {
|
|
244
230
|
const newChild = createEmptyComparison();
|
|
@@ -257,47 +243,33 @@ const LimeQueryFilterGroupComponent = /*@__PURE__*/ proxyCustomElement(class Lim
|
|
|
257
243
|
this.expressionChange.emit(result.expression);
|
|
258
244
|
};
|
|
259
245
|
}
|
|
246
|
+
// Initialize value to match current operator
|
|
247
|
+
componentWillLoad() {
|
|
248
|
+
this.value =
|
|
249
|
+
this.options.find((option) => option.value ===
|
|
250
|
+
(this.expression.op === Zt.AND ? 'and' : 'or')) || this.options[0];
|
|
251
|
+
}
|
|
260
252
|
render() {
|
|
261
253
|
const subheading = this.getSubheading();
|
|
262
|
-
return (h("div", { key: '
|
|
263
|
-
name: this.expression.op === Zt.AND
|
|
264
|
-
? 'dot_bricks'
|
|
265
|
-
: 'dot_circle',
|
|
266
|
-
color: 'rgb(var(--contrast-800))',
|
|
267
|
-
}, subheading: subheading, onClick: this.handleToggleOperator, class: "clickable-header" }, this.renderActions())), h("ul", { key: 'f3ae21204e082e81068c0e20b76e14ed4b577051' }, this.expression.exp.map(this.renderChildExpression), h("li", { key: 'd5958d8b61f348540b3dfb821de16ed0f2d0a1f4', class: "add-button" }, this.renderAddButton(), this.renderAddGroupButton()))));
|
|
268
|
-
}
|
|
269
|
-
get actions() {
|
|
270
|
-
return [
|
|
271
|
-
{
|
|
272
|
-
id: '1',
|
|
273
|
-
icon: this.expression.op === Zt.AND
|
|
274
|
-
? 'dot_circle'
|
|
275
|
-
: 'dot_bricks',
|
|
276
|
-
label: this.expression.op === Zt.AND
|
|
277
|
-
? 'Any condition (OR)'
|
|
278
|
-
: 'All conditions (AND)',
|
|
279
|
-
},
|
|
280
|
-
];
|
|
254
|
+
return (h("div", { key: '741f2870c545d8e879a53244e0334d5c0cf0a4bd', class: "expression" }, subheading && (h("limel-header", { key: 'c08e664d2aaa539a47d3f5b4bbb4daa350c15131', subheading: subheading }, this.renderOperators())), h("ul", { key: '2bddf3cc8b4167845838844512aa6ab5688c46c5' }, this.expression.exp.map(this.renderChildExpression), h("li", { key: 'da86547dcf15b4c53a1991340f19d8bd54f4dee4', class: "add-button" }, this.renderAddButton(), this.renderAddGroupButton()))));
|
|
281
255
|
}
|
|
282
|
-
|
|
283
|
-
return (h("
|
|
256
|
+
renderOperators() {
|
|
257
|
+
return (h("limel-select", { slot: "actions", value: this.value, options: this.options, onChange: this.handleToggleOperator }));
|
|
284
258
|
}
|
|
285
259
|
getSubheading() {
|
|
286
260
|
return getFilterGroupSubheading(this.expression.op, this.expression.exp.length);
|
|
287
261
|
}
|
|
288
262
|
renderAddButton() {
|
|
289
|
-
|
|
290
|
-
|
|
263
|
+
return (h("limel-button", { label: "Condition", icon: {
|
|
264
|
+
name: 'plus_math',
|
|
265
|
+
title: 'Add',
|
|
266
|
+
}, onClick: this.handleAddChildExpression }));
|
|
291
267
|
}
|
|
292
268
|
renderAddGroupButton() {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
return getAddConditionButtonLabel(this.expression.op, this.expression.exp.length);
|
|
298
|
-
}
|
|
299
|
-
getAddGroupButtonLabel() {
|
|
300
|
-
return getAddGroupButtonLabel(this.expression.op, this.expression.exp.length);
|
|
269
|
+
return (h("limel-button", { label: "Group", icon: {
|
|
270
|
+
name: 'tree_structure',
|
|
271
|
+
title: 'Add',
|
|
272
|
+
}, onClick: this.handleAddChildGroup }));
|
|
301
273
|
}
|
|
302
274
|
static get style() { return LimebbLimeQueryFilterGroupStyle0; }
|
|
303
275
|
}, [1, "limebb-lime-query-filter-group", {
|
|
@@ -305,7 +277,8 @@ const LimeQueryFilterGroupComponent = /*@__PURE__*/ proxyCustomElement(class Lim
|
|
|
305
277
|
"context": [16],
|
|
306
278
|
"limetype": [1],
|
|
307
279
|
"activeLimetype": [1, "active-limetype"],
|
|
308
|
-
"expression": [16]
|
|
280
|
+
"expression": [16],
|
|
281
|
+
"value": [32]
|
|
309
282
|
}]);
|
|
310
283
|
function defineCustomElement$1() {
|
|
311
284
|
if (typeof customElements === "undefined") {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { T as Te } from './index.esm.js';
|
|
3
3
|
import { i as isLimeQuerySupported } from './lime-query-validation.js';
|
|
4
4
|
import { d as defineCustomElement$d } from './lime-query-filter-builder.js';
|
|
@@ -12,7 +12,7 @@ import { d as defineCustomElement$4 } from './lime-query-value-input.js';
|
|
|
12
12
|
import { d as defineCustomElement$3 } from './limetype-field.js';
|
|
13
13
|
import { d as defineCustomElement$2 } from './property-selector.js';
|
|
14
14
|
|
|
15
|
-
const limeQueryBuilderCss = ":host(limebb-lime-lime-query-builder)
|
|
15
|
+
const limeQueryBuilderCss = "*,*:before,*:after{box-sizing:border-box}:host(limebb-lime-query-builder){--header-background-color:rgb(var(--contrast-400));--limebb-lime-query-builder-background-color:rgb(var(--contrast-100));--limebb-lime-query-builder-border-radius:0.75rem;box-sizing:border-box;width:calc(100% - 1.5rem);margin:0.75rem auto;display:flex;flex-direction:column;border-radius:var(--limebb-lime-query-builder-border-radius);background-color:var(--limebb-lime-query-builder-background-color);box-shadow:var(--shadow-inflated-16)}.gui-mode{padding:1rem;border:1px solid var(--header-background-color);border-radius:0 0 0.754rem 0.75rem}.code-mode{--code-editor-max-height:70vh;display:flex;flex-direction:column;gap:1rem}.code-mode .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-mode .validation-errors strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-mode .validation-errors ul{margin:0;padding-left:1.5rem}.code-mode .validation-errors li{margin:0.25rem 0}.code-mode .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-mode .gui-limitations strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-mode .gui-limitations ul{margin:0;padding-left:1.5rem}.code-mode .gui-limitations li{margin:0.25rem 0}.limetype-section{display:flex;flex-direction:column}.filter-section,.query-options-section{display:flex;flex-direction:column;gap:1rem;padding-top: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}";
|
|
16
16
|
const LimebbLimeQueryBuilderStyle0 = limeQueryBuilderCss;
|
|
17
17
|
|
|
18
18
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -147,11 +147,14 @@ const LimeQueryBuilder = /*@__PURE__*/ proxyCustomElement(class LimeQueryBuilder
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
render() {
|
|
150
|
+
return (h(Host, { key: '02e7367fbc718a8625c8d49d5e546acca0986ce2' }, this.renderHeader(), this.renderContent()));
|
|
151
|
+
}
|
|
152
|
+
renderContent() {
|
|
150
153
|
const guiSupported = this.checkGuiSupport();
|
|
151
154
|
const showCodeMode = !this.guiModeEnabled || this.mode === 'code';
|
|
152
|
-
return
|
|
155
|
+
return showCodeMode
|
|
153
156
|
? this.renderCodeMode(guiSupported)
|
|
154
|
-
: this.renderGuiMode()
|
|
157
|
+
: this.renderGuiMode();
|
|
155
158
|
}
|
|
156
159
|
emitChange() {
|
|
157
160
|
// Only emit in GUI mode
|
|
@@ -245,14 +248,19 @@ const LimeQueryBuilder = /*@__PURE__*/ proxyCustomElement(class LimeQueryBuilder
|
|
|
245
248
|
renderModeSwitch(support) {
|
|
246
249
|
const guiDisabled = !support.guiSupported;
|
|
247
250
|
const buttons = this.getButtons().map((button) => (Object.assign(Object.assign({}, button), { selected: button.id === this.mode })));
|
|
248
|
-
return (h("limel-button-group", { onChange: this.handleChange, value: buttons, disabled: guiDisabled }));
|
|
251
|
+
return (h("limel-button-group", { slot: "actions", onChange: this.handleChange, value: buttons, disabled: guiDisabled }));
|
|
249
252
|
}
|
|
250
253
|
renderCodeEditor(guiSupported) {
|
|
251
|
-
return
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
!guiSupported.guiSupported &&
|
|
255
|
-
|
|
254
|
+
return [
|
|
255
|
+
h("limel-code-editor", { value: this.codeValue, language: "json", lineNumbers: true, fold: true, lint: true, onChange: this.handleCodeChange }),
|
|
256
|
+
/* Show validation errors (invalid Lime Query) */
|
|
257
|
+
!guiSupported.valid && guiSupported.validationErrors.length > 0 && (h("div", { class: "validation-errors" }, h("strong", null, "Invalid Lime Query:"), h("ul", null, guiSupported.validationErrors.map((error) => (h("li", null, error)))))),
|
|
258
|
+
/* Show GUI limitations (only when GUI mode is enabled and Lime Query is valid) */
|
|
259
|
+
this.guiModeEnabled &&
|
|
260
|
+
guiSupported.valid &&
|
|
261
|
+
!guiSupported.guiSupported &&
|
|
262
|
+
guiSupported.guiLimitations.length > 0 && (h("div", { class: "gui-limitations" }, h("strong", null, "Cannot switch to GUI mode:"), h("ul", null, guiSupported.guiLimitations.map((limitation) => (h("li", null, limitation)))))),
|
|
263
|
+
];
|
|
256
264
|
}
|
|
257
265
|
renderLimetypeSection() {
|
|
258
266
|
return (h("div", { class: "limetype-section" }, h("limebb-limetype-field", { platform: this.platform, context: this.context, label: "Object Type", value: this.limetype, required: true, fieldName: "limetype", helperText: "Select the type of object you want to query", onChange: this.handleLimetypeChange })));
|
|
@@ -279,17 +287,15 @@ const LimeQueryBuilder = /*@__PURE__*/ proxyCustomElement(class LimeQueryBuilder
|
|
|
279
287
|
renderGuiMode() {
|
|
280
288
|
return (h("div", { class: "gui-mode" }, this.renderLimetypeSection(), this.renderResponseFormatSection(), this.renderFilterSection(), this.renderQueryOptionsSection()));
|
|
281
289
|
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
return h("h3", { class: "lime-query-builder-label" }, this.label);
|
|
290
|
+
renderHeader() {
|
|
291
|
+
const guiSupported = this.checkGuiSupport();
|
|
292
|
+
return (h("limel-header", { heading: this.label }, this.renderModeControls(guiSupported)));
|
|
287
293
|
}
|
|
288
294
|
renderModeControls(support) {
|
|
289
295
|
if (!this.guiModeEnabled) {
|
|
290
296
|
return;
|
|
291
297
|
}
|
|
292
|
-
return
|
|
298
|
+
return this.renderModeSwitch(support);
|
|
293
299
|
}
|
|
294
300
|
renderCodeMode(support) {
|
|
295
301
|
return h("div", { class: "code-mode" }, this.renderCodeEditor(support));
|
|
@@ -39,7 +39,9 @@ function parseResponseFormat(json) {
|
|
|
39
39
|
`Only 'object' and 'aggregates' are allowed.`);
|
|
40
40
|
}
|
|
41
41
|
// Must have at least one of object or aggregates
|
|
42
|
-
|
|
42
|
+
// Note: Empty objects {} are valid (starting point for GUI mode)
|
|
43
|
+
const hasProperties = keys.length > 0;
|
|
44
|
+
if (hasProperties && !parsed.object && !parsed.aggregates) {
|
|
43
45
|
throw new Error('Response format must contain at least one of: object, aggregates');
|
|
44
46
|
}
|
|
45
47
|
return parsed;
|
|
@@ -161,7 +161,7 @@ function itemsToPropertySelection(items) {
|
|
|
161
161
|
return result;
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
const responseFormatEditorCss = ":host(limebb-lime-query-response-format-editor){display:block;width:100%}.response-format-editor{display:flex;flex-direction:column;
|
|
164
|
+
const responseFormatEditorCss = ":host(limebb-lime-query-response-format-editor){display:block;width:100%}.response-format-editor{display:flex;flex-direction:column;padding:1rem 0}limel-badge[slot=actions]{--badge-background-color:rgb(var(--contrast-200));margin-right:0.25rem}.property{border:1px solid var(--header-background-color);border-radius:0 0 0.75rem 0.75rem}.property-list{display:flex;flex-direction:column;border-radius:0.25rem;background-color:rgb(var(--contrast-100));gap:0.5rem;padding:0.5rem}.property-item{border-radius:0.25rem;transition:background-color 0.2s}.property-item:hover{background-color:rgb(var(--contrast-100))}.actions{display:flex}.actions limel-button{padding:0.5rem;width:100%}.empty-state{padding:2rem;text-align:center;color:rgb(var(--contrast-700));font-style:italic}.empty-state p{margin:0}.empty-state .empty-state-message{margin-bottom:1rem;font-size:0.875rem}.empty-state limel-button{margin:0 auto;max-width:200px}";
|
|
165
165
|
const LimebbLimeQueryResponseFormatEditorStyle0 = responseFormatEditorCss;
|
|
166
166
|
|
|
167
167
|
const ResponseFormatEditor = /*@__PURE__*/ proxyCustomElement(class ResponseFormatEditor extends HTMLElement {
|
|
@@ -173,8 +173,8 @@ const ResponseFormatEditor = /*@__PURE__*/ proxyCustomElement(class ResponseForm
|
|
|
173
173
|
/**
|
|
174
174
|
* Optional label
|
|
175
175
|
*/
|
|
176
|
-
this.label = '
|
|
177
|
-
this.items = [
|
|
176
|
+
this.label = 'Properties';
|
|
177
|
+
this.items = [];
|
|
178
178
|
this.handleItemChange = (index) => (event) => {
|
|
179
179
|
event.stopPropagation();
|
|
180
180
|
const newItems = [...this.items];
|
|
@@ -186,10 +186,7 @@ const ResponseFormatEditor = /*@__PURE__*/ proxyCustomElement(class ResponseForm
|
|
|
186
186
|
// Update item
|
|
187
187
|
newItems[index] = event.detail;
|
|
188
188
|
}
|
|
189
|
-
//
|
|
190
|
-
if (newItems.length === 0) {
|
|
191
|
-
newItems.push({ path: '_id' });
|
|
192
|
-
}
|
|
189
|
+
// Allow empty items - users can remove all properties
|
|
193
190
|
this.items = newItems;
|
|
194
191
|
this.emitChange();
|
|
195
192
|
};
|
|
@@ -200,16 +197,45 @@ const ResponseFormatEditor = /*@__PURE__*/ proxyCustomElement(class ResponseForm
|
|
|
200
197
|
}
|
|
201
198
|
componentWillLoad() {
|
|
202
199
|
var _a;
|
|
203
|
-
|
|
200
|
+
// Check if value is truly empty ({}) - no object or aggregates
|
|
201
|
+
const isTrulyEmpty = this.value &&
|
|
202
|
+
Object.keys(this.value).length === 0 &&
|
|
203
|
+
!this.value.object &&
|
|
204
|
+
!this.value.aggregates;
|
|
205
|
+
if (isTrulyEmpty) {
|
|
206
|
+
// Keep items empty for truly empty objects
|
|
207
|
+
this.items = [];
|
|
208
|
+
}
|
|
209
|
+
else if ((_a = this.value) === null || _a === void 0 ? void 0 : _a.object) {
|
|
204
210
|
const converted = propertySelectionToItems(this.value.object);
|
|
205
211
|
if (converted.length > 0) {
|
|
206
212
|
this.items = converted;
|
|
207
213
|
}
|
|
214
|
+
else {
|
|
215
|
+
// Empty object property, but not a truly empty value
|
|
216
|
+
// Use default _id for backward compatibility
|
|
217
|
+
this.items = [{ path: '_id' }];
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
else if (!this.value) {
|
|
221
|
+
// No value provided at all, use default _id
|
|
222
|
+
this.items = [{ path: '_id' }];
|
|
208
223
|
}
|
|
209
224
|
}
|
|
210
225
|
componentWillUpdate() {
|
|
211
226
|
var _a;
|
|
212
|
-
|
|
227
|
+
// Check if value is truly empty ({})
|
|
228
|
+
const isTrulyEmpty = this.value &&
|
|
229
|
+
Object.keys(this.value).length === 0 &&
|
|
230
|
+
!this.value.object &&
|
|
231
|
+
!this.value.aggregates;
|
|
232
|
+
if (isTrulyEmpty) {
|
|
233
|
+
// Keep items empty for truly empty objects
|
|
234
|
+
if (this.items.length > 0) {
|
|
235
|
+
this.items = [];
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
else if ((_a = this.value) === null || _a === void 0 ? void 0 : _a.object) {
|
|
213
239
|
const currentItems = propertySelectionToItems(this.value.object);
|
|
214
240
|
// Check if items have changed
|
|
215
241
|
const itemsChanged = currentItems.length !== this.items.length ||
|
|
@@ -221,8 +247,8 @@ const ResponseFormatEditor = /*@__PURE__*/ proxyCustomElement(class ResponseForm
|
|
|
221
247
|
item.description === current.description);
|
|
222
248
|
});
|
|
223
249
|
if (itemsChanged) {
|
|
224
|
-
|
|
225
|
-
|
|
250
|
+
// Allow empty items array - don't force _id
|
|
251
|
+
this.items = currentItems;
|
|
226
252
|
}
|
|
227
253
|
}
|
|
228
254
|
}
|
|
@@ -230,7 +256,20 @@ const ResponseFormatEditor = /*@__PURE__*/ proxyCustomElement(class ResponseForm
|
|
|
230
256
|
if (!this.limetype) {
|
|
231
257
|
return (h("div", { class: "empty-state" }, h("p", null, "Select a limetype to choose properties")));
|
|
232
258
|
}
|
|
233
|
-
|
|
259
|
+
// Render empty state when no properties are selected
|
|
260
|
+
if (this.items.length === 0) {
|
|
261
|
+
return (h("div", { class: "response-format-editor" }, h("h4", { class: "header" }, this.label), h("div", { class: "empty-state" }, h("p", { class: "empty-state-message" }, "No properties selected. The response will return empty objects."), h("limel-button", { label: "Add Property", icon: "plus_math", onClick: this.handleAddProperty }))));
|
|
262
|
+
}
|
|
263
|
+
return (h("div", { class: "response-format-editor" }, h("limel-header", { subheading: this.label }, this.renderPropertyCount()), h("div", { class: "property" }, h("div", { class: "property-list" }, this.items.map((item, index) => this.renderItem(item, index))), h("div", { class: "actions" }, h("limel-button", { label: "Property", icon: {
|
|
264
|
+
name: 'plus_math',
|
|
265
|
+
title: 'Add',
|
|
266
|
+
}, onClick: this.handleAddProperty })))));
|
|
267
|
+
}
|
|
268
|
+
renderPropertyCount() {
|
|
269
|
+
return [
|
|
270
|
+
h("limel-badge", { slot: "actions", id: "counter-badge", label: this.items.length.toString() }),
|
|
271
|
+
h("limel-tooltip", { elementId: "counter-badge", slot: "actions", label: "Number of selected properties" }),
|
|
272
|
+
];
|
|
234
273
|
}
|
|
235
274
|
renderItem(item, index) {
|
|
236
275
|
return (h("limebb-lime-query-response-format-item", { key: `${item.path}-${index}`, class: "property-item", platform: this.platform, context: this.context, limetype: this.limetype, item: item, onItemChange: this.handleItemChange(index) }));
|
|
@@ -16,5 +16,5 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy(JSON.parse("[[\"limebb-lime-query-builder\",[[1,\"limebb-lime-query-builder\",{\"platform\":[16],\"context\":[16],\"value\":[16],\"label\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"limetypes\":[32],\"mode\":[32],\"codeValue\":[32],\"limetype\":[32],\"filter\":[32],\"internalResponseFormat\":[32],\"limit\":[32],\"orderBy\":[32]}]]],[\"limebb-feed\",[[1,\"limebb-feed\",{\"platform\":[16],\"context\":[16],\"items\":[16],\"emptyStateMessage\":[1,\"empty-state-message\"],\"heading\":[1],\"loading\":[4],\"minutesOfProximity\":[2,\"minutes-of-proximity\"],\"totalCount\":[2,\"total-count\"],\"direction\":[513],\"lastVisitedTimestamp\":[1,\"last-visited-timestamp\"],\"highlightedItemId\":[8,\"highlighted-item-id\"]},null,{\"highlightedItemId\":[\"highlightedItemIdChanged\"]}]]],[\"limebb-kanban\",[[1,\"limebb-kanban\",{\"platform\":[16],\"context\":[16],\"groups\":[16]}]]],[\"limebb-lime-query-response-format-builder\",[[1,\"limebb-lime-query-response-format-builder\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"value\":[16],\"label\":[1],\"limetypes\":[32],\"mode\":[32],\"codeValue\":[32],\"internalValue\":[32]}]]],[\"limebb-chat-list\",[[1,\"limebb-chat-list\",{\"platform\":[16],\"context\":[16],\"items\":[16],\"loading\":[516],\"isTypingIndicatorVisible\":[516,\"is-typing-indicator-visible\"],\"lastVisitedTimestamp\":[513,\"last-visited-timestamp\"],\"order\":[513]},null,{\"items\":[\"handleItemsChange\"]}]]],[\"limebb-limeobject-file-viewer\",[[1,\"limebb-limeobject-file-viewer\",{\"platform\":[16],\"context\":[16],\"property\":[1],\"fileTypes\":[16],\"limeobject\":[32],\"limetype\":[32]}]]],[\"limebb-text-editor\",[[1,\"limebb-text-editor\",{\"platform\":[16],\"context\":[16],\"allowMentioning\":[4,\"allow-mentioning\"],\"contentType\":[1,\"content-type\"],\"language\":[513],\"disabled\":[516],\"readonly\":[516],\"helperText\":[513,\"helper-text\"],\"placeholder\":[513],\"label\":[513],\"invalid\":[516],\"required\":[516],\"selectedContext\":[16],\"ui\":[513],\"allowResize\":[4,\"allow-resize\"],\"value\":[1],\"draftIdentifier\":[1,\"draft-identifier\"],\"triggerMap\":[16],\"customElements\":[16],\"allowInlineImages\":[4,\"allow-inline-images\"],\"items\":[32],\"highlightedItemIndex\":[32],\"editorPickerQuery\":[32],\"searchableLimetypes\":[32],\"isPickerOpen\":[32],\"isSearching\":[32]},null,{\"isPickerOpen\":[\"watchOpen\"],\"editorPickerQuery\":[\"watchQuery\"]}]]],[\"limebb-date-range\",[[1,\"limebb-date-range\",{\"platform\":[16],\"context\":[16],\"startTime\":[16],\"endTime\":[16],\"startTimeLabel\":[1,\"start-time-label\"],\"endTimeLabel\":[1,\"end-time-label\"],\"language\":[1],\"timeFormat\":[1,\"time-format\"],\"type\":[1]}]]],[\"limebb-document-picker\",[[1,\"limebb-document-picker\",{\"platform\":[16],\"context\":[16],\"items\":[16],\"label\":[513],\"helperText\":[513,\"helper-text\"],\"invalid\":[516],\"required\":[516],\"type\":[513]}]]],[\"limebb-info-tile-currency-format\",[[1,\"limebb-info-tile-currency-format\",{\"platform\":[16],\"context\":[16],\"value\":[16]}]]],[\"limebb-notification-list\",[[1,\"limebb-notification-list\",{\"platform\":[16],\"context\":[16],\"items\":[16],\"loading\":[4],\"lastVisitedTimestamp\":[1,\"last-visited-timestamp\"]},null,{\"items\":[\"handleItemsChange\"]}]]],[\"limebb-browser\",[[17,\"limebb-browser\",{\"platform\":[16],\"context\":[16],\"items\":[16],\"layout\":[1],\"filter\":[32]}]]],[\"limebb-component-config\",[[1,\"limebb-component-config\",{\"platform\":[16],\"context\":[16],\"value\":[16],\"required\":[4],\"readonly\":[4],\"disabled\":[4],\"label\":[1],\"helperText\":[1,\"helper-text\"],\"formInfo\":[16],\"type\":[1],\"nameField\":[1,\"name-field\"],\"configComponent\":[32],\"configViewType\":[32]},null,{\"formInfo\":[\"watchFormInfo\"],\"configComponent\":[\"watchconfigComponent\"]}]]],[\"limebb-component-picker\",[[1,\"limebb-component-picker\",{\"platform\":[16],\"context\":[16],\"type\":[1],\"tags\":[16],\"value\":[1],\"copyLabel\":[1,\"copy-label\"],\"hideCopyButton\":[4,\"hide-copy-button\"],\"required\":[4],\"readonly\":[4],\"disabled\":[4],\"label\":[1],\"helperText\":[1,\"helper-text\"]}]]],[\"limebb-dashboard-widget\",[[1,\"limebb-dashboard-widget\",{\"heading\":[513],\"subheading\":[513],\"supportingText\":[513,\"supporting-text\"],\"icon\":[513]}]]],[\"limebb-icon-picker\",[[1,\"limebb-icon-picker\",{\"value\":[1],\"required\":[4],\"readonly\":[4],\"invalid\":[4],\"disabled\":[4],\"label\":[1],\"helperText\":[1,\"helper-text\"]}]]],[\"limebb-info-tile\",[[1,\"limebb-info-tile\",{\"platform\":[16],\"context\":[16],\"filterId\":[513,\"filter-id\"],\"disabled\":[4],\"icon\":[513],\"label\":[1],\"prefix\":[1],\"suffix\":[1],\"propertyName\":[1,\"property-name\"],\"aggregateOperator\":[1,\"aggregate-operator\"],\"format\":[16],\"config\":[32],\"filters\":[32],\"value\":[32],\"loading\":[32],\"error\":[32]},null,{\"filterId\":[\"watchFilterId\"],\"propertyName\":[\"watchPropertyName\"],\"aggregateOperator\":[\"watchAggregateOperator\"]}]]],[\"limebb-info-tile-date-format\",[[1,\"limebb-info-tile-date-format\",{\"value\":[16]}]]],[\"limebb-info-tile-decimal-format\",[[1,\"limebb-info-tile-decimal-format\",{\"value\":[16]}]]],[\"limebb-info-tile-format\",[[1,\"limebb-info-tile-format\",{\"platform\":[16],\"context\":[16],\"type\":[1],\"value\":[16]}]]],[\"limebb-info-tile-relative-date-format\",[[1,\"limebb-info-tile-relative-date-format\",{\"value\":[16]}]]],[\"limebb-info-tile-unit-format\",[[1,\"limebb-info-tile-unit-format\",{\"value\":[16]}]]],[\"limebb-loader\",[[1,\"limebb-loader\",{\"platform\":[16],\"context\":[16]}]]],[\"limebb-locale-picker\",[[1,\"limebb-locale-picker\",{\"platform\":[16],\"context\":[16],\"value\":[1],\"required\":[4],\"disabled\":[4],\"label\":[1],\"helperText\":[1,\"helper-text\"],\"readonly\":[4],\"multipleChoice\":[4,\"multiple-choice\"],\"allLanguages\":[32]}]]],[\"limebb-mention\",[[1,\"limebb-mention\",{\"limetype\":[1],\"objectid\":[2],\"limeobject\":[32]}]]],[\"limebb-mention-group-counter\",[[1,\"limebb-mention-group-counter\",{\"count\":[2],\"limetype\":[16],\"helperLabel\":[1,\"helper-label\"]}]]],[\"limebb-percentage-visualizer\",[[1,\"limebb-percentage-visualizer\",{\"platform\":[16],\"context\":[16],\"value\":[520],\"rangeMax\":[514,\"range-max\"],\"rangeMin\":[514,\"range-min\"],\"multiplier\":[514],\"label\":[513],\"invalid\":[516],\"required\":[516],\"helperText\":[513,\"helper-text\"],\"reducePresence\":[516,\"reduce-presence\"],\"displayPercentageColors\":[516,\"display-percentage-colors\"]},null,{\"value\":[\"valueChanged\"]}]]],[\"limebb-trend-indicator\",[[1,\"limebb-trend-indicator\",{\"platform\":[16],\"context\":[16],\"value\":[520],\"formerValue\":[514,\"former-value\"],\"suffix\":[513],\"label\":[513],\"invalid\":[516],\"required\":[516],\"helperText\":[513,\"helper-text\"],\"reducePresence\":[516,\"reduce-presence\"]},null,{\"value\":[\"valueChanged\"]}]]],[\"limebb-feed-timeline-item\",[[1,\"limebb-feed-timeline-item\",{\"platform\":[16],\"context\":[16],\"item\":[16],\"ui\":[513],\"helperText\":[1,\"helper-text\"],\"hasError\":[516,\"has-error\"],\"isBundled\":[516,\"is-bundled\"],\"headingCanExpand\":[32],\"isHeadingExpanded\":[32],\"showMore\":[32],\"isTall\":[32]}]]],[\"limebb-kanban-item\",[[1,\"limebb-kanban-item\",{\"platform\":[16],\"context\":[16],\"item\":[16]}]]],[\"limebb-kanban-group\",[[1,\"limebb-kanban-group\",{\"platform\":[16],\"context\":[16],\"identifier\":[1],\"heading\":[513],\"help\":[1],\"items\":[16],\"summary\":[1],\"loading\":[516],\"totalCount\":[514,\"total-count\"]}]]],[\"limebb-text-editor-picker\",[[1,\"limebb-text-editor-picker\",{\"items\":[16],\"open\":[516],\"isSearching\":[4,\"is-searching\"],\"emptyMessage\":[1,\"empty-message\"]},null,{\"open\":[\"watchOpen\"]}]]],[\"limebb-currency-picker\",[[1,\"limebb-currency-picker\",{\"platform\":[16],\"context\":[16],\"label\":[513],\"currencies\":[16],\"helperText\":[513,\"helper-text\"],\"required\":[516],\"readonly\":[516],\"invalid\":[516],\"disabled\":[516],\"value\":[1]}]]],[\"limebb-date-picker\",[[1,\"limebb-date-picker\",{\"platform\":[16],\"context\":[16],\"disabled\":[516],\"readonly\":[516],\"invalid\":[516],\"label\":[513],\"placeholder\":[513],\"helperText\":[513,\"helper-text\"],\"required\":[516],\"value\":[1],\"type\":[513]}]]],[\"limebb-document-item\",[[17,\"limebb-document-item\",{\"platform\":[16],\"context\":[16],\"item\":[16],\"type\":[513]}]]],[\"limebb-live-docs-info\",[[1,\"limebb-live-docs-info\"]]],[\"limebb-notification-item\",[[1,\"limebb-notification-item\",{\"platform\":[16],\"context\":[16],\"item\":[16]}]]],[\"limebb-lime-query-order-by-item\",[[1,\"limebb-lime-query-order-by-item\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"item\":[16]}]]],[\"limebb-chat-item_2\",[[1,\"limebb-chat-item\",{\"platform\":[16],\"context\":[16],\"item\":[16],\"helperText\":[1,\"helper-text\"],\"hasError\":[516,\"has-error\"]}],[1,\"limebb-typing-indicator\"]]],[\"limebb-feed-item-thumbnail-file-info\",[[1,\"limebb-feed-item-thumbnail-file-info\",{\"description\":[1]}]]],[\"limebb-lime-query-filter-builder_3\",[[1,\"limebb-lime-query-filter-builder\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"expression\":[16]}],[1,\"limebb-lime-query-order-by-editor\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"value\":[16],\"label\":[1],\"items\":[32]},null,{\"value\":[\"handleValueChange\"]}],[0,\"limebb-limetype-field\",{\"platform\":[16],\"context\":[16],\"label\":[513],\"required\":[516],\"readonly\":[516],\"disabled\":[516],\"value\":[513],\"helperText\":[513,\"helper-text\"],\"invalid\":[4],\"limetypes\":[16],\"propertyFields\":[16],\"fieldName\":[1,\"field-name\"],\"formInfo\":[16]}]]],[\"limebb-empty-state\",[[1,\"limebb-empty-state\",{\"heading\":[513],\"value\":[513],\"icon\":[16]}]]],[\"limebb-property-selector\",[[1,\"limebb-property-selector\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"value\":[1],\"label\":[1],\"required\":[4],\"helperText\":[1,\"helper-text\"],\"limetypes\":[32],\"isOpen\":[32],\"navigationPath\":[32]}]]],[\"limebb-lime-query-response-format-editor_2\",[[1,\"limebb-lime-query-response-format-editor\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"value\":[16],\"label\":[1],\"items\":[32]}],[1,\"limebb-lime-query-response-format-item\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"item\":[16],\"showAliasInput\":[32],\"showDescriptionInput\":[32]}]]],[\"limebb-navigation-button_2\",[[1,\"limebb-summary-popover\",{\"triggerDelay\":[514,\"trigger-delay\"],\"heading\":[513],\"subheading\":[513],\"image\":[16],\"icon\":[513],\"value\":[1],\"openDirection\":[513,\"open-direction\"],\"popoverMaxWidth\":[513,\"popover-max-width\"],\"popoverMaxHeight\":[513,\"popover-max-height\"],\"actions\":[16],\"isPopoverOpen\":[32]}],[17,\"limebb-navigation-button\",{\"href\":[513],\"tooltipLabel\":[513,\"tooltip-label\"],\"tooltipHelperLabel\":[513,\"tooltip-helper-label\"],\"type\":[513]}]]],[\"limebb-lime-query-filter-group_3\",[[1,\"limebb-lime-query-value-input\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"propertyPath\":[1,\"property-path\"],\"operator\":[1],\"value\":[8],\"label\":[1],\"limetypes\":[32],\"inputMode\":[32]}],[1,\"limebb-lime-query-filter-group\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"expression\":[16]}],[1,\"limebb-lime-query-filter-not\",{\"platform\":[16],\"context\":[16],\"label\":[1],\"limetype\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"expression\":[16]}]]],[\"limebb-lime-query-filter-comparison_2\",[[1,\"limebb-lime-query-filter-expression\",{\"platform\":[16],\"context\":[16],\"label\":[1],\"limetype\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"expression\":[16]}],[1,\"limebb-lime-query-filter-comparison\",{\"platform\":[16],\"context\":[16],\"label\":[1],\"limetype\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"expression\":[16]}]]]]"), options);
|
|
19
|
+
return bootstrapLazy(JSON.parse("[[\"limebb-lime-query-builder\",[[1,\"limebb-lime-query-builder\",{\"platform\":[16],\"context\":[16],\"value\":[16],\"label\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"limetypes\":[32],\"mode\":[32],\"codeValue\":[32],\"limetype\":[32],\"filter\":[32],\"internalResponseFormat\":[32],\"limit\":[32],\"orderBy\":[32]}]]],[\"limebb-feed\",[[1,\"limebb-feed\",{\"platform\":[16],\"context\":[16],\"items\":[16],\"emptyStateMessage\":[1,\"empty-state-message\"],\"heading\":[1],\"loading\":[4],\"minutesOfProximity\":[2,\"minutes-of-proximity\"],\"totalCount\":[2,\"total-count\"],\"direction\":[513],\"lastVisitedTimestamp\":[1,\"last-visited-timestamp\"],\"highlightedItemId\":[8,\"highlighted-item-id\"]},null,{\"highlightedItemId\":[\"highlightedItemIdChanged\"]}]]],[\"limebb-kanban\",[[1,\"limebb-kanban\",{\"platform\":[16],\"context\":[16],\"groups\":[16]}]]],[\"limebb-lime-query-response-format-builder\",[[1,\"limebb-lime-query-response-format-builder\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"value\":[16],\"label\":[1],\"limetypes\":[32],\"mode\":[32],\"codeValue\":[32],\"internalValue\":[32]}]]],[\"limebb-chat-list\",[[1,\"limebb-chat-list\",{\"platform\":[16],\"context\":[16],\"items\":[16],\"loading\":[516],\"isTypingIndicatorVisible\":[516,\"is-typing-indicator-visible\"],\"lastVisitedTimestamp\":[513,\"last-visited-timestamp\"],\"order\":[513]},null,{\"items\":[\"handleItemsChange\"]}]]],[\"limebb-limeobject-file-viewer\",[[1,\"limebb-limeobject-file-viewer\",{\"platform\":[16],\"context\":[16],\"property\":[1],\"fileTypes\":[16],\"limeobject\":[32],\"limetype\":[32]}]]],[\"limebb-text-editor\",[[1,\"limebb-text-editor\",{\"platform\":[16],\"context\":[16],\"allowMentioning\":[4,\"allow-mentioning\"],\"contentType\":[1,\"content-type\"],\"language\":[513],\"disabled\":[516],\"readonly\":[516],\"helperText\":[513,\"helper-text\"],\"placeholder\":[513],\"label\":[513],\"invalid\":[516],\"required\":[516],\"selectedContext\":[16],\"ui\":[513],\"allowResize\":[4,\"allow-resize\"],\"value\":[1],\"draftIdentifier\":[1,\"draft-identifier\"],\"triggerMap\":[16],\"customElements\":[16],\"allowInlineImages\":[4,\"allow-inline-images\"],\"items\":[32],\"highlightedItemIndex\":[32],\"editorPickerQuery\":[32],\"searchableLimetypes\":[32],\"isPickerOpen\":[32],\"isSearching\":[32]},null,{\"isPickerOpen\":[\"watchOpen\"],\"editorPickerQuery\":[\"watchQuery\"]}]]],[\"limebb-date-range\",[[1,\"limebb-date-range\",{\"platform\":[16],\"context\":[16],\"startTime\":[16],\"endTime\":[16],\"startTimeLabel\":[1,\"start-time-label\"],\"endTimeLabel\":[1,\"end-time-label\"],\"language\":[1],\"timeFormat\":[1,\"time-format\"],\"type\":[1]}]]],[\"limebb-document-picker\",[[1,\"limebb-document-picker\",{\"platform\":[16],\"context\":[16],\"items\":[16],\"label\":[513],\"helperText\":[513,\"helper-text\"],\"invalid\":[516],\"required\":[516],\"type\":[513]}]]],[\"limebb-info-tile-currency-format\",[[1,\"limebb-info-tile-currency-format\",{\"platform\":[16],\"context\":[16],\"value\":[16]}]]],[\"limebb-notification-list\",[[1,\"limebb-notification-list\",{\"platform\":[16],\"context\":[16],\"items\":[16],\"loading\":[4],\"lastVisitedTimestamp\":[1,\"last-visited-timestamp\"]},null,{\"items\":[\"handleItemsChange\"]}]]],[\"limebb-browser\",[[17,\"limebb-browser\",{\"platform\":[16],\"context\":[16],\"items\":[16],\"layout\":[1],\"filter\":[32]}]]],[\"limebb-component-config\",[[1,\"limebb-component-config\",{\"platform\":[16],\"context\":[16],\"value\":[16],\"required\":[4],\"readonly\":[4],\"disabled\":[4],\"label\":[1],\"helperText\":[1,\"helper-text\"],\"formInfo\":[16],\"type\":[1],\"nameField\":[1,\"name-field\"],\"configComponent\":[32],\"configViewType\":[32]},null,{\"formInfo\":[\"watchFormInfo\"],\"configComponent\":[\"watchconfigComponent\"]}]]],[\"limebb-component-picker\",[[1,\"limebb-component-picker\",{\"platform\":[16],\"context\":[16],\"type\":[1],\"tags\":[16],\"value\":[1],\"copyLabel\":[1,\"copy-label\"],\"hideCopyButton\":[4,\"hide-copy-button\"],\"required\":[4],\"readonly\":[4],\"disabled\":[4],\"label\":[1],\"helperText\":[1,\"helper-text\"]}]]],[\"limebb-dashboard-widget\",[[1,\"limebb-dashboard-widget\",{\"heading\":[513],\"subheading\":[513],\"supportingText\":[513,\"supporting-text\"],\"icon\":[513]}]]],[\"limebb-icon-picker\",[[1,\"limebb-icon-picker\",{\"value\":[1],\"required\":[4],\"readonly\":[4],\"invalid\":[4],\"disabled\":[4],\"label\":[1],\"helperText\":[1,\"helper-text\"]}]]],[\"limebb-info-tile\",[[1,\"limebb-info-tile\",{\"platform\":[16],\"context\":[16],\"filterId\":[513,\"filter-id\"],\"disabled\":[4],\"icon\":[513],\"label\":[1],\"prefix\":[1],\"suffix\":[1],\"propertyName\":[1,\"property-name\"],\"aggregateOperator\":[1,\"aggregate-operator\"],\"format\":[16],\"config\":[32],\"filters\":[32],\"value\":[32],\"loading\":[32],\"error\":[32]},null,{\"filterId\":[\"watchFilterId\"],\"propertyName\":[\"watchPropertyName\"],\"aggregateOperator\":[\"watchAggregateOperator\"]}]]],[\"limebb-info-tile-date-format\",[[1,\"limebb-info-tile-date-format\",{\"value\":[16]}]]],[\"limebb-info-tile-decimal-format\",[[1,\"limebb-info-tile-decimal-format\",{\"value\":[16]}]]],[\"limebb-info-tile-format\",[[1,\"limebb-info-tile-format\",{\"platform\":[16],\"context\":[16],\"type\":[1],\"value\":[16]}]]],[\"limebb-info-tile-relative-date-format\",[[1,\"limebb-info-tile-relative-date-format\",{\"value\":[16]}]]],[\"limebb-info-tile-unit-format\",[[1,\"limebb-info-tile-unit-format\",{\"value\":[16]}]]],[\"limebb-loader\",[[1,\"limebb-loader\",{\"platform\":[16],\"context\":[16]}]]],[\"limebb-locale-picker\",[[1,\"limebb-locale-picker\",{\"platform\":[16],\"context\":[16],\"value\":[1],\"required\":[4],\"disabled\":[4],\"label\":[1],\"helperText\":[1,\"helper-text\"],\"readonly\":[4],\"multipleChoice\":[4,\"multiple-choice\"],\"allLanguages\":[32]}]]],[\"limebb-mention\",[[1,\"limebb-mention\",{\"limetype\":[1],\"objectid\":[2],\"limeobject\":[32]}]]],[\"limebb-mention-group-counter\",[[1,\"limebb-mention-group-counter\",{\"count\":[2],\"limetype\":[16],\"helperLabel\":[1,\"helper-label\"]}]]],[\"limebb-percentage-visualizer\",[[1,\"limebb-percentage-visualizer\",{\"platform\":[16],\"context\":[16],\"value\":[520],\"rangeMax\":[514,\"range-max\"],\"rangeMin\":[514,\"range-min\"],\"multiplier\":[514],\"label\":[513],\"invalid\":[516],\"required\":[516],\"helperText\":[513,\"helper-text\"],\"reducePresence\":[516,\"reduce-presence\"],\"displayPercentageColors\":[516,\"display-percentage-colors\"]},null,{\"value\":[\"valueChanged\"]}]]],[\"limebb-trend-indicator\",[[1,\"limebb-trend-indicator\",{\"platform\":[16],\"context\":[16],\"value\":[520],\"formerValue\":[514,\"former-value\"],\"suffix\":[513],\"label\":[513],\"invalid\":[516],\"required\":[516],\"helperText\":[513,\"helper-text\"],\"reducePresence\":[516,\"reduce-presence\"]},null,{\"value\":[\"valueChanged\"]}]]],[\"limebb-feed-timeline-item\",[[1,\"limebb-feed-timeline-item\",{\"platform\":[16],\"context\":[16],\"item\":[16],\"ui\":[513],\"helperText\":[1,\"helper-text\"],\"hasError\":[516,\"has-error\"],\"isBundled\":[516,\"is-bundled\"],\"headingCanExpand\":[32],\"isHeadingExpanded\":[32],\"showMore\":[32],\"isTall\":[32]}]]],[\"limebb-kanban-item\",[[1,\"limebb-kanban-item\",{\"platform\":[16],\"context\":[16],\"item\":[16]}]]],[\"limebb-kanban-group\",[[1,\"limebb-kanban-group\",{\"platform\":[16],\"context\":[16],\"identifier\":[1],\"heading\":[513],\"help\":[1],\"items\":[16],\"summary\":[1],\"loading\":[516],\"totalCount\":[514,\"total-count\"]}]]],[\"limebb-text-editor-picker\",[[1,\"limebb-text-editor-picker\",{\"items\":[16],\"open\":[516],\"isSearching\":[4,\"is-searching\"],\"emptyMessage\":[1,\"empty-message\"]},null,{\"open\":[\"watchOpen\"]}]]],[\"limebb-currency-picker\",[[1,\"limebb-currency-picker\",{\"platform\":[16],\"context\":[16],\"label\":[513],\"currencies\":[16],\"helperText\":[513,\"helper-text\"],\"required\":[516],\"readonly\":[516],\"invalid\":[516],\"disabled\":[516],\"value\":[1]}]]],[\"limebb-date-picker\",[[1,\"limebb-date-picker\",{\"platform\":[16],\"context\":[16],\"disabled\":[516],\"readonly\":[516],\"invalid\":[516],\"label\":[513],\"placeholder\":[513],\"helperText\":[513,\"helper-text\"],\"required\":[516],\"value\":[1],\"type\":[513]}]]],[\"limebb-document-item\",[[17,\"limebb-document-item\",{\"platform\":[16],\"context\":[16],\"item\":[16],\"type\":[513]}]]],[\"limebb-live-docs-info\",[[1,\"limebb-live-docs-info\"]]],[\"limebb-notification-item\",[[1,\"limebb-notification-item\",{\"platform\":[16],\"context\":[16],\"item\":[16]}]]],[\"limebb-lime-query-order-by-item\",[[1,\"limebb-lime-query-order-by-item\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"item\":[16]}]]],[\"limebb-chat-item_2\",[[1,\"limebb-chat-item\",{\"platform\":[16],\"context\":[16],\"item\":[16],\"helperText\":[1,\"helper-text\"],\"hasError\":[516,\"has-error\"]}],[1,\"limebb-typing-indicator\"]]],[\"limebb-feed-item-thumbnail-file-info\",[[1,\"limebb-feed-item-thumbnail-file-info\",{\"description\":[1]}]]],[\"limebb-lime-query-filter-builder_3\",[[1,\"limebb-lime-query-filter-builder\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"expression\":[16]}],[1,\"limebb-lime-query-order-by-editor\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"value\":[16],\"label\":[1],\"items\":[32]},null,{\"value\":[\"handleValueChange\"]}],[0,\"limebb-limetype-field\",{\"platform\":[16],\"context\":[16],\"label\":[513],\"required\":[516],\"readonly\":[516],\"disabled\":[516],\"value\":[513],\"helperText\":[513,\"helper-text\"],\"invalid\":[4],\"limetypes\":[16],\"propertyFields\":[16],\"fieldName\":[1,\"field-name\"],\"formInfo\":[16]}]]],[\"limebb-empty-state\",[[1,\"limebb-empty-state\",{\"heading\":[513],\"value\":[513],\"icon\":[16]}]]],[\"limebb-property-selector\",[[1,\"limebb-property-selector\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"value\":[1],\"label\":[1],\"required\":[4],\"helperText\":[1,\"helper-text\"],\"limetypes\":[32],\"isOpen\":[32],\"navigationPath\":[32]}]]],[\"limebb-lime-query-response-format-editor_2\",[[1,\"limebb-lime-query-response-format-editor\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"value\":[16],\"label\":[1],\"items\":[32]}],[1,\"limebb-lime-query-response-format-item\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"item\":[16],\"showAliasInput\":[32],\"showDescriptionInput\":[32]}]]],[\"limebb-navigation-button_2\",[[1,\"limebb-summary-popover\",{\"triggerDelay\":[514,\"trigger-delay\"],\"heading\":[513],\"subheading\":[513],\"image\":[16],\"icon\":[513],\"value\":[1],\"openDirection\":[513,\"open-direction\"],\"popoverMaxWidth\":[513,\"popover-max-width\"],\"popoverMaxHeight\":[513,\"popover-max-height\"],\"actions\":[16],\"isPopoverOpen\":[32]}],[17,\"limebb-navigation-button\",{\"href\":[513],\"tooltipLabel\":[513,\"tooltip-label\"],\"tooltipHelperLabel\":[513,\"tooltip-helper-label\"],\"type\":[513]}]]],[\"limebb-lime-query-filter-group_3\",[[1,\"limebb-lime-query-value-input\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"propertyPath\":[1,\"property-path\"],\"operator\":[1],\"value\":[8],\"label\":[1],\"limetypes\":[32],\"inputMode\":[32]}],[1,\"limebb-lime-query-filter-group\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"expression\":[16],\"value\":[32]}],[1,\"limebb-lime-query-filter-not\",{\"platform\":[16],\"context\":[16],\"label\":[1],\"limetype\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"expression\":[16]}]]],[\"limebb-lime-query-filter-comparison_2\",[[1,\"limebb-lime-query-filter-expression\",{\"platform\":[16],\"context\":[16],\"label\":[1],\"limetype\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"expression\":[16]}],[1,\"limebb-lime-query-filter-comparison\",{\"platform\":[16],\"context\":[16],\"label\":[1],\"limetype\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"expression\":[16]}]]]]"), options);
|
|
20
20
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-96dd111f.js';
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-96dd111f.js';
|
|
2
2
|
import { T as Te } from './index.esm-bb569663.js';
|
|
3
3
|
import { i as isLimeQuerySupported } from './lime-query-validation-573223a5.js';
|
|
4
4
|
import './property-resolution-c21a1369.js';
|
|
5
5
|
|
|
6
|
-
const limeQueryBuilderCss = ":host(limebb-lime-lime-query-builder)
|
|
6
|
+
const limeQueryBuilderCss = "*,*:before,*:after{box-sizing:border-box}:host(limebb-lime-query-builder){--header-background-color:rgb(var(--contrast-400));--limebb-lime-query-builder-background-color:rgb(var(--contrast-100));--limebb-lime-query-builder-border-radius:0.75rem;box-sizing:border-box;width:calc(100% - 1.5rem);margin:0.75rem auto;display:flex;flex-direction:column;border-radius:var(--limebb-lime-query-builder-border-radius);background-color:var(--limebb-lime-query-builder-background-color);box-shadow:var(--shadow-inflated-16)}.gui-mode{padding:1rem;border:1px solid var(--header-background-color);border-radius:0 0 0.754rem 0.75rem}.code-mode{--code-editor-max-height:70vh;display:flex;flex-direction:column;gap:1rem}.code-mode .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-mode .validation-errors strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-mode .validation-errors ul{margin:0;padding-left:1.5rem}.code-mode .validation-errors li{margin:0.25rem 0}.code-mode .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-mode .gui-limitations strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-mode .gui-limitations ul{margin:0;padding-left:1.5rem}.code-mode .gui-limitations li{margin:0.25rem 0}.limetype-section{display:flex;flex-direction:column}.filter-section,.query-options-section{display:flex;flex-direction:column;gap:1rem;padding-top: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}";
|
|
7
7
|
const LimebbLimeQueryBuilderStyle0 = limeQueryBuilderCss;
|
|
8
8
|
|
|
9
9
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -136,11 +136,14 @@ const LimeQueryBuilder = class {
|
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
render() {
|
|
139
|
+
return (h(Host, { key: '02e7367fbc718a8625c8d49d5e546acca0986ce2' }, this.renderHeader(), this.renderContent()));
|
|
140
|
+
}
|
|
141
|
+
renderContent() {
|
|
139
142
|
const guiSupported = this.checkGuiSupport();
|
|
140
143
|
const showCodeMode = !this.guiModeEnabled || this.mode === 'code';
|
|
141
|
-
return
|
|
144
|
+
return showCodeMode
|
|
142
145
|
? this.renderCodeMode(guiSupported)
|
|
143
|
-
: this.renderGuiMode()
|
|
146
|
+
: this.renderGuiMode();
|
|
144
147
|
}
|
|
145
148
|
emitChange() {
|
|
146
149
|
// Only emit in GUI mode
|
|
@@ -234,14 +237,19 @@ const LimeQueryBuilder = class {
|
|
|
234
237
|
renderModeSwitch(support) {
|
|
235
238
|
const guiDisabled = !support.guiSupported;
|
|
236
239
|
const buttons = this.getButtons().map((button) => (Object.assign(Object.assign({}, button), { selected: button.id === this.mode })));
|
|
237
|
-
return (h("limel-button-group", { onChange: this.handleChange, value: buttons, disabled: guiDisabled }));
|
|
240
|
+
return (h("limel-button-group", { slot: "actions", onChange: this.handleChange, value: buttons, disabled: guiDisabled }));
|
|
238
241
|
}
|
|
239
242
|
renderCodeEditor(guiSupported) {
|
|
240
|
-
return
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
!guiSupported.guiSupported &&
|
|
244
|
-
|
|
243
|
+
return [
|
|
244
|
+
h("limel-code-editor", { value: this.codeValue, language: "json", lineNumbers: true, fold: true, lint: true, onChange: this.handleCodeChange }),
|
|
245
|
+
/* Show validation errors (invalid Lime Query) */
|
|
246
|
+
!guiSupported.valid && guiSupported.validationErrors.length > 0 && (h("div", { class: "validation-errors" }, h("strong", null, "Invalid Lime Query:"), h("ul", null, guiSupported.validationErrors.map((error) => (h("li", null, error)))))),
|
|
247
|
+
/* Show GUI limitations (only when GUI mode is enabled and Lime Query is valid) */
|
|
248
|
+
this.guiModeEnabled &&
|
|
249
|
+
guiSupported.valid &&
|
|
250
|
+
!guiSupported.guiSupported &&
|
|
251
|
+
guiSupported.guiLimitations.length > 0 && (h("div", { class: "gui-limitations" }, h("strong", null, "Cannot switch to GUI mode:"), h("ul", null, guiSupported.guiLimitations.map((limitation) => (h("li", null, limitation)))))),
|
|
252
|
+
];
|
|
245
253
|
}
|
|
246
254
|
renderLimetypeSection() {
|
|
247
255
|
return (h("div", { class: "limetype-section" }, h("limebb-limetype-field", { platform: this.platform, context: this.context, label: "Object Type", value: this.limetype, required: true, fieldName: "limetype", helperText: "Select the type of object you want to query", onChange: this.handleLimetypeChange })));
|
|
@@ -268,17 +276,15 @@ const LimeQueryBuilder = class {
|
|
|
268
276
|
renderGuiMode() {
|
|
269
277
|
return (h("div", { class: "gui-mode" }, this.renderLimetypeSection(), this.renderResponseFormatSection(), this.renderFilterSection(), this.renderQueryOptionsSection()));
|
|
270
278
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
}
|
|
275
|
-
return h("h3", { class: "lime-query-builder-label" }, this.label);
|
|
279
|
+
renderHeader() {
|
|
280
|
+
const guiSupported = this.checkGuiSupport();
|
|
281
|
+
return (h("limel-header", { heading: this.label }, this.renderModeControls(guiSupported)));
|
|
276
282
|
}
|
|
277
283
|
renderModeControls(support) {
|
|
278
284
|
if (!this.guiModeEnabled) {
|
|
279
285
|
return;
|
|
280
286
|
}
|
|
281
|
-
return
|
|
287
|
+
return this.renderModeSwitch(support);
|
|
282
288
|
}
|
|
283
289
|
renderCodeMode(support) {
|
|
284
290
|
return h("div", { class: "code-mode" }, this.renderCodeEditor(support));
|
|
@@ -127,7 +127,10 @@ const LimeQueryFilterBuilderComponent = class {
|
|
|
127
127
|
return this.expression.op === Zt.NOT;
|
|
128
128
|
}
|
|
129
129
|
renderEmptyState() {
|
|
130
|
-
return (h("limel-button", { label: "
|
|
130
|
+
return (h("limel-button", { label: "Condition", icon: {
|
|
131
|
+
name: 'plus_math',
|
|
132
|
+
title: 'Add',
|
|
133
|
+
}, onClick: this.handleAddFirstCondition }));
|
|
131
134
|
}
|
|
132
135
|
renderWithPromotionButton() {
|
|
133
136
|
return (h("div", { class: "expression-with-promotion" }, h("limebb-lime-query-filter-expression", { platform: this.platform, context: this.context, limetype: this.limetype, activeLimetype: this.activeLimetype, expression: this.expression, onExpressionChange: this.handleExpressionChange }), h("limel-button", { label: "Add another condition", icon: "plus_math", onClick: this.handlePromoteAndAdd })));
|