@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
package/package.json
CHANGED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-ff255a0d.js');
|
|
6
|
-
|
|
7
|
-
const responseFormatItemCss = ":host(limebb-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%}}";
|
|
8
|
-
const LimebbResponseFormatItemStyle0 = responseFormatItemCss;
|
|
9
|
-
|
|
10
|
-
const ResponseFormatItem = class {
|
|
11
|
-
constructor(hostRef) {
|
|
12
|
-
index.registerInstance(this, hostRef);
|
|
13
|
-
this.itemChange = index.createEvent(this, "itemChange", 7);
|
|
14
|
-
this.showAliasInput = false;
|
|
15
|
-
this.showDescriptionInput = false;
|
|
16
|
-
this.handlePathChange = (event) => {
|
|
17
|
-
event.stopPropagation();
|
|
18
|
-
this.itemChange.emit(Object.assign(Object.assign({}, this.item), { path: event.detail }));
|
|
19
|
-
};
|
|
20
|
-
this.toggleAliasInput = () => {
|
|
21
|
-
this.showAliasInput = !this.showAliasInput;
|
|
22
|
-
};
|
|
23
|
-
this.toggleDescriptionInput = () => {
|
|
24
|
-
this.showDescriptionInput = !this.showDescriptionInput;
|
|
25
|
-
};
|
|
26
|
-
this.handleAliasChange = (event) => {
|
|
27
|
-
event.stopPropagation();
|
|
28
|
-
const alias = event.detail;
|
|
29
|
-
this.itemChange.emit(Object.assign(Object.assign({}, this.item), { alias: alias || undefined }));
|
|
30
|
-
};
|
|
31
|
-
this.handleDescriptionChange = (event) => {
|
|
32
|
-
event.stopPropagation();
|
|
33
|
-
const description = event.detail;
|
|
34
|
-
this.itemChange.emit(Object.assign(Object.assign({}, this.item), { description: description || undefined }));
|
|
35
|
-
};
|
|
36
|
-
this.handleAliasBlur = () => {
|
|
37
|
-
if (this.item.alias) {
|
|
38
|
-
const trimmed = this.item.alias.trim();
|
|
39
|
-
if (trimmed !== this.item.alias) {
|
|
40
|
-
this.itemChange.emit(Object.assign(Object.assign({}, this.item), { alias: trimmed || undefined }));
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
this.handleDescriptionBlur = () => {
|
|
45
|
-
if (this.item.description) {
|
|
46
|
-
const trimmed = this.item.description.trim();
|
|
47
|
-
if (trimmed !== this.item.description) {
|
|
48
|
-
this.itemChange.emit(Object.assign(Object.assign({}, this.item), { description: trimmed || undefined }));
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
this.handleRemove = () => {
|
|
53
|
-
this.itemChange.emit(null);
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
componentWillLoad() {
|
|
57
|
-
// Initialize visibility based on whether fields have values
|
|
58
|
-
this.showAliasInput = !!this.item.alias;
|
|
59
|
-
this.showDescriptionInput = !!this.item.description;
|
|
60
|
-
}
|
|
61
|
-
componentWillUpdate() {
|
|
62
|
-
// Keep inputs visible if they have values
|
|
63
|
-
if (this.item.alias && !this.showAliasInput) {
|
|
64
|
-
this.showAliasInput = true;
|
|
65
|
-
}
|
|
66
|
-
if (this.item.description && !this.showDescriptionInput) {
|
|
67
|
-
this.showDescriptionInput = true;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
render() {
|
|
71
|
-
return [
|
|
72
|
-
index.h("div", { key: '842362f9a9cfd48420409e53f0a8dc84048e383f', class: "property-controls" }, index.h("div", { key: '9f1b758ca0a6123e9acdff4ee4e1480b1938bb8b', class: "property-path" }, index.h("limebb-property-selector", { key: '3f4ca007b7131c94c57af2883638e19657e0a876', platform: this.platform, context: this.context, limetype: this.limetype, label: "Property", value: this.item.path, required: true, onChange: this.handlePathChange })), index.h("div", { key: 'c0141d13b1af44df29ad6502817330da6fe62283', class: "control-buttons" }, index.h("limel-icon-button", { key: '24aa415a1a1d91a46a251fb947fe071cd8f6e36f', icon: "add_tag", label: "Add alias", class: this.item.alias ? 'has-value' : '', onClick: this.toggleAliasInput }), index.h("limel-icon-button", { key: '4fa60916e5e179361c9fa6ab49fa06ce4c88ca66', icon: "comments", label: "Add description", class: this.item.description ? 'has-value' : '', onClick: this.toggleDescriptionInput }), index.h("limel-icon-button", { key: '03db71a330ccc905e37ffb9d8375bb6b774812b9', icon: "trash", label: "Remove property", onClick: this.handleRemove }))),
|
|
73
|
-
this.showAliasInput && (index.h("div", { key: 'bebaa718fd408dfdcce2f4cfe479e1b56325df86', class: "alias" }, index.h("limel-input-field", { key: '2a7c1e65558ef4f4892f854da04d7e083847defd', label: "Alias", value: this.item.alias || '', placeholder: "Custom property name...", onChange: this.handleAliasChange, onBlur: this.handleAliasBlur }))),
|
|
74
|
-
this.showDescriptionInput && (index.h("div", { key: 'b32b9b5006a9a48e44f5725f070f9bd376c8b15f', class: "description" }, index.h("limel-input-field", { key: '98f63d70cc77c68cbf535d33210a8d5e0c15cf72', label: "Description", value: this.item.description || '', placeholder: "Describe this property for AI...", onChange: this.handleDescriptionChange, onBlur: this.handleDescriptionBlur }))),
|
|
75
|
-
];
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
ResponseFormatItem.style = LimebbResponseFormatItemStyle0;
|
|
79
|
-
|
|
80
|
-
exports.limebb_response_format_item = ResponseFormatItem;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Components, JSX } from "../types/components";
|
|
2
|
-
|
|
3
|
-
interface LimebbResponseFormatEditor extends Components.LimebbResponseFormatEditor, HTMLElement {}
|
|
4
|
-
export const LimebbResponseFormatEditor: {
|
|
5
|
-
prototype: LimebbResponseFormatEditor;
|
|
6
|
-
new (): LimebbResponseFormatEditor;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Used to define this component and all nested components recursively.
|
|
10
|
-
*/
|
|
11
|
-
export const defineCustomElement: () => void;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Components, JSX } from "../types/components";
|
|
2
|
-
|
|
3
|
-
interface LimebbResponseFormatItem extends Components.LimebbResponseFormatItem, HTMLElement {}
|
|
4
|
-
export const LimebbResponseFormatItem: {
|
|
5
|
-
prototype: LimebbResponseFormatItem;
|
|
6
|
-
new (): LimebbResponseFormatItem;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Used to define this component and all nested components recursively.
|
|
10
|
-
*/
|
|
11
|
-
export const defineCustomElement: () => void;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-96dd111f.js';
|
|
2
|
-
|
|
3
|
-
const responseFormatItemCss = ":host(limebb-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%}}";
|
|
4
|
-
const LimebbResponseFormatItemStyle0 = responseFormatItemCss;
|
|
5
|
-
|
|
6
|
-
const ResponseFormatItem = class {
|
|
7
|
-
constructor(hostRef) {
|
|
8
|
-
registerInstance(this, hostRef);
|
|
9
|
-
this.itemChange = createEvent(this, "itemChange", 7);
|
|
10
|
-
this.showAliasInput = false;
|
|
11
|
-
this.showDescriptionInput = false;
|
|
12
|
-
this.handlePathChange = (event) => {
|
|
13
|
-
event.stopPropagation();
|
|
14
|
-
this.itemChange.emit(Object.assign(Object.assign({}, this.item), { path: event.detail }));
|
|
15
|
-
};
|
|
16
|
-
this.toggleAliasInput = () => {
|
|
17
|
-
this.showAliasInput = !this.showAliasInput;
|
|
18
|
-
};
|
|
19
|
-
this.toggleDescriptionInput = () => {
|
|
20
|
-
this.showDescriptionInput = !this.showDescriptionInput;
|
|
21
|
-
};
|
|
22
|
-
this.handleAliasChange = (event) => {
|
|
23
|
-
event.stopPropagation();
|
|
24
|
-
const alias = event.detail;
|
|
25
|
-
this.itemChange.emit(Object.assign(Object.assign({}, this.item), { alias: alias || undefined }));
|
|
26
|
-
};
|
|
27
|
-
this.handleDescriptionChange = (event) => {
|
|
28
|
-
event.stopPropagation();
|
|
29
|
-
const description = event.detail;
|
|
30
|
-
this.itemChange.emit(Object.assign(Object.assign({}, this.item), { description: description || undefined }));
|
|
31
|
-
};
|
|
32
|
-
this.handleAliasBlur = () => {
|
|
33
|
-
if (this.item.alias) {
|
|
34
|
-
const trimmed = this.item.alias.trim();
|
|
35
|
-
if (trimmed !== this.item.alias) {
|
|
36
|
-
this.itemChange.emit(Object.assign(Object.assign({}, this.item), { alias: trimmed || undefined }));
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
this.handleDescriptionBlur = () => {
|
|
41
|
-
if (this.item.description) {
|
|
42
|
-
const trimmed = this.item.description.trim();
|
|
43
|
-
if (trimmed !== this.item.description) {
|
|
44
|
-
this.itemChange.emit(Object.assign(Object.assign({}, this.item), { description: trimmed || undefined }));
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
this.handleRemove = () => {
|
|
49
|
-
this.itemChange.emit(null);
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
componentWillLoad() {
|
|
53
|
-
// Initialize visibility based on whether fields have values
|
|
54
|
-
this.showAliasInput = !!this.item.alias;
|
|
55
|
-
this.showDescriptionInput = !!this.item.description;
|
|
56
|
-
}
|
|
57
|
-
componentWillUpdate() {
|
|
58
|
-
// Keep inputs visible if they have values
|
|
59
|
-
if (this.item.alias && !this.showAliasInput) {
|
|
60
|
-
this.showAliasInput = true;
|
|
61
|
-
}
|
|
62
|
-
if (this.item.description && !this.showDescriptionInput) {
|
|
63
|
-
this.showDescriptionInput = true;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
render() {
|
|
67
|
-
return [
|
|
68
|
-
h("div", { key: '842362f9a9cfd48420409e53f0a8dc84048e383f', class: "property-controls" }, h("div", { key: '9f1b758ca0a6123e9acdff4ee4e1480b1938bb8b', class: "property-path" }, h("limebb-property-selector", { key: '3f4ca007b7131c94c57af2883638e19657e0a876', platform: this.platform, context: this.context, limetype: this.limetype, label: "Property", value: this.item.path, required: true, onChange: this.handlePathChange })), h("div", { key: 'c0141d13b1af44df29ad6502817330da6fe62283', class: "control-buttons" }, h("limel-icon-button", { key: '24aa415a1a1d91a46a251fb947fe071cd8f6e36f', icon: "add_tag", label: "Add alias", class: this.item.alias ? 'has-value' : '', onClick: this.toggleAliasInput }), h("limel-icon-button", { key: '4fa60916e5e179361c9fa6ab49fa06ce4c88ca66', icon: "comments", label: "Add description", class: this.item.description ? 'has-value' : '', onClick: this.toggleDescriptionInput }), h("limel-icon-button", { key: '03db71a330ccc905e37ffb9d8375bb6b774812b9', icon: "trash", label: "Remove property", onClick: this.handleRemove }))),
|
|
69
|
-
this.showAliasInput && (h("div", { key: 'bebaa718fd408dfdcce2f4cfe479e1b56325df86', class: "alias" }, h("limel-input-field", { key: '2a7c1e65558ef4f4892f854da04d7e083847defd', label: "Alias", value: this.item.alias || '', placeholder: "Custom property name...", onChange: this.handleAliasChange, onBlur: this.handleAliasBlur }))),
|
|
70
|
-
this.showDescriptionInput && (h("div", { key: 'b32b9b5006a9a48e44f5725f070f9bd376c8b15f', class: "description" }, h("limel-input-field", { key: '98f63d70cc77c68cbf535d33210a8d5e0c15cf72', label: "Description", value: this.item.description || '', placeholder: "Describe this property for AI...", onChange: this.handleDescriptionChange, onBlur: this.handleDescriptionBlur }))),
|
|
71
|
-
];
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
ResponseFormatItem.style = LimebbResponseFormatItemStyle0;
|
|
75
|
-
|
|
76
|
-
export { ResponseFormatItem as limebb_response_format_item };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as e}from"./p-1556b545.js";const s=class{constructor(e){t(this,e),this.itemChange=i(this,"itemChange",7),this.showAliasInput=!1,this.showDescriptionInput=!1,this.handlePathChange=t=>{t.stopPropagation(),this.itemChange.emit(Object.assign(Object.assign({},this.item),{path:t.detail}))},this.toggleAliasInput=()=>{this.showAliasInput=!this.showAliasInput},this.toggleDescriptionInput=()=>{this.showDescriptionInput=!this.showDescriptionInput},this.handleAliasChange=t=>{t.stopPropagation();const i=t.detail;this.itemChange.emit(Object.assign(Object.assign({},this.item),{alias:i||void 0}))},this.handleDescriptionChange=t=>{t.stopPropagation();const i=t.detail;this.itemChange.emit(Object.assign(Object.assign({},this.item),{description:i||void 0}))},this.handleAliasBlur=()=>{if(this.item.alias){const t=this.item.alias.trim();t!==this.item.alias&&this.itemChange.emit(Object.assign(Object.assign({},this.item),{alias:t||void 0}))}},this.handleDescriptionBlur=()=>{if(this.item.description){const t=this.item.description.trim();t!==this.item.description&&this.itemChange.emit(Object.assign(Object.assign({},this.item),{description:t||void 0}))}},this.handleRemove=()=>{this.itemChange.emit(null)}}componentWillLoad(){this.showAliasInput=!!this.item.alias,this.showDescriptionInput=!!this.item.description}componentWillUpdate(){this.item.alias&&!this.showAliasInput&&(this.showAliasInput=!0),this.item.description&&!this.showDescriptionInput&&(this.showDescriptionInput=!0)}render(){return[e("div",{key:"842362f9a9cfd48420409e53f0a8dc84048e383f",class:"property-controls"},e("div",{key:"9f1b758ca0a6123e9acdff4ee4e1480b1938bb8b",class:"property-path"},e("limebb-property-selector",{key:"3f4ca007b7131c94c57af2883638e19657e0a876",platform:this.platform,context:this.context,limetype:this.limetype,label:"Property",value:this.item.path,required:!0,onChange:this.handlePathChange})),e("div",{key:"c0141d13b1af44df29ad6502817330da6fe62283",class:"control-buttons"},e("limel-icon-button",{key:"24aa415a1a1d91a46a251fb947fe071cd8f6e36f",icon:"add_tag",label:"Add alias",class:this.item.alias?"has-value":"",onClick:this.toggleAliasInput}),e("limel-icon-button",{key:"4fa60916e5e179361c9fa6ab49fa06ce4c88ca66",icon:"comments",label:"Add description",class:this.item.description?"has-value":"",onClick:this.toggleDescriptionInput}),e("limel-icon-button",{key:"03db71a330ccc905e37ffb9d8375bb6b774812b9",icon:"trash",label:"Remove property",onClick:this.handleRemove}))),this.showAliasInput&&e("div",{key:"bebaa718fd408dfdcce2f4cfe479e1b56325df86",class:"alias"},e("limel-input-field",{key:"2a7c1e65558ef4f4892f854da04d7e083847defd",label:"Alias",value:this.item.alias||"",placeholder:"Custom property name...",onChange:this.handleAliasChange,onBlur:this.handleAliasBlur})),this.showDescriptionInput&&e("div",{key:"b32b9b5006a9a48e44f5725f070f9bd376c8b15f",class:"description"},e("limel-input-field",{key:"98f63d70cc77c68cbf535d33210a8d5e0c15cf72",label:"Description",value:this.item.description||"",placeholder:"Describe this property for AI...",onChange:this.handleDescriptionChange,onBlur:this.handleDescriptionBlur}))]}};s.style=":host(limebb-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%}}";export{s as limebb_response_format_item}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as i}from"./p-1556b545.js";import{Z as r,T as o}from"./p-4838284a.js";import{g as n,a as s}from"./p-b748c770.js";const l=new Set(["$yesterday","$now","$today","$tomorrow","$this_week","$this_month","$this_quarter","$this_year"]),a=/^\$(previous|next)_(day|week|month|quarter|year)\(\d+\)$/,d=/^\$me(\.\w+)*$/;function c(t,e,i=!0){const r=Object.keys(t),o=[];if(i){const t=r.filter((t=>t.startsWith("#")&&"#description"!==t));t.length>0&&o.push(`Property '${e}' contains # properties not supported in GUI: ${t.join(", ")}`)}return{keys:r.filter((t=>"_alias"!==t&&!t.startsWith("#"))),guiLimitations:o}}function u(t,e,i,r,o,n=!0){if(""===t){if(n&&null!==e)throw new Error("Empty property name must have null value");return[]}const s=i[t];if(!s)throw new Error(`Property '${t}' does not exist on limetype '${o}'`);return s.relation?function(t,e,i,r,o=!0){if(null===e)return[];if("object"!=typeof e)throw new TypeError(`Relation property '${t}' must be null or an object`);const n=e,{keys:s,guiLimitations:l}=c(n,t,o);if(0===s.length)return l;const a=r.relation.getLimetype();if(!a)throw new Error(`Could not determine related limetype for property '${t}'`);const d={};for(const t of s)d[t]=n[t];const u=h(d,i,a.name,o);return[...l,...u]}(t,e,r,s,n):function(t,e,i=!0){if(null===e)return[];if("object"==typeof e){const{keys:r,guiLimitations:o}=c(e,t,i);if(0===r.length)return o;throw new Error(`Non-relation property '${t}' cannot have nested properties other than _alias or # properties (got: ${r.join(", ")})`)}throw new Error(`Non-relation property '${t}' must be null or an object (got ${typeof e})`)}(t,e,n)}function h(t,e,i,r=!0){const o=e[i];if(!o)throw new Error(`Unknown limetype: ${i}`);const n=s(o),l=[];for(const[o,s]of Object.entries(t)){if(o.startsWith("#"))continue;const t=u(o,s,n,e,i,r);l.push(...t)}return l}function m(t,e,i,o=!0){t&&("key"in t?function(t,e,i){if(!Object.values(r).includes(t.op))throw new Error(`Unsupported filter operator: ${t.op}`);const o=function(t,e,i){if(function(t){return"string"==typeof t&&(l.has(t)||a.test(t)||d.test(t))}(t))return{valid:!0};if("string"!=typeof t||!t.startsWith("%activeObject%"))return{valid:!0};if(!e)return{valid:!0};const r=t.replace(/^%activeObject%\.?/,"");if(!r)return{valid:!0};try{return n(i,e,r)?{valid:!0}:{valid:!1,error:`Property path '${r}' does not exist on limetype '${e}'`}}catch(t){return{valid:!1,error:`Invalid placeholder path: ${t.message}`}}}(t.exp,e,i);if(!o.valid)throw new Error(`Invalid placeholder in filter '${t.key}': ${o.error}`)}(t,e,i):"exp"in t&&function(t,e,i,o){if(t.op!==r.AND&&t.op!==r.OR&&t.op!==r.NOT)throw new Error(`Unsupported group operator: ${t.op}`);if(t.op===r.NOT)m(t.exp,e,i,o);else if(t.op===r.AND||t.op===r.OR){const r=t.exp;for(const t of r)m(t,e,i,o)}}(t,e,i,o))}function p(t,e,i,r){const o=[],s=function(t,e){return"object"!=typeof t||null===t?`orderBy[${e}] must be an object`:null}(t,e);if(s)return[s];const l=Object.keys(t),a=function(t,e){return 0===t.length?`orderBy[${e}] must have a property path`:t.length>1?`orderBy[${e}] must have exactly one property, got ${t.length}`:null}(l,e);if(a)return[a];const d=l[0],c=function(t,e){return"ASC"!==t&&"DESC"!==t?`orderBy[${e}]: direction must be 'ASC' or 'DESC', got '${t}'`:null}(t[d],e);c&&o.push(c);const u=function(t,e,i,r){if(!t||""===t)return null;return n(e,i,t)?null:`orderBy[${r}]: property path '${t}' does not exist on limetype '${i}'`}(d,i,r,e);return u&&o.push(u),o}function f(t,e,i,r=!0){if(!t)return{valid:!0,guiSupported:!0,validationErrors:[],guiLimitations:[]};const o=[],n=[];if(t.limetype&&!e[t.limetype]&&o.push(`Unknown limetype: ${t.limetype}`),void 0===t.offset||t.orderBy||o.push("offset requires orderBy to be specified"),t.orderBy){const i=function(t,e,i){const r=[];if(!Array.isArray(t))return r.push("orderBy must be an array"),r;if(!i||!e[i])return r;for(const[o,n]of t.entries()){const t=p(n,o,e,i);r.push(...t)}return r}(t.orderBy,e,t.limetype);o.push(...i)}if(r&&void 0!==t.offset&&n.push("offset is not yet supported in GUI mode"),t.filter){const n=function(t,e,i,r){const o=[];try{m(t,e,i,r)}catch(t){o.push(`Invalid filter: ${t.message}`)}return o}(t.filter,i,e,r);o.push(...n)}if(t.responseFormat){const{errors:i,limitations:s}=function(t,e,i,r){const o=[],n=[];try{const o=function(t,e,i,r=!0){const o=[];if(r&&t.aggregates&&o.push("responseFormat.aggregates is not yet supported in GUI mode"),t.object){const n=h(t.object,e,i,r);o.push(...n)}return o}(t,e,i,r);n.push(...o)}catch(t){o.push(`Invalid responseFormat: ${t.message}`)}return{errors:o,limitations:n}}(t.responseFormat,e,t.limetype,r);o.push(...i),n.push(...s)}return{valid:0===o.length,guiSupported:0===n.length,validationErrors:o,guiLimitations:n}}const y=class{constructor(i){t(this,i),this.change=e(this,"change",7),this.mode="gui",this.codeValue="",this.limetype="",this.handleLimetypeChange=t=>{t.stopPropagation(),this.limetype=t.detail,this.filter=void 0,this.internalResponseFormat={object:{_id:null}},this.emitChange()},this.handleFilterChange=t=>{var e;t.stopPropagation(),this.filter=null!==(e=t.detail)&&void 0!==e?e:void 0,this.emitChange()},this.handleResponseFormatChange=t=>{t.stopPropagation(),this.internalResponseFormat=t.detail,this.emitChange()},this.handleLimitChange=t=>{t.stopPropagation();const e=t.detail;this.limit=e?Number.parseInt(e,10):void 0,this.emitChange()},this.handleOrderByChange=t=>{t.stopPropagation(),this.orderBy=t.detail,this.emitChange()},this.switchToGui=()=>{try{const t=JSON.parse(this.codeValue);if(!this.checkGuiSupport().guiSupported)return;this.limetype=t.limetype||"",this.filter=t.filter,this.internalResponseFormat=t.responseFormat,this.limit=t.limit,this.orderBy=t.orderBy,this.mode="gui",this.change.emit(t)}catch(t){}},this.switchToCode=()=>{this.updateCodeValue(),this.mode="code"},this.handleCodeChange=t=>{t.stopPropagation(),this.codeValue=t.detail;try{const t=JSON.parse(this.codeValue);this.change.emit(t)}catch(t){}}}get guiModeEnabled(){var t,e,i;return null!==(i=null===(e=null===(t=this.platform)||void 0===t?void 0:t.isFeatureEnabled)||void 0===e?void 0:e.call(t,"useLimeQueryBuilderGuiMode"))&&void 0!==i&&i}componentWillLoad(){if(!this.guiModeEnabled)return this.mode="code",void this.updateCodeValue();this.value&&(this.limetype=this.value.limetype||"",this.filter=this.value.filter,this.internalResponseFormat=this.value.responseFormat,this.limit=this.value.limit,this.orderBy=this.value.orderBy),this.updateCodeValue(),this.checkGuiSupport().guiSupported||(this.mode="code")}render(){const t=this.checkGuiSupport(),e=!this.guiModeEnabled||"code"===this.mode;return i("div",{key:"f51ae0459c1c7f482f3a790abb4cc3bd60b83e70",class:"lime-query-builder"},this.renderLabel(),this.renderModeControls(t),e?this.renderCodeMode(t):this.renderGuiMode())}emitChange(){"code"!==this.mode&&this.limetype&&this.change.emit(this.buildLimeQuery())}updateCodeValue(){this.codeValue=this.limetype?JSON.stringify(this.buildLimeQuery(),null,2):JSON.stringify(this.value||{},null,2)}buildLimeQuery(){const t={limetype:this.limetype,responseFormat:this.internalResponseFormat||{object:{_id:null}},filter:this.filter};return void 0!==this.limit&&this.limit>0&&(t.limit=this.limit),this.orderBy&&this.orderBy.length>0&&(t.orderBy=this.orderBy),t}checkGuiSupport(){if(!this.limetypes)return{valid:!0,guiSupported:!0,validationErrors:[],guiLimitations:[]};let t;if("code"===this.mode&&this.codeValue)try{t=JSON.parse(this.codeValue)}catch(t){return{valid:!1,guiSupported:!1,validationErrors:["Invalid JSON"],guiLimitations:[]}}else{if(!this.limetype)return{valid:!0,guiSupported:!0,validationErrors:[],guiLimitations:[]};t={limetype:this.limetype,responseFormat:this.internalResponseFormat||{object:{_id:null}},filter:this.filter},void 0!==this.limit&&this.limit>0&&(t.limit=this.limit)}return f(t,this.limetypes,this.activeLimetype,this.guiModeEnabled)}renderModeSwitch(t){return i("div",{class:"mode-switch"},i("limel-button",{label:"GUI",primary:"gui"===this.mode,disabled:!t.guiSupported,onClick:this.switchToGui}),i("limel-button",{label:"Code",primary:"code"===this.mode,onClick:this.switchToCode}))}renderCodeEditor(t){return i("div",{class:"code-editor-container"},i("limel-code-editor",{value:this.codeValue,language:"json",lineNumbers:!0,fold:!0,lint:!0,onChange:this.handleCodeChange}),!t.valid&&t.validationErrors.length>0&&i("div",{class:"validation-errors"},i("strong",null,"Invalid Lime Query:"),i("ul",null,t.validationErrors.map((t=>i("li",null,t))))),this.guiModeEnabled&&t.valid&&!t.guiSupported&&t.guiLimitations.length>0&&i("div",{class:"gui-limitations"},i("strong",null,"Cannot switch to GUI mode:"),i("ul",null,t.guiLimitations.map((t=>i("li",null,t))))))}renderLimetypeSection(){return i("div",{class:"limetype-section"},i("limebb-limetype-field",{platform:this.platform,context:this.context,label:"Object Type",value:this.limetype,required:!0,fieldName:"limetype",helperText:"Select the type of object you want to query",onChange:this.handleLimetypeChange}))}renderResponseFormatSection(){if(this.limetype)return i("div",{class:"response-format-section"},i("limebb-response-format-editor",{platform:this.platform,context:this.context,limetype:this.limetype,value:this.internalResponseFormat,onChange:this.handleResponseFormatChange}))}renderFilterSection(){if(this.limetype)return i("div",{class:"filter-section"},i("h4",{class:"section-label"},"Filter Conditions"),i("limebb-lime-query-filter-builder",{platform:this.platform,context:this.context,limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.filter,onExpressionChange:this.handleFilterChange}))}renderQueryOptionsSection(){var t;if(this.limetype)return i("div",{class:"query-options-section"},i("h4",{class:"section-label"},"Query Options"),i("div",{class:"query-options-controls"},i("limel-input-field",{label:"Limit",type:"number",value:(null===(t=this.limit)||void 0===t?void 0:t.toString())||"",placeholder:"No limit",helperText:"Maximum number of results",onChange:this.handleLimitChange}),i("limebb-lime-query-order-by-editor",{platform:this.platform,context:this.context,limetype:this.limetype,value:this.orderBy,onChange:this.handleOrderByChange})))}renderGuiMode(){return i("div",{class:"gui-mode"},this.renderLimetypeSection(),this.renderResponseFormatSection(),this.renderFilterSection(),this.renderQueryOptionsSection())}renderLabel(){if(this.label)return i("h3",{class:"lime-query-builder-label"},this.label)}renderModeControls(t){if(this.guiModeEnabled)return i("div",{class:"mode-controls"},this.renderModeSwitch(t))}renderCodeMode(t){return i("div",{class:"code-mode"},this.renderCodeEditor(t))}};(function(t,e,i,r){var o,n=arguments.length,s=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,r);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(s=(n<3?o(s):n>3?o(e,i,s):o(e,i))||s);n>3&&s&&Object.defineProperty(e,i,s)})([o()],y.prototype,"limetypes",void 0),y.style=":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}}";export{y as limebb_lime_query_builder}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as i}from"./p-1556b545.js";import{Z as r,T as s}from"./p-4838284a.js";import{g as l}from"./p-b748c770.js";const o=class{constructor(s){e(this,s),this.expressionChange=t(this,"expressionChange",7),this.renderChildExpression=(e,t)=>i("li",null,i("limebb-lime-query-filter-expression",{platform:this.platform,context:this.context,limetype:this.limetype,activeLimetype:this.activeLimetype,expression:e,onExpressionChange:this.handleExpressionChange(t)})),this.handleToggleOperator=()=>{this.expressionChange.emit({op:this.expression.op===r.AND?r.OR:r.AND,exp:this.expression.exp})},this.handleAddChildExpression=()=>{this.expressionChange.emit({op:this.expression.op,exp:[...this.expression.exp,{key:"",op:r.EQUALS,exp:""}]})},this.handleAddChildGroup=()=>{this.expressionChange.emit({op:this.expression.op,exp:[...this.expression.exp,{op:this.expression.op===r.AND?r.OR:r.AND,exp:[{key:"",op:r.EQUALS,exp:""}]}]})},this.handleExpressionChange=e=>t=>{t.stopPropagation();const i=t.detail,r=[...this.expression.exp];if(void 0===i){if(r.splice(e,1),0===r.length)return void this.expressionChange.emit(void 0);if(1===r.length)return void this.expressionChange.emit(r[0])}else r[e]=i;this.expressionChange.emit({op:this.expression.op,exp:r})}}render(){const e=this.getSubheading();return i("div",{key:"0ed5a1403d9641926cd6d474910cedf9c7bba89e",class:"expression"},e&&i("limel-header",{key:"ea88a97df09f0fb5a21bf9afb4745256a611c7f8",subheading:e,onClick:this.handleToggleOperator,class:"clickable-header"}),i("ul",{key:"cfbcdd539e84f79bf1d778e075cd3317d7409647"},this.expression.exp.map(this.renderChildExpression),i("li",{key:"ec443459245bf5852920bb4d3e341f2490a7b75b",class:"add-button"},this.renderAddButton(),this.renderAddGroupButton())))}getSubheading(){return this.expression.exp.length<=1?"":this.expression.op===r.AND?"All of these conditions are true":"Any of these conditions are true"}renderAddButton(){const e=this.getAddButtonLabel();return i("limel-button",{label:e,icon:"plus_math",onClick:this.handleAddChildExpression})}renderAddGroupButton(){const e=this.getAddGroupButtonLabel();return i("limel-button",{label:e,icon:"tree_structure",onClick:this.handleAddChildGroup})}getAddButtonLabel(){return 0===this.expression.exp.length?"Add a condition":this.expression.op===r.AND?"Add another condition":"Add alternative"}getAddGroupButtonLabel(){return 0===this.expression.exp.length?"Add a group":this.expression.op===r.AND?"Add another group":"Add alternative group"}};o.style='@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}';const n=class{constructor(i){e(this,i),this.expressionChange=t(this,"expressionChange",7),this.handleExpressionChange=e=>{var t;e.stopPropagation();const i=null!==(t=e.detail)&&void 0!==t?t:void 0;this.expressionChange.emit(void 0!==i?{op:r.NOT,exp:i}:void 0)}}render(){return i("div",{key:"9ab4a6b1e99668a0bcee3e3ba8cbbbe5185222e0",class:"expression"},this.label&&i("limel-header",{key:"85e997b0f96db306dd7a4433da959a74303aacfa",heading:this.label}),i("limebb-lime-query-filter-expression",{key:"14f634e125ee78f2aa70c7537b270a31699ba7c2",platform:this.platform,context:this.context,label:"Not",limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.expression.exp,onExpressionChange:this.handleExpressionChange}))}};n.style='@charset "UTF-8";.expression{display:flex;flex-direction:column;margin-bottom:1rem;gap:1rem;padding:1rem;border-left:0.25rem solid rgb(var(--contrast-400));background-color:rgb(var(--contrast-100))}';const a=class{constructor(i){e(this,i),this.change=t(this,"change",7),this.label="Value",this.inputMode="value",this.handleTextChange=e=>{e.stopPropagation();const t=e.detail,i=Number(t);Number.isNaN(i)||""===t?this.change.emit(t):this.change.emit(i)},this.handleSelectChange=e=>{e.stopPropagation();const t=e.detail;Array.isArray(t)?this.change.emit(t.map((e=>e.value))):this.change.emit(null==t?void 0:t.value)},this.handleBooleanChange=e=>{e.stopPropagation();const t=e.detail;Array.isArray(t)||this.change.emit("true"===(null==t?void 0:t.value))},this.handleDateChange=e=>{e.stopPropagation();const t=e.detail;this.change.emit(t?t.toISOString():null)},this.handleMultiValueChange=e=>{e.stopPropagation();const t=e.detail.split(",").map((e=>e.trim())).filter((e=>e.length>0));this.change.emit(t)},this.handleModeToggle=()=>{"value"===this.inputMode?(this.inputMode="placeholder",this.change.emit("%activeObject%")):(this.inputMode="value",this.change.emit(""))},this.handlePlaceholderPropertyChange=e=>{e.stopPropagation();const t=this.buildPlaceholderValue(e.detail);this.change.emit(t)}}componentWillLoad(){this.isPlaceholder(this.value)&&(this.inputMode="placeholder")}componentWillUpdate(){this.isPlaceholder(this.value)&&"placeholder"!==this.inputMode?this.inputMode="placeholder":this.isPlaceholder(this.value)||"placeholder"!==this.inputMode||(this.inputMode="value")}isPlaceholder(e){return"string"==typeof e&&e.startsWith("%activeObject%")}parsePlaceholderPath(e){return this.isPlaceholder(e)?e.replace(/^%activeObject%\.?/,""):""}buildPlaceholderValue(e){return e?`%activeObject%.${e}`:"%activeObject%"}render(){return this.operator?i("div",{class:"value-input-container"},this.renderModeToggle(),"placeholder"===this.inputMode?this.renderPlaceholderInput():this.renderValueInputByType()):null}renderModeToggle(){if(!this.activeLimetype)return null;const e="placeholder"===this.inputMode;return i("limel-icon-button",{class:"mode-toggle",icon:e?"text":"link",label:e?"Use Value":"Use Placeholder",onClick:this.handleModeToggle})}renderPlaceholderInput(){const e=this.parsePlaceholderPath(this.value);return i("div",{class:"placeholder-input"},i("limebb-property-selector",{platform:this.platform,context:this.context,limetype:this.activeLimetype,label:"Active Object Property",value:e,required:!1,helperText:"Select property from the active object",onChange:this.handlePlaceholderPropertyChange}),this.isPlaceholder(this.value)&&i("div",{class:"placeholder-preview"},i("limel-icon",{name:"info",size:"small"}),i("span",null,"Placeholder: ",this.value)))}renderValueInputByType(){if(this.operator===r.IN)return this.renderMultiValueInput();const e=this.getProperty();if(!e)return this.renderTextInput();switch(e.type){case"integer":case"decimal":return this.renderNumberInput(e.type);case"yesno":return this.renderBooleanInput();case"option":return this.renderOptionInput(e);case"date":return this.renderDateInput();case"time":return this.renderTimeInput();default:return this.renderTextInput()}}renderTextInput(){var e;return i("limel-input-field",{label:this.label,value:(null===(e=this.value)||void 0===e?void 0:e.toString())||"",placeholder:"Enter value",onChange:this.handleTextChange})}renderNumberInput(e){var t;const r="integer"===e?1:.01;return i("limel-input-field",{label:this.label,type:"number",value:(null===(t=this.value)||void 0===t?void 0:t.toString())||"",step:r,onChange:this.handleTextChange})}renderBooleanInput(){const e=[{text:"True",value:"true"},{text:"False",value:"false"}],t=!0===this.value||"true"===this.value?"true":"false",r=e.find((e=>e.value===t));return i("limel-select",{label:this.label,options:e,value:r,onChange:this.handleBooleanChange})}renderOptionInput(e){if(!e.options||0===e.options.length)return this.renderTextInput();const t=e.options.map((e=>({text:e.text||e.key,value:e.key}))),r=t.find((e=>e.value===this.value));return i("limel-select",{label:this.label,options:t,value:r,onChange:this.handleSelectChange})}renderDateInput(){const e="string"==typeof this.value?new Date(this.value):this.value;return i("limel-date-picker",{label:this.label,value:e,onChange:this.handleDateChange})}renderTimeInput(){return i("limel-input-field",{label:this.label,type:"time",value:this.value||"",onChange:this.handleTextChange})}renderMultiValueInput(){const e=Array.isArray(this.value)?this.value.join(", "):this.value||"";return i("limel-input-field",{label:this.label+" (comma-separated)",value:e,placeholder:"e.g., won, lost, tender",onChange:this.handleMultiValueChange})}getProperty(){if(this.limetypes&&this.limetype&&this.propertyPath)return l(this.limetypes,this.limetype,this.propertyPath)}};(function(e,t,i,r){var s,l=arguments.length,o=l<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(o=(l<3?s(o):l>3?s(t,i,o):s(t,i))||o);l>3&&o&&Object.defineProperty(t,i,o)})([s()],a.prototype,"limetypes",void 0),a.style=":host{display:block}.value-input-container{display:flex;flex-direction:row;align-items:flex-start;gap:0.5rem;width:100%}.mode-toggle{flex-shrink:0;margin-top:0.5rem;opacity:0.7;transition:opacity 0.2s ease}.mode-toggle:hover{opacity:1}.placeholder-input{flex-grow:1;display:flex;flex-direction:column;gap:0.5rem}.placeholder-preview{display:flex;align-items:center;gap:0.5rem;padding:0.5rem;background-color:rgba(var(--color-blue-light), 0.1);border-radius:var(--border-radius-small);font-size:0.875rem;color:rgb(var(--color-blue-default));border-left:3px solid rgb(var(--color-blue-default))}.placeholder-preview limel-icon{flex-shrink:0;color:rgb(var(--color-blue-default))}.placeholder-preview span{font-family:var(--font-monospace);word-break:break-all}";export{o as limebb_lime_query_filter_group,n as limebb_lime_query_filter_not,a as limebb_lime_query_value_input}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as i}from"./p-1556b545.js";const o=class{constructor(i){e(this,i),this.itemChange=t(this,"itemChange",7),this.handlePathChange=e=>{e.stopPropagation();const t=e.detail;if(!t){const e=this.item[Object.keys(this.item)[0]]||"ASC";return void this.itemChange.emit({"":e})}const i=Object.keys(this.item)[0],o=this.item[i]||"ASC";this.itemChange.emit({[t]:o})},this.handleToggleDirection=()=>{const e=Object.keys(this.item)[0]||"",t="ASC"===(this.item[e]||"ASC")?"DESC":"ASC";this.itemChange.emit({[e]:t})},this.handleRemove=()=>{this.itemChange.emit(null)}}render(){const e=Object.keys(this.item)[0]||"",t=this.item[e]||"ASC";return i("div",{key:"e0faeb5b370d8aba00a668f0861e8e1cb4eec495",class:"order-by-controls"},i("div",{key:"d013e829ca193b6ce9cc3756c3700584984f4478",class:"property-path"},i("limebb-property-selector",{key:"11dee28e5de28d0dc6934abdfe613e87a8b8fbed",platform:this.platform,context:this.context,limetype:this.limetype,label:"Property",value:e,required:!0,onChange:this.handlePathChange})),i("div",{key:"66aa416b1f9683a15357d609e3685379d8993733",class:"control-buttons"},i("limel-icon-button",{key:"360f271ecd3cf42581ae21617d297c84ee93569e",icon:"ASC"===t?"sort_ascending":"sort_descending",label:"ASC"===t?"Ascending":"Descending",onClick:this.handleToggleDirection}),i("limel-icon-button",{key:"3cbb13bff679a0ca95bb30b7853551b8bc276520",icon:"trash",label:"Remove",onClick:this.handleRemove})))}};o.style=":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}}";export{o as limebb_lime_query_order_by_item}
|