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