@limetech/lime-crm-building-blocks 1.98.0 → 1.100.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.
Files changed (176) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/{index.esm-a894ac76.js → index.esm-d785eb6e.js} +2 -0
  3. package/dist/cjs/lime-crm-building-blocks.cjs.js +1 -1
  4. package/dist/cjs/limebb-browser.cjs.entry.js +1 -1
  5. package/dist/cjs/limebb-chat-item_2.cjs.entry.js +1 -1
  6. package/dist/cjs/limebb-chat-list.cjs.entry.js +1 -1
  7. package/dist/cjs/limebb-component-config.cjs.entry.js +1 -1
  8. package/dist/cjs/limebb-component-picker.cjs.entry.js +1 -1
  9. package/dist/cjs/limebb-currency-picker.cjs.entry.js +1 -1
  10. package/dist/cjs/limebb-date-picker.cjs.entry.js +1 -1
  11. package/dist/cjs/limebb-feed-timeline-item.cjs.entry.js +1 -1
  12. package/dist/cjs/limebb-feed.cjs.entry.js +1 -1
  13. package/dist/cjs/limebb-info-tile.cjs.entry.js +1 -1
  14. package/dist/cjs/limebb-kanban-group.cjs.entry.js +1 -1
  15. package/dist/cjs/limebb-kanban-item.cjs.entry.js +1 -1
  16. package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +68 -179
  17. package/dist/cjs/limebb-lime-query-filter-and.cjs.entry.js +80 -0
  18. package/dist/cjs/{limebb-limetype-field_2.cjs.entry.js → limebb-lime-query-filter-builder_3.cjs.entry.js} +108 -6
  19. package/dist/cjs/limebb-lime-query-filter-comparison_5.cjs.entry.js +705 -0
  20. package/dist/cjs/limebb-lime-query-filter-expression.cjs.entry.js +45 -0
  21. package/dist/cjs/limebb-lime-query-filter-or.cjs.entry.js +68 -0
  22. package/dist/cjs/limebb-limeobject-file-viewer.cjs.entry.js +1 -1
  23. package/dist/cjs/limebb-live-docs-info.cjs.entry.js +2 -2
  24. package/dist/cjs/limebb-loader.cjs.entry.js +1 -1
  25. package/dist/cjs/limebb-locale-picker.cjs.entry.js +2 -2
  26. package/dist/cjs/limebb-mention-group-counter.cjs.entry.js +2 -2
  27. package/dist/cjs/limebb-mention.cjs.entry.js +1 -1
  28. package/dist/cjs/limebb-navigation-button_2.cjs.entry.js +3 -3
  29. package/dist/cjs/limebb-notification-item.cjs.entry.js +2 -2
  30. package/dist/cjs/limebb-notification-list.cjs.entry.js +1 -1
  31. package/dist/cjs/limebb-percentage-visualizer.cjs.entry.js +2 -2
  32. package/dist/cjs/limebb-text-editor.cjs.entry.js +3 -3
  33. package/dist/cjs/limebb-trend-indicator.cjs.entry.js +1 -1
  34. package/dist/cjs/{limetype-1fe0207f.js → limetype-f2e4376e.js} +1 -1
  35. package/dist/cjs/loader.cjs.js +1 -1
  36. package/dist/collection/collection-manifest.json +2 -0
  37. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-and.js +41 -49
  38. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-builder.css +5 -0
  39. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-builder.js +225 -0
  40. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-comparison.js +77 -41
  41. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-expression.js +35 -46
  42. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.css +130 -0
  43. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.js +269 -0
  44. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-not.js +19 -25
  45. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-or.js +34 -34
  46. package/dist/collection/components/lime-query-builder/lime-query-builder.js +11 -26
  47. package/dist/collection/components/lime-query-builder/limetype-field/limetype-field.js +1 -1
  48. package/dist/collection/components/limeobject/file-viewer/live-docs-info.js +2 -2
  49. package/dist/collection/components/locale-picker/locale-picker.js +1 -1
  50. package/dist/collection/components/notification-list/notification-item/notification-item.js +1 -1
  51. package/dist/collection/components/percentage-visualizer/percentage-visualizer.js +2 -2
  52. package/dist/collection/components/summary-popover/summary-popover.js +3 -3
  53. package/dist/collection/components/text-editor/mention-group-counter.js +2 -2
  54. package/dist/collection/components/text-editor/text-editor.js +1 -1
  55. package/dist/collection/components/trend-indicator/trend-indicator.js +1 -1
  56. package/dist/components/index.esm.js +2 -1
  57. package/dist/components/lime-query-filter-builder.js +129 -0
  58. package/dist/components/lime-query-filter-comparison.js +32 -45
  59. package/dist/components/lime-query-filter-expression.js +315 -0
  60. package/dist/components/limebb-lime-query-builder.js +73 -182
  61. package/dist/components/limebb-lime-query-filter-and.js +130 -1
  62. package/dist/components/limebb-lime-query-filter-builder.d.ts +11 -0
  63. package/dist/components/limebb-lime-query-filter-builder.js +6 -0
  64. package/dist/components/limebb-lime-query-filter-comparison.js +1 -1
  65. package/dist/components/limebb-lime-query-filter-expression.js +1 -1
  66. package/dist/components/limebb-lime-query-filter-group.d.ts +11 -0
  67. package/dist/components/limebb-lime-query-filter-group.js +6 -0
  68. package/dist/components/limebb-lime-query-filter-not.js +1 -1
  69. package/dist/components/limebb-lime-query-filter-or.js +118 -1
  70. package/dist/components/limebb-locale-picker.js +1 -1
  71. package/dist/components/limebb-mention-group-counter.js +2 -2
  72. package/dist/components/limebb-percentage-visualizer.js +2 -2
  73. package/dist/components/limebb-text-editor.js +1 -1
  74. package/dist/components/limebb-trend-indicator.js +1 -1
  75. package/dist/components/limetype-field.js +34 -2
  76. package/dist/components/live-docs-info.js +2 -2
  77. package/dist/components/notification-item.js +1 -1
  78. package/dist/components/summary-popover.js +3 -3
  79. package/dist/esm/{index.esm-d8fdeb18.js → index.esm-bb569663.js} +2 -1
  80. package/dist/esm/lime-crm-building-blocks.js +1 -1
  81. package/dist/esm/limebb-browser.entry.js +1 -1
  82. package/dist/esm/limebb-chat-item_2.entry.js +1 -1
  83. package/dist/esm/limebb-chat-list.entry.js +1 -1
  84. package/dist/esm/limebb-component-config.entry.js +1 -1
  85. package/dist/esm/limebb-component-picker.entry.js +1 -1
  86. package/dist/esm/limebb-currency-picker.entry.js +1 -1
  87. package/dist/esm/limebb-date-picker.entry.js +1 -1
  88. package/dist/esm/limebb-feed-timeline-item.entry.js +1 -1
  89. package/dist/esm/limebb-feed.entry.js +1 -1
  90. package/dist/esm/limebb-info-tile.entry.js +1 -1
  91. package/dist/esm/limebb-kanban-group.entry.js +1 -1
  92. package/dist/esm/limebb-kanban-item.entry.js +1 -1
  93. package/dist/esm/limebb-lime-query-builder.entry.js +67 -178
  94. package/dist/esm/limebb-lime-query-filter-and.entry.js +76 -0
  95. package/dist/esm/{limebb-limetype-field_2.entry.js → limebb-lime-query-filter-builder_3.entry.js} +107 -6
  96. package/dist/esm/limebb-lime-query-filter-comparison_5.entry.js +697 -0
  97. package/dist/esm/limebb-lime-query-filter-expression.entry.js +41 -0
  98. package/dist/esm/limebb-lime-query-filter-or.entry.js +64 -0
  99. package/dist/esm/limebb-limeobject-file-viewer.entry.js +1 -1
  100. package/dist/esm/limebb-live-docs-info.entry.js +2 -2
  101. package/dist/esm/limebb-loader.entry.js +1 -1
  102. package/dist/esm/limebb-locale-picker.entry.js +2 -2
  103. package/dist/esm/limebb-mention-group-counter.entry.js +2 -2
  104. package/dist/esm/limebb-mention.entry.js +1 -1
  105. package/dist/esm/limebb-navigation-button_2.entry.js +3 -3
  106. package/dist/esm/limebb-notification-item.entry.js +2 -2
  107. package/dist/esm/limebb-notification-list.entry.js +1 -1
  108. package/dist/esm/limebb-percentage-visualizer.entry.js +2 -2
  109. package/dist/esm/limebb-text-editor.entry.js +3 -3
  110. package/dist/esm/limebb-trend-indicator.entry.js +1 -1
  111. package/dist/esm/{limetype-6e7552a7.js → limetype-c0e041f7.js} +1 -1
  112. package/dist/esm/loader.js +1 -1
  113. package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
  114. package/dist/lime-crm-building-blocks/{p-a1818969.entry.js → p-03af0e66.entry.js} +1 -1
  115. package/dist/lime-crm-building-blocks/{p-f402184f.entry.js → p-098ee6c1.entry.js} +1 -1
  116. package/dist/lime-crm-building-blocks/{p-42e52b50.entry.js → p-1be0eec7.entry.js} +1 -1
  117. package/dist/lime-crm-building-blocks/{p-2aa18c2b.entry.js → p-206575e4.entry.js} +1 -1
  118. package/dist/lime-crm-building-blocks/p-20bfca36.js +1 -0
  119. package/dist/lime-crm-building-blocks/p-24aeb928.entry.js +1 -0
  120. package/dist/lime-crm-building-blocks/{p-82d33d43.entry.js → p-2faaacbc.entry.js} +1 -1
  121. package/dist/lime-crm-building-blocks/{p-d4016891.entry.js → p-2fdcb868.entry.js} +1 -1
  122. package/dist/lime-crm-building-blocks/{p-f52125a0.entry.js → p-3122ea05.entry.js} +1 -1
  123. package/dist/lime-crm-building-blocks/{p-baf4e428.entry.js → p-3175883d.entry.js} +1 -1
  124. package/dist/lime-crm-building-blocks/{p-8c8b7115.entry.js → p-32534eb7.entry.js} +1 -1
  125. package/dist/lime-crm-building-blocks/{p-6c1146ca.entry.js → p-36ea13c0.entry.js} +1 -1
  126. package/dist/lime-crm-building-blocks/p-422f6d51.entry.js +1 -0
  127. package/dist/lime-crm-building-blocks/{p-1fba0ade.js → p-4838284a.js} +1 -1
  128. package/dist/lime-crm-building-blocks/{p-5e4ba110.entry.js → p-5464f0de.entry.js} +1 -1
  129. package/dist/lime-crm-building-blocks/{p-e9d23ef7.entry.js → p-569c86b5.entry.js} +1 -1
  130. package/dist/lime-crm-building-blocks/{p-90e1716a.entry.js → p-5dc574a3.entry.js} +1 -1
  131. package/dist/lime-crm-building-blocks/{p-00da9b24.entry.js → p-631ca5a5.entry.js} +1 -1
  132. package/dist/lime-crm-building-blocks/p-67dbaa4c.entry.js +1 -0
  133. package/dist/lime-crm-building-blocks/p-6d119dab.entry.js +1 -0
  134. package/dist/lime-crm-building-blocks/{p-beb0d164.entry.js → p-7271f47a.entry.js} +1 -1
  135. package/dist/lime-crm-building-blocks/{p-34357744.entry.js → p-9031f136.entry.js} +1 -1
  136. package/dist/lime-crm-building-blocks/p-91732502.entry.js +1 -0
  137. package/dist/lime-crm-building-blocks/{p-8c4eb49f.entry.js → p-93cadc1e.entry.js} +1 -1
  138. package/dist/lime-crm-building-blocks/{p-3932077b.entry.js → p-9cac4de2.entry.js} +1 -1
  139. package/dist/lime-crm-building-blocks/{p-79d4668a.entry.js → p-a200954f.entry.js} +1 -1
  140. package/dist/lime-crm-building-blocks/p-b198194a.entry.js +1 -0
  141. package/dist/lime-crm-building-blocks/{p-d89c44ad.entry.js → p-b9b954d9.entry.js} +1 -1
  142. package/dist/lime-crm-building-blocks/{p-3a620226.entry.js → p-cfa1a4ad.entry.js} +1 -1
  143. package/dist/lime-crm-building-blocks/{p-ef8a5266.entry.js → p-e8946134.entry.js} +1 -1
  144. package/dist/lime-crm-building-blocks/{p-9d9f25da.entry.js → p-eb81bceb.entry.js} +1 -1
  145. package/dist/lime-crm-building-blocks/{p-50d3d61a.entry.js → p-ee1b00b9.entry.js} +1 -1
  146. package/dist/types/components/lime-query-builder/expressions/lime-query-filter-and.d.ts +5 -4
  147. package/dist/types/components/lime-query-builder/expressions/lime-query-filter-builder.d.ts +50 -0
  148. package/dist/types/components/lime-query-builder/expressions/lime-query-filter-comparison.d.ts +6 -4
  149. package/dist/types/components/lime-query-builder/expressions/lime-query-filter-expression.d.ts +10 -14
  150. package/dist/types/components/lime-query-builder/expressions/lime-query-filter-group.d.ts +60 -0
  151. package/dist/types/components/lime-query-builder/expressions/lime-query-filter-not.d.ts +4 -4
  152. package/dist/types/components/lime-query-builder/expressions/lime-query-filter-or.d.ts +5 -4
  153. package/dist/types/components/lime-query-builder/lime-query-builder.d.ts +1 -0
  154. package/dist/types/components/lime-query-builder/lime-query.types.d.ts +2 -1
  155. package/dist/types/components.d.ts +293 -65
  156. package/package.json +1 -1
  157. package/dist/cjs/isEqual-e77cce75.js +0 -37
  158. package/dist/cjs/lime-query.types-bcb63a22.js +0 -61
  159. package/dist/cjs/limebb-lime-query-filter-and_5.cjs.entry.js +0 -278
  160. package/dist/cjs/limebb-lime-query-value-input.cjs.entry.js +0 -239
  161. package/dist/cjs/limebb-property-selector.cjs.entry.js +0 -234
  162. package/dist/components/isEqual.js +0 -35
  163. package/dist/components/lime-query-filter-and.js +0 -408
  164. package/dist/esm/isEqual-57d0c223.js +0 -35
  165. package/dist/esm/lime-query.types-f72355e1.js +0 -59
  166. package/dist/esm/limebb-lime-query-filter-and_5.entry.js +0 -270
  167. package/dist/esm/limebb-lime-query-value-input.entry.js +0 -235
  168. package/dist/esm/limebb-property-selector.entry.js +0 -230
  169. package/dist/lime-crm-building-blocks/p-02c0cc04.entry.js +0 -1
  170. package/dist/lime-crm-building-blocks/p-0957b2a6.entry.js +0 -1
  171. package/dist/lime-crm-building-blocks/p-3b0a15ec.js +0 -1
  172. package/dist/lime-crm-building-blocks/p-5a6d2e7f.js +0 -1
  173. package/dist/lime-crm-building-blocks/p-60971d64.js +0 -1
  174. package/dist/lime-crm-building-blocks/p-70a28b93.entry.js +0 -1
  175. package/dist/lime-crm-building-blocks/p-96beaabc.entry.js +0 -1
  176. package/dist/lime-crm-building-blocks/p-f99c611d.entry.js +0 -1
