@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.
Files changed (60) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +37 -26
  3. package/dist/cjs/limebb-lime-query-filter-builder_3.cjs.entry.js +3 -3
  4. package/dist/cjs/limebb-lime-query-filter-group_3.cjs.entry.js +26 -2
  5. package/dist/cjs/limebb-lime-query-order-by-item.cjs.entry.js +1 -1
  6. package/dist/cjs/limebb-lime-query-response-format-builder.cjs.entry.js +23 -3
  7. package/dist/cjs/limebb-lime-query-response-format-editor_2.cjs.entry.js +28 -6
  8. package/dist/cjs/limebb-property-selector.cjs.entry.js +11 -0
  9. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-builder.css +8 -0
  10. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.css +2 -1
  11. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.js +26 -1
  12. package/dist/collection/components/lime-query-builder/lime-query-builder.css +4 -16
  13. package/dist/collection/components/lime-query-builder/lime-query-builder.js +36 -25
  14. package/dist/collection/components/lime-query-builder/lime-query-response-format-builder.css +1 -18
  15. package/dist/collection/components/lime-query-builder/lime-query-response-format-builder.js +22 -2
  16. package/dist/collection/components/lime-query-builder/order-by/order-by-editor.css +2 -3
  17. package/dist/collection/components/lime-query-builder/order-by/order-by-editor.js +1 -1
  18. package/dist/collection/components/lime-query-builder/order-by/order-by-item.css +1 -5
  19. package/dist/collection/components/lime-query-builder/property-selector/property-selector.js +12 -1
  20. package/dist/collection/components/lime-query-builder/response-format/response-format-editor.css +13 -17
  21. package/dist/collection/components/lime-query-builder/response-format/response-format-editor.js +1 -1
  22. package/dist/collection/components/lime-query-builder/response-format/response-format-item.css +4 -11
  23. package/dist/collection/components/lime-query-builder/response-format/response-format-item.js +25 -3
  24. package/dist/components/lime-query-filter-builder.js +1 -1
  25. package/dist/components/lime-query-filter-expression.js +26 -2
  26. package/dist/components/limebb-lime-query-builder.js +37 -26
  27. package/dist/components/limebb-lime-query-response-format-builder.js +23 -3
  28. package/dist/components/order-by-editor.js +2 -2
  29. package/dist/components/order-by-item.js +1 -1
  30. package/dist/components/property-selector.js +12 -1
  31. package/dist/components/response-format-editor.js +2 -2
  32. package/dist/components/response-format-item.js +26 -4
  33. package/dist/esm/limebb-lime-query-builder.entry.js +37 -26
  34. package/dist/esm/limebb-lime-query-filter-builder_3.entry.js +3 -3
  35. package/dist/esm/limebb-lime-query-filter-group_3.entry.js +26 -2
  36. package/dist/esm/limebb-lime-query-order-by-item.entry.js +1 -1
  37. package/dist/esm/limebb-lime-query-response-format-builder.entry.js +23 -3
  38. package/dist/esm/limebb-lime-query-response-format-editor_2.entry.js +28 -6
  39. package/dist/esm/limebb-property-selector.entry.js +12 -1
  40. package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
  41. package/dist/lime-crm-building-blocks/p-1f76540e.entry.js +1 -0
  42. package/dist/lime-crm-building-blocks/p-2d5f83bc.entry.js +1 -0
  43. package/dist/lime-crm-building-blocks/p-3384f1ee.entry.js +1 -0
  44. package/dist/lime-crm-building-blocks/p-5c693302.entry.js +1 -0
  45. package/dist/lime-crm-building-blocks/p-8917c472.entry.js +1 -0
  46. package/dist/lime-crm-building-blocks/p-9167bc6c.entry.js +1 -0
  47. package/dist/lime-crm-building-blocks/p-d8696b23.entry.js +1 -0
  48. package/dist/types/components/lime-query-builder/expressions/lime-query-filter-group.d.ts +3 -0
  49. package/dist/types/components/lime-query-builder/lime-query-builder.d.ts +2 -2
  50. package/dist/types/components/lime-query-builder/lime-query-response-format-builder.d.ts +1 -0
  51. package/dist/types/components/lime-query-builder/property-selector/property-selector.d.ts +2 -0
  52. package/dist/types/components/lime-query-builder/response-format/response-format-item.d.ts +2 -0
  53. package/package.json +1 -1
  54. package/dist/lime-crm-building-blocks/p-289ce8b9.entry.js +0 -1
  55. package/dist/lime-crm-building-blocks/p-3351395b.entry.js +0 -1
  56. package/dist/lime-crm-building-blocks/p-33e6d0ec.entry.js +0 -1
  57. package/dist/lime-crm-building-blocks/p-7731e1b0.entry.js +0 -1
  58. package/dist/lime-crm-building-blocks/p-be845252.entry.js +0 -1
  59. package/dist/lime-crm-building-blocks/p-cb338753.entry.js +0 -1
  60. package/dist/lime-crm-building-blocks/p-e5549e10.entry.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.102.4](https://github.com/Lundalogik/lime-crm-building-blocks/compare/v1.102.3...v1.102.4) (2025-11-12)
2
+
3
+ ### Bug Fixes
4
+
5
+
6
+ * **lime-query-builder:** sort properties alphabetically in selector ([e87508a](https://github.com/Lundalogik/lime-crm-building-blocks/commit/e87508a7c0c5d872a3e6151289826c3602dad54e)), closes [Lundalogik/crm-insights-and-intelligence#139](https://github.com/Lundalogik/crm-insights-and-intelligence/issues/139)
7
+
8
+ ## [1.102.3](https://github.com/Lundalogik/lime-crm-building-blocks/compare/v1.102.2...v1.102.3) (2025-11-12)
9
+
10
+ ### Bug Fixes
11
+
12
+
13
+ * **response-format-editor:** improve ui ([24c6f2d](https://github.com/Lundalogik/lime-crm-building-blocks/commit/24c6f2dd1ac75edad931d00eefec4badd910d333))
14
+
1
15
  ## [1.102.2](https://github.com/Lundalogik/lime-crm-building-blocks/compare/v1.102.1...v1.102.2) (2025-11-11)
2
16
 
3
17
  ### Bug Fixes
@@ -7,7 +7,7 @@ const index_esm = require('./index.esm-d785eb6e.js');
7
7
  const limeQueryValidation = require('./lime-query-validation-6be10fa7.js');
8
8
  require('./property-resolution-fb42a46b.js');
9
9
 
10
- const limeQueryBuilderCss = ":host(limebb-lime-lime-query-builder){display:block;width:100%}.lime-query-builder{display:flex;flex-direction:column;gap:2rem}.mode-controls{display:flex;align-items:center;gap:0.5rem;padding:0.5rem}.mode-switch{display:flex;align-items:center;gap:0.5rem}.mode-switch limel-button{min-width:5rem}.mode-switch limel-helper-text{margin-left:1rem;color:rgb(var(--color-red-default))}.gui-mode,.code-mode{display:block}.code-editor-container{--code-editor-max-height:70vh;display:flex;flex-direction:column;gap:1rem}.code-editor-container .validation-errors{padding:0.75rem 1rem;color:rgb(var(--color-red-default));background-color:rgb(var(--color-red-lighter));border-left:0.25rem solid rgb(var(--color-red-default));border-radius:0.25rem;font-size:0.875rem}.code-editor-container .validation-errors strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-editor-container .validation-errors ul{margin:0;padding-left:1.5rem}.code-editor-container .validation-errors li{margin:0.25rem 0}.code-editor-container .gui-limitations{padding:0.75rem 1rem;color:rgb(var(--color-blue-dark));background-color:rgb(var(--color-blue-lighter));border-left:0.25rem solid rgb(var(--color-blue-default));border-radius:0.25rem;font-size:0.875rem}.code-editor-container .gui-limitations strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-editor-container .gui-limitations ul{margin:0;padding-left:1.5rem}.code-editor-container .gui-limitations li{margin:0.25rem 0}.lime-query-builder-label{margin:0;font-size:1.5rem;font-weight:600;color:rgb(var(--contrast-1100))}.limetype-section{display:flex;flex-direction:column}.filter-section,.query-options-section{display:flex;flex-direction:column;gap:1rem}.section-label{margin:0;font-size:1.125rem;font-weight:600;color:rgb(var(--contrast-1000))}.query-options-controls{display:flex;flex-direction:column;gap:1rem}@media (max-width: 768px){.lime-query-builder{gap:1.5rem}}";
10
+ 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}}";
11
11
  const LimebbLimeQueryBuilderStyle0 = limeQueryBuilderCss;
12
12
 
13
13
  var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
@@ -62,33 +62,33 @@ const LimeQueryBuilder = class {
62
62
  this.orderBy = event.detail;
63
63
  this.emitChange();
64
64
  };
65
- this.switchToGui = () => {
66
- // Validate JSON before switching
67
- try {
68
- const parsed = JSON.parse(this.codeValue);
69
- // Check if it's supported in GUI
70
- const support = this.checkGuiSupport();
71
- if (!support.guiSupported) {
72
- // Don't switch if GUI can't render this query
73
- return;
65
+ this.handleChange = (event) => {
66
+ event.stopPropagation();
67
+ const mode = event.detail.id;
68
+ if (mode === 'gui') {
69
+ try {
70
+ const parsed = JSON.parse(this.codeValue);
71
+ const support = this.checkGuiSupport();
72
+ if (!support.guiSupported) {
73
+ return;
74
+ }
75
+ this.limetype = parsed.limetype || '';
76
+ this.filter = parsed.filter;
77
+ this.internalResponseFormat = parsed.responseFormat;
78
+ this.limit = parsed.limit;
79
+ this.orderBy = parsed.orderBy;
80
+ this.mode = 'gui';
81
+ this.change.emit(parsed);
82
+ }
83
+ catch (_a) {
84
+ // Don't switch if JSON is invalid
74
85
  }
75
- // Update internal state from parsed query
76
- this.limetype = parsed.limetype || '';
77
- this.filter = parsed.filter;
78
- this.internalResponseFormat = parsed.responseFormat;
79
- this.limit = parsed.limit;
80
- this.orderBy = parsed.orderBy;
81
- this.mode = 'gui';
82
- this.change.emit(parsed);
83
86
  }
84
- catch (_a) {
85
- // Don't switch if JSON is invalid (linter will show the error)
87
+ else if (mode === 'code') {
88
+ this.updateCodeValue();
89
+ this.mode = 'code';
86
90
  }
87
91
  };
88
- this.switchToCode = () => {
89
- this.updateCodeValue();
90
- this.mode = 'code';
91
- };
92
92
  this.handleCodeChange = (event) => {
93
93
  event.stopPropagation();
94
94
  this.codeValue = event.detail;
@@ -102,6 +102,16 @@ const LimeQueryBuilder = class {
102
102
  }
103
103
  };
104
104
  }
105
+ // Buttons are generated dynamically in renderModeSwitch to allow disabling
106
+ getButtons() {
107
+ return [
108
+ {
109
+ id: 'gui',
110
+ title: 'Visual',
111
+ },
112
+ { id: 'code', title: 'Code' },
113
+ ];
114
+ }
105
115
  get guiModeEnabled() {
106
116
  var _a, _b, _c;
107
117
  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);
@@ -132,7 +142,7 @@ const LimeQueryBuilder = class {
132
142
  render() {
133
143
  const guiSupported = this.checkGuiSupport();
134
144
  const showCodeMode = !this.guiModeEnabled || this.mode === 'code';
135
- return (index.h("div", { key: 'f51ae0459c1c7f482f3a790abb4cc3bd60b83e70', class: "lime-query-builder" }, this.renderLabel(), this.renderModeControls(guiSupported), showCodeMode
145
+ return (index.h("div", { key: '5e9c8bb860cf348b08272831bc2e252752fad24d', class: "lime-query-builder" }, this.renderLabel(), this.renderModeControls(guiSupported), showCodeMode
136
146
  ? this.renderCodeMode(guiSupported)
137
147
  : this.renderGuiMode()));
138
148
  }
@@ -227,7 +237,8 @@ const LimeQueryBuilder = class {
227
237
  }
228
238
  renderModeSwitch(support) {
229
239
  const guiDisabled = !support.guiSupported;
230
- return (index.h("div", { class: "mode-switch" }, index.h("limel-button", { label: "GUI", primary: this.mode === 'gui', disabled: guiDisabled, onClick: this.switchToGui }), index.h("limel-button", { label: "Code", primary: this.mode === 'code', onClick: this.switchToCode })));
240
+ const buttons = this.getButtons().map((button) => (Object.assign(Object.assign({}, button), { selected: button.id === this.mode })));
241
+ return (index.h("limel-button-group", { onChange: this.handleChange, value: buttons, disabled: guiDisabled }));
231
242
  }
232
243
  renderCodeEditor(guiSupported) {
233
244
  return (index.h("div", { class: "code-editor-container" }, index.h("limel-code-editor", { value: this.codeValue, language: "json", lineNumbers: true, fold: true, lint: true, onChange: this.handleCodeChange }), !guiSupported.valid &&
@@ -69,7 +69,7 @@ function isEqual(value, other) {
69
69
  return _baseIsEqual.baseIsEqual(value, other);
70
70
  }
71
71
 
72
- const limeQueryFilterBuilderCss = ".expression-with-promotion{display:flex;flex-direction:column;gap:1rem}";
72
+ const limeQueryFilterBuilderCss = ".expression-with-promotion{display:flex;flex-direction:column;gap:1rem}limel-button{width:100%}.query-options-section{margin-top:1rem}";
73
73
  const LimebbLimeQueryFilterBuilderStyle0 = limeQueryFilterBuilderCss;
74
74
 
75
75
  const LimeQueryFilterBuilderComponent = class {
@@ -139,7 +139,7 @@ const LimeQueryFilterBuilderComponent = class {
139
139
  };
140
140
  LimeQueryFilterBuilderComponent.style = LimebbLimeQueryFilterBuilderStyle0;
141
141
 
142
- 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;padding:0.5rem;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;justify-content:flex-start}.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}";
142
+ 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}";
143
143
  const LimebbLimeQueryOrderByEditorStyle0 = orderByEditorCss;
144
144
 
145
145
  const OrderByEditor = class {
@@ -208,7 +208,7 @@ const OrderByEditor = class {
208
208
  return (index.h("div", { class: "order-by-list" }, this.items.map((item, index) => this.renderItem(item, index))));
209
209
  }
210
210
  renderActions() {
211
- return (index.h("div", { class: "actions" }, index.h("limel-button", { label: "Add Sort Field", icon: "plus_math", onClick: this.handleAddSortField })));
211
+ return (index.h("limel-button", { label: "Add Sort Field", icon: "plus_math", onClick: this.handleAddSortField }));
212
212
  }
213
213
  renderItem(item, index$1) {
214
214
  const propertyPath = Object.keys(item)[0] || '';
@@ -156,13 +156,16 @@ function updateChildExpression(group, childIndex, updatedChild) {
156
156
  };
157
157
  }
158
158
 
159
- 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;margin-left:1rem;padding-left:1rem;list-style:disc}.expression>ul li{margin-top:1rem}.expression>ul li.add-button{list-style:none;display:flex;gap:0.5rem}";
159
+ 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}";
160
160
  const LimebbLimeQueryFilterGroupStyle0 = limeQueryFilterGroupCss;
161
161
 
162
162
  const LimeQueryFilterGroupComponent = class {
163
163
  constructor(hostRef) {
164
164
  index.registerInstance(this, hostRef);
165
165
  this.expressionChange = index.createEvent(this, "expressionChange", 7);
166
+ this.renderActionButton = (action) => {
167
+ return (index.h("limel-icon-button", { class: "action-icon", elevated: true, icon: action.icon, label: action.label, onClick: this.handleToggleOperator }));
168
+ };
166
169
  this.renderChildExpression = (expression, childIndex) => (index.h("li", null, index.h("limebb-lime-query-filter-expression", { platform: this.platform, context: this.context, limetype: this.limetype, activeLimetype: this.activeLimetype, expression: expression, onExpressionChange: this.handleExpressionChange(childIndex) })));
167
170
  this.handleToggleOperator = () => {
168
171
  const newGroup = toggleGroupOperator(this.expression);
@@ -187,7 +190,28 @@ const LimeQueryFilterGroupComponent = class {
187
190
  }
188
191
  render() {
189
192
  const subheading = this.getSubheading();
190
- return (index.h("div", { key: 'bf26300a939b4a2a1b401fa7a81593ec745a2a52', class: "expression" }, subheading && (index.h("limel-header", { key: 'f5152a2ca09811540b626965f52f5793e6c99728', subheading: subheading, onClick: this.handleToggleOperator, class: "clickable-header" })), index.h("ul", { key: 'c4cad750e47e0b6c94d6a76b2a4d8b72e36b3402' }, this.expression.exp.map(this.renderChildExpression), index.h("li", { key: 'ddd614f237a0c0314c2977b74a31b365f3251f9d', class: "add-button" }, this.renderAddButton(), this.renderAddGroupButton()))));
193
+ return (index.h("div", { key: 'b7972fb9e34b8b0b57ae82b3bf4de3e55b66169f', class: "expression" }, subheading && (index.h("limel-header", { key: '9721388fa6a60018f95dbe27b2959dcc1c11211e', icon: {
194
+ name: this.expression.op === index_esm.Zt.AND
195
+ ? 'dot_bricks'
196
+ : 'dot_circle',
197
+ color: 'rgb(var(--contrast-800))',
198
+ }, subheading: subheading, onClick: this.handleToggleOperator, class: "clickable-header" }, this.renderActions())), index.h("ul", { key: 'f3ae21204e082e81068c0e20b76e14ed4b577051' }, this.expression.exp.map(this.renderChildExpression), index.h("li", { key: 'd5958d8b61f348540b3dfb821de16ed0f2d0a1f4', class: "add-button" }, this.renderAddButton(), this.renderAddGroupButton()))));
199
+ }
200
+ get actions() {
201
+ return [
202
+ {
203
+ id: '1',
204
+ icon: this.expression.op === index_esm.Zt.AND
205
+ ? 'dot_circle'
206
+ : 'dot_bricks',
207
+ label: this.expression.op === index_esm.Zt.AND
208
+ ? 'Any condition (OR)'
209
+ : 'All conditions (AND)',
210
+ },
211
+ ];
212
+ }
213
+ renderActions() {
214
+ return (index.h("div", { class: "actions" }, this.actions.map(this.renderActionButton)));
191
215
  }
192
216
  getSubheading() {
193
217
  return getFilterGroupSubheading(this.expression.op, this.expression.exp.length);
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-ff255a0d.js');
6
6
 
7
- 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(20rem, 100%)}.control-buttons{flex-shrink:0;display:flex;flex-direction:row;gap:0.25rem;align-items:center;padding-top:0.5rem}.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}.control-buttons{padding-top:0}}";
7
+ 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}}";
8
8
  const LimebbLimeQueryOrderByItemStyle0 = orderByItemCss;
9
9
 
10
10
  const OrderByItemComponent = class {
@@ -68,7 +68,7 @@ function getDefaultResponseFormat() {
68
68
  };
69
69
  }
70
70
 
71
- const limeQueryResponseFormatBuilderCss = ":host(limebb-lime-query-response-format-builder){display:block;width:100%}.response-format-builder{display:flex;flex-direction:column;gap:1.5rem}.builder-label{margin:0;font-size:1.25rem;font-weight:600;color:rgb(var(--contrast-1100))}.mode-controls{display:flex;align-items:center;gap:0.5rem;padding:0.5rem}.mode-switch{display:flex;align-items:center;gap:0.5rem}.mode-switch limel-button{min-width:5rem}.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}@media (max-width: 768px){.response-format-builder{gap:1rem}}";
71
+ 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}";
72
72
  const LimebbLimeQueryResponseFormatBuilderStyle0 = limeQueryResponseFormatBuilderCss;
73
73
 
74
74
  var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
@@ -91,6 +91,16 @@ const LimeQueryResponseFormatBuilder = class {
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 = class {
180
190
  }
181
191
  render() {
182
192
  const guiSupported = this.checkGuiSupport();
183
- return (index.h("div", { key: '2b5e4ee360d6997a176d24e5a7aa36158461ad4a', class: "response-format-builder" }, this.label && index.h("h3", { key: 'b81f58824e4cf3114efd4d2978c833f7f06f2004', class: "builder-label" }, this.label), this.guiModeEnabled && (index.h("div", { key: '1b2ec0cd39909568732be94707a9dcadaa4a1223', class: "mode-controls" }, this.renderModeSwitch(guiSupported))), !this.guiModeEnabled || this.mode === 'code' ? (index.h("div", { class: "code-mode" }, this.renderCodeEditor(guiSupported))) : (index.h("div", { class: "gui-mode" }, this.renderGuiMode()))));
193
+ return (index.h("div", { key: '8b4116d9e6f1653ec429995647481b1df3df2712', class: "response-format-builder" }, this.label && index.h("h3", { key: 'd5e532a64f4e735b67b0533b4896165f7862561e', class: "builder-label" }, this.label), this.guiModeEnabled && (index.h("div", { key: '42af934f90de83855ff81306fe0bdb10c45fa808', class: "mode-controls" }, this.renderModeSwitch(guiSupported))), !this.guiModeEnabled || this.mode === 'code' ? (index.h("div", { class: "code-mode" }, this.renderCodeEditor(guiSupported))) : (index.h("div", { class: "gui-mode" }, this.renderGuiMode()))));
184
194
  }
185
195
  renderModeSwitch(support) {
186
196
  const guiDisabled = !support.guiSupported;
187
- return (index.h("div", { class: "mode-switch" }, index.h("limel-button", { label: "GUI", primary: this.mode === 'gui', disabled: guiDisabled, onClick: this.switchToGui }), index.h("limel-button", { label: "Code", primary: this.mode === 'code', onClick: this.switchToCode })));
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 (index.h("limel-button-group", { value: buttons, disabled: guiDisabled, onChange: this.handleModeChange }));
188
208
  }
189
209
  renderCodeEditor(support) {
190
210
  return (index.h("div", { class: "code-editor-container" }, index.h("limel-code-editor", { value: this.codeValue, language: "json", lineNumbers: true, fold: true, lint: true, onChange: this.handleCodeChange }), !support.valid && support.validationErrors.length > 0 && (index.h("div", { class: "validation-errors" }, index.h("strong", null, "Invalid Response Format:"), index.h("ul", null, support.validationErrors.map((error) => (index.h("li", null, error)))))), this.guiModeEnabled &&
@@ -163,7 +163,7 @@ function itemsToPropertySelection(items) {
163
163
  return result;
164
164
  }
165
165
 
166
- const responseFormatEditorCss = ":host(limebb-lime-query-response-format-editor){display:block;width:100%}.response-format-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))}.property-list{display:flex;flex-direction:column;gap:1rem;padding:0.5rem;border:1px solid rgb(var(--contrast-300));border-radius:0.25rem;background-color:rgb(var(--contrast-50));min-height:4rem}.property-item{padding:0.5rem;border-radius:0.25rem;transition:background-color 0.2s}.property-item:hover{background-color:rgb(var(--contrast-100))}.actions{display:flex;justify-content:flex-start}.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}";
166
+ 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}";
167
167
  const LimebbLimeQueryResponseFormatEditorStyle0 = responseFormatEditorCss;
168
168
 
169
169
  const ResponseFormatEditor = class {
@@ -230,7 +230,7 @@ const ResponseFormatEditor = class {
230
230
  if (!this.limetype) {
231
231
  return (index.h("div", { class: "empty-state" }, index.h("p", null, "Select a limetype to choose properties")));
232
232
  }
233
- return (index.h("div", { class: "response-format-editor" }, index.h("div", { class: "header" }, index.h("h4", null, this.label)), index.h("div", { class: "property-list" }, this.items.map((item, index) => this.renderItem(item, index))), index.h("div", { class: "actions" }, index.h("limel-button", { label: "Add Property", icon: "plus_math", onClick: this.handleAddProperty })), index.h("div", { class: "summary" }, index.h("span", { class: "count" }, this.items.length, ' ', this.items.length === 1 ? 'property' : 'properties', ' ', "selected"))));
233
+ return (index.h("div", { class: "response-format-editor" }, index.h("h4", { class: "header" }, this.label), index.h("div", { class: "summary" }, index.h("span", { class: "count" }, "(", this.items.length, ' ', this.items.length === 1 ? 'property' : 'properties', ' ', "selected)")), index.h("div", { class: "property" }, index.h("div", { class: "property-list" }, this.items.map((item, index) => this.renderItem(item, index))), index.h("div", { class: "actions" }, index.h("limel-button", { label: "Add Property", icon: "plus_math", onClick: this.handleAddProperty })))));
234
234
  }
235
235
  renderItem(item, index$1) {
236
236
  return (index.h("limebb-lime-query-response-format-item", { key: `${item.path}-${index$1}`, class: "property-item", platform: this.platform, context: this.context, limetype: this.limetype, item: item, onItemChange: this.handleItemChange(index$1) }));
@@ -245,7 +245,7 @@ const ResponseFormatEditor = class {
245
245
  };
246
246
  ResponseFormatEditor.style = LimebbLimeQueryResponseFormatEditorStyle0;
247
247
 
248
- const responseFormatItemCss = ":host(limebb-lime-query-response-format-item){display:flex;flex-direction:column;gap:0.5rem;width:100%}.property-controls{display:flex;flex-direction:row;align-items:flex-start;gap:0.5rem;width:100%}.property-path{flex-grow:1;min-width:min(20rem, 100%)}.control-buttons{flex-shrink:0;display:flex;flex-direction:row;gap:0.25rem;align-items:center;padding-top:0.5rem}.control-buttons limel-icon-button{opacity:0.6;transition:opacity 0.2s ease}.control-buttons limel-icon-button:hover{opacity:1}.control-buttons limel-icon-button.has-value{opacity:1;color:rgb(var(--color-blue-default))}.alias,.description{padding-left:1.5rem;width:calc(100% - 1.5rem);max-width:40rem}@media (max-width: 768px){.property-controls{flex-direction:column;gap:0.5rem}.control-buttons{padding-top:0}.alias,.description{padding-left:0;width:100%}}";
248
+ const responseFormatItemCss = ":host(limebb-lime-query-response-format-item){display:flex;flex-direction:column;gap:0.5rem}.property-controls{display:flex;flex-wrap:wrap;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}.control-buttons limel-icon-button.has-value{opacity:1;color:rgb(var(--color-blue-default))}.alias,.description{padding-left:1rem;width:calc(100% - 8.75rem)}@media (max-width: 768px){.property-controls{flex-direction:column;gap:0.5rem}.alias,.description{padding-left:0;width:100%}}";
249
249
  const LimebbLimeQueryResponseFormatItemStyle0 = responseFormatItemCss;
250
250
 
251
251
  const ResponseFormatItem = class {
@@ -310,11 +310,33 @@ const ResponseFormatItem = class {
310
310
  }
311
311
  render() {
312
312
  return [
313
- index.h("div", { key: 'e804c4feb61b44aeb2f141c5b5d3269a76ac9320', class: "property-controls" }, index.h("div", { key: 'becbf35e823b8b16df5366c099b98ce6566d514a', class: "property-path" }, index.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 })), index.h("div", { key: '1e598bbbb6df1c5e93bd4ae5f6b112a745a68df9', class: "control-buttons" }, index.h("limel-icon-button", { key: 'da7ec3bf553900c96149f2d762c2d40ab97d2fbd', icon: "add_tag", label: "Add alias", class: this.item.alias ? 'has-value' : '', onClick: this.toggleAliasInput }), index.h("limel-icon-button", { key: '3936855dd72388fc581770f561be809b4ebc0267', icon: "comments", label: "Add description", class: this.item.description ? 'has-value' : '', onClick: this.toggleDescriptionInput }), index.h("limel-icon-button", { key: '221a2f7399c7c781a583bc344c273f03ae181efb', icon: "trash", label: "Remove property", onClick: this.handleRemove }))),
314
- this.showAliasInput && (index.h("div", { key: 'ddd9a21a4a83a3e8fd7d41b13c293746cf5467ae', class: "alias" }, index.h("limel-input-field", { key: '1c2ec668aa6d864897a57f8aebaf8b60012addb5', label: "Alias", value: this.item.alias || '', placeholder: "Custom property name...", onChange: this.handleAliasChange, onBlur: this.handleAliasBlur }))),
315
- this.showDescriptionInput && (index.h("div", { key: 'e989a6293fb50b760e6e7e46a650f27cd44722ba', class: "description" }, index.h("limel-input-field", { key: '201e61a233a14d832fe450322e782d947ff7187a', label: "Description", value: this.item.description || '', placeholder: "Describe this property for AI...", onChange: this.handleDescriptionChange, onBlur: this.handleDescriptionBlur }))),
313
+ index.h("div", { key: 'e804c4feb61b44aeb2f141c5b5d3269a76ac9320', class: "property-controls" }, index.h("div", { key: 'becbf35e823b8b16df5366c099b98ce6566d514a', class: "property-path" }, index.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 })), index.h("div", { key: '1e598bbbb6df1c5e93bd4ae5f6b112a745a68df9', class: "control-buttons" }, index.h("limel-icon-button", { key: '51d3dfaa9f3578802abf6f65ec876535740ae6a5', icon: this.getAliasIcon(), label: "Add alias", class: this.item.alias ? 'has-value' : '', onClick: this.toggleAliasInput }), index.h("limel-icon-button", { key: 'b2f6050b01d810cc20093e87a09452c625cd7847', icon: this.getDescriptionIcon(), label: "Add description", class: this.item.description ? 'has-value' : '', onClick: this.toggleDescriptionInput }), index.h("limel-icon-button", { key: 'cd58b575c383555db343ebe4a22392c51346751e', icon: "trash", label: "Remove property", onClick: this.handleRemove }))),
314
+ this.showAliasInput && (index.h("div", { key: 'cd95aa0e34945eb9da88e4be4e4c2326c41ec090', class: "alias" }, index.h("limel-input-field", { key: 'f62646327adfb8fcd3f0f2aa3a5325ad8a3bfcc3', label: "Alias", value: this.item.alias || '', placeholder: "Custom property name...", onChange: this.handleAliasChange, onBlur: this.handleAliasBlur }))),
315
+ this.showDescriptionInput && (index.h("div", { key: 'b00f9859a80df3aacf3f524fc1451473e5fcdf5a', class: "description" }, index.h("limel-input-field", { key: '044485f6a35f84816e7458a08882a40aaeacf2f4', label: "Description", value: this.item.description || '', placeholder: "Describe this property for AI...", onChange: this.handleDescriptionChange, onBlur: this.handleDescriptionBlur }))),
316
316
  ];
317
317
  }
318
+ getAliasIcon() {
319
+ const defaultIcon = {
320
+ name: 'add_tag',
321
+ color: 'rgb(var(--color-gray-600))',
322
+ };
323
+ const toggledIcon = {
324
+ name: 'add_tag',
325
+ color: 'rgb(var(--color-teal-default))',
326
+ };
327
+ return this.showAliasInput ? toggledIcon : defaultIcon;
328
+ }
329
+ getDescriptionIcon() {
330
+ const defaultIcon = {
331
+ name: 'comments',
332
+ color: 'rgb(var(--color-gray-600))',
333
+ };
334
+ const toggledIcon = {
335
+ name: 'comments',
336
+ color: 'rgb(var(--color-teal-default))',
337
+ };
338
+ return this.showDescriptionInput ? toggledIcon : defaultIcon;
339
+ }
318
340
  };
319
341
  ResponseFormatItem.style = LimebbLimeQueryResponseFormatItemStyle0;
320
342
 
@@ -107,6 +107,15 @@ const PropertySelector = class {
107
107
  }
108
108
  };
109
109
  }
110
+ componentWillLoad() {
111
+ const language = this.platform
112
+ .get(index_esm.c.Application)
113
+ .getLanguage();
114
+ this.collator = new Intl.Collator(language, {
115
+ numeric: true,
116
+ sensitivity: 'base',
117
+ });
118
+ }
110
119
  render() {
111
120
  if (!this.limetype || !this.limetypes) {
112
121
  return null;
@@ -166,6 +175,8 @@ const PropertySelector = class {
166
175
  items: items,
167
176
  });
168
177
  }
178
+ // Sort properties alphabetically by display text
179
+ 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 : ''); });
169
180
  if (results.length === 0) {
170
181
  return [
171
182
  {
@@ -2,4 +2,12 @@
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 1rem;
5
+ }
6
+
7
+ limel-button {
8
+ width: 100%;
9
+ }
10
+
11
+ .query-options-section {
12
+ margin-top: 1rem;
5
13
  }
@@ -113,14 +113,15 @@
113
113
  background-color: rgb(var(--contrast-200));
114
114
  }
115
115
  .expression > ul {
116
+ list-style: none;
116
117
  margin-top: 0;
117
118
  margin-right: 1rem;
118
119
  margin-bottom: 1rem;
119
- margin-left: 1rem;
120
120
  padding-left: 1rem;
121
121
  list-style: disc;
122
122
  }
123
123
  .expression > ul li {
124
+ list-style: none;
124
125
  margin-top: 1rem;
125
126
  }
126
127
  .expression > ul li.add-button {
@@ -1,4 +1,5 @@
1
1
  import { h } from "@stencil/core";
2
+ import { Operator, } from "@limetech/lime-web-components";
2
3
  import { addExpressionToGroup, createEmptyComparison, createNestedGroup, getAddConditionButtonLabel, getAddGroupButtonLabel, getFilterGroupSubheading, toggleGroupOperator, updateChildExpression, } from "./filter-group-logic";
3
4
  /**
4
5
  * Lime Query Filter Group Component
@@ -20,6 +21,9 @@ import { addExpressionToGroup, createEmptyComparison, createNestedGroup, getAddC
20
21
  */
21
22
  export class LimeQueryFilterGroupComponent {
22
23
  constructor() {
24
+ this.renderActionButton = (action) => {
25
+ return (h("limel-icon-button", { class: "action-icon", elevated: true, icon: action.icon, label: action.label, onClick: this.handleToggleOperator }));
26
+ };
23
27
  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) })));
24
28
  this.handleToggleOperator = () => {
25
29
  const newGroup = toggleGroupOperator(this.expression);
@@ -44,7 +48,28 @@ export class LimeQueryFilterGroupComponent {
44
48
  }
45
49
  render() {
46
50
  const subheading = this.getSubheading();
47
- return (h("div", { key: 'bf26300a939b4a2a1b401fa7a81593ec745a2a52', class: "expression" }, subheading && (h("limel-header", { key: 'f5152a2ca09811540b626965f52f5793e6c99728', subheading: subheading, onClick: this.handleToggleOperator, class: "clickable-header" })), h("ul", { key: 'c4cad750e47e0b6c94d6a76b2a4d8b72e36b3402' }, this.expression.exp.map(this.renderChildExpression), h("li", { key: 'ddd614f237a0c0314c2977b74a31b365f3251f9d', class: "add-button" }, this.renderAddButton(), this.renderAddGroupButton()))));
51
+ return (h("div", { key: 'b7972fb9e34b8b0b57ae82b3bf4de3e55b66169f', class: "expression" }, subheading && (h("limel-header", { key: '9721388fa6a60018f95dbe27b2959dcc1c11211e', icon: {
52
+ name: this.expression.op === Operator.AND
53
+ ? 'dot_bricks'
54
+ : 'dot_circle',
55
+ color: 'rgb(var(--contrast-800))',
56
+ }, 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()))));
57
+ }
58
+ get actions() {
59
+ return [
60
+ {
61
+ id: '1',
62
+ icon: this.expression.op === Operator.AND
63
+ ? 'dot_circle'
64
+ : 'dot_bricks',
65
+ label: this.expression.op === Operator.AND
66
+ ? 'Any condition (OR)'
67
+ : 'All conditions (AND)',
68
+ },
69
+ ];
70
+ }
71
+ renderActions() {
72
+ return (h("div", { class: "actions" }, this.actions.map(this.renderActionButton)));
48
73
  }
49
74
  getSubheading() {
50
75
  return getFilterGroupSubheading(this.expression.op, this.expression.exp.length);
@@ -6,29 +6,16 @@
6
6
  .lime-query-builder {
7
7
  display: flex;
8
8
  flex-direction: column;
9
- gap: 2rem;
9
+ gap: 1rem;
10
+ padding: 1rem;
10
11
  }
11
12
 
12
13
  .mode-controls {
13
14
  display: flex;
14
- align-items: center;
15
- gap: 0.5rem;
15
+ justify-content: flex-end;
16
16
  padding: 0.5rem;
17
17
  }
18
18
 
19
- .mode-switch {
20
- display: flex;
21
- align-items: center;
22
- gap: 0.5rem;
23
- }
24
- .mode-switch limel-button {
25
- min-width: 5rem;
26
- }
27
- .mode-switch limel-helper-text {
28
- margin-left: 1rem;
29
- color: rgb(var(--color-red-default));
30
- }
31
-
32
19
  .gui-mode,
33
20
  .code-mode {
34
21
  display: block;
@@ -98,6 +85,7 @@
98
85
  display: flex;
99
86
  flex-direction: column;
100
87
  gap: 1rem;
88
+ padding-top: 1rem;
101
89
  }
102
90
 
103
91
  .section-label {
@@ -80,33 +80,33 @@ export class LimeQueryBuilder {
80
80
  this.orderBy = event.detail;
81
81
  this.emitChange();
82
82
  };
83
- this.switchToGui = () => {
84
- // Validate JSON before switching
85
- try {
86
- const parsed = JSON.parse(this.codeValue);
87
- // Check if it's supported in GUI
88
- const support = this.checkGuiSupport();
89
- if (!support.guiSupported) {
90
- // Don't switch if GUI can't render this query
91
- return;
83
+ this.handleChange = (event) => {
84
+ event.stopPropagation();
85
+ const mode = event.detail.id;
86
+ if (mode === 'gui') {
87
+ try {
88
+ const parsed = JSON.parse(this.codeValue);
89
+ const support = this.checkGuiSupport();
90
+ if (!support.guiSupported) {
91
+ return;
92
+ }
93
+ this.limetype = parsed.limetype || '';
94
+ this.filter = parsed.filter;
95
+ this.internalResponseFormat = parsed.responseFormat;
96
+ this.limit = parsed.limit;
97
+ this.orderBy = parsed.orderBy;
98
+ this.mode = 'gui';
99
+ this.change.emit(parsed);
100
+ }
101
+ catch (_a) {
102
+ // Don't switch if JSON is invalid
92
103
  }
93
- // Update internal state from parsed query
94
- this.limetype = parsed.limetype || '';
95
- this.filter = parsed.filter;
96
- this.internalResponseFormat = parsed.responseFormat;
97
- this.limit = parsed.limit;
98
- this.orderBy = parsed.orderBy;
99
- this.mode = 'gui';
100
- this.change.emit(parsed);
101
104
  }
102
- catch (_a) {
103
- // Don't switch if JSON is invalid (linter will show the error)
105
+ else if (mode === 'code') {
106
+ this.updateCodeValue();
107
+ this.mode = 'code';
104
108
  }
105
109
  };
106
- this.switchToCode = () => {
107
- this.updateCodeValue();
108
- this.mode = 'code';
109
- };
110
110
  this.handleCodeChange = (event) => {
111
111
  event.stopPropagation();
112
112
  this.codeValue = event.detail;
@@ -120,6 +120,16 @@ export class LimeQueryBuilder {
120
120
  }
121
121
  };
122
122
  }
123
+ // Buttons are generated dynamically in renderModeSwitch to allow disabling
124
+ getButtons() {
125
+ return [
126
+ {
127
+ id: 'gui',
128
+ title: 'Visual',
129
+ },
130
+ { id: 'code', title: 'Code' },
131
+ ];
132
+ }
123
133
  get guiModeEnabled() {
124
134
  var _a, _b, _c;
125
135
  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);
@@ -150,7 +160,7 @@ export class LimeQueryBuilder {
150
160
  render() {
151
161
  const guiSupported = this.checkGuiSupport();
152
162
  const showCodeMode = !this.guiModeEnabled || this.mode === 'code';
153
- return (h("div", { key: 'f51ae0459c1c7f482f3a790abb4cc3bd60b83e70', class: "lime-query-builder" }, this.renderLabel(), this.renderModeControls(guiSupported), showCodeMode
163
+ return (h("div", { key: '5e9c8bb860cf348b08272831bc2e252752fad24d', class: "lime-query-builder" }, this.renderLabel(), this.renderModeControls(guiSupported), showCodeMode
154
164
  ? this.renderCodeMode(guiSupported)
155
165
  : this.renderGuiMode()));
156
166
  }
@@ -245,7 +255,8 @@ export class LimeQueryBuilder {
245
255
  }
246
256
  renderModeSwitch(support) {
247
257
  const guiDisabled = !support.guiSupported;
248
- return (h("div", { class: "mode-switch" }, h("limel-button", { label: "GUI", primary: this.mode === 'gui', disabled: guiDisabled, onClick: this.switchToGui }), h("limel-button", { label: "Code", primary: this.mode === 'code', onClick: this.switchToCode })));
258
+ const buttons = this.getButtons().map((button) => (Object.assign(Object.assign({}, button), { selected: button.id === this.mode })));
259
+ return (h("limel-button-group", { onChange: this.handleChange, value: buttons, disabled: guiDisabled }));
249
260
  }
250
261
  renderCodeEditor(guiSupported) {
251
262
  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 &&
@@ -6,7 +6,6 @@
6
6
  .response-format-builder {
7
7
  display: flex;
8
8
  flex-direction: column;
9
- gap: 1.5rem;
10
9
  }
11
10
 
12
11
  .builder-label {
@@ -18,20 +17,10 @@
18
17
 
19
18
  .mode-controls {
20
19
  display: flex;
21
- align-items: center;
22
- gap: 0.5rem;
20
+ justify-content: flex-end;
23
21
  padding: 0.5rem;
24
22
  }
25
23
 
26
- .mode-switch {
27
- display: flex;
28
- align-items: center;
29
- gap: 0.5rem;
30
- }
31
- .mode-switch limel-button {
32
- min-width: 5rem;
33
- }
34
-
35
24
  .gui-mode,
36
25
  .code-mode {
37
26
  display: block;
@@ -82,10 +71,4 @@
82
71
  }
83
72
  .code-editor-container .gui-limitations li {
84
73
  margin: 0.25rem 0;
85
- }
86
-
87
- @media (max-width: 768px) {
88
- .response-format-builder {
89
- gap: 1rem;
90
- }
91
74
  }