@limetech/lime-crm-building-blocks 1.101.0 → 1.102.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/lime-crm-building-blocks.cjs.js +1 -1
- package/dist/cjs/lime-query-validation-6be10fa7.js +558 -0
- package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +4 -514
- package/dist/cjs/{limebb-lime-query-filter-builder_4.cjs.entry.js → limebb-lime-query-filter-builder_3.cjs.entry.js} +1 -243
- package/dist/cjs/limebb-lime-query-filter-comparison_2.cjs.entry.js +1 -1
- package/dist/cjs/limebb-lime-query-filter-group_3.cjs.entry.js +165 -71
- package/dist/cjs/limebb-lime-query-order-by-item.cjs.entry.js +2 -2
- package/dist/cjs/limebb-lime-query-response-format-builder.cjs.entry.js +242 -0
- package/dist/cjs/limebb-lime-query-response-format-editor_2.cjs.entry.js +322 -0
- package/dist/cjs/limebb-live-docs-info.cjs.entry.js +2 -2
- package/dist/cjs/limebb-locale-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-mention-group-counter.cjs.entry.js +2 -2
- package/dist/cjs/limebb-navigation-button_2.cjs.entry.js +3 -3
- package/dist/cjs/limebb-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-percentage-visualizer.cjs.entry.js +2 -2
- package/dist/cjs/limebb-text-editor.cjs.entry.js +1 -1
- package/dist/cjs/limebb-trend-indicator.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/lime-query-builder/expressions/filter-group-logic.js +150 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-comparison.js +1 -1
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.js +15 -71
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-not.js +1 -1
- package/dist/collection/components/lime-query-builder/lime-query-builder.js +1 -1
- package/dist/collection/components/lime-query-builder/lime-query-response-format-builder.css +91 -0
- package/dist/collection/components/lime-query-builder/lime-query-response-format-builder.js +355 -0
- package/dist/collection/components/lime-query-builder/lime-query-validation.js +40 -0
- package/dist/collection/components/lime-query-builder/limetype-field/limetype-field.js +1 -1
- package/dist/collection/components/lime-query-builder/order-by/order-by-item.js +2 -2
- package/dist/collection/components/lime-query-builder/{response-format-editor.css → response-format/response-format-editor.css} +1 -1
- package/dist/collection/components/lime-query-builder/{response-format-editor.js → response-format/response-format-editor.js} +5 -5
- package/dist/collection/components/lime-query-builder/response-format/response-format-helpers.js +92 -0
- package/dist/collection/components/lime-query-builder/{response-format-item.css → response-format/response-format-item.css} +1 -1
- package/dist/collection/components/lime-query-builder/{response-format-item.js → response-format/response-format-item.js} +6 -6
- package/dist/collection/components/limeobject/file-viewer/live-docs-info.js +2 -2
- package/dist/collection/components/locale-picker/locale-picker.js +1 -1
- package/dist/collection/components/notification-list/notification-item/notification-item.js +1 -1
- package/dist/collection/components/percentage-visualizer/percentage-visualizer.js +2 -2
- package/dist/collection/components/summary-popover/summary-popover.js +3 -3
- package/dist/collection/components/text-editor/mention-group-counter.js +2 -2
- package/dist/collection/components/text-editor/text-editor.js +1 -1
- package/dist/collection/components/trend-indicator/trend-indicator.js +1 -1
- package/dist/components/lime-query-filter-comparison.js +1 -1
- package/dist/components/lime-query-filter-expression.js +165 -71
- package/dist/components/lime-query-validation.js +555 -0
- package/dist/components/limebb-lime-query-builder.js +14 -524
- package/dist/components/limebb-lime-query-response-format-builder.d.ts +11 -0
- package/dist/components/limebb-lime-query-response-format-builder.js +283 -0
- package/dist/components/limebb-lime-query-response-format-editor.d.ts +11 -0
- package/dist/components/{limebb-response-format-editor.js → limebb-lime-query-response-format-editor.js} +2 -2
- package/dist/components/limebb-lime-query-response-format-item.d.ts +11 -0
- package/dist/components/{limebb-response-format-item.js → limebb-lime-query-response-format-item.js} +2 -2
- package/dist/components/limebb-locale-picker.js +1 -1
- package/dist/components/limebb-mention-group-counter.js +2 -2
- package/dist/components/limebb-percentage-visualizer.js +2 -2
- package/dist/components/limebb-text-editor.js +1 -1
- package/dist/components/limebb-trend-indicator.js +1 -1
- package/dist/components/limetype-field.js +1 -1
- package/dist/components/live-docs-info.js +2 -2
- package/dist/components/notification-item.js +1 -1
- package/dist/components/order-by-item.js +2 -2
- package/dist/components/response-format-editor.js +11 -11
- package/dist/components/response-format-item.js +9 -9
- package/dist/components/summary-popover.js +3 -3
- package/dist/esm/lime-crm-building-blocks.js +1 -1
- package/dist/esm/lime-query-validation-573223a5.js +555 -0
- package/dist/esm/limebb-lime-query-builder.entry.js +4 -514
- package/dist/esm/{limebb-lime-query-filter-builder_4.entry.js → limebb-lime-query-filter-builder_3.entry.js} +2 -243
- package/dist/esm/limebb-lime-query-filter-comparison_2.entry.js +1 -1
- package/dist/esm/limebb-lime-query-filter-group_3.entry.js +165 -71
- package/dist/esm/limebb-lime-query-order-by-item.entry.js +2 -2
- package/dist/esm/limebb-lime-query-response-format-builder.entry.js +238 -0
- package/dist/esm/limebb-lime-query-response-format-editor_2.entry.js +317 -0
- package/dist/esm/limebb-live-docs-info.entry.js +2 -2
- package/dist/esm/limebb-locale-picker.entry.js +1 -1
- package/dist/esm/limebb-mention-group-counter.entry.js +2 -2
- package/dist/esm/limebb-navigation-button_2.entry.js +3 -3
- package/dist/esm/limebb-notification-item.entry.js +1 -1
- package/dist/esm/limebb-percentage-visualizer.entry.js +2 -2
- package/dist/esm/limebb-text-editor.entry.js +1 -1
- package/dist/esm/limebb-trend-indicator.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/{p-5cf4898d.entry.js → p-0de79b7f.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-8c2fb1c9.entry.js → p-0f7135ff.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-6aa216ec.entry.js → p-186e9f1a.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-289ce8b9.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-3351395b.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-33e6d0ec.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-a1ee8990.entry.js → p-3d1be1c9.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-92dfc5f8.entry.js → p-577d8909.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-d84874dc.entry.js → p-6f6fed59.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-7731e1b0.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-0cd036ed.entry.js → p-7e5528f6.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-8601eab5.entry.js → p-a9ac501f.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-be845252.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-2725671e.entry.js → p-cb338753.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-425eaba2.entry.js → p-d0721b22.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-fa2da6bc.js +1 -0
- package/dist/types/components/lime-query-builder/expressions/filter-group-logic.d.ts +89 -0
- package/dist/types/components/lime-query-builder/lime-query-response-format-builder.d.ts +102 -0
- package/dist/types/components/lime-query-builder/lime-query-validation.d.ts +13 -0
- package/dist/types/components/lime-query-builder/{response-format-editor.d.ts → response-format/response-format-editor.d.ts} +2 -2
- package/dist/types/components/lime-query-builder/response-format/response-format-helpers.d.ts +42 -0
- package/dist/types/components/lime-query-builder/{response-format-item.d.ts → response-format/response-format-item.d.ts} +2 -2
- package/dist/types/components.d.ts +394 -222
- package/package.json +1 -1
- package/dist/cjs/limebb-response-format-item.cjs.entry.js +0 -80
- package/dist/components/limebb-response-format-editor.d.ts +0 -11
- package/dist/components/limebb-response-format-item.d.ts +0 -11
- package/dist/esm/limebb-response-format-item.entry.js +0 -76
- package/dist/lime-crm-building-blocks/p-244ee55b.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-67c174d0.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-ccf34631.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-f9efca1d.entry.js +0 -1
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
4
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else
|
|
6
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
7
|
+
if (d = decorators[i])
|
|
8
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10
|
+
};
|
|
11
|
+
import { h } from "@stencil/core";
|
|
12
|
+
import { SelectLimeTypes as Limetypes, } from "@limetech/lime-web-components";
|
|
13
|
+
import { parseResponseFormat, stringifyResponseFormat, getDefaultResponseFormat, } from "./response-format/response-format-helpers";
|
|
14
|
+
import { validateResponseFormatOnly, } from "./lime-query-validation";
|
|
15
|
+
/**
|
|
16
|
+
* Response Format Builder
|
|
17
|
+
*
|
|
18
|
+
* A focused component for editing Lime Query ResponseFormat in isolation.
|
|
19
|
+
* Supports both GUI and code modes for maximum flexibility.
|
|
20
|
+
*
|
|
21
|
+
* Use this component when you need to configure which properties to return
|
|
22
|
+
* from a query, but don't need filter, limit, or other query parameters.
|
|
23
|
+
*
|
|
24
|
+
* **Features**:
|
|
25
|
+
* - **GUI Mode**: Visual property selector with relation navigation
|
|
26
|
+
* - **Code Mode**: JSON editor for ResponseFormat structure
|
|
27
|
+
* - **Validation**: Ensures JSON is valid ResponseFormat (rejects other fields)
|
|
28
|
+
* - **Mode Toggle**: Switch between GUI and code modes seamlessly
|
|
29
|
+
* - **Feature Flag**: Respects `useLimeQueryBuilderGuiMode` setting
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <limebb-lime-query-response-format-builder
|
|
34
|
+
* platform={this.platform}
|
|
35
|
+
* context={this.context}
|
|
36
|
+
* limetype="deal"
|
|
37
|
+
* value={this.responseFormat}
|
|
38
|
+
* label="Select Properties to Return"
|
|
39
|
+
* onChange={this.handleChange}
|
|
40
|
+
* />
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @exampleComponent limebb-example-response-format-builder-basic
|
|
44
|
+
* @private
|
|
45
|
+
*/
|
|
46
|
+
export class LimeQueryResponseFormatBuilder {
|
|
47
|
+
constructor() {
|
|
48
|
+
/**
|
|
49
|
+
* Optional label for the builder
|
|
50
|
+
*/
|
|
51
|
+
this.label = 'Response Format';
|
|
52
|
+
this.mode = 'gui';
|
|
53
|
+
this.codeValue = '';
|
|
54
|
+
/**
|
|
55
|
+
* Switch from code mode to GUI mode
|
|
56
|
+
*/
|
|
57
|
+
this.switchToGui = () => {
|
|
58
|
+
// Validate JSON before switching
|
|
59
|
+
try {
|
|
60
|
+
const parsed = parseResponseFormat(this.codeValue);
|
|
61
|
+
// Check if it's supported in GUI
|
|
62
|
+
const support = validateResponseFormatOnly(parsed, this.limetypes, this.limetype, this.guiModeEnabled);
|
|
63
|
+
if (!support.guiSupported) {
|
|
64
|
+
// Don't switch if GUI can't render this response format
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
// Update internal state from parsed value
|
|
68
|
+
this.internalValue = parsed;
|
|
69
|
+
this.mode = 'gui';
|
|
70
|
+
this.change.emit(parsed);
|
|
71
|
+
}
|
|
72
|
+
catch (_a) {
|
|
73
|
+
// Don't switch if JSON is invalid (linter will show the error)
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Switch from GUI mode to code mode
|
|
78
|
+
*/
|
|
79
|
+
this.switchToCode = () => {
|
|
80
|
+
this.updateCodeValue();
|
|
81
|
+
this.mode = 'code';
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Handle code editor changes
|
|
85
|
+
* @param event
|
|
86
|
+
*/
|
|
87
|
+
this.handleCodeChange = (event) => {
|
|
88
|
+
event.stopPropagation();
|
|
89
|
+
this.codeValue = event.detail;
|
|
90
|
+
// Try to parse and emit if valid
|
|
91
|
+
try {
|
|
92
|
+
const parsed = parseResponseFormat(this.codeValue);
|
|
93
|
+
this.internalValue = parsed;
|
|
94
|
+
this.change.emit(parsed);
|
|
95
|
+
}
|
|
96
|
+
catch (_a) {
|
|
97
|
+
// Invalid JSON - don't emit change
|
|
98
|
+
// Validation errors will be shown by checkGuiSupport()
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Handle GUI mode changes
|
|
103
|
+
* @param event
|
|
104
|
+
*/
|
|
105
|
+
this.handleGuiChange = (event) => {
|
|
106
|
+
event.stopPropagation();
|
|
107
|
+
this.internalValue = event.detail;
|
|
108
|
+
this.updateCodeValue();
|
|
109
|
+
this.change.emit(event.detail);
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Check if GUI mode is enabled via feature flag
|
|
114
|
+
*/
|
|
115
|
+
get guiModeEnabled() {
|
|
116
|
+
var _a, _b, _c;
|
|
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);
|
|
118
|
+
}
|
|
119
|
+
componentWillLoad() {
|
|
120
|
+
// Initialize internal value
|
|
121
|
+
this.internalValue = this.value || getDefaultResponseFormat();
|
|
122
|
+
// Update code value from internal value
|
|
123
|
+
this.updateCodeValue();
|
|
124
|
+
// Force code mode if GUI is disabled
|
|
125
|
+
if (!this.guiModeEnabled) {
|
|
126
|
+
this.mode = 'code';
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
// Check if GUI mode is supported for current value
|
|
130
|
+
const support = this.checkGuiSupport();
|
|
131
|
+
if (!support.guiSupported) {
|
|
132
|
+
this.mode = 'code';
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
componentWillUpdate() {
|
|
136
|
+
// Sync internal value when prop changes externally
|
|
137
|
+
if (this.value && this.mode === 'gui') {
|
|
138
|
+
this.internalValue = this.value;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
render() {
|
|
142
|
+
const guiSupported = this.checkGuiSupport();
|
|
143
|
+
return (h("div", { key: '2b5e4ee360d6997a176d24e5a7aa36158461ad4a', class: "response-format-builder" }, this.label && h("h3", { key: 'b81f58824e4cf3114efd4d2978c833f7f06f2004', class: "builder-label" }, this.label), this.guiModeEnabled && (h("div", { key: '1b2ec0cd39909568732be94707a9dcadaa4a1223', 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
|
+
}
|
|
145
|
+
renderModeSwitch(support) {
|
|
146
|
+
const guiDisabled = !support.guiSupported;
|
|
147
|
+
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 })));
|
|
148
|
+
}
|
|
149
|
+
renderCodeEditor(support) {
|
|
150
|
+
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 &&
|
|
151
|
+
support.valid &&
|
|
152
|
+
!support.guiSupported &&
|
|
153
|
+
support.guiLimitations.length > 0 && (h("div", { class: "gui-limitations" }, h("strong", null, "Cannot switch to GUI mode:"), h("ul", null, support.guiLimitations.map((limitation) => (h("li", null, limitation))))))));
|
|
154
|
+
}
|
|
155
|
+
renderGuiMode() {
|
|
156
|
+
return (h("limebb-lime-query-response-format-editor", { platform: this.platform, context: this.context, limetype: this.limetype, value: this.internalValue, onChange: this.handleGuiChange }));
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Check if current value can be rendered in GUI mode
|
|
160
|
+
*/
|
|
161
|
+
checkGuiSupport() {
|
|
162
|
+
if (!this.limetypes) {
|
|
163
|
+
return {
|
|
164
|
+
valid: false,
|
|
165
|
+
guiSupported: false,
|
|
166
|
+
validationErrors: ['Limetypes not loaded'],
|
|
167
|
+
guiLimitations: [],
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
// Try to parse code value if in code mode
|
|
171
|
+
let valueToCheck;
|
|
172
|
+
if (this.mode === 'code') {
|
|
173
|
+
try {
|
|
174
|
+
valueToCheck = parseResponseFormat(this.codeValue);
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
return {
|
|
178
|
+
valid: false,
|
|
179
|
+
guiSupported: false,
|
|
180
|
+
validationErrors: [error.message],
|
|
181
|
+
guiLimitations: [],
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
valueToCheck = this.internalValue;
|
|
187
|
+
}
|
|
188
|
+
return validateResponseFormatOnly(valueToCheck, this.limetypes, this.limetype, this.guiModeEnabled);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Update code value from internal state
|
|
192
|
+
*/
|
|
193
|
+
updateCodeValue() {
|
|
194
|
+
this.codeValue = stringifyResponseFormat(this.internalValue);
|
|
195
|
+
}
|
|
196
|
+
static get is() { return "limebb-lime-query-response-format-builder"; }
|
|
197
|
+
static get encapsulation() { return "shadow"; }
|
|
198
|
+
static get originalStyleUrls() {
|
|
199
|
+
return {
|
|
200
|
+
"$": ["lime-query-response-format-builder.scss"]
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
static get styleUrls() {
|
|
204
|
+
return {
|
|
205
|
+
"$": ["lime-query-response-format-builder.css"]
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
static get properties() {
|
|
209
|
+
return {
|
|
210
|
+
"platform": {
|
|
211
|
+
"type": "unknown",
|
|
212
|
+
"mutable": false,
|
|
213
|
+
"complexType": {
|
|
214
|
+
"original": "LimeWebComponentPlatform",
|
|
215
|
+
"resolved": "LimeWebComponentPlatform",
|
|
216
|
+
"references": {
|
|
217
|
+
"LimeWebComponentPlatform": {
|
|
218
|
+
"location": "import",
|
|
219
|
+
"path": "@limetech/lime-web-components",
|
|
220
|
+
"id": "node_modules::LimeWebComponentPlatform"
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"required": false,
|
|
225
|
+
"optional": false,
|
|
226
|
+
"docs": {
|
|
227
|
+
"tags": [],
|
|
228
|
+
"text": "Platform service provider"
|
|
229
|
+
},
|
|
230
|
+
"getter": false,
|
|
231
|
+
"setter": false
|
|
232
|
+
},
|
|
233
|
+
"context": {
|
|
234
|
+
"type": "unknown",
|
|
235
|
+
"mutable": false,
|
|
236
|
+
"complexType": {
|
|
237
|
+
"original": "LimeWebComponentContext",
|
|
238
|
+
"resolved": "LimeWebComponentContext",
|
|
239
|
+
"references": {
|
|
240
|
+
"LimeWebComponentContext": {
|
|
241
|
+
"location": "import",
|
|
242
|
+
"path": "@limetech/lime-web-components",
|
|
243
|
+
"id": "node_modules::LimeWebComponentContext"
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"required": false,
|
|
248
|
+
"optional": false,
|
|
249
|
+
"docs": {
|
|
250
|
+
"tags": [],
|
|
251
|
+
"text": "Component context"
|
|
252
|
+
},
|
|
253
|
+
"getter": false,
|
|
254
|
+
"setter": false
|
|
255
|
+
},
|
|
256
|
+
"limetype": {
|
|
257
|
+
"type": "string",
|
|
258
|
+
"mutable": false,
|
|
259
|
+
"complexType": {
|
|
260
|
+
"original": "string",
|
|
261
|
+
"resolved": "string",
|
|
262
|
+
"references": {}
|
|
263
|
+
},
|
|
264
|
+
"required": false,
|
|
265
|
+
"optional": false,
|
|
266
|
+
"docs": {
|
|
267
|
+
"tags": [],
|
|
268
|
+
"text": "The limetype to configure response format for\nThis is fixed and not editable by the user"
|
|
269
|
+
},
|
|
270
|
+
"getter": false,
|
|
271
|
+
"setter": false,
|
|
272
|
+
"attribute": "limetype",
|
|
273
|
+
"reflect": false
|
|
274
|
+
},
|
|
275
|
+
"value": {
|
|
276
|
+
"type": "unknown",
|
|
277
|
+
"mutable": false,
|
|
278
|
+
"complexType": {
|
|
279
|
+
"original": "ResponseFormat",
|
|
280
|
+
"resolved": "ResponseFormat | undefined",
|
|
281
|
+
"references": {
|
|
282
|
+
"ResponseFormat": {
|
|
283
|
+
"location": "import",
|
|
284
|
+
"path": "./lime-query.types",
|
|
285
|
+
"id": "src/components/lime-query-builder/lime-query.types.ts::ResponseFormat"
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
"required": false,
|
|
290
|
+
"optional": true,
|
|
291
|
+
"docs": {
|
|
292
|
+
"tags": [],
|
|
293
|
+
"text": "Current response format value"
|
|
294
|
+
},
|
|
295
|
+
"getter": false,
|
|
296
|
+
"setter": false
|
|
297
|
+
},
|
|
298
|
+
"label": {
|
|
299
|
+
"type": "string",
|
|
300
|
+
"mutable": false,
|
|
301
|
+
"complexType": {
|
|
302
|
+
"original": "string",
|
|
303
|
+
"resolved": "string",
|
|
304
|
+
"references": {}
|
|
305
|
+
},
|
|
306
|
+
"required": false,
|
|
307
|
+
"optional": false,
|
|
308
|
+
"docs": {
|
|
309
|
+
"tags": [],
|
|
310
|
+
"text": "Optional label for the builder"
|
|
311
|
+
},
|
|
312
|
+
"getter": false,
|
|
313
|
+
"setter": false,
|
|
314
|
+
"attribute": "label",
|
|
315
|
+
"reflect": false,
|
|
316
|
+
"defaultValue": "'Response Format'"
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
static get states() {
|
|
321
|
+
return {
|
|
322
|
+
"limetypes": {},
|
|
323
|
+
"mode": {},
|
|
324
|
+
"codeValue": {},
|
|
325
|
+
"internalValue": {}
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
static get events() {
|
|
329
|
+
return [{
|
|
330
|
+
"method": "change",
|
|
331
|
+
"name": "change",
|
|
332
|
+
"bubbles": true,
|
|
333
|
+
"cancelable": true,
|
|
334
|
+
"composed": true,
|
|
335
|
+
"docs": {
|
|
336
|
+
"tags": [],
|
|
337
|
+
"text": "Emitted when the response format changes"
|
|
338
|
+
},
|
|
339
|
+
"complexType": {
|
|
340
|
+
"original": "ResponseFormat",
|
|
341
|
+
"resolved": "ResponseFormat",
|
|
342
|
+
"references": {
|
|
343
|
+
"ResponseFormat": {
|
|
344
|
+
"location": "import",
|
|
345
|
+
"path": "./lime-query.types",
|
|
346
|
+
"id": "src/components/lime-query-builder/lime-query.types.ts::ResponseFormat"
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}];
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
__decorate([
|
|
354
|
+
Limetypes()
|
|
355
|
+
], LimeQueryResponseFormatBuilder.prototype, "limetypes", void 0);
|
|
@@ -511,3 +511,43 @@ export function isLimeQuerySupported(limeQuery, limetypes, activeLimetype, guiMo
|
|
|
511
511
|
guiLimitations,
|
|
512
512
|
};
|
|
513
513
|
}
|
|
514
|
+
// ============================================================================
|
|
515
|
+
// Specialized Validators for Modular Builders
|
|
516
|
+
// ============================================================================
|
|
517
|
+
/**
|
|
518
|
+
* Validate a ResponseFormat in isolation (for response-format-builder)
|
|
519
|
+
*
|
|
520
|
+
* This validator is designed for the response-format-builder component,
|
|
521
|
+
* which only handles ResponseFormat editing without the full LimeQuery context.
|
|
522
|
+
*
|
|
523
|
+
* @param responseFormat - The response format to validate
|
|
524
|
+
* @param limetypes - Record of all available limetypes
|
|
525
|
+
* @param limetype - The limetype context for validation
|
|
526
|
+
* @param guiModeEnabled - Whether GUI mode is enabled (affects validation)
|
|
527
|
+
* @returns Validation result with errors and GUI limitations
|
|
528
|
+
*/
|
|
529
|
+
export function validateResponseFormatOnly(responseFormat, limetypes, limetype, guiModeEnabled = true) {
|
|
530
|
+
const validationErrors = [];
|
|
531
|
+
const guiLimitations = [];
|
|
532
|
+
// Validate limetype exists
|
|
533
|
+
if (!limetypes[limetype]) {
|
|
534
|
+
validationErrors.push(`Unknown limetype: ${limetype}`);
|
|
535
|
+
// Can't proceed with property validation if limetype is unknown
|
|
536
|
+
return {
|
|
537
|
+
valid: false,
|
|
538
|
+
guiSupported: false,
|
|
539
|
+
validationErrors,
|
|
540
|
+
guiLimitations,
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
// Use internal validation logic
|
|
544
|
+
const { errors, limitations } = validateLimeQueryResponseFormatInternal(responseFormat, limetypes, limetype, guiModeEnabled);
|
|
545
|
+
validationErrors.push(...errors);
|
|
546
|
+
guiLimitations.push(...limitations);
|
|
547
|
+
return {
|
|
548
|
+
valid: validationErrors.length === 0,
|
|
549
|
+
guiSupported: guiLimitations.length === 0,
|
|
550
|
+
validationErrors,
|
|
551
|
+
guiLimitations,
|
|
552
|
+
};
|
|
553
|
+
}
|
|
@@ -78,7 +78,7 @@ export class LimetypeField {
|
|
|
78
78
|
value: '',
|
|
79
79
|
};
|
|
80
80
|
options.unshift(emptyOption);
|
|
81
|
-
return (h("limel-select", { key: '
|
|
81
|
+
return (h("limel-select", { key: 'ee9fdc46424c9e6dc5897260cb16bcbedd43413a', label: this.label, options: options, value: selectedOption, required: this.required, helperText: this.helperText, invalid: invalid, disabled: this.disabled || this.readonly, onChange: this.handleChange }));
|
|
82
82
|
}
|
|
83
83
|
componentWillRender() {
|
|
84
84
|
this.updatePropertyFields(this.value || '');
|
|
@@ -38,9 +38,9 @@ export class OrderByItemComponent {
|
|
|
38
38
|
render() {
|
|
39
39
|
const propertyPath = Object.keys(this.item)[0] || '';
|
|
40
40
|
const direction = this.item[propertyPath] || 'ASC';
|
|
41
|
-
return (h("div", { key: '
|
|
41
|
+
return (h("div", { key: '1587617d84be8905a858059ea966b7a9e0d6df78', class: "order-by-controls" }, h("div", { key: '8d4f47423c56cad20e91142f82a5726a7325233b', class: "property-path" }, h("limebb-property-selector", { key: '42c54528d2d2ee72e5b3f6ca4b31eb7bbcb9b325', platform: this.platform, context: this.context, limetype: this.limetype, label: "Property", value: propertyPath, required: true, onChange: this.handlePathChange })), h("div", { key: '1011a34f626c94608a926567e464d380faded349', class: "control-buttons" }, h("limel-icon-button", { key: '510a7c333397792a66f3e17a3501f2af96183db9', icon: direction === 'ASC'
|
|
42
42
|
? 'sort_ascending'
|
|
43
|
-
: 'sort_descending', label: direction === 'ASC' ? 'Ascending' : 'Descending', onClick: this.handleToggleDirection }), h("limel-icon-button", { key: '
|
|
43
|
+
: 'sort_descending', label: direction === 'ASC' ? 'Ascending' : 'Descending', onClick: this.handleToggleDirection }), h("limel-icon-button", { key: '5bc160b38c565e30cca03a88d6f2d181284cefdd', icon: "trash", label: "Remove", onClick: this.handleRemove }))));
|
|
44
44
|
}
|
|
45
45
|
static get is() { return "limebb-lime-query-order-by-item"; }
|
|
46
46
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
import { propertySelectionToItems, itemsToPropertySelection, } from "
|
|
2
|
+
import { propertySelectionToItems, itemsToPropertySelection, } from "../property-selection-format";
|
|
3
3
|
/**
|
|
4
4
|
* Response Format Editor Component
|
|
5
5
|
*
|
|
@@ -84,7 +84,7 @@ export class ResponseFormatEditor {
|
|
|
84
84
|
return (h("div", { class: "response-format-editor" }, h("div", { class: "header" }, h("h4", null, this.label)), 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 })), h("div", { class: "summary" }, h("span", { class: "count" }, this.items.length, ' ', this.items.length === 1 ? 'property' : 'properties', ' ', "selected"))));
|
|
85
85
|
}
|
|
86
86
|
renderItem(item, index) {
|
|
87
|
-
return (h("limebb-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) }));
|
|
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) }));
|
|
88
88
|
}
|
|
89
89
|
emitChange() {
|
|
90
90
|
const propertySelection = itemsToPropertySelection(this.items);
|
|
@@ -93,7 +93,7 @@ export class ResponseFormatEditor {
|
|
|
93
93
|
};
|
|
94
94
|
this.change.emit(responseFormat);
|
|
95
95
|
}
|
|
96
|
-
static get is() { return "limebb-response-format-editor"; }
|
|
96
|
+
static get is() { return "limebb-lime-query-response-format-editor"; }
|
|
97
97
|
static get encapsulation() { return "shadow"; }
|
|
98
98
|
static get originalStyleUrls() {
|
|
99
99
|
return {
|
|
@@ -181,7 +181,7 @@ export class ResponseFormatEditor {
|
|
|
181
181
|
"references": {
|
|
182
182
|
"ResponseFormat": {
|
|
183
183
|
"location": "import",
|
|
184
|
-
"path": "
|
|
184
|
+
"path": "../lime-query.types",
|
|
185
185
|
"id": "src/components/lime-query-builder/lime-query.types.ts::ResponseFormat"
|
|
186
186
|
}
|
|
187
187
|
}
|
|
@@ -239,7 +239,7 @@ export class ResponseFormatEditor {
|
|
|
239
239
|
"references": {
|
|
240
240
|
"ResponseFormat": {
|
|
241
241
|
"location": "import",
|
|
242
|
-
"path": "
|
|
242
|
+
"path": "../lime-query.types",
|
|
243
243
|
"id": "src/components/lime-query-builder/lime-query.types.ts::ResponseFormat"
|
|
244
244
|
}
|
|
245
245
|
}
|
package/dist/collection/components/lime-query-builder/response-format/response-format-helpers.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper functions for working with ResponseFormat objects
|
|
3
|
+
*
|
|
4
|
+
* These utilities handle parsing, stringifying, and default values
|
|
5
|
+
* for ResponseFormat in isolation (without full LimeQuery wrapper)
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Parse JSON string to ResponseFormat
|
|
9
|
+
*
|
|
10
|
+
* @param json - JSON string to parse
|
|
11
|
+
* @returns Parsed ResponseFormat object
|
|
12
|
+
* @throws Error if JSON is invalid or not a ResponseFormat
|
|
13
|
+
*/
|
|
14
|
+
export function parseResponseFormat(json) {
|
|
15
|
+
let parsed;
|
|
16
|
+
try {
|
|
17
|
+
parsed = JSON.parse(json);
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
throw new Error(`Invalid JSON: ${error.message}`);
|
|
21
|
+
}
|
|
22
|
+
if (parsed === null || typeof parsed !== 'object') {
|
|
23
|
+
throw new Error('Response format must be an object');
|
|
24
|
+
}
|
|
25
|
+
// Validate structure
|
|
26
|
+
const validKeys = new Set(['object', 'aggregates']);
|
|
27
|
+
const keys = Object.keys(parsed);
|
|
28
|
+
// Check for unexpected keys
|
|
29
|
+
const unexpectedKeys = keys.filter((key) => !validKeys.has(key));
|
|
30
|
+
if (unexpectedKeys.length > 0) {
|
|
31
|
+
throw new Error(`Unexpected properties in response format: ${unexpectedKeys.join(', ')}. ` +
|
|
32
|
+
`Only 'object' and 'aggregates' are allowed.`);
|
|
33
|
+
}
|
|
34
|
+
// Must have at least one of object or aggregates
|
|
35
|
+
if (!parsed.object && !parsed.aggregates) {
|
|
36
|
+
throw new Error('Response format must contain at least one of: object, aggregates');
|
|
37
|
+
}
|
|
38
|
+
return parsed;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Stringify ResponseFormat to JSON
|
|
42
|
+
*
|
|
43
|
+
* @param format - ResponseFormat object to stringify
|
|
44
|
+
* @returns Pretty-printed JSON string
|
|
45
|
+
*/
|
|
46
|
+
export function stringifyResponseFormat(format) {
|
|
47
|
+
return JSON.stringify(format, null, 2);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get default ResponseFormat (just _id)
|
|
51
|
+
*
|
|
52
|
+
* @returns Default ResponseFormat with only _id selected
|
|
53
|
+
*/
|
|
54
|
+
export function getDefaultResponseFormat() {
|
|
55
|
+
return {
|
|
56
|
+
object: {
|
|
57
|
+
_id: null,
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Check if a parsed JSON object is a valid ResponseFormat
|
|
63
|
+
*
|
|
64
|
+
* This is a more lenient check than parseResponseFormat - it doesn't throw,
|
|
65
|
+
* just returns a boolean with optional error message
|
|
66
|
+
*
|
|
67
|
+
* @param json - Parsed JSON object to check
|
|
68
|
+
* @returns Object with `valid` boolean and optional `error` message
|
|
69
|
+
*/
|
|
70
|
+
export function isValidResponseFormatStructure(json) {
|
|
71
|
+
if (json === null || typeof json !== 'object') {
|
|
72
|
+
return { valid: false, error: 'Response format must be an object' };
|
|
73
|
+
}
|
|
74
|
+
const validKeys = new Set(['object', 'aggregates']);
|
|
75
|
+
const keys = Object.keys(json);
|
|
76
|
+
// Check for unexpected keys
|
|
77
|
+
const unexpectedKeys = keys.filter((key) => !validKeys.has(key));
|
|
78
|
+
if (unexpectedKeys.length > 0) {
|
|
79
|
+
return {
|
|
80
|
+
valid: false,
|
|
81
|
+
error: `Unexpected properties: ${unexpectedKeys.join(', ')}. Only 'object' and 'aggregates' are allowed.`,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
// Must have at least one of object or aggregates
|
|
85
|
+
if (!json.object && !json.aggregates) {
|
|
86
|
+
return {
|
|
87
|
+
valid: false,
|
|
88
|
+
error: 'Response format must contain at least one of: object, aggregates',
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
return { valid: true };
|
|
92
|
+
}
|
|
@@ -66,12 +66,12 @@ export class ResponseFormatItem {
|
|
|
66
66
|
}
|
|
67
67
|
render() {
|
|
68
68
|
return [
|
|
69
|
-
h("div", { 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: 'da7ec3bf553900c96149f2d762c2d40ab97d2fbd', icon: "add_tag", label: "Add alias", class: this.item.alias ? 'has-value' : '', onClick: this.toggleAliasInput }), h("limel-icon-button", { key: '3936855dd72388fc581770f561be809b4ebc0267', icon: "comments", label: "Add description", class: this.item.description ? 'has-value' : '', onClick: this.toggleDescriptionInput }), h("limel-icon-button", { key: '221a2f7399c7c781a583bc344c273f03ae181efb', icon: "trash", label: "Remove property", onClick: this.handleRemove }))),
|
|
70
|
+
this.showAliasInput && (h("div", { key: 'ddd9a21a4a83a3e8fd7d41b13c293746cf5467ae', class: "alias" }, h("limel-input-field", { key: '1c2ec668aa6d864897a57f8aebaf8b60012addb5', label: "Alias", value: this.item.alias || '', placeholder: "Custom property name...", onChange: this.handleAliasChange, onBlur: this.handleAliasBlur }))),
|
|
71
|
+
this.showDescriptionInput && (h("div", { key: 'e989a6293fb50b760e6e7e46a650f27cd44722ba', class: "description" }, h("limel-input-field", { key: '201e61a233a14d832fe450322e782d947ff7187a', label: "Description", value: this.item.description || '', placeholder: "Describe this property for AI...", onChange: this.handleDescriptionChange, onBlur: this.handleDescriptionBlur }))),
|
|
72
72
|
];
|
|
73
73
|
}
|
|
74
|
-
static get is() { return "limebb-response-format-item"; }
|
|
74
|
+
static get is() { return "limebb-lime-query-response-format-item"; }
|
|
75
75
|
static get encapsulation() { return "shadow"; }
|
|
76
76
|
static get originalStyleUrls() {
|
|
77
77
|
return {
|
|
@@ -159,7 +159,7 @@ export class ResponseFormatItem {
|
|
|
159
159
|
"references": {
|
|
160
160
|
"PropertySelectionItem": {
|
|
161
161
|
"location": "import",
|
|
162
|
-
"path": "
|
|
162
|
+
"path": "../property-selection-format",
|
|
163
163
|
"id": "src/components/lime-query-builder/property-selection-format.ts::PropertySelectionItem"
|
|
164
164
|
}
|
|
165
165
|
}
|
|
@@ -198,7 +198,7 @@ export class ResponseFormatItem {
|
|
|
198
198
|
"references": {
|
|
199
199
|
"PropertySelectionItem": {
|
|
200
200
|
"location": "import",
|
|
201
|
-
"path": "
|
|
201
|
+
"path": "../property-selection-format",
|
|
202
202
|
"id": "src/components/lime-query-builder/property-selection-format.ts::PropertySelectionItem"
|
|
203
203
|
}
|
|
204
204
|
}
|
|
@@ -5,8 +5,8 @@ import { h } from "@stencil/core";
|
|
|
5
5
|
export class LiveDocsInfo {
|
|
6
6
|
render() {
|
|
7
7
|
return [
|
|
8
|
-
h("div", { key: '
|
|
9
|
-
h("p", { key: '
|
|
8
|
+
h("div", { key: '719c7b607dc66882cb8cee2275dc670c9ad53b73', class: "header" }, h("limel-icon", { key: 'a50b72a8266bf58feba9e92a8da2061ecc4fe855', name: "not_showing_video_frames" }), h("h2", { key: 'fad26ca7f04886af8e63c4bfbcf736459ce49906' }, "Viewing this file type requires ", h("em", { key: 'f99708d544005e572f7efebe5b352017f69abdf9' }, "Live Docs"))),
|
|
9
|
+
h("p", { key: 'd8433cc57b251319bc2d34e115df2a1d7d617ae3' }, h("em", { key: '559862e1cb8631a3209eedd2e2354ab53ec74a96' }, "Live Docs"), " not only enables you to view many file formats such as Microsoft Office documents, but it also empowers you to edit them right in the CRM. No need to download anything on your device!", h("a", { key: '367bccba15d2b591c267870bd7610cc86fe7fb5b', target: "_blank", href: "https://www.lime-technologies.com/en/lime-crm/live-docs/" }, "Learn more")),
|
|
10
10
|
];
|
|
11
11
|
}
|
|
12
12
|
static get is() { return "limebb-live-docs-info"; }
|
|
@@ -53,7 +53,7 @@ export class LocalePicker {
|
|
|
53
53
|
const value = this.value;
|
|
54
54
|
selectedOptions = options.find((option) => option.value === value);
|
|
55
55
|
}
|
|
56
|
-
return (h("limel-select", { key: '
|
|
56
|
+
return (h("limel-select", { key: '59ee26c288bf08161708bf6bcc6b304ebf1b456f', value: selectedOptions, options: sortBy(options, 'text'), helperText: this.helperText, label: this.label, required: this.required, disabled: this.disabled, readonly: this.readonly, onChange: this.handleChange, multiple: this.multipleChoice }));
|
|
57
57
|
}
|
|
58
58
|
static get is() { return "limebb-locale-picker"; }
|
|
59
59
|
static get encapsulation() { return "shadow"; }
|
|
@@ -56,7 +56,7 @@ export class NotificationListItem {
|
|
|
56
56
|
}
|
|
57
57
|
render() {
|
|
58
58
|
var _a, _b;
|
|
59
|
-
return (h(Host, { key: '
|
|
59
|
+
return (h(Host, { key: '48b4679d731d3f42abbdd12935fef881b29f1638', id: this.item.id, class: {
|
|
60
60
|
'is-clickable': this.isItemClickable(),
|
|
61
61
|
'is-read': !!((_a = this.item) === null || _a === void 0 ? void 0 : _a.read),
|
|
62
62
|
'is-selected': !!((_b = this.item) === null || _b === void 0 ? void 0 : _b.selected),
|