@limetech/lime-crm-building-blocks 1.102.2 → 1.102.4
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/limebb-lime-query-builder.cjs.entry.js +37 -26
- package/dist/cjs/limebb-lime-query-filter-builder_3.cjs.entry.js +3 -3
- package/dist/cjs/limebb-lime-query-filter-group_3.cjs.entry.js +26 -2
- package/dist/cjs/limebb-lime-query-order-by-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-lime-query-response-format-builder.cjs.entry.js +23 -3
- package/dist/cjs/limebb-lime-query-response-format-editor_2.cjs.entry.js +28 -6
- package/dist/cjs/limebb-property-selector.cjs.entry.js +11 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-builder.css +8 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.css +2 -1
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.js +26 -1
- package/dist/collection/components/lime-query-builder/lime-query-builder.css +4 -16
- package/dist/collection/components/lime-query-builder/lime-query-builder.js +36 -25
- package/dist/collection/components/lime-query-builder/lime-query-response-format-builder.css +1 -18
- package/dist/collection/components/lime-query-builder/lime-query-response-format-builder.js +22 -2
- package/dist/collection/components/lime-query-builder/order-by/order-by-editor.css +2 -3
- package/dist/collection/components/lime-query-builder/order-by/order-by-editor.js +1 -1
- package/dist/collection/components/lime-query-builder/order-by/order-by-item.css +1 -5
- package/dist/collection/components/lime-query-builder/property-selector/property-selector.js +12 -1
- package/dist/collection/components/lime-query-builder/response-format/response-format-editor.css +13 -17
- package/dist/collection/components/lime-query-builder/response-format/response-format-editor.js +1 -1
- package/dist/collection/components/lime-query-builder/response-format/response-format-item.css +4 -11
- package/dist/collection/components/lime-query-builder/response-format/response-format-item.js +25 -3
- package/dist/components/lime-query-filter-builder.js +1 -1
- package/dist/components/lime-query-filter-expression.js +26 -2
- package/dist/components/limebb-lime-query-builder.js +37 -26
- package/dist/components/limebb-lime-query-response-format-builder.js +23 -3
- package/dist/components/order-by-editor.js +2 -2
- package/dist/components/order-by-item.js +1 -1
- package/dist/components/property-selector.js +12 -1
- package/dist/components/response-format-editor.js +2 -2
- package/dist/components/response-format-item.js +26 -4
- package/dist/esm/limebb-lime-query-builder.entry.js +37 -26
- package/dist/esm/limebb-lime-query-filter-builder_3.entry.js +3 -3
- package/dist/esm/limebb-lime-query-filter-group_3.entry.js +26 -2
- package/dist/esm/limebb-lime-query-order-by-item.entry.js +1 -1
- package/dist/esm/limebb-lime-query-response-format-builder.entry.js +23 -3
- package/dist/esm/limebb-lime-query-response-format-editor_2.entry.js +28 -6
- package/dist/esm/limebb-property-selector.entry.js +12 -1
- package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/p-1f76540e.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-2d5f83bc.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-3384f1ee.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-5c693302.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-8917c472.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-9167bc6c.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-d8696b23.entry.js +1 -0
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-group.d.ts +3 -0
- package/dist/types/components/lime-query-builder/lime-query-builder.d.ts +2 -2
- package/dist/types/components/lime-query-builder/lime-query-response-format-builder.d.ts +1 -0
- package/dist/types/components/lime-query-builder/property-selector/property-selector.d.ts +2 -0
- package/dist/types/components/lime-query-builder/response-format/response-format-item.d.ts +2 -0
- package/package.json +1 -1
- package/dist/lime-crm-building-blocks/p-289ce8b9.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-3351395b.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-33e6d0ec.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-7731e1b0.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-be845252.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-cb338753.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-e5549e10.entry.js +0 -1
|
@@ -51,6 +51,16 @@ export class LimeQueryResponseFormatBuilder {
|
|
|
51
51
|
this.label = 'Response Format';
|
|
52
52
|
this.mode = 'gui';
|
|
53
53
|
this.codeValue = '';
|
|
54
|
+
this.handleModeChange = (event) => {
|
|
55
|
+
event.stopPropagation();
|
|
56
|
+
const mode = event.detail.id;
|
|
57
|
+
if (mode === 'gui') {
|
|
58
|
+
this.switchToGui();
|
|
59
|
+
}
|
|
60
|
+
else if (mode === 'code') {
|
|
61
|
+
this.switchToCode();
|
|
62
|
+
}
|
|
63
|
+
};
|
|
54
64
|
/**
|
|
55
65
|
* Switch from code mode to GUI mode
|
|
56
66
|
*/
|
|
@@ -140,11 +150,21 @@ export class LimeQueryResponseFormatBuilder {
|
|
|
140
150
|
}
|
|
141
151
|
render() {
|
|
142
152
|
const guiSupported = this.checkGuiSupport();
|
|
143
|
-
return (h("div", { key: '
|
|
153
|
+
return (h("div", { key: '8b4116d9e6f1653ec429995647481b1df3df2712', class: "response-format-builder" }, this.label && h("h3", { key: 'd5e532a64f4e735b67b0533b4896165f7862561e', class: "builder-label" }, this.label), this.guiModeEnabled && (h("div", { key: '42af934f90de83855ff81306fe0bdb10c45fa808', class: "mode-controls" }, this.renderModeSwitch(guiSupported))), !this.guiModeEnabled || this.mode === 'code' ? (h("div", { class: "code-mode" }, this.renderCodeEditor(guiSupported))) : (h("div", { class: "gui-mode" }, this.renderGuiMode()))));
|
|
144
154
|
}
|
|
145
155
|
renderModeSwitch(support) {
|
|
146
156
|
const guiDisabled = !support.guiSupported;
|
|
147
|
-
|
|
157
|
+
const buttons = [
|
|
158
|
+
{
|
|
159
|
+
id: 'gui',
|
|
160
|
+
title: 'Visual',
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
id: 'code',
|
|
164
|
+
title: 'Code',
|
|
165
|
+
},
|
|
166
|
+
].map((button) => (Object.assign(Object.assign({}, button), { selected: button.id === this.mode })));
|
|
167
|
+
return (h("limel-button-group", { value: buttons, disabled: guiDisabled, onChange: this.handleModeChange }));
|
|
148
168
|
}
|
|
149
169
|
renderCodeEditor(support) {
|
|
150
170
|
return (h("div", { class: "code-editor-container" }, h("limel-code-editor", { value: this.codeValue, language: "json", lineNumbers: true, fold: true, lint: true, onChange: this.handleCodeChange }), !support.valid && support.validationErrors.length > 0 && (h("div", { class: "validation-errors" }, h("strong", null, "Invalid Response Format:"), h("ul", null, support.validationErrors.map((error) => (h("li", null, error)))))), this.guiModeEnabled &&
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-direction: column;
|
|
9
9
|
gap: 1rem;
|
|
10
|
-
padding: 1rem;
|
|
10
|
+
padding: 1rem 0;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.header {
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
display: flex;
|
|
28
28
|
flex-direction: column;
|
|
29
29
|
gap: 1rem;
|
|
30
|
-
padding: 0.5rem;
|
|
31
30
|
border: 1px solid rgb(var(--contrast-300));
|
|
32
31
|
border-radius: 0.25rem;
|
|
33
32
|
background-color: rgb(var(--contrast-50));
|
|
@@ -45,7 +44,7 @@
|
|
|
45
44
|
|
|
46
45
|
.actions {
|
|
47
46
|
display: flex;
|
|
48
|
-
|
|
47
|
+
width: 100%;
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
.summary {
|
|
@@ -81,7 +81,7 @@ export class OrderByEditor {
|
|
|
81
81
|
return (h("div", { class: "order-by-list" }, this.items.map((item, index) => this.renderItem(item, index))));
|
|
82
82
|
}
|
|
83
83
|
renderActions() {
|
|
84
|
-
return (h("
|
|
84
|
+
return (h("limel-button", { label: "Add Sort Field", icon: "plus_math", onClick: this.handleAddSortField }));
|
|
85
85
|
}
|
|
86
86
|
renderItem(item, index) {
|
|
87
87
|
const propertyPath = Object.keys(item)[0] || '';
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
.property-path {
|
|
17
17
|
flex-grow: 1;
|
|
18
|
-
min-width: min(
|
|
18
|
+
min-width: min(10rem, 100%);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
.control-buttons {
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
flex-direction: row;
|
|
25
25
|
gap: 0.25rem;
|
|
26
26
|
align-items: center;
|
|
27
|
-
padding-top: 0.5rem;
|
|
28
27
|
}
|
|
29
28
|
.control-buttons limel-icon-button {
|
|
30
29
|
opacity: 0.6;
|
|
@@ -39,7 +38,4 @@
|
|
|
39
38
|
flex-direction: column;
|
|
40
39
|
gap: 0.5rem;
|
|
41
40
|
}
|
|
42
|
-
.control-buttons {
|
|
43
|
-
padding-top: 0;
|
|
44
|
-
}
|
|
45
41
|
}
|
package/dist/collection/components/lime-query-builder/property-selector/property-selector.js
CHANGED
|
@@ -9,7 +9,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
9
9
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10
10
|
};
|
|
11
11
|
import { h } from "@stencil/core";
|
|
12
|
-
import { SelectLimeTypes as Limetypes, } from "@limetech/lime-web-components";
|
|
12
|
+
import { PlatformServiceName, SelectLimeTypes as Limetypes, } from "@limetech/lime-web-components";
|
|
13
13
|
import { getPropertyFromPath, getNormalizedProperties, } from "../property-resolution";
|
|
14
14
|
import { getIcon } from "../../../util/limetype";
|
|
15
15
|
/**
|
|
@@ -114,6 +114,15 @@ export class PropertySelector {
|
|
|
114
114
|
}
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
|
+
componentWillLoad() {
|
|
118
|
+
const language = this.platform
|
|
119
|
+
.get(PlatformServiceName.Application)
|
|
120
|
+
.getLanguage();
|
|
121
|
+
this.collator = new Intl.Collator(language, {
|
|
122
|
+
numeric: true,
|
|
123
|
+
sensitivity: 'base',
|
|
124
|
+
});
|
|
125
|
+
}
|
|
117
126
|
render() {
|
|
118
127
|
if (!this.limetype || !this.limetypes) {
|
|
119
128
|
return null;
|
|
@@ -173,6 +182,8 @@ export class PropertySelector {
|
|
|
173
182
|
items: items,
|
|
174
183
|
});
|
|
175
184
|
}
|
|
185
|
+
// Sort properties alphabetically by display text
|
|
186
|
+
results.sort((a, b) => { var _a, _b; return this.collator.compare((_a = a.text) !== null && _a !== void 0 ? _a : '', (_b = b.text) !== null && _b !== void 0 ? _b : ''); });
|
|
176
187
|
if (results.length === 0) {
|
|
177
188
|
return [
|
|
178
189
|
{
|
package/dist/collection/components/lime-query-builder/response-format/response-format-editor.css
CHANGED
|
@@ -6,36 +6,31 @@
|
|
|
6
6
|
.response-format-editor {
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-direction: column;
|
|
9
|
-
gap:
|
|
10
|
-
padding: 1rem;
|
|
9
|
+
gap: 0.5rem;
|
|
10
|
+
padding: 1rem 0;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.header {
|
|
14
|
-
display: flex;
|
|
15
|
-
justify-content: space-between;
|
|
16
|
-
align-items: center;
|
|
17
|
-
gap: 1rem;
|
|
18
|
-
}
|
|
19
|
-
.header h4 {
|
|
20
14
|
margin: 0;
|
|
21
15
|
font-size: 1rem;
|
|
22
16
|
font-weight: 600;
|
|
23
17
|
color: rgb(var(--contrast-1000));
|
|
24
18
|
}
|
|
25
19
|
|
|
20
|
+
.property {
|
|
21
|
+
border: 1px solid rgb(var(--contrast-500));
|
|
22
|
+
}
|
|
23
|
+
|
|
26
24
|
.property-list {
|
|
27
25
|
display: flex;
|
|
28
26
|
flex-direction: column;
|
|
29
|
-
gap: 1rem;
|
|
30
|
-
padding: 0.5rem;
|
|
31
|
-
border: 1px solid rgb(var(--contrast-300));
|
|
32
27
|
border-radius: 0.25rem;
|
|
33
|
-
background-color: rgb(var(--contrast-
|
|
34
|
-
|
|
28
|
+
background-color: rgb(var(--contrast-100));
|
|
29
|
+
gap: 0.5rem;
|
|
30
|
+
padding: 0.5rem;
|
|
35
31
|
}
|
|
36
32
|
|
|
37
33
|
.property-item {
|
|
38
|
-
padding: 0.5rem;
|
|
39
34
|
border-radius: 0.25rem;
|
|
40
35
|
transition: background-color 0.2s;
|
|
41
36
|
}
|
|
@@ -45,15 +40,16 @@
|
|
|
45
40
|
|
|
46
41
|
.actions {
|
|
47
42
|
display: flex;
|
|
48
|
-
|
|
43
|
+
}
|
|
44
|
+
.actions limel-button {
|
|
45
|
+
padding: 0.5rem;
|
|
46
|
+
width: 100%;
|
|
49
47
|
}
|
|
50
48
|
|
|
51
49
|
.summary {
|
|
52
50
|
display: flex;
|
|
53
51
|
justify-content: space-between;
|
|
54
52
|
align-items: center;
|
|
55
|
-
padding-top: 0.5rem;
|
|
56
|
-
border-top: 1px solid rgb(var(--contrast-300));
|
|
57
53
|
}
|
|
58
54
|
.summary .count {
|
|
59
55
|
font-size: 0.875rem;
|
package/dist/collection/components/lime-query-builder/response-format/response-format-editor.js
CHANGED
|
@@ -81,7 +81,7 @@ export class ResponseFormatEditor {
|
|
|
81
81
|
if (!this.limetype) {
|
|
82
82
|
return (h("div", { class: "empty-state" }, h("p", null, "Select a limetype to choose properties")));
|
|
83
83
|
}
|
|
84
|
-
return (h("div", { class: "response-format-editor" }, h("
|
|
84
|
+
return (h("div", { class: "response-format-editor" }, h("h4", { class: "header" }, this.label), h("div", { class: "summary" }, h("span", { class: "count" }, "(", this.items.length, ' ', this.items.length === 1 ? 'property' : 'properties', ' ', "selected)")), 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: "Add Property", icon: "plus_math", onClick: this.handleAddProperty })))));
|
|
85
85
|
}
|
|
86
86
|
renderItem(item, index) {
|
|
87
87
|
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) }));
|
package/dist/collection/components/lime-query-builder/response-format/response-format-item.css
CHANGED
|
@@ -2,20 +2,18 @@
|
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 0.5rem;
|
|
5
|
-
width: 100%;
|
|
6
5
|
}
|
|
7
6
|
|
|
8
7
|
.property-controls {
|
|
9
8
|
display: flex;
|
|
10
|
-
flex-
|
|
11
|
-
align-items: flex-start;
|
|
9
|
+
flex-wrap: wrap;
|
|
12
10
|
gap: 0.5rem;
|
|
13
11
|
width: 100%;
|
|
14
12
|
}
|
|
15
13
|
|
|
16
14
|
.property-path {
|
|
17
15
|
flex-grow: 1;
|
|
18
|
-
min-width: min(
|
|
16
|
+
min-width: min(10rem, 100%);
|
|
19
17
|
}
|
|
20
18
|
|
|
21
19
|
.control-buttons {
|
|
@@ -24,7 +22,6 @@
|
|
|
24
22
|
flex-direction: row;
|
|
25
23
|
gap: 0.25rem;
|
|
26
24
|
align-items: center;
|
|
27
|
-
padding-top: 0.5rem;
|
|
28
25
|
}
|
|
29
26
|
.control-buttons limel-icon-button {
|
|
30
27
|
opacity: 0.6;
|
|
@@ -40,9 +37,8 @@
|
|
|
40
37
|
|
|
41
38
|
.alias,
|
|
42
39
|
.description {
|
|
43
|
-
padding-left:
|
|
44
|
-
width: calc(100% -
|
|
45
|
-
max-width: 40rem;
|
|
40
|
+
padding-left: 1rem;
|
|
41
|
+
width: calc(100% - 8.75rem);
|
|
46
42
|
}
|
|
47
43
|
|
|
48
44
|
@media (max-width: 768px) {
|
|
@@ -50,9 +46,6 @@
|
|
|
50
46
|
flex-direction: column;
|
|
51
47
|
gap: 0.5rem;
|
|
52
48
|
}
|
|
53
|
-
.control-buttons {
|
|
54
|
-
padding-top: 0;
|
|
55
|
-
}
|
|
56
49
|
.alias,
|
|
57
50
|
.description {
|
|
58
51
|
padding-left: 0;
|
package/dist/collection/components/lime-query-builder/response-format/response-format-item.js
CHANGED
|
@@ -66,11 +66,33 @@ export class ResponseFormatItem {
|
|
|
66
66
|
}
|
|
67
67
|
render() {
|
|
68
68
|
return [
|
|
69
|
-
h("div", { key: 'e804c4feb61b44aeb2f141c5b5d3269a76ac9320', class: "property-controls" }, h("div", { key: 'becbf35e823b8b16df5366c099b98ce6566d514a', class: "property-path" }, h("limebb-property-selector", { key: '2b35ccefecb9dbd4d2c418566482d9903a1c0d02', platform: this.platform, context: this.context, limetype: this.limetype, label: "Property", value: this.item.path, required: true, onChange: this.handlePathChange })), h("div", { key: '1e598bbbb6df1c5e93bd4ae5f6b112a745a68df9', class: "control-buttons" }, h("limel-icon-button", { key: '
|
|
70
|
-
this.showAliasInput && (h("div", { key: '
|
|
71
|
-
this.showDescriptionInput && (h("div", { key: '
|
|
69
|
+
h("div", { key: 'e804c4feb61b44aeb2f141c5b5d3269a76ac9320', class: "property-controls" }, h("div", { key: 'becbf35e823b8b16df5366c099b98ce6566d514a', class: "property-path" }, h("limebb-property-selector", { key: '2b35ccefecb9dbd4d2c418566482d9903a1c0d02', platform: this.platform, context: this.context, limetype: this.limetype, label: "Property", value: this.item.path, required: true, onChange: this.handlePathChange })), h("div", { key: '1e598bbbb6df1c5e93bd4ae5f6b112a745a68df9', class: "control-buttons" }, h("limel-icon-button", { key: '51d3dfaa9f3578802abf6f65ec876535740ae6a5', icon: this.getAliasIcon(), label: "Add alias", class: this.item.alias ? 'has-value' : '', onClick: this.toggleAliasInput }), h("limel-icon-button", { key: 'b2f6050b01d810cc20093e87a09452c625cd7847', icon: this.getDescriptionIcon(), label: "Add description", class: this.item.description ? 'has-value' : '', onClick: this.toggleDescriptionInput }), h("limel-icon-button", { key: 'cd58b575c383555db343ebe4a22392c51346751e', icon: "trash", label: "Remove property", onClick: this.handleRemove }))),
|
|
70
|
+
this.showAliasInput && (h("div", { key: 'cd95aa0e34945eb9da88e4be4e4c2326c41ec090', class: "alias" }, h("limel-input-field", { key: 'f62646327adfb8fcd3f0f2aa3a5325ad8a3bfcc3', label: "Alias", value: this.item.alias || '', placeholder: "Custom property name...", onChange: this.handleAliasChange, onBlur: this.handleAliasBlur }))),
|
|
71
|
+
this.showDescriptionInput && (h("div", { key: 'b00f9859a80df3aacf3f524fc1451473e5fcdf5a', class: "description" }, h("limel-input-field", { key: '044485f6a35f84816e7458a08882a40aaeacf2f4', label: "Description", value: this.item.description || '', placeholder: "Describe this property for AI...", onChange: this.handleDescriptionChange, onBlur: this.handleDescriptionBlur }))),
|
|
72
72
|
];
|
|
73
73
|
}
|
|
74
|
+
getAliasIcon() {
|
|
75
|
+
const defaultIcon = {
|
|
76
|
+
name: 'add_tag',
|
|
77
|
+
color: 'rgb(var(--color-gray-600))',
|
|
78
|
+
};
|
|
79
|
+
const toggledIcon = {
|
|
80
|
+
name: 'add_tag',
|
|
81
|
+
color: 'rgb(var(--color-teal-default))',
|
|
82
|
+
};
|
|
83
|
+
return this.showAliasInput ? toggledIcon : defaultIcon;
|
|
84
|
+
}
|
|
85
|
+
getDescriptionIcon() {
|
|
86
|
+
const defaultIcon = {
|
|
87
|
+
name: 'comments',
|
|
88
|
+
color: 'rgb(var(--color-gray-600))',
|
|
89
|
+
};
|
|
90
|
+
const toggledIcon = {
|
|
91
|
+
name: 'comments',
|
|
92
|
+
color: 'rgb(var(--color-teal-default))',
|
|
93
|
+
};
|
|
94
|
+
return this.showDescriptionInput ? toggledIcon : defaultIcon;
|
|
95
|
+
}
|
|
74
96
|
static get is() { return "limebb-lime-query-response-format-item"; }
|
|
75
97
|
static get encapsulation() { return "shadow"; }
|
|
76
98
|
static get originalStyleUrls() {
|
|
@@ -5,7 +5,7 @@ import { d as defineCustomElement$3, a as defineCustomElement$4, b as defineCust
|
|
|
5
5
|
import { d as defineCustomElement$2 } from './lime-query-value-input.js';
|
|
6
6
|
import { d as defineCustomElement$1 } from './property-selector.js';
|
|
7
7
|
|
|
8
|
-
const limeQueryFilterBuilderCss = ".expression-with-promotion{display:flex;flex-direction:column;gap:1rem}";
|
|
8
|
+
const limeQueryFilterBuilderCss = ".expression-with-promotion{display:flex;flex-direction:column;gap:1rem}limel-button{width:100%}.query-options-section{margin-top:1rem}";
|
|
9
9
|
const LimebbLimeQueryFilterBuilderStyle0 = limeQueryFilterBuilderCss;
|
|
10
10
|
|
|
11
11
|
const LimeQueryFilterBuilderComponent = /*@__PURE__*/ proxyCustomElement(class LimeQueryFilterBuilderComponent extends HTMLElement {
|
|
@@ -223,7 +223,7 @@ function defineCustomElement$2() {
|
|
|
223
223
|
} });
|
|
224
224
|
}
|
|
225
225
|
|
|
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 .clickable-header{cursor:pointer;user-select:none}.expression .clickable-header:hover{background-color:rgb(var(--contrast-200))}.expression>ul{margin-top:0;margin-right:1rem;margin-bottom:1rem;
|
|
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 .clickable-header{cursor:pointer;user-select:none}.expression .clickable-header:hover{background-color:rgb(var(--contrast-200))}.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
227
|
const LimebbLimeQueryFilterGroupStyle0 = limeQueryFilterGroupCss;
|
|
228
228
|
|
|
229
229
|
const LimeQueryFilterGroupComponent = /*@__PURE__*/ proxyCustomElement(class LimeQueryFilterGroupComponent extends HTMLElement {
|
|
@@ -232,6 +232,9 @@ const LimeQueryFilterGroupComponent = /*@__PURE__*/ proxyCustomElement(class Lim
|
|
|
232
232
|
this.__registerHost();
|
|
233
233
|
this.__attachShadow();
|
|
234
234
|
this.expressionChange = createEvent(this, "expressionChange", 7);
|
|
235
|
+
this.renderActionButton = (action) => {
|
|
236
|
+
return (h("limel-icon-button", { class: "action-icon", elevated: true, icon: action.icon, label: action.label, onClick: this.handleToggleOperator }));
|
|
237
|
+
};
|
|
235
238
|
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) })));
|
|
236
239
|
this.handleToggleOperator = () => {
|
|
237
240
|
const newGroup = toggleGroupOperator(this.expression);
|
|
@@ -256,7 +259,28 @@ const LimeQueryFilterGroupComponent = /*@__PURE__*/ proxyCustomElement(class Lim
|
|
|
256
259
|
}
|
|
257
260
|
render() {
|
|
258
261
|
const subheading = this.getSubheading();
|
|
259
|
-
return (h("div", { key: '
|
|
262
|
+
return (h("div", { key: 'b7972fb9e34b8b0b57ae82b3bf4de3e55b66169f', class: "expression" }, subheading && (h("limel-header", { key: '9721388fa6a60018f95dbe27b2959dcc1c11211e', icon: {
|
|
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
|
+
];
|
|
281
|
+
}
|
|
282
|
+
renderActions() {
|
|
283
|
+
return (h("div", { class: "actions" }, this.actions.map(this.renderActionButton)));
|
|
260
284
|
}
|
|
261
285
|
getSubheading() {
|
|
262
286
|
return getFilterGroupSubheading(this.expression.op, this.expression.exp.length);
|
|
@@ -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){display:block;width:100%}.lime-query-builder{display:flex;flex-direction:column;gap:
|
|
15
|
+
const limeQueryBuilderCss = ":host(limebb-lime-lime-query-builder){display:block;width:100%}.lime-query-builder{display:flex;flex-direction:column;gap:1rem;padding:1rem}.mode-controls{display:flex;justify-content:flex-end;padding:0.5rem}.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;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}@media (max-width: 768px){.lime-query-builder{gap:1.5rem}}";
|
|
16
16
|
const LimebbLimeQueryBuilderStyle0 = limeQueryBuilderCss;
|
|
17
17
|
|
|
18
18
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -69,33 +69,33 @@ const LimeQueryBuilder = /*@__PURE__*/ proxyCustomElement(class LimeQueryBuilder
|
|
|
69
69
|
this.orderBy = event.detail;
|
|
70
70
|
this.emitChange();
|
|
71
71
|
};
|
|
72
|
-
this.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
72
|
+
this.handleChange = (event) => {
|
|
73
|
+
event.stopPropagation();
|
|
74
|
+
const mode = event.detail.id;
|
|
75
|
+
if (mode === 'gui') {
|
|
76
|
+
try {
|
|
77
|
+
const parsed = JSON.parse(this.codeValue);
|
|
78
|
+
const support = this.checkGuiSupport();
|
|
79
|
+
if (!support.guiSupported) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
this.limetype = parsed.limetype || '';
|
|
83
|
+
this.filter = parsed.filter;
|
|
84
|
+
this.internalResponseFormat = parsed.responseFormat;
|
|
85
|
+
this.limit = parsed.limit;
|
|
86
|
+
this.orderBy = parsed.orderBy;
|
|
87
|
+
this.mode = 'gui';
|
|
88
|
+
this.change.emit(parsed);
|
|
89
|
+
}
|
|
90
|
+
catch (_a) {
|
|
91
|
+
// Don't switch if JSON is invalid
|
|
81
92
|
}
|
|
82
|
-
// Update internal state from parsed query
|
|
83
|
-
this.limetype = parsed.limetype || '';
|
|
84
|
-
this.filter = parsed.filter;
|
|
85
|
-
this.internalResponseFormat = parsed.responseFormat;
|
|
86
|
-
this.limit = parsed.limit;
|
|
87
|
-
this.orderBy = parsed.orderBy;
|
|
88
|
-
this.mode = 'gui';
|
|
89
|
-
this.change.emit(parsed);
|
|
90
93
|
}
|
|
91
|
-
|
|
92
|
-
|
|
94
|
+
else if (mode === 'code') {
|
|
95
|
+
this.updateCodeValue();
|
|
96
|
+
this.mode = 'code';
|
|
93
97
|
}
|
|
94
98
|
};
|
|
95
|
-
this.switchToCode = () => {
|
|
96
|
-
this.updateCodeValue();
|
|
97
|
-
this.mode = 'code';
|
|
98
|
-
};
|
|
99
99
|
this.handleCodeChange = (event) => {
|
|
100
100
|
event.stopPropagation();
|
|
101
101
|
this.codeValue = event.detail;
|
|
@@ -109,6 +109,16 @@ const LimeQueryBuilder = /*@__PURE__*/ proxyCustomElement(class LimeQueryBuilder
|
|
|
109
109
|
}
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
|
+
// Buttons are generated dynamically in renderModeSwitch to allow disabling
|
|
113
|
+
getButtons() {
|
|
114
|
+
return [
|
|
115
|
+
{
|
|
116
|
+
id: 'gui',
|
|
117
|
+
title: 'Visual',
|
|
118
|
+
},
|
|
119
|
+
{ id: 'code', title: 'Code' },
|
|
120
|
+
];
|
|
121
|
+
}
|
|
112
122
|
get guiModeEnabled() {
|
|
113
123
|
var _a, _b, _c;
|
|
114
124
|
return ((_c = (_b = (_a = this.platform) === null || _a === void 0 ? void 0 : _a.isFeatureEnabled) === null || _b === void 0 ? void 0 : _b.call(_a, 'useLimeQueryBuilderGuiMode')) !== null && _c !== void 0 ? _c : false);
|
|
@@ -139,7 +149,7 @@ const LimeQueryBuilder = /*@__PURE__*/ proxyCustomElement(class LimeQueryBuilder
|
|
|
139
149
|
render() {
|
|
140
150
|
const guiSupported = this.checkGuiSupport();
|
|
141
151
|
const showCodeMode = !this.guiModeEnabled || this.mode === 'code';
|
|
142
|
-
return (h("div", { key: '
|
|
152
|
+
return (h("div", { key: '5e9c8bb860cf348b08272831bc2e252752fad24d', class: "lime-query-builder" }, this.renderLabel(), this.renderModeControls(guiSupported), showCodeMode
|
|
143
153
|
? this.renderCodeMode(guiSupported)
|
|
144
154
|
: this.renderGuiMode()));
|
|
145
155
|
}
|
|
@@ -234,7 +244,8 @@ const LimeQueryBuilder = /*@__PURE__*/ proxyCustomElement(class LimeQueryBuilder
|
|
|
234
244
|
}
|
|
235
245
|
renderModeSwitch(support) {
|
|
236
246
|
const guiDisabled = !support.guiSupported;
|
|
237
|
-
|
|
247
|
+
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 }));
|
|
238
249
|
}
|
|
239
250
|
renderCodeEditor(guiSupported) {
|
|
240
251
|
return (h("div", { class: "code-editor-container" }, h("limel-code-editor", { value: this.codeValue, language: "json", lineNumbers: true, fold: true, lint: true, onChange: this.handleCodeChange }), !guiSupported.valid &&
|
|
@@ -66,7 +66,7 @@ function getDefaultResponseFormat() {
|
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
const limeQueryResponseFormatBuilderCss = ":host(limebb-lime-query-response-format-builder){display:block;width:100%}.response-format-builder{display:flex;flex-direction:column
|
|
69
|
+
const limeQueryResponseFormatBuilderCss = ":host(limebb-lime-query-response-format-builder){display:block;width:100%}.response-format-builder{display:flex;flex-direction:column}.builder-label{margin:0;font-size:1.25rem;font-weight:600;color:rgb(var(--contrast-1100))}.mode-controls{display:flex;justify-content:flex-end;padding:0.5rem}.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}";
|
|
70
70
|
const LimebbLimeQueryResponseFormatBuilderStyle0 = limeQueryResponseFormatBuilderCss;
|
|
71
71
|
|
|
72
72
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -91,6 +91,16 @@ const LimeQueryResponseFormatBuilder = /*@__PURE__*/ proxyCustomElement(class Li
|
|
|
91
91
|
this.label = 'Response Format';
|
|
92
92
|
this.mode = 'gui';
|
|
93
93
|
this.codeValue = '';
|
|
94
|
+
this.handleModeChange = (event) => {
|
|
95
|
+
event.stopPropagation();
|
|
96
|
+
const mode = event.detail.id;
|
|
97
|
+
if (mode === 'gui') {
|
|
98
|
+
this.switchToGui();
|
|
99
|
+
}
|
|
100
|
+
else if (mode === 'code') {
|
|
101
|
+
this.switchToCode();
|
|
102
|
+
}
|
|
103
|
+
};
|
|
94
104
|
/**
|
|
95
105
|
* Switch from code mode to GUI mode
|
|
96
106
|
*/
|
|
@@ -180,11 +190,21 @@ const LimeQueryResponseFormatBuilder = /*@__PURE__*/ proxyCustomElement(class Li
|
|
|
180
190
|
}
|
|
181
191
|
render() {
|
|
182
192
|
const guiSupported = this.checkGuiSupport();
|
|
183
|
-
return (h("div", { key: '
|
|
193
|
+
return (h("div", { key: '8b4116d9e6f1653ec429995647481b1df3df2712', class: "response-format-builder" }, this.label && h("h3", { key: 'd5e532a64f4e735b67b0533b4896165f7862561e', class: "builder-label" }, this.label), this.guiModeEnabled && (h("div", { key: '42af934f90de83855ff81306fe0bdb10c45fa808', class: "mode-controls" }, this.renderModeSwitch(guiSupported))), !this.guiModeEnabled || this.mode === 'code' ? (h("div", { class: "code-mode" }, this.renderCodeEditor(guiSupported))) : (h("div", { class: "gui-mode" }, this.renderGuiMode()))));
|
|
184
194
|
}
|
|
185
195
|
renderModeSwitch(support) {
|
|
186
196
|
const guiDisabled = !support.guiSupported;
|
|
187
|
-
|
|
197
|
+
const buttons = [
|
|
198
|
+
{
|
|
199
|
+
id: 'gui',
|
|
200
|
+
title: 'Visual',
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
id: 'code',
|
|
204
|
+
title: 'Code',
|
|
205
|
+
},
|
|
206
|
+
].map((button) => (Object.assign(Object.assign({}, button), { selected: button.id === this.mode })));
|
|
207
|
+
return (h("limel-button-group", { value: buttons, disabled: guiDisabled, onChange: this.handleModeChange }));
|
|
188
208
|
}
|
|
189
209
|
renderCodeEditor(support) {
|
|
190
210
|
return (h("div", { class: "code-editor-container" }, h("limel-code-editor", { value: this.codeValue, language: "json", lineNumbers: true, fold: true, lint: true, onChange: this.handleCodeChange }), !support.valid && support.validationErrors.length > 0 && (h("div", { class: "validation-errors" }, h("strong", null, "Invalid Response Format:"), h("ul", null, support.validationErrors.map((error) => (h("li", null, error)))))), this.guiModeEnabled &&
|
|
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/i
|
|
|
2
2
|
import { d as defineCustomElement$2 } from './order-by-item.js';
|
|
3
3
|
import { d as defineCustomElement$1 } from './property-selector.js';
|
|
4
4
|
|
|
5
|
-
const orderByEditorCss = ":host(limebb-lime-query-order-by-editor){display:block;width:100%}.order-by-editor{display:flex;flex-direction:column;gap:1rem;padding:1rem}.header{display:flex;justify-content:space-between;align-items:center;gap:1rem}.header h4{margin:0;font-size:1rem;font-weight:600;color:rgb(var(--contrast-1000))}.order-by-list{display:flex;flex-direction:column;gap:1rem;
|
|
5
|
+
const orderByEditorCss = ":host(limebb-lime-query-order-by-editor){display:block;width:100%}.order-by-editor{display:flex;flex-direction:column;gap:1rem;padding:1rem 0}.header{display:flex;justify-content:space-between;align-items:center;gap:1rem}.header h4{margin:0;font-size:1rem;font-weight:600;color:rgb(var(--contrast-1000))}.order-by-list{display:flex;flex-direction:column;gap:1rem;border:1px solid rgb(var(--contrast-300));border-radius:0.25rem;background-color:rgb(var(--contrast-50));min-height:4rem}.order-by-item{padding:0.5rem;border-radius:0.25rem;transition:background-color 0.2s}.order-by-item:hover{background-color:rgb(var(--contrast-100))}.actions{display:flex;width:100%}.summary{display:flex;justify-content:space-between;align-items:center;padding-top:0.5rem;border-top:1px solid rgb(var(--contrast-300))}.summary .count{font-size:0.875rem;font-weight:500;color:rgb(var(--contrast-900))}.empty-state{padding:2rem;text-align:center;color:rgb(var(--contrast-700));font-style:italic}.empty-state p{margin:0}";
|
|
6
6
|
const LimebbLimeQueryOrderByEditorStyle0 = orderByEditorCss;
|
|
7
7
|
|
|
8
8
|
const OrderByEditor = /*@__PURE__*/ proxyCustomElement(class OrderByEditor extends HTMLElement {
|
|
@@ -73,7 +73,7 @@ const OrderByEditor = /*@__PURE__*/ proxyCustomElement(class OrderByEditor exten
|
|
|
73
73
|
return (h("div", { class: "order-by-list" }, this.items.map((item, index) => this.renderItem(item, index))));
|
|
74
74
|
}
|
|
75
75
|
renderActions() {
|
|
76
|
-
return (h("
|
|
76
|
+
return (h("limel-button", { label: "Add Sort Field", icon: "plus_math", onClick: this.handleAddSortField }));
|
|
77
77
|
}
|
|
78
78
|
renderItem(item, index) {
|
|
79
79
|
const propertyPath = Object.keys(item)[0] || '';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { d as defineCustomElement$1 } from './property-selector.js';
|
|
3
3
|
|
|
4
|
-
const orderByItemCss = ":host(limebb-lime-query-order-by-item){display:flex;flex-direction:column;gap:0.5rem;width:100%}.order-by-controls{display:flex;flex-direction:row;align-items:flex-start;gap:0.5rem;width:100%}.property-path{flex-grow:1;min-width:min(
|
|
4
|
+
const orderByItemCss = ":host(limebb-lime-query-order-by-item){display:flex;flex-direction:column;gap:0.5rem;width:100%}.order-by-controls{display:flex;flex-direction:row;align-items:flex-start;gap:0.5rem;width:100%}.property-path{flex-grow:1;min-width:min(10rem, 100%)}.control-buttons{flex-shrink:0;display:flex;flex-direction:row;gap:0.25rem;align-items:center}.control-buttons limel-icon-button{opacity:0.6;transition:opacity 0.2s ease}.control-buttons limel-icon-button:hover{opacity:1}@media (max-width: 768px){.order-by-controls{flex-direction:column;gap:0.5rem}}";
|
|
5
5
|
const LimebbLimeQueryOrderByItemStyle0 = orderByItemCss;
|
|
6
6
|
|
|
7
7
|
const OrderByItemComponent = /*@__PURE__*/ proxyCustomElement(class OrderByItemComponent extends HTMLElement {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { T as Te } from './index.esm.js';
|
|
2
|
+
import { T as Te, c } from './index.esm.js';
|
|
3
3
|
import { g as getIcon } from './limetype.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -166,6 +166,15 @@ const PropertySelector = /*@__PURE__*/ proxyCustomElement(class PropertySelector
|
|
|
166
166
|
}
|
|
167
167
|
};
|
|
168
168
|
}
|
|
169
|
+
componentWillLoad() {
|
|
170
|
+
const language = this.platform
|
|
171
|
+
.get(c.Application)
|
|
172
|
+
.getLanguage();
|
|
173
|
+
this.collator = new Intl.Collator(language, {
|
|
174
|
+
numeric: true,
|
|
175
|
+
sensitivity: 'base',
|
|
176
|
+
});
|
|
177
|
+
}
|
|
169
178
|
render() {
|
|
170
179
|
if (!this.limetype || !this.limetypes) {
|
|
171
180
|
return null;
|
|
@@ -225,6 +234,8 @@ const PropertySelector = /*@__PURE__*/ proxyCustomElement(class PropertySelector
|
|
|
225
234
|
items: items,
|
|
226
235
|
});
|
|
227
236
|
}
|
|
237
|
+
// Sort properties alphabetically by display text
|
|
238
|
+
results.sort((a, b) => { var _a, _b; return this.collator.compare((_a = a.text) !== null && _a !== void 0 ? _a : '', (_b = b.text) !== null && _b !== void 0 ? _b : ''); });
|
|
228
239
|
if (results.length === 0) {
|
|
229
240
|
return [
|
|
230
241
|
{
|
|
@@ -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;gap:
|
|
164
|
+
const responseFormatEditorCss = ":host(limebb-lime-query-response-format-editor){display:block;width:100%}.response-format-editor{display:flex;flex-direction:column;gap:0.5rem;padding:1rem 0}.header{margin:0;font-size:1rem;font-weight:600;color:rgb(var(--contrast-1000))}.property{border:1px solid rgb(var(--contrast-500))}.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%}.summary{display:flex;justify-content:space-between;align-items:center}.summary .count{font-size:0.875rem;font-weight:500;color:rgb(var(--contrast-900))}.empty-state{padding:2rem;text-align:center;color:rgb(var(--contrast-700));font-style:italic}.empty-state p{margin:0}";
|
|
165
165
|
const LimebbLimeQueryResponseFormatEditorStyle0 = responseFormatEditorCss;
|
|
166
166
|
|
|
167
167
|
const ResponseFormatEditor = /*@__PURE__*/ proxyCustomElement(class ResponseFormatEditor extends HTMLElement {
|
|
@@ -230,7 +230,7 @@ const ResponseFormatEditor = /*@__PURE__*/ proxyCustomElement(class ResponseForm
|
|
|
230
230
|
if (!this.limetype) {
|
|
231
231
|
return (h("div", { class: "empty-state" }, h("p", null, "Select a limetype to choose properties")));
|
|
232
232
|
}
|
|
233
|
-
return (h("div", { class: "response-format-editor" }, h("
|
|
233
|
+
return (h("div", { class: "response-format-editor" }, h("h4", { class: "header" }, this.label), h("div", { class: "summary" }, h("span", { class: "count" }, "(", this.items.length, ' ', this.items.length === 1 ? 'property' : 'properties', ' ', "selected)")), 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: "Add Property", icon: "plus_math", onClick: this.handleAddProperty })))));
|
|
234
234
|
}
|
|
235
235
|
renderItem(item, index) {
|
|
236
236
|
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) }));
|