@limetech/lime-crm-building-blocks 1.100.0 → 1.101.0
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/limebb-lime-query-builder.cjs.entry.js +177 -204
- package/dist/cjs/{limebb-lime-query-filter-builder_3.cjs.entry.js → limebb-lime-query-filter-builder_4.cjs.entry.js} +86 -1
- package/dist/cjs/limebb-lime-query-filter-comparison_2.cjs.entry.js +147 -0
- package/dist/cjs/{limebb-lime-query-filter-comparison_5.cjs.entry.js → limebb-lime-query-filter-group_3.cjs.entry.js} +5 -333
- package/dist/cjs/limebb-lime-query-order-by-item.cjs.entry.js +51 -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-property-selector.cjs.entry.js +234 -0
- 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 +2 -2
- 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 +1 -1
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-not.js +1 -1
- package/dist/collection/components/lime-query-builder/expressions/lime-query-value-input.js +7 -7
- package/dist/collection/components/lime-query-builder/lime-query-builder.css +2 -5
- package/dist/collection/components/lime-query-builder/lime-query-builder.js +19 -19
- package/dist/collection/components/lime-query-builder/lime-query-validation.js +160 -26
- package/dist/collection/components/lime-query-builder/lime-query.types.js +1 -57
- 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-editor.css +72 -0
- package/dist/collection/components/lime-query-builder/order-by/order-by-editor.js +252 -0
- package/dist/collection/components/lime-query-builder/order-by/order-by-item.css +45 -0
- package/dist/collection/components/lime-query-builder/order-by/order-by-item.js +173 -0
- 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 +2 -2
- package/dist/components/lime-query-value-input.js +3 -3
- package/dist/components/limebb-lime-query-builder.js +201 -215
- package/dist/components/limebb-lime-query-order-by-editor.d.ts +11 -0
- package/dist/components/limebb-lime-query-order-by-editor.js +6 -0
- package/dist/components/limebb-lime-query-order-by-item.d.ts +11 -0
- package/dist/components/limebb-lime-query-order-by-item.js +6 -0
- 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-editor.js +123 -0
- package/dist/components/order-by-item.js +73 -0
- package/dist/components/property-selector.js +1 -1
- package/dist/components/summary-popover.js +3 -3
- package/dist/esm/lime-crm-building-blocks.js +1 -1
- package/dist/esm/limebb-lime-query-builder.entry.js +179 -206
- package/dist/esm/{limebb-lime-query-filter-builder_3.entry.js → limebb-lime-query-filter-builder_4.entry.js} +86 -2
- package/dist/esm/limebb-lime-query-filter-comparison_2.entry.js +142 -0
- package/dist/esm/{limebb-lime-query-filter-comparison_5.entry.js → limebb-lime-query-filter-group_3.entry.js} +7 -333
- package/dist/esm/limebb-lime-query-order-by-item.entry.js +47 -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-property-selector.entry.js +230 -0
- 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/esm/{property-resolution-fde2375e.js → property-resolution-c21a1369.js} +1 -1
- package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/{p-631ca5a5.entry.js → p-0cd036ed.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-2725671e.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-9cac4de2.entry.js → p-425eaba2.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-e8946134.entry.js → p-5cf4898d.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-67c174d0.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-6aa216ec.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-93cadc1e.entry.js → p-8601eab5.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-b9b954d9.entry.js → p-8c2fb1c9.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-3122ea05.entry.js → p-92dfc5f8.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-569c86b5.entry.js → p-a1ee8990.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-abfc7815.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-e0ab1554.js → p-b748c770.js} +1 -1
- package/dist/lime-crm-building-blocks/p-ccf34631.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-36ea13c0.entry.js → p-d84874dc.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-f9efca1d.entry.js +1 -0
- package/dist/types/components/lime-query-builder/expressions/lime-query-value-input.d.ts +2 -3
- package/dist/types/components/lime-query-builder/lime-query-builder.d.ts +9 -6
- package/dist/types/components/lime-query-builder/lime-query.types.d.ts +0 -72
- package/dist/types/components/lime-query-builder/order-by/order-by-editor.d.ts +58 -0
- package/dist/types/components/lime-query-builder/order-by/order-by-item.d.ts +37 -0
- package/dist/types/components.d.ts +165 -205
- package/package.json +1 -1
- package/dist/cjs/limebb-lime-query-filter-and.cjs.entry.js +0 -80
- package/dist/cjs/limebb-lime-query-filter-expression.cjs.entry.js +0 -45
- package/dist/cjs/limebb-lime-query-filter-or.cjs.entry.js +0 -68
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-and.css +0 -121
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-and.js +0 -249
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-or.css +0 -123
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-or.js +0 -237
- package/dist/collection/components/lime-query-builder/filter-conversion.js +0 -255
- package/dist/components/limebb-lime-query-filter-and.d.ts +0 -11
- package/dist/components/limebb-lime-query-filter-and.js +0 -135
- package/dist/components/limebb-lime-query-filter-or.d.ts +0 -11
- package/dist/components/limebb-lime-query-filter-or.js +0 -123
- package/dist/esm/limebb-lime-query-filter-and.entry.js +0 -76
- package/dist/esm/limebb-lime-query-filter-expression.entry.js +0 -41
- package/dist/esm/limebb-lime-query-filter-or.entry.js +0 -64
- package/dist/lime-crm-building-blocks/p-24aeb928.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-422f6d51.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-67dbaa4c.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-6d119dab.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-91732502.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-b198194a.entry.js +0 -1
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-and.d.ts +0 -57
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-or.d.ts +0 -56
- package/dist/types/components/lime-query-builder/filter-conversion.d.ts +0 -31
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { Z as Zt } from './index.esm.js';
|
|
3
|
-
import { d as defineCustomElement$7 } from './lime-query-filter-comparison.js';
|
|
4
|
-
import { d as defineCustomElement$4, a as defineCustomElement$5, b as defineCustomElement$6 } from './lime-query-filter-expression.js';
|
|
5
|
-
import { d as defineCustomElement$3 } from './lime-query-value-input.js';
|
|
6
|
-
import { d as defineCustomElement$2 } from './property-selector.js';
|
|
7
|
-
|
|
8
|
-
const limeQueryFilterOrCss = "@charset \"UTF-8\";.expression{display:flex;flex-direction:column;margin-bottom:1rem;gap:0;background-color:rgb(var(--contrast-200));border:1px solid rgb(var(--contrast-600));border-radius:0.75rem}.expression>ul{margin-top:0;margin-right:1rem;margin-bottom:1rem;margin-left:1rem;padding-left:1rem;list-style:circle}.expression>ul li{margin-top:1rem}.expression>ul li.add-button{list-style:none;margin-top:0;text-align:right}";
|
|
9
|
-
const LimebbLimeQueryFilterOrStyle0 = limeQueryFilterOrCss;
|
|
10
|
-
|
|
11
|
-
const LimeQueryFilterOrComponent = /*@__PURE__*/ proxyCustomElement(class LimeQueryFilterOrComponent extends HTMLElement {
|
|
12
|
-
constructor() {
|
|
13
|
-
super();
|
|
14
|
-
this.__registerHost();
|
|
15
|
-
this.__attachShadow();
|
|
16
|
-
this.expressionChange = createEvent(this, "expressionChange", 7);
|
|
17
|
-
this.renderChildExpression = (expression, childIndex) => {
|
|
18
|
-
const label = this.expression.exp.length === 1 ? this.label : undefined;
|
|
19
|
-
return (h("li", null, h("limebb-lime-query-filter-expression", { platform: this.platform, context: this.context, label: label, limetype: this.limetype, activeLimetype: this.activeLimetype, expression: expression, onExpressionChange: this.handleExpressionChange(childIndex) })));
|
|
20
|
-
};
|
|
21
|
-
this.handleExpressionChange = (updatedChildIndex) => (event) => {
|
|
22
|
-
var _a;
|
|
23
|
-
event.stopPropagation();
|
|
24
|
-
const updatedExpression = (_a = event.detail) !== null && _a !== void 0 ? _a : undefined;
|
|
25
|
-
const expressions = [...this.expression.exp];
|
|
26
|
-
if (updatedExpression === undefined) {
|
|
27
|
-
expressions.splice(updatedChildIndex, 1);
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
expressions[updatedChildIndex] = updatedExpression;
|
|
31
|
-
}
|
|
32
|
-
if (expressions.length === 0) {
|
|
33
|
-
this.expressionChange.emit(undefined);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
if (expressions.length === 1) {
|
|
37
|
-
this.expressionChange.emit(expressions[0]);
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
this.expressionChange.emit({
|
|
41
|
-
op: Zt.OR,
|
|
42
|
-
exp: expressions,
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
this.handleAddChildExpression = () => {
|
|
46
|
-
const newComparison = {
|
|
47
|
-
key: '',
|
|
48
|
-
op: Zt.EQUALS,
|
|
49
|
-
exp: '',
|
|
50
|
-
};
|
|
51
|
-
const updatedExpressionsList = [
|
|
52
|
-
...this.expression.exp,
|
|
53
|
-
newComparison,
|
|
54
|
-
];
|
|
55
|
-
this.expressionChange.emit({
|
|
56
|
-
op: Zt.OR,
|
|
57
|
-
exp: updatedExpressionsList,
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
render() {
|
|
62
|
-
return (h("div", { key: '8efd3bba832388365d89313ebc007514fd3478e0', class: "expression" }, this.expression.exp.length > 1 && (h("limel-header", { key: 'eb65924d2e9b7e0e4e47f769b3af76773ae98266', heading: this.label, subheading: "Any of these conditions is true" })), h("ul", { key: 'cc6a4c9d7532096f054e9e20d54e67d14d45a038' }, this.expression.exp.map(this.renderChildExpression), h("li", { key: 'ad876db1e6435657d2263351b75ae4acb3a6a234', class: "add-button" }, this.renderAddChildExpression()))));
|
|
63
|
-
}
|
|
64
|
-
renderAddChildExpression() {
|
|
65
|
-
return (h("limel-icon-button", { label: "Add alternative", icon: "plus_math", onClick: this.handleAddChildExpression }));
|
|
66
|
-
}
|
|
67
|
-
static get style() { return LimebbLimeQueryFilterOrStyle0; }
|
|
68
|
-
}, [1, "limebb-lime-query-filter-or", {
|
|
69
|
-
"platform": [16],
|
|
70
|
-
"context": [16],
|
|
71
|
-
"label": [1],
|
|
72
|
-
"limetype": [1],
|
|
73
|
-
"activeLimetype": [1, "active-limetype"],
|
|
74
|
-
"expression": [16]
|
|
75
|
-
}]);
|
|
76
|
-
function defineCustomElement$1() {
|
|
77
|
-
if (typeof customElements === "undefined") {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
const components = ["limebb-lime-query-filter-or", "limebb-lime-query-filter-comparison", "limebb-lime-query-filter-expression", "limebb-lime-query-filter-group", "limebb-lime-query-filter-not", "limebb-lime-query-value-input", "limebb-property-selector"];
|
|
81
|
-
components.forEach(tagName => { switch (tagName) {
|
|
82
|
-
case "limebb-lime-query-filter-or":
|
|
83
|
-
if (!customElements.get(tagName)) {
|
|
84
|
-
customElements.define(tagName, LimeQueryFilterOrComponent);
|
|
85
|
-
}
|
|
86
|
-
break;
|
|
87
|
-
case "limebb-lime-query-filter-comparison":
|
|
88
|
-
if (!customElements.get(tagName)) {
|
|
89
|
-
defineCustomElement$7();
|
|
90
|
-
}
|
|
91
|
-
break;
|
|
92
|
-
case "limebb-lime-query-filter-expression":
|
|
93
|
-
if (!customElements.get(tagName)) {
|
|
94
|
-
defineCustomElement$6();
|
|
95
|
-
}
|
|
96
|
-
break;
|
|
97
|
-
case "limebb-lime-query-filter-group":
|
|
98
|
-
if (!customElements.get(tagName)) {
|
|
99
|
-
defineCustomElement$5();
|
|
100
|
-
}
|
|
101
|
-
break;
|
|
102
|
-
case "limebb-lime-query-filter-not":
|
|
103
|
-
if (!customElements.get(tagName)) {
|
|
104
|
-
defineCustomElement$4();
|
|
105
|
-
}
|
|
106
|
-
break;
|
|
107
|
-
case "limebb-lime-query-value-input":
|
|
108
|
-
if (!customElements.get(tagName)) {
|
|
109
|
-
defineCustomElement$3();
|
|
110
|
-
}
|
|
111
|
-
break;
|
|
112
|
-
case "limebb-property-selector":
|
|
113
|
-
if (!customElements.get(tagName)) {
|
|
114
|
-
defineCustomElement$2();
|
|
115
|
-
}
|
|
116
|
-
break;
|
|
117
|
-
} });
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
const LimebbLimeQueryFilterOr = LimeQueryFilterOrComponent;
|
|
121
|
-
const defineCustomElement = defineCustomElement$1;
|
|
122
|
-
|
|
123
|
-
export { LimebbLimeQueryFilterOr, defineCustomElement };
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-96dd111f.js';
|
|
2
|
-
import { Z as Zt } from './index.esm-bb569663.js';
|
|
3
|
-
|
|
4
|
-
const limeQueryFilterAndCss = "@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>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}";
|
|
5
|
-
const LimebbLimeQueryFilterAndStyle0 = limeQueryFilterAndCss;
|
|
6
|
-
|
|
7
|
-
const LimeQueryFilterAndComponent = class {
|
|
8
|
-
constructor(hostRef) {
|
|
9
|
-
registerInstance(this, hostRef);
|
|
10
|
-
this.expressionChange = createEvent(this, "expressionChange", 7);
|
|
11
|
-
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) })));
|
|
12
|
-
this.handleAddChildExpression = () => {
|
|
13
|
-
const newOrGroup = {
|
|
14
|
-
op: Zt.OR,
|
|
15
|
-
exp: [
|
|
16
|
-
{
|
|
17
|
-
key: '',
|
|
18
|
-
op: Zt.EQUALS,
|
|
19
|
-
exp: '',
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
};
|
|
23
|
-
const updatedExpressionsList = [
|
|
24
|
-
...this.expression.exp,
|
|
25
|
-
newOrGroup,
|
|
26
|
-
];
|
|
27
|
-
this.expressionChange.emit({
|
|
28
|
-
op: Zt.AND,
|
|
29
|
-
exp: updatedExpressionsList,
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
this.handleExpressionChange = (updatedChildIndex) => (event) => {
|
|
33
|
-
var _a;
|
|
34
|
-
event.stopPropagation();
|
|
35
|
-
const updatedExpression = (_a = event.detail) !== null && _a !== void 0 ? _a : undefined;
|
|
36
|
-
const expressions = [...this.expression.exp];
|
|
37
|
-
if (updatedExpression === undefined) {
|
|
38
|
-
expressions.splice(updatedChildIndex, 1);
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
expressions[updatedChildIndex] = updatedExpression;
|
|
42
|
-
}
|
|
43
|
-
if (expressions.length === 0) {
|
|
44
|
-
this.expressionChange.emit(undefined);
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
if (expressions.length === 1) {
|
|
48
|
-
this.expressionChange.emit(expressions[0]);
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
this.expressionChange.emit({
|
|
52
|
-
op: Zt.AND,
|
|
53
|
-
exp: expressions,
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
render() {
|
|
58
|
-
let subheading = 'All of these conditions are true';
|
|
59
|
-
if (this.expression.exp.length <= 1) {
|
|
60
|
-
subheading = '';
|
|
61
|
-
}
|
|
62
|
-
return (h("div", { key: 'f07c53808d6be8d846f5a45223abb5c94b1a0b16', class: "expression" }, (this.label || subheading) && (h("limel-header", { key: '229f0d58ff15743fbb12da53ad9c593bfba801d1', heading: this.label, subheading: subheading })), h("ul", { key: '2600c2bee2b958036ea606141bcfcac0e277114c' }, this.expression.exp.map(this.renderChildExpression), h("li", { key: '6395e605ee8f454a820ac73601da89b19686187a', class: "add-button" }, this.renderAddChildExpression()))));
|
|
63
|
-
}
|
|
64
|
-
renderAddChildExpression() {
|
|
65
|
-
return (h("limel-button", { label: this.getAddButtonLabel(), icon: "plus_math", onClick: this.handleAddChildExpression }));
|
|
66
|
-
}
|
|
67
|
-
getAddButtonLabel() {
|
|
68
|
-
if (this.expression.exp.length === 0) {
|
|
69
|
-
return 'Add a condition';
|
|
70
|
-
}
|
|
71
|
-
return 'Add another condition';
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
LimeQueryFilterAndComponent.style = LimebbLimeQueryFilterAndStyle0;
|
|
75
|
-
|
|
76
|
-
export { LimeQueryFilterAndComponent as limebb_lime_query_filter_and };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-96dd111f.js';
|
|
2
|
-
import { Z as Zt } from './index.esm-bb569663.js';
|
|
3
|
-
|
|
4
|
-
const limeQueryFilterExpressionCss = "@charset \"UTF-8\";.expression{display:flex;flex-direction:column;margin-bottom:1rem;gap:1rem}";
|
|
5
|
-
const LimebbLimeQueryFilterExpressionStyle0 = limeQueryFilterExpressionCss;
|
|
6
|
-
|
|
7
|
-
const LimeQueryFilterExpressionComponent = class {
|
|
8
|
-
constructor(hostRef) {
|
|
9
|
-
registerInstance(this, hostRef);
|
|
10
|
-
this.expressionChange = createEvent(this, "expressionChange", 7);
|
|
11
|
-
this.handleExpressionChange = (event) => {
|
|
12
|
-
event.stopPropagation();
|
|
13
|
-
this.expressionChange.emit(event.detail);
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
render() {
|
|
17
|
-
if (!this.expression) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const props = {
|
|
21
|
-
platform: this.platform,
|
|
22
|
-
context: this.context,
|
|
23
|
-
label: this.label,
|
|
24
|
-
limetype: this.limetype,
|
|
25
|
-
activeLimetype: this.activeLimetype,
|
|
26
|
-
};
|
|
27
|
-
if ('key' in this.expression) {
|
|
28
|
-
return (h("limebb-lime-query-filter-comparison", Object.assign({}, props, { expression: this.expression, onExpressionChange: this.handleExpressionChange })));
|
|
29
|
-
}
|
|
30
|
-
if (this.expression.op === Zt.AND ||
|
|
31
|
-
this.expression.op === Zt.OR) {
|
|
32
|
-
return (h("limebb-lime-query-filter-group", Object.assign({}, props, { expression: this.expression, onExpressionChange: this.handleExpressionChange })));
|
|
33
|
-
}
|
|
34
|
-
if (this.expression.op === Zt.NOT) {
|
|
35
|
-
return (h("limebb-lime-query-filter-not", Object.assign({}, props, { expression: this.expression, onExpressionChange: this.handleExpressionChange })));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
LimeQueryFilterExpressionComponent.style = LimebbLimeQueryFilterExpressionStyle0;
|
|
40
|
-
|
|
41
|
-
export { LimeQueryFilterExpressionComponent as limebb_lime_query_filter_expression };
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-96dd111f.js';
|
|
2
|
-
import { Z as Zt } from './index.esm-bb569663.js';
|
|
3
|
-
|
|
4
|
-
const limeQueryFilterOrCss = "@charset \"UTF-8\";.expression{display:flex;flex-direction:column;margin-bottom:1rem;gap:0;background-color:rgb(var(--contrast-200));border:1px solid rgb(var(--contrast-600));border-radius:0.75rem}.expression>ul{margin-top:0;margin-right:1rem;margin-bottom:1rem;margin-left:1rem;padding-left:1rem;list-style:circle}.expression>ul li{margin-top:1rem}.expression>ul li.add-button{list-style:none;margin-top:0;text-align:right}";
|
|
5
|
-
const LimebbLimeQueryFilterOrStyle0 = limeQueryFilterOrCss;
|
|
6
|
-
|
|
7
|
-
const LimeQueryFilterOrComponent = class {
|
|
8
|
-
constructor(hostRef) {
|
|
9
|
-
registerInstance(this, hostRef);
|
|
10
|
-
this.expressionChange = createEvent(this, "expressionChange", 7);
|
|
11
|
-
this.renderChildExpression = (expression, childIndex) => {
|
|
12
|
-
const label = this.expression.exp.length === 1 ? this.label : undefined;
|
|
13
|
-
return (h("li", null, h("limebb-lime-query-filter-expression", { platform: this.platform, context: this.context, label: label, limetype: this.limetype, activeLimetype: this.activeLimetype, expression: expression, onExpressionChange: this.handleExpressionChange(childIndex) })));
|
|
14
|
-
};
|
|
15
|
-
this.handleExpressionChange = (updatedChildIndex) => (event) => {
|
|
16
|
-
var _a;
|
|
17
|
-
event.stopPropagation();
|
|
18
|
-
const updatedExpression = (_a = event.detail) !== null && _a !== void 0 ? _a : undefined;
|
|
19
|
-
const expressions = [...this.expression.exp];
|
|
20
|
-
if (updatedExpression === undefined) {
|
|
21
|
-
expressions.splice(updatedChildIndex, 1);
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
expressions[updatedChildIndex] = updatedExpression;
|
|
25
|
-
}
|
|
26
|
-
if (expressions.length === 0) {
|
|
27
|
-
this.expressionChange.emit(undefined);
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
if (expressions.length === 1) {
|
|
31
|
-
this.expressionChange.emit(expressions[0]);
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
this.expressionChange.emit({
|
|
35
|
-
op: Zt.OR,
|
|
36
|
-
exp: expressions,
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
this.handleAddChildExpression = () => {
|
|
40
|
-
const newComparison = {
|
|
41
|
-
key: '',
|
|
42
|
-
op: Zt.EQUALS,
|
|
43
|
-
exp: '',
|
|
44
|
-
};
|
|
45
|
-
const updatedExpressionsList = [
|
|
46
|
-
...this.expression.exp,
|
|
47
|
-
newComparison,
|
|
48
|
-
];
|
|
49
|
-
this.expressionChange.emit({
|
|
50
|
-
op: Zt.OR,
|
|
51
|
-
exp: updatedExpressionsList,
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
render() {
|
|
56
|
-
return (h("div", { key: '8efd3bba832388365d89313ebc007514fd3478e0', class: "expression" }, this.expression.exp.length > 1 && (h("limel-header", { key: 'eb65924d2e9b7e0e4e47f769b3af76773ae98266', heading: this.label, subheading: "Any of these conditions is true" })), h("ul", { key: 'cc6a4c9d7532096f054e9e20d54e67d14d45a038' }, this.expression.exp.map(this.renderChildExpression), h("li", { key: 'ad876db1e6435657d2263351b75ae4acb3a6a234', class: "add-button" }, this.renderAddChildExpression()))));
|
|
57
|
-
}
|
|
58
|
-
renderAddChildExpression() {
|
|
59
|
-
return (h("limel-icon-button", { label: "Add alternative", icon: "plus_math", onClick: this.handleAddChildExpression }));
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
LimeQueryFilterOrComponent.style = LimebbLimeQueryFilterOrStyle0;
|
|
63
|
-
|
|
64
|
-
export { LimeQueryFilterOrComponent as limebb_lime_query_filter_or };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as i}from"./p-1556b545.js";import{Z as s,T as r}from"./p-4838284a.js";import{a as l,g as o}from"./p-e0ab1554.js";const n=[{value:s.EQUALS,label:"Equals",icon:"equals"},{value:s.NOT_EQUALS,label:"Not Equals",icon:"not-equal"},{value:s.GREATER,label:"Greater Than",icon:"greater-than",applicableTypes:["integer","decimal","date","time"]},{value:s.GREATER_OR_EQUAL,label:"Greater or Equal",icon:"greater-or-equal",applicableTypes:["integer","decimal","date","time"]},{value:s.LESS,label:"Less Than",icon:"less-than",applicableTypes:["integer","decimal","date","time"]},{value:s.LESS_OR_EQUAL,label:"Less or Equal",icon:"less-or-equal",applicableTypes:["integer","decimal","date","time"]},{value:s.IN,label:"In List",icon:"list"},{value:s.LIKE,label:"Contains",icon:"-lime-filter-contain",applicableTypes:["string","text"]},{value:s.BEGINS,label:"Begins With",icon:"-lime-filter-begin",applicableTypes:["string","text"]},{value:s.ENDS,label:"Ends With",icon:"-lime-filter-end",applicableTypes:["string","text"]}],a=class{constructor(i){e(this,i),this.expressionChange=t(this,"expressionChange",7),this.handlePropertyChange=e=>{e.stopPropagation(),this.expressionChange.emit(Object.assign(Object.assign({},this.expression),{key:e.detail}))},this.handleOperatorChange=e=>{e.stopPropagation(),this.expressionChange.emit({key:this.expression.key,op:e.detail.value,exp:this.expression.exp})},this.handleValueChange=e=>{e.stopPropagation(),this.expressionChange.emit(Object.assign(Object.assign({},this.expression),{exp:e.detail}))},this.removeExpression=()=>{this.expressionChange.emit(void 0)}}render(){return i("div",{key:"668e0f05bdb1fb25ffd652ea650c34e5431a3332",class:"expression"},this.label&&i("limel-header",{key:"5034070b58afe31cf90699dd2a27f884e647f540",heading:this.label}),i("div",{key:"14a2b1270e5e6d7e158e29ebc5f61051e5670e80",class:"expression-container"},this.renderPropertySelector(),this.renderOperator(),this.renderValueInput(),i("limel-icon-button",{key:"b69bde6e88c40d2623ef015794db28cec3676c73",class:"remove",icon:"trash",label:"Remove condition",onClick:this.removeExpression})))}renderPropertySelector(){return i("limebb-property-selector",{platform:this.platform,context:this.context,label:"Property",limetype:this.limetype,value:this.expression.key,required:!0,onChange:this.handlePropertyChange})}renderOperator(){const e=!!this.expression.op,t=n.map((e=>({text:e.label,value:e.value,icon:e.icon?{name:e.icon}:void 0}))),s=t.find((e=>e.value===this.expression.op));return i("limel-select",{class:"operator",label:"Operator",value:s,options:t,disabled:!e&&!this.expression.key,onChange:this.handleOperatorChange})}renderValueInput(){return this.expression.op?i("limebb-lime-query-value-input",{platform:this.platform,context:this.context,limetype:this.limetype,activeLimetype:this.activeLimetype,propertyPath:this.expression.key,operator:this.expression.op,value:this.expression.exp,onChange:this.handleValueChange}):null}};a.style=".expression-container{display:flex;flex-direction:row;align-items:flex-start;gap:1rem;flex-wrap:wrap}.expression-container>*{flex-grow:2;width:30%;max-width:calc(100% - 3.25rem)}.expression-container>.operator{flex-grow:1;width:calc(30% + 1rem);min-width:4rem}.expression-container>.remove{flex-grow:0;width:auto;margin-left:auto}@media (max-width: 768px){.expression-container{flex-direction:column}.expression-container>*{width:100%;max-width:100%}.expression-container>.operator{width:100%}.expression-container>.remove{margin-left:0;align-self:flex-end}}";const h=class{constructor(r){e(this,r),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===s.AND?s.OR:s.AND,exp:this.expression.exp})},this.handleAddChildExpression=()=>{this.expressionChange.emit({op:this.expression.op,exp:[...this.expression.exp,{key:"",op:s.EQUALS,exp:""}]})},this.handleAddChildGroup=()=>{this.expressionChange.emit({op:this.expression.op,exp:[...this.expression.exp,{op:this.expression.op===s.AND?s.OR:s.AND,exp:[{key:"",op:s.EQUALS,exp:""}]}]})},this.handleExpressionChange=e=>t=>{t.stopPropagation();const i=t.detail,s=[...this.expression.exp];if(void 0===i){if(s.splice(e,1),0===s.length)return void this.expressionChange.emit(void 0);if(1===s.length)return void this.expressionChange.emit(s[0])}else s[e]=i;this.expressionChange.emit({op:this.expression.op,exp:s})}}render(){const e=this.getSubheading();return i("div",{key:"43a1d99fd896e3ad49dd97594e54bccaf74c3aa0",class:"expression"},e&&i("limel-header",{key:"534eb0a3db2f0194e8a28e2fb071beb545f38458",subheading:e,onClick:this.handleToggleOperator,class:"clickable-header"}),i("ul",{key:"9d29d98ab034bf2878e7dc19828bc045dbdd492f"},this.expression.exp.map(this.renderChildExpression),i("li",{key:"44b266c8aeb390b8a68b3e08a51a0760a6421f93",class:"add-button"},this.renderAddButton(),this.renderAddGroupButton())))}getSubheading(){return this.expression.exp.length<=1?"":this.expression.op===s.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===s.AND?"Add another condition":"Add alternative"}getAddGroupButtonLabel(){return 0===this.expression.exp.length?"Add a group":this.expression.op===s.AND?"Add another group":"Add alternative group"}};h.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 c=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:s.NOT,exp:i}:void 0)}}render(){return i("div",{key:"f1dfd7fd4ec7dc1873841d1c8b3d2bb6677634fd",class:"expression"},this.label&&i("limel-header",{key:"91e1b754f6e45c70f49bf2a770898a590defaf22",heading:this.label}),i("limebb-lime-query-filter-expression",{key:"bf42f3c71521a413e5ecc49a8e0d6401b34384a2",platform:this.platform,context:this.context,label:"Not",limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.expression.exp,onExpressionChange:this.handleExpressionChange}))}};c.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 d=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("IN"===this.operator)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 s="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:s,onChange:this.handleTextChange})}renderBooleanInput(){const e=[{text:"True",value:"true"},{text:"False",value:"false"}],t=!0===this.value||"true"===this.value?"true":"false",s=e.find((e=>e.value===t));return i("limel-select",{label:this.label,options:e,value:s,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}))),s=t.find((e=>e.value===this.value));return i("limel-select",{label:this.label,options:t,value:s,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,s){var r,l=arguments.length,o=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(o=(l<3?r(o):l>3?r(t,i,o):r(t,i))||o);l>3&&o&&Object.defineProperty(t,i,o)})([r()],d.prototype,"limetypes",void 0),d.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}";const u=class{constructor(i){e(this,i),this.change=t(this,"change",7),this.label="Property",this.required=!1,this.isOpen=!1,this.navigationPath="",this.menuItems=[],this.handleChipSetWrapperClick=e=>{e.stopPropagation()},this.handleChipSetFocus=()=>{this.isOpen||(this.navigationPath=this.value||"",this.loadMenuItems(),this.isOpen=!0)},this.handleSelect=e=>{e.stopPropagation();const t=e.detail.value;if(!t)return;const i=l(this.limetypes,this.limetype,t);(null==i?void 0:i.relation)?this.navigationPath=t:(this.change.emit(t),this.isOpen=!1,this.navigationPath="")},this.handleNavigateMenu=e=>{var t;e.stopPropagation(),(null===(t=e.detail)||void 0===t?void 0:t.value)&&(this.navigationPath=e.detail.value)},this.handleCancel=()=>{this.isOpen=!1,this.navigationPath=""},this.handleChipSetChange=e=>{e.stopPropagation();const t=e.detail;if(!t)return this.change.emit(""),void(this.navigationPath="");const i=Array.isArray(t)?t:[t];if(0===i.length)this.change.emit(""),this.navigationPath="";else{const e=i.at(-1);e&&this.change.emit(e.value),this.navigationPath=""}}}render(){if(!this.limetype||!this.limetypes)return null;const e=this.getChipsForPath(this.navigationPath||this.value||"");return i("limel-menu",{items:this.menuItems,open:this.isOpen,emptyResultMessage:"No available properties",surfaceWidth:"inherit-from-trigger",openDirection:"bottom-end",onSelect:this.handleSelect,onNavigateMenu:this.handleNavigateMenu,onCancel:this.handleCancel},i("div",{slot:"trigger"},i("div",{onClick:this.handleChipSetWrapperClick},i("limel-chip-set",{type:"input",label:this.label,value:e,required:this.required,helperText:this.helperText,delimiter:"›",maxItems:1,onChange:this.handleChipSetChange,onFocus:this.handleChipSetFocus}))))}loadMenuItems(){const e=this.getCurrentLimetype();this.menuItems=e?this.createMenuItems(e,""):[]}getCurrentLimetype(){if(!this.navigationPath)return this.limetypes[this.limetype];const e=l(this.limetypes,this.limetype,this.navigationPath);return(null==e?void 0:e.relation)?e.relation.getLimetype():this.limetypes[this.limetype]}createMenuItems(e,t){const i=[];if(!e)return i;const s=o(e);for(const[e,r]of Object.entries(s)){if("hasmany"===r.type||"hasandbelongstomany"===r.type)continue;const s=t?`${t}.${e}`:e;let l;if(r.relation&&r.relation){const e=r.relation.getLimetype();e&&(l=async()=>this.createMenuItems(e,s))}i.push({text:r.localname||e,secondaryText:this.getSecondaryText(r),icon:this.getIconForProperty(r),value:s,items:l})}return 0===i.length?[{text:"No available properties",value:"",disabled:!0}]:i}getSecondaryText(e){var t;if(e.relation){const i=e.relation.getLimetype();return(null===(t=null==i?void 0:i.localname)||void 0===t?void 0:t.singular)||"Object"}return e.type.charAt(0).toUpperCase()+e.type.slice(1)}getIconForProperty(e){return e.relation?{name:"link",color:"rgb(var(--color-sky-default))"}:{name:"decision",color:"rgb(var(--color-gray-default))"}}getChipsForPath(e){if(!e)return[];const t=e.split("."),i=[];let s=this.limetypes[this.limetype],r="";for(const e of t){r=r?`${r}.${e}`:e;const t=o(s)[e];t&&(i.push({id:r,text:t.localname||e,icon:this.getIconForProperty(t),value:r}),t.relation&&(s=t.relation.getLimetype()))}return i}};(function(e,t,i,s){var r,l=arguments.length,o=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(o=(l<3?r(o):l>3?r(t,i,o):r(t,i))||o);l>3&&o&&Object.defineProperty(t,i,o)})([r()],u.prototype,"limetypes",void 0),u.style=":host(limebb-property-selector){display:block}limel-menu{display:block;width:100%}";export{a as limebb_lime_query_filter_comparison,h as limebb_lime_query_filter_group,c as limebb_lime_query_filter_not,d as limebb_lime_query_value_input,u as limebb_property_selector}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as i,h as s}from"./p-1556b545.js";import{Z as t}from"./p-4838284a.js";const r=class{constructor(s){e(this,s),this.expressionChange=i(this,"expressionChange",7),this.handleExpressionChange=e=>{e.stopPropagation(),this.expressionChange.emit(e.detail)}}render(){if(!this.expression)return;const e={platform:this.platform,context:this.context,label:this.label,limetype:this.limetype,activeLimetype:this.activeLimetype};return"key"in this.expression?s("limebb-lime-query-filter-comparison",Object.assign({},e,{expression:this.expression,onExpressionChange:this.handleExpressionChange})):this.expression.op===t.AND||this.expression.op===t.OR?s("limebb-lime-query-filter-group",Object.assign({},e,{expression:this.expression,onExpressionChange:this.handleExpressionChange})):this.expression.op===t.NOT?s("limebb-lime-query-filter-not",Object.assign({},e,{expression:this.expression,onExpressionChange:this.handleExpressionChange})):void 0}};r.style='@charset "UTF-8";.expression{display:flex;flex-direction:column;margin-bottom:1rem;gap:1rem}';export{r as limebb_lime_query_filter_expression}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as i,h as t}from"./p-1556b545.js";import{Z as s}from"./p-4838284a.js";const r=class{constructor(r){e(this,r),this.expressionChange=i(this,"expressionChange",7),this.renderChildExpression=(e,i)=>t("li",null,t("limebb-lime-query-filter-expression",{platform:this.platform,context:this.context,limetype:this.limetype,activeLimetype:this.activeLimetype,expression:e,onExpressionChange:this.handleExpressionChange(i)})),this.handleAddChildExpression=()=>{const e=[...this.expression.exp,{op:s.OR,exp:[{key:"",op:s.EQUALS,exp:""}]}];this.expressionChange.emit({op:s.AND,exp:e})},this.handleExpressionChange=e=>i=>{var t;i.stopPropagation();const r=null!==(t=i.detail)&&void 0!==t?t:void 0,o=[...this.expression.exp];void 0===r?o.splice(e,1):o[e]=r,this.expressionChange.emit(0!==o.length?1!==o.length?{op:s.AND,exp:o}:o[0]:void 0)}}render(){let e="All of these conditions are true";return this.expression.exp.length<=1&&(e=""),t("div",{key:"f07c53808d6be8d846f5a45223abb5c94b1a0b16",class:"expression"},(this.label||e)&&t("limel-header",{key:"229f0d58ff15743fbb12da53ad9c593bfba801d1",heading:this.label,subheading:e}),t("ul",{key:"2600c2bee2b958036ea606141bcfcac0e277114c"},this.expression.exp.map(this.renderChildExpression),t("li",{key:"6395e605ee8f454a820ac73601da89b19686187a",class:"add-button"},this.renderAddChildExpression())))}renderAddChildExpression(){return t("limel-button",{label:this.getAddButtonLabel(),icon:"plus_math",onClick:this.handleAddChildExpression})}getAddButtonLabel(){return 0===this.expression.exp.length?"Add a condition":"Add another condition"}};r.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>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}';export{r as limebb_lime_query_filter_and}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as i}from"./p-1556b545.js";import{Z as s,c as o}from"./p-4838284a.js";import{b as r}from"./p-20bfca36.js";import{i as n}from"./p-1484e300.js";import{b as l}from"./p-a659d55a.js";import{i as a,a as h,b as c}from"./p-b31772c8.js";import"./p-35897ec3.js";import"./p-fe2b91d9.js";import"./p-5322fd19.js";function p(t){return"string"==typeof t||!a(t)&&h(t)&&"[object String]"==c(t)}const d=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}))}};d.style=".expression-with-promotion{display:flex;flex-direction:column;gap:1rem}";const m=["string","text","phone","integer","decimal","percent","time","date","year","quarter","month","yesno","link","user","xml","option","set","file","system"],u=m.filter((t=>"system"!==t));u.push("belongsto","hasone","hasmany","hasandbelongstomany");const f=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(o.Application).getLanguage();this.collator=new Intl.Collator(t,{numeric:!0,sensitivity:"base"})}componentShouldUpdate(t,e,i){var s,o,r,n;return"formInfo"!==i||(r=null===(s=null==t?void 0:t.schema)||void 0===s?void 0:s.oneOf,n=null===(o=null==e?void 0:e.schema)||void 0===o?void 0:o.oneOf,!l(r,n))}render(){var t;const e=this.getLimeTypes().map(b);e.sort(((t,e)=>this.collator.compare(t.text,e.text)));let s=e.find((t=>t.value===this.value)),o=this.invalid;return this.value&&!s&&(o=!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:"cf27b83c4751838e85436af443a275b3d7c9dfee",label:this.label,options:e,value:s,required:this.required,helperText:this.helperText,invalid:o,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(p)),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===m&&(e.allowedPropertyTypes=u)}get limeTypeRepository(){return this.platform.get(o.LimeTypeRepository)}},b=t=>({text:t.localname.singular,value:t.name,icon:r(t)});function y(t,e,i){if(null===i)return void t.push({path:e});const s=i,o="_alias"in s,r="#description"in s,n=Object.keys(s).filter((t=>"_alias"!==t&&"#description"!==t));if(0!==n.length)if(o||r){const i={};for(const t of n)i[t]=s[t];t.push(...v(i,e))}else t.push(...v(i,e));else{const i=s._alias,o=s["#description"];t.push(i||o?{path:e,alias:i,description:o}:{path:e})}}function v(t,e=""){if(!t)return[];const i=[];for(const[s,o]of Object.entries(t))"object"==typeof o&&y(i,e?`${e}.${s}`:s,o);return i}function g(t,e,i){const s=t[e];if(s&&"object"==typeof s&&!("_alias"in s)&&!("#description"in s))return;const o={};i.alias&&""!==i.alias.trim()&&(o._alias=i.alias),i.description&&""!==i.description.trim()&&(o["#description"]=i.description),t[e]=Object.keys(o).length>0?o:null}function x(t,e){const i=t[e];if(!i)return t[e]={},t[e];if("object"==typeof i){const t=i;return Object.keys(t).filter((t=>"_alias"!==t&&"#description"!==t)),t}return t[e]={},t[e]}const j=class{constructor(i){t(this,i),this.change=e(this,"change",7),this.label="Select Properties to Return",this.items=[{path:"_id"}],this.handleItemChange=t=>e=>{e.stopPropagation();const i=[...this.items];null===e.detail?i.splice(t,1):i[t]=e.detail,0===i.length&&i.push({path:"_id"}),this.items=i,this.emitChange()},this.handleAddProperty=()=>{this.items=[...this.items,{path:""}],this.emitChange()}}componentWillLoad(){var t;if(null===(t=this.value)||void 0===t?void 0:t.object){const t=v(this.value.object);t.length>0&&(this.items=t)}}componentWillUpdate(){var t;if(null===(t=this.value)||void 0===t?void 0:t.object){const t=v(this.value.object);(t.length!==this.items.length||!t.every(((t,e)=>{const i=this.items[e];return i&&t.path===i.path&&t.alias===i.alias&&t.description===i.description})))&&(this.items=t.length>0?t:[{path:"_id"}])}}render(){return this.limetype?i("div",{class:"response-format-editor"},i("div",{class:"header"},i("h4",null,this.label)),i("div",{class:"property-list"},this.items.map(((t,e)=>this.renderItem(t,e)))),i("div",{class:"actions"},i("limel-button",{label:"Add Property",icon:"plus_math",onClick:this.handleAddProperty})),i("div",{class:"summary"},i("span",{class:"count"},this.items.length," ",1===this.items.length?"property":"properties"," ","selected"))):i("div",{class:"empty-state"},i("p",null,"Select a limetype to choose properties"))}renderItem(t,e){return i("limebb-response-format-item",{key:`${t.path}-${e}`,class:"property-item",platform:this.platform,context:this.context,limetype:this.limetype,item:t,onItemChange:this.handleItemChange(e)})}emitChange(){const t=function(t){const e={};for(const i of t){const t=i.path.split(".");let s=e;for(let e=0;e<t.length;e++){const o=t[e];e===t.length-1?g(s,o,i):s=x(s,o)}}return e}(this.items);this.change.emit({object:t})}};j.style=":host(limebb-response-format-editor){display:block;width:100%}.response-format-editor{display:flex;flex-direction:column;gap:1rem;padding:1rem}.header{display:flex;justify-content:space-between;align-items:center;gap:1rem}.header h4{margin:0;font-size:1rem;font-weight:600;color:rgb(var(--contrast-1000))}.property-list{display:flex;flex-direction:column;gap:1rem;padding:0.5rem;border:1px solid rgb(var(--contrast-300));border-radius:0.25rem;background-color:rgb(var(--contrast-50));min-height:4rem}.property-item{padding:0.5rem;border-radius:0.25rem;transition:background-color 0.2s}.property-item:hover{background-color:rgb(var(--contrast-100))}.actions{display:flex;justify-content:flex-start}.summary{display:flex;justify-content:space-between;align-items:center;padding-top:0.5rem;border-top:1px solid rgb(var(--contrast-300))}.summary .count{font-size:0.875rem;font-weight:500;color:rgb(var(--contrast-900))}.empty-state{padding:2rem;text-align:center;color:rgb(var(--contrast-700));font-style:italic}.empty-state p{margin:0}";export{d as limebb_lime_query_filter_builder,f as limebb_limetype_field,j as limebb_response_format_editor}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as i,h as t}from"./p-1556b545.js";import{Z as s}from"./p-4838284a.js";const r=class{constructor(r){e(this,r),this.expressionChange=i(this,"expressionChange",7),this.renderChildExpression=(e,i)=>t("li",null,t("limebb-lime-query-filter-expression",{platform:this.platform,context:this.context,label:1===this.expression.exp.length?this.label:void 0,limetype:this.limetype,activeLimetype:this.activeLimetype,expression:e,onExpressionChange:this.handleExpressionChange(i)})),this.handleExpressionChange=e=>i=>{var t;i.stopPropagation();const r=null!==(t=i.detail)&&void 0!==t?t:void 0,o=[...this.expression.exp];void 0===r?o.splice(e,1):o[e]=r,this.expressionChange.emit(0!==o.length?1!==o.length?{op:s.OR,exp:o}:o[0]:void 0)},this.handleAddChildExpression=()=>{const e=[...this.expression.exp,{key:"",op:s.EQUALS,exp:""}];this.expressionChange.emit({op:s.OR,exp:e})}}render(){return t("div",{key:"8efd3bba832388365d89313ebc007514fd3478e0",class:"expression"},this.expression.exp.length>1&&t("limel-header",{key:"eb65924d2e9b7e0e4e47f769b3af76773ae98266",heading:this.label,subheading:"Any of these conditions is true"}),t("ul",{key:"cc6a4c9d7532096f054e9e20d54e67d14d45a038"},this.expression.exp.map(this.renderChildExpression),t("li",{key:"ad876db1e6435657d2263351b75ae4acb3a6a234",class:"add-button"},this.renderAddChildExpression())))}renderAddChildExpression(){return t("limel-icon-button",{label:"Add alternative",icon:"plus_math",onClick:this.handleAddChildExpression})}};r.style='@charset "UTF-8";.expression{display:flex;flex-direction:column;margin-bottom:1rem;gap:0;background-color:rgb(var(--contrast-200));border:1px solid rgb(var(--contrast-600));border-radius:0.75rem}.expression>ul{margin-top:0;margin-right:1rem;margin-bottom:1rem;margin-left:1rem;padding-left:1rem;list-style:circle}.expression>ul li{margin-top:1rem}.expression>ul li.add-button{list-style:none;margin-top:0;text-align:right}';export{r as limebb_lime_query_filter_or}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as i}from"./p-1556b545.js";import{T as r}from"./p-4838284a.js";import{g as o,a as n}from"./p-e0ab1554.js";const s=[{value:"=",label:"Equals",icon:"equals"},{value:"!=",label:"Not Equals",icon:"not-equal"},{value:">",label:"Greater Than",icon:"greater-than",applicableTypes:["integer","decimal","date","time"]},{value:">=",label:"Greater or Equal",icon:"greater-or-equal",applicableTypes:["integer","decimal","date","time"]},{value:"<",label:"Less Than",icon:"less-than",applicableTypes:["integer","decimal","date","time"]},{value:"<=",label:"Less or Equal",icon:"less-or-equal",applicableTypes:["integer","decimal","date","time"]},{value:"IN",label:"In List",icon:"list"},{value:"?",label:"Contains",icon:"-lime-filter-contain",applicableTypes:["string","text"]},{value:"=?",label:"Begins With",icon:"-lime-filter-begin",applicableTypes:["string","text"]},{value:"=$",label:"Ends With",icon:"-lime-filter-end",applicableTypes:["string","text"]}];function l(e){return e?"key"in e?function(e){if(!("op"in e)||!("exp"in e))throw new Error("Invalid filter: comparison must have key, op, and exp properties");if(!s.map((e=>e.value)).includes(e.op))throw new Error(`Unsupported filter operator: ${e.op}`);const t=new Set(["key","op","exp","type"]),i=Object.keys(e).filter((e=>!t.has(e)));if(i.length>0)throw new Error(`Unexpected properties in filter comparison: ${i.join(", ")}`);return{filter_type:"comparison",property:e.key,operator:e.op,value:e.exp}}(e):function(e){if(!("op"in e))throw new Error("Invalid filter: filter group must have op property");if(!("exp"in e))throw new Error("Invalid filter: filter group must have exp property");const t=new Set(["op","exp"]),i=Object.keys(e).filter((e=>!t.has(e)));if(i.length>0)throw new Error(`Unexpected properties in filter group: ${i.join(", ")}`);if("!"===e.op){if(Array.isArray(e.exp))throw new TypeError("Invalid NOT filter: exp should be a single expression, not an array");return{filter_type:"NOT",expression:l(e.exp)}}if("AND"===e.op){if(!Array.isArray(e.exp))throw new TypeError("Invalid AND filter: exp must be an array");return{filter_type:"AND",expressions:e.exp.map(l)}}if("OR"===e.op){if(!Array.isArray(e.exp))throw new TypeError("Invalid OR filter: exp must be an array");return{filter_type:"OR",expressions:e.exp.map(l)}}throw new Error(`Unsupported filter operator: ${e.op}`)}(e):{filter_type:"AND",expressions:[]}}const a=new Set(["$yesterday","$now","$today","$tomorrow","$this_week","$this_month","$this_quarter","$this_year"]),d=/^\$(previous|next)_(day|week|month|quarter|year)\(\d+\)$/,c=/^\$me(\.\w+)*$/;function u(e,t,i=!0){const r=Object.keys(e),o=[];if(i){const e=r.filter((e=>e.startsWith("#")&&"#description"!==e));e.length>0&&o.push(`Property '${t}' contains # properties not supported in GUI: ${e.join(", ")}`)}return{keys:r.filter((e=>"_alias"!==e&&!e.startsWith("#"))),guiLimitations:o}}function p(e,t,i,r,o,n=!0){if(""===e){if(n&&null!==t)throw new Error("Empty property name must have null value");return[]}const s=i[e];if(!s)throw new Error(`Property '${e}' does not exist on limetype '${o}'`);return s.relation?function(e,t,i,r,o=!0){if(null===t)return[];if("object"!=typeof t)throw new TypeError(`Relation property '${e}' must be null or an object`);const n=t,{keys:s,guiLimitations:l}=u(n,e,o);if(0===s.length)return l;const a=r.relation.getLimetype();if(!a)throw new Error(`Could not determine related limetype for property '${e}'`);const d={};for(const e of s)d[e]=n[e];const c=h(d,i,a.name,o);return[...l,...c]}(e,t,r,s,n):function(e,t,i=!0){if(null===t)return[];if("object"==typeof t){const{keys:r,guiLimitations:o}=u(t,e,i);if(0===r.length)return o;throw new Error(`Non-relation property '${e}' cannot have nested properties other than _alias or # properties (got: ${r.join(", ")})`)}throw new Error(`Non-relation property '${e}' must be null or an object (got ${typeof t})`)}(e,t,n)}function h(e,t,i,r=!0){const n=t[i];if(!n)throw new Error(`Unknown limetype: ${i}`);const s=o(n),l=[];for(const[o,n]of Object.entries(e)){if(o.startsWith("#"))continue;const e=p(o,n,s,t,i,r);l.push(...e)}return l}function m(e,t,i,r=!0){if(e)if("key"in e){const r=function(e,t,i){if(function(e){return"string"==typeof e&&(a.has(e)||d.test(e)||c.test(e))}(e))return{valid:!0};if("string"!=typeof e||!e.startsWith("%activeObject%"))return{valid:!0};if(!t)return{valid:!0};const r=e.replace(/^%activeObject%\.?/,"");if(!r)return{valid:!0};try{return n(i,t,r)?{valid:!0}:{valid:!1,error:`Property path '${r}' does not exist on limetype '${t}'`}}catch(e){return{valid:!1,error:`Invalid placeholder path: ${e.message}`}}}(e.exp,t,i);if(!r.valid)throw new Error(`Invalid placeholder in filter '${e.key}': ${r.error}`)}else if("exp"in e)if("!"===e.op)m(e.exp,t,i,r);else if("AND"===e.op||"OR"===e.op){const o=e.exp;for(const e of o)m(e,t,i,r)}}const f=class{constructor(i){e(this,i),this.change=t(this,"change",7),this.mode="gui",this.codeValue="",this.limetype="",this.handleLimetypeChange=e=>{e.stopPropagation(),this.limetype=e.detail,this.filter=void 0,this.internalResponseFormat={object:{_id:null}},this.emitChange()},this.handleFilterChange=e=>{var t;e.stopPropagation(),this.filter=null!==(t=e.detail)&&void 0!==t?t:void 0,this.emitChange()},this.handleResponseFormatChange=e=>{e.stopPropagation(),this.internalResponseFormat=e.detail,this.emitChange()},this.handleLimitChange=e=>{e.stopPropagation();const t=e.detail;this.limit=t?Number.parseInt(t,10):void 0,this.emitChange()},this.switchToGui=()=>{try{const e=JSON.parse(this.codeValue);if(!this.checkGuiSupport().guiSupported)return;this.limetype=e.limetype||"",this.filter=e.filter,this.internalResponseFormat=e.responseFormat,this.limit=e.limit,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=JSON.parse(this.codeValue);this.change.emit(e)}catch(e){}}}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(){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.updateCodeValue(),this.checkGuiSupport().guiSupported||(this.mode="code")}render(){const e=this.checkGuiSupport(),t=!this.guiModeEnabled||"code"===this.mode;return i("div",{key:"0b4d2bb5b4d503a775d8d3215e1e4c74fdb1eceb",class:"lime-query-builder"},this.renderLabel(),this.renderModeControls(e),t?this.renderCodeMode(e):this.renderGuiMode())}emitChange(){if("code"===this.mode)return;if(!this.limetype)return;const e={limetype:this.limetype,responseFormat:this.internalResponseFormat||{object:{_id:null}},filter:this.filter};void 0!==this.limit&&this.limit>0&&(e.limit=this.limit),this.change.emit(e)}updateCodeValue(){if(!this.limetype)return void(this.codeValue=JSON.stringify(this.value||{},null,2));const e={limetype:this.limetype,responseFormat:this.internalResponseFormat||{object:{_id:null}},filter:this.filter};void 0!==this.limit&&this.limit>0&&(e.limit=this.limit),this.codeValue=JSON.stringify(e,null,2)}checkGuiSupport(){if(!this.limetypes)return{valid:!0,guiSupported:!0,validationErrors:[],guiLimitations:[]};let e;if("code"===this.mode&&this.codeValue)try{e=JSON.parse(this.codeValue)}catch(e){return{valid:!1,guiSupported:!1,validationErrors:["Invalid JSON"],guiLimitations:[]}}else{if(!this.limetype)return{valid:!0,guiSupported:!0,validationErrors:[],guiLimitations:[]};e={limetype:this.limetype,responseFormat:this.internalResponseFormat||{object:{_id:null}},filter:this.filter},void 0!==this.limit&&this.limit>0&&(e.limit=this.limit)}return function(e,t,i,r=!0){if(!e)return{valid:!0,guiSupported:!0,validationErrors:[],guiLimitations:[]};const o=[],n=[];if(e.limetype&&!t[e.limetype]&&o.push(`Unknown limetype: ${e.limetype}`),void 0===e.offset||e.orderBy||o.push("offset requires orderBy to be specified"),r&&(e.orderBy&&n.push("orderBy is not yet supported in GUI mode"),void 0!==e.offset&&n.push("offset is not yet supported in GUI mode")),e.filter){const n=function(e,t,i,r){const o=[];try{l(e),m(e,t,i,r)}catch(e){o.push(`Invalid filter: ${e.message}`)}return o}(e.filter,i,t,r);o.push(...n)}if(e.responseFormat){const{errors:i,limitations:s}=function(e,t,i,r){const o=[],n=[];try{const o=function(e,t,i,r=!0){const o=[];if(r&&e.aggregates&&o.push("responseFormat.aggregates is not yet supported in GUI mode"),e.object){const n=h(e.object,t,i,r);o.push(...n)}return o}(e,t,i,r);n.push(...o)}catch(e){o.push(`Invalid responseFormat: ${e.message}`)}return{errors:o,limitations:n}}(e.responseFormat,t,e.limetype,r);o.push(...i),n.push(...s)}return{valid:0===o.length,guiSupported:0===n.length,validationErrors:o,guiLimitations:n}}(e,this.limetypes,this.activeLimetype,this.guiModeEnabled)}renderModeSwitch(e){return i("div",{class:"mode-switch"},i("limel-button",{label:"GUI",primary:"gui"===this.mode,disabled:!e.guiSupported,onClick:this.switchToGui}),i("limel-button",{label:"Code",primary:"code"===this.mode,onClick:this.switchToCode}))}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 Lime Query:"),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))))))}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 e;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===(e=this.limit)||void 0===e?void 0:e.toString())||"",placeholder:"No limit",helperText:"Maximum number of results",onChange:this.handleLimitChange})))}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(e){if(this.guiModeEnabled)return i("div",{class:"mode-controls"},this.renderModeSwitch(e))}renderCodeMode(e){return i("div",{class:"code-mode"},this.renderCodeEditor(e))}};(function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);n>3&&s&&Object.defineProperty(t,i,s)})([r()],f.prototype,"limetypes",void 0),f.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:grid;grid-template-columns:repeat(auto-fit, minmax(200px, 1fr));gap:1rem}@media (max-width: 768px){.lime-query-builder{gap:1.5rem}.query-options-controls{grid-template-columns:1fr}}";export{f as limebb_lime_query_builder}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
-
import { AndOrExpression, Expression, LimeWebComponent, LimeWebComponentContext, LimeWebComponentPlatform } from '@limetech/lime-web-components';
|
|
3
|
-
/**
|
|
4
|
-
* Lime Query Filter AND Component
|
|
5
|
-
*
|
|
6
|
-
* Renders a group of filter expressions where **all conditions must be true**.
|
|
7
|
-
* Users can add multiple child expressions, and a record must match all of them
|
|
8
|
-
* to be included in the result set.
|
|
9
|
-
*
|
|
10
|
-
* This component displays:
|
|
11
|
-
* - A header with "All of these conditions are true" when there are multiple conditions
|
|
12
|
-
* - A list of child expressions (which can be comparisons or nested AND/OR/NOT groups)
|
|
13
|
-
* - An "Add another condition" button to add more expressions
|
|
14
|
-
*
|
|
15
|
-
* Clicking the trash icon on a child expression removes it from the AND group.
|
|
16
|
-
*
|
|
17
|
-
* @private
|
|
18
|
-
*/
|
|
19
|
-
export declare class LimeQueryFilterAndComponent implements LimeWebComponent {
|
|
20
|
-
/**
|
|
21
|
-
* Platform service provider
|
|
22
|
-
*/
|
|
23
|
-
platform: LimeWebComponentPlatform;
|
|
24
|
-
/**
|
|
25
|
-
* Component context
|
|
26
|
-
*/
|
|
27
|
-
context: LimeWebComponentContext;
|
|
28
|
-
/**
|
|
29
|
-
* Optional label for the AND group
|
|
30
|
-
*/
|
|
31
|
-
label: string;
|
|
32
|
-
/**
|
|
33
|
-
* The limetype being queried (e.g., "deal", "company")
|
|
34
|
-
*/
|
|
35
|
-
limetype: string;
|
|
36
|
-
/**
|
|
37
|
-
* The limetype of the active object (for %activeObject% placeholders)
|
|
38
|
-
*/
|
|
39
|
-
activeLimetype?: string;
|
|
40
|
-
/**
|
|
41
|
-
* The AND expression containing child expressions
|
|
42
|
-
*/
|
|
43
|
-
expression: AndOrExpression;
|
|
44
|
-
/**
|
|
45
|
-
* Emitted when the AND expression changes (expressions added/removed/modified)
|
|
46
|
-
* Emits undefined when expression should be removed
|
|
47
|
-
* Can emit any Expression type when unwrapping (single child)
|
|
48
|
-
*/
|
|
49
|
-
expressionChange: EventEmitter<Expression | undefined>;
|
|
50
|
-
render(): any;
|
|
51
|
-
private renderChildExpression;
|
|
52
|
-
private renderAddChildExpression;
|
|
53
|
-
private getAddButtonLabel;
|
|
54
|
-
private handleAddChildExpression;
|
|
55
|
-
private handleExpressionChange;
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=lime-query-filter-and.d.ts.map
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
-
import { AndOrExpression, Expression, LimeWebComponent, LimeWebComponentContext, LimeWebComponentPlatform } from '@limetech/lime-web-components';
|
|
3
|
-
/**
|
|
4
|
-
* Lime Query Filter OR Component
|
|
5
|
-
*
|
|
6
|
-
* Renders a group of filter expressions where **at least one condition must be true**.
|
|
7
|
-
* Users can add multiple alternative expressions, and a record only needs to match
|
|
8
|
-
* one of them to be included in the result set.
|
|
9
|
-
*
|
|
10
|
-
* This component displays:
|
|
11
|
-
* - A header with "Any of these conditions is true" when there are multiple conditions
|
|
12
|
-
* - A list of child expressions (which can be comparisons or nested AND/OR/NOT groups)
|
|
13
|
-
* - An "Add alternative" button to add more options
|
|
14
|
-
*
|
|
15
|
-
* Clicking the trash icon on a child expression removes it from the OR group.
|
|
16
|
-
*
|
|
17
|
-
* @private
|
|
18
|
-
*/
|
|
19
|
-
export declare class LimeQueryFilterOrComponent implements LimeWebComponent {
|
|
20
|
-
/**
|
|
21
|
-
* Platform service provider
|
|
22
|
-
*/
|
|
23
|
-
platform: LimeWebComponentPlatform;
|
|
24
|
-
/**
|
|
25
|
-
* Component context
|
|
26
|
-
*/
|
|
27
|
-
context: LimeWebComponentContext;
|
|
28
|
-
/**
|
|
29
|
-
* Optional label for the OR group
|
|
30
|
-
*/
|
|
31
|
-
label: string;
|
|
32
|
-
/**
|
|
33
|
-
* The limetype being queried (e.g., "deal", "company")
|
|
34
|
-
*/
|
|
35
|
-
limetype: string;
|
|
36
|
-
/**
|
|
37
|
-
* The limetype of the active object (for %activeObject% placeholders)
|
|
38
|
-
*/
|
|
39
|
-
activeLimetype?: string;
|
|
40
|
-
/**
|
|
41
|
-
* The OR expression containing child expressions
|
|
42
|
-
*/
|
|
43
|
-
expression: AndOrExpression;
|
|
44
|
-
/**
|
|
45
|
-
* Emitted when the OR expression changes (expressions added/removed/modified)
|
|
46
|
-
* Emits undefined when expression should be removed
|
|
47
|
-
* Can emit any Expression type when unwrapping (single child)
|
|
48
|
-
*/
|
|
49
|
-
expressionChange: EventEmitter<Expression | undefined>;
|
|
50
|
-
render(): any;
|
|
51
|
-
private renderChildExpression;
|
|
52
|
-
private handleExpressionChange;
|
|
53
|
-
private renderAddChildExpression;
|
|
54
|
-
private handleAddChildExpression;
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=lime-query-filter-or.d.ts.map
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { FilterExpression, FilterGroup, LimeQueryFilterExpression } from './lime-query.types';
|
|
2
|
-
/**
|
|
3
|
-
* Convert UI filter representation to Lime Query filter format
|
|
4
|
-
* @param filter
|
|
5
|
-
*/
|
|
6
|
-
export declare function guiFilterToLimeQuery(filter: LimeQueryFilterExpression): FilterExpression | FilterGroup | undefined;
|
|
7
|
-
/**
|
|
8
|
-
* Convert Lime Query filter to UI filter representation
|
|
9
|
-
* Throws errors for unsupported filter structures
|
|
10
|
-
* @param filter
|
|
11
|
-
*/
|
|
12
|
-
export declare function limeQueryToGuiFilter(filter: FilterExpression | FilterGroup | undefined): LimeQueryFilterExpression;
|
|
13
|
-
/**
|
|
14
|
-
* Normalize filter for GUI mode by ensuring proper AND/OR wrapper structure.
|
|
15
|
-
* GUI mode requires filters to be wrapped in AND([OR(...)]) so users have
|
|
16
|
-
* access to add/remove buttons on the AND and OR components.
|
|
17
|
-
*
|
|
18
|
-
* This function ensures that:
|
|
19
|
-
* - Single comparisons are wrapped in AND([OR([comparison])])
|
|
20
|
-
* - OR groups are wrapped in AND([OR group])
|
|
21
|
-
* - AND groups have their comparison children wrapped in OR
|
|
22
|
-
* - Empty/undefined filters become AND([])
|
|
23
|
-
*
|
|
24
|
-
* When converting back to Lime Query JSON, limeQueryFilterToLimeQuery()
|
|
25
|
-
* automatically unwraps single-item AND/OR groups.
|
|
26
|
-
*
|
|
27
|
-
* @param filter The filter expression from limeQueryToLimeQueryFilter
|
|
28
|
-
* @returns Normalized filter suitable for GUI editing
|
|
29
|
-
*/
|
|
30
|
-
export declare function normalizeLimeQueryFilterForGui(filter: LimeQueryFilterExpression): LimeQueryFilterExpression;
|
|
31
|
-
//# sourceMappingURL=filter-conversion.d.ts.map
|