@limetech/lime-crm-building-blocks 2.0.4 → 2.2.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 (288) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/cjs/condition-tree-translate-B_qIQz9s.js +27 -0
  3. package/dist/cjs/index.cjs.js +6 -0
  4. package/dist/cjs/lime-crm-building-blocks.cjs.js +1 -1
  5. package/dist/cjs/limebb-alert-dialog.cjs.entry.js +1 -1
  6. package/dist/cjs/limebb-browser.cjs.entry.js +2 -2
  7. package/dist/cjs/limebb-chat-icon-list_3.cjs.entry.js +4 -4
  8. package/dist/cjs/limebb-chat-list.cjs.entry.js +1 -1
  9. package/dist/cjs/limebb-color-palette-picker.cjs.entry.js +1 -1
  10. package/dist/cjs/limebb-color-palette-swatches.cjs.entry.js +1 -1
  11. package/dist/cjs/limebb-composer-toolbar.cjs.entry.js +2 -2
  12. package/dist/cjs/limebb-condition-tree-editor.cjs.entry.js +90 -0
  13. package/dist/cjs/limebb-condition-tree.cjs.entry.js +882 -0
  14. package/dist/cjs/limebb-currency-picker.cjs.entry.js +1 -1
  15. package/dist/cjs/limebb-dashboard-widget.cjs.entry.js +1 -1
  16. package/dist/cjs/limebb-date-picker.cjs.entry.js +1 -1
  17. package/dist/cjs/limebb-date-range.cjs.entry.js +1 -1
  18. package/dist/cjs/limebb-document-chips.cjs.entry.js +1 -1
  19. package/dist/cjs/limebb-document-item.cjs.entry.js +2 -2
  20. package/dist/cjs/limebb-document-picker.cjs.entry.js +1 -1
  21. package/dist/cjs/limebb-feed-item-thumbnail-file-info.cjs.entry.js +1 -1
  22. package/dist/cjs/limebb-feed-timeline-item.cjs.entry.js +1 -1
  23. package/dist/cjs/limebb-feed.cjs.entry.js +1 -1
  24. package/dist/cjs/limebb-filter-chip_6.cjs.entry.js +7 -7
  25. package/dist/cjs/limebb-icon-picker.cjs.entry.js +1 -1
  26. package/dist/cjs/limebb-info-tile-format.cjs.entry.js +1 -1
  27. package/dist/cjs/limebb-info-tile.cjs.entry.js +1 -1
  28. package/dist/cjs/limebb-kanban-group.cjs.entry.js +1 -1
  29. package/dist/cjs/limebb-kanban-item.cjs.entry.js +1 -1
  30. package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +1 -1
  31. package/dist/cjs/limebb-lime-query-filter-comparison_2.cjs.entry.js +2 -2
  32. package/dist/cjs/limebb-lime-query-order-by-editor_2.cjs.entry.js +2 -2
  33. package/dist/cjs/limebb-lime-query-order-by-item.cjs.entry.js +2 -2
  34. package/dist/cjs/limebb-lime-query-response-format-builder.cjs.entry.js +1 -1
  35. package/dist/cjs/limebb-lime-query-response-format-editor_2.cjs.entry.js +1 -1
  36. package/dist/cjs/limebb-live-docs-info.cjs.entry.js +2 -2
  37. package/dist/cjs/limebb-locale-picker.cjs.entry.js +1 -1
  38. package/dist/cjs/limebb-mention-group-counter.cjs.entry.js +2 -2
  39. package/dist/cjs/limebb-navigation-button_2.cjs.entry.js +2 -2
  40. package/dist/cjs/limebb-notification-item.cjs.entry.js +1 -1
  41. package/dist/cjs/limebb-percentage-visualizer.cjs.entry.js +2 -2
  42. package/dist/cjs/limebb-rule-chip-popover.cjs.entry.js +2 -2
  43. package/dist/cjs/limebb-rule-editor.cjs.entry.js +162 -22
  44. package/dist/cjs/limebb-rule-gate.cjs.entry.js +1 -1
  45. package/dist/cjs/limebb-text-editor.cjs.entry.js +1 -1
  46. package/dist/cjs/limebb-trend-indicator.cjs.entry.js +1 -1
  47. package/dist/cjs/limebb-value-comparison-editor.cjs.entry.js +1 -1
  48. package/dist/cjs/loader.cjs.js +1 -1
  49. package/dist/cjs/rule-editor-modes-Dc6rnwD2.js +76 -0
  50. package/dist/collection/collection-manifest.json +3 -1
  51. package/dist/collection/components/alert-dialog/alert-dialog.js +1 -1
  52. package/dist/collection/components/browser/browser.js +2 -2
  53. package/dist/collection/components/chat-list/chat-icon-list/chat-icon-list.js +1 -1
  54. package/dist/collection/components/chat-list/chat-item/chat-item.js +2 -2
  55. package/dist/collection/components/chat-list/chat-list.js +1 -1
  56. package/dist/collection/components/chat-list/typing-indicator/typing-indicator.js +1 -1
  57. package/dist/collection/components/color-palette-picker/color-palette-picker.js +1 -1
  58. package/dist/collection/components/color-palette-picker/color-palette-swatches/color-palette-swatches.js +1 -1
  59. package/dist/collection/components/composer-toolbar/composer-toolbar.js +2 -2
  60. package/dist/collection/components/condition-tree/condition-tree-combinators.js +78 -0
  61. package/dist/collection/components/condition-tree/condition-tree-editor/condition-tree-editor.css +17 -0
  62. package/dist/collection/components/condition-tree/condition-tree-editor/condition-tree-editor.js +333 -0
  63. package/dist/collection/components/condition-tree/condition-tree-nodes.js +218 -0
  64. package/dist/collection/components/condition-tree/condition-tree-open-state.js +127 -0
  65. package/dist/collection/components/condition-tree/condition-tree-translate.js +22 -0
  66. package/dist/collection/components/condition-tree/condition-tree-view-context.js +22 -0
  67. package/dist/collection/components/condition-tree/condition-tree.css +132 -0
  68. package/dist/collection/components/condition-tree/condition-tree.js +461 -0
  69. package/dist/collection/components/condition-tree/condition-tree.types.js +1 -0
  70. package/dist/collection/components/condition-tree/group-node-view.js +153 -0
  71. package/dist/collection/components/condition-tree/leaf-node-view.js +74 -0
  72. package/dist/collection/components/currency-picker/currency-picker.js +1 -1
  73. package/dist/collection/components/dashboard-widget/dashboard-widget.js +1 -1
  74. package/dist/collection/components/date-picker/date-picker.js +1 -1
  75. package/dist/collection/components/date-range/date-range.js +1 -1
  76. package/dist/collection/components/document-chips/document-chips.js +1 -1
  77. package/dist/collection/components/document-picker/document-item/document-item.js +2 -2
  78. package/dist/collection/components/document-picker/document-picker.js +1 -1
  79. package/dist/collection/components/feed/feed-item/feed-timeline-item.js +1 -1
  80. package/dist/collection/components/feed/feed-item-thumbnail-file-info/feed-item-thumbnail-file-info.js +1 -1
  81. package/dist/collection/components/feed/feed.js +1 -1
  82. package/dist/collection/components/filter-chip/filter-chip.js +2 -2
  83. package/dist/collection/components/filter-condition-picker/filter-condition-picker.js +1 -1
  84. package/dist/collection/components/icon-picker/icon-picker.js +1 -1
  85. package/dist/collection/components/info-tile/format/config/info-tile-format.js +1 -1
  86. package/dist/collection/components/info-tile/info-tile.js +1 -1
  87. package/dist/collection/components/kanban/kanban-group/kanban-group.js +1 -1
  88. package/dist/collection/components/kanban/kanban-item/kanban-item.js +1 -1
  89. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-comparison-editor.js +1 -1
  90. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-comparison.js +2 -2
  91. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.js +2 -2
  92. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-not.js +1 -1
  93. package/dist/collection/components/lime-query-builder/lime-query-builder.js +1 -1
  94. package/dist/collection/components/lime-query-builder/lime-query-response-format-builder.js +1 -1
  95. package/dist/collection/components/lime-query-builder/limetype-field/limetype-field.js +1 -1
  96. package/dist/collection/components/lime-query-builder/order-by/order-by-editor.js +1 -1
  97. package/dist/collection/components/lime-query-builder/order-by/order-by-item.js +2 -2
  98. package/dist/collection/components/lime-query-builder/response-format/response-format-item.js +1 -1
  99. package/dist/collection/components/limeobject/file-viewer/live-docs-info.js +2 -2
  100. package/dist/collection/components/locale-picker/locale-picker.js +1 -1
  101. package/dist/collection/components/notification-list/notification-item/notification-item.js +1 -1
  102. package/dist/collection/components/percentage-visualizer/percentage-visualizer.js +2 -2
  103. package/dist/collection/components/rule-editor/group-node-view.js +3 -3
  104. package/dist/collection/components/rule-editor/rule-chip-popover/rule-chip-popover.js +2 -2
  105. package/dist/collection/components/rule-editor/rule-editor-mode-view.js +32 -0
  106. package/dist/collection/components/rule-editor/rule-editor-modes.js +68 -0
  107. package/dist/collection/components/rule-editor/rule-editor.css +153 -12
  108. package/dist/collection/components/rule-editor/rule-editor.js +201 -19
  109. package/dist/collection/components/rule-editor/rule-editor.types.js +1 -0
  110. package/dist/collection/components/rule-editor/value-comparison-editor/value-comparison-editor.js +1 -1
  111. package/dist/collection/components/rule-gate/rule-gate.js +1 -1
  112. package/dist/collection/components/summary-popover/summary-popover.js +2 -2
  113. package/dist/collection/components/text-editor/mention-group-counter.js +2 -2
  114. package/dist/collection/components/text-editor/text-editor.js +1 -1
  115. package/dist/collection/components/trend-indicator/trend-indicator.js +1 -1
  116. package/dist/collection/index.js +2 -0
  117. package/dist/components/chat-icon-list.js +1 -1
  118. package/dist/components/chat-item.js +1 -1
  119. package/dist/components/condition-tree-editor.js +1 -0
  120. package/dist/components/currency-picker.js +1 -1
  121. package/dist/components/date-picker.js +1 -1
  122. package/dist/components/document-item.js +1 -1
  123. package/dist/components/feed-item-thumbnail-file-info.js +1 -1
  124. package/dist/components/feed-timeline-item.js +1 -1
  125. package/dist/components/filter-chip.js +1 -1
  126. package/dist/components/filter-condition-picker.js +1 -1
  127. package/dist/components/index.js +1 -1
  128. package/dist/components/kanban-group.js +1 -1
  129. package/dist/components/kanban-item.js +1 -1
  130. package/dist/components/lime-query-filter-comparison-editor.js +1 -1
  131. package/dist/components/lime-query-filter-comparison.js +1 -1
  132. package/dist/components/lime-query-filter-expression.js +1 -1
  133. package/dist/components/limebb-alert-dialog.js +1 -1
  134. package/dist/components/limebb-browser.js +1 -1
  135. package/dist/components/limebb-chat-list.js +1 -1
  136. package/dist/components/limebb-color-palette-picker.js +1 -1
  137. package/dist/components/limebb-color-palette-swatches.js +1 -1
  138. package/dist/components/limebb-composer-toolbar.js +1 -1
  139. package/dist/components/limebb-condition-tree-editor.d.ts +11 -0
  140. package/dist/components/limebb-condition-tree-editor.js +1 -0
  141. package/dist/components/limebb-condition-tree.d.ts +11 -0
  142. package/dist/components/limebb-condition-tree.js +1 -0
  143. package/dist/components/limebb-dashboard-widget.js +1 -1
  144. package/dist/components/limebb-date-range.js +1 -1
  145. package/dist/components/limebb-document-chips.js +1 -1
  146. package/dist/components/limebb-document-picker.js +1 -1
  147. package/dist/components/limebb-feed.js +1 -1
  148. package/dist/components/limebb-icon-picker.js +1 -1
  149. package/dist/components/limebb-info-tile-format.js +1 -1
  150. package/dist/components/limebb-info-tile.js +1 -1
  151. package/dist/components/limebb-lime-query-builder.js +1 -1
  152. package/dist/components/limebb-lime-query-response-format-builder.js +1 -1
  153. package/dist/components/limebb-locale-picker.js +1 -1
  154. package/dist/components/limebb-mention-group-counter.js +1 -1
  155. package/dist/components/limebb-rule-editor.js +1 -1
  156. package/dist/components/limebb-rule-gate.js +1 -1
  157. package/dist/components/limebb-text-editor.js +1 -1
  158. package/dist/components/limebb-trend-indicator.js +1 -1
  159. package/dist/components/limebb-value-comparison-editor.js +1 -1
  160. package/dist/components/limetype-field.js +1 -1
  161. package/dist/components/live-docs-info.js +1 -1
  162. package/dist/components/notification-item.js +1 -1
  163. package/dist/components/order-by-editor.js +1 -1
  164. package/dist/components/order-by-item.js +1 -1
  165. package/dist/components/percentage-visualizer.js +1 -1
  166. package/dist/components/response-format-item.js +1 -1
  167. package/dist/components/rule-chip-popover.js +1 -1
  168. package/dist/components/rule-editor-modes.js +1 -0
  169. package/dist/components/summary-popover.js +1 -1
  170. package/dist/components/typing-indicator.js +1 -1
  171. package/dist/esm/condition-tree-translate-CBeXbZ_z.js +25 -0
  172. package/dist/esm/index.js +1 -0
  173. package/dist/esm/lime-crm-building-blocks.js +1 -1
  174. package/dist/esm/limebb-alert-dialog.entry.js +1 -1
  175. package/dist/esm/limebb-browser.entry.js +2 -2
  176. package/dist/esm/limebb-chat-icon-list_3.entry.js +4 -4
  177. package/dist/esm/limebb-chat-list.entry.js +1 -1
  178. package/dist/esm/limebb-color-palette-picker.entry.js +1 -1
  179. package/dist/esm/limebb-color-palette-swatches.entry.js +1 -1
  180. package/dist/esm/limebb-composer-toolbar.entry.js +2 -2
  181. package/dist/esm/limebb-condition-tree-editor.entry.js +88 -0
  182. package/dist/esm/limebb-condition-tree.entry.js +880 -0
  183. package/dist/esm/limebb-currency-picker.entry.js +1 -1
  184. package/dist/esm/limebb-dashboard-widget.entry.js +1 -1
  185. package/dist/esm/limebb-date-picker.entry.js +1 -1
  186. package/dist/esm/limebb-date-range.entry.js +1 -1
  187. package/dist/esm/limebb-document-chips.entry.js +1 -1
  188. package/dist/esm/limebb-document-item.entry.js +2 -2
  189. package/dist/esm/limebb-document-picker.entry.js +1 -1
  190. package/dist/esm/limebb-feed-item-thumbnail-file-info.entry.js +1 -1
  191. package/dist/esm/limebb-feed-timeline-item.entry.js +1 -1
  192. package/dist/esm/limebb-feed.entry.js +1 -1
  193. package/dist/esm/limebb-filter-chip_6.entry.js +7 -7
  194. package/dist/esm/limebb-icon-picker.entry.js +1 -1
  195. package/dist/esm/limebb-info-tile-format.entry.js +1 -1
  196. package/dist/esm/limebb-info-tile.entry.js +1 -1
  197. package/dist/esm/limebb-kanban-group.entry.js +1 -1
  198. package/dist/esm/limebb-kanban-item.entry.js +1 -1
  199. package/dist/esm/limebb-lime-query-builder.entry.js +1 -1
  200. package/dist/esm/limebb-lime-query-filter-comparison_2.entry.js +2 -2
  201. package/dist/esm/limebb-lime-query-order-by-editor_2.entry.js +2 -2
  202. package/dist/esm/limebb-lime-query-order-by-item.entry.js +2 -2
  203. package/dist/esm/limebb-lime-query-response-format-builder.entry.js +1 -1
  204. package/dist/esm/limebb-lime-query-response-format-editor_2.entry.js +1 -1
  205. package/dist/esm/limebb-live-docs-info.entry.js +2 -2
  206. package/dist/esm/limebb-locale-picker.entry.js +1 -1
  207. package/dist/esm/limebb-mention-group-counter.entry.js +2 -2
  208. package/dist/esm/limebb-navigation-button_2.entry.js +2 -2
  209. package/dist/esm/limebb-notification-item.entry.js +1 -1
  210. package/dist/esm/limebb-percentage-visualizer.entry.js +2 -2
  211. package/dist/esm/limebb-rule-chip-popover.entry.js +2 -2
  212. package/dist/esm/limebb-rule-editor.entry.js +163 -23
  213. package/dist/esm/limebb-rule-gate.entry.js +1 -1
  214. package/dist/esm/limebb-text-editor.entry.js +1 -1
  215. package/dist/esm/limebb-trend-indicator.entry.js +1 -1
  216. package/dist/esm/limebb-value-comparison-editor.entry.js +1 -1
  217. package/dist/esm/loader.js +1 -1
  218. package/dist/esm/rule-editor-modes-BCglve2Z.js +70 -0
  219. package/dist/lime-crm-building-blocks/index.esm.js +1 -1
  220. package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
  221. package/dist/lime-crm-building-blocks/{p-2f8540ab.entry.js → p-02fba38e.entry.js} +1 -1
  222. package/dist/lime-crm-building-blocks/{p-76151fce.entry.js → p-0445035f.entry.js} +1 -1
  223. package/dist/lime-crm-building-blocks/{p-4f0a4893.entry.js → p-0a05b3e9.entry.js} +1 -1
  224. package/dist/lime-crm-building-blocks/p-0dd64440.entry.js +1 -0
  225. package/dist/lime-crm-building-blocks/p-1578c8f0.entry.js +1 -0
  226. package/dist/lime-crm-building-blocks/{p-76064593.entry.js → p-170ab4be.entry.js} +1 -1
  227. package/dist/lime-crm-building-blocks/{p-542047c4.entry.js → p-27b9c824.entry.js} +1 -1
  228. package/dist/lime-crm-building-blocks/{p-2628fe8e.entry.js → p-2d1c7b6f.entry.js} +1 -1
  229. package/dist/lime-crm-building-blocks/{p-c2c181f1.entry.js → p-3fd84800.entry.js} +1 -1
  230. package/dist/lime-crm-building-blocks/{p-c7daffb6.entry.js → p-45dd8663.entry.js} +1 -1
  231. package/dist/lime-crm-building-blocks/{p-cede8095.entry.js → p-4e4d096c.entry.js} +1 -1
  232. package/dist/lime-crm-building-blocks/{p-51eb53ee.entry.js → p-54735042.entry.js} +1 -1
  233. package/dist/lime-crm-building-blocks/{p-c2899d68.entry.js → p-568c4e76.entry.js} +1 -1
  234. package/dist/lime-crm-building-blocks/{p-9907deb1.entry.js → p-584a48e4.entry.js} +1 -1
  235. package/dist/lime-crm-building-blocks/{p-ac4bddfc.entry.js → p-5b97d4f4.entry.js} +1 -1
  236. package/dist/lime-crm-building-blocks/p-615770be.entry.js +1 -0
  237. package/dist/lime-crm-building-blocks/{p-edfaf566.entry.js → p-6d8efe87.entry.js} +1 -1
  238. package/dist/lime-crm-building-blocks/p-705c53c0.entry.js +1 -0
  239. package/dist/lime-crm-building-blocks/{p-031b1648.entry.js → p-73f23d08.entry.js} +1 -1
  240. package/dist/lime-crm-building-blocks/{p-2baab674.entry.js → p-7c5ecffe.entry.js} +1 -1
  241. package/dist/lime-crm-building-blocks/{p-1fac8130.entry.js → p-7cd8dffd.entry.js} +1 -1
  242. package/dist/lime-crm-building-blocks/p-93af3e81.entry.js +1 -0
  243. package/dist/lime-crm-building-blocks/{p-247fcace.entry.js → p-97e2e5c9.entry.js} +1 -1
  244. package/dist/lime-crm-building-blocks/p-BCglve2Z.js +1 -0
  245. package/dist/lime-crm-building-blocks/p-BxCq236x.js +1 -0
  246. package/dist/lime-crm-building-blocks/p-a2b9c410.entry.js +1 -0
  247. package/dist/lime-crm-building-blocks/{p-f9f7020f.entry.js → p-a716b3a8.entry.js} +1 -1
  248. package/dist/lime-crm-building-blocks/p-b3529254.entry.js +1 -0
  249. package/dist/lime-crm-building-blocks/{p-2bfd351d.entry.js → p-b48d7d23.entry.js} +1 -1
  250. package/dist/lime-crm-building-blocks/{p-b373c60f.entry.js → p-b6807166.entry.js} +1 -1
  251. package/dist/lime-crm-building-blocks/{p-318369ae.entry.js → p-b6c2d93b.entry.js} +1 -1
  252. package/dist/lime-crm-building-blocks/{p-d82a2424.entry.js → p-c46802cd.entry.js} +1 -1
  253. package/dist/lime-crm-building-blocks/{p-9099b440.entry.js → p-c635f826.entry.js} +1 -1
  254. package/dist/lime-crm-building-blocks/{p-fec173db.entry.js → p-d816fcc8.entry.js} +1 -1
  255. package/dist/lime-crm-building-blocks/{p-4594c2b1.entry.js → p-d8ce3497.entry.js} +1 -1
  256. package/dist/lime-crm-building-blocks/{p-0f74d662.entry.js → p-d8d32cb1.entry.js} +1 -1
  257. package/dist/lime-crm-building-blocks/{p-99556fc0.entry.js → p-de7724f0.entry.js} +1 -1
  258. package/dist/lime-crm-building-blocks/{p-92403251.entry.js → p-e910963c.entry.js} +1 -1
  259. package/dist/lime-crm-building-blocks/{p-4274cbe3.entry.js → p-ea6ab8b0.entry.js} +1 -1
  260. package/dist/lime-crm-building-blocks/{p-eedbf69a.entry.js → p-ee7bd504.entry.js} +1 -1
  261. package/dist/lime-crm-building-blocks/{p-e1f35866.entry.js → p-f024c185.entry.js} +1 -1
  262. package/dist/lime-crm-building-blocks/{p-7bb2788b.entry.js → p-f102f169.entry.js} +1 -1
  263. package/dist/lime-crm-building-blocks/{p-2984005d.entry.js → p-f1060c88.entry.js} +1 -1
  264. package/dist/lime-crm-building-blocks/{p-17588c29.entry.js → p-f3905fa2.entry.js} +1 -1
  265. package/dist/lime-crm-building-blocks/{p-ac97c7cc.entry.js → p-fc372344.entry.js} +1 -1
  266. package/dist/types/components/condition-tree/condition-tree-combinators.d.ts +47 -0
  267. package/dist/types/components/condition-tree/condition-tree-editor/condition-tree-editor.d.ts +84 -0
  268. package/dist/types/components/condition-tree/condition-tree-nodes.d.ts +130 -0
  269. package/dist/types/components/condition-tree/condition-tree-open-state.d.ts +76 -0
  270. package/dist/types/components/condition-tree/condition-tree-translate.d.ts +11 -0
  271. package/dist/types/components/condition-tree/condition-tree-view-context.d.ts +48 -0
  272. package/dist/types/components/condition-tree/condition-tree.d.ts +177 -0
  273. package/dist/types/components/condition-tree/condition-tree.types.d.ts +323 -0
  274. package/dist/types/components/condition-tree/group-node-view.d.ts +30 -0
  275. package/dist/types/components/condition-tree/leaf-node-view.d.ts +21 -0
  276. package/dist/types/components/rule-editor/rule-editor-mode-view.d.ts +22 -0
  277. package/dist/types/components/rule-editor/rule-editor-modes.d.ts +43 -0
  278. package/dist/types/components/rule-editor/rule-editor.d.ts +129 -5
  279. package/dist/types/components/rule-editor/rule-editor.types.d.ts +16 -0
  280. package/dist/types/components.d.ts +412 -4
  281. package/dist/types/index.d.ts +2 -0
  282. package/dist/types/interface.d.ts +2 -0
  283. package/package.json +3 -3
  284. package/dist/lime-crm-building-blocks/p-1e83a491.entry.js +0 -1
  285. package/dist/lime-crm-building-blocks/p-73f79d42.entry.js +0 -1
  286. package/dist/lime-crm-building-blocks/p-761deada.entry.js +0 -1
  287. package/dist/lime-crm-building-blocks/p-b8d74591.entry.js +0 -1
  288. package/dist/lime-crm-building-blocks/p-e8a7a94c.entry.js +0 -1