@@ -0,0 +1,225 @@
1
+ import { h } from "@stencil/core";
2
+ import { Operator, } from "@limetech/lime-web-components";
3
+ /**
4
+ * Lime Query Filter Builder
5
+ *
6
+ * Entry component for building Lime Query filter expressions.
7
+ * This component wraps the expression router and adds promotion logic
8
+ * for handling Add buttons and expression structure.
9
+ *
10
+ * Unlike the expression router (which is pure routing), this component
11
+ * contains business logic for promoting expressions and managing the
12
+ * filter structure.
13
+ *
14
+ * @private
15
+ */
16
+ export class LimeQueryFilterBuilderComponent {
17
+ constructor() {
18
+ this.handleAddFirstCondition = () => {
19
+ const newExpression = {
20
+ key: '',
21
+ op: Operator.EQUALS,
22
+ exp: '',
23
+ };
24
+ this.expressionChange.emit(newExpression);
25
+ };
26
+ this.handlePromoteAndAdd = () => {
27
+ if (!this.expression) {
28
+ return;
29
+ }
30
+ // Wrap current expression in AND and add a new comparison
31
+ const newExpression = {
32
+ op: Operator.AND,
33
+ exp: [
34
+ this.expression,
35
+ {
36
+ key: '',
37
+ op: Operator.EQUALS,
38
+ exp: '',
39
+ },
40
+ ],
41
+ };
42
+ this.expressionChange.emit(newExpression);
43
+ };
44
+ this.handleExpressionChange = (event) => {
45
+ var _a;
46
+ event.stopPropagation();
47
+ this.expressionChange.emit((_a = event.detail) !== null && _a !== void 0 ? _a : undefined);
48
+ };
49
+ }
50
+ render() {
51
+ if (!this.expression) {
52
+ return this.renderEmptyState();
53
+ }
54
+ // Check if we need to show promotion UI (comparison or NOT)
55
+ if (this.needsPromotion()) {
56
+ return this.renderWithPromotionButton();
57
+ }
58
+ // AND/OR groups handle their own Add buttons
59
+ return (h("limebb-lime-query-filter-expression", { platform: this.platform, context: this.context, limetype: this.limetype, activeLimetype: this.activeLimetype, expression: this.expression, onExpressionChange: this.handleExpressionChange }));
60
+ }
61
+ needsPromotion() {
62
+ if (!this.expression) {
63
+ return false;
64
+ }
65
+ // Basic comparison needs promotion
66
+ if ('key' in this.expression) {
67
+ return true;
68
+ }
69
+ // NOT needs promotion
70
+ return this.expression.op === Operator.NOT;
71
+ }
72
+ renderEmptyState() {
73
+ return (h("limel-button", { label: "Add a condition", icon: "plus_math", onClick: this.handleAddFirstCondition }));
74
+ }
75
+ renderWithPromotionButton() {
76
+ return (h("div", { class: "expression-with-promotion" }, h("limebb-lime-query-filter-expression", { platform: this.platform, context: this.context, limetype: this.limetype, activeLimetype: this.activeLimetype, expression: this.expression, onExpressionChange: this.handleExpressionChange }), h("limel-button", { label: "Add another condition", icon: "plus_math", onClick: this.handlePromoteAndAdd })));
77
+ }
78
+ static get is() { return "limebb-lime-query-filter-builder"; }
79
+ static get encapsulation() { return "shadow"; }
80
+ static get originalStyleUrls() {
81
+ return {
82
+ "$": ["lime-query-filter-builder.scss"]
83
+ };
84
+ }
85
+ static get styleUrls() {
86
+ return {
87
+ "$": ["lime-query-filter-builder.css"]
88
+ };
89
+ }
90
+ static get properties() {
91
+ return {
92
+ "platform": {
93
+ "type": "unknown",
94
+ "mutable": false,
95
+ "complexType": {
96
+ "original": "LimeWebComponentPlatform",
97
+ "resolved": "LimeWebComponentPlatform",
98
+ "references": {
99
+ "LimeWebComponentPlatform": {
100
+ "location": "import",
101
+ "path": "@limetech/lime-web-components",
102
+ "id": "node_modules::LimeWebComponentPlatform"
103
+ }
104
+ }
105
+ },
106
+ "required": false,
107
+ "optional": false,
108
+ "docs": {
109
+ "tags": [],
110
+ "text": "Platform service provider"
111
+ },
112
+ "getter": false,
113
+ "setter": false
114
+ },
115
+ "context": {
116
+ "type": "unknown",
117
+ "mutable": false,
118
+ "complexType": {
119
+ "original": "LimeWebComponentContext",
120
+ "resolved": "LimeWebComponentContext",
121
+ "references": {
122
+ "LimeWebComponentContext": {
123
+ "location": "import",
124
+ "path": "@limetech/lime-web-components",
125
+ "id": "node_modules::LimeWebComponentContext"
126
+ }
127
+ }
128
+ },
129
+ "required": false,
130
+ "optional": false,
131
+ "docs": {
132
+ "tags": [],
133
+ "text": "Component context"
134
+ },
135
+ "getter": false,
136
+ "setter": false
137
+ },
138
+ "limetype": {
139
+ "type": "string",
140
+ "mutable": false,
141
+ "complexType": {
142
+ "original": "string",
143
+ "resolved": "string",
144
+ "references": {}
145
+ },
146
+ "required": false,
147
+ "optional": false,
148
+ "docs": {
149
+ "tags": [],
150
+ "text": "The limetype being queried (e.g., \"deal\", \"company\")"
151
+ },
152
+ "getter": false,
153
+ "setter": false,
154
+ "attribute": "limetype",
155
+ "reflect": false
156
+ },
157
+ "activeLimetype": {
158
+ "type": "string",
159
+ "mutable": false,
160
+ "complexType": {
161
+ "original": "string",
162
+ "resolved": "string | undefined",
163
+ "references": {}
164
+ },
165
+ "required": false,
166
+ "optional": true,
167
+ "docs": {
168
+ "tags": [],
169
+ "text": "The limetype of the active object (for %activeObject% placeholders)"
170
+ },
171
+ "getter": false,
172
+ "setter": false,
173
+ "attribute": "active-limetype",
174
+ "reflect": false
175
+ },
176
+ "expression": {
177
+ "type": "unknown",
178
+ "mutable": false,
179
+ "complexType": {
180
+ "original": "Expression | undefined",
181
+ "resolved": "undefined | { key: string; op: BasicOperator; exp: ExpressionValue; } | { key: string; op: Operator.IN; exp: ExpressionValue[]; } | { op: Operator.AND | Operator.OR; exp: Expression[]; } | { op: Operator.NOT; exp: Expression; } | { type: \"filter\"; key: string; op: Operator.IN; exp: string; }",
182
+ "references": {
183
+ "Expression": {
184
+ "location": "import",
185
+ "path": "@limetech/lime-web-components",
186
+ "id": "node_modules::Expression"
187
+ }
188
+ }
189
+ },
190
+ "required": false,
191
+ "optional": false,
192
+ "docs": {
193
+ "tags": [],
194
+ "text": "The filter expression to build"
195
+ },
196
+ "getter": false,
197
+ "setter": false
198
+ }
199
+ };
200
+ }
201
+ static get events() {
202
+ return [{
203
+ "method": "expressionChange",
204
+ "name": "expressionChange",
205
+ "bubbles": true,
206
+ "cancelable": true,
207
+ "composed": true,
208
+ "docs": {
209
+ "tags": [],
210
+ "text": "Emitted when the filter expression changes\nEmits undefined when expression should be removed"
211
+ },
212
+ "complexType": {
213
+ "original": "Expression | undefined",
214
+ "resolved": "undefined | { key: string; op: BasicOperator; exp: ExpressionValue; } | { key: string; op: Operator.IN; exp: ExpressionValue[]; } | { op: Operator.AND | Operator.OR; exp: Expression[]; } | { op: Operator.NOT; exp: Expression; } | { type: \"filter\"; key: string; op: Operator.IN; exp: string; }",
215
+ "references": {
216
+ "Expression": {
217
+ "location": "import",
218
+ "path": "@limetech/lime-web-components",
219
+ "id": "node_modules::Expression"
220
+ }
221
+ }
222
+ }
223
+ }];
224
+ }
225
+ }
@@ -1,5 +1,52 @@
1
+ import { Operator, } from "@limetech/lime-web-components";
1
2
  import { h } from "@stencil/core";
