@limetech/lime-crm-building-blocks 1.102.1 → 1.102.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +37 -26
- package/dist/cjs/limebb-lime-query-filter-builder_3.cjs.entry.js +3 -3
- package/dist/cjs/limebb-lime-query-filter-group_3.cjs.entry.js +26 -2
- package/dist/cjs/limebb-lime-query-order-by-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-lime-query-response-format-builder.cjs.entry.js +23 -3
- package/dist/cjs/limebb-lime-query-response-format-editor_2.cjs.entry.js +28 -6
- package/dist/cjs/limebb-property-selector.cjs.entry.js +3 -5
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-builder.css +8 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.css +2 -1
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.js +26 -1
- package/dist/collection/components/lime-query-builder/lime-query-builder.css +4 -16
- package/dist/collection/components/lime-query-builder/lime-query-builder.js +36 -25
- package/dist/collection/components/lime-query-builder/lime-query-response-format-builder.css +1 -18
- package/dist/collection/components/lime-query-builder/lime-query-response-format-builder.js +22 -2
- package/dist/collection/components/lime-query-builder/order-by/order-by-editor.css +2 -3
- package/dist/collection/components/lime-query-builder/order-by/order-by-editor.js +1 -1
- package/dist/collection/components/lime-query-builder/order-by/order-by-item.css +1 -5
- package/dist/collection/components/lime-query-builder/property-selector/property-selector.js +3 -5
- package/dist/collection/components/lime-query-builder/response-format/response-format-editor.css +13 -17
- package/dist/collection/components/lime-query-builder/response-format/response-format-editor.js +1 -1
- package/dist/collection/components/lime-query-builder/response-format/response-format-item.css +4 -11
- package/dist/collection/components/lime-query-builder/response-format/response-format-item.js +25 -3
- package/dist/components/lime-query-filter-builder.js +1 -1
- package/dist/components/lime-query-filter-expression.js +26 -2
- package/dist/components/limebb-lime-query-builder.js +37 -26
- package/dist/components/limebb-lime-query-response-format-builder.js +23 -3
- package/dist/components/order-by-editor.js +2 -2
- package/dist/components/order-by-item.js +1 -1
- package/dist/components/property-selector.js +3 -5
- package/dist/components/response-format-editor.js +2 -2
- package/dist/components/response-format-item.js +26 -4
- package/dist/esm/limebb-lime-query-builder.entry.js +37 -26
- package/dist/esm/limebb-lime-query-filter-builder_3.entry.js +3 -3
- package/dist/esm/limebb-lime-query-filter-group_3.entry.js +26 -2
- package/dist/esm/limebb-lime-query-order-by-item.entry.js +1 -1
- package/dist/esm/limebb-lime-query-response-format-builder.entry.js +23 -3
- package/dist/esm/limebb-lime-query-response-format-editor_2.entry.js +28 -6
- package/dist/esm/limebb-property-selector.entry.js +3 -5
- package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/p-1f76540e.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-2d5f83bc.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-3384f1ee.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-5c693302.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-8917c472.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-9167bc6c.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-e5549e10.entry.js +1 -0
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-group.d.ts +3 -0
- package/dist/types/components/lime-query-builder/lime-query-builder.d.ts +2 -2
- package/dist/types/components/lime-query-builder/lime-query-response-format-builder.d.ts +1 -0
- package/dist/types/components/lime-query-builder/response-format/response-format-item.d.ts +2 -0
- package/package.json +1 -1
- package/dist/lime-crm-building-blocks/p-289ce8b9.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-3351395b.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-33e6d0ec.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-7731e1b0.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-abfc7815.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-be845252.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-cb338753.entry.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { d as defineCustomElement$1 } from './property-selector.js';
|
|
3
3
|
|
|
4
|
-
const responseFormatItemCss = ":host(limebb-lime-query-response-format-item){display:flex;flex-direction:column;gap:0.5rem
|
|
4
|
+
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%}}";
|
|
5
5
|
const LimebbLimeQueryResponseFormatItemStyle0 = responseFormatItemCss;
|
|
6
6
|
|
|
7
7
|
const ResponseFormatItem = /*@__PURE__*/ proxyCustomElement(class ResponseFormatItem extends HTMLElement {
|
|
@@ -68,11 +68,33 @@ const ResponseFormatItem = /*@__PURE__*/ proxyCustomElement(class ResponseFormat
|
|
|
68
68
|
}
|
|
69
69
|
render() {
|
|
70
70
|
return [
|
|
71
|
-
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: '
|
|
72
|
-
this.showAliasInput && (h("div", { key: '
|
|
73
|
-
this.showDescriptionInput && (h("div", { key: '
|
|
71
|
+
h("div", { key: 'e804c4feb61b44aeb2f141c5b5d3269a76ac9320', class: "property-controls" }, h("div", { key: 'becbf35e823b8b16df5366c099b98ce6566d514a', class: "property-path" }, h("limebb-property-selector", { key: '2b35ccefecb9dbd4d2c418566482d9903a1c0d02', platform: this.platform, context: this.context, limetype: this.limetype, label: "Property", value: this.item.path, required: true, onChange: this.handlePathChange })), h("div", { key: '1e598bbbb6df1c5e93bd4ae5f6b112a745a68df9', class: "control-buttons" }, h("limel-icon-button", { key: '51d3dfaa9f3578802abf6f65ec876535740ae6a5', icon: this.getAliasIcon(), label: "Add alias", class: this.item.alias ? 'has-value' : '', onClick: this.toggleAliasInput }), h("limel-icon-button", { key: 'b2f6050b01d810cc20093e87a09452c625cd7847', icon: this.getDescriptionIcon(), label: "Add description", class: this.item.description ? 'has-value' : '', onClick: this.toggleDescriptionInput }), h("limel-icon-button", { key: 'cd58b575c383555db343ebe4a22392c51346751e', icon: "trash", label: "Remove property", onClick: this.handleRemove }))),
|
|
72
|
+
this.showAliasInput && (h("div", { key: 'cd95aa0e34945eb9da88e4be4e4c2326c41ec090', class: "alias" }, h("limel-input-field", { key: 'f62646327adfb8fcd3f0f2aa3a5325ad8a3bfcc3', label: "Alias", value: this.item.alias || '', placeholder: "Custom property name...", onChange: this.handleAliasChange, onBlur: this.handleAliasBlur }))),
|
|
73
|
+
this.showDescriptionInput && (h("div", { key: 'b00f9859a80df3aacf3f524fc1451473e5fcdf5a', class: "description" }, h("limel-input-field", { key: '044485f6a35f84816e7458a08882a40aaeacf2f4', label: "Description", value: this.item.description || '', placeholder: "Describe this property for AI...", onChange: this.handleDescriptionChange, onBlur: this.handleDescriptionBlur }))),
|
|
74
74
|
];
|
|
75
75
|
}
|
|
76
|
+
getAliasIcon() {
|
|
77
|
+
const defaultIcon = {
|
|
78
|
+
name: 'add_tag',
|
|
79
|
+
color: 'rgb(var(--color-gray-600))',
|
|
80
|
+
};
|
|
81
|
+
const toggledIcon = {
|
|
82
|
+
name: 'add_tag',
|
|
83
|
+
color: 'rgb(var(--color-teal-default))',
|
|
84
|
+
};
|
|
85
|
+
return this.showAliasInput ? toggledIcon : defaultIcon;
|
|
86
|
+
}
|
|
87
|
+
getDescriptionIcon() {
|
|
88
|
+
const defaultIcon = {
|
|
89
|
+
name: 'comments',
|
|
90
|
+
color: 'rgb(var(--color-gray-600))',
|
|
91
|
+
};
|
|
92
|
+
const toggledIcon = {
|
|
93
|
+
name: 'comments',
|
|
94
|
+
color: 'rgb(var(--color-teal-default))',
|
|
95
|
+
};
|
|
96
|
+
return this.showDescriptionInput ? toggledIcon : defaultIcon;
|
|
97
|
+
}
|
|
76
98
|
static get style() { return LimebbLimeQueryResponseFormatItemStyle0; }
|
|
77
99
|
}, [1, "limebb-lime-query-response-format-item", {
|
|
78
100
|
"platform": [16],
|
|
@@ -3,7 +3,7 @@ import { T as Te } from './index.esm-bb569663.js';
|
|
|
3
3
|
import { i as isLimeQuerySupported } from './lime-query-validation-573223a5.js';
|
|
4
4
|
import './property-resolution-c21a1369.js';
|
|
5
5
|
|
|
6
|
-
const limeQueryBuilderCss = ":host(limebb-lime-lime-query-builder){display:block;width:100%}.lime-query-builder{display:flex;flex-direction:column;gap:
|
|
6
|
+
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}}";
|
|
7
7
|
const LimebbLimeQueryBuilderStyle0 = limeQueryBuilderCss;
|
|
8
8
|
|
|
9
9
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -58,33 +58,33 @@ const LimeQueryBuilder = class {
|
|
|
58
58
|
this.orderBy = event.detail;
|
|
59
59
|
this.emitChange();
|
|
60
60
|
};
|
|
61
|
-
this.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
61
|
+
this.handleChange = (event) => {
|
|
62
|
+
event.stopPropagation();
|
|
63
|
+
const mode = event.detail.id;
|
|
64
|
+
if (mode === 'gui') {
|
|
65
|
+
try {
|
|
66
|
+
const parsed = JSON.parse(this.codeValue);
|
|
67
|
+
const support = this.checkGuiSupport();
|
|
68
|
+
if (!support.guiSupported) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
this.limetype = parsed.limetype || '';
|
|
72
|
+
this.filter = parsed.filter;
|
|
73
|
+
this.internalResponseFormat = parsed.responseFormat;
|
|
74
|
+
this.limit = parsed.limit;
|
|
75
|
+
this.orderBy = parsed.orderBy;
|
|
76
|
+
this.mode = 'gui';
|
|
77
|
+
this.change.emit(parsed);
|
|
78
|
+
}
|
|
79
|
+
catch (_a) {
|
|
80
|
+
// Don't switch if JSON is invalid
|
|
70
81
|
}
|
|
71
|
-
// Update internal state from parsed query
|
|
72
|
-
this.limetype = parsed.limetype || '';
|
|
73
|
-
this.filter = parsed.filter;
|
|
74
|
-
this.internalResponseFormat = parsed.responseFormat;
|
|
75
|
-
this.limit = parsed.limit;
|
|
76
|
-
this.orderBy = parsed.orderBy;
|
|
77
|
-
this.mode = 'gui';
|
|
78
|
-
this.change.emit(parsed);
|
|
79
82
|
}
|
|
80
|
-
|
|
81
|
-
|
|
83
|
+
else if (mode === 'code') {
|
|
84
|
+
this.updateCodeValue();
|
|
85
|
+
this.mode = 'code';
|
|
82
86
|
}
|
|
83
87
|
};
|
|
84
|
-
this.switchToCode = () => {
|
|
85
|
-
this.updateCodeValue();
|
|
86
|
-
this.mode = 'code';
|
|
87
|
-
};
|
|
88
88
|
this.handleCodeChange = (event) => {
|
|
89
89
|
event.stopPropagation();
|
|
90
90
|
this.codeValue = event.detail;
|
|
@@ -98,6 +98,16 @@ const LimeQueryBuilder = class {
|
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
+
// Buttons are generated dynamically in renderModeSwitch to allow disabling
|
|
102
|
+
getButtons() {
|
|
103
|
+
return [
|
|
104
|
+
{
|
|
105
|
+
id: 'gui',
|
|
106
|
+
title: 'Visual',
|
|
107
|
+
},
|
|
108
|
+
{ id: 'code', title: 'Code' },
|
|
109
|
+
];
|
|
110
|
+
}
|
|
101
111
|
get guiModeEnabled() {
|
|
102
112
|
var _a, _b, _c;
|
|
103
113
|
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);
|
|
@@ -128,7 +138,7 @@ const LimeQueryBuilder = class {
|
|
|
128
138
|
render() {
|
|
129
139
|
const guiSupported = this.checkGuiSupport();
|
|
130
140
|
const showCodeMode = !this.guiModeEnabled || this.mode === 'code';
|
|
131
|
-
return (h("div", { key: '
|
|
141
|
+
return (h("div", { key: '5e9c8bb860cf348b08272831bc2e252752fad24d', class: "lime-query-builder" }, this.renderLabel(), this.renderModeControls(guiSupported), showCodeMode
|
|
132
142
|
? this.renderCodeMode(guiSupported)
|
|
133
143
|
: this.renderGuiMode()));
|
|
134
144
|
}
|
|
@@ -223,7 +233,8 @@ const LimeQueryBuilder = class {
|
|
|
223
233
|
}
|
|
224
234
|
renderModeSwitch(support) {
|
|
225
235
|
const guiDisabled = !support.guiSupported;
|
|
226
|
-
|
|
236
|
+
const buttons = this.getButtons().map((button) => (Object.assign(Object.assign({}, button), { selected: button.id === this.mode })));
|
|
237
|
+
return (h("limel-button-group", { onChange: this.handleChange, value: buttons, disabled: guiDisabled }));
|
|
227
238
|
}
|
|
228
239
|
renderCodeEditor(guiSupported) {
|
|
229
240
|
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 &&
|
|
@@ -65,7 +65,7 @@ function isEqual(value, other) {
|
|
|
65
65
|
return baseIsEqual(value, other);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
const limeQueryFilterBuilderCss = ".expression-with-promotion{display:flex;flex-direction:column;gap:1rem}";
|
|
68
|
+
const limeQueryFilterBuilderCss = ".expression-with-promotion{display:flex;flex-direction:column;gap:1rem}limel-button{width:100%}.query-options-section{margin-top:1rem}";
|
|
69
69
|
const LimebbLimeQueryFilterBuilderStyle0 = limeQueryFilterBuilderCss;
|
|
70
70
|
|
|
71
71
|
const LimeQueryFilterBuilderComponent = class {
|
|
@@ -135,7 +135,7 @@ const LimeQueryFilterBuilderComponent = class {
|
|
|
135
135
|
};
|
|
136
136
|
LimeQueryFilterBuilderComponent.style = LimebbLimeQueryFilterBuilderStyle0;
|
|
137
137
|
|
|
138
|
-
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;
|
|
138
|
+
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}";
|
|
139
139
|
const LimebbLimeQueryOrderByEditorStyle0 = orderByEditorCss;
|
|
140
140
|
|
|
141
141
|
const OrderByEditor = class {
|
|
@@ -204,7 +204,7 @@ const OrderByEditor = class {
|
|
|
204
204
|
return (h("div", { class: "order-by-list" }, this.items.map((item, index) => this.renderItem(item, index))));
|
|
205
205
|
}
|
|
206
206
|
renderActions() {
|
|
207
|
-
return (h("
|
|
207
|
+
return (h("limel-button", { label: "Add Sort Field", icon: "plus_math", onClick: this.handleAddSortField }));
|
|
208
208
|
}
|
|
209
209
|
renderItem(item, index) {
|
|
210
210
|
const propertyPath = Object.keys(item)[0] || '';
|
|
@@ -152,13 +152,16 @@ function updateChildExpression(group, childIndex, updatedChild) {
|
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
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;
|
|
155
|
+
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}";
|
|
156
156
|
const LimebbLimeQueryFilterGroupStyle0 = limeQueryFilterGroupCss;
|
|
157
157
|
|
|
158
158
|
const LimeQueryFilterGroupComponent = class {
|
|
159
159
|
constructor(hostRef) {
|
|
160
160
|
registerInstance(this, hostRef);
|
|
161
161
|
this.expressionChange = createEvent(this, "expressionChange", 7);
|
|
162
|
+
this.renderActionButton = (action) => {
|
|
163
|
+
return (h("limel-icon-button", { class: "action-icon", elevated: true, icon: action.icon, label: action.label, onClick: this.handleToggleOperator }));
|
|
164
|
+
};
|
|
162
165
|
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) })));
|
|
163
166
|
this.handleToggleOperator = () => {
|
|
164
167
|
const newGroup = toggleGroupOperator(this.expression);
|
|
@@ -183,7 +186,28 @@ const LimeQueryFilterGroupComponent = class {
|
|
|
183
186
|
}
|
|
184
187
|
render() {
|
|
185
188
|
const subheading = this.getSubheading();
|
|
186
|
-
return (h("div", { key: '
|
|
189
|
+
return (h("div", { key: 'b7972fb9e34b8b0b57ae82b3bf4de3e55b66169f', class: "expression" }, subheading && (h("limel-header", { key: '9721388fa6a60018f95dbe27b2959dcc1c11211e', icon: {
|
|
190
|
+
name: this.expression.op === Zt.AND
|
|
191
|
+
? 'dot_bricks'
|
|
192
|
+
: 'dot_circle',
|
|
193
|
+
color: 'rgb(var(--contrast-800))',
|
|
194
|
+
}, 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()))));
|
|
195
|
+
}
|
|
196
|
+
get actions() {
|
|
197
|
+
return [
|
|
198
|
+
{
|
|
199
|
+
id: '1',
|
|
200
|
+
icon: this.expression.op === Zt.AND
|
|
201
|
+
? 'dot_circle'
|
|
202
|
+
: 'dot_bricks',
|
|
203
|
+
label: this.expression.op === Zt.AND
|
|
204
|
+
? 'Any condition (OR)'
|
|
205
|
+
: 'All conditions (AND)',
|
|
206
|
+
},
|
|
207
|
+
];
|
|
208
|
+
}
|
|
209
|
+
renderActions() {
|
|
210
|
+
return (h("div", { class: "actions" }, this.actions.map(this.renderActionButton)));
|
|
187
211
|
}
|
|
188
212
|
getSubheading() {
|
|
189
213
|
return getFilterGroupSubheading(this.expression.op, this.expression.exp.length);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-96dd111f.js';
|
|
2
2
|
|
|
3
|
-
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(
|
|
3
|
+
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}}";
|
|
4
4
|
const LimebbLimeQueryOrderByItemStyle0 = orderByItemCss;
|
|
5
5
|
|
|
6
6
|
const OrderByItemComponent = class {
|
|
@@ -64,7 +64,7 @@ function getDefaultResponseFormat() {
|
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
const limeQueryResponseFormatBuilderCss = ":host(limebb-lime-query-response-format-builder){display:block;width:100%}.response-format-builder{display:flex;flex-direction:column
|
|
67
|
+
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}";
|
|
68
68
|
const LimebbLimeQueryResponseFormatBuilderStyle0 = limeQueryResponseFormatBuilderCss;
|
|
69
69
|
|
|
70
70
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -87,6 +87,16 @@ const LimeQueryResponseFormatBuilder = class {
|
|
|
87
87
|
this.label = 'Response Format';
|
|
88
88
|
this.mode = 'gui';
|
|
89
89
|
this.codeValue = '';
|
|
90
|
+
this.handleModeChange = (event) => {
|
|
91
|
+
event.stopPropagation();
|
|
92
|
+
const mode = event.detail.id;
|
|
93
|
+
if (mode === 'gui') {
|
|
94
|
+
this.switchToGui();
|
|
95
|
+
}
|
|
96
|
+
else if (mode === 'code') {
|
|
97
|
+
this.switchToCode();
|
|
98
|
+
}
|
|
99
|
+
};
|
|
90
100
|
/**
|
|
91
101
|
* Switch from code mode to GUI mode
|
|
92
102
|
*/
|
|
@@ -176,11 +186,21 @@ const LimeQueryResponseFormatBuilder = class {
|
|
|
176
186
|
}
|
|
177
187
|
render() {
|
|
178
188
|
const guiSupported = this.checkGuiSupport();
|
|
179
|
-
return (h("div", { key: '
|
|
189
|
+
return (h("div", { key: '8b4116d9e6f1653ec429995647481b1df3df2712', class: "response-format-builder" }, this.label && h("h3", { key: 'd5e532a64f4e735b67b0533b4896165f7862561e', class: "builder-label" }, this.label), this.guiModeEnabled && (h("div", { key: '42af934f90de83855ff81306fe0bdb10c45fa808', class: "mode-controls" }, this.renderModeSwitch(guiSupported))), !this.guiModeEnabled || this.mode === 'code' ? (h("div", { class: "code-mode" }, this.renderCodeEditor(guiSupported))) : (h("div", { class: "gui-mode" }, this.renderGuiMode()))));
|
|
180
190
|
}
|
|
181
191
|
renderModeSwitch(support) {
|
|
182
192
|
const guiDisabled = !support.guiSupported;
|
|
183
|
-
|
|
193
|
+
const buttons = [
|
|
194
|
+
{
|
|
195
|
+
id: 'gui',
|
|
196
|
+
title: 'Visual',
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
id: 'code',
|
|
200
|
+
title: 'Code',
|
|
201
|
+
},
|
|
202
|
+
].map((button) => (Object.assign(Object.assign({}, button), { selected: button.id === this.mode })));
|
|
203
|
+
return (h("limel-button-group", { value: buttons, disabled: guiDisabled, onChange: this.handleModeChange }));
|
|
184
204
|
}
|
|
185
205
|
renderCodeEditor(support) {
|
|
186
206
|
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 &&
|
|
@@ -159,7 +159,7 @@ function itemsToPropertySelection(items) {
|
|
|
159
159
|
return result;
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
const responseFormatEditorCss = ":host(limebb-lime-query-response-format-editor){display:block;width:100%}.response-format-editor{display:flex;flex-direction:column;gap:
|
|
162
|
+
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}";
|
|
163
163
|
const LimebbLimeQueryResponseFormatEditorStyle0 = responseFormatEditorCss;
|
|
164
164
|
|
|
165
165
|
const ResponseFormatEditor = class {
|
|
@@ -226,7 +226,7 @@ const ResponseFormatEditor = class {
|
|
|
226
226
|
if (!this.limetype) {
|
|
227
227
|
return (h("div", { class: "empty-state" }, h("p", null, "Select a limetype to choose properties")));
|
|
228
228
|
}
|
|
229
|
-
return (h("div", { class: "response-format-editor" }, h("
|
|
229
|
+
return (h("div", { class: "response-format-editor" }, h("h4", { class: "header" }, this.label), h("div", { class: "summary" }, h("span", { class: "count" }, "(", this.items.length, ' ', this.items.length === 1 ? 'property' : 'properties', ' ', "selected)")), h("div", { class: "property" }, h("div", { class: "property-list" }, this.items.map((item, index) => this.renderItem(item, index))), h("div", { class: "actions" }, h("limel-button", { label: "Add Property", icon: "plus_math", onClick: this.handleAddProperty })))));
|
|
230
230
|
}
|
|
231
231
|
renderItem(item, index) {
|
|
232
232
|
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) }));
|
|
@@ -241,7 +241,7 @@ const ResponseFormatEditor = class {
|
|
|
241
241
|
};
|
|
242
242
|
ResponseFormatEditor.style = LimebbLimeQueryResponseFormatEditorStyle0;
|
|
243
243
|
|
|
244
|
-
const responseFormatItemCss = ":host(limebb-lime-query-response-format-item){display:flex;flex-direction:column;gap:0.5rem
|
|
244
|
+
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%}}";
|
|
245
245
|
const LimebbLimeQueryResponseFormatItemStyle0 = responseFormatItemCss;
|
|
246
246
|
|
|
247
247
|
const ResponseFormatItem = class {
|
|
@@ -306,11 +306,33 @@ const ResponseFormatItem = class {
|
|
|
306
306
|
}
|
|
307
307
|
render() {
|
|
308
308
|
return [
|
|
309
|
-
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: '
|
|
310
|
-
this.showAliasInput && (h("div", { key: '
|
|
311
|
-
this.showDescriptionInput && (h("div", { key: '
|
|
309
|
+
h("div", { key: 'e804c4feb61b44aeb2f141c5b5d3269a76ac9320', class: "property-controls" }, h("div", { key: 'becbf35e823b8b16df5366c099b98ce6566d514a', class: "property-path" }, h("limebb-property-selector", { key: '2b35ccefecb9dbd4d2c418566482d9903a1c0d02', platform: this.platform, context: this.context, limetype: this.limetype, label: "Property", value: this.item.path, required: true, onChange: this.handlePathChange })), h("div", { key: '1e598bbbb6df1c5e93bd4ae5f6b112a745a68df9', class: "control-buttons" }, h("limel-icon-button", { key: '51d3dfaa9f3578802abf6f65ec876535740ae6a5', icon: this.getAliasIcon(), label: "Add alias", class: this.item.alias ? 'has-value' : '', onClick: this.toggleAliasInput }), h("limel-icon-button", { key: 'b2f6050b01d810cc20093e87a09452c625cd7847', icon: this.getDescriptionIcon(), label: "Add description", class: this.item.description ? 'has-value' : '', onClick: this.toggleDescriptionInput }), h("limel-icon-button", { key: 'cd58b575c383555db343ebe4a22392c51346751e', icon: "trash", label: "Remove property", onClick: this.handleRemove }))),
|
|
310
|
+
this.showAliasInput && (h("div", { key: 'cd95aa0e34945eb9da88e4be4e4c2326c41ec090', class: "alias" }, h("limel-input-field", { key: 'f62646327adfb8fcd3f0f2aa3a5325ad8a3bfcc3', label: "Alias", value: this.item.alias || '', placeholder: "Custom property name...", onChange: this.handleAliasChange, onBlur: this.handleAliasBlur }))),
|
|
311
|
+
this.showDescriptionInput && (h("div", { key: 'b00f9859a80df3aacf3f524fc1451473e5fcdf5a', class: "description" }, h("limel-input-field", { key: '044485f6a35f84816e7458a08882a40aaeacf2f4', label: "Description", value: this.item.description || '', placeholder: "Describe this property for AI...", onChange: this.handleDescriptionChange, onBlur: this.handleDescriptionBlur }))),
|
|
312
312
|
];
|
|
313
313
|
}
|
|
314
|
+
getAliasIcon() {
|
|
315
|
+
const defaultIcon = {
|
|
316
|
+
name: 'add_tag',
|
|
317
|
+
color: 'rgb(var(--color-gray-600))',
|
|
318
|
+
};
|
|
319
|
+
const toggledIcon = {
|
|
320
|
+
name: 'add_tag',
|
|
321
|
+
color: 'rgb(var(--color-teal-default))',
|
|
322
|
+
};
|
|
323
|
+
return this.showAliasInput ? toggledIcon : defaultIcon;
|
|
324
|
+
}
|
|
325
|
+
getDescriptionIcon() {
|
|
326
|
+
const defaultIcon = {
|
|
327
|
+
name: 'comments',
|
|
328
|
+
color: 'rgb(var(--color-gray-600))',
|
|
329
|
+
};
|
|
330
|
+
const toggledIcon = {
|
|
331
|
+
name: 'comments',
|
|
332
|
+
color: 'rgb(var(--color-teal-default))',
|
|
333
|
+
};
|
|
334
|
+
return this.showDescriptionInput ? toggledIcon : defaultIcon;
|
|
335
|
+
}
|
|
314
336
|
};
|
|
315
337
|
ResponseFormatItem.style = LimebbLimeQueryResponseFormatItemStyle0;
|
|
316
338
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-96dd111f.js';
|
|
2
2
|
import { T as Te } from './index.esm-bb569663.js';
|
|
3
3
|
import { g as getPropertyFromPath, a as getNormalizedProperties } from './property-resolution-c21a1369.js';
|
|
4
|
+
import { b as getIcon } from './limetype-c0e041f7.js';
|
|
4
5
|
|
|
5
6
|
const propertySelectorCss = ":host(limebb-property-selector){display:block}limel-menu{display:block;width:100%}";
|
|
6
7
|
const LimebbPropertySelectorStyle0 = propertySelectorCss;
|
|
@@ -183,14 +184,11 @@ const PropertySelector = class {
|
|
|
183
184
|
}
|
|
184
185
|
getIconForProperty(property) {
|
|
185
186
|
if (property.relation) {
|
|
186
|
-
return
|
|
187
|
-
name: 'link',
|
|
188
|
-
color: 'rgb(var(--color-sky-default))',
|
|
189
|
-
};
|
|
187
|
+
return getIcon(property.relation.getLimetype());
|
|
190
188
|
}
|
|
191
189
|
// Use generic property icon
|
|
192
190
|
return {
|
|
193
|
-
name: '
|
|
191
|
+
name: 'dot_circle',
|
|
194
192
|
color: 'rgb(var(--color-gray-default))',
|
|
195
193
|
};
|
|
196
194
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as t}from"./p-1556b545.js";export{s as setNonce}from"./p-1556b545.js";import{g as i}from"./p-e1255160.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((async e=>(await i(),t(JSON.parse('[["p-be845252",[[1,"limebb-lime-query-builder",{"platform":[16],"context":[16],"value":[16],"label":[1],"activeLimetype":[1,"active-limetype"],"limetypes":[32],"mode":[32],"codeValue":[32],"limetype":[32],"filter":[32],"internalResponseFormat":[32],"limit":[32],"orderBy":[32]}]]],["p-ee1b00b9",[[1,"limebb-feed",{"platform":[16],"context":[16],"items":[16],"emptyStateMessage":[1,"empty-state-message"],"heading":[1],"loading":[4],"minutesOfProximity":[2,"minutes-of-proximity"],"totalCount":[2,"total-count"],"direction":[513],"lastVisitedTimestamp":[1,"last-visited-timestamp"],"highlightedItemId":[8,"highlighted-item-id"]},null,{"highlightedItemId":["highlightedItemIdChanged"]}]]],["p-3a406a20",[[1,"limebb-kanban",{"platform":[16],"context":[16],"groups":[16]}]]],["p-33e6d0ec",[[1,"limebb-lime-query-response-format-builder",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"limetypes":[32],"mode":[32],"codeValue":[32],"internalValue":[32]}]]],["p-32534eb7",[[1,"limebb-chat-list",{"platform":[16],"context":[16],"items":[16],"loading":[516],"isTypingIndicatorVisible":[516,"is-typing-indicator-visible"],"lastVisitedTimestamp":[513,"last-visited-timestamp"],"order":[513]},null,{"items":["handleItemsChange"]}]]],["p-03af0e66",[[1,"limebb-limeobject-file-viewer",{"platform":[16],"context":[16],"property":[1],"fileTypes":[16],"limeobject":[32],"limetype":[32]}]]],["p-6f6fed59",[[1,"limebb-text-editor",{"platform":[16],"context":[16],"allowMentioning":[4,"allow-mentioning"],"contentType":[1,"content-type"],"language":[513],"disabled":[516],"readonly":[516],"helperText":[513,"helper-text"],"placeholder":[513],"label":[513],"invalid":[516],"required":[516],"selectedContext":[16],"ui":[513],"allowResize":[4,"allow-resize"],"value":[1],"draftIdentifier":[1,"draft-identifier"],"triggerMap":[16],"customElements":[16],"allowInlineImages":[4,"allow-inline-images"],"items":[32],"highlightedItemIndex":[32],"editorPickerQuery":[32],"searchableLimetypes":[32],"isPickerOpen":[32],"isSearching":[32]},null,{"isPickerOpen":["watchOpen"],"editorPickerQuery":["watchQuery"]}]]],["p-8491aaa1",[[1,"limebb-date-range",{"platform":[16],"context":[16],"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["p-4a82410e",[[1,"limebb-document-picker",{"platform":[16],"context":[16],"items":[16],"label":[513],"helperText":[513,"helper-text"],"invalid":[516],"required":[516],"type":[513]}]]],["p-568b7520",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["p-2fdcb868",[[1,"limebb-notification-list",{"platform":[16],"context":[16],"items":[16],"loading":[4],"lastVisitedTimestamp":[1,"last-visited-timestamp"]},null,{"items":["handleItemsChange"]}]]],["p-5464f0de",[[17,"limebb-browser",{"platform":[16],"context":[16],"items":[16],"layout":[1],"filter":[32]}]]],["p-3175883d",[[1,"limebb-component-config",{"platform":[16],"context":[16],"value":[16],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"formInfo":[16],"type":[1],"nameField":[1,"name-field"],"configComponent":[32],"configViewType":[32]},null,{"formInfo":["watchFormInfo"],"configComponent":["watchconfigComponent"]}]]],["p-1be0eec7",[[1,"limebb-component-picker",{"platform":[16],"context":[16],"type":[1],"tags":[16],"value":[1],"copyLabel":[1,"copy-label"],"hideCopyButton":[4,"hide-copy-button"],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-10ac8b3e",[[1,"limebb-dashboard-widget",{"heading":[513],"subheading":[513],"supportingText":[513,"supporting-text"],"icon":[513]}]]],["p-e35299e0",[[1,"limebb-icon-picker",{"value":[1],"required":[4],"readonly":[4],"invalid":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-a200954f",[[1,"limebb-info-tile",{"platform":[16],"context":[16],"filterId":[513,"filter-id"],"disabled":[4],"icon":[513],"label":[1],"prefix":[1],"suffix":[1],"propertyName":[1,"property-name"],"aggregateOperator":[1,"aggregate-operator"],"format":[16],"config":[32],"filters":[32],"value":[32],"loading":[32],"error":[32]},null,{"filterId":["watchFilterId"],"propertyName":["watchPropertyName"],"aggregateOperator":["watchAggregateOperator"]}]]],["p-01cff04f",[[1,"limebb-info-tile-date-format",{"value":[16]}]]],["p-4caa8bbe",[[1,"limebb-info-tile-decimal-format",{"value":[16]}]]],["p-ff0b244b",[[1,"limebb-info-tile-format",{"platform":[16],"context":[16],"type":[1],"value":[16]}]]],["p-25e1a434",[[1,"limebb-info-tile-relative-date-format",{"value":[16]}]]],["p-6c56121c",[[1,"limebb-info-tile-unit-format",{"value":[16]}]]],["p-206575e4",[[1,"limebb-loader",{"platform":[16],"context":[16]}]]],["p-0de79b7f",[[1,"limebb-locale-picker",{"platform":[16],"context":[16],"value":[1],"required":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"readonly":[4],"multipleChoice":[4,"multiple-choice"],"allLanguages":[32]}]]],["p-cfa1a4ad",[[1,"limebb-mention",{"limetype":[1],"objectid":[2],"limeobject":[32]}]]],["p-d0721b22",[[1,"limebb-mention-group-counter",{"count":[2],"limetype":[16],"helperLabel":[1,"helper-label"]}]]],["p-3d1be1c9",[[1,"limebb-percentage-visualizer",{"platform":[16],"context":[16],"value":[520],"rangeMax":[514,"range-max"],"rangeMin":[514,"range-min"],"multiplier":[514],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"],"displayPercentageColors":[516,"display-percentage-colors"]},null,{"value":["valueChanged"]}]]],["p-577d8909",[[1,"limebb-trend-indicator",{"platform":[16],"context":[16],"value":[520],"formerValue":[514,"former-value"],"suffix":[513],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"]},null,{"value":["valueChanged"]}]]],["p-7271f47a",[[1,"limebb-feed-timeline-item",{"platform":[16],"context":[16],"item":[16],"ui":[513],"helperText":[1,"helper-text"],"hasError":[516,"has-error"],"isBundled":[516,"is-bundled"],"headingCanExpand":[32],"isHeadingExpanded":[32],"showMore":[32],"isTall":[32]}]]],["p-eb81bceb",[[1,"limebb-kanban-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-2faaacbc",[[1,"limebb-kanban-group",{"platform":[16],"context":[16],"identifier":[1],"heading":[513],"help":[1],"items":[16],"summary":[1],"loading":[516],"totalCount":[514,"total-count"]}]]],["p-218b7f38",[[1,"limebb-text-editor-picker",{"items":[16],"open":[516],"isSearching":[4,"is-searching"],"emptyMessage":[1,"empty-message"]},null,{"open":["watchOpen"]}]]],["p-9031f136",[[1,"limebb-currency-picker",{"platform":[16],"context":[16],"label":[513],"currencies":[16],"helperText":[513,"helper-text"],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"value":[1]}]]],["p-098ee6c1",[[1,"limebb-date-picker",{"platform":[16],"context":[16],"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"required":[516],"value":[1],"type":[513]}]]],["p-9d25ed5a",[[17,"limebb-document-item",{"platform":[16],"context":[16],"item":[16],"type":[513]}]]],["p-a9ac501f",[[1,"limebb-live-docs-info"]]],["p-0f7135ff",[[1,"limebb-notification-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-289ce8b9",[[1,"limebb-lime-query-order-by-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16]}]]],["p-5dc574a3",[[1,"limebb-chat-item",{"platform":[16],"context":[16],"item":[16],"helperText":[1,"helper-text"],"hasError":[516,"has-error"]}],[1,"limebb-typing-indicator"]]],["p-61282e1a",[[1,"limebb-feed-item-thumbnail-file-info",{"description":[1]}]]],["p-cb338753",[[1,"limebb-lime-query-filter-builder",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-order-by-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]},null,{"value":["handleValueChange"]}],[0,"limebb-limetype-field",{"platform":[16],"context":[16],"label":[513],"required":[516],"readonly":[516],"disabled":[516],"value":[513],"helperText":[513,"helper-text"],"invalid":[4],"limetypes":[16],"propertyFields":[16],"fieldName":[1,"field-name"],"formInfo":[16]}]]],["p-292631ea",[[1,"limebb-empty-state",{"heading":[513],"value":[513],"icon":[16]}]]],["p-abfc7815",[[1,"limebb-property-selector",{"platform":[16],"context":[16],"limetype":[1],"value":[1],"label":[1],"required":[4],"helperText":[1,"helper-text"],"limetypes":[32],"isOpen":[32],"navigationPath":[32]}]]],["p-3351395b",[[1,"limebb-lime-query-response-format-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]}],[1,"limebb-lime-query-response-format-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16],"showAliasInput":[32],"showDescriptionInput":[32]}]]],["p-7e5528f6",[[1,"limebb-summary-popover",{"triggerDelay":[514,"trigger-delay"],"heading":[513],"subheading":[513],"image":[16],"icon":[513],"value":[1],"openDirection":[513,"open-direction"],"popoverMaxWidth":[513,"popover-max-width"],"popoverMaxHeight":[513,"popover-max-height"],"actions":[16],"isPopoverOpen":[32]}],[17,"limebb-navigation-button",{"href":[513],"tooltipLabel":[513,"tooltip-label"],"tooltipHelperLabel":[513,"tooltip-helper-label"],"type":[513]}]]],["p-7731e1b0",[[1,"limebb-lime-query-value-input",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"propertyPath":[1,"property-path"],"operator":[1],"value":[8],"label":[1],"limetypes":[32],"inputMode":[32]}],[1,"limebb-lime-query-filter-group",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-filter-not",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}]]],["p-186e9f1a",[[1,"limebb-lime-query-filter-expression",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-filter-comparison",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}]]]]'),e))));
|
|
1
|
+
import{p as e,b as t}from"./p-1556b545.js";export{s as setNonce}from"./p-1556b545.js";import{g as i}from"./p-e1255160.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((async e=>(await i(),t(JSON.parse('[["p-3384f1ee",[[1,"limebb-lime-query-builder",{"platform":[16],"context":[16],"value":[16],"label":[1],"activeLimetype":[1,"active-limetype"],"limetypes":[32],"mode":[32],"codeValue":[32],"limetype":[32],"filter":[32],"internalResponseFormat":[32],"limit":[32],"orderBy":[32]}]]],["p-ee1b00b9",[[1,"limebb-feed",{"platform":[16],"context":[16],"items":[16],"emptyStateMessage":[1,"empty-state-message"],"heading":[1],"loading":[4],"minutesOfProximity":[2,"minutes-of-proximity"],"totalCount":[2,"total-count"],"direction":[513],"lastVisitedTimestamp":[1,"last-visited-timestamp"],"highlightedItemId":[8,"highlighted-item-id"]},null,{"highlightedItemId":["highlightedItemIdChanged"]}]]],["p-3a406a20",[[1,"limebb-kanban",{"platform":[16],"context":[16],"groups":[16]}]]],["p-2d5f83bc",[[1,"limebb-lime-query-response-format-builder",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"limetypes":[32],"mode":[32],"codeValue":[32],"internalValue":[32]}]]],["p-32534eb7",[[1,"limebb-chat-list",{"platform":[16],"context":[16],"items":[16],"loading":[516],"isTypingIndicatorVisible":[516,"is-typing-indicator-visible"],"lastVisitedTimestamp":[513,"last-visited-timestamp"],"order":[513]},null,{"items":["handleItemsChange"]}]]],["p-03af0e66",[[1,"limebb-limeobject-file-viewer",{"platform":[16],"context":[16],"property":[1],"fileTypes":[16],"limeobject":[32],"limetype":[32]}]]],["p-6f6fed59",[[1,"limebb-text-editor",{"platform":[16],"context":[16],"allowMentioning":[4,"allow-mentioning"],"contentType":[1,"content-type"],"language":[513],"disabled":[516],"readonly":[516],"helperText":[513,"helper-text"],"placeholder":[513],"label":[513],"invalid":[516],"required":[516],"selectedContext":[16],"ui":[513],"allowResize":[4,"allow-resize"],"value":[1],"draftIdentifier":[1,"draft-identifier"],"triggerMap":[16],"customElements":[16],"allowInlineImages":[4,"allow-inline-images"],"items":[32],"highlightedItemIndex":[32],"editorPickerQuery":[32],"searchableLimetypes":[32],"isPickerOpen":[32],"isSearching":[32]},null,{"isPickerOpen":["watchOpen"],"editorPickerQuery":["watchQuery"]}]]],["p-8491aaa1",[[1,"limebb-date-range",{"platform":[16],"context":[16],"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["p-4a82410e",[[1,"limebb-document-picker",{"platform":[16],"context":[16],"items":[16],"label":[513],"helperText":[513,"helper-text"],"invalid":[516],"required":[516],"type":[513]}]]],["p-568b7520",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["p-2fdcb868",[[1,"limebb-notification-list",{"platform":[16],"context":[16],"items":[16],"loading":[4],"lastVisitedTimestamp":[1,"last-visited-timestamp"]},null,{"items":["handleItemsChange"]}]]],["p-5464f0de",[[17,"limebb-browser",{"platform":[16],"context":[16],"items":[16],"layout":[1],"filter":[32]}]]],["p-3175883d",[[1,"limebb-component-config",{"platform":[16],"context":[16],"value":[16],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"formInfo":[16],"type":[1],"nameField":[1,"name-field"],"configComponent":[32],"configViewType":[32]},null,{"formInfo":["watchFormInfo"],"configComponent":["watchconfigComponent"]}]]],["p-1be0eec7",[[1,"limebb-component-picker",{"platform":[16],"context":[16],"type":[1],"tags":[16],"value":[1],"copyLabel":[1,"copy-label"],"hideCopyButton":[4,"hide-copy-button"],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-10ac8b3e",[[1,"limebb-dashboard-widget",{"heading":[513],"subheading":[513],"supportingText":[513,"supporting-text"],"icon":[513]}]]],["p-e35299e0",[[1,"limebb-icon-picker",{"value":[1],"required":[4],"readonly":[4],"invalid":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-a200954f",[[1,"limebb-info-tile",{"platform":[16],"context":[16],"filterId":[513,"filter-id"],"disabled":[4],"icon":[513],"label":[1],"prefix":[1],"suffix":[1],"propertyName":[1,"property-name"],"aggregateOperator":[1,"aggregate-operator"],"format":[16],"config":[32],"filters":[32],"value":[32],"loading":[32],"error":[32]},null,{"filterId":["watchFilterId"],"propertyName":["watchPropertyName"],"aggregateOperator":["watchAggregateOperator"]}]]],["p-01cff04f",[[1,"limebb-info-tile-date-format",{"value":[16]}]]],["p-4caa8bbe",[[1,"limebb-info-tile-decimal-format",{"value":[16]}]]],["p-ff0b244b",[[1,"limebb-info-tile-format",{"platform":[16],"context":[16],"type":[1],"value":[16]}]]],["p-25e1a434",[[1,"limebb-info-tile-relative-date-format",{"value":[16]}]]],["p-6c56121c",[[1,"limebb-info-tile-unit-format",{"value":[16]}]]],["p-206575e4",[[1,"limebb-loader",{"platform":[16],"context":[16]}]]],["p-0de79b7f",[[1,"limebb-locale-picker",{"platform":[16],"context":[16],"value":[1],"required":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"readonly":[4],"multipleChoice":[4,"multiple-choice"],"allLanguages":[32]}]]],["p-cfa1a4ad",[[1,"limebb-mention",{"limetype":[1],"objectid":[2],"limeobject":[32]}]]],["p-d0721b22",[[1,"limebb-mention-group-counter",{"count":[2],"limetype":[16],"helperLabel":[1,"helper-label"]}]]],["p-3d1be1c9",[[1,"limebb-percentage-visualizer",{"platform":[16],"context":[16],"value":[520],"rangeMax":[514,"range-max"],"rangeMin":[514,"range-min"],"multiplier":[514],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"],"displayPercentageColors":[516,"display-percentage-colors"]},null,{"value":["valueChanged"]}]]],["p-577d8909",[[1,"limebb-trend-indicator",{"platform":[16],"context":[16],"value":[520],"formerValue":[514,"former-value"],"suffix":[513],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"]},null,{"value":["valueChanged"]}]]],["p-7271f47a",[[1,"limebb-feed-timeline-item",{"platform":[16],"context":[16],"item":[16],"ui":[513],"helperText":[1,"helper-text"],"hasError":[516,"has-error"],"isBundled":[516,"is-bundled"],"headingCanExpand":[32],"isHeadingExpanded":[32],"showMore":[32],"isTall":[32]}]]],["p-eb81bceb",[[1,"limebb-kanban-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-2faaacbc",[[1,"limebb-kanban-group",{"platform":[16],"context":[16],"identifier":[1],"heading":[513],"help":[1],"items":[16],"summary":[1],"loading":[516],"totalCount":[514,"total-count"]}]]],["p-218b7f38",[[1,"limebb-text-editor-picker",{"items":[16],"open":[516],"isSearching":[4,"is-searching"],"emptyMessage":[1,"empty-message"]},null,{"open":["watchOpen"]}]]],["p-9031f136",[[1,"limebb-currency-picker",{"platform":[16],"context":[16],"label":[513],"currencies":[16],"helperText":[513,"helper-text"],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"value":[1]}]]],["p-098ee6c1",[[1,"limebb-date-picker",{"platform":[16],"context":[16],"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"required":[516],"value":[1],"type":[513]}]]],["p-9d25ed5a",[[17,"limebb-document-item",{"platform":[16],"context":[16],"item":[16],"type":[513]}]]],["p-a9ac501f",[[1,"limebb-live-docs-info"]]],["p-0f7135ff",[[1,"limebb-notification-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-5c693302",[[1,"limebb-lime-query-order-by-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16]}]]],["p-5dc574a3",[[1,"limebb-chat-item",{"platform":[16],"context":[16],"item":[16],"helperText":[1,"helper-text"],"hasError":[516,"has-error"]}],[1,"limebb-typing-indicator"]]],["p-61282e1a",[[1,"limebb-feed-item-thumbnail-file-info",{"description":[1]}]]],["p-8917c472",[[1,"limebb-lime-query-filter-builder",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-order-by-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]},null,{"value":["handleValueChange"]}],[0,"limebb-limetype-field",{"platform":[16],"context":[16],"label":[513],"required":[516],"readonly":[516],"disabled":[516],"value":[513],"helperText":[513,"helper-text"],"invalid":[4],"limetypes":[16],"propertyFields":[16],"fieldName":[1,"field-name"],"formInfo":[16]}]]],["p-292631ea",[[1,"limebb-empty-state",{"heading":[513],"value":[513],"icon":[16]}]]],["p-e5549e10",[[1,"limebb-property-selector",{"platform":[16],"context":[16],"limetype":[1],"value":[1],"label":[1],"required":[4],"helperText":[1,"helper-text"],"limetypes":[32],"isOpen":[32],"navigationPath":[32]}]]],["p-9167bc6c",[[1,"limebb-lime-query-response-format-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]}],[1,"limebb-lime-query-response-format-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16],"showAliasInput":[32],"showDescriptionInput":[32]}]]],["p-7e5528f6",[[1,"limebb-summary-popover",{"triggerDelay":[514,"trigger-delay"],"heading":[513],"subheading":[513],"image":[16],"icon":[513],"value":[1],"openDirection":[513,"open-direction"],"popoverMaxWidth":[513,"popover-max-width"],"popoverMaxHeight":[513,"popover-max-height"],"actions":[16],"isPopoverOpen":[32]}],[17,"limebb-navigation-button",{"href":[513],"tooltipLabel":[513,"tooltip-label"],"tooltipHelperLabel":[513,"tooltip-helper-label"],"type":[513]}]]],["p-1f76540e",[[1,"limebb-lime-query-value-input",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"propertyPath":[1,"property-path"],"operator":[1],"value":[8],"label":[1],"limetypes":[32],"inputMode":[32]}],[1,"limebb-lime-query-filter-group",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-filter-not",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}]]],["p-186e9f1a",[[1,"limebb-lime-query-filter-expression",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-filter-comparison",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}]]]]'),e))));
|
|
@@ -0,0 +1 @@
|
|
|
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";function o(){return{key:"",op:r.EQUALS,exp:""}}function n(e,t){return{op:e.op,exp:[...e.exp,t]}}const a=class{constructor(s){e(this,s),this.expressionChange=t(this,"expressionChange",7),this.renderActionButton=e=>i("limel-icon-button",{class:"action-icon",elevated:!0,icon:e.icon,label:e.label,onClick:this.handleToggleOperator}),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=()=>{const e={op:(t=this.expression).op===r.AND?r.OR:r.AND,exp:[...t.exp]};var t;this.expressionChange.emit(e)},this.handleAddChildExpression=()=>{const e=o(),t=n(this.expression,e);this.expressionChange.emit(t)},this.handleAddChildGroup=()=>{const e={op:this.expression.op===r.AND?r.OR:r.AND,exp:[o()]},t=n(this.expression,e);this.expressionChange.emit(t)},this.handleExpressionChange=e=>t=>{t.stopPropagation();const i=function(e,t,i){const r=[...e.exp];return i?(r[t]=i,{type:"updated",expression:{op:e.op,exp:r}}):(r.splice(t,1),0===r.length?{type:"removed",expression:void 0}:1===r.length?{type:"unwrapped",expression:r[0]}:{type:"updated",expression:{op:e.op,exp:r}})}(this.expression,e,t.detail);this.expressionChange.emit(i.expression)}}render(){const e=this.getSubheading();return i("div",{key:"b7972fb9e34b8b0b57ae82b3bf4de3e55b66169f",class:"expression"},e&&i("limel-header",{key:"9721388fa6a60018f95dbe27b2959dcc1c11211e",icon:{name:this.expression.op===r.AND?"dot_bricks":"dot_circle",color:"rgb(var(--contrast-800))"},subheading:e,onClick:this.handleToggleOperator,class:"clickable-header"},this.renderActions()),i("ul",{key:"f3ae21204e082e81068c0e20b76e14ed4b577051"},this.expression.exp.map(this.renderChildExpression),i("li",{key:"d5958d8b61f348540b3dfb821de16ed0f2d0a1f4",class:"add-button"},this.renderAddButton(),this.renderAddGroupButton())))}get actions(){return[{id:"1",icon:this.expression.op===r.AND?"dot_circle":"dot_bricks",label:this.expression.op===r.AND?"Any condition (OR)":"All conditions (AND)"}]}renderActions(){return i("div",{class:"actions"},this.actions.map(this.renderActionButton))}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"}};a.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{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}';const h=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:"29770b10d0b892750ad2aab3520cec5a82063774",class:"expression"},this.label&&i("limel-header",{key:"9e47d14c6cb526c9c31d67e11a5ed5ec665c7f62",heading:this.label}),i("limebb-lime-query-filter-expression",{key:"943c1529057aa6cc918dc935f1a5782b149351ae",platform:this.platform,context:this.context,label:"Not",limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.expression.exp,onExpressionChange:this.handleExpressionChange}))}};h.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 c=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()],c.prototype,"limetypes",void 0),c.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{a as limebb_lime_query_filter_group,h as limebb_lime_query_filter_not,c as limebb_lime_query_value_input}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as t,h as i}from"./p-1556b545.js";import{T as o}from"./p-4838284a.js";import{v as r}from"./p-fa2da6bc.js";import"./p-b748c770.js";function s(e){let t;try{t=JSON.parse(e)}catch(e){throw new Error(`Invalid JSON: ${e.message}`)}if(null===t||"object"!=typeof t)throw new Error("Response format must be an object");const i=new Set(["object","aggregates"]),o=Object.keys(t).filter((e=>!i.has(e)));if(o.length>0)throw new Error(`Unexpected properties in response format: ${o.join(", ")}. Only 'object' and 'aggregates' are allowed.`);if(!t.object&&!t.aggregates)throw new Error("Response format must contain at least one of: object, aggregates");return t}const l=class{constructor(i){e(this,i),this.change=t(this,"change",7),this.label="Response Format",this.mode="gui",this.codeValue="",this.handleModeChange=e=>{e.stopPropagation();const t=e.detail.id;"gui"===t?this.switchToGui():"code"===t&&this.switchToCode()},this.switchToGui=()=>{try{const e=s(this.codeValue);if(!r(e,this.limetypes,this.limetype,this.guiModeEnabled).guiSupported)return;this.internalValue=e,this.mode="gui",this.change.emit(e)}catch(e){}},this.switchToCode=()=>{this.updateCodeValue(),this.mode="code"},this.handleCodeChange=e=>{e.stopPropagation(),this.codeValue=e.detail;try{const e=s(this.codeValue);this.internalValue=e,this.change.emit(e)}catch(e){}},this.handleGuiChange=e=>{e.stopPropagation(),this.internalValue=e.detail,this.updateCodeValue(),this.change.emit(e.detail)}}get guiModeEnabled(){var e,t,i;return null!==(i=null===(t=null===(e=this.platform)||void 0===e?void 0:e.isFeatureEnabled)||void 0===t?void 0:t.call(e,"useLimeQueryBuilderGuiMode"))&&void 0!==i&&i}componentWillLoad(){this.internalValue=this.value||{object:{_id:null}},this.updateCodeValue(),this.guiModeEnabled&&this.checkGuiSupport().guiSupported||(this.mode="code")}componentWillUpdate(){this.value&&"gui"===this.mode&&(this.internalValue=this.value)}render(){const e=this.checkGuiSupport();return i("div",{key:"8b4116d9e6f1653ec429995647481b1df3df2712",class:"response-format-builder"},this.label&&i("h3",{key:"d5e532a64f4e735b67b0533b4896165f7862561e",class:"builder-label"},this.label),this.guiModeEnabled&&i("div",{key:"42af934f90de83855ff81306fe0bdb10c45fa808",class:"mode-controls"},this.renderModeSwitch(e)),this.guiModeEnabled&&"code"!==this.mode?i("div",{class:"gui-mode"},this.renderGuiMode()):i("div",{class:"code-mode"},this.renderCodeEditor(e)))}renderModeSwitch(e){const t=!e.guiSupported,o=[{id:"gui",title:"Visual"},{id:"code",title:"Code"}].map((e=>Object.assign(Object.assign({},e),{selected:e.id===this.mode})));return i("limel-button-group",{value:o,disabled:t,onChange:this.handleModeChange})}renderCodeEditor(e){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}),!e.valid&&e.validationErrors.length>0&&i("div",{class:"validation-errors"},i("strong",null,"Invalid Response Format:"),i("ul",null,e.validationErrors.map((e=>i("li",null,e))))),this.guiModeEnabled&&e.valid&&!e.guiSupported&&e.guiLimitations.length>0&&i("div",{class:"gui-limitations"},i("strong",null,"Cannot switch to GUI mode:"),i("ul",null,e.guiLimitations.map((e=>i("li",null,e))))))}renderGuiMode(){return i("limebb-lime-query-response-format-editor",{platform:this.platform,context:this.context,limetype:this.limetype,value:this.internalValue,onChange:this.handleGuiChange})}checkGuiSupport(){if(!this.limetypes)return{valid:!1,guiSupported:!1,validationErrors:["Limetypes not loaded"],guiLimitations:[]};let e;if("code"===this.mode)try{e=s(this.codeValue)}catch(e){return{valid:!1,guiSupported:!1,validationErrors:[e.message],guiLimitations:[]}}else e=this.internalValue;return r(e,this.limetypes,this.limetype,this.guiModeEnabled)}updateCodeValue(){this.codeValue=JSON.stringify(this.internalValue,null,2)}};(function(e,t,i,o){var r,s=arguments.length,l=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(l=(s<3?r(l):s>3?r(t,i,l):r(t,i))||l);s>3&&l&&Object.defineProperty(t,i,l)})([o()],l.prototype,"limetypes",void 0),l.style=":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}";export{l as limebb_lime_query_response_format_builder}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,c as e,h as t}from"./p-1556b545.js";import{T as r}from"./p-4838284a.js";import{i as o}from"./p-fa2da6bc.js";import"./p-b748c770.js";const s=class{constructor(t){i(this,t),this.change=e(this,"change",7),this.mode="gui",this.codeValue="",this.limetype="",this.handleLimetypeChange=i=>{i.stopPropagation(),this.limetype=i.detail,this.filter=void 0,this.internalResponseFormat={object:{_id:null}},this.emitChange()},this.handleFilterChange=i=>{var e;i.stopPropagation(),this.filter=null!==(e=i.detail)&&void 0!==e?e:void 0,this.emitChange()},this.handleResponseFormatChange=i=>{i.stopPropagation(),this.internalResponseFormat=i.detail,this.emitChange()},this.handleLimitChange=i=>{i.stopPropagation();const e=i.detail;this.limit=e?Number.parseInt(e,10):void 0,this.emitChange()},this.handleOrderByChange=i=>{i.stopPropagation(),this.orderBy=i.detail,this.emitChange()},this.handleChange=i=>{i.stopPropagation();const e=i.detail.id;if("gui"===e)try{const i=JSON.parse(this.codeValue);if(!this.checkGuiSupport().guiSupported)return;this.limetype=i.limetype||"",this.filter=i.filter,this.internalResponseFormat=i.responseFormat,this.limit=i.limit,this.orderBy=i.orderBy,this.mode="gui",this.change.emit(i)}catch(i){}else"code"===e&&(this.updateCodeValue(),this.mode="code")},this.handleCodeChange=i=>{i.stopPropagation(),this.codeValue=i.detail;try{const i=JSON.parse(this.codeValue);this.change.emit(i)}catch(i){}}}getButtons(){return[{id:"gui",title:"Visual"},{id:"code",title:"Code"}]}get guiModeEnabled(){var i,e,t;return null!==(t=null===(e=null===(i=this.platform)||void 0===i?void 0:i.isFeatureEnabled)||void 0===e?void 0:e.call(i,"useLimeQueryBuilderGuiMode"))&&void 0!==t&&t}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 i=this.checkGuiSupport(),e=!this.guiModeEnabled||"code"===this.mode;return t("div",{key:"5e9c8bb860cf348b08272831bc2e252752fad24d",class:"lime-query-builder"},this.renderLabel(),this.renderModeControls(i),e?this.renderCodeMode(i):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 i={limetype:this.limetype,responseFormat:this.internalResponseFormat||{object:{_id:null}},filter:this.filter};return void 0!==this.limit&&this.limit>0&&(i.limit=this.limit),this.orderBy&&this.orderBy.length>0&&(i.orderBy=this.orderBy),i}checkGuiSupport(){if(!this.limetypes)return{valid:!0,guiSupported:!0,validationErrors:[],guiLimitations:[]};let i;if("code"===this.mode&&this.codeValue)try{i=JSON.parse(this.codeValue)}catch(i){return{valid:!1,guiSupported:!1,validationErrors:["Invalid JSON"],guiLimitations:[]}}else{if(!this.limetype)return{valid:!0,guiSupported:!0,validationErrors:[],guiLimitations:[]};i={limetype:this.limetype,responseFormat:this.internalResponseFormat||{object:{_id:null}},filter:this.filter},void 0!==this.limit&&this.limit>0&&(i.limit=this.limit)}return o(i,this.limetypes,this.activeLimetype,this.guiModeEnabled)}renderModeSwitch(i){const e=!i.guiSupported,r=this.getButtons().map((i=>Object.assign(Object.assign({},i),{selected:i.id===this.mode})));return t("limel-button-group",{onChange:this.handleChange,value:r,disabled:e})}renderCodeEditor(i){return t("div",{class:"code-editor-container"},t("limel-code-editor",{value:this.codeValue,language:"json",lineNumbers:!0,fold:!0,lint:!0,onChange:this.handleCodeChange}),!i.valid&&i.validationErrors.length>0&&t("div",{class:"validation-errors"},t("strong",null,"Invalid Lime Query:"),t("ul",null,i.validationErrors.map((i=>t("li",null,i))))),this.guiModeEnabled&&i.valid&&!i.guiSupported&&i.guiLimitations.length>0&&t("div",{class:"gui-limitations"},t("strong",null,"Cannot switch to GUI mode:"),t("ul",null,i.guiLimitations.map((i=>t("li",null,i))))))}renderLimetypeSection(){return t("div",{class:"limetype-section"},t("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 t("div",{class:"response-format-section"},t("limebb-lime-query-response-format-editor",{platform:this.platform,context:this.context,limetype:this.limetype,value:this.internalResponseFormat,onChange:this.handleResponseFormatChange}))}renderFilterSection(){if(this.limetype)return t("div",{class:"filter-section"},t("h4",{class:"section-label"},"Filter Conditions"),t("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 i;if(this.limetype)return t("div",{class:"query-options-section"},t("h4",{class:"section-label"},"Query Options"),t("div",{class:"query-options-controls"},t("limel-input-field",{label:"Limit",type:"number",value:(null===(i=this.limit)||void 0===i?void 0:i.toString())||"",placeholder:"No limit",helperText:"Maximum number of results",onChange:this.handleLimitChange}),t("limebb-lime-query-order-by-editor",{platform:this.platform,context:this.context,limetype:this.limetype,value:this.orderBy,onChange:this.handleOrderByChange})))}renderGuiMode(){return t("div",{class:"gui-mode"},this.renderLimetypeSection(),this.renderResponseFormatSection(),this.renderFilterSection(),this.renderQueryOptionsSection())}renderLabel(){if(this.label)return t("h3",{class:"lime-query-builder-label"},this.label)}renderModeControls(i){if(this.guiModeEnabled)return t("div",{class:"mode-controls"},this.renderModeSwitch(i))}renderCodeMode(i){return t("div",{class:"code-mode"},this.renderCodeEditor(i))}};(function(i,e,t,r){var o,s=arguments.length,l=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(i,e,t,r);else for(var n=i.length-1;n>=0;n--)(o=i[n])&&(l=(s<3?o(l):s>3?o(e,t,l):o(e,t))||l);s>3&&l&&Object.defineProperty(e,t,l)})([r()],s.prototype,"limetypes",void 0),s.style=":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}}";export{s as limebb_lime_query_builder}
|
|
@@ -0,0 +1 @@
|
|
|
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:"1587617d84be8905a858059ea966b7a9e0d6df78",class:"order-by-controls"},i("div",{key:"8d4f47423c56cad20e91142f82a5726a7325233b",class:"property-path"},i("limebb-property-selector",{key:"42c54528d2d2ee72e5b3f6ca4b31eb7bbcb9b325",platform:this.platform,context:this.context,limetype:this.limetype,label:"Property",value:e,required:!0,onChange:this.handlePathChange})),i("div",{key:"1011a34f626c94608a926567e464d380faded349",class:"control-buttons"},i("limel-icon-button",{key:"510a7c333397792a66f3e17a3501f2af96183db9",icon:"ASC"===t?"sort_ascending":"sort_descending",label:"ASC"===t?"Ascending":"Descending",onClick:this.handleToggleDirection}),i("limel-icon-button",{key:"5bc160b38c565e30cca03a88d6f2d181284cefdd",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(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}}";export{o as limebb_lime_query_order_by_item}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as e,h as i}from"./p-1556b545.js";import{Z as s,c as r}from"./p-4838284a.js";import{b as o}from"./p-20bfca36.js";import{i as n}from"./p-1484e300.js";import{b as l}from"./p-a659d55a.js";import{i as h,a,b as d}from"./p-b31772c8.js";import"./p-35897ec3.js";import"./p-fe2b91d9.js";import"./p-5322fd19.js";function m(t){return"string"==typeof t||!h(t)&&a(t)&&"[object String]"==d(t)}const c=class{constructor(i){t(this,i),this.expressionChange=e(this,"expressionChange",7),this.handleAddFirstCondition=()=>{this.expressionChange.emit({key:"",op:s.EQUALS,exp:""})},this.handlePromoteAndAdd=()=>{this.expression&&this.expressionChange.emit({op:s.AND,exp:[this.expression,{key:"",op:s.EQUALS,exp:""}]})},this.handleExpressionChange=t=>{var e;t.stopPropagation(),this.expressionChange.emit(null!==(e=t.detail)&&void 0!==e?e:void 0)}}render(){return this.expression?this.needsPromotion()?this.renderWithPromotionButton():i("limebb-lime-query-filter-expression",{platform:this.platform,context:this.context,limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.expression,onExpressionChange:this.handleExpressionChange}):this.renderEmptyState()}needsPromotion(){return!!this.expression&&("key"in this.expression||this.expression.op===s.NOT)}renderEmptyState(){return i("limel-button",{label:"Add a condition",icon:"plus_math",onClick:this.handleAddFirstCondition})}renderWithPromotionButton(){return i("div",{class:"expression-with-promotion"},i("limebb-lime-query-filter-expression",{platform:this.platform,context:this.context,limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.expression,onExpressionChange:this.handleExpressionChange}),i("limel-button",{label:"Add another condition",icon:"plus_math",onClick:this.handlePromoteAndAdd}))}};c.style=".expression-with-promotion{display:flex;flex-direction:column;gap:1rem}limel-button{width:100%}.query-options-section{margin-top:1rem}";const p=class{constructor(i){t(this,i),this.change=e(this,"change",7),this.label="Sort Order",this.items=[],this.handleItemChange=t=>e=>{e.stopPropagation();const i=[...this.items];null===e.detail?i.splice(t,1):i[t]=e.detail,this.items=i,this.emitChange()},this.handleAddSortField=()=>{this.items=[...this.items,{"":"ASC"}],this.emitChange()}}componentWillLoad(){this.value&&this.value.length>0&&(this.items=[...this.value])}handleValueChange(t){t&&(t.length!==this.items.length||!t.every(((t,e)=>{const i=this.items[e];if(!i)return!1;const s=Object.keys(t)[0],r=Object.keys(i)[0];return s===r&&t[s]===i[r]})))&&(this.items=t.length>0?[...t]:[])}render(){return this.limetype?i("div",{class:"order-by-editor"},i("div",{class:"header"},i("h4",null,this.label)),this.renderOrderByList(),this.renderActions()):i("div",{class:"empty-state"},i("p",null,"Select a limetype to configure sorting"))}renderOrderByList(){return 0===this.items.length?null:i("div",{class:"order-by-list"},this.items.map(((t,e)=>this.renderItem(t,e))))}renderActions(){return i("limel-button",{label:"Add Sort Field",icon:"plus_math",onClick:this.handleAddSortField})}renderItem(t,e){const s=Object.keys(t)[0]||"";return i("limebb-lime-query-order-by-item",{key:`${s}-${e}`,class:"order-by-item",platform:this.platform,context:this.context,limetype:this.limetype,item:t,onItemChange:this.handleItemChange(e)})}emitChange(){this.change.emit(this.items)}static get watchers(){return{value:["handleValueChange"]}}};p.style=":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}";const u=["string","text","phone","integer","decimal","percent","time","date","year","quarter","month","yesno","link","user","xml","option","set","file","system"],b=u.filter((t=>"system"!==t));b.push("belongsto","hasone","hasmany","hasandbelongstomany");const y=class{constructor(i){t(this,i),this.change=e(this,"change",7),this.propertyFields=[],this.fieldName="limetype",this.handleChange=t=>{t.stopPropagation();let e="";t.detail&&"value"in t.detail&&(e=t.detail.value),this.change.emit(e||void 0)}}componentWillLoad(){const t=this.platform.get(r.Application).getLanguage();this.collator=new Intl.Collator(t,{numeric:!0,sensitivity:"base"})}componentShouldUpdate(t,e,i){var s,r,o,n;return"formInfo"!==i||(o=null===(s=null==t?void 0:t.schema)||void 0===s?void 0:s.oneOf,n=null===(r=null==e?void 0:e.schema)||void 0===r?void 0:r.oneOf,!l(o,n))}render(){var t;const e=this.getLimeTypes().map(g);e.sort(((t,e)=>this.collator.compare(t.text,e.text)));let s=e.find((t=>t.value===this.value)),r=this.invalid;return this.value&&!s&&(r=!0,e.unshift({text:(null===(t=this.limeTypeRepository.getLimeType(this.value))||void 0===t?void 0:t.localname.singular)||this.value,value:this.value}),s=e[0]),e.unshift({text:"",value:""}),i("limel-select",{key:"ee9fdc46424c9e6dc5897260cb16bcbedd43413a",label:this.label,options:e,value:s,required:this.required,helperText:this.helperText,invalid:r,disabled:this.disabled||this.readonly,onChange:this.handleChange})}componentWillRender(){this.updatePropertyFields(this.value||"")}getLimeTypes(){var t,e;let i=this.limetypes;return(null===(e=null===(t=this.formInfo)||void 0===t?void 0:t.schema)||void 0===e?void 0:e.oneOf)&&(i=this.formInfo.schema.oneOf.map((t=>t.const)).filter(m)),i?i.map((t=>this.limeTypeRepository.getLimeType(t))).filter(n):this.limeTypeRepository.getLimeTypes()}updatePropertyFields(t){for(const e of this.propertyFields)e.limetype=t,e.allowedPropertyTypes===u&&(e.allowedPropertyTypes=b)}get limeTypeRepository(){return this.platform.get(r.LimeTypeRepository)}},g=t=>({text:t.localname.singular,value:t.name,icon:o(t)});export{c as limebb_lime_query_filter_builder,p as limebb_lime_query_order_by_editor,y as limebb_limetype_field}
|