@limetech/lime-crm-building-blocks 2.0.3 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/cjs/condition-tree-translate-B_qIQz9s.js +27 -0
- package/dist/cjs/lime-crm-building-blocks.cjs.js +1 -1
- package/dist/cjs/limebb-alert-dialog.cjs.entry.js +1 -1
- package/dist/cjs/limebb-browser.cjs.entry.js +2 -2
- package/dist/cjs/limebb-chat-icon-list_3.cjs.entry.js +12 -5
- package/dist/cjs/limebb-chat-list.cjs.entry.js +1 -1
- package/dist/cjs/limebb-color-palette-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-color-palette-swatches.cjs.entry.js +1 -1
- package/dist/cjs/limebb-composer-toolbar.cjs.entry.js +2 -2
- package/dist/cjs/limebb-condition-tree-editor.cjs.entry.js +90 -0
- package/dist/cjs/limebb-condition-tree.cjs.entry.js +882 -0
- package/dist/cjs/limebb-currency-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-dashboard-widget.cjs.entry.js +1 -1
- package/dist/cjs/limebb-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-date-range.cjs.entry.js +1 -1
- package/dist/cjs/limebb-document-chips.cjs.entry.js +1 -1
- package/dist/cjs/limebb-document-item.cjs.entry.js +2 -2
- package/dist/cjs/limebb-document-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-feed-item-thumbnail-file-info.cjs.entry.js +1 -1
- package/dist/cjs/limebb-feed-timeline-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-feed.cjs.entry.js +1 -1
- package/dist/cjs/limebb-filter-chip_6.cjs.entry.js +7 -7
- package/dist/cjs/limebb-icon-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-info-tile-format.cjs.entry.js +1 -1
- package/dist/cjs/limebb-info-tile.cjs.entry.js +1 -1
- package/dist/cjs/limebb-kanban-group.cjs.entry.js +1 -1
- package/dist/cjs/limebb-kanban-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +1 -1
- package/dist/cjs/limebb-lime-query-filter-comparison_2.cjs.entry.js +2 -2
- package/dist/cjs/limebb-lime-query-order-by-editor_2.cjs.entry.js +2 -2
- package/dist/cjs/limebb-lime-query-order-by-item.cjs.entry.js +2 -2
- package/dist/cjs/limebb-lime-query-response-format-builder.cjs.entry.js +1 -1
- package/dist/cjs/limebb-lime-query-response-format-editor_2.cjs.entry.js +1 -1
- package/dist/cjs/limebb-live-docs-info.cjs.entry.js +2 -2
- package/dist/cjs/limebb-locale-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-mention-group-counter.cjs.entry.js +2 -2
- package/dist/cjs/limebb-navigation-button_2.cjs.entry.js +2 -2
- package/dist/cjs/limebb-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-percentage-visualizer.cjs.entry.js +2 -2
- package/dist/cjs/limebb-rule-chip-popover.cjs.entry.js +2 -2
- package/dist/cjs/limebb-rule-editor.cjs.entry.js +4 -4
- package/dist/cjs/limebb-rule-gate.cjs.entry.js +1 -1
- package/dist/cjs/limebb-text-editor.cjs.entry.js +1 -1
- package/dist/cjs/limebb-trend-indicator.cjs.entry.js +1 -1
- package/dist/cjs/limebb-value-comparison-editor.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/alert-dialog/alert-dialog.js +1 -1
- package/dist/collection/components/browser/browser.js +2 -2
- package/dist/collection/components/chat-list/chat-icon-list/chat-icon-list.js +1 -1
- package/dist/collection/components/chat-list/chat-item/chat-item.css +4 -1
- package/dist/collection/components/chat-list/chat-item/chat-item.js +9 -2
- package/dist/collection/components/chat-list/chat-list.js +1 -1
- package/dist/collection/components/chat-list/typing-indicator/typing-indicator.js +1 -1
- package/dist/collection/components/color-palette-picker/color-palette-picker.js +1 -1
- package/dist/collection/components/color-palette-picker/color-palette-swatches/color-palette-swatches.js +1 -1
- package/dist/collection/components/composer-toolbar/composer-toolbar.js +2 -2
- package/dist/collection/components/condition-tree/condition-tree-combinators.js +78 -0
- package/dist/collection/components/condition-tree/condition-tree-editor/condition-tree-editor.css +17 -0
- package/dist/collection/components/condition-tree/condition-tree-editor/condition-tree-editor.js +333 -0
- package/dist/collection/components/condition-tree/condition-tree-nodes.js +218 -0
- package/dist/collection/components/condition-tree/condition-tree-open-state.js +127 -0
- package/dist/collection/components/condition-tree/condition-tree-translate.js +22 -0
- package/dist/collection/components/condition-tree/condition-tree-view-context.js +22 -0
- package/dist/collection/components/condition-tree/condition-tree.css +132 -0
- package/dist/collection/components/condition-tree/condition-tree.js +461 -0
- package/dist/collection/components/condition-tree/condition-tree.types.js +1 -0
- package/dist/collection/components/condition-tree/group-node-view.js +153 -0
- package/dist/collection/components/condition-tree/leaf-node-view.js +74 -0
- package/dist/collection/components/currency-picker/currency-picker.js +1 -1
- package/dist/collection/components/dashboard-widget/dashboard-widget.js +1 -1
- package/dist/collection/components/date-picker/date-picker.js +1 -1
- package/dist/collection/components/date-range/date-range.js +1 -1
- package/dist/collection/components/document-chips/document-chips.js +1 -1
- package/dist/collection/components/document-picker/document-item/document-item.js +2 -2
- package/dist/collection/components/document-picker/document-picker.js +1 -1
- package/dist/collection/components/feed/feed-item/feed-timeline-item.js +1 -1
- package/dist/collection/components/feed/feed-item-thumbnail-file-info/feed-item-thumbnail-file-info.js +1 -1
- package/dist/collection/components/feed/feed.js +1 -1
- package/dist/collection/components/filter-chip/filter-chip.js +2 -2
- package/dist/collection/components/filter-condition-picker/filter-condition-picker.js +1 -1
- package/dist/collection/components/icon-picker/icon-picker.js +1 -1
- package/dist/collection/components/info-tile/format/config/info-tile-format.js +1 -1
- package/dist/collection/components/info-tile/info-tile.js +1 -1
- package/dist/collection/components/kanban/kanban-group/kanban-group.js +1 -1
- package/dist/collection/components/kanban/kanban-item/kanban-item.js +1 -1
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-comparison-editor.js +1 -1
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-comparison.js +2 -2
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.js +2 -2
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-not.js +1 -1
- package/dist/collection/components/lime-query-builder/lime-query-builder.js +1 -1
- package/dist/collection/components/lime-query-builder/lime-query-response-format-builder.js +1 -1
- package/dist/collection/components/lime-query-builder/limetype-field/limetype-field.js +1 -1
- package/dist/collection/components/lime-query-builder/order-by/order-by-editor.js +1 -1
- package/dist/collection/components/lime-query-builder/order-by/order-by-item.js +2 -2
- package/dist/collection/components/lime-query-builder/response-format/response-format-item.js +1 -1
- package/dist/collection/components/limeobject/file-viewer/live-docs-info.js +2 -2
- package/dist/collection/components/locale-picker/locale-picker.js +1 -1
- package/dist/collection/components/notification-list/notification-item/notification-item.js +1 -1
- package/dist/collection/components/percentage-visualizer/percentage-visualizer.js +2 -2
- package/dist/collection/components/rule-editor/group-node-view.js +3 -3
- package/dist/collection/components/rule-editor/rule-chip-popover/rule-chip-popover.js +2 -2
- package/dist/collection/components/rule-editor/rule-editor.js +1 -1
- package/dist/collection/components/rule-editor/value-comparison-editor/value-comparison-editor.js +1 -1
- package/dist/collection/components/rule-gate/rule-gate.js +1 -1
- package/dist/collection/components/summary-popover/summary-popover.js +2 -2
- package/dist/collection/components/text-editor/mention-group-counter.js +2 -2
- package/dist/collection/components/text-editor/text-editor.js +1 -1
- package/dist/collection/components/trend-indicator/trend-indicator.js +1 -1
- package/dist/components/chat-icon-list.js +1 -1
- package/dist/components/chat-item.js +1 -1
- package/dist/components/condition-tree-editor.js +1 -0
- package/dist/components/currency-picker.js +1 -1
- package/dist/components/date-picker.js +1 -1
- package/dist/components/document-item.js +1 -1
- package/dist/components/feed-item-thumbnail-file-info.js +1 -1
- package/dist/components/feed-timeline-item.js +1 -1
- package/dist/components/filter-chip.js +1 -1
- package/dist/components/filter-condition-picker.js +1 -1
- package/dist/components/kanban-group.js +1 -1
- package/dist/components/kanban-item.js +1 -1
- package/dist/components/lime-query-filter-comparison-editor.js +1 -1
- package/dist/components/lime-query-filter-comparison.js +1 -1
- package/dist/components/lime-query-filter-expression.js +1 -1
- package/dist/components/limebb-alert-dialog.js +1 -1
- package/dist/components/limebb-browser.js +1 -1
- package/dist/components/limebb-chat-list.js +1 -1
- package/dist/components/limebb-color-palette-picker.js +1 -1
- package/dist/components/limebb-color-palette-swatches.js +1 -1
- package/dist/components/limebb-composer-toolbar.js +1 -1
- package/dist/components/limebb-condition-tree-editor.d.ts +11 -0
- package/dist/components/limebb-condition-tree-editor.js +1 -0
- package/dist/components/limebb-condition-tree.d.ts +11 -0
- package/dist/components/limebb-condition-tree.js +1 -0
- package/dist/components/limebb-dashboard-widget.js +1 -1
- package/dist/components/limebb-date-range.js +1 -1
- package/dist/components/limebb-document-chips.js +1 -1
- package/dist/components/limebb-document-picker.js +1 -1
- package/dist/components/limebb-feed.js +1 -1
- package/dist/components/limebb-icon-picker.js +1 -1
- package/dist/components/limebb-info-tile-format.js +1 -1
- package/dist/components/limebb-info-tile.js +1 -1
- package/dist/components/limebb-lime-query-builder.js +1 -1
- package/dist/components/limebb-lime-query-response-format-builder.js +1 -1
- package/dist/components/limebb-locale-picker.js +1 -1
- package/dist/components/limebb-mention-group-counter.js +1 -1
- package/dist/components/limebb-rule-editor.js +1 -1
- package/dist/components/limebb-rule-gate.js +1 -1
- package/dist/components/limebb-text-editor.js +1 -1
- package/dist/components/limebb-trend-indicator.js +1 -1
- package/dist/components/limebb-value-comparison-editor.js +1 -1
- package/dist/components/limetype-field.js +1 -1
- package/dist/components/live-docs-info.js +1 -1
- package/dist/components/notification-item.js +1 -1
- package/dist/components/order-by-editor.js +1 -1
- package/dist/components/order-by-item.js +1 -1
- package/dist/components/percentage-visualizer.js +1 -1
- package/dist/components/response-format-item.js +1 -1
- package/dist/components/rule-chip-popover.js +1 -1
- package/dist/components/summary-popover.js +1 -1
- package/dist/components/typing-indicator.js +1 -1
- package/dist/esm/condition-tree-translate-CBeXbZ_z.js +25 -0
- package/dist/esm/lime-crm-building-blocks.js +1 -1
- package/dist/esm/limebb-alert-dialog.entry.js +1 -1
- package/dist/esm/limebb-browser.entry.js +2 -2
- package/dist/esm/limebb-chat-icon-list_3.entry.js +12 -5
- package/dist/esm/limebb-chat-list.entry.js +1 -1
- package/dist/esm/limebb-color-palette-picker.entry.js +1 -1
- package/dist/esm/limebb-color-palette-swatches.entry.js +1 -1
- package/dist/esm/limebb-composer-toolbar.entry.js +2 -2
- package/dist/esm/limebb-condition-tree-editor.entry.js +88 -0
- package/dist/esm/limebb-condition-tree.entry.js +880 -0
- package/dist/esm/limebb-currency-picker.entry.js +1 -1
- package/dist/esm/limebb-dashboard-widget.entry.js +1 -1
- package/dist/esm/limebb-date-picker.entry.js +1 -1
- package/dist/esm/limebb-date-range.entry.js +1 -1
- package/dist/esm/limebb-document-chips.entry.js +1 -1
- package/dist/esm/limebb-document-item.entry.js +2 -2
- package/dist/esm/limebb-document-picker.entry.js +1 -1
- package/dist/esm/limebb-feed-item-thumbnail-file-info.entry.js +1 -1
- package/dist/esm/limebb-feed-timeline-item.entry.js +1 -1
- package/dist/esm/limebb-feed.entry.js +1 -1
- package/dist/esm/limebb-filter-chip_6.entry.js +7 -7
- package/dist/esm/limebb-icon-picker.entry.js +1 -1
- package/dist/esm/limebb-info-tile-format.entry.js +1 -1
- package/dist/esm/limebb-info-tile.entry.js +1 -1
- package/dist/esm/limebb-kanban-group.entry.js +1 -1
- package/dist/esm/limebb-kanban-item.entry.js +1 -1
- package/dist/esm/limebb-lime-query-builder.entry.js +1 -1
- package/dist/esm/limebb-lime-query-filter-comparison_2.entry.js +2 -2
- package/dist/esm/limebb-lime-query-order-by-editor_2.entry.js +2 -2
- package/dist/esm/limebb-lime-query-order-by-item.entry.js +2 -2
- package/dist/esm/limebb-lime-query-response-format-builder.entry.js +1 -1
- package/dist/esm/limebb-lime-query-response-format-editor_2.entry.js +1 -1
- package/dist/esm/limebb-live-docs-info.entry.js +2 -2
- package/dist/esm/limebb-locale-picker.entry.js +1 -1
- package/dist/esm/limebb-mention-group-counter.entry.js +2 -2
- package/dist/esm/limebb-navigation-button_2.entry.js +2 -2
- package/dist/esm/limebb-notification-item.entry.js +1 -1
- package/dist/esm/limebb-percentage-visualizer.entry.js +2 -2
- package/dist/esm/limebb-rule-chip-popover.entry.js +2 -2
- package/dist/esm/limebb-rule-editor.entry.js +4 -4
- package/dist/esm/limebb-rule-gate.entry.js +1 -1
- package/dist/esm/limebb-text-editor.entry.js +1 -1
- package/dist/esm/limebb-trend-indicator.entry.js +1 -1
- package/dist/esm/limebb-value-comparison-editor.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/{p-73f23d08.entry.js → p-031b1648.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-d8d32cb1.entry.js → p-0f74d662.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-242ed59b.entry.js → p-11b41423.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-1578c8f0.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-7a9d7d87.entry.js → p-1731f5c3.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-956e466d.entry.js → p-17588c29.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-7cd8dffd.entry.js → p-1fac8130.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-f1060c88.entry.js → p-2984005d.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-080a1166.entry.js → p-2baab674.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-02fba38e.entry.js → p-2f8540ab.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-848462ee.entry.js → p-318369ae.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-ac13feb9.entry.js → p-3c72400d.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-79bb58b0.entry.js → p-3fe4f3f4.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-f9b1cd5e.entry.js → p-4274cbe3.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-4594c2b1.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-abe751c0.entry.js → p-51eb53ee.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-78118c62.entry.js → p-5b000748.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-7ccca5e4.entry.js → p-5b80d92a.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-705c53c0.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-170ab4be.entry.js → p-76064593.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-4f0939e6.entry.js → p-761deada.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-d071bd2d.entry.js → p-9099b440.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-e910963c.entry.js → p-92403251.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-584a48e4.entry.js → p-9907deb1.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-5268fc02.entry.js → p-99556fc0.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-BxCq236x.js +1 -0
- package/dist/lime-crm-building-blocks/{p-3c3009e3.entry.js → p-a0dee52a.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-40cb2c7c.entry.js → p-b373c60f.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-bd89279d.entry.js → p-b46722c8.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-56d125c7.entry.js → p-b48c23f4.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-43dfbefb.entry.js → p-b8d74591.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-10da40f8.entry.js → p-c2899d68.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-d23f4604.entry.js → p-c4e40c2c.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-6951dcf7.entry.js → p-c7daffb6.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-10310a64.entry.js → p-cede8095.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-ad661a38.entry.js → p-d0c75083.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-8fdf6a09.entry.js → p-d82a2424.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-e5028d83.entry.js → p-e1f35866.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-e6605577.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-e8a7a94c.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-6d8efe87.entry.js → p-edfaf566.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-ee7bd504.entry.js → p-eedbf69a.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-fb45e6d5.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-d816fcc8.entry.js → p-fec173db.entry.js} +1 -1
- package/dist/types/components/chat-list/chat-item/chat-item.d.ts +1 -0
- package/dist/types/components/condition-tree/condition-tree-combinators.d.ts +47 -0
- package/dist/types/components/condition-tree/condition-tree-editor/condition-tree-editor.d.ts +84 -0
- package/dist/types/components/condition-tree/condition-tree-nodes.d.ts +130 -0
- package/dist/types/components/condition-tree/condition-tree-open-state.d.ts +76 -0
- package/dist/types/components/condition-tree/condition-tree-translate.d.ts +11 -0
- package/dist/types/components/condition-tree/condition-tree-view-context.d.ts +48 -0
- package/dist/types/components/condition-tree/condition-tree.d.ts +177 -0
- package/dist/types/components/condition-tree/condition-tree.types.d.ts +323 -0
- package/dist/types/components/condition-tree/group-node-view.d.ts +30 -0
- package/dist/types/components/condition-tree/leaf-node-view.d.ts +21 -0
- package/dist/types/components.d.ts +348 -4
- package/dist/types/interface.d.ts +1 -0
- package/package.json +3 -3
- package/dist/lime-crm-building-blocks/p-29262c17.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-63e7c191.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-a17d6dac.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-c85ff45b.entry.js +0 -1
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
import { IconName, MenuItem } from '@limetech/lime-elements';
|
|
3
|
+
import { ComponentDescriptor, LimeWebComponentContext, LimeWebComponentPlatform } from '@limetech/lime-web-components';
|
|
4
|
+
/**
|
|
5
|
+
* How a group joins the conditions inside it.
|
|
6
|
+
*
|
|
7
|
+
* - `all` — every condition must hold (`AND`)
|
|
8
|
+
* - `any` — at least one condition must hold (`OR`)
|
|
9
|
+
* - `not-all` — at least one condition must fail (`NOT AND`)
|
|
10
|
+
* - `none` — every condition must fail (`NOT OR`)
|
|
11
|
+
*
|
|
12
|
+
* The last two are the negations of the first two. Consumers whose data model
|
|
13
|
+
* expresses negation as a wrapper (`NOT[AND[…]]`, `not(all(…))`) fold that
|
|
14
|
+
* wrapper into the combinator in `describe`, and unfold it again in `group`. A
|
|
15
|
+
* consumer that would rather not expose the negated forms to its users lists
|
|
16
|
+
* only the ones it wants via `combinators`.
|
|
17
|
+
*
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export type ConditionTreeCombinator = 'all' | 'any' | 'not-all' | 'none';
|
|
21
|
+
/**
|
|
22
|
+
* How one condition reads when it is collapsed.
|
|
23
|
+
*
|
|
24
|
+
* This is the whole vocabulary the tree itself has for a condition: a name, a
|
|
25
|
+
* value, an icon, and whether something is wrong with it. It says nothing
|
|
26
|
+
* about what the condition *means* — that is the consumer's business, and a
|
|
27
|
+
* consumer whose chips need to say more replaces the chip through
|
|
28
|
+
* `component`.
|
|
29
|
+
*
|
|
30
|
+
* @public
|
|
31
|
+
*/
|
|
32
|
+
export interface ConditionTreeChip {
|
|
33
|
+
/**
|
|
34
|
+
* The name of what is being tested — typically a property name, but for an
|
|
35
|
+
* opaque condition simply its title (e.g. "User is an administrator").
|
|
36
|
+
*
|
|
37
|
+
* It also becomes the heading of the editor when the condition is opened.
|
|
38
|
+
*/
|
|
39
|
+
label?: string;
|
|
40
|
+
/**
|
|
41
|
+
* The value(s) tested against.
|
|
42
|
+
*/
|
|
43
|
+
value?: string | string[];
|
|
44
|
+
/**
|
|
45
|
+
* The glyph shown between the label and the value.
|
|
46
|
+
*/
|
|
47
|
+
icon?: IconName;
|
|
48
|
+
/**
|
|
49
|
+
* Set to `true` to mark the condition as unresolvable or malformed.
|
|
50
|
+
*/
|
|
51
|
+
invalid?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* A component to draw in place of the built-in chip, for a condition whose
|
|
54
|
+
* summary needs more than the four fields above can say.
|
|
55
|
+
*
|
|
56
|
+
* The tree knows nothing about filters, operators or data types, so a
|
|
57
|
+
* consumer that wants the full `limebb-filter-chip` summary — the glyph
|
|
58
|
+
* and wording derived from a condition and a property type — names that
|
|
59
|
+
* component here and passes the rest through `props`:
|
|
60
|
+
*
|
|
61
|
+
* ```ts
|
|
62
|
+
* component: {
|
|
63
|
+
* name: 'limebb-filter-chip',
|
|
64
|
+
* props: { condition: 'greater-than', propertyType: 'date' },
|
|
65
|
+
* }
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* The four fields above are still forwarded, and the tree's own state
|
|
69
|
+
* always wins over `props`. See {@link ConditionChip} for the contract the
|
|
70
|
+
* component is held to.
|
|
71
|
+
*/
|
|
72
|
+
component?: ComponentDescriptor;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* What the tree should draw for one of the consumer's nodes that holds others.
|
|
76
|
+
*
|
|
77
|
+
* @public
|
|
78
|
+
*/
|
|
79
|
+
export interface ConditionTreeGroupDescription<T> {
|
|
80
|
+
kind: 'group';
|
|
81
|
+
/**
|
|
82
|
+
* How the conditions inside the group are joined.
|
|
83
|
+
*/
|
|
84
|
+
combinator: ConditionTreeCombinator;
|
|
85
|
+
/**
|
|
86
|
+
* The consumer's own nodes inside this group, in display order. They are
|
|
87
|
+
* passed straight back to `describe` one level down, so they need no
|
|
88
|
+
* translating: a group hands over what it already holds.
|
|
89
|
+
*/
|
|
90
|
+
children: T[];
|
|
91
|
+
/**
|
|
92
|
+
* Problems to show on the group, for example from a validation pass.
|
|
93
|
+
*/
|
|
94
|
+
issues?: string[];
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* What the tree should draw for one of the consumer's nodes that is a single
|
|
98
|
+
* condition: a chip, and the editor that opens when it is clicked.
|
|
99
|
+
*
|
|
100
|
+
* @public
|
|
101
|
+
*/
|
|
102
|
+
export interface ConditionTreeLeafDescription {
|
|
103
|
+
kind: 'leaf';
|
|
104
|
+
/**
|
|
105
|
+
* How the condition reads when collapsed.
|
|
106
|
+
*/
|
|
107
|
+
chip: ConditionTreeChip;
|
|
108
|
+
/**
|
|
109
|
+
* The component to mount in the condition's editor popover. It is created
|
|
110
|
+
* by tag name and receives `platform`, `context` and the condition itself
|
|
111
|
+
* as `value`, alongside the `props` given here, so a consumer can hand over
|
|
112
|
+
* any editor it likes — including one supplied by a third party — without
|
|
113
|
+
* the tree knowing what it edits. See {@link ConditionEditor} for the
|
|
114
|
+
* contract that editor is held to.
|
|
115
|
+
*
|
|
116
|
+
* A leaf without an editor is not clickable.
|
|
117
|
+
*/
|
|
118
|
+
editor?: ComponentDescriptor;
|
|
119
|
+
/**
|
|
120
|
+
* Whether this condition is negated.
|
|
121
|
+
*
|
|
122
|
+
* Leave it `undefined` when the condition carries its own polarity — one
|
|
123
|
+
* that tests a property can say "is not between" in its own vocabulary of
|
|
124
|
+
* conditions, and a second, outer negation there would be both redundant
|
|
125
|
+
* and ambiguous. The tree then renders no negation control.
|
|
126
|
+
*
|
|
127
|
+
* Set it — to `false` as much as to `true` — for an opaque condition that
|
|
128
|
+
* is simply true or false, with nothing inside it able to express the
|
|
129
|
+
* opposite, so that wrapping it is the only negation available. The tree
|
|
130
|
+
* then offers the control, and rebuilds the condition through
|
|
131
|
+
* `ConditionTreeAdapter.negate` when it is used.
|
|
132
|
+
*/
|
|
133
|
+
negated?: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* Set to `true` to open this condition's editor as soon as it appears,
|
|
136
|
+
* for example because the user just added it and it has nothing in it yet.
|
|
137
|
+
*
|
|
138
|
+
* It is acted on once per condition, so there is no need to clear it
|
|
139
|
+
* afterwards: a condition the user has closed stays closed, and the next
|
|
140
|
+
* condition to carry the flag still opens.
|
|
141
|
+
*/
|
|
142
|
+
autoOpen?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Problems to show on the condition, for example from a validation pass.
|
|
145
|
+
*/
|
|
146
|
+
issues?: string[];
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* What the tree should draw for one of the consumer's nodes: either a group of
|
|
150
|
+
* others, or a single condition.
|
|
151
|
+
*
|
|
152
|
+
* @public
|
|
153
|
+
*/
|
|
154
|
+
export type ConditionTreeDescription<T> = ConditionTreeGroupDescription<T> | ConditionTreeLeafDescription;
|
|
155
|
+
/**
|
|
156
|
+
* What the tree knows about the user's dealings with one node, handed to
|
|
157
|
+
* `describe` so a consumer does not have to keep the tally itself.
|
|
158
|
+
*
|
|
159
|
+
* @public
|
|
160
|
+
*/
|
|
161
|
+
export interface ConditionTreeNodeState {
|
|
162
|
+
/**
|
|
163
|
+
* Whether the user has opened this condition's editor and closed it again.
|
|
164
|
+
*
|
|
165
|
+
* The tree is the only thing that knows this — it opens the editors — so
|
|
166
|
+
* it is the tree that remembers. A consumer uses it to tell a condition
|
|
167
|
+
* nobody has reached yet from one the user saw and left as it is: the
|
|
168
|
+
* first is not at fault for being empty, the second may well be.
|
|
169
|
+
*
|
|
170
|
+
* Always `false` for a group, which has no editor to open.
|
|
171
|
+
*/
|
|
172
|
+
visited: boolean;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* How `limebb-condition-tree` reads and rebuilds a consumer's own tree.
|
|
176
|
+
*
|
|
177
|
+
* The tree holds no model of its own. It is given the consumer's tree as-is,
|
|
178
|
+
* asks this adapter what each node should look like, and — when the user
|
|
179
|
+
* changes something — hands back a tree of the same kind with the change
|
|
180
|
+
* applied. Conditions travel by identity: the tree moves the very objects it
|
|
181
|
+
* was given, and only asks for groups to be rebuilt, because only a group's
|
|
182
|
+
* combinator and children can change.
|
|
183
|
+
*
|
|
184
|
+
* Build the adapter once and hold on to it. One built inside `render()` is a
|
|
185
|
+
* new object every time, which makes the tree re-render for no reason.
|
|
186
|
+
*
|
|
187
|
+
* @public
|
|
188
|
+
*/
|
|
189
|
+
export interface ConditionTreeAdapter<T> {
|
|
190
|
+
/**
|
|
191
|
+
* What the tree should draw for one of the consumer's nodes.
|
|
192
|
+
*
|
|
193
|
+
* This runs for every node on every render, so it must be pure and cheap.
|
|
194
|
+
* Work that is not — resolving a property name against a repository, say —
|
|
195
|
+
* belongs in the consumer's own state, resolved once and read from here.
|
|
196
|
+
*
|
|
197
|
+
* `state` is what the tree knows about the user's dealings with this node.
|
|
198
|
+
* Most consumers ignore it; one that marks a condition the user left
|
|
199
|
+
* unfinished reads `visited` from it, rather than keeping that tally
|
|
200
|
+
* itself.
|
|
201
|
+
* @param node
|
|
202
|
+
* @param state
|
|
203
|
+
*/
|
|
204
|
+
describe(node: T, state: ConditionTreeNodeState): ConditionTreeDescription<T>;
|
|
205
|
+
/**
|
|
206
|
+
* A group of the consumer's own kind, joining `children` the way
|
|
207
|
+
* `combinator` says.
|
|
208
|
+
*
|
|
209
|
+
* The tree calls this for every group along the path from the edit up to
|
|
210
|
+
* the root, so a consumer whose model wraps negation (`NOT[AND[…]]`)
|
|
211
|
+
* unfolds `not-all` and `none` back into that wrapper here.
|
|
212
|
+
*
|
|
213
|
+
* `children` is empty in one case only: the user asked for a new group
|
|
214
|
+
* while `addOptions` is set, so the tree cannot know which kind of
|
|
215
|
+
* condition to put in it and leaves that to the user. A group emptied by
|
|
216
|
+
* an edit is dropped rather than rebuilt, so it never reaches here.
|
|
217
|
+
* @param combinator
|
|
218
|
+
* @param children
|
|
219
|
+
*/
|
|
220
|
+
group(combinator: ConditionTreeCombinator, children: T[]): T;
|
|
221
|
+
/**
|
|
222
|
+
* A new condition, for the user to fill in.
|
|
223
|
+
*
|
|
224
|
+
* `item` is the kind the user picked from `addOptions`, and is absent when
|
|
225
|
+
* the tree was given no options to offer: the consumer is then free to
|
|
226
|
+
* decide what a new condition is — typically a blank one, left for its
|
|
227
|
+
* editor to fill in.
|
|
228
|
+
* @param item
|
|
229
|
+
*/
|
|
230
|
+
createLeaf(item?: MenuItem): T;
|
|
231
|
+
/**
|
|
232
|
+
* The same condition, negated or not.
|
|
233
|
+
*
|
|
234
|
+
* Leave it out and the tree offers no negation control, whatever a leaf
|
|
235
|
+
* description says about `negated`.
|
|
236
|
+
* @param node
|
|
237
|
+
* @param negated
|
|
238
|
+
*/
|
|
239
|
+
negate?(node: T, negated: boolean): T;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* The contract an editor mounted by `limebb-condition-tree` is held to.
|
|
243
|
+
*
|
|
244
|
+
* The tree sets all five props on the component named by
|
|
245
|
+
* `ConditionTreeLeafDescription.editor`, and listens for one event.
|
|
246
|
+
*
|
|
247
|
+
* @public
|
|
248
|
+
*/
|
|
249
|
+
export interface ConditionEditor<T> {
|
|
250
|
+
/**
|
|
251
|
+
* Platform service provider.
|
|
252
|
+
*/
|
|
253
|
+
platform: LimeWebComponentPlatform;
|
|
254
|
+
/**
|
|
255
|
+
* Component context.
|
|
256
|
+
*/
|
|
257
|
+
context: LimeWebComponentContext;
|
|
258
|
+
/**
|
|
259
|
+
* The condition being edited, in the consumer's own model.
|
|
260
|
+
*/
|
|
261
|
+
value: T;
|
|
262
|
+
/**
|
|
263
|
+
* @inheritdoc
|
|
264
|
+
*/
|
|
265
|
+
readonly: boolean;
|
|
266
|
+
/**
|
|
267
|
+
* @inheritdoc
|
|
268
|
+
*/
|
|
269
|
+
disabled: boolean;
|
|
270
|
+
/**
|
|
271
|
+
* Emitted with the replacement condition when the user changes something.
|
|
272
|
+
*
|
|
273
|
+
* Named `conditionChange` rather than `change` on purpose: every
|
|
274
|
+
* `limel-input-field`, `limel-picker` and `limel-select` inside an editor
|
|
275
|
+
* emits a bubbling, composed `change`, and the tree would catch all of
|
|
276
|
+
* them.
|
|
277
|
+
*/
|
|
278
|
+
conditionChange: EventEmitter<T>;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* The contract a chip mounted by `limebb-condition-tree` is held to.
|
|
282
|
+
*
|
|
283
|
+
* The tree sets these props on the component named by
|
|
284
|
+
* `ConditionTreeChip.component`, and listens for two events. Anything else the
|
|
285
|
+
* chip needs comes from the descriptor's `props`, which the tree passes
|
|
286
|
+
* through untouched — except where a name below collides, and then the tree
|
|
287
|
+
* wins: a chip that stayed on screen while the tree was locked must not be the
|
|
288
|
+
* one place the lock does not reach.
|
|
289
|
+
*
|
|
290
|
+
* `limebb-filter-chip` satisfies this contract, which is why it is what the
|
|
291
|
+
* tree draws when no component is named.
|
|
292
|
+
*
|
|
293
|
+
* @public
|
|
294
|
+
*/
|
|
295
|
+
export interface ConditionChip extends Omit<ConditionTreeChip, 'component'> {
|
|
296
|
+
/**
|
|
297
|
+
* Platform service provider.
|
|
298
|
+
*/
|
|
299
|
+
platform: LimeWebComponentPlatform;
|
|
300
|
+
/**
|
|
301
|
+
* Whether this condition's editor is the one currently open.
|
|
302
|
+
*/
|
|
303
|
+
selected: boolean;
|
|
304
|
+
/**
|
|
305
|
+
* @inheritdoc
|
|
306
|
+
*/
|
|
307
|
+
readonly: boolean;
|
|
308
|
+
/**
|
|
309
|
+
* @inheritdoc
|
|
310
|
+
*/
|
|
311
|
+
disabled: boolean;
|
|
312
|
+
/**
|
|
313
|
+
* Whether the chip offers a control that deletes the condition. It is
|
|
314
|
+
* `false` while the tree is read-only.
|
|
315
|
+
*/
|
|
316
|
+
removable: boolean;
|
|
317
|
+
/**
|
|
318
|
+
* Emitted when the user asks for the condition to be deleted. Its payload
|
|
319
|
+
* is ignored: the tree already knows which condition the chip stands for.
|
|
320
|
+
*/
|
|
321
|
+
remove: EventEmitter<unknown>;
|
|
322
|
+
}
|
|
323
|
+
//# sourceMappingURL=condition-tree.types.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FunctionalComponent } from '../../stencil-public-runtime';
|
|
2
|
+
import { ConditionTreeDescription, ConditionTreeGroupDescription } from './condition-tree.types';
|
|
3
|
+
import { ConditionTreePath } from './condition-tree-nodes';
|
|
4
|
+
import { ConditionTreeRenderContext } from './condition-tree-view-context';
|
|
5
|
+
/**
|
|
6
|
+
* Render one of the consumer's nodes, whichever kind the adapter says it is.
|
|
7
|
+
*
|
|
8
|
+
* It lives beside `GroupView` because a group is what holds nodes of either
|
|
9
|
+
* kind: the recursion is the group's, and keeping the choice here is what lets
|
|
10
|
+
* a group draw a group without two modules importing each other.
|
|
11
|
+
* @param props
|
|
12
|
+
*/
|
|
13
|
+
export declare const NodeView: FunctionalComponent<{
|
|
14
|
+
node: unknown;
|
|
15
|
+
description: ConditionTreeDescription<unknown>;
|
|
16
|
+
path: ConditionTreePath;
|
|
17
|
+
ctx: ConditionTreeRenderContext;
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* A box holding a combinator, the conditions joined by it, and the two buttons
|
|
21
|
+
* that grow it.
|
|
22
|
+
* @param props
|
|
23
|
+
*/
|
|
24
|
+
export declare const GroupView: FunctionalComponent<{
|
|
25
|
+
description: ConditionTreeGroupDescription<unknown>;
|
|
26
|
+
path: ConditionTreePath;
|
|
27
|
+
ctx: ConditionTreeRenderContext;
|
|
28
|
+
placeholder?: boolean;
|
|
29
|
+
}>;
|
|
30
|
+
//# sourceMappingURL=group-node-view.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FunctionalComponent } from '../../stencil-public-runtime';
|
|
2
|
+
import { ConditionTreeLeafDescription } from './condition-tree.types';
|
|
3
|
+
import { ConditionTreePath } from './condition-tree-nodes';
|
|
4
|
+
import { ConditionTreeRenderContext } from './condition-tree-view-context';
|
|
5
|
+
/**
|
|
6
|
+
* What both halves of a condition need: the node itself, what to draw for it,
|
|
7
|
+
* where it sits, and the state and callbacks of the tree around it.
|
|
8
|
+
*/
|
|
9
|
+
interface LeafProps {
|
|
10
|
+
node: unknown;
|
|
11
|
+
description: ConditionTreeLeafDescription;
|
|
12
|
+
path: ConditionTreePath;
|
|
13
|
+
ctx: ConditionTreeRenderContext;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* One condition: a chip that summarizes it, and the editor it opens.
|
|
17
|
+
* @param props
|
|
18
|
+
*/
|
|
19
|
+
export declare const LeafView: FunctionalComponent<LeafProps>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=leaf-node-view.d.ts.map
|