@@ -0,0 +1,461 @@
1
+ import { Host, h, } from "@stencil/core";
2
+ import { CONDITION_TREE_COMBINATORS, oppositeCombinator, } from "./condition-tree-combinators";
3
+ import { ConditionTreeWalker } from "./condition-tree-nodes";
4
+ import { ConditionTreeOpenState } from "./condition-tree-open-state";
5
+ import { GroupView, NodeView } from "./group-node-view";
6
+ import { createTranslator } from "./condition-tree-translate";
7
+ /**
8
+ * The group drawn when there is no tree yet. Nothing is inside it, so no
9
+ * combinator is offered and there is nothing to delete or to group.
10
+ */
11
+ const EMPTY_GROUP = {
12
+ kind: 'group',
13
+ combinator: 'all',
14
+ children: [],
15
+ };
16
+ /**
17
+ * The shared skeleton for editing a tree of conditions: nested groups joined by
18
+ * "All of the following" or "Any of the following", or the negations of those
19
+ * two, each holding conditions shown as chips, with the buttons that add,
20
+ * remove and regroup them.
21
+ *
22
+ * This component is deliberately ignorant of what a condition *is*.
23
+ *
24
+ * A condition is visualized as a chip, plus the tag name of an editor to open.
25
+ * So the same skeleton serves a condition that tests a property ("Deal value is
26
+ * greater than 100 000") and one that is opaque ("User is a member of a group")
27
+ * without either model leaking into it.
28
+ *
29
+ * It holds no tree of its own either. The consumer passes in its own tree, and
30
+ * an adapter that reads one node and rebuilds one group. Every structural edit
31
+ * — add, delete, regroup, rejoin, negate — is applied here and handed back as a
32
+ * tree of the same kind, so no consumer has to write that code twice.
33
+ *
34
+ * @exampleComponent limebb-example-condition-tree-basic
35
+ * @exampleComponent limebb-example-condition-tree-combinators
36
+ * @exampleComponent limebb-example-condition-tree-editors
37
+ * @exampleComponent limebb-example-condition-tree-palette
38
+ *
39
+ * @beta
40
+ */
41
+ export class ConditionTree {
42
+ constructor() {
43
+ /**
44
+ * Which combinators to offer in the group dropdowns, in the order given.
45
+ *
46
+ * All four are offered by default. "Not all of the following" and "None of
47
+ * the following" are harder to reason about than the two they negate, so a
48
+ * consumer whose users would be better served without them passes
49
+ * `['all', 'any']`. A group that already uses a combinator left off this
50
+ * list still shows it, rather than misrepresenting itself as using one of
51
+ * the offered ones.
52
+ */
53
+ this.combinators = [
54
+ ...CONDITION_TREE_COMBINATORS,
55
+ ];
56
+ /**
57
+ * Set to `true` when the tree is not the viewer's to change: the add,
58
+ * delete and negate controls are not rendered at all, leaving the
59
+ * conditions to be read. Use it where the tree is being shown rather than
60
+ * edited — a saved filter summarized on a card, or a rule the viewer has
61
+ * no rights over.
62
+ */
63
+ this.readonly = false;
64
+ /**
65
+ * Set to `true` when the tree *is* the viewer's to change, but not at this
66
+ * moment: every control stays where it is, dimmed and inert. Use it for a
67
+ * state that will pass — a form mid-save, or a tree behind an "Apply a
68
+ * filter" switch that is currently off.
69
+ */
70
+ this.disabled = false;
71
+ /**
72
+ * Which editor is open, and what the user has already been through — see
73
+ * `condition-tree-open-state.ts`.
74
+ */
75
+ this.openState = ConditionTreeOpenState.empty();
76
+ }
77
+ componentWillLoad() {
78
+ this.buildWalker();
79
+ }
80
+ buildWalker() {
81
+ this.walker = new ConditionTreeWalker(this.adapter, (node) => this.openState.hasSeen(node));
82
+ this.syncOpenState();
83
+ }
84
+ /**
85
+ * Nothing can be read out of a tree until there is an adapter to read it
86
+ * with, so a tree that arrives first waits here. `buildWalker` catches it
87
+ * up when the adapter turns up.
88
+ */
89
+ syncOpenState() {
90
+ if (!this.adapter) {
91
+ return;
92
+ }
93
+ this.openState = this.openState.sync(this.value, this.walker);
94
+ }
95
+ render() {
96
+ if (!this.adapter) {
97
+ return h(Host, null);
98
+ }
99
+ return (h(Host, null, this.isEmpty ? (this.renderEmptyState()) : (h(NodeView, { node: this.value, description: this.walker.describe(this.value), path: [], ctx: this.renderContext() }))));
100
+ }
101
+ /**
102
+ * The empty tree is drawn as the group it is about to become, rather than
103
+ * as a lone button: every condition here ends up inside a group, so the
104
+ * first one lands in a frame that was already on screen instead of
105
+ * conjuring one around itself. It can be filled either way round, with a
106
+ * condition or with a nested group.
107
+ */
108
+ renderEmptyState() {
109
+ if (this.readonly) {
110
+ return null;
111
+ }
112
+ return (h(GroupView, { description: EMPTY_GROUP, path: [], ctx: this.renderContext(), placeholder: true }));
113
+ }
114
+ renderContext() {
115
+ return {
116
+ platform: this.platform,
117
+ context: this.context,
118
+ walker: this.walker,
119
+ translate: createTranslator(this.platform),
120
+ combinators: this.combinators,
121
+ readonly: this.readonly,
122
+ disabled: this.disabled,
123
+ negatable: !!this.adapter.negate,
124
+ openNode: this.openState.openNode,
125
+ addOptions: this.addOptions,
126
+ onAddLeaf: (path, item) => this.addLeaf(path, item),
127
+ onAddGroup: (path) => this.addGroup(path),
128
+ onDelete: (path) => this.applyEdit((root) => this.walker.replaceAt(root, path, undefined)),
129
+ onCombinator: (path, combinator) => this.applyEdit((root) => this.walker.rejoinAt(root, path, combinator)),
130
+ onNegate: (path, negated) => this.applyEdit((root) => this.walker.negateAt(root, path, negated)),
131
+ onConditionChange: (path, next) => {
132
+ this.openState = this.openState.expect(next);
133
+ this.applyEdit((root) => this.walker.replaceAt(root, path, next));
134
+ },
135
+ onOpen: (node) => {
136
+ this.openState = this.openState.moveTo(node);
137
+ },
138
+ };
139
+ }
140
+ addLeaf(path, item) {
141
+ this.grow(path, this.adapter.createLeaf(item));
142
+ }
143
+ /**
144
+ * A nested group is joined the other way round from the one holding it: a
145
+ * group joined the same way as its parent would say nothing the parent does
146
+ * not already say.
147
+ * @param path
148
+ */
149
+ addGroup(path) {
150
+ var _a, _b;
151
+ const combinator = (_b = (_a = this.walker.groupAt(this.value, path)) === null || _a === void 0 ? void 0 : _a.combinator) !== null && _b !== void 0 ? _b : this.rootCombinator();
152
+ this.grow(path, this.adapter.group(oppositeCombinator(combinator), this.newGroupChildren()));
153
+ }
154
+ /**
155
+ * What a new group starts with: one blank condition, so that a group is
156
+ * never handed over saying nothing — the same rule by which a group emptied
157
+ * of its last condition is dropped rather than kept. A consumer offering a
158
+ * menu of kinds is the exception, since the tree cannot know which kind to
159
+ * make.
160
+ */
161
+ newGroupChildren() {
162
+ var _a;
163
+ if ((_a = this.addOptions) === null || _a === void 0 ? void 0 : _a.length) {
164
+ return [];
165
+ }
166
+ return [this.adapter.createLeaf()];
167
+ }
168
+ /**
169
+ * Add a condition, or a group to put conditions in.
170
+ *
171
+ * Everything in this tree lives inside a group, so the first thing added
172
+ * to an empty one gets a root group to live in. After that the walker
173
+ * places it.
174
+ * @param path
175
+ * @param child
176
+ */
177
+ grow(path, child) {
178
+ if (this.isEmpty) {
179
+ this.emitChange(this.adapter.group(this.rootCombinator(), [child]));
180
+ return;
181
+ }
182
+ this.emitChange(this.walker.appendAt(this.value, path, child));
183
+ }
184
+ /**
185
+ * An empty tree has nothing to edit.
186
+ * @param edit
187
+ */
188
+ applyEdit(edit) {
189
+ if (this.isEmpty) {
190
+ return;
191
+ }
192
+ this.emitChange(edit(this.value));
193
+ }
194
+ /**
195
+ * Announce a tree the user has changed — unless it was not theirs to
196
+ * change. Every control is hidden or dimmed by then, so what this catches
197
+ * is an editor: the tree mounts whatever component a condition names, and
198
+ * has no way to make it honour the `readonly` it was handed.
199
+ * @param next
200
+ */
201
+ emitChange(next) {
202
+ if (this.readonly || this.disabled) {
203
+ return;
204
+ }
205
+ this.change.emit(next);
206
+ }
207
+ /**
208
+ * Whether there is no tree yet — which is not the same as a tree that
209
+ * happens to be an empty group.
210
+ */
211
+ get isEmpty() {
212
+ return this.value === undefined || this.value === null;
213
+ }
214
+ /**
215
+ * The combinator a group made here is joined by: the first one the consumer
216
+ * offers, so a tree that never offers "All of the following" never invents
217
+ * one.
218
+ */
219
+ rootCombinator() {
220
+ var _a;
221
+ return (_a = this.combinators[0]) !== null && _a !== void 0 ? _a : 'all';
222
+ }
223
+ static get is() { return "limebb-condition-tree"; }
224
+ static get encapsulation() { return "shadow"; }
225
+ static get originalStyleUrls() {
226
+ return {
227
+ "$": ["condition-tree.scss"]
228
+ };
229
+ }
230
+ static get styleUrls() {
231
+ return {
232
+ "$": ["condition-tree.css"]
233
+ };
234
+ }
235
+ static get properties() {
236
+ return {
237
+ "platform": {
238
+ "type": "unknown",
239
+ "mutable": false,
240
+ "complexType": {
241
+ "original": "LimeWebComponentPlatform",
242
+ "resolved": "LimeWebComponentPlatform",
243
+ "references": {
244
+ "LimeWebComponentPlatform": {
245
+ "location": "import",
246
+ "path": "@limetech/lime-web-components",
247
+ "id": "node_modules::LimeWebComponentPlatform",
248
+ "referenceLocation": "LimeWebComponentPlatform"
249
+ }
250
+ }
251
+ },
252
+ "required": false,
253
+ "optional": false,
254
+ "docs": {
255
+ "tags": [],
256
+ "text": "Platform service provider"
257
+ },
258
+ "getter": false,
259
+ "setter": false
260
+ },
261
+ "context": {
262
+ "type": "unknown",
263
+ "mutable": false,
264
+ "complexType": {
265
+ "original": "LimeWebComponentContext",
266
+ "resolved": "LimeWebComponentContext",
267
+ "references": {
268
+ "LimeWebComponentContext": {
269
+ "location": "import",
270
+ "path": "@limetech/lime-web-components",
271
+ "id": "node_modules::LimeWebComponentContext",
272
+ "referenceLocation": "LimeWebComponentContext"
273
+ }
274
+ }
275
+ },
276
+ "required": false,
277
+ "optional": false,
278
+ "docs": {
279
+ "tags": [],
280
+ "text": "Component context, forwarded to each condition's editor."
281
+ },
282
+ "getter": false,
283
+ "setter": false
284
+ },
285
+ "value": {
286
+ "type": "any",
287
+ "mutable": false,
288
+ "complexType": {
289
+ "original": "any",
290
+ "resolved": "any",
291
+ "references": {}
292
+ },
293
+ "required": false,
294
+ "optional": true,
295
+ "docs": {
296
+ "tags": [],
297
+ "text": "The consumer's own tree, rendered as-is \u2014 the root node, in whatever\nshape `adapter` reads. Leave it unset for a tree with nothing in it yet,\nwhich draws an empty group asking for its first condition."
298
+ },
299
+ "getter": false,
300
+ "setter": false,
301
+ "reflect": false,
302
+ "attribute": "value"
303
+ },
304
+ "adapter": {
305
+ "type": "unknown",
306
+ "mutable": false,
307
+ "complexType": {
308
+ "original": "ConditionTreeAdapter<any>",
309
+ "resolved": "ConditionTreeAdapter<any>",
310
+ "references": {
311
+ "ConditionTreeAdapter": {
312
+ "location": "import",
313
+ "path": "./condition-tree.types",
314
+ "id": "src/components/condition-tree/condition-tree.types.ts::ConditionTreeAdapter",
315
+ "referenceLocation": "ConditionTreeAdapter"
316
+ }
317
+ }
318
+ },
319
+ "required": false,
320
+ "optional": false,
321
+ "docs": {
322
+ "tags": [],
323
+ "text": "How to read and rebuild `value`. Build it once and hold on to it: one\nbuilt inside a consumer's `render()` is a new object every time, which\nmakes this component re-render for no reason.\n\nA Stencil element cannot be generic, so this is typed loosely here.\nDeclare the adapter as `ConditionTreeAdapter<YourNode>` where you write\nit, and the compiler checks it against your own model."
324
+ },
325
+ "getter": false,
326
+ "setter": false
327
+ },
328
+ "combinators": {
329
+ "type": "unknown",
330
+ "mutable": false,
331
+ "complexType": {
332
+ "original": "ConditionTreeCombinator[]",
333
+ "resolved": "ConditionTreeCombinator[]",
334
+ "references": {
335
+ "ConditionTreeCombinator": {
336
+ "location": "import",
337
+ "path": "./condition-tree.types",
338
+ "id": "src/components/condition-tree/condition-tree.types.ts::ConditionTreeCombinator",
339
+ "referenceLocation": "ConditionTreeCombinator"
340
+ }
341
+ }
342
+ },
343
+ "required": false,
344
+ "optional": false,
345
+ "docs": {
346
+ "tags": [],
347
+ "text": "Which combinators to offer in the group dropdowns, in the order given.\n\nAll four are offered by default. \"Not all of the following\" and \"None of\nthe following\" are harder to reason about than the two they negate, so a\nconsumer whose users would be better served without them passes\n`['all', 'any']`. A group that already uses a combinator left off this\nlist still shows it, rather than misrepresenting itself as using one of\nthe offered ones."
348
+ },
349
+ "getter": false,
350
+ "setter": false,
351
+ "defaultValue": "[\n ...CONDITION_TREE_COMBINATORS,\n ]"
352
+ },
353
+ "addOptions": {
354
+ "type": "unknown",
355
+ "mutable": false,
356
+ "complexType": {
357
+ "original": "Array<MenuItem | ListSeparator>",
358
+ "resolved": "(ListSeparator | MenuItem<any>)[] | undefined",
359
+ "references": {
360
+ "Array": {
361
+ "location": "global",
362
+ "id": "global::Array"
363
+ },
364
+ "MenuItem": {
365
+ "location": "import",
366
+ "path": "@limetech/lime-elements",
367
+ "id": "node_modules::MenuItem",
368
+ "referenceLocation": "MenuItem"
369
+ },
370
+ "ListSeparator": {
371
+ "location": "import",
372
+ "path": "@limetech/lime-elements",
373
+ "id": "node_modules::ListSeparator",
374
+ "referenceLocation": "ListSeparator"
375
+ }
376
+ }
377
+ },
378
+ "required": false,
379
+ "optional": true,
380
+ "docs": {
381
+ "tags": [],
382
+ "text": "The kinds of condition a user can add, offered as a menu when the add\nbutton is pressed. The chosen item is passed to `adapter.createLeaf`.\n\nLeave it unset when every condition in the tree is of the same kind:\na blank one can simply be inserted, and its editor settles the rest, so\npressing the button is the whole interaction. Set it when conditions come\nin kinds that have nothing in common \u2014 \"the deal is worth more than\n100 000\", \"the user belongs to a group\", \"it is the first day of the\nmonth\" \u2014 where nothing can be inserted until the user says which.\n\nThe menu has to be rendered here rather than by the consumer, because\nthe button it hangs from lives inside this component."
383
+ },
384
+ "getter": false,
385
+ "setter": false
386
+ },
387
+ "readonly": {
388
+ "type": "boolean",
389
+ "mutable": false,
390
+ "complexType": {
391
+ "original": "boolean",
392
+ "resolved": "boolean",
393
+ "references": {}
394
+ },
395
+ "required": false,
396
+ "optional": false,
397
+ "docs": {
398
+ "tags": [],
399
+ "text": "Set to `true` when the tree is not the viewer's to change: the add,\ndelete and negate controls are not rendered at all, leaving the\nconditions to be read. Use it where the tree is being shown rather than\nedited \u2014 a saved filter summarized on a card, or a rule the viewer has\nno rights over."
400
+ },
401
+ "getter": false,
402
+ "setter": false,
403
+ "reflect": true,
404
+ "attribute": "readonly",
405
+ "defaultValue": "false"
406
+ },
407
+ "disabled": {
408
+ "type": "boolean",
409
+ "mutable": false,
410
+ "complexType": {
411
+ "original": "boolean",
412
+ "resolved": "boolean",
413
+ "references": {}
414
+ },
415
+ "required": false,
416
+ "optional": false,
417
+ "docs": {
418
+ "tags": [],
419
+ "text": "Set to `true` when the tree *is* the viewer's to change, but not at this\nmoment: every control stays where it is, dimmed and inert. Use it for a\nstate that will pass \u2014 a form mid-save, or a tree behind an \"Apply a\nfilter\" switch that is currently off."
420
+ },
421
+ "getter": false,
422
+ "setter": false,
423
+ "reflect": true,
424
+ "attribute": "disabled",
425
+ "defaultValue": "false"
426
+ }
427
+ };
428
+ }
429
+ static get states() {
430
+ return {
431
+ "openState": {}
432
+ };
433
+ }
434
+ static get events() {
435
+ return [{
436
+ "method": "change",
437
+ "name": "change",
438
+ "bubbles": true,
439
+ "cancelable": true,
440
+ "composed": true,
441
+ "docs": {
442
+ "tags": [],
443
+ "text": "Emitted with the whole tree, of the consumer's own kind, whenever the\nuser changes it. `null` means the last condition went and there is\nnothing left \u2014 an event carries no detail otherwise."
444
+ },
445
+ "complexType": {
446
+ "original": "any",
447
+ "resolved": "any",
448
+ "references": {}
449
+ }
450
+ }];
451
+ }
452
+ static get watchers() {
453
+ return [{
454
+ "propName": "adapter",
455
+ "methodName": "buildWalker"
456
+ }, {
457
+ "propName": "value",
458
+ "methodName": "syncOpenState"
459
+ }];
460
+ }
461
+ }
@@ -0,0 +1,153 @@
1
+ import { h } from "@stencil/core";
2
+ import { COMBINATOR_PRESENTATION } from "./condition-tree-combinators";
3
+ import { pathKey } from "./condition-tree-nodes";
4
+ import { handleDelete, IssuesView, } from "./condition-tree-view-context";
5
+ import { LeafView } from "./leaf-node-view";
6
+ /**
7
+ * Render one of the consumer's nodes, whichever kind the adapter says it is.
8
+ *
9
+ * It lives beside `GroupView` because a group is what holds nodes of either
10
+ * kind: the recursion is the group's, and keeping the choice here is what lets
11
+ * a group draw a group without two modules importing each other.
12
+ * @param props
13
+ */
14
+ export const NodeView = (props) => {
15
+ const { description } = props;
16
+ if (description.kind === 'group') {
17
+ return (h(GroupView, { description: description, path: props.path, ctx: props.ctx }));
18
+ }
19
+ return (h(LeafView, { node: props.node, description: description, path: props.path, ctx: props.ctx }));
20
+ };
21
+ /**
22
+ * A box holding a combinator, the conditions joined by it, and the two buttons
23
+ * that grow it.
24
+ * @param props
25
+ */
26
+ export const GroupView = (props) => {
27
+ const { description, path, ctx, placeholder } = props;
28
+ const presentation = COMBINATOR_PRESENTATION[description.combinator];
29
+ const delimiter = ctx.translate(presentation.delimiterKey, presentation.delimiter);
30
+ // The marker between two rows reads as the join itself: "&", "or", and
31
+ // for the negated combinators the same joins prefixed with "not".
32
+ const marker = presentation.negated
33
+ ? `${ctx.translate('webclient.delimiter.not', 'not')} ${delimiter}`
34
+ : delimiter;
35
+ return (h("div", { class: "group", key: pathKey(path), "data-combinator": description.combinator, style: { '--group-rail-color': presentation.color } }, h("div", { class: "group-header" }, renderCombinator(description, path, ctx), renderDeleteGroup(path, ctx, placeholder)), h(IssuesView, { issues: description.issues }), h("ul", { class: "rows" }, description.children.map((child, index) => {
36
+ const childDescription = ctx.walker.describe(child);
37
+ return (h("li", { class: {
38
+ row: true,
39
+ 'row--group': childDescription.kind === 'group',
40
+ }, "data-marker": marker, key: pathKey([...path, index]) }, h(NodeView, { node: child, description: childDescription, path: [...path, index], ctx: ctx })));
41
+ }), renderAddCondition(path, marker, ctx)), renderAddGroup(path, ctx)));
42
+ };
43
+ /**
44
+ * The "+" that turns a noun into an action.
45
+ *
46
+ * The chips and buttons that grow the tree read as "+ Condition" and
47
+ * "+ Group": a sighted reader takes the glyph as the verb, so the label only
48
+ * has to carry the noun. A screen reader cannot — an icon without a `title`
49
+ * is hidden from it entirely, leaving nothing but a bare "Condition". The
50
+ * title supplies the missing verb, and lime-elements composes the two into
51
+ * "Add Condition" for assistive technology and for the tooltip alike.
52
+ *
53
+ * This is why the translated strings behind these are nouns, and must stay
54
+ * nouns: the verb lives here.
55
+ * @param ctx
56
+ * @param color
57
+ */
58
+ function addIcon(ctx, color) {
59
+ return {
60
+ name: 'plus_math',
61
+ title: ctx.translate('webclient.add', 'Add'),
62
+ color: color,
63
+ };
64
+ }
65
+ /**
66
+ * The combinators to list, which is what the consumer offers — plus the one the
67
+ * group already uses, when that is not among them. A group saved before the
68
+ * consumer narrowed the list has to keep saying what it does, rather than
69
+ * misrepresenting itself as using one of the offered ones.
70
+ * @param ctx
71
+ * @param current
72
+ */
73
+ function combinatorOptions(ctx, current) {
74
+ const combinators = [...ctx.combinators];
75
+ if (current && !combinators.includes(current)) {
76
+ combinators.push(current);
77
+ }
78
+ return combinators.map((combinator) => {
79
+ const presentation = COMBINATOR_PRESENTATION[combinator];
80
+ return {
81
+ value: combinator,
82
+ text: ctx.translate(presentation.labelKey, presentation.label),
83
+ secondaryText: ctx.translate(presentation.descriptionKey, presentation.description),
84
+ icon: {
85
+ name: presentation.iconName,
86
+ color: presentation.color,
87
+ },
88
+ };
89
+ });
90
+ }
91
+ /**
92
+ * The dropdown that says how a group joins what is inside it.
93
+ *
94
+ * A group holding fewer than two things has nothing to join yet, so choosing
95
+ * between "All of the following" and "Any of the following" would change
96
+ * nothing, and the dropdown is left out until there is a second thing for it to
97
+ * act on. A negating combinator is the exception: "None of the following" says
98
+ * something about a lone condition that "All of the following" does not, so
99
+ * leaving it out would leave out the negation with it.
100
+ * @param description
101
+ * @param path
102
+ * @param ctx
103
+ */
104
+ function renderCombinator(description, path, ctx) {
105
+ const joins = description.children.length > 1;
106
+ if (!joins && !COMBINATOR_PRESENTATION[description.combinator].negated) {
107
+ return null;
108
+ }
109
+ const options = combinatorOptions(ctx, description.combinator);
110
+ // No label: every option is a full sentence about the group ("All of the
111
+ // following"), so a label above it could only name the same thing twice.
112
+ // The accessible name comes from the selected option for the same reason.
113
+ return (h("limel-select", { class: "combinator", value: options.find((option) => option.value === description.combinator), options: options, disabled: ctx.disabled, readonly: ctx.readonly, onChange: handleCombinator(path, ctx) }));
114
+ }
115
+ function renderDeleteGroup(path, ctx, placeholder) {
116
+ if (ctx.readonly) {
117
+ return null;
118
+ }
119
+ return (h("limel-icon-button", { class: "delete-group", icon: "trash", label: ctx.translate('webclient.delete-group', 'Delete this group'), disabled: ctx.disabled || !!placeholder, onClick: handleDelete(path, ctx) }));
120
+ }
121
+ function renderAddCondition(path, marker, ctx) {
122
+ var _a;
123
+ if (ctx.readonly) {
124
+ return null;
125
+ }
126
+ const offersChoice = !!((_a = ctx.addOptions) === null || _a === void 0 ? void 0 : _a.length);
127
+ const chip = (h("limel-chip", { slot: offersChoice ? 'trigger' : undefined, class: "add-condition", text: ctx.translate('webclient.condition', 'Condition'), disabled: ctx.disabled, icon: addIcon(ctx), onClick: offersChoice ? undefined : handleAddLeaf(path, ctx) }));
128
+ // A row of its own rather than a bare chip, so that the join between it
129
+ // and the condition before it is drawn by the same rule that joins any two
130
+ // rows: the button is where the next condition goes, and it reads as part
131
+ // of the sequence — "Won or 100000 or + Condition".
132
+ return (h("li", { class: "row", "data-marker": marker, key: `${pathKey(path)}.add` }, offersChoice ? (h("limel-menu", { class: "add-condition-menu", items: ctx.addOptions, openDirection: "bottom-start", onSelect: handleAddLeafPick(path, ctx) }, chip)) : (chip)));
133
+ }
134
+ function renderAddGroup(path, ctx) {
135
+ if (ctx.readonly) {
136
+ return null;
137
+ }
138
+ return (h("limel-chip", { class: "add-group", size: "small", text: ctx.translate('webclient.group', 'Group'), disabled: ctx.disabled, icon: addIcon(ctx, 'var(--group-rail-color)'), onClick: handleAddGroup(path, ctx) }));
139
+ }
140
+ const handleCombinator = (path, ctx) => (event) => {
141
+ var _a;
142
+ event.stopPropagation();
143
+ const combinator = (_a = event.detail) === null || _a === void 0 ? void 0 : _a.value;
144
+ if (combinator) {
145
+ ctx.onCombinator(path, combinator);
146
+ }
147
+ };
148
+ const handleAddLeaf = (path, ctx) => () => ctx.onAddLeaf(path);
149
+ const handleAddLeafPick = (path, ctx) => (event) => {
150
+ event.stopPropagation();
151
+ ctx.onAddLeaf(path, event.detail);
152
+ };
153
+ const handleAddGroup = (path, ctx) => () => ctx.onAddGroup(path);