@limetech/lime-crm-building-blocks 1.97.0 → 1.99.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/{index.esm-a894ac76.js → index.esm-d785eb6e.js} +2 -0
- package/dist/cjs/lime-crm-building-blocks.cjs.js +1 -1
- package/dist/cjs/limebb-browser.cjs.entry.js +1 -1
- package/dist/cjs/limebb-chat-item_2.cjs.entry.js +1 -1
- package/dist/cjs/limebb-chat-list.cjs.entry.js +1 -1
- package/dist/cjs/limebb-component-config.cjs.entry.js +1 -1
- package/dist/cjs/limebb-component-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-currency-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-feed-timeline-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-feed.cjs.entry.js +1 -1
- package/dist/cjs/limebb-info-tile.cjs.entry.js +1 -1
- package/dist/cjs/limebb-kanban-group.cjs.entry.js +1 -1
- package/dist/cjs/limebb-kanban-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +90 -174
- package/dist/cjs/limebb-lime-query-filter-and.cjs.entry.js +80 -0
- package/dist/cjs/limebb-lime-query-filter-comparison_2.cjs.entry.js +147 -0
- package/dist/cjs/limebb-lime-query-filter-group_4.cjs.entry.js +603 -0
- package/dist/cjs/limebb-lime-query-filter-or.cjs.entry.js +68 -0
- package/dist/cjs/limebb-limeobject-file-viewer.cjs.entry.js +1 -1
- package/dist/cjs/limebb-limetype-field_2.cjs.entry.js +37 -6
- package/dist/cjs/limebb-live-docs-info.cjs.entry.js +2 -2
- package/dist/cjs/limebb-loader.cjs.entry.js +1 -1
- package/dist/cjs/limebb-locale-picker.cjs.entry.js +2 -2
- package/dist/cjs/limebb-mention-group-counter.cjs.entry.js +2 -2
- package/dist/cjs/limebb-mention.cjs.entry.js +1 -1
- package/dist/cjs/limebb-navigation-button_2.cjs.entry.js +3 -3
- package/dist/cjs/limebb-notification-item.cjs.entry.js +2 -2
- package/dist/cjs/limebb-notification-list.cjs.entry.js +1 -1
- package/dist/cjs/limebb-percentage-visualizer.cjs.entry.js +2 -2
- package/dist/cjs/limebb-text-editor.cjs.entry.js +3 -3
- package/dist/cjs/limebb-trend-indicator.cjs.entry.js +1 -1
- package/dist/cjs/{limetype-1fe0207f.js → limetype-f2e4376e.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-and.js +41 -49
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-comparison.js +77 -41
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-expression.js +35 -46
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.css +130 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.js +269 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-not.js +19 -25
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-or.js +34 -34
- package/dist/collection/components/lime-query-builder/lime-query-builder.js +60 -24
- package/dist/collection/components/lime-query-builder/limetype-field/limetype-field.js +1 -1
- 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/index.esm.js +2 -1
- package/dist/components/lime-query-filter-comparison.js +32 -45
- package/dist/components/lime-query-filter-expression.js +315 -0
- package/dist/components/limebb-lime-query-builder.js +96 -184
- package/dist/components/limebb-lime-query-filter-and.js +130 -1
- package/dist/components/limebb-lime-query-filter-comparison.js +1 -1
- package/dist/components/limebb-lime-query-filter-expression.js +1 -1
- package/dist/components/limebb-lime-query-filter-group.d.ts +11 -0
- package/dist/components/limebb-lime-query-filter-group.js +6 -0
- package/dist/components/limebb-lime-query-filter-not.js +1 -1
- package/dist/components/limebb-lime-query-filter-or.js +118 -1
- 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 +34 -2
- package/dist/components/live-docs-info.js +2 -2
- package/dist/components/notification-item.js +1 -1
- package/dist/components/summary-popover.js +3 -3
- package/dist/esm/{index.esm-d8fdeb18.js → index.esm-bb569663.js} +2 -1
- package/dist/esm/lime-crm-building-blocks.js +1 -1
- package/dist/esm/limebb-browser.entry.js +1 -1
- package/dist/esm/limebb-chat-item_2.entry.js +1 -1
- package/dist/esm/limebb-chat-list.entry.js +1 -1
- package/dist/esm/limebb-component-config.entry.js +1 -1
- package/dist/esm/limebb-component-picker.entry.js +1 -1
- package/dist/esm/limebb-currency-picker.entry.js +1 -1
- package/dist/esm/limebb-date-picker.entry.js +1 -1
- package/dist/esm/limebb-feed-timeline-item.entry.js +1 -1
- package/dist/esm/limebb-feed.entry.js +1 -1
- package/dist/esm/limebb-info-tile.entry.js +1 -1
- package/dist/esm/limebb-kanban-group.entry.js +1 -1
- package/dist/esm/limebb-kanban-item.entry.js +1 -1
- package/dist/esm/limebb-lime-query-builder.entry.js +89 -173
- package/dist/esm/limebb-lime-query-filter-and.entry.js +76 -0
- package/dist/esm/limebb-lime-query-filter-comparison_2.entry.js +142 -0
- package/dist/esm/limebb-lime-query-filter-group_4.entry.js +596 -0
- package/dist/esm/limebb-lime-query-filter-or.entry.js +64 -0
- package/dist/esm/limebb-limeobject-file-viewer.entry.js +1 -1
- package/dist/esm/limebb-limetype-field_2.entry.js +36 -5
- package/dist/esm/limebb-live-docs-info.entry.js +2 -2
- package/dist/esm/limebb-loader.entry.js +1 -1
- package/dist/esm/limebb-locale-picker.entry.js +2 -2
- package/dist/esm/limebb-mention-group-counter.entry.js +2 -2
- package/dist/esm/limebb-mention.entry.js +1 -1
- package/dist/esm/limebb-navigation-button_2.entry.js +3 -3
- package/dist/esm/limebb-notification-item.entry.js +2 -2
- package/dist/esm/limebb-notification-list.entry.js +1 -1
- package/dist/esm/limebb-percentage-visualizer.entry.js +2 -2
- package/dist/esm/limebb-text-editor.entry.js +3 -3
- package/dist/esm/limebb-trend-indicator.entry.js +1 -1
- package/dist/esm/{limetype-6e7552a7.js → limetype-c0e041f7.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/p-03accd53.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-a1818969.entry.js → p-03af0e66.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-f402184f.entry.js → p-098ee6c1.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-42e52b50.entry.js → p-1be0eec7.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-2aa18c2b.entry.js → p-206575e4.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-20bfca36.js +1 -0
- package/dist/lime-crm-building-blocks/{p-82d33d43.entry.js → p-2faaacbc.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-d4016891.entry.js → p-2fdcb868.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-f52125a0.entry.js → p-3122ea05.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-baf4e428.entry.js → p-3175883d.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-8c8b7115.entry.js → p-32534eb7.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-6c1146ca.entry.js → p-36ea13c0.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-4715210d.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-1fba0ade.js → p-4838284a.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-5e4ba110.entry.js → p-5464f0de.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-e9d23ef7.entry.js → p-569c86b5.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-90e1716a.entry.js → p-5dc574a3.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-5f7644b5.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-00da9b24.entry.js → p-631ca5a5.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-67dbaa4c.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-beb0d164.entry.js → p-7271f47a.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-34357744.entry.js → p-9031f136.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-91732502.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-8c4eb49f.entry.js → p-93cadc1e.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-3932077b.entry.js → p-9cac4de2.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-79d4668a.entry.js → p-a200954f.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-aa646df7.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-d89c44ad.entry.js → p-b9b954d9.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-3a620226.entry.js → p-cfa1a4ad.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-ef8a5266.entry.js → p-e8946134.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-9d9f25da.entry.js → p-eb81bceb.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-50d3d61a.entry.js → p-ee1b00b9.entry.js} +1 -1
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-and.d.ts +5 -4
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-comparison.d.ts +6 -4
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-expression.d.ts +10 -14
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-group.d.ts +60 -0
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-not.d.ts +4 -4
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-or.d.ts +5 -4
- package/dist/types/components/lime-query-builder/lime-query-builder.d.ts +19 -2
- package/dist/types/components/lime-query-builder/lime-query.types.d.ts +2 -1
- package/dist/types/components.d.ts +209 -65
- package/package.json +1 -1
- package/dist/cjs/isEqual-e77cce75.js +0 -37
- package/dist/cjs/lime-query.types-bcb63a22.js +0 -61
- package/dist/cjs/limebb-lime-query-filter-and_5.cjs.entry.js +0 -278
- package/dist/cjs/limebb-lime-query-value-input.cjs.entry.js +0 -239
- package/dist/cjs/limebb-property-selector.cjs.entry.js +0 -234
- package/dist/components/isEqual.js +0 -35
- package/dist/components/lime-query-filter-and.js +0 -408
- package/dist/esm/isEqual-57d0c223.js +0 -35
- package/dist/esm/lime-query.types-f72355e1.js +0 -59
- package/dist/esm/limebb-lime-query-filter-and_5.entry.js +0 -270
- package/dist/esm/limebb-lime-query-value-input.entry.js +0 -235
- package/dist/esm/limebb-property-selector.entry.js +0 -230
- package/dist/lime-crm-building-blocks/p-02c0cc04.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-3b0a15ec.js +0 -1
- package/dist/lime-crm-building-blocks/p-5a6d2e7f.js +0 -1
- package/dist/lime-crm-building-blocks/p-60971d64.js +0 -1
- package/dist/lime-crm-building-blocks/p-70a28b93.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-96beaabc.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-b7c72179.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-f99c611d.entry.js +0 -1
|
@@ -0,0 +1,603 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-ff255a0d.js');
|
|
6
|
+
const index_esm = require('./index.esm-d785eb6e.js');
|
|
7
|
+
const propertyResolution = require('./property-resolution-fb42a46b.js');
|
|
8
|
+
|
|
9
|
+
const limeQueryFilterGroupCss = "@charset \"UTF-8\";.expression{display:flex;flex-direction:column;margin-bottom:1rem;gap:0;background-color:rgb(var(--contrast-100));border:1px solid rgb(var(--contrast-500));border-radius:0.75rem}.expression .clickable-header{cursor:pointer;user-select:none}.expression .clickable-header:hover{background-color:rgb(var(--contrast-200))}.expression>ul{margin-top:0;margin-right:1rem;margin-bottom:1rem;margin-left:1rem;padding-left:1rem;list-style:disc}.expression>ul li{margin-top:1rem}.expression>ul li.add-button{list-style:none;display:flex;gap:0.5rem}";
|
|
10
|
+
const LimebbLimeQueryFilterGroupStyle0 = limeQueryFilterGroupCss;
|
|
11
|
+
|
|
12
|
+
const LimeQueryFilterGroupComponent = class {
|
|
13
|
+
constructor(hostRef) {
|
|
14
|
+
index.registerInstance(this, hostRef);
|
|
15
|
+
this.expressionChange = index.createEvent(this, "expressionChange", 7);
|
|
16
|
+
this.renderChildExpression = (expression, childIndex) => (index.h("li", null, index.h("limebb-lime-query-filter-expression", { platform: this.platform, context: this.context, limetype: this.limetype, activeLimetype: this.activeLimetype, expression: expression, onExpressionChange: this.handleExpressionChange(childIndex) })));
|
|
17
|
+
this.handleToggleOperator = () => {
|
|
18
|
+
const newOperator = this.expression.op === index_esm.Zt.AND ? index_esm.Zt.OR : index_esm.Zt.AND;
|
|
19
|
+
this.expressionChange.emit({
|
|
20
|
+
op: newOperator,
|
|
21
|
+
exp: this.expression.exp,
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
this.handleAddChildExpression = () => {
|
|
25
|
+
// Always add a new comparison directly to the list
|
|
26
|
+
const newChild = {
|
|
27
|
+
key: '',
|
|
28
|
+
op: index_esm.Zt.EQUALS,
|
|
29
|
+
exp: '',
|
|
30
|
+
};
|
|
31
|
+
this.expressionChange.emit({
|
|
32
|
+
op: this.expression.op,
|
|
33
|
+
exp: [...this.expression.exp, newChild],
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
this.handleAddChildGroup = () => {
|
|
37
|
+
// Add a nested group of the opposite type
|
|
38
|
+
const oppositeOp = this.expression.op === index_esm.Zt.AND ? index_esm.Zt.OR : index_esm.Zt.AND;
|
|
39
|
+
const newChild = {
|
|
40
|
+
op: oppositeOp,
|
|
41
|
+
exp: [
|
|
42
|
+
{
|
|
43
|
+
key: '',
|
|
44
|
+
op: index_esm.Zt.EQUALS,
|
|
45
|
+
exp: '',
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
};
|
|
49
|
+
this.expressionChange.emit({
|
|
50
|
+
op: this.expression.op,
|
|
51
|
+
exp: [...this.expression.exp, newChild],
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
this.handleExpressionChange = (updatedChildIndex) => (event) => {
|
|
55
|
+
event.stopPropagation();
|
|
56
|
+
const updatedExpression = event.detail;
|
|
57
|
+
const expressions = [...this.expression.exp];
|
|
58
|
+
if (updatedExpression === undefined) {
|
|
59
|
+
// Deletion - remove the child and potentially unwrap
|
|
60
|
+
expressions.splice(updatedChildIndex, 1);
|
|
61
|
+
if (expressions.length === 0) {
|
|
62
|
+
this.expressionChange.emit(undefined);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (expressions.length === 1) {
|
|
66
|
+
// Unwrap when only one child remains after deletion
|
|
67
|
+
this.expressionChange.emit(expressions[0]);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
// Update - replace the child, don't unwrap
|
|
73
|
+
expressions[updatedChildIndex] = updatedExpression;
|
|
74
|
+
}
|
|
75
|
+
this.expressionChange.emit({
|
|
76
|
+
op: this.expression.op,
|
|
77
|
+
exp: expressions,
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
render() {
|
|
82
|
+
const subheading = this.getSubheading();
|
|
83
|
+
return (index.h("div", { key: '43a1d99fd896e3ad49dd97594e54bccaf74c3aa0', class: "expression" }, subheading && (index.h("limel-header", { key: '534eb0a3db2f0194e8a28e2fb071beb545f38458', subheading: subheading, onClick: this.handleToggleOperator, class: "clickable-header" })), index.h("ul", { key: '9d29d98ab034bf2878e7dc19828bc045dbdd492f' }, this.expression.exp.map(this.renderChildExpression), index.h("li", { key: '44b266c8aeb390b8a68b3e08a51a0760a6421f93', class: "add-button" }, this.renderAddButton(), this.renderAddGroupButton()))));
|
|
84
|
+
}
|
|
85
|
+
getSubheading() {
|
|
86
|
+
if (this.expression.exp.length <= 1) {
|
|
87
|
+
return '';
|
|
88
|
+
}
|
|
89
|
+
return this.expression.op === index_esm.Zt.AND
|
|
90
|
+
? 'All of these conditions are true'
|
|
91
|
+
: 'Any of these conditions are true';
|
|
92
|
+
}
|
|
93
|
+
renderAddButton() {
|
|
94
|
+
const label = this.getAddButtonLabel();
|
|
95
|
+
return (index.h("limel-button", { label: label, icon: "plus_math", onClick: this.handleAddChildExpression }));
|
|
96
|
+
}
|
|
97
|
+
renderAddGroupButton() {
|
|
98
|
+
const label = this.getAddGroupButtonLabel();
|
|
99
|
+
return (index.h("limel-button", { label: label, icon: "tree_structure", onClick: this.handleAddChildGroup }));
|
|
100
|
+
}
|
|
101
|
+
getAddButtonLabel() {
|
|
102
|
+
const isAnd = this.expression.op === index_esm.Zt.AND;
|
|
103
|
+
if (this.expression.exp.length === 0) {
|
|
104
|
+
return 'Add a condition';
|
|
105
|
+
}
|
|
106
|
+
return isAnd ? 'Add another condition' : 'Add alternative';
|
|
107
|
+
}
|
|
108
|
+
getAddGroupButtonLabel() {
|
|
109
|
+
const isAnd = this.expression.op === index_esm.Zt.AND;
|
|
110
|
+
if (this.expression.exp.length === 0) {
|
|
111
|
+
return 'Add a group';
|
|
112
|
+
}
|
|
113
|
+
return isAnd ? 'Add another group' : 'Add alternative group';
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
LimeQueryFilterGroupComponent.style = LimebbLimeQueryFilterGroupStyle0;
|
|
117
|
+
|
|
118
|
+
const limeQueryFilterNotCss = "@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))}";
|
|
119
|
+
const LimebbLimeQueryFilterNotStyle0 = limeQueryFilterNotCss;
|
|
120
|
+
|
|
121
|
+
const LimeQueryFilterNotComponent = class {
|
|
122
|
+
constructor(hostRef) {
|
|
123
|
+
index.registerInstance(this, hostRef);
|
|
124
|
+
this.expressionChange = index.createEvent(this, "expressionChange", 7);
|
|
125
|
+
this.handleExpressionChange = (event) => {
|
|
126
|
+
var _a;
|
|
127
|
+
event.stopPropagation();
|
|
128
|
+
const updatedExpression = (_a = event.detail) !== null && _a !== void 0 ? _a : undefined;
|
|
129
|
+
if (updatedExpression === undefined) {
|
|
130
|
+
this.expressionChange.emit(undefined);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
this.expressionChange.emit({
|
|
134
|
+
op: index_esm.Zt.NOT,
|
|
135
|
+
exp: updatedExpression,
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
render() {
|
|
140
|
+
return (index.h("div", { key: 'f1dfd7fd4ec7dc1873841d1c8b3d2bb6677634fd', class: "expression" }, this.label && index.h("limel-header", { key: '91e1b754f6e45c70f49bf2a770898a590defaf22', heading: this.label }), index.h("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 })));
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
LimeQueryFilterNotComponent.style = LimebbLimeQueryFilterNotStyle0;
|
|
144
|
+
|
|
145
|
+
const limeQueryValueInputCss = ":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}";
|
|
146
|
+
const LimebbLimeQueryValueInputStyle0 = limeQueryValueInputCss;
|
|
147
|
+
|
|
148
|
+
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
149
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
150
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
151
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
152
|
+
else
|
|
153
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
154
|
+
if (d = decorators[i])
|
|
155
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
156
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
157
|
+
};
|
|
158
|
+
const LimeQueryValueInput = class {
|
|
159
|
+
constructor(hostRef) {
|
|
160
|
+
index.registerInstance(this, hostRef);
|
|
161
|
+
this.change = index.createEvent(this, "change", 7);
|
|
162
|
+
/**
|
|
163
|
+
* Optional label for the input
|
|
164
|
+
*/
|
|
165
|
+
this.label = 'Value';
|
|
166
|
+
this.inputMode = 'value';
|
|
167
|
+
this.handleTextChange = (event) => {
|
|
168
|
+
event.stopPropagation();
|
|
169
|
+
// Try to parse as number for number inputs
|
|
170
|
+
const value = event.detail;
|
|
171
|
+
const numValue = Number(value);
|
|
172
|
+
if (!Number.isNaN(numValue) && value !== '') {
|
|
173
|
+
this.change.emit(numValue);
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
this.change.emit(value);
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
this.handleSelectChange = (event) => {
|
|
180
|
+
event.stopPropagation();
|
|
181
|
+
const detail = event.detail;
|
|
182
|
+
if (Array.isArray(detail)) {
|
|
183
|
+
this.change.emit(detail.map((o) => o.value));
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
this.change.emit(detail === null || detail === void 0 ? void 0 : detail.value);
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
this.handleBooleanChange = (event) => {
|
|
190
|
+
event.stopPropagation();
|
|
191
|
+
const detail = event.detail;
|
|
192
|
+
if (!Array.isArray(detail)) {
|
|
193
|
+
// Convert string back to boolean
|
|
194
|
+
this.change.emit((detail === null || detail === void 0 ? void 0 : detail.value) === 'true');
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
this.handleDateChange = (event) => {
|
|
198
|
+
event.stopPropagation();
|
|
199
|
+
// Convert Date to ISO string for storage
|
|
200
|
+
const date = event.detail;
|
|
201
|
+
this.change.emit(date ? date.toISOString() : null);
|
|
202
|
+
};
|
|
203
|
+
this.handleMultiValueChange = (event) => {
|
|
204
|
+
event.stopPropagation();
|
|
205
|
+
// Split by comma and trim whitespace
|
|
206
|
+
const values = event.detail
|
|
207
|
+
.split(',')
|
|
208
|
+
.map((v) => v.trim())
|
|
209
|
+
.filter((v) => v.length > 0);
|
|
210
|
+
this.change.emit(values);
|
|
211
|
+
};
|
|
212
|
+
this.handleModeToggle = () => {
|
|
213
|
+
if (this.inputMode === 'value') {
|
|
214
|
+
// Switching to placeholder mode
|
|
215
|
+
this.inputMode = 'placeholder';
|
|
216
|
+
// Emit placeholder value (empty initially)
|
|
217
|
+
this.change.emit('%activeObject%');
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
// Switching to value mode
|
|
221
|
+
this.inputMode = 'value';
|
|
222
|
+
// Emit empty value
|
|
223
|
+
this.change.emit('');
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
this.handlePlaceholderPropertyChange = (event) => {
|
|
227
|
+
event.stopPropagation();
|
|
228
|
+
const propertyPath = event.detail;
|
|
229
|
+
const placeholderValue = this.buildPlaceholderValue(propertyPath);
|
|
230
|
+
this.change.emit(placeholderValue);
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
componentWillLoad() {
|
|
234
|
+
// Detect if the current value is a placeholder
|
|
235
|
+
if (this.isPlaceholder(this.value)) {
|
|
236
|
+
this.inputMode = 'placeholder';
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
componentWillUpdate() {
|
|
240
|
+
// Update mode if value changes externally
|
|
241
|
+
if (this.isPlaceholder(this.value) &&
|
|
242
|
+
this.inputMode !== 'placeholder') {
|
|
243
|
+
this.inputMode = 'placeholder';
|
|
244
|
+
}
|
|
245
|
+
else if (!this.isPlaceholder(this.value) &&
|
|
246
|
+
this.inputMode === 'placeholder') {
|
|
247
|
+
this.inputMode = 'value';
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
isPlaceholder(value) {
|
|
251
|
+
return typeof value === 'string' && value.startsWith('%activeObject%');
|
|
252
|
+
}
|
|
253
|
+
parsePlaceholderPath(value) {
|
|
254
|
+
if (!this.isPlaceholder(value)) {
|
|
255
|
+
return '';
|
|
256
|
+
}
|
|
257
|
+
// Extract path after %activeObject%. (e.g., "%activeObject%.company.name" → "company.name")
|
|
258
|
+
return value.replace(/^%activeObject%\.?/, '');
|
|
259
|
+
}
|
|
260
|
+
buildPlaceholderValue(propertyPath) {
|
|
261
|
+
if (!propertyPath) {
|
|
262
|
+
return '%activeObject%';
|
|
263
|
+
}
|
|
264
|
+
return `%activeObject%.${propertyPath}`;
|
|
265
|
+
}
|
|
266
|
+
render() {
|
|
267
|
+
if (!this.operator) {
|
|
268
|
+
return null;
|
|
269
|
+
}
|
|
270
|
+
return (index.h("div", { class: "value-input-container" }, this.renderModeToggle(), this.inputMode === 'placeholder'
|
|
271
|
+
? this.renderPlaceholderInput()
|
|
272
|
+
: this.renderValueInputByType()));
|
|
273
|
+
}
|
|
274
|
+
renderModeToggle() {
|
|
275
|
+
// Only show toggle if activeLimetype is set
|
|
276
|
+
if (!this.activeLimetype) {
|
|
277
|
+
return null;
|
|
278
|
+
}
|
|
279
|
+
const isPlaceholderMode = this.inputMode === 'placeholder';
|
|
280
|
+
const buttonLabel = isPlaceholderMode ? 'Use Value' : 'Use Placeholder';
|
|
281
|
+
const buttonIcon = isPlaceholderMode ? 'text' : 'link';
|
|
282
|
+
return (index.h("limel-icon-button", { class: "mode-toggle", icon: buttonIcon, label: buttonLabel, onClick: this.handleModeToggle }));
|
|
283
|
+
}
|
|
284
|
+
renderPlaceholderInput() {
|
|
285
|
+
const propertyPath = this.parsePlaceholderPath(this.value);
|
|
286
|
+
return (index.h("div", { class: "placeholder-input" }, index.h("limebb-property-selector", { platform: this.platform, context: this.context, limetype: this.activeLimetype, label: "Active Object Property", value: propertyPath, required: false, helperText: "Select property from the active object", onChange: this.handlePlaceholderPropertyChange }), this.isPlaceholder(this.value) && (index.h("div", { class: "placeholder-preview" }, index.h("limel-icon", { name: "info", size: "small" }), index.h("span", null, "Placeholder: ", this.value)))));
|
|
287
|
+
}
|
|
288
|
+
renderValueInputByType() {
|
|
289
|
+
// Special handling for IN operator - always use chip set for arrays
|
|
290
|
+
if (this.operator === 'IN') {
|
|
291
|
+
return this.renderMultiValueInput();
|
|
292
|
+
}
|
|
293
|
+
const property = this.getProperty();
|
|
294
|
+
if (!property) {
|
|
295
|
+
return this.renderTextInput();
|
|
296
|
+
}
|
|
297
|
+
switch (property.type) {
|
|
298
|
+
case 'integer':
|
|
299
|
+
case 'decimal': {
|
|
300
|
+
return this.renderNumberInput(property.type);
|
|
301
|
+
}
|
|
302
|
+
case 'yesno': {
|
|
303
|
+
return this.renderBooleanInput();
|
|
304
|
+
}
|
|
305
|
+
case 'option': {
|
|
306
|
+
return this.renderOptionInput(property);
|
|
307
|
+
}
|
|
308
|
+
case 'date': {
|
|
309
|
+
return this.renderDateInput();
|
|
310
|
+
}
|
|
311
|
+
case 'time': {
|
|
312
|
+
return this.renderTimeInput();
|
|
313
|
+
}
|
|
314
|
+
default: {
|
|
315
|
+
return this.renderTextInput();
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
renderTextInput() {
|
|
320
|
+
var _a;
|
|
321
|
+
return (index.h("limel-input-field", { label: this.label, value: ((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString()) || '', placeholder: "Enter value", onChange: this.handleTextChange }));
|
|
322
|
+
}
|
|
323
|
+
renderNumberInput(type) {
|
|
324
|
+
var _a;
|
|
325
|
+
const step = type === 'integer' ? 1 : 0.01;
|
|
326
|
+
return (index.h("limel-input-field", { label: this.label, type: "number", value: ((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString()) || '', step: step, onChange: this.handleTextChange }));
|
|
327
|
+
}
|
|
328
|
+
renderBooleanInput() {
|
|
329
|
+
const options = [
|
|
330
|
+
{ text: 'True', value: 'true' },
|
|
331
|
+
{ text: 'False', value: 'false' },
|
|
332
|
+
];
|
|
333
|
+
const valueAsString = this.value === true || this.value === 'true' ? 'true' : 'false';
|
|
334
|
+
const selectedOption = options.find((o) => o.value === valueAsString);
|
|
335
|
+
return (index.h("limel-select", { label: this.label, options: options, value: selectedOption, onChange: this.handleBooleanChange }));
|
|
336
|
+
}
|
|
337
|
+
renderOptionInput(property) {
|
|
338
|
+
if (!property.options || property.options.length === 0) {
|
|
339
|
+
return this.renderTextInput();
|
|
340
|
+
}
|
|
341
|
+
const options = property.options.map((opt) => ({
|
|
342
|
+
text: opt.text || opt.key,
|
|
343
|
+
value: opt.key,
|
|
344
|
+
}));
|
|
345
|
+
const selectedOption = options.find((o) => o.value === this.value);
|
|
346
|
+
return (index.h("limel-select", { label: this.label, options: options, value: selectedOption, onChange: this.handleSelectChange }));
|
|
347
|
+
}
|
|
348
|
+
renderDateInput() {
|
|
349
|
+
// Convert string to Date if needed
|
|
350
|
+
const dateValue = typeof this.value === 'string' ? new Date(this.value) : this.value;
|
|
351
|
+
return (index.h("limel-date-picker", { label: this.label, value: dateValue, onChange: this.handleDateChange }));
|
|
352
|
+
}
|
|
353
|
+
renderTimeInput() {
|
|
354
|
+
return (index.h("limel-input-field", { label: this.label, type: "time", value: this.value || '', onChange: this.handleTextChange }));
|
|
355
|
+
}
|
|
356
|
+
renderMultiValueInput() {
|
|
357
|
+
// For IN operator, allow comma-separated values
|
|
358
|
+
const displayValue = Array.isArray(this.value)
|
|
359
|
+
? this.value.join(', ')
|
|
360
|
+
: this.value || '';
|
|
361
|
+
return (index.h("limel-input-field", { label: this.label + ' (comma-separated)', value: displayValue, placeholder: "e.g., won, lost, tender", onChange: this.handleMultiValueChange }));
|
|
362
|
+
}
|
|
363
|
+
getProperty() {
|
|
364
|
+
if (!this.limetypes || !this.limetype || !this.propertyPath) {
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
return propertyResolution.getPropertyFromPath(this.limetypes, this.limetype, this.propertyPath);
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
__decorate$1([
|
|
371
|
+
index_esm.Te()
|
|
372
|
+
], LimeQueryValueInput.prototype, "limetypes", void 0);
|
|
373
|
+
LimeQueryValueInput.style = LimebbLimeQueryValueInputStyle0;
|
|
374
|
+
|
|
375
|
+
const propertySelectorCss = ":host(limebb-property-selector){display:block}limel-menu{display:block;width:100%}";
|
|
376
|
+
const LimebbPropertySelectorStyle0 = propertySelectorCss;
|
|
377
|
+
|
|
378
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
379
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
380
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
381
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
382
|
+
else
|
|
383
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
384
|
+
if (d = decorators[i])
|
|
385
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
386
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
387
|
+
};
|
|
388
|
+
const PropertySelector = class {
|
|
389
|
+
constructor(hostRef) {
|
|
390
|
+
index.registerInstance(this, hostRef);
|
|
391
|
+
this.change = index.createEvent(this, "change", 7);
|
|
392
|
+
/**
|
|
393
|
+
* Label for the input
|
|
394
|
+
*/
|
|
395
|
+
this.label = 'Property';
|
|
396
|
+
/**
|
|
397
|
+
* Whether the field is required
|
|
398
|
+
*/
|
|
399
|
+
this.required = false;
|
|
400
|
+
this.isOpen = false;
|
|
401
|
+
this.navigationPath = '';
|
|
402
|
+
this.menuItems = [];
|
|
403
|
+
this.handleChipSetWrapperClick = (event) => {
|
|
404
|
+
// Stop all clicks on the chip-set from bubbling
|
|
405
|
+
// This prevents the menu from opening when clicking chip remove buttons
|
|
406
|
+
event.stopPropagation();
|
|
407
|
+
};
|
|
408
|
+
this.handleChipSetFocus = () => {
|
|
409
|
+
// Open menu when the chip-set input receives focus
|
|
410
|
+
// This happens when user clicks to type/edit
|
|
411
|
+
if (!this.isOpen) {
|
|
412
|
+
this.navigationPath = this.value || '';
|
|
413
|
+
this.loadMenuItems();
|
|
414
|
+
this.isOpen = true;
|
|
415
|
+
}
|
|
416
|
+
};
|
|
417
|
+
this.handleSelect = (event) => {
|
|
418
|
+
event.stopPropagation();
|
|
419
|
+
const selectedPath = event.detail.value;
|
|
420
|
+
if (!selectedPath) {
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
// Check if this is a complete path (leaf property, not a relation)
|
|
424
|
+
const property = propertyResolution.getPropertyFromPath(this.limetypes, this.limetype, selectedPath);
|
|
425
|
+
if (property === null || property === void 0 ? void 0 : property.relation) {
|
|
426
|
+
// This is a relation - update navigation but don't emit
|
|
427
|
+
this.navigationPath = selectedPath;
|
|
428
|
+
}
|
|
429
|
+
else {
|
|
430
|
+
// This is a leaf property - emit and close
|
|
431
|
+
this.change.emit(selectedPath);
|
|
432
|
+
this.isOpen = false;
|
|
433
|
+
this.navigationPath = '';
|
|
434
|
+
}
|
|
435
|
+
};
|
|
436
|
+
this.handleNavigateMenu = (event) => {
|
|
437
|
+
var _a;
|
|
438
|
+
event.stopPropagation();
|
|
439
|
+
if ((_a = event.detail) === null || _a === void 0 ? void 0 : _a.value) {
|
|
440
|
+
// Update navigation path when drilling down
|
|
441
|
+
this.navigationPath = event.detail.value;
|
|
442
|
+
}
|
|
443
|
+
};
|
|
444
|
+
this.handleCancel = () => {
|
|
445
|
+
this.isOpen = false;
|
|
446
|
+
this.navigationPath = '';
|
|
447
|
+
};
|
|
448
|
+
this.handleChipSetChange = (event) => {
|
|
449
|
+
event.stopPropagation();
|
|
450
|
+
const detail = event.detail;
|
|
451
|
+
// Handle both single chip and array of chips
|
|
452
|
+
if (!detail) {
|
|
453
|
+
// Clear all was clicked
|
|
454
|
+
this.change.emit('');
|
|
455
|
+
this.navigationPath = '';
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
// Convert to array if it's a single chip
|
|
459
|
+
const chips = Array.isArray(detail) ? detail : [detail];
|
|
460
|
+
if (chips.length === 0) {
|
|
461
|
+
// All chips removed
|
|
462
|
+
this.change.emit('');
|
|
463
|
+
this.navigationPath = '';
|
|
464
|
+
}
|
|
465
|
+
else {
|
|
466
|
+
// A chip was removed - emit the last remaining chip's value
|
|
467
|
+
const lastChip = chips.at(-1);
|
|
468
|
+
if (lastChip) {
|
|
469
|
+
this.change.emit(lastChip.value);
|
|
470
|
+
}
|
|
471
|
+
this.navigationPath = '';
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
render() {
|
|
476
|
+
if (!this.limetype || !this.limetypes) {
|
|
477
|
+
return null;
|
|
478
|
+
}
|
|
479
|
+
const chips = this.getChipsForPath(this.navigationPath || this.value || '');
|
|
480
|
+
return (index.h("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 }, index.h("div", { slot: "trigger" }, index.h("div", { onClick: this.handleChipSetWrapperClick }, index.h("limel-chip-set", { type: "input", label: this.label, value: chips, required: this.required, helperText: this.helperText, delimiter: "\u203A", maxItems: 1, onChange: this.handleChipSetChange, onFocus: this.handleChipSetFocus })))));
|
|
481
|
+
}
|
|
482
|
+
loadMenuItems() {
|
|
483
|
+
// Get the limetype we're currently navigating in
|
|
484
|
+
const currentLimetype = this.getCurrentLimetype();
|
|
485
|
+
if (!currentLimetype) {
|
|
486
|
+
this.menuItems = [];
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
this.menuItems = this.createMenuItems(currentLimetype, '');
|
|
490
|
+
}
|
|
491
|
+
getCurrentLimetype() {
|
|
492
|
+
if (!this.navigationPath) {
|
|
493
|
+
return this.limetypes[this.limetype];
|
|
494
|
+
}
|
|
495
|
+
// Get the limetype at the current navigation path
|
|
496
|
+
const property = propertyResolution.getPropertyFromPath(this.limetypes, this.limetype, this.navigationPath);
|
|
497
|
+
if (property === null || property === void 0 ? void 0 : property.relation) {
|
|
498
|
+
return property.relation.getLimetype();
|
|
499
|
+
}
|
|
500
|
+
return this.limetypes[this.limetype];
|
|
501
|
+
}
|
|
502
|
+
createMenuItems(limetype, pathPrefix) {
|
|
503
|
+
const results = [];
|
|
504
|
+
if (!limetype) {
|
|
505
|
+
return results;
|
|
506
|
+
}
|
|
507
|
+
const normalizedProperties = propertyResolution.getNormalizedProperties(limetype);
|
|
508
|
+
for (const [propName, property] of Object.entries(normalizedProperties)) {
|
|
509
|
+
// Skip hasMany and hasAndBelongsToMany relations
|
|
510
|
+
if (property.type === 'hasmany' ||
|
|
511
|
+
property.type === 'hasandbelongstomany') {
|
|
512
|
+
continue;
|
|
513
|
+
}
|
|
514
|
+
const fullPath = pathPrefix
|
|
515
|
+
? `${pathPrefix}.${propName}`
|
|
516
|
+
: propName;
|
|
517
|
+
const isRelation = !!property.relation;
|
|
518
|
+
let items;
|
|
519
|
+
if (isRelation && property.relation) {
|
|
520
|
+
// Create submenu for relation (only belongsto at this point)
|
|
521
|
+
const relatedLimetype = property.relation.getLimetype();
|
|
522
|
+
if (relatedLimetype) {
|
|
523
|
+
items = async () => this.createMenuItems(relatedLimetype, fullPath);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
results.push({
|
|
527
|
+
text: property.localname || propName,
|
|
528
|
+
secondaryText: this.getSecondaryText(property),
|
|
529
|
+
icon: this.getIconForProperty(property),
|
|
530
|
+
value: fullPath,
|
|
531
|
+
items: items,
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
if (results.length === 0) {
|
|
535
|
+
return [
|
|
536
|
+
{
|
|
537
|
+
text: 'No available properties',
|
|
538
|
+
value: '',
|
|
539
|
+
disabled: true,
|
|
540
|
+
},
|
|
541
|
+
];
|
|
542
|
+
}
|
|
543
|
+
return results;
|
|
544
|
+
}
|
|
545
|
+
getSecondaryText(property) {
|
|
546
|
+
var _a;
|
|
547
|
+
if (property.relation) {
|
|
548
|
+
const relatedLimetype = property.relation.getLimetype();
|
|
549
|
+
return ((_a = relatedLimetype === null || relatedLimetype === void 0 ? void 0 : relatedLimetype.localname) === null || _a === void 0 ? void 0 : _a.singular) || 'Object';
|
|
550
|
+
}
|
|
551
|
+
// Return the property type as the secondary text
|
|
552
|
+
return property.type.charAt(0).toUpperCase() + property.type.slice(1);
|
|
553
|
+
}
|
|
554
|
+
getIconForProperty(property) {
|
|
555
|
+
if (property.relation) {
|
|
556
|
+
return {
|
|
557
|
+
name: 'link',
|
|
558
|
+
color: 'rgb(var(--color-sky-default))',
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
// Use generic property icon
|
|
562
|
+
return {
|
|
563
|
+
name: 'decision',
|
|
564
|
+
color: 'rgb(var(--color-gray-default))',
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
getChipsForPath(path) {
|
|
568
|
+
if (!path) {
|
|
569
|
+
return [];
|
|
570
|
+
}
|
|
571
|
+
const parts = path.split('.');
|
|
572
|
+
const chips = [];
|
|
573
|
+
let currentLimetype = this.limetypes[this.limetype];
|
|
574
|
+
let currentPath = '';
|
|
575
|
+
for (const part of parts) {
|
|
576
|
+
currentPath = currentPath ? `${currentPath}.${part}` : part;
|
|
577
|
+
// Use getNormalizedProperties to include _id and _timestamp
|
|
578
|
+
const normalizedProperties = propertyResolution.getNormalizedProperties(currentLimetype);
|
|
579
|
+
const property = normalizedProperties[part];
|
|
580
|
+
if (property) {
|
|
581
|
+
chips.push({
|
|
582
|
+
id: currentPath,
|
|
583
|
+
text: property.localname || part,
|
|
584
|
+
icon: this.getIconForProperty(property),
|
|
585
|
+
value: currentPath,
|
|
586
|
+
});
|
|
587
|
+
if (property.relation) {
|
|
588
|
+
currentLimetype = property.relation.getLimetype();
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
return chips;
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
__decorate([
|
|
596
|
+
index_esm.Te()
|
|
597
|
+
], PropertySelector.prototype, "limetypes", void 0);
|
|
598
|
+
PropertySelector.style = LimebbPropertySelectorStyle0;
|
|
599
|
+
|
|
600
|
+
exports.limebb_lime_query_filter_group = LimeQueryFilterGroupComponent;
|
|
601
|
+
exports.limebb_lime_query_filter_not = LimeQueryFilterNotComponent;
|
|
602
|
+
exports.limebb_lime_query_value_input = LimeQueryValueInput;
|
|
603
|
+
exports.limebb_property_selector = PropertySelector;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-ff255a0d.js');
|
|
6
|
+
const index_esm = require('./index.esm-d785eb6e.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 = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
this.expressionChange = index.createEvent(this, "expressionChange", 7);
|
|
15
|
+
this.renderChildExpression = (expression, childIndex) => {
|
|
16
|
+
const label = this.expression.exp.length === 1 ? this.label : undefined;
|
|
17
|
+
return (index.h("li", null, index.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) })));
|
|
18
|
+
};
|
|
19
|
+
this.handleExpressionChange = (updatedChildIndex) => (event) => {
|
|
20
|
+
var _a;
|
|
21
|
+
event.stopPropagation();
|
|
22
|
+
const updatedExpression = (_a = event.detail) !== null && _a !== void 0 ? _a : undefined;
|
|
23
|
+
const expressions = [...this.expression.exp];
|
|
24
|
+
if (updatedExpression === undefined) {
|
|
25
|
+
expressions.splice(updatedChildIndex, 1);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
expressions[updatedChildIndex] = updatedExpression;
|
|
29
|
+
}
|
|
30
|
+
if (expressions.length === 0) {
|
|
31
|
+
this.expressionChange.emit(undefined);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (expressions.length === 1) {
|
|
35
|
+
this.expressionChange.emit(expressions[0]);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
this.expressionChange.emit({
|
|
39
|
+
op: index_esm.Zt.OR,
|
|
40
|
+
exp: expressions,
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
this.handleAddChildExpression = () => {
|
|
44
|
+
const newComparison = {
|
|
45
|
+
key: '',
|
|
46
|
+
op: index_esm.Zt.EQUALS,
|
|
47
|
+
exp: '',
|
|
48
|
+
};
|
|
49
|
+
const updatedExpressionsList = [
|
|
50
|
+
...this.expression.exp,
|
|
51
|
+
newComparison,
|
|
52
|
+
];
|
|
53
|
+
this.expressionChange.emit({
|
|
54
|
+
op: index_esm.Zt.OR,
|
|
55
|
+
exp: updatedExpressionsList,
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
render() {
|
|
60
|
+
return (index.h("div", { key: '8efd3bba832388365d89313ebc007514fd3478e0', class: "expression" }, this.expression.exp.length > 1 && (index.h("limel-header", { key: 'eb65924d2e9b7e0e4e47f769b3af76773ae98266', heading: this.label, subheading: "Any of these conditions is true" })), index.h("ul", { key: 'cc6a4c9d7532096f054e9e20d54e67d14d45a038' }, this.expression.exp.map(this.renderChildExpression), index.h("li", { key: 'ad876db1e6435657d2263351b75ae4acb3a6a234', class: "add-button" }, this.renderAddChildExpression()))));
|
|
61
|
+
}
|
|
62
|
+
renderAddChildExpression() {
|
|
63
|
+
return (index.h("limel-icon-button", { label: "Add alternative", icon: "plus_math", onClick: this.handleAddChildExpression }));
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
LimeQueryFilterOrComponent.style = LimebbLimeQueryFilterOrStyle0;
|
|
67
|
+
|
|
68
|
+
exports.limebb_lime_query_filter_or = LimeQueryFilterOrComponent;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-ff255a0d.js');
|
|
6
|
-
const index_esm = require('./index.esm-
|
|
6
|
+
const index_esm = require('./index.esm-d785eb6e.js');
|
|
7
7
|
const negate = require('./negate-e0a2bf77.js');
|
|
8
8
|
|
|
9
9
|
const LIVE_DOCS_TYPES = ['pdf', 'edit', 'view'];
|