2
- import { LIME_QUERY_OPERATORS, } from "../lime-query.types";
3
+ const LIME_QUERY_OPERATORS = [
4
+ { value: Operator.EQUALS, label: 'Equals', icon: 'equals' },
5
+ { value: Operator.NOT_EQUALS, label: 'Not Equals', icon: 'not-equal' },
6
+ {
7
+ value: Operator.GREATER,
8
+ label: 'Greater Than',
9
+ icon: 'greater-than',
10
+ applicableTypes: ['integer', 'decimal', 'date', 'time'],
11
+ },
12
+ {
13
+ value: Operator.GREATER_OR_EQUAL,
14
+ label: 'Greater or Equal',
15
+ icon: 'greater-or-equal',
16
+ applicableTypes: ['integer', 'decimal', 'date', 'time'],
17
+ },
18
+ {
19
+ value: Operator.LESS,
20
+ label: 'Less Than',
21
+ icon: 'less-than',
22
+ applicableTypes: ['integer', 'decimal', 'date', 'time'],
23
+ },
24
+ {
25
+ value: Operator.LESS_OR_EQUAL,
26
+ label: 'Less or Equal',
27
+ icon: 'less-or-equal',
28
+ applicableTypes: ['integer', 'decimal', 'date', 'time'],
29
+ },
30
+ { value: Operator.IN, label: 'In List', icon: 'list' },
31
+ {
32
+ value: Operator.LIKE,
33
+ label: 'Contains',
34
+ icon: '-lime-filter-contain',
35
+ applicableTypes: ['string', 'text'],
36
+ },
37
+ {
38
+ value: Operator.BEGINS,
39
+ label: 'Begins With',
40
+ icon: '-lime-filter-begin',
41
+ applicableTypes: ['string', 'text'],
42
+ },
43
+ {
44
+ value: Operator.ENDS,
45
+ label: 'Ends With',
46
+ icon: '-lime-filter-end',
47
+ applicableTypes: ['string', 'text'],
48
+ },
49
+ ];
3
50
  /**
4
51
  * Lime Query Filter Comparison Component
5
52
  *
@@ -24,52 +71,49 @@ import { LIME_QUERY_OPERATORS, } from "../lime-query.types";
24
71
  */
25
72
  export class LimeQueryFilterComparisonComponent {
26
73
  constructor() {
27
- /**
28
- * The comparison expression to render
29
- */
30
- this.expression = {
31
- filter_type: 'comparison',
32
- property: '',
33
- operator: '=',
34
- value: '',
35
- };
36
74
  this.handlePropertyChange = (event) => {
37
75
  event.stopPropagation();
38
- this.expressionChange.emit(Object.assign(Object.assign({}, this.expression), { property: event.detail }));
76
+ this.expressionChange.emit(Object.assign(Object.assign({}, this.expression), { key: event.detail }));
39
77
  };
40
78
  this.handleOperatorChange = (event) => {
41
79
  event.stopPropagation();
42
- this.expressionChange.emit(Object.assign(Object.assign({}, this.expression), { operator: event.detail.value }));
80
+ // TODO: Clear value when switching between IN and other operators
81
+ // since array values are incompatible with single-value operators
82
+ this.expressionChange.emit({
83
+ key: this.expression.key,
84
+ op: event.detail.value,
85
+ exp: this.expression.exp,
86
+ });
43
87
  };
44
88
  this.handleValueChange = (event) => {
45
89
  event.stopPropagation();
46
- this.expressionChange.emit(Object.assign(Object.assign({}, this.expression), { value: event.detail }));
90
+ this.expressionChange.emit(Object.assign(Object.assign({}, this.expression), { exp: event.detail }));
47
91
  };
48
92
  this.removeExpression = () => {
49
- this.expressionChange.emit({ filter_type: '' });
93
+ this.expressionChange.emit(undefined);
50
94
  };
51
95
  }
52
96
  render() {
53
- return (h("div", { key: '618150e84e87cdc234b5eab7cd0ef6443bcb261c', class: "expression" }, this.label && h("limel-header", { key: '7b9a35794777df5556b591ea54d1e63b64833808', heading: this.label }), h("div", { key: '4367741a9383fc268fcfe6dbcc14bea49f20871b', class: "expression-container" }, this.renderPropertySelector(), this.renderOperator(), this.renderValueInput(), h("limel-icon-button", { key: '3ad667258da994636f484c0f7a5649b1e13b063b', class: "remove", icon: "trash", label: "Remove condition", onClick: this.removeExpression }))));
97
+ return (h("div", { key: '668e0f05bdb1fb25ffd652ea650c34e5431a3332', class: "expression" }, this.label && h("limel-header", { key: '5034070b58afe31cf90699dd2a27f884e647f540', heading: this.label }), h("div", { key: '14a2b1270e5e6d7e158e29ebc5f61051e5670e80', class: "expression-container" }, this.renderPropertySelector(), this.renderOperator(), this.renderValueInput(), h("limel-icon-button", { key: 'b69bde6e88c40d2623ef015794db28cec3676c73', class: "remove", icon: "trash", label: "Remove condition", onClick: this.removeExpression }))));
54
98
  }
55
99
  renderPropertySelector() {
56
- return (h("limebb-property-selector", { platform: this.platform, context: this.context, label: "Property", limetype: this.limetype, value: this.expression.property, required: true, onChange: this.handlePropertyChange }));
100
+ return (h("limebb-property-selector", { platform: this.platform, context: this.context, label: "Property", limetype: this.limetype, value: this.expression.key, required: true, onChange: this.handlePropertyChange }));
57
101
  }
58
102
  renderOperator() {
59
- const operatorHasBeenSet = !!this.expression.operator;
103
+ const operatorHasBeenSet = !!this.expression.op;
60
104
  const options = LIME_QUERY_OPERATORS.map((op) => ({
61
105
  text: op.label,
62
106
  value: op.value,
63
107
  icon: op.icon ? { name: op.icon } : undefined,
64
108
  }));
65
- const selectedOption = options.find((o) => o.value === this.expression.operator);
66
- return (h("limel-select", { class: "operator", label: "Operator", value: selectedOption, options: options, disabled: !operatorHasBeenSet && !this.expression.property, onChange: this.handleOperatorChange }));
109
+ const selectedOption = options.find((o) => o.value === this.expression.op);
110
+ return (h("limel-select", { class: "operator", label: "Operator", value: selectedOption, options: options, disabled: !operatorHasBeenSet && !this.expression.key, onChange: this.handleOperatorChange }));
67
111
  }
68
112
  renderValueInput() {
69
- if (!this.expression.operator) {
113
+ if (!this.expression.op) {
70
114
  return null;
71
115
  }
72
- return (h("limebb-lime-query-value-input", { platform: this.platform, context: this.context, limetype: this.limetype, activeLimetype: this.activeLimetype, propertyPath: this.expression.property, operator: this.expression.operator, value: this.expression.value, onChange: this.handleValueChange }));
116
+ return (h("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 }));
73
117
  }
74
118
  static get is() { return "limebb-lime-query-filter-comparison"; }
75
119
  static get encapsulation() { return "shadow"; }
@@ -192,13 +236,12 @@ export class LimeQueryFilterComparisonComponent {
192
236
  "type": "unknown",
193
237
  "mutable": false,
194
238
  "complexType": {
195
- "original": "LimeQueryFilterComparison",
196
- "resolved": "LimeQueryFilterComparison",
239
+ "original": "ComparisonExpression",
240
+ "resolved": "{ key: string; op: BasicOperator; exp: ExpressionValue; } | { key: string; op: Operator.IN; exp: ExpressionValue[]; } | { type: \"filter\"; key: string; op: Operator.IN; exp: string; }",
197
241
  "references": {
198
- "LimeQueryFilterComparison": {
199
- "location": "import",
200
- "path": "../lime-query.types",
201
- "id": "src/components/lime-query-builder/lime-query.types.ts::LimeQueryFilterComparison"
242
+ "ComparisonExpression": {
243
+ "location": "global",
244
+ "id": "global::ComparisonExpression"
202
245
  }
203
246
  }
204
247
  },
@@ -209,8 +252,7 @@ export class LimeQueryFilterComparisonComponent {
209
252
  "text": "The comparison expression to render"
210
253
  },
211
254
  "getter": false,
212
- "setter": false,
213
- "defaultValue": "{\n filter_type: 'comparison',\n property: '',\n operator: '=',\n value: '',\n }"
255
+ "setter": false
214
256
  }
215
257
  };
216
258
  }
@@ -223,21 +265,15 @@ export class LimeQueryFilterComparisonComponent {
223
265
  "composed": true,
224
266
  "docs": {
225
267
  "tags": [],
226
- "text": "Emitted when the comparison expression changes (property/operator/value modified)"
268
+ "text": "Emitted when the comparison expression changes (property/operator/value modified)\nEmits undefined when the expression should be removed"
227
269
  },
228
270
  "complexType": {
229
- "original": "LimeQueryFilterComparison | LimeQueryFilterMissing",
230
- "resolved": "LimeQueryFilterComparison | LimeQueryFilterMissing",
271
+ "original": "ComparisonExpression | undefined",
272
+ "resolved": "undefined | { key: string; op: BasicOperator; exp: ExpressionValue; } | { key: string; op: Operator.IN; exp: ExpressionValue[]; } | { type: \"filter\"; key: string; op: Operator.IN; exp: string; }",
231
273
  "references": {
232
- "LimeQueryFilterComparison": {
233
- "location": "import",
234
- "path": "../lime-query.types",
235
- "id": "src/components/lime-query-builder/lime-query.types.ts::LimeQueryFilterComparison"
236
- },
237
- "LimeQueryFilterMissing": {
238
- "location": "import",
239
- "path": "../lime-query.types",
240
- "id": "src/components/lime-query-builder/lime-query.types.ts::LimeQueryFilterMissing"
274
+ "ComparisonExpression": {
275
+ "location": "global",
276
+ "id": "global::ComparisonExpression"
241
277
  }
242
278
  }
243
279
  }
@@ -1,23 +1,27 @@
1
1
  import { h } from "@stencil/core";
2
+ import { Operator, } from "@limetech/lime-web-components";
2
3
  /**
3
4
  * Lime Query Filter Expression Router
4
5
  *
5
- * This is the main entry point for rendering Lime Query filters.
6
- * It routes to the appropriate sub-component based on the filter type:
7
- * - `'AND'` → limebb-lime-query-filter-and
8
- * - `'OR'` → limebb-lime-query-filter-or
9
- * - `'NOT'` → limebb-lime-query-filter-not
10
- * - `'comparison'` → limebb-lime-query-filter-comparison
11
- * - `''` (missing) → limebb-lime-query-filter-comparison (default)
12
- *
13
- * Use this component when you need to render a complete filter expression
14
- * that may contain nested AND/OR/NOT logic.
6
+ * Router component for rendering Lime Query filter expressions.
7
+ * Routes to the appropriate sub-component based on expression structure:
8
+ * - Has `key` property → limebb-lime-query-filter-comparison
9
+ * - `op: Operator.AND | Operator.OR` → limebb-lime-query-filter-group
10
+ * - `op: Operator.NOT` → limebb-lime-query-filter-not
15
11
  *
16
12
  * @private
17
13
  */
18
14
  export class LimeQueryFilterExpressionComponent {
15
+ constructor() {
16
+ this.handleExpressionChange = (event) => {
17
+ event.stopPropagation();
18
+ this.expressionChange.emit(event.detail);
19
+ };
20
+ }
19
21
  render() {
20
- var _a;
22
+ if (!this.expression) {
23
+ return;
24
+ }
21
25
  const props = {
22
26
  platform: this.platform,
23
27
  context: this.context,
@@ -25,30 +29,15 @@ export class LimeQueryFilterExpressionComponent {
25
29
  limetype: this.limetype,
26
30
  activeLimetype: this.activeLimetype,
27
31
  };
28
- switch ((_a = this.expression) === null || _a === void 0 ? void 0 : _a.filter_type) {
29
- case 'AND': {
30
- return (h("limebb-lime-query-filter-and", Object.assign({}, props, { expression: this.expression })));
31
- }
32
- case 'OR': {
33
- return (h("limebb-lime-query-filter-or", Object.assign({}, props, { expression: this.expression })));
34
- }
35
- case 'NOT': {
36
- return (h("limebb-lime-query-filter-not", Object.assign({}, props, { expression: this.expression })));
37
- }
38
- case 'comparison': {
39
- return (h("limebb-lime-query-filter-comparison", Object.assign({}, props, { expression: this.expression })));
40
- }
41
- default: {
42
- // Default to comparison for empty/missing expressions
43
- // Convert missing expression to empty comparison
44
- const comparisonExpression = {
45
- filter_type: 'comparison',
46
- property: '',
47
- operator: '=',
48
- value: '',
49
- };
50
- return (h("limebb-lime-query-filter-comparison", Object.assign({}, props, { expression: comparisonExpression })));
51
- }
32
+ if ('key' in this.expression) {
33
+ return (h("limebb-lime-query-filter-comparison", Object.assign({}, props, { expression: this.expression, onExpressionChange: this.handleExpressionChange })));
34
+ }
35
+ if (this.expression.op === Operator.AND ||
36
+ this.expression.op === Operator.OR) {
37
+ return (h("limebb-lime-query-filter-group", Object.assign({}, props, { expression: this.expression, onExpressionChange: this.handleExpressionChange })));
38
+ }
39
+ if (this.expression.op === Operator.NOT) {
40
+ return (h("limebb-lime-query-filter-not", Object.assign({}, props, { expression: this.expression, onExpressionChange: this.handleExpressionChange })));
52
41
  }
53
42
  }
54
43
  static get is() { return "limebb-lime-query-filter-expression"; }
@@ -172,13 +161,13 @@ export class LimeQueryFilterExpressionComponent {
172
161
  "type": "unknown",
173
162
  "mutable": false,
174
163
  "complexType": {
175
- "original": "LimeQueryFilterExpression",
176
- "resolved": "LimeQueryFilterAnd | LimeQueryFilterComparison | LimeQueryFilterMissing | LimeQueryFilterNot | LimeQueryFilterOr",
164
+ "original": "Expression",
165
+ "resolved": "{ key: string; op: BasicOperator; exp: ExpressionValue; } | { key: string; op: Operator.IN; exp: ExpressionValue[]; } | { op: Operator.AND | Operator.OR; exp: Expression[]; } | { op: Operator.NOT; exp: Expression; } | { type: \"filter\"; key: string; op: Operator.IN; exp: string; }",
177
166
  "references": {
178
- "LimeQueryFilterExpression": {
167
+ "Expression": {
179
168
  "location": "import",
180
- "path": "../lime-query.types",
181
- "id": "src/components/lime-query-builder/lime-query.types.ts::LimeQueryFilterExpression"
169
+ "path": "@limetech/lime-web-components",
170
+ "id": "node_modules::Expression"
182
171
  }
183
172
  }
184
173
  },
@@ -202,16 +191,16 @@ export class LimeQueryFilterExpressionComponent {
202
191
  "composed": true,
203
192
  "docs": {
204
193
  "tags": [],
205
- "text": "Emitted when the filter expression changes"
194
+ "text": "Emitted when the filter expression changes\nEmits undefined when expression should be removed"
206
195
  },
207
196
  "complexType": {
208
- "original": "LimeQueryFilterExpression",
209
- "resolved": "LimeQueryFilterAnd | LimeQueryFilterComparison | LimeQueryFilterMissing | LimeQueryFilterNot | LimeQueryFilterOr",
197
+ "original": "Expression | undefined",
198
+ "resolved": "undefined | { key: string; op: BasicOperator; exp: ExpressionValue; } | { key: string; op: Operator.IN; exp: ExpressionValue[]; } | { op: Operator.AND | Operator.OR; exp: Expression[]; } | { op: Operator.NOT; exp: Expression; } | { type: \"filter\"; key: string; op: Operator.IN; exp: string; }",
210
199
  "references": {
211
- "LimeQueryFilterExpression": {
200
+ "Expression": {
212
201
  "location": "import",
213
- "path": "../lime-query.types",
214
- "id": "src/components/lime-query-builder/lime-query.types.ts::LimeQueryFilterExpression"
202
+ "path": "@limetech/lime-web-components",
203
+ "id": "node_modules::Expression"
215
204
  }
216
205
  }
217
206
  }
@@ -0,0 +1,130 @@
1
+ @charset "UTF-8";
2
+ /**
3
+ * Note! This file is exported to `dist/scss/` in the published
4
+ * node module, for consumer projects to import.
5
+ * That means this file cannot import from any file that isn't
6
+ * also exported, keeping the same relative path.
7
+ *
8
+ * Or, just don't import anything, that works too.
9
+ */
10
+ /**
11
+ * This can be used on a trigger element that opens a dropdown menu or a popover.
12
+ */
13
+ /**
14
+ * This mixin will mask out the content that is close to
15
+ * the edges of a scrollable area.
16
+ * - If the scrollable content has `overflow-y`, use `vertically`
17
+ * as an argument for `$direction`.
18
+ - If the scrollable content has `overflow-x`, use `horizontally`
19
+ * as an argument for `$direction`.
20
+ *
21
+ * For the visual effect to work smoothly, we need to make sure that
22
+ * the size of the fade-out edge effect is the same as the
23
+ * internal paddings of the scrollable area. Otherwise, content of a
24
+ * scrollable area that does not have a padding will fade out before
25
+ * any scrolling has been done.
26
+ * This is why this mixin already adds paddings, which automatically
27
+ * default to the size of the fade-out effect.
28
+ * This size defaults to `1rem`, but to override the size use
29
+ * `--limel-top-edge-fade-height` & `--limel-bottom-edge-fade-height`
30
+ * when `vertically` argument is set, and use
31
+ * `--limel-left-edge-fade-width` & `--limel-right-edge-fade-width`
32
+ * when `horizontally` argument is set.
33
+ * Of course you can also programmatically increase and decrease the
34
+ * size of these variables for each edge, based on the amount of
35
+ * scrolling that has been done by the user. In this case, make sure
36
+ * to add a custom padding where the mixin is used, to override
37
+ * the paddings that are automatically added by the mixin in the
38
+ * compiled CSS code.
39
+ */
40
+ /**
41
+ * This mixin will add an animated underline to the bottom of an `a` elements.
42
+ * Note that you may need to add `all: unset;` –depending on your use case–
43
+ * before using this mixin.
44
+ */
45
+ /**
46
+ * This mixin creates a cross-browser font stack.
47
+ * - `sans-serif` can be used for the UI of the components.
48
+ * - `monospace` can be used for code.
49
+ *
50
+ * ⚠️ If we change the font stacks, we need to update
51
+ * 1. the consumer documentation in `README.md`, and
52
+ * 2. the CSS variables of `--kompendium-example-font-family`
53
+ * in the `<style>` tag of `index.html`.
54
+ */
55
+ /**
56
+ * This mixin is a hack, using old CSS syntax
57
+ * to enable you to truncate a piece of text,
58
+ * after a certain number of lines.
59
+ */
60
+ /**
61
+ * This mixin will add a chessboard background pattern,
62
+ * typically used to visualize transparency.
63
+ */
64
+ /**
65
+ * Make a container resizable by the user.
66
+ * This is used in the documentations and examples
67
+ * of some components, to demonstrate how the component
68
+ * behaves in a resizable container.
69
+ */
70
+ /**
71
+ * The breakpoints below are used to create responsive designs
72
+ * in Lime's products. Therefore, they are here to get distributed
73
+ * to all components in other private repos, which rely on this `mixins`
74
+ * file, to create consistent styles.
75
+ *
76
+ * :::important
77
+ * In very rare cases you should used media queries!
78
+ * Nowadays, there are many better ways of achieving responsive design
79
+ * without media queries. For example, using CSS Grid, Flexbox, and their features.
80
+ * :::
81
+ */
82
+ /**
83
+ * Media query mixins for responsive design based on screen width.
84
+ * Note that these mixins do not detect the device type!
85
+ */
86
+ /**
87
+ * @mixin action-bar-interactions($item-selector)
88
+ * This mixin applies styles for the action bar interactions.
89
+ * For example, it animates the height of the action bar from `0` to `auto`.
90
+ *
91
+ * :::note
92
+ * The consumer should set:
93
+ * `--limebb-promoted-action-bar-grid-template-rows: 0fr;`
94
+ * when the action bar is not supposed to be visible.
95
+ * :::
96
+ *
97
+ * @param {string} $item-selector - The consumer component's tag name for the item that displays the action bar.
98
+ */
99
+ .expression {
100
+ display: flex;
101
+ flex-direction: column;
102
+ margin-bottom: 1rem;
103
+ gap: 0;
104
+ background-color: rgb(var(--contrast-100));
105
+ border: 1px solid rgb(var(--contrast-500));
106
+ border-radius: 0.75rem;
107
+ }
108
+ .expression .clickable-header {
109
+ cursor: pointer;
110
+ user-select: none;
111
+ }
112
+ .expression .clickable-header:hover {
113
+ background-color: rgb(var(--contrast-200));
114
+ }
115
+ .expression > ul {
116
+ margin-top: 0;
117
+ margin-right: 1rem;
118
+ margin-bottom: 1rem;
119
+ margin-left: 1rem;
120
+ padding-left: 1rem;
121
+ list-style: disc;
122
+ }
123
+ .expression > ul li {
124
+ margin-top: 1rem;
125
+ }
126
+ .expression > ul li.add-button {
127
+ list-style: none;
128
+ display: flex;
129
+ gap: 0.5rem;
130
+ }