@limetech/lime-crm-building-blocks 2.4.0 → 2.4.2

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 CHANGED
@@ -1,3 +1,17 @@
1
+ ## [2.4.2](https://github.com/Lundalogik/lime-crm-building-blocks/compare/v2.4.1...v2.4.2) (2026-09-18)
2
+
3
+ ### Bug Fixes
4
+
5
+
6
+ * **rule-editor:** mark a condition with a tick or a cross, not with ¬ ([575eba6](https://github.com/Lundalogik/lime-crm-building-blocks/commit/575eba67dd490028761f37b4372dadcca23d13d0))
7
+
8
+ ## [2.4.1](https://github.com/Lundalogik/lime-crm-building-blocks/compare/v2.4.0...v2.4.1) (2026-09-17)
9
+
10
+ ### Bug Fixes
11
+
12
+
13
+ * **rule-gate:** render as display: contents so it never alters layout ([4006c06](https://github.com/Lundalogik/lime-crm-building-blocks/commit/4006c060526994bb7f8b2661d31c290ea5160328))
14
+
1
15
  ## [2.4.0](https://github.com/Lundalogik/lime-crm-building-blocks/compare/v2.3.1...v2.4.0) (2026-09-16)
2
16
 
3
17
  ### Features
@@ -1,9 +1,25 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-Du4GyM0Y.js');
4
+ var conditionTreeTranslate = require('./condition-tree-translate-BQwKtiNZ.js');
5
+ var randomString = require('./random-string-BdZGIsGg.js');
6
+ require('./index.esm-C2zw0QJK.js');
4
7
 
5
8
  const ruleConditionChipCss = () => `:host{display:inline-flex;min-width:0}`;
6
9
 
10
+ /**
11
+ * The glyphs that say which way round a condition is: that it must hold, or
12
+ * that it must not.
13
+ *
14
+ * A plain tick and cross, rather than the `=` and the `≠` of the shared
15
+ * filter vocabulary. Those two read as the verb between a property and a value,
16
+ * and a rule condition has neither yet — a bare `≠` in front of a name
17
+ * reads as a sentence that was cut off. They become the right pair once a
18
+ * condition carries a value and the chip reads as one sentence; until then
19
+ * these say the only thing there is to say.
20
+ */
21
+ const AFFIRMED_ICON = 'ok';
22
+ const NEGATED_ICON = 'cancel_2';
7
23
  const RuleConditionChip = class {
8
24
  constructor(hostRef) {
9
25
  index.registerInstance(this, hostRef);
@@ -40,30 +56,50 @@ const RuleConditionChip = class {
40
56
  * from `limel-chip` also withholds the lock it puts on the cross.
41
57
  */
42
58
  this.removable = true;
59
+ /**
60
+ * What the tooltip attaches itself to. Its own, rather than the host's `id`:
61
+ * nothing outside sets one on a chip the tree creates, and the tooltip needs
62
+ * a target in the same shadow root either way.
63
+ */
64
+ this.chipId = 'rule-condition-chip-' + randomString.createRandomString();
43
65
  this.handleRemove = (event) => {
44
66
  event.stopPropagation();
45
67
  this.remove.emit();
46
68
  };
47
69
  }
48
70
  render() {
49
- return (index.h("limel-chip", { key: '3b1e45748efbdd1bdbf8effd7bca4976f9ba537c', text: this.text, icon: this.glyph, invalid: this.invalid, selected: this.selected, disabled: this.disabled, removable: this.removable && !this.readonly, onRemove: this.handleRemove }));
71
+ return [
72
+ index.h("limel-chip", { key: 'f5b4e4c7ea6a2538fbffc683f25c1119309b3c43', id: this.chipId, text: this.label, icon: this.glyph, invalid: this.invalid, selected: this.selected, disabled: this.disabled, removable: this.removable && !this.readonly, onRemove: this.handleRemove }),
73
+ this.renderPolarityTooltip(),
74
+ ];
50
75
  }
51
76
  /**
52
- * The glyph, with its colour put back on when it has one.
77
+ * What the polarity glyph means, in words.
78
+ *
79
+ * A glyph on its own is no better than the `¬` it replaces unless someone
80
+ * who does not recognize it can still find out what it means, and unless it
81
+ * reaches a screen reader. `limel-chip` cannot help with either: its
82
+ * accessible name is its `text` and it has no tooltip. `limel-tooltip`
83
+ * carries the wording on hover and sets `aria-describedby` on the chip, so
84
+ * the polarity is announced rather than merely drawn.
53
85
  */
54
- get glyph() {
55
- if (!this.icon || !this.iconColor) {
56
- return this.icon;
57
- }
58
- return { name: this.icon, color: this.iconColor };
86
+ renderPolarityTooltip() {
87
+ const translate = conditionTreeTranslate.createTranslator(this.platform);
88
+ return (index.h("limel-tooltip", { elementId: this.chipId, label: this.label, helperLabel: this.negated
89
+ ? translate('webclient.rule-editor.negated-condition', 'This condition must not be met.')
90
+ : translate('webclient.rule-editor.affirmed-condition', 'This condition must be met.') }));
59
91
  }
60
92
  /**
61
- * The name, behind `¬` when negated — a symbol rather than a word, so it
62
- * does not compete with the "not" the tree writes between the rows of a
63
- * negated group.
93
+ * Which way round the condition is.
94
+ *
95
+ * It has the slot unconditionally, which is why `icon` and `iconColor` do
96
+ * not reach it: there is one slot, and which way round a condition is
97
+ * matters more than which kind of condition it is. No built-in primitive
98
+ * registers an icon, so in practice this withholds only the glyphs of the
99
+ * docs-app examples and of `legacy.*` conditions whose author set one.
64
100
  */
65
- get text() {
66
- return this.negated ? `¬ ${this.label}` : this.label;
101
+ get glyph() {
102
+ return this.negated ? NEGATED_ICON : AFFIRMED_ICON;
67
103
  }
68
104
  };
69
105
  RuleConditionChip.style = ruleConditionChipCss();
@@ -3,7 +3,7 @@
3
3
  var index = require('./index-Du4GyM0Y.js');
4
4
  var index_esm = require('./index.esm-C2zw0QJK.js');
5
5
 
6
- const ruleGateCss = () => `:host{display:block}:host([hidden]){display:none}`;
6
+ const ruleGateCss = () => `:host(limebb-rule-gate){display:contents}:host(limebb-rule-gate[hidden]){display:none}`;
7
7
 
8
8
  const RuleGate = class {
9
9
  constructor(hostRef) {
@@ -1,4 +1,19 @@
1
1
  import { h } from "@stencil/core";
2
+ import { createTranslator } from "../../condition-tree/condition-tree-translate";
3
+ import { createRandomString } from "../../../util/random-string";
4
+ /**
5
+ * The glyphs that say which way round a condition is: that it must hold, or
6
+ * that it must not.
7
+ *
8
+ * A plain tick and cross, rather than the `=` and the `≠` of the shared
9
+ * filter vocabulary. Those two read as the verb between a property and a value,
10
+ * and a rule condition has neither yet — a bare `≠` in front of a name
11
+ * reads as a sentence that was cut off. They become the right pair once a
12
+ * condition carries a value and the chip reads as one sentence; until then
13
+ * these say the only thing there is to say.
14
+ */
15
+ const AFFIRMED_ICON = 'ok';
16
+ const NEGATED_ICON = 'cancel_2';
2
17
  /**
3
18
  * A rule condition as a chip, in place of the `limebb-filter-chip` the tree
4
19
  * draws by default.
@@ -43,30 +58,50 @@ export class RuleConditionChip {
43
58
  * from `limel-chip` also withholds the lock it puts on the cross.
44
59
  */
45
60
  this.removable = true;
61
+ /**
62
+ * What the tooltip attaches itself to. Its own, rather than the host's `id`:
63
+ * nothing outside sets one on a chip the tree creates, and the tooltip needs
64
+ * a target in the same shadow root either way.
65
+ */
66
+ this.chipId = 'rule-condition-chip-' + createRandomString();
46
67
  this.handleRemove = (event) => {
47
68
  event.stopPropagation();
48
69
  this.remove.emit();
49
70
  };
50
71
  }
51
72
  render() {
52
- return (h("limel-chip", { key: '3b1e45748efbdd1bdbf8effd7bca4976f9ba537c', text: this.text, icon: this.glyph, invalid: this.invalid, selected: this.selected, disabled: this.disabled, removable: this.removable && !this.readonly, onRemove: this.handleRemove }));
73
+ return [
74
+ h("limel-chip", { key: 'f5b4e4c7ea6a2538fbffc683f25c1119309b3c43', id: this.chipId, text: this.label, icon: this.glyph, invalid: this.invalid, selected: this.selected, disabled: this.disabled, removable: this.removable && !this.readonly, onRemove: this.handleRemove }),
75
+ this.renderPolarityTooltip(),
76
+ ];
53
77
  }
54
78
  /**
55
- * The glyph, with its colour put back on when it has one.
79
+ * What the polarity glyph means, in words.
80
+ *
81
+ * A glyph on its own is no better than the `¬` it replaces unless someone
82
+ * who does not recognize it can still find out what it means, and unless it
83
+ * reaches a screen reader. `limel-chip` cannot help with either: its
84
+ * accessible name is its `text` and it has no tooltip. `limel-tooltip`
85
+ * carries the wording on hover and sets `aria-describedby` on the chip, so
86
+ * the polarity is announced rather than merely drawn.
56
87
  */
57
- get glyph() {
58
- if (!this.icon || !this.iconColor) {
59
- return this.icon;
60
- }
61
- return { name: this.icon, color: this.iconColor };
88
+ renderPolarityTooltip() {
89
+ const translate = createTranslator(this.platform);
90
+ return (h("limel-tooltip", { elementId: this.chipId, label: this.label, helperLabel: this.negated
91
+ ? translate('webclient.rule-editor.negated-condition', 'This condition must not be met.')
92
+ : translate('webclient.rule-editor.affirmed-condition', 'This condition must be met.') }));
62
93
  }
63
94
  /**
64
- * The name, behind `¬` when negated — a symbol rather than a word, so it
65
- * does not compete with the "not" the tree writes between the rows of a
66
- * negated group.
95
+ * Which way round the condition is.
96
+ *
97
+ * It has the slot unconditionally, which is why `icon` and `iconColor` do
98
+ * not reach it: there is one slot, and which way round a condition is
99
+ * matters more than which kind of condition it is. No built-in primitive
100
+ * registers an icon, so in practice this withholds only the glyphs of the
101
+ * docs-app examples and of `legacy.*` conditions whose author set one.
67
102
  */
68
- get text() {
69
- return this.negated ? `¬ ${this.label}` : this.label;
103
+ get glyph() {
104
+ return this.negated ? NEGATED_ICON : AFFIRMED_ICON;
70
105
  }
71
106
  static get is() { return "limebb-rule-condition-chip"; }
72
107
  static get encapsulation() { return "shadow"; }
@@ -101,7 +136,7 @@ export class RuleConditionChip {
101
136
  "optional": false,
102
137
  "docs": {
103
138
  "tags": [],
104
- "text": "Platform service provider. Unread, but declared so that the tree setting\nit does not leave it in the DOM as an attribute."
139
+ "text": "Platform service provider, used to translate what the negation glyph\nmeans. The chip reads nothing else from it."
105
140
  },
106
141
  "getter": false,
107
142
  "setter": false
@@ -144,7 +179,7 @@ export class RuleConditionChip {
144
179
  "optional": true,
145
180
  "docs": {
146
181
  "tags": [],
147
- "text": "The condition's glyph."
182
+ "text": "The condition's glyph. Declared because the tree sets it, but not drawn:\nthe polarity glyph has the only slot there is \u2014 see {@link glyph}."
148
183
  },
149
184
  "getter": false,
150
185
  "setter": false,
@@ -163,7 +198,7 @@ export class RuleConditionChip {
163
198
  "optional": true,
164
199
  "docs": {
165
200
  "tags": [],
166
- "text": "The glyph's colour, which travels beside the name because\n`ConditionTreeChip.icon` has no room for it."
201
+ "text": "The glyph's colour, which travels beside the name because\n`ConditionTreeChip.icon` has no room for it. Not drawn either, for the\nsame reason as `icon`."
167
202
  },
168
203
  "getter": false,
169
204
  "setter": false,
@@ -1,7 +1,7 @@
1
- :host {
2
- display: block;
1
+ :host(limebb-rule-gate) {
2
+ display: contents;
3
3
  }
4
4
 
5
- :host([hidden]) {
5
+ :host(limebb-rule-gate[hidden]) {
6
6
  display: none;
7
7
  }
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as n,transformTag as s}from"@stencil/core/internal/client";import{n as r,k as o}from"./index.esm.js";import{L as a}from"./web-component-template.js";function l(e){return(t,i)=>{var n;let s;try{s=null===(n=null==e?void 0:e.get(r.Translate))||void 0===n?void 0:n.get(t)}catch(e){return i}return s&&s!==t?s:i}}const d=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.negateChange=i(this,"negateChange",7),this.conditionChange=i(this,"conditionChange",7),this.open=!1,this.readonly=!1,this.disabled=!1,this.handleNegate=e=>{e.stopPropagation(),this.negateChange.emit(e.detail)},this.handleConditionChange=e=>{e.stopPropagation(),this.conditionChange.emit(e.detail)}}render(){return this.open?[this.renderHeader(),this.renderBody()]:null}renderHeader(){return void 0===this.negated?null:n("limel-header",{class:"header is-narrow",heading:this.heading,icon:this.icon},this.renderNegate())}renderNegate(){return this.readonly?null:n("div",{slot:"actions",class:"header-actions"},n("limel-switch",{class:"negate",label:this.negateLabel,value:this.negated,disabled:this.disabled,onChange:this.handleNegate}))}renderBody(){return this.editor?n(a,{class:"editor",platform:this.platform,context:this.context,name:this.editor.name,props:Object.assign(Object.assign({},this.editor.props),{value:this.value,readonly:this.readonly,disabled:this.disabled,onConditionChange:this.handleConditionChange})}):null}get negateLabel(){return l(this.platform)("webclient.negate","Negate")}static get style(){return":host{display:contents}limel-header.header{--header-background-color:rgba(var(--contrast-300));padding-right:0.5rem;gap:1rem}.header-actions{display:grid;grid-auto-flow:column;grid-gap:0.75rem;padding:0.25rem;align-items:center}"}},[1,"limebb-condition-tree-editor",{platform:[16],context:[16],open:[4],editor:[16],value:[8],heading:[1],icon:[1],negated:[4],readonly:[516],disabled:[516]}]);function c(){"undefined"!=typeof customElements&&["limebb-condition-tree-editor"].forEach((e=>{"limebb-condition-tree-editor"===e&&(customElements.get(s(e))||customElements.define(s(e),d))}))}!function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);r>3&&o&&Object.defineProperty(t,i,o)}([o("context")],d.prototype,"context",void 0);export{d as C,l as c,c as d}
1
+ import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as n,transformTag as s}from"@stencil/core/internal/client";import{k as r}from"./index.esm.js";import{L as o}from"./web-component-template.js";import{c as a}from"./condition-tree-translate.js";const l=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.negateChange=i(this,"negateChange",7),this.conditionChange=i(this,"conditionChange",7),this.open=!1,this.readonly=!1,this.disabled=!1,this.handleNegate=e=>{e.stopPropagation(),this.negateChange.emit(e.detail)},this.handleConditionChange=e=>{e.stopPropagation(),this.conditionChange.emit(e.detail)}}render(){return this.open?[this.renderHeader(),this.renderBody()]:null}renderHeader(){return void 0===this.negated?null:n("limel-header",{class:"header is-narrow",heading:this.heading,icon:this.icon},this.renderNegate())}renderNegate(){return this.readonly?null:n("div",{slot:"actions",class:"header-actions"},n("limel-switch",{class:"negate",label:this.negateLabel,value:this.negated,disabled:this.disabled,onChange:this.handleNegate}))}renderBody(){return this.editor?n(o,{class:"editor",platform:this.platform,context:this.context,name:this.editor.name,props:Object.assign(Object.assign({},this.editor.props),{value:this.value,readonly:this.readonly,disabled:this.disabled,onConditionChange:this.handleConditionChange})}):null}get negateLabel(){return a(this.platform)("webclient.negate","Negate")}static get style(){return":host{display:contents}limel-header.header{--header-background-color:rgba(var(--contrast-300));padding-right:0.5rem;gap:1rem}.header-actions{display:grid;grid-auto-flow:column;grid-gap:0.75rem;padding:0.25rem;align-items:center}"}},[1,"limebb-condition-tree-editor",{platform:[16],context:[16],open:[4],editor:[16],value:[8],heading:[1],icon:[1],negated:[4],readonly:[516],disabled:[516]}]);function d(){"undefined"!=typeof customElements&&["limebb-condition-tree-editor"].forEach((e=>{"limebb-condition-tree-editor"===e&&(customElements.get(s(e))||customElements.define(s(e),l))}))}!function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);r>3&&o&&Object.defineProperty(t,i,o)}([r("context")],l.prototype,"context",void 0);export{l as C,d}
@@ -0,0 +1 @@
1
+ import{n as r}from"./index.esm.js";function t(t){return(n,e)=>{var o;let i;try{i=null===(o=null==t?void 0:t.get(r.Translate))||void 0===o?void 0:o.get(n)}catch(r){return e}return i&&i!==n?i:e}}export{t as c}
@@ -1 +1 @@
1
- import{h as e,proxyCustomElement as t,HTMLElement as i,createEvent as o,Host as n,transformTag as r}from"@stencil/core/internal/client";import{c as l,d as s}from"./condition-tree-editor.js";import{d as a}from"./filter-chip.js";const c=["all","any","not-all","none"],d={all:"any",any:"all","not-all":"any",none:"all"},u={all:{color:"rgb(var(--contrast-900))",iconName:"dot_circle",labelKey:"webclient.combinator.all",label:"All of the following",descriptionKey:"webclient.combinator.all.description",description:"Every condition must be met.",negated:!1,delimiterKey:"webclient.delimiter.and",delimiter:"&"},any:{color:"rgb(var(--color-sky-default))",iconName:"centre_point",labelKey:"webclient.combinator.any",label:"Any of the following",descriptionKey:"webclient.combinator.any.description",description:"At least one condition must be met.",negated:!1,delimiterKey:"webclient.delimiter.or",delimiter:"or"},"not-all":{color:"rgb(var(--color-orange-default))",iconName:"dot_circle",labelKey:"webclient.combinator.not-all",label:"Not all of the following",descriptionKey:"webclient.combinator.not-all.description",description:"At least one condition must not be met.",negated:!0,delimiterKey:"webclient.delimiter.and",delimiter:"&"},none:{color:"rgb(var(--color-red-default))",iconName:"centre_point",labelKey:"webclient.combinator.none",label:"None of the following",descriptionKey:"webclient.combinator.none.description",description:"No conditions may be met.",negated:!0,delimiterKey:"webclient.delimiter.or",delimiter:"or"}};function h(e){return 0===e.length?"root":e.join(".")}class p{constructor(e,t=()=>!1){this.adapter=e,this.isVisited=t}describe(e){return this.adapter.describe(e,{visited:this.isVisited(e)})}groupOf(e){const t=this.describe(e);return"group"===t.kind?t:void 0}childrenOf(e){var t;return null===(t=this.groupOf(e))||void 0===t?void 0:t.children}nodeAt(e,t){let i=e;for(const e of t){if(void 0===i)return;const t=this.childrenOf(i);if(!t)return;i=t[e]}return i}groupAt(e,t){const i=this.nodeAt(e,t);return void 0===i?void 0:this.groupOf(i)}contains(e,t){if(void 0===e)return!1;if(e===t)return!0;const i=this.childrenOf(e);return!!(null==i?void 0:i.some((e=>this.contains(e,t))))}autoOpenNodes(e){if(void 0===e)return[];const t=this.describe(e);return"leaf"===t.kind?t.autoOpen?[e]:[]:t.children.flatMap((e=>this.autoOpenNodes(e)))}replaceAt(e,t,i){if(0===t.length)return i;const o=this.groupOf(e);if(!o)return e;const[n,...r]=t,l=o.children;if(!(n in l))return e;const s=this.replaceAt(l[n],r,i);return this.rebuild(o.combinator,function(e,t,i){return[...e.slice(0,t),...void 0===i?[]:[i],...e.slice(t+1)]}(l,n,s))}appendAt(e,t,i){const o=this.groupAt(e,t);return o?this.replaceAt(e,t,this.adapter.group(o.combinator,[...o.children,i])):e}rejoinAt(e,t,i){const o=this.groupAt(e,t);return o?this.replaceAt(e,t,this.adapter.group(i,o.children)):e}negated(e,t,i){const o=this.nodeAt(e,t);if(void 0!==o&&this.adapter.negate)return this.adapter.negate(o,i)}rebuild(e,t){if(0!==t.length)return this.adapter.group(e,t)}}class m{constructor(e){this.fields=e}static empty(){return new m({open:null,pending:null,seen:new Set,autoOpened:new Set})}get openNode(){return this.fields.open}hasSeen(e){return this.fields.seen.has(e)}moveTo(e){const t=this.fields.open,i=this.with({open:e,pending:null});return null===t||t===e?i:i.with({seen:new Set(this.fields.seen).add(t)})}expect(e){return this.with({pending:e})}sync(e,t){return this.followPending(e,t).openWhatAsks(e,t).dropIfGone(e,t)}with(e){return new m(Object.assign(Object.assign({},this.fields),e))}followPending(e,t){return null===this.fields.pending?this:t.contains(e,this.fields.pending)?this.with({open:this.fields.pending,pending:null}):this}openWhatAsks(e,t){const i=t.autoOpenNodes(e),o=i.find((e=>!this.fields.autoOpened.has(e))),n=this.with({autoOpened:new Set(i)});return void 0===o?n:n.moveTo(o)}dropIfGone(e,t){return null===this.fields.open||t.contains(e,this.fields.open)?this:this.with({open:null})}}const b=t=>{var i;return(null===(i=t.issues)||void 0===i?void 0:i.length)?t.issues.map((t=>e("div",{class:"issue"},t))):null},g=(e,t)=>i=>{i.stopPropagation(),t.onDelete(e)},f=t=>{const{node:i,description:o,path:n,ctx:r}=t,l=r.openNode===i;return[e("limel-popover",{class:"leaf",key:h(n),open:l,openDirection:"bottom-start",onClose:x(r)},e(v,{node:i,description:o,path:n,ctx:r}),e("limebb-condition-tree-editor",{platform:r.platform,context:r.context,open:l,editor:o.editor,value:i,heading:o.chip.label,icon:o.chip.icon,negated:r.negatable?o.negated:void 0,readonly:r.readonly,disabled:r.disabled,onNegateChange:k(n,r),onConditionChange:C(n,r)})),e(b,{issues:o.issues})]},v=t=>{const{component:i}=t.description.chip;return i?e(i.name,Object.assign({},i.props,w(t))):e("limebb-filter-chip",Object.assign({},w(t)))};function w(e){const{node:t,description:i,path:o,ctx:n}=e,{chip:r}=i;return{slot:"trigger",platform:n.platform,label:r.label,value:r.value,icon:r.icon,invalid:r.invalid,selected:n.openNode===t,readonly:n.readonly,disabled:n.disabled,removable:!n.readonly,onClick:y(t,i,n),onRemove:g(o,n)}}const y=(e,t,i)=>()=>{(function(e,t){return!!e.editor||t.negatable&&void 0!==e.negated})(t,i)&&!i.disabled&&i.onOpen(e)},x=e=>t=>{t.stopPropagation(),e.onOpen(null)},k=(e,t)=>i=>{i.stopPropagation(),t.onNegate(e,i.detail)},C=(e,t)=>i=>{i.stopPropagation(),t.onConditionChange(e,i.detail)},O=t=>{const{description:i}=t;return"group"===i.kind?e(A,{description:i,path:t.path,ctx:t.ctx}):e(f,{node:t.node,description:i,path:t.path,ctx:t.ctx})},A=t=>{const{description:i,path:o,ctx:n,placeholder:r}=t,l=u[i.combinator],s=n.translate(l.delimiterKey,l.delimiter),a=l.negated?`${n.translate("webclient.delimiter.not","not")} ${s}`:s;return e("div",{class:"group",key:h(o),"data-combinator":i.combinator,style:{"--group-rail-color":l.color}},e("div",{class:"group-header"},function(t,i,o){if(!(t.children.length>1)&&!u[t.combinator].negated)return null;const n=function(e,t){const i=[...e.combinators];return t&&!i.includes(t)&&i.push(t),i.map((t=>{const i=u[t];return{value:t,text:e.translate(i.labelKey,i.label),secondaryText:e.translate(i.descriptionKey,i.description),icon:{name:i.iconName,color:i.color}}}))}(o,t.combinator);return e("limel-select",{class:"combinator",value:n.find((e=>e.value===t.combinator)),options:n,disabled:o.disabled,readonly:o.readonly,onChange:j(i,o)})}(i,o,n),function(t,i,o){return i.readonly?null:e("limel-icon-button",{class:"delete-group",icon:"trash",label:i.translate("webclient.delete-group","Delete this group"),disabled:i.disabled||!!o,onClick:g(t,i)})}(o,n,r)),e(b,{issues:i.issues}),e("ul",{class:"rows"},i.children.map(((t,i)=>{const r=n.walker.describe(t);return e("li",{class:{row:!0,"row--group":"group"===r.kind},"data-marker":a,key:h([...o,i])},e(O,{node:t,description:r,path:[...o,i],ctx:n}))})),function(t,i,o){if(o.readonly)return null;const n=e("limel-chip",{slot:K(o)?"trigger":void 0,class:"add-condition",text:o.translate("webclient.condition","Condition"),disabled:o.disabled||N(o),icon:S(o),onClick:K(o)?void 0:W(t,o)});return e("li",{class:"row","data-marker":i,key:`${h(t)}.add`},E(n,"add-condition-menu",_(t,o),o))}(o,a,n)),function(t,i){if(i.readonly)return null;return E(e("limel-chip",{slot:K(i)?"trigger":void 0,class:"add-group",size:"small",text:i.translate("webclient.group","Group"),disabled:i.disabled||N(i),icon:S(i,"var(--group-rail-color)"),onClick:K(i)?void 0:z(t,i)}),"add-group-menu",D(t,i),i)}(o,n))};function S(e,t){return{name:"plus_math",title:e.translate("webclient.add","Add"),color:t}}function K(e){return!!e.addOptions}function N(e){var t;return 0===(null===(t=e.addOptions)||void 0===t?void 0:t.length)}function E(t,i,o,n){return K(n)?e("limel-menu",{class:i,items:n.addOptions,searcher:n.addSearcher,openDirection:"bottom-start",onSelect:o},t):t}const j=(e,t)=>i=>{var o;i.stopPropagation();const n=null===(o=i.detail)||void 0===o?void 0:o.value;n&&t.onCombinator(e,n)},W=(e,t)=>()=>t.onAddLeaf(e),_=(e,t)=>i=>{i.stopPropagation(),t.onAddLeaf(e,i.detail)},z=(e,t)=>()=>t.onAddGroup(e),D=(e,t)=>i=>{i.stopPropagation(),t.onAddGroup(e,i.detail)},G={kind:"group",combinator:"all",children:[]},L=t(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.change=o(this,"change",7),this.combinators=[...c],this.readonly=!1,this.disabled=!1,this.openState=m.empty()}componentWillLoad(){this.buildWalker()}buildWalker(){this.walker=new p(this.adapter,(e=>this.openState.hasSeen(e))),this.syncOpenState()}syncOpenState(){this.adapter&&(this.openState=this.openState.sync(this.value,this.walker))}render(){return this.adapter?e(n,null,this.isEmpty?this.renderEmptyState():e(O,{node:this.value,description:this.walker.describe(this.value),path:[],ctx:this.renderContext()})):e(n,null)}renderEmptyState(){return this.readonly?null:e(A,{description:G,path:[],ctx:this.renderContext(),placeholder:!0})}renderContext(){return{platform:this.platform,context:this.context,walker:this.walker,translate:l(this.platform),combinators:this.combinators,readonly:this.readonly,disabled:this.disabled,negatable:!!this.adapter.negate,openNode:this.openState.openNode,addOptions:this.addOptions,addSearcher:this.addSearcher,onAddLeaf:(e,t)=>this.addLeaf(e,t),onAddGroup:(e,t)=>this.addGroup(e,t),onDelete:e=>this.applyEdit((t=>this.walker.replaceAt(t,e,void 0))),onCombinator:(e,t)=>this.applyEdit((i=>this.walker.rejoinAt(i,e,t))),onNegate:(e,t)=>this.negate(e,t),onConditionChange:(e,t)=>{this.openState=this.openState.expect(t),this.applyEdit((i=>this.walker.replaceAt(i,e,t)))},onOpen:e=>{this.openState=this.openState.moveTo(e)}}}negate(e,t){const i=this.walker.negated(this.value,e,t);void 0!==i&&(this.openState=this.openState.expect(i),this.applyEdit((t=>this.walker.replaceAt(t,e,i))))}addLeaf(e,t){this.grow(e,this.adapter.createLeaf(t))}addGroup(e,t){var i,o;const n=null!==(o=null===(i=this.walker.groupAt(this.value,e))||void 0===i?void 0:i.combinator)&&void 0!==o?o:this.rootCombinator();this.grow(e,this.adapter.group(function(e){return d[e]}(n),[this.adapter.createLeaf(t)]))}grow(e,t){this.emitChange(this.isEmpty?this.adapter.group(this.rootCombinator(),[t]):this.walker.appendAt(this.value,e,t))}applyEdit(e){this.isEmpty||this.emitChange(e(this.value))}emitChange(e){this.readonly||this.disabled||this.change.emit(e)}get isEmpty(){return null==this.value}rootCombinator(){var e;return null!==(e=this.combinators[0])&&void 0!==e?e:"all"}static get watchers(){return{adapter:[{buildWalker:0}],value:[{syncOpenState:0}]}}static get style(){return'*,*:before,*::after{box-sizing:border-box}:host{display:flex;flex-direction:column;gap:1.5rem}.group{position:relative;display:flex;flex-direction:column;gap:1rem;padding:0.5rem;border-radius:0.75rem;background-color:rgb(var(--contrast-800), 0.15);transition:box-shadow 120ms ease}.group:before{content:"";position:absolute;top:1rem;bottom:calc(1rem + 1.75rem);left:0;width:0.125rem;transform:translateX(-50%);border-radius:1rem;background-color:var(--group-rail-color)}.group:has(>.group-header>limel-icon-button.delete-group:not([disabled]):hover),.group:has(>.group-header>limel-icon-button.delete-group:not([disabled]):focus-within){box-shadow:var(--shadow-error-state)}.group-header{display:flex;align-items:center;gap:0.5rem;min-height:2.5rem}limel-select.combinator{min-width:12rem}limel-icon-button.delete-group{margin-left:auto;opacity:0;transition:opacity 120ms ease}.group:hover>.group-header>limel-icon-button.delete-group,.group:focus-within>.group-header>limel-icon-button.delete-group{opacity:1}limel-chip.add-group{--lime-elevated-surface-background-color:transparent;--button-shadow-normal:none;isolation:isolate;position:relative;margin-right:auto}limel-chip.add-group:after{content:"";position:absolute;width:0.5rem;height:1.75rem;top:0;left:calc(0.5rem * -1 - 0.125rem / 2);border-width:0 0 0.125rem 0.125rem;border-color:var(--group-rail-color);border-style:solid;border-radius:0 0 0 0.5rem;transform:translateY(calc(-50% - 0.125rem / 2))}ul.rows{list-style:none;margin:0;display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;column-gap:0.5rem;row-gap:0.5rem;padding:0 0.5rem 0.5rem 0.5rem}li.row{list-style:none;position:relative}li.row.row--group{flex-basis:100%;align-self:stretch}li.row+li.row:before{content:attr(data-marker);color:var(--group-rail-color);font-size:0.75rem;font-weight:600;line-height:normal}li.row+li.row.row--group:before{position:absolute;left:0;top:0;transform:translate(-50%, -50%)}li.row+li.row:not(.row--group){display:inline-flex;align-items:center;flex-wrap:wrap}li.row+li.row:not(.row--group):before{margin-right:0.5rem}limel-popover.leaf{display:inline-block;max-width:25rem}.issue{color:rgb(var(--color-red-default));font-size:0.875rem;flex-basis:100%}'}},[1,"limebb-condition-tree",{platform:[16],context:[16],value:[8],adapter:[16],combinators:[16],addOptions:[16],addSearcher:[16],readonly:[516],disabled:[516],openState:[32]},void 0,{adapter:[{buildWalker:0}],value:[{syncOpenState:0}]}]);function $(){"undefined"!=typeof customElements&&["limebb-condition-tree","limebb-condition-tree-editor","limebb-filter-chip"].forEach((e=>{switch(e){case"limebb-condition-tree":customElements.get(r(e))||customElements.define(r(e),L);break;case"limebb-condition-tree-editor":customElements.get(r(e))||s();break;case"limebb-filter-chip":customElements.get(r(e))||a()}}))}export{L as C,$ as d}
1
+ import{h as e,proxyCustomElement as t,HTMLElement as i,createEvent as o,Host as n,transformTag as r}from"@stencil/core/internal/client";import{c as l}from"./condition-tree-translate.js";import{d as s}from"./condition-tree-editor.js";import{d as a}from"./filter-chip.js";const c=["all","any","not-all","none"],d={all:"any",any:"all","not-all":"any",none:"all"},u={all:{color:"rgb(var(--contrast-900))",iconName:"dot_circle",labelKey:"webclient.combinator.all",label:"All of the following",descriptionKey:"webclient.combinator.all.description",description:"Every condition must be met.",negated:!1,delimiterKey:"webclient.delimiter.and",delimiter:"&"},any:{color:"rgb(var(--color-sky-default))",iconName:"centre_point",labelKey:"webclient.combinator.any",label:"Any of the following",descriptionKey:"webclient.combinator.any.description",description:"At least one condition must be met.",negated:!1,delimiterKey:"webclient.delimiter.or",delimiter:"or"},"not-all":{color:"rgb(var(--color-orange-default))",iconName:"dot_circle",labelKey:"webclient.combinator.not-all",label:"Not all of the following",descriptionKey:"webclient.combinator.not-all.description",description:"At least one condition must not be met.",negated:!0,delimiterKey:"webclient.delimiter.and",delimiter:"&"},none:{color:"rgb(var(--color-red-default))",iconName:"centre_point",labelKey:"webclient.combinator.none",label:"None of the following",descriptionKey:"webclient.combinator.none.description",description:"No conditions may be met.",negated:!0,delimiterKey:"webclient.delimiter.or",delimiter:"or"}};function h(e){return 0===e.length?"root":e.join(".")}class p{constructor(e,t=()=>!1){this.adapter=e,this.isVisited=t}describe(e){return this.adapter.describe(e,{visited:this.isVisited(e)})}groupOf(e){const t=this.describe(e);return"group"===t.kind?t:void 0}childrenOf(e){var t;return null===(t=this.groupOf(e))||void 0===t?void 0:t.children}nodeAt(e,t){let i=e;for(const e of t){if(void 0===i)return;const t=this.childrenOf(i);if(!t)return;i=t[e]}return i}groupAt(e,t){const i=this.nodeAt(e,t);return void 0===i?void 0:this.groupOf(i)}contains(e,t){if(void 0===e)return!1;if(e===t)return!0;const i=this.childrenOf(e);return!!(null==i?void 0:i.some((e=>this.contains(e,t))))}autoOpenNodes(e){if(void 0===e)return[];const t=this.describe(e);return"leaf"===t.kind?t.autoOpen?[e]:[]:t.children.flatMap((e=>this.autoOpenNodes(e)))}replaceAt(e,t,i){if(0===t.length)return i;const o=this.groupOf(e);if(!o)return e;const[n,...r]=t,l=o.children;if(!(n in l))return e;const s=this.replaceAt(l[n],r,i);return this.rebuild(o.combinator,function(e,t,i){return[...e.slice(0,t),...void 0===i?[]:[i],...e.slice(t+1)]}(l,n,s))}appendAt(e,t,i){const o=this.groupAt(e,t);return o?this.replaceAt(e,t,this.adapter.group(o.combinator,[...o.children,i])):e}rejoinAt(e,t,i){const o=this.groupAt(e,t);return o?this.replaceAt(e,t,this.adapter.group(i,o.children)):e}negated(e,t,i){const o=this.nodeAt(e,t);if(void 0!==o&&this.adapter.negate)return this.adapter.negate(o,i)}rebuild(e,t){if(0!==t.length)return this.adapter.group(e,t)}}class m{constructor(e){this.fields=e}static empty(){return new m({open:null,pending:null,seen:new Set,autoOpened:new Set})}get openNode(){return this.fields.open}hasSeen(e){return this.fields.seen.has(e)}moveTo(e){const t=this.fields.open,i=this.with({open:e,pending:null});return null===t||t===e?i:i.with({seen:new Set(this.fields.seen).add(t)})}expect(e){return this.with({pending:e})}sync(e,t){return this.followPending(e,t).openWhatAsks(e,t).dropIfGone(e,t)}with(e){return new m(Object.assign(Object.assign({},this.fields),e))}followPending(e,t){return null===this.fields.pending?this:t.contains(e,this.fields.pending)?this.with({open:this.fields.pending,pending:null}):this}openWhatAsks(e,t){const i=t.autoOpenNodes(e),o=i.find((e=>!this.fields.autoOpened.has(e))),n=this.with({autoOpened:new Set(i)});return void 0===o?n:n.moveTo(o)}dropIfGone(e,t){return null===this.fields.open||t.contains(e,this.fields.open)?this:this.with({open:null})}}const b=t=>{var i;return(null===(i=t.issues)||void 0===i?void 0:i.length)?t.issues.map((t=>e("div",{class:"issue"},t))):null},g=(e,t)=>i=>{i.stopPropagation(),t.onDelete(e)},f=t=>{const{node:i,description:o,path:n,ctx:r}=t,l=r.openNode===i;return[e("limel-popover",{class:"leaf",key:h(n),open:l,openDirection:"bottom-start",onClose:x(r)},e(v,{node:i,description:o,path:n,ctx:r}),e("limebb-condition-tree-editor",{platform:r.platform,context:r.context,open:l,editor:o.editor,value:i,heading:o.chip.label,icon:o.chip.icon,negated:r.negatable?o.negated:void 0,readonly:r.readonly,disabled:r.disabled,onNegateChange:k(n,r),onConditionChange:C(n,r)})),e(b,{issues:o.issues})]},v=t=>{const{component:i}=t.description.chip;return i?e(i.name,Object.assign({},i.props,w(t))):e("limebb-filter-chip",Object.assign({},w(t)))};function w(e){const{node:t,description:i,path:o,ctx:n}=e,{chip:r}=i;return{slot:"trigger",platform:n.platform,label:r.label,value:r.value,icon:r.icon,invalid:r.invalid,selected:n.openNode===t,readonly:n.readonly,disabled:n.disabled,removable:!n.readonly,onClick:y(t,i,n),onRemove:g(o,n)}}const y=(e,t,i)=>()=>{(function(e,t){return!!e.editor||t.negatable&&void 0!==e.negated})(t,i)&&!i.disabled&&i.onOpen(e)},x=e=>t=>{t.stopPropagation(),e.onOpen(null)},k=(e,t)=>i=>{i.stopPropagation(),t.onNegate(e,i.detail)},C=(e,t)=>i=>{i.stopPropagation(),t.onConditionChange(e,i.detail)},O=t=>{const{description:i}=t;return"group"===i.kind?e(A,{description:i,path:t.path,ctx:t.ctx}):e(f,{node:t.node,description:i,path:t.path,ctx:t.ctx})},A=t=>{const{description:i,path:o,ctx:n,placeholder:r}=t,l=u[i.combinator],s=n.translate(l.delimiterKey,l.delimiter),a=l.negated?`${n.translate("webclient.delimiter.not","not")} ${s}`:s;return e("div",{class:"group",key:h(o),"data-combinator":i.combinator,style:{"--group-rail-color":l.color}},e("div",{class:"group-header"},function(t,i,o){if(!(t.children.length>1)&&!u[t.combinator].negated)return null;const n=function(e,t){const i=[...e.combinators];return t&&!i.includes(t)&&i.push(t),i.map((t=>{const i=u[t];return{value:t,text:e.translate(i.labelKey,i.label),secondaryText:e.translate(i.descriptionKey,i.description),icon:{name:i.iconName,color:i.color}}}))}(o,t.combinator);return e("limel-select",{class:"combinator",value:n.find((e=>e.value===t.combinator)),options:n,disabled:o.disabled,readonly:o.readonly,onChange:j(i,o)})}(i,o,n),function(t,i,o){return i.readonly?null:e("limel-icon-button",{class:"delete-group",icon:"trash",label:i.translate("webclient.delete-group","Delete this group"),disabled:i.disabled||!!o,onClick:g(t,i)})}(o,n,r)),e(b,{issues:i.issues}),e("ul",{class:"rows"},i.children.map(((t,i)=>{const r=n.walker.describe(t);return e("li",{class:{row:!0,"row--group":"group"===r.kind},"data-marker":a,key:h([...o,i])},e(O,{node:t,description:r,path:[...o,i],ctx:n}))})),function(t,i,o){if(o.readonly)return null;const n=e("limel-chip",{slot:K(o)?"trigger":void 0,class:"add-condition",text:o.translate("webclient.condition","Condition"),disabled:o.disabled||N(o),icon:S(o),onClick:K(o)?void 0:W(t,o)});return e("li",{class:"row","data-marker":i,key:`${h(t)}.add`},E(n,"add-condition-menu",_(t,o),o))}(o,a,n)),function(t,i){if(i.readonly)return null;return E(e("limel-chip",{slot:K(i)?"trigger":void 0,class:"add-group",size:"small",text:i.translate("webclient.group","Group"),disabled:i.disabled||N(i),icon:S(i,"var(--group-rail-color)"),onClick:K(i)?void 0:z(t,i)}),"add-group-menu",D(t,i),i)}(o,n))};function S(e,t){return{name:"plus_math",title:e.translate("webclient.add","Add"),color:t}}function K(e){return!!e.addOptions}function N(e){var t;return 0===(null===(t=e.addOptions)||void 0===t?void 0:t.length)}function E(t,i,o,n){return K(n)?e("limel-menu",{class:i,items:n.addOptions,searcher:n.addSearcher,openDirection:"bottom-start",onSelect:o},t):t}const j=(e,t)=>i=>{var o;i.stopPropagation();const n=null===(o=i.detail)||void 0===o?void 0:o.value;n&&t.onCombinator(e,n)},W=(e,t)=>()=>t.onAddLeaf(e),_=(e,t)=>i=>{i.stopPropagation(),t.onAddLeaf(e,i.detail)},z=(e,t)=>()=>t.onAddGroup(e),D=(e,t)=>i=>{i.stopPropagation(),t.onAddGroup(e,i.detail)},G={kind:"group",combinator:"all",children:[]},L=t(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.change=o(this,"change",7),this.combinators=[...c],this.readonly=!1,this.disabled=!1,this.openState=m.empty()}componentWillLoad(){this.buildWalker()}buildWalker(){this.walker=new p(this.adapter,(e=>this.openState.hasSeen(e))),this.syncOpenState()}syncOpenState(){this.adapter&&(this.openState=this.openState.sync(this.value,this.walker))}render(){return this.adapter?e(n,null,this.isEmpty?this.renderEmptyState():e(O,{node:this.value,description:this.walker.describe(this.value),path:[],ctx:this.renderContext()})):e(n,null)}renderEmptyState(){return this.readonly?null:e(A,{description:G,path:[],ctx:this.renderContext(),placeholder:!0})}renderContext(){return{platform:this.platform,context:this.context,walker:this.walker,translate:l(this.platform),combinators:this.combinators,readonly:this.readonly,disabled:this.disabled,negatable:!!this.adapter.negate,openNode:this.openState.openNode,addOptions:this.addOptions,addSearcher:this.addSearcher,onAddLeaf:(e,t)=>this.addLeaf(e,t),onAddGroup:(e,t)=>this.addGroup(e,t),onDelete:e=>this.applyEdit((t=>this.walker.replaceAt(t,e,void 0))),onCombinator:(e,t)=>this.applyEdit((i=>this.walker.rejoinAt(i,e,t))),onNegate:(e,t)=>this.negate(e,t),onConditionChange:(e,t)=>{this.openState=this.openState.expect(t),this.applyEdit((i=>this.walker.replaceAt(i,e,t)))},onOpen:e=>{this.openState=this.openState.moveTo(e)}}}negate(e,t){const i=this.walker.negated(this.value,e,t);void 0!==i&&(this.openState=this.openState.expect(i),this.applyEdit((t=>this.walker.replaceAt(t,e,i))))}addLeaf(e,t){this.grow(e,this.adapter.createLeaf(t))}addGroup(e,t){var i,o;const n=null!==(o=null===(i=this.walker.groupAt(this.value,e))||void 0===i?void 0:i.combinator)&&void 0!==o?o:this.rootCombinator();this.grow(e,this.adapter.group(function(e){return d[e]}(n),[this.adapter.createLeaf(t)]))}grow(e,t){this.emitChange(this.isEmpty?this.adapter.group(this.rootCombinator(),[t]):this.walker.appendAt(this.value,e,t))}applyEdit(e){this.isEmpty||this.emitChange(e(this.value))}emitChange(e){this.readonly||this.disabled||this.change.emit(e)}get isEmpty(){return null==this.value}rootCombinator(){var e;return null!==(e=this.combinators[0])&&void 0!==e?e:"all"}static get watchers(){return{adapter:[{buildWalker:0}],value:[{syncOpenState:0}]}}static get style(){return'*,*:before,*::after{box-sizing:border-box}:host{display:flex;flex-direction:column;gap:1.5rem}.group{position:relative;display:flex;flex-direction:column;gap:1rem;padding:0.5rem;border-radius:0.75rem;background-color:rgb(var(--contrast-800), 0.15);transition:box-shadow 120ms ease}.group:before{content:"";position:absolute;top:1rem;bottom:calc(1rem + 1.75rem);left:0;width:0.125rem;transform:translateX(-50%);border-radius:1rem;background-color:var(--group-rail-color)}.group:has(>.group-header>limel-icon-button.delete-group:not([disabled]):hover),.group:has(>.group-header>limel-icon-button.delete-group:not([disabled]):focus-within){box-shadow:var(--shadow-error-state)}.group-header{display:flex;align-items:center;gap:0.5rem;min-height:2.5rem}limel-select.combinator{min-width:12rem}limel-icon-button.delete-group{margin-left:auto;opacity:0;transition:opacity 120ms ease}.group:hover>.group-header>limel-icon-button.delete-group,.group:focus-within>.group-header>limel-icon-button.delete-group{opacity:1}limel-chip.add-group{--lime-elevated-surface-background-color:transparent;--button-shadow-normal:none;isolation:isolate;position:relative;margin-right:auto}limel-chip.add-group:after{content:"";position:absolute;width:0.5rem;height:1.75rem;top:0;left:calc(0.5rem * -1 - 0.125rem / 2);border-width:0 0 0.125rem 0.125rem;border-color:var(--group-rail-color);border-style:solid;border-radius:0 0 0 0.5rem;transform:translateY(calc(-50% - 0.125rem / 2))}ul.rows{list-style:none;margin:0;display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;column-gap:0.5rem;row-gap:0.5rem;padding:0 0.5rem 0.5rem 0.5rem}li.row{list-style:none;position:relative}li.row.row--group{flex-basis:100%;align-self:stretch}li.row+li.row:before{content:attr(data-marker);color:var(--group-rail-color);font-size:0.75rem;font-weight:600;line-height:normal}li.row+li.row.row--group:before{position:absolute;left:0;top:0;transform:translate(-50%, -50%)}li.row+li.row:not(.row--group){display:inline-flex;align-items:center;flex-wrap:wrap}li.row+li.row:not(.row--group):before{margin-right:0.5rem}limel-popover.leaf{display:inline-block;max-width:25rem}.issue{color:rgb(var(--color-red-default));font-size:0.875rem;flex-basis:100%}'}},[1,"limebb-condition-tree",{platform:[16],context:[16],value:[8],adapter:[16],combinators:[16],addOptions:[16],addSearcher:[16],readonly:[516],disabled:[516],openState:[32]},void 0,{adapter:[{buildWalker:0}],value:[{syncOpenState:0}]}]);function $(){"undefined"!=typeof customElements&&["limebb-condition-tree","limebb-condition-tree-editor","limebb-filter-chip"].forEach((e=>{switch(e){case"limebb-condition-tree":customElements.get(r(e))||customElements.define(r(e),L);break;case"limebb-condition-tree-editor":customElements.get(r(e))||s();break;case"limebb-filter-chip":customElements.get(r(e))||a()}}))}export{L as C,$ as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as i,createEvent as e,h as s,transformTag as n}from"@stencil/core/internal/client";const o=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.remove=e(this,"remove",7),this.negated=!1,this.invalid=!1,this.selected=!1,this.readonly=!1,this.disabled=!1,this.removable=!0,this.handleRemove=t=>{t.stopPropagation(),this.remove.emit()}}render(){return s("limel-chip",{key:"3b1e45748efbdd1bdbf8effd7bca4976f9ba537c",text:this.text,icon:this.glyph,invalid:this.invalid,selected:this.selected,disabled:this.disabled,removable:this.removable&&!this.readonly,onRemove:this.handleRemove})}get glyph(){return this.icon&&this.iconColor?{name:this.icon,color:this.iconColor}:this.icon}get text(){return this.negated?"¬ "+this.label:this.label}static get style(){return":host{display:inline-flex;min-width:0}"}},[1,"limebb-rule-condition-chip",{platform:[16],label:[1],icon:[1],iconColor:[1,"icon-color"],negated:[4],invalid:[516],selected:[516],readonly:[516],disabled:[516],removable:[4]}]),h=o,l=function(){"undefined"!=typeof customElements&&["limebb-rule-condition-chip"].forEach((t=>{"limebb-rule-condition-chip"===t&&(customElements.get(n(t))||customElements.define(n(t),o))}))};export{h as LimebbRuleConditionChip,l as defineCustomElement}
1
+ import{proxyCustomElement as t,HTMLElement as i,createEvent as e,h as o,transformTag as n}from"@stencil/core/internal/client";import{c as s}from"./condition-tree-translate.js";import{c as l}from"./random-string.js";const r=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.remove=e(this,"remove",7),this.negated=!1,this.invalid=!1,this.selected=!1,this.readonly=!1,this.disabled=!1,this.removable=!0,this.chipId="rule-condition-chip-"+l(),this.handleRemove=t=>{t.stopPropagation(),this.remove.emit()}}render(){return[o("limel-chip",{key:"f5b4e4c7ea6a2538fbffc683f25c1119309b3c43",id:this.chipId,text:this.label,icon:this.glyph,invalid:this.invalid,selected:this.selected,disabled:this.disabled,removable:this.removable&&!this.readonly,onRemove:this.handleRemove}),this.renderPolarityTooltip()]}renderPolarityTooltip(){const t=s(this.platform);return o("limel-tooltip",{elementId:this.chipId,label:this.label,helperLabel:this.negated?t("webclient.rule-editor.negated-condition","This condition must not be met."):t("webclient.rule-editor.affirmed-condition","This condition must be met.")})}get glyph(){return this.negated?"cancel_2":"ok"}static get style(){return":host{display:inline-flex;min-width:0}"}},[1,"limebb-rule-condition-chip",{platform:[16],label:[1],icon:[1],iconColor:[1,"icon-color"],negated:[4],invalid:[516],selected:[516],readonly:[516],disabled:[516],removable:[4]}]),c=r,h=function(){"undefined"!=typeof customElements&&["limebb-rule-condition-chip"].forEach((t=>{"limebb-rule-condition-chip"===t&&(customElements.get(n(t))||customElements.define(n(t),r))}))};export{c as LimebbRuleConditionChip,h as defineCustomElement}
@@ -1 +1 @@
1
- import{h as e,proxyCustomElement as t,HTMLElement as i,createEvent as l,Host as s,transformTag as n}from"@stencil/core/internal/client";import{M as o,n as r}from"./index.esm.js";import{d as a,c as h}from"./condition-tree-editor.js";import{c as d,g as c}from"./condition-tree-adapter.js";import{r as u,b as m,A as b}from"./rule-editor-modes.js";import{c as p}from"./random-string.js";import{d as f}from"./condition-tree.js";import{d as v}from"./filter-chip.js";function g(e,t){let i=e,l=0;for(;l<t.length;){if(null===i||"object"!=typeof i)return;const e=t[l];if("rule"===e&&"not"===i.type){i=i.rule,l+=1;continue}const s=t[l+1];if("rules"!==e||"all"!==i.type&&"any"!==i.type||!Array.isArray(i.rules)||"number"!=typeof s)return;i=i.rules[s],l+=2}return i}function w(e,t){return e.title?t.get(e.title):e.id}function y(e,t){return e.reads.every((e=>t.has(e)))}function x(e){return t=>Promise.resolve(function(e,t){if(!t)return e;const i=t.toLocaleLowerCase().split(/\s+/);return e.filter((e=>i.every((t=>{var i,l;return e.text.toLocaleLowerCase().includes(t)||(null===(i=e.secondaryText)||void 0===i?void 0:i.toLocaleLowerCase().includes(t))||((null!==(l=e.value)&&void 0!==l?l:"")+"").toLocaleLowerCase().includes(t)}))))}(e,t))}const C={never:"webclient.never",always:"webclient.always",conditional:"webclient.conditionally"},M=t=>{const{modes:i,selected:l,disabled:s,translator:n,onModeChange:o}=t;return e("limel-button-group",{value:i.map((e=>({id:e,title:n.get(C[e]),selected:e===l}))),disabled:s,onChange:e=>{e.stopPropagation(),o(e.detail.id)}})};const j=t(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.change=l(this,"change",7),this.modeOverride=null,this.metadataById=new Map,this.primitiveTitles=new Map,this.availablePrimitiveOptions=[],this.searcher=x([]),this.issuesByNode=new Map,this.created=new WeakSet,this.reachableSlots=new Set,this.normalizedCache=null,this.hasLoaded=!1,this.labelId=p(),this.helperTextId=p(),this.handleModeChange=e=>{var t;"conditional"===this.currentMode&&(this.stashedTree=this.value),"conditional"!==e&&(this.created=new WeakSet),this.modeOverride=e,this.change.emit(null!==(t=u(e))&&void 0!==t?t:this.stashedTree)},this.handleTreeChange=e=>{var t;e.stopPropagation(),this.modeOverride="conditional",this.change.emit(null!==(t=e.detail)&&void 0!==t?t:void 0)}}componentWillLoad(){this.rebuildFromRegistries()}rebuildFromRegistries(){this.computeReachableSlots(),this.indexMetadata(),this.rebuildAvailableOptions(),this.runValidation(),this.rebuildAdapter()}connectedCallback(){this.hasLoaded&&(this.computeReachableSlots(),this.rebuildAvailableOptions(),this.runValidation(),this.rebuildAdapter())}componentDidLoad(){this.hasLoaded=!0,this.emitNormalization()}onValueChange(){this.clearReachedModeOverride(),this.emitNormalization()||this.runValidation()}onAvailableContextsChange(){this.rebuildFromRegistries()}render(){return e(s,{key:"eb89af0c748f82d8e60b1209c4fcce3475ac2934"},this.renderHelp(),e("limel-notched-outline",{key:"9d454ec87268aa9ff07776d38882365a544a64e7",label:this.label,labelId:this.labelId,required:this.required,readonly:this.readonly,disabled:this.disabled,invalid:this.invalid,hasValue:!0,hasFloatingLabel:!0},e("div",{key:"57293e75c641d4909a4d2e1d3a3d2c20a60a4512",slot:"content",class:{"rule-editor":!0,"rule-editor--disabled":this.disabled},role:"group","aria-labelledby":this.label?this.labelId:void 0,"aria-describedby":this.helperText?this.helperTextId:void 0},this.renderModes(),this.renderTree())),this.renderHelperLine())}renderModes(){const t=this.modes,i=this.currentMode;return t&&i?e(M,{modes:t,selected:i,disabled:this.disabled||this.readonly,translator:this.translator,onModeChange:this.handleModeChange}):null}renderTree(){const t=this.currentMode;return t&&"conditional"!==t?null:e("limebb-condition-tree",{platform:this.platform,context:this.effectiveContext,value:this.normalizedValue,adapter:this.adapter,addOptions:this.availablePrimitiveOptions,addSearcher:this.searcher,readonly:this.readonly,disabled:this.disabled,onChange:this.handleTreeChange})}renderHelperLine(){return this.helperText?e("limel-helper-line",{helperText:this.helperText,helperTextId:this.helperTextId,invalid:this.invalid}):null}renderHelp(){return this.help?e("limel-help",{value:this.help}):null}get currentMode(){var e,t;const i=this.modes;if(null==i?void 0:i.length)return null!==(t=null!==(e=this.modeOverride)&&void 0!==e?e:m(this.value))&&void 0!==t?t:i[0]}clearReachedModeOverride(){const e=m(this.value);void 0!==e&&e!==this.modeOverride&&(this.modeOverride=null)}indexMetadata(){var e,t,i;const l=null!==(i=null===(t=(e=this.ruleRegistry).listMetadata)||void 0===t?void 0:t.call(e))&&void 0!==i?i:[];this.metadataById=new Map(l.map((e=>[e.id,e]))),this.primitiveTitles=new Map(l.map((e=>[e.id,w(e,this.translator)])))}rebuildAvailableOptions(){this.availablePrimitiveOptions=function(e,t){return[...e.values()].map((e=>({value:e.id,text:w(e,t),secondaryText:e.description?t.get(e.description):"",icon:e.icon}))).sort(((e,t)=>e.text.localeCompare(t.text)))}(this.availablePrimitiveMetadata(),this.translator),this.searcher=x(this.availablePrimitiveOptions)}availablePrimitiveMetadata(){const e=new Map;for(const[t,i]of this.metadataById)t!==b&&y(i,this.reachableSlots)&&e.set(t,i);return e}computeReachableSlots(){var e;const t=this.contextRegistry,i=t.list().map((e=>e.id)).filter((e=>void 0!==t.get(e,this.host)));this.reachableSlots=new Set([...i,...null!==(e=this.availableContexts)&&void 0!==e?e:[]])}runValidation(){this.issuesByNode=this.findIssues()}findIssues(){const e=this.normalizedValue;if(!e)return new Map;try{const t=this.ruleRegistry.validate(e,[...this.reachableSlots]);return t.ok?new Map:function(e,t){var i,l;const s=function(e){const t=new Map,i=(e,l)=>{if("object"==typeof e&&null!==e)if(t.set(e,l),"not"!==e.type){if(("all"===e.type||"any"===e.type)&&Array.isArray(e.rules))for(const t of e.rules)i(t,t)}else i(e.rule,l)};return i(e,e),t}(e),n=new Map;for(const o of t){const t=g(e,o.path),r=null!==(i=t&&s.get(t))&&void 0!==i?i:e;n.set(r,[...null!==(l=n.get(r))&&void 0!==l?l:[],o.message])}return n}(e,t.issues)}catch(t){return console.warn("rule-editor could not validate the rule",{rule:e,error:t}),new Map}}rebuildAdapter(){this.adapter=d({metadata:this.metadataById,titles:this.primitiveTitles,translate:h(this.platform),issues:()=>this.issuesByNode,created:()=>this.created})}get normalizedValue(){if(!this.value)return;const e=this.currentMode;if(null!==this.normalizedCache&&this.normalizedCache.source===this.value&&this.normalizedCache.mode===e)return this.normalizedCache.normalized;const t=function(e,t){return"always"===t||"never"===t||c(e)?e:{type:"all",rules:[e]}}(this.value,e);return this.normalizedCache={source:this.value,mode:e,normalized:t},t}emitNormalization(){if(!this.value)return!1;const e=this.normalizedValue;return e!==this.value&&(this.change.emit(e),!0)}get ruleRegistry(){return this.platform.get(r.RuleRegistry)}get translator(){return this.platform.get(r.Translate)}get contextRegistry(){return this.platform.get(r.ContextRegistry)}get effectiveContext(){var e,t;return(null===(e=this.context)||void 0===e?void 0:e.limetype)?this.context:(null===(t=this.resolvedContext)||void 0===t?void 0:t.limetype)?this.resolvedContext:k}get host(){return this}static get watchers(){return{value:[{onValueChange:0}],availableContexts:[{onAvailableContextsChange:0}]}}static get style(){return'@charset "UTF-8";:host{display:block;position:relative}.limel-notched-outline{--limel-notched-outline-background-color:transparent;padding:0.5rem 0 0 0}limel-notched-outline:not([invalid]:not([invalid=false])) .limel-notched-outline{--limel-notched-outline-border-color:transparent}.rule-editor--disabled{opacity:0.6;pointer-events:none}limebb-condition-tree{--popover-surface-width:min(calc(100vw - 4rem), 50rem)}:host(limebb-rule-editor:focus),:host(limebb-rule-editor:focus-visible),:host(limebb-rule-editor:focus-within){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limebb-rule-editor){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}:host(limebb-rule-editor:focus) limel-helper-line,:host(limebb-rule-editor:focus-visible) limel-helper-line,:host(limebb-rule-editor:focus-within) limel-helper-line,:host(limebb-rule-editor:hover) limel-helper-line{will-change:grid-template-rows}limel-help{position:absolute;top:calc(var(--form-row-gap, 1rem) * -0.5);left:calc(var(--form-column-gap, 1rem) * -0.5);z-index:1}'}},[1,"limebb-rule-editor",{platform:[16],context:[16],value:[16],availableContexts:[16],modes:[16],required:[516],readonly:[516],disabled:[516],invalid:[516],label:[513],helperText:[1,"helper-text"],help:[1],resolvedContext:[32],modeOverride:[32],availablePrimitiveOptions:[32],adapter:[32]},void 0,{value:[{onValueChange:0}],availableContexts:[{onAvailableContextsChange:0}]}]);!function(e,t,i,l){var s,n=arguments.length,o=n<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,l);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(o=(n<3?s(o):n>3?s(t,i,o):s(t,i))||o);n>3&&o&&Object.defineProperty(t,i,o)}([o("context")],j.prototype,"resolvedContext",void 0);const k=Object.freeze({limetype:null,id:null}),A=j,O=function(){"undefined"!=typeof customElements&&["limebb-rule-editor","limebb-condition-tree","limebb-condition-tree-editor","limebb-filter-chip"].forEach((e=>{switch(e){case"limebb-rule-editor":customElements.get(n(e))||customElements.define(n(e),j);break;case"limebb-condition-tree":customElements.get(n(e))||f();break;case"limebb-condition-tree-editor":customElements.get(n(e))||a();break;case"limebb-filter-chip":customElements.get(n(e))||v()}}))};export{A as LimebbRuleEditor,O as defineCustomElement}
1
+ import{h as e,proxyCustomElement as t,HTMLElement as i,createEvent as l,Host as s,transformTag as n}from"@stencil/core/internal/client";import{M as o,n as r}from"./index.esm.js";import{c as a}from"./condition-tree-translate.js";import{c as h,g as d}from"./condition-tree-adapter.js";import{c}from"./random-string.js";import{r as u,b as m,A as b}from"./rule-editor-modes.js";import{d as p}from"./condition-tree.js";import{d as f}from"./condition-tree-editor.js";import{d as v}from"./filter-chip.js";function g(e,t){let i=e,l=0;for(;l<t.length;){if(null===i||"object"!=typeof i)return;const e=t[l];if("rule"===e&&"not"===i.type){i=i.rule,l+=1;continue}const s=t[l+1];if("rules"!==e||"all"!==i.type&&"any"!==i.type||!Array.isArray(i.rules)||"number"!=typeof s)return;i=i.rules[s],l+=2}return i}function w(e,t){return e.title?t.get(e.title):e.id}function y(e,t){return e.reads.every((e=>t.has(e)))}function x(e){return t=>Promise.resolve(function(e,t){if(!t)return e;const i=t.toLocaleLowerCase().split(/\s+/);return e.filter((e=>i.every((t=>{var i,l;return e.text.toLocaleLowerCase().includes(t)||(null===(i=e.secondaryText)||void 0===i?void 0:i.toLocaleLowerCase().includes(t))||((null!==(l=e.value)&&void 0!==l?l:"")+"").toLocaleLowerCase().includes(t)}))))}(e,t))}const C={never:"webclient.never",always:"webclient.always",conditional:"webclient.conditionally"},M=t=>{const{modes:i,selected:l,disabled:s,translator:n,onModeChange:o}=t;return e("limel-button-group",{value:i.map((e=>({id:e,title:n.get(C[e]),selected:e===l}))),disabled:s,onChange:e=>{e.stopPropagation(),o(e.detail.id)}})};const j=t(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.change=l(this,"change",7),this.modeOverride=null,this.metadataById=new Map,this.primitiveTitles=new Map,this.availablePrimitiveOptions=[],this.searcher=x([]),this.issuesByNode=new Map,this.created=new WeakSet,this.reachableSlots=new Set,this.normalizedCache=null,this.hasLoaded=!1,this.labelId=c(),this.helperTextId=c(),this.handleModeChange=e=>{var t;"conditional"===this.currentMode&&(this.stashedTree=this.value),"conditional"!==e&&(this.created=new WeakSet),this.modeOverride=e,this.change.emit(null!==(t=u(e))&&void 0!==t?t:this.stashedTree)},this.handleTreeChange=e=>{var t;e.stopPropagation(),this.modeOverride="conditional",this.change.emit(null!==(t=e.detail)&&void 0!==t?t:void 0)}}componentWillLoad(){this.rebuildFromRegistries()}rebuildFromRegistries(){this.computeReachableSlots(),this.indexMetadata(),this.rebuildAvailableOptions(),this.runValidation(),this.rebuildAdapter()}connectedCallback(){this.hasLoaded&&(this.computeReachableSlots(),this.rebuildAvailableOptions(),this.runValidation(),this.rebuildAdapter())}componentDidLoad(){this.hasLoaded=!0,this.emitNormalization()}onValueChange(){this.clearReachedModeOverride(),this.emitNormalization()||this.runValidation()}onAvailableContextsChange(){this.rebuildFromRegistries()}render(){return e(s,{key:"eb89af0c748f82d8e60b1209c4fcce3475ac2934"},this.renderHelp(),e("limel-notched-outline",{key:"9d454ec87268aa9ff07776d38882365a544a64e7",label:this.label,labelId:this.labelId,required:this.required,readonly:this.readonly,disabled:this.disabled,invalid:this.invalid,hasValue:!0,hasFloatingLabel:!0},e("div",{key:"57293e75c641d4909a4d2e1d3a3d2c20a60a4512",slot:"content",class:{"rule-editor":!0,"rule-editor--disabled":this.disabled},role:"group","aria-labelledby":this.label?this.labelId:void 0,"aria-describedby":this.helperText?this.helperTextId:void 0},this.renderModes(),this.renderTree())),this.renderHelperLine())}renderModes(){const t=this.modes,i=this.currentMode;return t&&i?e(M,{modes:t,selected:i,disabled:this.disabled||this.readonly,translator:this.translator,onModeChange:this.handleModeChange}):null}renderTree(){const t=this.currentMode;return t&&"conditional"!==t?null:e("limebb-condition-tree",{platform:this.platform,context:this.effectiveContext,value:this.normalizedValue,adapter:this.adapter,addOptions:this.availablePrimitiveOptions,addSearcher:this.searcher,readonly:this.readonly,disabled:this.disabled,onChange:this.handleTreeChange})}renderHelperLine(){return this.helperText?e("limel-helper-line",{helperText:this.helperText,helperTextId:this.helperTextId,invalid:this.invalid}):null}renderHelp(){return this.help?e("limel-help",{value:this.help}):null}get currentMode(){var e,t;const i=this.modes;if(null==i?void 0:i.length)return null!==(t=null!==(e=this.modeOverride)&&void 0!==e?e:m(this.value))&&void 0!==t?t:i[0]}clearReachedModeOverride(){const e=m(this.value);void 0!==e&&e!==this.modeOverride&&(this.modeOverride=null)}indexMetadata(){var e,t,i;const l=null!==(i=null===(t=(e=this.ruleRegistry).listMetadata)||void 0===t?void 0:t.call(e))&&void 0!==i?i:[];this.metadataById=new Map(l.map((e=>[e.id,e]))),this.primitiveTitles=new Map(l.map((e=>[e.id,w(e,this.translator)])))}rebuildAvailableOptions(){this.availablePrimitiveOptions=function(e,t){return[...e.values()].map((e=>({value:e.id,text:w(e,t),secondaryText:e.description?t.get(e.description):"",icon:e.icon}))).sort(((e,t)=>e.text.localeCompare(t.text)))}(this.availablePrimitiveMetadata(),this.translator),this.searcher=x(this.availablePrimitiveOptions)}availablePrimitiveMetadata(){const e=new Map;for(const[t,i]of this.metadataById)t!==b&&y(i,this.reachableSlots)&&e.set(t,i);return e}computeReachableSlots(){var e;const t=this.contextRegistry,i=t.list().map((e=>e.id)).filter((e=>void 0!==t.get(e,this.host)));this.reachableSlots=new Set([...i,...null!==(e=this.availableContexts)&&void 0!==e?e:[]])}runValidation(){this.issuesByNode=this.findIssues()}findIssues(){const e=this.normalizedValue;if(!e)return new Map;try{const t=this.ruleRegistry.validate(e,[...this.reachableSlots]);return t.ok?new Map:function(e,t){var i,l;const s=function(e){const t=new Map,i=(e,l)=>{if("object"==typeof e&&null!==e)if(t.set(e,l),"not"!==e.type){if(("all"===e.type||"any"===e.type)&&Array.isArray(e.rules))for(const t of e.rules)i(t,t)}else i(e.rule,l)};return i(e,e),t}(e),n=new Map;for(const o of t){const t=g(e,o.path),r=null!==(i=t&&s.get(t))&&void 0!==i?i:e;n.set(r,[...null!==(l=n.get(r))&&void 0!==l?l:[],o.message])}return n}(e,t.issues)}catch(t){return console.warn("rule-editor could not validate the rule",{rule:e,error:t}),new Map}}rebuildAdapter(){this.adapter=h({metadata:this.metadataById,titles:this.primitiveTitles,translate:a(this.platform),issues:()=>this.issuesByNode,created:()=>this.created})}get normalizedValue(){if(!this.value)return;const e=this.currentMode;if(null!==this.normalizedCache&&this.normalizedCache.source===this.value&&this.normalizedCache.mode===e)return this.normalizedCache.normalized;const t=function(e,t){return"always"===t||"never"===t||d(e)?e:{type:"all",rules:[e]}}(this.value,e);return this.normalizedCache={source:this.value,mode:e,normalized:t},t}emitNormalization(){if(!this.value)return!1;const e=this.normalizedValue;return e!==this.value&&(this.change.emit(e),!0)}get ruleRegistry(){return this.platform.get(r.RuleRegistry)}get translator(){return this.platform.get(r.Translate)}get contextRegistry(){return this.platform.get(r.ContextRegistry)}get effectiveContext(){var e,t;return(null===(e=this.context)||void 0===e?void 0:e.limetype)?this.context:(null===(t=this.resolvedContext)||void 0===t?void 0:t.limetype)?this.resolvedContext:k}get host(){return this}static get watchers(){return{value:[{onValueChange:0}],availableContexts:[{onAvailableContextsChange:0}]}}static get style(){return'@charset "UTF-8";:host{display:block;position:relative}.limel-notched-outline{--limel-notched-outline-background-color:transparent;padding:0.5rem 0 0 0}limel-notched-outline:not([invalid]:not([invalid=false])) .limel-notched-outline{--limel-notched-outline-border-color:transparent}.rule-editor--disabled{opacity:0.6;pointer-events:none}limebb-condition-tree{--popover-surface-width:min(calc(100vw - 4rem), 50rem)}:host(limebb-rule-editor:focus),:host(limebb-rule-editor:focus-visible),:host(limebb-rule-editor:focus-within){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limebb-rule-editor){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}:host(limebb-rule-editor:focus) limel-helper-line,:host(limebb-rule-editor:focus-visible) limel-helper-line,:host(limebb-rule-editor:focus-within) limel-helper-line,:host(limebb-rule-editor:hover) limel-helper-line{will-change:grid-template-rows}limel-help{position:absolute;top:calc(var(--form-row-gap, 1rem) * -0.5);left:calc(var(--form-column-gap, 1rem) * -0.5);z-index:1}'}},[1,"limebb-rule-editor",{platform:[16],context:[16],value:[16],availableContexts:[16],modes:[16],required:[516],readonly:[516],disabled:[516],invalid:[516],label:[513],helperText:[1,"helper-text"],help:[1],resolvedContext:[32],modeOverride:[32],availablePrimitiveOptions:[32],adapter:[32]},void 0,{value:[{onValueChange:0}],availableContexts:[{onAvailableContextsChange:0}]}]);!function(e,t,i,l){var s,n=arguments.length,o=n<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,l);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(o=(n<3?s(o):n>3?s(t,i,o):s(t,i))||o);n>3&&o&&Object.defineProperty(t,i,o)}([o("context")],j.prototype,"resolvedContext",void 0);const k=Object.freeze({limetype:null,id:null}),A=j,O=function(){"undefined"!=typeof customElements&&["limebb-rule-editor","limebb-condition-tree","limebb-condition-tree-editor","limebb-filter-chip"].forEach((e=>{switch(e){case"limebb-rule-editor":customElements.get(n(e))||customElements.define(n(e),j);break;case"limebb-condition-tree":customElements.get(n(e))||p();break;case"limebb-condition-tree-editor":customElements.get(n(e))||f();break;case"limebb-filter-chip":customElements.get(n(e))||v()}}))};export{A as LimebbRuleEditor,O as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as t,h as s,Host as i,transformTag as o}from"@stencil/core/internal/client";import{n}from"./index.esm.js";const l=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.shouldRender=!1}componentWillLoad(){this.evaluate()}disconnectedCallback(){var e;null===(e=this.stopSubscription)||void 0===e||e.call(this)}onRuleChange(){this.evaluate()}onScopeChange(){this.evaluate()}render(){return s(i,{key:"36ac8be5125b3a169160a699388f69641d8b4c1c",hidden:!this.shouldRender},s("slot",{key:"3b14a3726279f295e5983adab2b2f5f7b5c103ed"}))}get ruleRegistry(){return this.platform.get(n.RuleRegistry)}evaluate(){var e;if(null===(e=this.stopSubscription)||void 0===e||e.call(this),this.stopSubscription=void 0,this.rule)try{const e=this.ruleRegistry.compile(this.rule);if(this.scope)return void(this.shouldRender=e.evaluate(this.scope));this.stopSubscription=this.ruleRegistry.subscribe(e,{host:this.host},(e=>{this.shouldRender=e}))}catch(e){console.warn("rule-gate failed to compile rule; hiding slot",{rule:this.rule,error:e}),this.shouldRender=!1}else this.shouldRender=!0}get host(){return this}static get watchers(){return{rule:[{onRuleChange:0}],scope:[{onScopeChange:0}]}}static get style(){return":host{display:block}:host([hidden]){display:none}"}},[257,"limebb-rule-gate",{platform:[16],rule:[16],scope:[16],shouldRender:[32]},void 0,{rule:[{onRuleChange:0}],scope:[{onScopeChange:0}]}]),r=l,h=function(){"undefined"!=typeof customElements&&["limebb-rule-gate"].forEach((e=>{"limebb-rule-gate"===e&&(customElements.get(o(e))||customElements.define(o(e),l))}))};export{r as LimebbRuleGate,h as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as t,h as s,Host as i,transformTag as o}from"@stencil/core/internal/client";import{n}from"./index.esm.js";const l=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.shouldRender=!1}componentWillLoad(){this.evaluate()}disconnectedCallback(){var e;null===(e=this.stopSubscription)||void 0===e||e.call(this)}onRuleChange(){this.evaluate()}onScopeChange(){this.evaluate()}render(){return s(i,{key:"36ac8be5125b3a169160a699388f69641d8b4c1c",hidden:!this.shouldRender},s("slot",{key:"3b14a3726279f295e5983adab2b2f5f7b5c103ed"}))}get ruleRegistry(){return this.platform.get(n.RuleRegistry)}evaluate(){var e;if(null===(e=this.stopSubscription)||void 0===e||e.call(this),this.stopSubscription=void 0,this.rule)try{const e=this.ruleRegistry.compile(this.rule);if(this.scope)return void(this.shouldRender=e.evaluate(this.scope));this.stopSubscription=this.ruleRegistry.subscribe(e,{host:this.host},(e=>{this.shouldRender=e}))}catch(e){console.warn("rule-gate failed to compile rule; hiding slot",{rule:this.rule,error:e}),this.shouldRender=!1}else this.shouldRender=!0}get host(){return this}static get watchers(){return{rule:[{onRuleChange:0}],scope:[{onScopeChange:0}]}}static get style(){return":host(limebb-rule-gate){display:contents}:host(limebb-rule-gate[hidden]){display:none}"}},[257,"limebb-rule-gate",{platform:[16],rule:[16],scope:[16],shouldRender:[32]},void 0,{rule:[{onRuleChange:0}],scope:[{onScopeChange:0}]}]),r=l,h=function(){"undefined"!=typeof customElements&&["limebb-rule-gate"].forEach((e=>{"limebb-rule-gate"===e&&(customElements.get(o(e))||customElements.define(o(e),l))}))};export{r as LimebbRuleGate,h as defineCustomElement}
@@ -1,7 +1,23 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-BK566_jX.js';
2
+ import { c as createTranslator } from './condition-tree-translate-ZQptbaXF.js';
3
+ import { c as createRandomString } from './random-string-C2JP2nLw.js';
4
+ import './index.esm-C__n3hug.js';
2
5
 
3
6
  const ruleConditionChipCss = () => `:host{display:inline-flex;min-width:0}`;
4
7
 
8
+ /**
9
+ * The glyphs that say which way round a condition is: that it must hold, or
10
+ * that it must not.
11
+ *
12
+ * A plain tick and cross, rather than the `=` and the `≠` of the shared
13
+ * filter vocabulary. Those two read as the verb between a property and a value,
14
+ * and a rule condition has neither yet — a bare `≠` in front of a name
15
+ * reads as a sentence that was cut off. They become the right pair once a
16
+ * condition carries a value and the chip reads as one sentence; until then
17
+ * these say the only thing there is to say.
18
+ */
19
+ const AFFIRMED_ICON = 'ok';
20
+ const NEGATED_ICON = 'cancel_2';
5
21
  const RuleConditionChip = class {
6
22
  constructor(hostRef) {
7
23
  registerInstance(this, hostRef);
@@ -38,30 +54,50 @@ const RuleConditionChip = class {
38
54
  * from `limel-chip` also withholds the lock it puts on the cross.
39
55
  */
40
56
  this.removable = true;
57
+ /**
58
+ * What the tooltip attaches itself to. Its own, rather than the host's `id`:
59
+ * nothing outside sets one on a chip the tree creates, and the tooltip needs
60
+ * a target in the same shadow root either way.
61
+ */
62
+ this.chipId = 'rule-condition-chip-' + createRandomString();
41
63
  this.handleRemove = (event) => {
42
64
  event.stopPropagation();
43
65
  this.remove.emit();
44
66
  };
45
67
  }
46
68
  render() {
47
- return (h("limel-chip", { key: '3b1e45748efbdd1bdbf8effd7bca4976f9ba537c', text: this.text, icon: this.glyph, invalid: this.invalid, selected: this.selected, disabled: this.disabled, removable: this.removable && !this.readonly, onRemove: this.handleRemove }));
69
+ return [
70
+ h("limel-chip", { key: 'f5b4e4c7ea6a2538fbffc683f25c1119309b3c43', id: this.chipId, text: this.label, icon: this.glyph, invalid: this.invalid, selected: this.selected, disabled: this.disabled, removable: this.removable && !this.readonly, onRemove: this.handleRemove }),
71
+ this.renderPolarityTooltip(),
72
+ ];
48
73
  }
49
74
  /**
50
- * The glyph, with its colour put back on when it has one.
75
+ * What the polarity glyph means, in words.
76
+ *
77
+ * A glyph on its own is no better than the `¬` it replaces unless someone
78
+ * who does not recognize it can still find out what it means, and unless it
79
+ * reaches a screen reader. `limel-chip` cannot help with either: its
80
+ * accessible name is its `text` and it has no tooltip. `limel-tooltip`
81
+ * carries the wording on hover and sets `aria-describedby` on the chip, so
82
+ * the polarity is announced rather than merely drawn.
51
83
  */
52
- get glyph() {
53
- if (!this.icon || !this.iconColor) {
54
- return this.icon;
55
- }
56
- return { name: this.icon, color: this.iconColor };
84
+ renderPolarityTooltip() {
85
+ const translate = createTranslator(this.platform);
86
+ return (h("limel-tooltip", { elementId: this.chipId, label: this.label, helperLabel: this.negated
87
+ ? translate('webclient.rule-editor.negated-condition', 'This condition must not be met.')
88
+ : translate('webclient.rule-editor.affirmed-condition', 'This condition must be met.') }));
57
89
  }
58
90
  /**
59
- * The name, behind `¬` when negated — a symbol rather than a word, so it
60
- * does not compete with the "not" the tree writes between the rows of a
61
- * negated group.
91
+ * Which way round the condition is.
92
+ *
93
+ * It has the slot unconditionally, which is why `icon` and `iconColor` do
94
+ * not reach it: there is one slot, and which way round a condition is
95
+ * matters more than which kind of condition it is. No built-in primitive
96
+ * registers an icon, so in practice this withholds only the glyphs of the
97
+ * docs-app examples and of `legacy.*` conditions whose author set one.
62
98
  */
63
- get text() {
64
- return this.negated ? `¬ ${this.label}` : this.label;
99
+ get glyph() {
100
+ return this.negated ? NEGATED_ICON : AFFIRMED_ICON;
65
101
  }
66
102
  };
67
103
  RuleConditionChip.style = ruleConditionChipCss();
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, h, H as Host, g as getElement } from './index-BK566_jX.js';
2
2
  import { n } from './index.esm-C__n3hug.js';
3
3
 
4
- const ruleGateCss = () => `:host{display:block}:host([hidden]){display:none}`;
4
+ const ruleGateCss = () => `:host(limebb-rule-gate){display:contents}:host(limebb-rule-gate[hidden]){display:none}`;
5
5
 
6
6
  const RuleGate = class {
7
7
  constructor(hostRef) {
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-BK566_jX.js";export{s as setNonce}from"./p-BK566_jX.js";import{g as l}from"./p-DQuL1Twl.js";(()=>{const t=import.meta.url,l={};return""!==t&&(l.resourcesUrl=new URL(".",t).href),e(l)})().then((async e=>(await l(),t(JSON.parse('[["p-985ae787",[[1,"limebb-lime-query-builder",{"platform":[16],"context":[16],"value":[16],"label":[1],"activeLimetype":[1,"active-limetype"],"limetypes":[32],"mode":[32],"codeValue":[32],"limetype":[32],"filter":[32],"internalResponseFormat":[32],"limit":[32],"orderBy":[32],"description":[32]}]]],["p-0621e884",[[1,"limebb-rule-arg-filter-editor",{"platform":[16],"context":[16],"value":[16],"resolvedContext":[32]}]]],["p-4f60b7bc",[[1,"limebb-feed",{"platform":[16],"context":[16],"items":[16],"emptyStateMessage":[1,"empty-state-message"],"heading":[1],"loading":[4],"minutesOfProximity":[2,"minutes-of-proximity"],"totalCount":[2,"total-count"],"direction":[513],"lastVisitedTimestamp":[1,"last-visited-timestamp"],"highlightedItemId":[8,"highlighted-item-id"]},null,{"highlightedItemId":[{"highlightedItemIdChanged":0}]}]]],["p-8c0455e4",[[1,"limebb-kanban",{"platform":[16],"context":[16],"groups":[16]}]]],["p-4bdaf436",[[257,"limebb-chat-list",{"platform":[16],"context":[16],"items":[16],"loading":[516],"isTypingIndicatorVisible":[516,"is-typing-indicator-visible"],"lastVisitedTimestamp":[513,"last-visited-timestamp"],"order":[513]},null,{"items":[{"handleItemsChange":0}],"order":[{"handleItemsChange":0}]}]]],["p-a598f92f",[[1,"limebb-lime-query-response-format-builder",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"helperText":[1,"helper-text"],"limetypes":[32],"mode":[32],"codeValue":[32],"internalValue":[32]}]]],["p-573f9e95",[[1,"limebb-rule-editor",{"platform":[16],"context":[16],"value":[16],"availableContexts":[16],"modes":[16],"required":[516],"readonly":[516],"disabled":[516],"invalid":[516],"label":[513],"helperText":[1,"helper-text"],"help":[1],"resolvedContext":[32],"modeOverride":[32],"availablePrimitiveOptions":[32],"adapter":[32]},null,{"value":[{"onValueChange":0}],"availableContexts":[{"onAvailableContextsChange":0}]}]]],["p-b72c748b",[[1,"limebb-document-chips",{"accessibleLabel":[513,"accessible-label"],"files":[16]},null,{"files":[{"onFilesChanged":0}]}]]],["p-9959019d",[[1,"limebb-limeobject-file-viewer",{"platform":[16],"context":[16],"property":[1],"fileTypes":[16],"limeobject":[32],"limetype":[32]}]]],["p-8f80d024",[[17,"limebb-text-editor",{"platform":[16],"context":[16],"allowMentioning":[4,"allow-mentioning"],"contentType":[1,"content-type"],"language":[513],"disabled":[516],"readonly":[516],"helperText":[513,"helper-text"],"placeholder":[513],"label":[513],"invalid":[516],"required":[516],"selectedContext":[16],"ui":[513],"allowResize":[4,"allow-resize"],"value":[1],"draftIdentifier":[1,"draft-identifier"],"triggerMap":[16],"customElements":[16],"allowPasteImages":[4,"allow-paste-images"],"items":[32],"highlightedItemIndex":[32],"editorPickerQuery":[32],"searchableLimetypes":[32],"appName":[32],"isPickerOpen":[32],"isSearching":[32]},null,{"isPickerOpen":[{"watchOpen":0}],"editorPickerQuery":[{"watchQuery":0}]}]]],["p-394b521a",[[1,"limebb-data-cells",{"platform":[16],"context":[16],"limeobject":[8],"items":[16],"image":[16],"relativeDates":[4,"relative-dates"]}]]],["p-ec9b5e30",[[1,"limebb-date-range",{"platform":[16],"context":[16],"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["p-3b672249",[[1,"limebb-document-picker",{"platform":[16],"context":[16],"items":[16],"label":[513],"helperText":[513,"helper-text"],"invalid":[516],"required":[516],"type":[513]}]]],["p-6e2553b4",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["p-627b0c79",[[1,"limebb-notification-list",{"platform":[16],"context":[16],"items":[16],"loading":[4],"lastVisitedTimestamp":[1,"last-visited-timestamp"]},null,{"items":[{"handleItemsChange":0}]}]]],["p-a1052482",[[1,"limebb-value-comparison-editor",{"value":[16],"platform":[16],"operandKey":[32],"direction":[32],"unit":[32],"count":[32],"countInput":[32],"countInvalid":[32],"specificDate":[32]},null,{"value":[{"onValueChange":0}]}]]],["p-a938384f",[[257,"limebb-alert-dialog",{"type":[513],"open":[516],"icon":[513],"heading":[513],"subheading":[1]}]]],["p-087d5651",[[17,"limebb-browser",{"platform":[16],"context":[16],"items":[16],"layout":[1],"filter":[32]}]]],["p-e19f4b3b",[[1,"limebb-color-palette-picker",{"value":[513],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"label":[513],"helperText":[1,"helper-text"]}]]],["p-895c8966",[[1,"limebb-color-palette-swatches",{"colors":[16]}]]],["p-5c541d0c",[[1,"limebb-component-config",{"platform":[16],"context":[16],"value":[16],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"formInfo":[16],"type":[1],"nameField":[1,"name-field"],"configComponent":[32],"configViewType":[32]},null,{"formInfo":[{"watchFormInfo":0}],"configComponent":[{"watchconfigComponent":0}]}]]],["p-612c6b28",[[1,"limebb-component-picker",{"platform":[16],"context":[16],"type":[1],"tags":[16],"value":[1],"copyLabel":[1,"copy-label"],"hideCopyButton":[4,"hide-copy-button"],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-a14bed52",[[257,"limebb-composer-toolbar",{"platform":[16],"mentions":[516],"textSnippets":[516,"text-snippets"],"internalLinks":[516,"internal-links"],"richText":[516,"rich-text"],"fileInput":[16]}]]],["p-6bd61290",[[257,"limebb-dashboard-widget",{"heading":[513],"subheading":[513],"supportingText":[513,"supporting-text"],"icon":[513]}]]],["p-d6099dc7",[[1,"limebb-icon-picker",{"value":[1],"required":[4],"readonly":[4],"invalid":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-53b44865",[[1,"limebb-info-tile",{"platform":[16],"context":[16],"filterId":[513,"filter-id"],"disabled":[4],"icon":[513],"label":[1],"prefix":[1],"suffix":[1],"propertyName":[1,"property-name"],"aggregateOperator":[1,"aggregate-operator"],"format":[16],"reducedPresence":[516,"reduced-presence"],"reducedPresenceRule":[16],"config":[32],"filters":[32],"value":[32],"loading":[32],"error":[32],"limetypes":[32]},null,{"filterId":[{"watchFilterId":0}],"propertyName":[{"watchPropertyName":0}],"aggregateOperator":[{"watchAggregateOperator":0}]}]]],["p-23d2632b",[[1,"limebb-info-tile-date-format",{"value":[16]}]]],["p-6303201b",[[1,"limebb-info-tile-decimal-format",{"value":[16]}]]],["p-3446290c",[[1,"limebb-info-tile-format",{"platform":[16],"context":[16],"type":[1],"value":[16]}]]],["p-3865eec4",[[1,"limebb-info-tile-relative-date-format",{"value":[16]}]]],["p-32339f09",[[1,"limebb-info-tile-unit-format",{"value":[16]}]]],["p-a2ebd5a4",[[1,"limebb-inline-image",{"imageId":[1,"image-id"],"alt":[1],"width":[1],"height":[1],"appName":[32]}]]],["p-35d9b3ad",[[1,"limebb-loader",{"platform":[16],"context":[16]}]]],["p-ab0210b2",[[1,"limebb-locale-picker",{"platform":[16],"context":[16],"value":[1],"required":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"readonly":[4],"multipleChoice":[4,"multiple-choice"],"allLanguages":[32]}]]],["p-1917956c",[[257,"limebb-mention",{"limetype":[1],"objectid":[2],"limeobject":[32]}]]],["p-c7bfa2e4",[[1,"limebb-mention-group-counter",{"count":[2],"limetype":[16],"helperLabel":[1,"helper-label"]}]]],["p-bac9d3a9",[[1,"limebb-object-chip",{"limetype":[1],"objectid":[2],"size":[1],"platform":[16],"data":[32]},null,{"limetype":[{"handlePropChange":0}],"objectid":[{"handlePropChange":0}]}]]],["p-e18a2cef",[[1,"limebb-rule-condition-chip",{"platform":[16],"label":[1],"icon":[1],"iconColor":[1,"icon-color"],"negated":[4],"invalid":[516],"selected":[516],"readonly":[516],"disabled":[516],"removable":[4]}]]],["p-2adeac66",[[1,"limebb-rule-condition-editor",{"platform":[16],"context":[16],"value":[16],"configComponent":[16],"focusOnOpen":[4,"focus-on-open"],"readonly":[4],"disabled":[4]}]]],["p-687640ed",[[257,"limebb-rule-gate",{"platform":[16],"rule":[16],"scope":[16],"shouldRender":[32]},null,{"rule":[{"onRuleChange":0}],"scope":[{"onScopeChange":0}]}]]],["p-6d2dba20",[[1,"limebb-trend-indicator",{"platform":[16],"context":[16],"value":[520],"formerValue":[514,"former-value"],"suffix":[513],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"]},null,{"value":[{"valueChanged":0}]}]]],["p-a4556649",[[1,"limebb-feed-timeline-item",{"platform":[16],"context":[16],"item":[16],"ui":[513],"helperText":[1,"helper-text"],"hasError":[516,"has-error"],"isBundled":[516,"is-bundled"],"headingCanExpand":[32],"isHeadingExpanded":[32],"showMore":[32],"isTall":[32]}]]],["p-b272730c",[[1,"limebb-kanban-group",{"platform":[16],"context":[16],"identifier":[1],"heading":[513],"help":[1],"items":[16],"summary":[1],"loading":[516],"totalCount":[514,"total-count"]}]]],["p-bd6c12bc",[[1,"limebb-condition-tree",{"platform":[16],"context":[16],"value":[8],"adapter":[16],"combinators":[16],"addOptions":[16],"addSearcher":[16],"readonly":[516],"disabled":[516],"openState":[32]},null,{"adapter":[{"buildWalker":0}],"value":[{"syncOpenState":0}]}]]],["p-da79c5fc",[[1,"limebb-text-editor-picker",{"items":[16],"open":[516],"isSearching":[4,"is-searching"],"emptyMessage":[1,"empty-message"]},null,{"open":[{"watchOpen":0}]}]]],["p-d4635a39",[[1,"limebb-currency-picker",{"platform":[16],"context":[16],"label":[513],"currencies":[16],"helperText":[513,"helper-text"],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"value":[1]}]]],["p-c58067ec",[[1,"limebb-date-picker",{"platform":[16],"context":[16],"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"required":[516],"value":[1],"type":[513]}]]],["p-47b56a75",[[17,"limebb-document-item",{"platform":[16],"context":[16],"item":[16],"type":[513],"fileTypes":[16]}]]],["p-550606f6",[[1,"limebb-live-docs-info"]]],["p-d6c7cf0f",[[1,"limebb-notification-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-27240bb0",[[1,"limebb-percentage-visualizer",{"platform":[16],"context":[16],"value":[520],"rangeMax":[514,"range-max"],"rangeMin":[514,"range-min"],"multiplier":[514],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"],"displayPercentageColors":[516,"display-percentage-colors"]},null,{"value":[{"valueChanged":0}]}]]],["p-7d53756b",[[1,"limebb-lime-query-order-by-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]},null,{"value":[{"handleValueChange":0}]}],[0,"limebb-limetype-field",{"platform":[16],"context":[16],"label":[513],"required":[516],"readonly":[516],"disabled":[516],"value":[513],"helperText":[513,"helper-text"],"invalid":[4],"limetypes":[16],"propertyFields":[16],"fieldName":[1,"field-name"],"formInfo":[16]}]]],["p-4af3ea2c",[[2,"limebb-lime-query-filter-expression",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-filter-comparison",{"platform":[16],"context":[16],"label":[513],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16],"isOpen":[32]}]]],["p-b4571d32",[[1,"limebb-lime-query-filter-builder",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}]]],["p-949ed056",[[257,"limebb-kanban-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-4fd9d615",[[1,"limebb-lime-query-order-by-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16]}]]],["p-7c3d3e06",[[1,"limebb-condition-tree-editor",{"platform":[16],"context":[16],"open":[4],"editor":[16],"value":[8],"heading":[1],"icon":[1],"negated":[4],"readonly":[516],"disabled":[516]}]]],["p-eb95767a",[[1,"limebb-feed-item-thumbnail-file-info",{"description":[1]}]]],["p-a2e291b4",[[1,"limebb-chat-icon-list",{"item":[16]}],[1,"limebb-chat-item",{"platform":[16],"context":[16],"item":[16],"helperText":[1,"helper-text"],"hasError":[516,"has-error"]}],[1,"limebb-typing-indicator"]]],["p-1ae4962d",[[1,"limebb-empty-state",{"heading":[513],"value":[513],"icon":[16]}]]],["p-251784bf",[[17,"limebb-property-selector",{"platform":[16],"context":[16],"limetype":[1],"value":[1],"label":[1],"required":[4],"helperText":[1,"helper-text"],"limetypes":[32],"isOpen":[32],"navigationPath":[32]}]]],["p-f49250f3",[[1,"limebb-lime-query-response-format-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]}],[1,"limebb-lime-query-response-format-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16],"showAliasInput":[32],"showDescriptionInput":[32]}]]],["p-39a36450",[[257,"limebb-summary-popover",{"triggerDelay":[514,"trigger-delay"],"heading":[513],"subheading":[513],"image":[16],"file":[16],"icon":[513],"value":[1],"openDirection":[513,"open-direction"],"popoverMaxWidth":[513,"popover-max-width"],"popoverMaxHeight":[513,"popover-max-height"],"actions":[16],"isPopoverOpen":[32]}],[17,"limebb-navigation-button",{"href":[513],"tooltipLabel":[513,"tooltip-label"],"tooltipHelperLabel":[513,"tooltip-helper-label"],"type":[513]}]]],["p-bf693702",[[17,"limebb-lime-query-filter-comparison-editor",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16],"propertyType":[1,"property-type"]}],[1,"limebb-lime-query-filter-group",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-filter-not",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-value-input",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"propertyPath":[1,"property-path"],"operator":[1],"value":[8],"label":[1],"limetypes":[32],"inputMode":[32]}],[17,"limebb-filter-chip",{"label":[1],"value":[1],"conjunction":[1],"condition":[1],"propertyType":[1,"property-type"],"icon":[1],"helperLabel":[1,"helper-label"],"removable":[4],"readonly":[516],"disabled":[4],"invalid":[516],"selected":[516],"identifier":[8],"platform":[16],"maxLength":[2,"max-length"]},[[2,"click","filterClickWhenInactive"]]],[1,"limebb-filter-condition-picker",{"platform":[16],"value":[1],"propertyType":[1,"property-type"],"conditions":[16],"disabled":[516]}]]]]'),e))));
1
+ import{p as e,b as t}from"./p-BK566_jX.js";export{s as setNonce}from"./p-BK566_jX.js";import{g as l}from"./p-DQuL1Twl.js";(()=>{const t=import.meta.url,l={};return""!==t&&(l.resourcesUrl=new URL(".",t).href),e(l)})().then((async e=>(await l(),t(JSON.parse('[["p-985ae787",[[1,"limebb-lime-query-builder",{"platform":[16],"context":[16],"value":[16],"label":[1],"activeLimetype":[1,"active-limetype"],"limetypes":[32],"mode":[32],"codeValue":[32],"limetype":[32],"filter":[32],"internalResponseFormat":[32],"limit":[32],"orderBy":[32],"description":[32]}]]],["p-0621e884",[[1,"limebb-rule-arg-filter-editor",{"platform":[16],"context":[16],"value":[16],"resolvedContext":[32]}]]],["p-4f60b7bc",[[1,"limebb-feed",{"platform":[16],"context":[16],"items":[16],"emptyStateMessage":[1,"empty-state-message"],"heading":[1],"loading":[4],"minutesOfProximity":[2,"minutes-of-proximity"],"totalCount":[2,"total-count"],"direction":[513],"lastVisitedTimestamp":[1,"last-visited-timestamp"],"highlightedItemId":[8,"highlighted-item-id"]},null,{"highlightedItemId":[{"highlightedItemIdChanged":0}]}]]],["p-8c0455e4",[[1,"limebb-kanban",{"platform":[16],"context":[16],"groups":[16]}]]],["p-4bdaf436",[[257,"limebb-chat-list",{"platform":[16],"context":[16],"items":[16],"loading":[516],"isTypingIndicatorVisible":[516,"is-typing-indicator-visible"],"lastVisitedTimestamp":[513,"last-visited-timestamp"],"order":[513]},null,{"items":[{"handleItemsChange":0}],"order":[{"handleItemsChange":0}]}]]],["p-a598f92f",[[1,"limebb-lime-query-response-format-builder",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"helperText":[1,"helper-text"],"limetypes":[32],"mode":[32],"codeValue":[32],"internalValue":[32]}]]],["p-573f9e95",[[1,"limebb-rule-editor",{"platform":[16],"context":[16],"value":[16],"availableContexts":[16],"modes":[16],"required":[516],"readonly":[516],"disabled":[516],"invalid":[516],"label":[513],"helperText":[1,"helper-text"],"help":[1],"resolvedContext":[32],"modeOverride":[32],"availablePrimitiveOptions":[32],"adapter":[32]},null,{"value":[{"onValueChange":0}],"availableContexts":[{"onAvailableContextsChange":0}]}]]],["p-b72c748b",[[1,"limebb-document-chips",{"accessibleLabel":[513,"accessible-label"],"files":[16]},null,{"files":[{"onFilesChanged":0}]}]]],["p-9959019d",[[1,"limebb-limeobject-file-viewer",{"platform":[16],"context":[16],"property":[1],"fileTypes":[16],"limeobject":[32],"limetype":[32]}]]],["p-8f80d024",[[17,"limebb-text-editor",{"platform":[16],"context":[16],"allowMentioning":[4,"allow-mentioning"],"contentType":[1,"content-type"],"language":[513],"disabled":[516],"readonly":[516],"helperText":[513,"helper-text"],"placeholder":[513],"label":[513],"invalid":[516],"required":[516],"selectedContext":[16],"ui":[513],"allowResize":[4,"allow-resize"],"value":[1],"draftIdentifier":[1,"draft-identifier"],"triggerMap":[16],"customElements":[16],"allowPasteImages":[4,"allow-paste-images"],"items":[32],"highlightedItemIndex":[32],"editorPickerQuery":[32],"searchableLimetypes":[32],"appName":[32],"isPickerOpen":[32],"isSearching":[32]},null,{"isPickerOpen":[{"watchOpen":0}],"editorPickerQuery":[{"watchQuery":0}]}]]],["p-394b521a",[[1,"limebb-data-cells",{"platform":[16],"context":[16],"limeobject":[8],"items":[16],"image":[16],"relativeDates":[4,"relative-dates"]}]]],["p-ec9b5e30",[[1,"limebb-date-range",{"platform":[16],"context":[16],"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["p-3b672249",[[1,"limebb-document-picker",{"platform":[16],"context":[16],"items":[16],"label":[513],"helperText":[513,"helper-text"],"invalid":[516],"required":[516],"type":[513]}]]],["p-6e2553b4",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["p-627b0c79",[[1,"limebb-notification-list",{"platform":[16],"context":[16],"items":[16],"loading":[4],"lastVisitedTimestamp":[1,"last-visited-timestamp"]},null,{"items":[{"handleItemsChange":0}]}]]],["p-a1052482",[[1,"limebb-value-comparison-editor",{"value":[16],"platform":[16],"operandKey":[32],"direction":[32],"unit":[32],"count":[32],"countInput":[32],"countInvalid":[32],"specificDate":[32]},null,{"value":[{"onValueChange":0}]}]]],["p-a938384f",[[257,"limebb-alert-dialog",{"type":[513],"open":[516],"icon":[513],"heading":[513],"subheading":[1]}]]],["p-087d5651",[[17,"limebb-browser",{"platform":[16],"context":[16],"items":[16],"layout":[1],"filter":[32]}]]],["p-e19f4b3b",[[1,"limebb-color-palette-picker",{"value":[513],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"label":[513],"helperText":[1,"helper-text"]}]]],["p-895c8966",[[1,"limebb-color-palette-swatches",{"colors":[16]}]]],["p-5c541d0c",[[1,"limebb-component-config",{"platform":[16],"context":[16],"value":[16],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"formInfo":[16],"type":[1],"nameField":[1,"name-field"],"configComponent":[32],"configViewType":[32]},null,{"formInfo":[{"watchFormInfo":0}],"configComponent":[{"watchconfigComponent":0}]}]]],["p-612c6b28",[[1,"limebb-component-picker",{"platform":[16],"context":[16],"type":[1],"tags":[16],"value":[1],"copyLabel":[1,"copy-label"],"hideCopyButton":[4,"hide-copy-button"],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-a14bed52",[[257,"limebb-composer-toolbar",{"platform":[16],"mentions":[516],"textSnippets":[516,"text-snippets"],"internalLinks":[516,"internal-links"],"richText":[516,"rich-text"],"fileInput":[16]}]]],["p-6bd61290",[[257,"limebb-dashboard-widget",{"heading":[513],"subheading":[513],"supportingText":[513,"supporting-text"],"icon":[513]}]]],["p-d6099dc7",[[1,"limebb-icon-picker",{"value":[1],"required":[4],"readonly":[4],"invalid":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-53b44865",[[1,"limebb-info-tile",{"platform":[16],"context":[16],"filterId":[513,"filter-id"],"disabled":[4],"icon":[513],"label":[1],"prefix":[1],"suffix":[1],"propertyName":[1,"property-name"],"aggregateOperator":[1,"aggregate-operator"],"format":[16],"reducedPresence":[516,"reduced-presence"],"reducedPresenceRule":[16],"config":[32],"filters":[32],"value":[32],"loading":[32],"error":[32],"limetypes":[32]},null,{"filterId":[{"watchFilterId":0}],"propertyName":[{"watchPropertyName":0}],"aggregateOperator":[{"watchAggregateOperator":0}]}]]],["p-23d2632b",[[1,"limebb-info-tile-date-format",{"value":[16]}]]],["p-6303201b",[[1,"limebb-info-tile-decimal-format",{"value":[16]}]]],["p-3446290c",[[1,"limebb-info-tile-format",{"platform":[16],"context":[16],"type":[1],"value":[16]}]]],["p-3865eec4",[[1,"limebb-info-tile-relative-date-format",{"value":[16]}]]],["p-32339f09",[[1,"limebb-info-tile-unit-format",{"value":[16]}]]],["p-a2ebd5a4",[[1,"limebb-inline-image",{"imageId":[1,"image-id"],"alt":[1],"width":[1],"height":[1],"appName":[32]}]]],["p-35d9b3ad",[[1,"limebb-loader",{"platform":[16],"context":[16]}]]],["p-ab0210b2",[[1,"limebb-locale-picker",{"platform":[16],"context":[16],"value":[1],"required":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"readonly":[4],"multipleChoice":[4,"multiple-choice"],"allLanguages":[32]}]]],["p-1917956c",[[257,"limebb-mention",{"limetype":[1],"objectid":[2],"limeobject":[32]}]]],["p-c7bfa2e4",[[1,"limebb-mention-group-counter",{"count":[2],"limetype":[16],"helperLabel":[1,"helper-label"]}]]],["p-bac9d3a9",[[1,"limebb-object-chip",{"limetype":[1],"objectid":[2],"size":[1],"platform":[16],"data":[32]},null,{"limetype":[{"handlePropChange":0}],"objectid":[{"handlePropChange":0}]}]]],["p-5855abdc",[[1,"limebb-rule-condition-chip",{"platform":[16],"label":[1],"icon":[1],"iconColor":[1,"icon-color"],"negated":[4],"invalid":[516],"selected":[516],"readonly":[516],"disabled":[516],"removable":[4]}]]],["p-2adeac66",[[1,"limebb-rule-condition-editor",{"platform":[16],"context":[16],"value":[16],"configComponent":[16],"focusOnOpen":[4,"focus-on-open"],"readonly":[4],"disabled":[4]}]]],["p-621ab65a",[[257,"limebb-rule-gate",{"platform":[16],"rule":[16],"scope":[16],"shouldRender":[32]},null,{"rule":[{"onRuleChange":0}],"scope":[{"onScopeChange":0}]}]]],["p-6d2dba20",[[1,"limebb-trend-indicator",{"platform":[16],"context":[16],"value":[520],"formerValue":[514,"former-value"],"suffix":[513],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"]},null,{"value":[{"valueChanged":0}]}]]],["p-a4556649",[[1,"limebb-feed-timeline-item",{"platform":[16],"context":[16],"item":[16],"ui":[513],"helperText":[1,"helper-text"],"hasError":[516,"has-error"],"isBundled":[516,"is-bundled"],"headingCanExpand":[32],"isHeadingExpanded":[32],"showMore":[32],"isTall":[32]}]]],["p-b272730c",[[1,"limebb-kanban-group",{"platform":[16],"context":[16],"identifier":[1],"heading":[513],"help":[1],"items":[16],"summary":[1],"loading":[516],"totalCount":[514,"total-count"]}]]],["p-bd6c12bc",[[1,"limebb-condition-tree",{"platform":[16],"context":[16],"value":[8],"adapter":[16],"combinators":[16],"addOptions":[16],"addSearcher":[16],"readonly":[516],"disabled":[516],"openState":[32]},null,{"adapter":[{"buildWalker":0}],"value":[{"syncOpenState":0}]}]]],["p-da79c5fc",[[1,"limebb-text-editor-picker",{"items":[16],"open":[516],"isSearching":[4,"is-searching"],"emptyMessage":[1,"empty-message"]},null,{"open":[{"watchOpen":0}]}]]],["p-d4635a39",[[1,"limebb-currency-picker",{"platform":[16],"context":[16],"label":[513],"currencies":[16],"helperText":[513,"helper-text"],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"value":[1]}]]],["p-c58067ec",[[1,"limebb-date-picker",{"platform":[16],"context":[16],"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"required":[516],"value":[1],"type":[513]}]]],["p-47b56a75",[[17,"limebb-document-item",{"platform":[16],"context":[16],"item":[16],"type":[513],"fileTypes":[16]}]]],["p-550606f6",[[1,"limebb-live-docs-info"]]],["p-d6c7cf0f",[[1,"limebb-notification-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-27240bb0",[[1,"limebb-percentage-visualizer",{"platform":[16],"context":[16],"value":[520],"rangeMax":[514,"range-max"],"rangeMin":[514,"range-min"],"multiplier":[514],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"],"displayPercentageColors":[516,"display-percentage-colors"]},null,{"value":[{"valueChanged":0}]}]]],["p-7d53756b",[[1,"limebb-lime-query-order-by-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]},null,{"value":[{"handleValueChange":0}]}],[0,"limebb-limetype-field",{"platform":[16],"context":[16],"label":[513],"required":[516],"readonly":[516],"disabled":[516],"value":[513],"helperText":[513,"helper-text"],"invalid":[4],"limetypes":[16],"propertyFields":[16],"fieldName":[1,"field-name"],"formInfo":[16]}]]],["p-4af3ea2c",[[2,"limebb-lime-query-filter-expression",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-filter-comparison",{"platform":[16],"context":[16],"label":[513],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16],"isOpen":[32]}]]],["p-b4571d32",[[1,"limebb-lime-query-filter-builder",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}]]],["p-949ed056",[[257,"limebb-kanban-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-4fd9d615",[[1,"limebb-lime-query-order-by-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16]}]]],["p-7c3d3e06",[[1,"limebb-condition-tree-editor",{"platform":[16],"context":[16],"open":[4],"editor":[16],"value":[8],"heading":[1],"icon":[1],"negated":[4],"readonly":[516],"disabled":[516]}]]],["p-eb95767a",[[1,"limebb-feed-item-thumbnail-file-info",{"description":[1]}]]],["p-a2e291b4",[[1,"limebb-chat-icon-list",{"item":[16]}],[1,"limebb-chat-item",{"platform":[16],"context":[16],"item":[16],"helperText":[1,"helper-text"],"hasError":[516,"has-error"]}],[1,"limebb-typing-indicator"]]],["p-1ae4962d",[[1,"limebb-empty-state",{"heading":[513],"value":[513],"icon":[16]}]]],["p-251784bf",[[17,"limebb-property-selector",{"platform":[16],"context":[16],"limetype":[1],"value":[1],"label":[1],"required":[4],"helperText":[1,"helper-text"],"limetypes":[32],"isOpen":[32],"navigationPath":[32]}]]],["p-f49250f3",[[1,"limebb-lime-query-response-format-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]}],[1,"limebb-lime-query-response-format-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16],"showAliasInput":[32],"showDescriptionInput":[32]}]]],["p-39a36450",[[257,"limebb-summary-popover",{"triggerDelay":[514,"trigger-delay"],"heading":[513],"subheading":[513],"image":[16],"file":[16],"icon":[513],"value":[1],"openDirection":[513,"open-direction"],"popoverMaxWidth":[513,"popover-max-width"],"popoverMaxHeight":[513,"popover-max-height"],"actions":[16],"isPopoverOpen":[32]}],[17,"limebb-navigation-button",{"href":[513],"tooltipLabel":[513,"tooltip-label"],"tooltipHelperLabel":[513,"tooltip-helper-label"],"type":[513]}]]],["p-bf693702",[[17,"limebb-lime-query-filter-comparison-editor",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16],"propertyType":[1,"property-type"]}],[1,"limebb-lime-query-filter-group",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-filter-not",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-value-input",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"propertyPath":[1,"property-path"],"operator":[1],"value":[8],"label":[1],"limetypes":[32],"inputMode":[32]}],[17,"limebb-filter-chip",{"label":[1],"value":[1],"conjunction":[1],"condition":[1],"propertyType":[1,"property-type"],"icon":[1],"helperLabel":[1,"helper-label"],"removable":[4],"readonly":[516],"disabled":[4],"invalid":[516],"selected":[516],"identifier":[8],"platform":[16],"maxLength":[2,"max-length"]},[[2,"click","filterClickWhenInactive"]]],[1,"limebb-filter-condition-picker",{"platform":[16],"value":[1],"propertyType":[1,"property-type"],"conditions":[16],"disabled":[516]}]]]]'),e))));
@@ -1 +1 @@
1
- import{h as t,r as e,c as i,H as s,g as l}from"./p-BK566_jX.js";import{M as n,n as r}from"./p-DhGRAeCH.js";import{c as o}from"./p-DOULPRTn.js";import{c as a,g as h}from"./p-ClYOFrOo.js";import"./p-e18a2cef.entry.js";import{r as d,b as u,A as c}from"./p-BCglve2Z.js";import{c as p}from"./p-C2JP2nLw.js";import"./p-Cve-3L4y.js";function m(t,e){let i=t,s=0;for(;s<e.length;){if(null===i||"object"!=typeof i)return;const t=e[s];if("rule"===t&&"not"===i.type){i=i.rule,s+=1;continue}const l=e[s+1];if("rules"!==t||"all"!==i.type&&"any"!==i.type||!Array.isArray(i.rules)||"number"!=typeof l)return;i=i.rules[l],s+=2}return i}function v(t,e){return t.title?e.get(t.title):t.id}function f(t,e){return t.reads.every((t=>e.has(t)))}function b(t){return e=>Promise.resolve(function(t,e){if(!e)return t;const i=e.toLocaleLowerCase().split(/\s+/);return t.filter((t=>i.every((e=>{var i,s;return t.text.toLocaleLowerCase().includes(e)||(null===(i=t.secondaryText)||void 0===i?void 0:i.toLocaleLowerCase().includes(e))||String(null!==(s=t.value)&&void 0!==s?s:"").toLocaleLowerCase().includes(e)}))))}(t,e))}const g={never:"webclient.never",always:"webclient.always",conditional:"webclient.conditionally"},w=e=>{const{modes:i,selected:s,disabled:l,translator:n,onModeChange:r}=e;return t("limel-button-group",{value:i.map((t=>({id:t,title:n.get(g[t]),selected:t===s}))),disabled:l,onChange:t=>{t.stopPropagation(),r(t.detail.id)}})};const y=class{constructor(t){e(this,t),this.change=i(this,"change"),this.modeOverride=null,this.metadataById=new Map,this.primitiveTitles=new Map,this.availablePrimitiveOptions=[],this.searcher=b([]),this.issuesByNode=new Map,this.created=new WeakSet,this.reachableSlots=new Set,this.normalizedCache=null,this.hasLoaded=!1,this.labelId=p(),this.helperTextId=p(),this.handleModeChange=t=>{var e;"conditional"===this.currentMode&&(this.stashedTree=this.value),"conditional"!==t&&(this.created=new WeakSet),this.modeOverride=t,this.change.emit(null!==(e=d(t))&&void 0!==e?e:this.stashedTree)},this.handleTreeChange=t=>{var e;t.stopPropagation(),this.modeOverride="conditional",this.change.emit(null!==(e=t.detail)&&void 0!==e?e:void 0)}}componentWillLoad(){this.rebuildFromRegistries()}rebuildFromRegistries(){this.computeReachableSlots(),this.indexMetadata(),this.rebuildAvailableOptions(),this.runValidation(),this.rebuildAdapter()}connectedCallback(){this.hasLoaded&&(this.computeReachableSlots(),this.rebuildAvailableOptions(),this.runValidation(),this.rebuildAdapter())}componentDidLoad(){this.hasLoaded=!0,this.emitNormalization()}onValueChange(){this.clearReachedModeOverride(),this.emitNormalization()||this.runValidation()}onAvailableContextsChange(){this.rebuildFromRegistries()}render(){return t(s,{key:"eb89af0c748f82d8e60b1209c4fcce3475ac2934"},this.renderHelp(),t("limel-notched-outline",{key:"9d454ec87268aa9ff07776d38882365a544a64e7",label:this.label,labelId:this.labelId,required:this.required,readonly:this.readonly,disabled:this.disabled,invalid:this.invalid,hasValue:!0,hasFloatingLabel:!0},t("div",{key:"57293e75c641d4909a4d2e1d3a3d2c20a60a4512",slot:"content",class:{"rule-editor":!0,"rule-editor--disabled":this.disabled},role:"group","aria-labelledby":this.label?this.labelId:void 0,"aria-describedby":this.helperText?this.helperTextId:void 0},this.renderModes(),this.renderTree())),this.renderHelperLine())}renderModes(){const e=this.modes,i=this.currentMode;return e&&i?t(w,{modes:e,selected:i,disabled:this.disabled||this.readonly,translator:this.translator,onModeChange:this.handleModeChange}):null}renderTree(){const e=this.currentMode;return e&&"conditional"!==e?null:t("limebb-condition-tree",{platform:this.platform,context:this.effectiveContext,value:this.normalizedValue,adapter:this.adapter,addOptions:this.availablePrimitiveOptions,addSearcher:this.searcher,readonly:this.readonly,disabled:this.disabled,onChange:this.handleTreeChange})}renderHelperLine(){return this.helperText?t("limel-helper-line",{helperText:this.helperText,helperTextId:this.helperTextId,invalid:this.invalid}):null}renderHelp(){return this.help?t("limel-help",{value:this.help}):null}get currentMode(){var t,e;const i=this.modes;if(null==i?void 0:i.length)return null!==(e=null!==(t=this.modeOverride)&&void 0!==t?t:u(this.value))&&void 0!==e?e:i[0]}clearReachedModeOverride(){const t=u(this.value);void 0!==t&&t!==this.modeOverride&&(this.modeOverride=null)}indexMetadata(){var t,e,i;const s=null!==(i=null===(e=(t=this.ruleRegistry).listMetadata)||void 0===e?void 0:e.call(t))&&void 0!==i?i:[];this.metadataById=new Map(s.map((t=>[t.id,t]))),this.primitiveTitles=new Map(s.map((t=>[t.id,v(t,this.translator)])))}rebuildAvailableOptions(){var t,e;this.availablePrimitiveOptions=(t=this.availablePrimitiveMetadata(),e=this.translator,[...t.values()].map((t=>({value:t.id,text:v(t,e),secondaryText:t.description?e.get(t.description):"",icon:t.icon}))).sort(((t,e)=>t.text.localeCompare(e.text)))),this.searcher=b(this.availablePrimitiveOptions)}availablePrimitiveMetadata(){const t=new Map;for(const[e,i]of this.metadataById)e!==c&&f(i,this.reachableSlots)&&t.set(e,i);return t}computeReachableSlots(){var t;const e=this.contextRegistry,i=e.list().map((t=>t.id)).filter((t=>void 0!==e.get(t,this.host)));this.reachableSlots=new Set([...i,...null!==(t=this.availableContexts)&&void 0!==t?t:[]])}runValidation(){this.issuesByNode=this.findIssues()}findIssues(){const t=this.normalizedValue;if(!t)return new Map;try{const e=this.ruleRegistry.validate(t,[...this.reachableSlots]);return e.ok?new Map:function(t,e){var i,s;const l=function(t){const e=new Map,i=(t,s)=>{if("object"==typeof t&&null!==t)if(e.set(t,s),"not"!==t.type){if(("all"===t.type||"any"===t.type)&&Array.isArray(t.rules))for(const e of t.rules)i(e,e)}else i(t.rule,s)};return i(t,t),e}(t),n=new Map;for(const r of e){const e=m(t,r.path),o=null!==(i=e&&l.get(e))&&void 0!==i?i:t;n.set(o,[...null!==(s=n.get(o))&&void 0!==s?s:[],r.message])}return n}(t,e.issues)}catch(e){return console.warn("rule-editor could not validate the rule",{rule:t,error:e}),new Map}}rebuildAdapter(){this.adapter=a({metadata:this.metadataById,titles:this.primitiveTitles,translate:o(this.platform),issues:()=>this.issuesByNode,created:()=>this.created})}get normalizedValue(){if(!this.value)return;const t=this.currentMode;if(null!==this.normalizedCache&&this.normalizedCache.source===this.value&&this.normalizedCache.mode===t)return this.normalizedCache.normalized;const e=function(t,e){return"always"===e||"never"===e||h(t)?t:{type:"all",rules:[t]}}(this.value,t);return this.normalizedCache={source:this.value,mode:t,normalized:e},e}emitNormalization(){if(!this.value)return!1;const t=this.normalizedValue;return t!==this.value&&(this.change.emit(t),!0)}get ruleRegistry(){return this.platform.get(r.RuleRegistry)}get translator(){return this.platform.get(r.Translate)}get contextRegistry(){return this.platform.get(r.ContextRegistry)}get effectiveContext(){var t,e;return(null===(t=this.context)||void 0===t?void 0:t.limetype)?this.context:(null===(e=this.resolvedContext)||void 0===e?void 0:e.limetype)?this.resolvedContext:C}get host(){return l(this)}static get watchers(){return{value:[{onValueChange:0}],availableContexts:[{onAvailableContextsChange:0}]}}};!function(t,e,i,s){var l,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(l=t[o])&&(r=(n<3?l(r):n>3?l(e,i,r):l(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([n("context")],y.prototype,"resolvedContext",void 0);const C=Object.freeze({limetype:null,id:null});y.style='@charset "UTF-8";:host{display:block;position:relative}.limel-notched-outline{--limel-notched-outline-background-color:transparent;padding:0.5rem 0 0 0}limel-notched-outline:not([invalid]:not([invalid=false])) .limel-notched-outline{--limel-notched-outline-border-color:transparent}.rule-editor--disabled{opacity:0.6;pointer-events:none}limebb-condition-tree{--popover-surface-width:min(calc(100vw - 4rem), 50rem)}:host(limebb-rule-editor:focus),:host(limebb-rule-editor:focus-visible),:host(limebb-rule-editor:focus-within){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limebb-rule-editor){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}:host(limebb-rule-editor:focus) limel-helper-line,:host(limebb-rule-editor:focus-visible) limel-helper-line,:host(limebb-rule-editor:focus-within) limel-helper-line,:host(limebb-rule-editor:hover) limel-helper-line{will-change:grid-template-rows}limel-help{position:absolute;top:calc(var(--form-row-gap, 1rem) * -0.5);left:calc(var(--form-column-gap, 1rem) * -0.5);z-index:1}';export{y as limebb_rule_editor}
1
+ import{h as t,r as e,c as i,H as s,g as l}from"./p-BK566_jX.js";import{M as n,n as r}from"./p-DhGRAeCH.js";import{c as o}from"./p-DOULPRTn.js";import{c as a,g as h}from"./p-ClYOFrOo.js";import"./p-5855abdc.entry.js";import{r as d,b as u,A as c}from"./p-BCglve2Z.js";import{c as p}from"./p-C2JP2nLw.js";import"./p-Cve-3L4y.js";function m(t,e){let i=t,s=0;for(;s<e.length;){if(null===i||"object"!=typeof i)return;const t=e[s];if("rule"===t&&"not"===i.type){i=i.rule,s+=1;continue}const l=e[s+1];if("rules"!==t||"all"!==i.type&&"any"!==i.type||!Array.isArray(i.rules)||"number"!=typeof l)return;i=i.rules[l],s+=2}return i}function v(t,e){return t.title?e.get(t.title):t.id}function b(t,e){return t.reads.every((t=>e.has(t)))}function f(t){return e=>Promise.resolve(function(t,e){if(!e)return t;const i=e.toLocaleLowerCase().split(/\s+/);return t.filter((t=>i.every((e=>{var i,s;return t.text.toLocaleLowerCase().includes(e)||(null===(i=t.secondaryText)||void 0===i?void 0:i.toLocaleLowerCase().includes(e))||String(null!==(s=t.value)&&void 0!==s?s:"").toLocaleLowerCase().includes(e)}))))}(t,e))}const g={never:"webclient.never",always:"webclient.always",conditional:"webclient.conditionally"},w=e=>{const{modes:i,selected:s,disabled:l,translator:n,onModeChange:r}=e;return t("limel-button-group",{value:i.map((t=>({id:t,title:n.get(g[t]),selected:t===s}))),disabled:l,onChange:t=>{t.stopPropagation(),r(t.detail.id)}})};const y=class{constructor(t){e(this,t),this.change=i(this,"change"),this.modeOverride=null,this.metadataById=new Map,this.primitiveTitles=new Map,this.availablePrimitiveOptions=[],this.searcher=f([]),this.issuesByNode=new Map,this.created=new WeakSet,this.reachableSlots=new Set,this.normalizedCache=null,this.hasLoaded=!1,this.labelId=p(),this.helperTextId=p(),this.handleModeChange=t=>{var e;"conditional"===this.currentMode&&(this.stashedTree=this.value),"conditional"!==t&&(this.created=new WeakSet),this.modeOverride=t,this.change.emit(null!==(e=d(t))&&void 0!==e?e:this.stashedTree)},this.handleTreeChange=t=>{var e;t.stopPropagation(),this.modeOverride="conditional",this.change.emit(null!==(e=t.detail)&&void 0!==e?e:void 0)}}componentWillLoad(){this.rebuildFromRegistries()}rebuildFromRegistries(){this.computeReachableSlots(),this.indexMetadata(),this.rebuildAvailableOptions(),this.runValidation(),this.rebuildAdapter()}connectedCallback(){this.hasLoaded&&(this.computeReachableSlots(),this.rebuildAvailableOptions(),this.runValidation(),this.rebuildAdapter())}componentDidLoad(){this.hasLoaded=!0,this.emitNormalization()}onValueChange(){this.clearReachedModeOverride(),this.emitNormalization()||this.runValidation()}onAvailableContextsChange(){this.rebuildFromRegistries()}render(){return t(s,{key:"eb89af0c748f82d8e60b1209c4fcce3475ac2934"},this.renderHelp(),t("limel-notched-outline",{key:"9d454ec87268aa9ff07776d38882365a544a64e7",label:this.label,labelId:this.labelId,required:this.required,readonly:this.readonly,disabled:this.disabled,invalid:this.invalid,hasValue:!0,hasFloatingLabel:!0},t("div",{key:"57293e75c641d4909a4d2e1d3a3d2c20a60a4512",slot:"content",class:{"rule-editor":!0,"rule-editor--disabled":this.disabled},role:"group","aria-labelledby":this.label?this.labelId:void 0,"aria-describedby":this.helperText?this.helperTextId:void 0},this.renderModes(),this.renderTree())),this.renderHelperLine())}renderModes(){const e=this.modes,i=this.currentMode;return e&&i?t(w,{modes:e,selected:i,disabled:this.disabled||this.readonly,translator:this.translator,onModeChange:this.handleModeChange}):null}renderTree(){const e=this.currentMode;return e&&"conditional"!==e?null:t("limebb-condition-tree",{platform:this.platform,context:this.effectiveContext,value:this.normalizedValue,adapter:this.adapter,addOptions:this.availablePrimitiveOptions,addSearcher:this.searcher,readonly:this.readonly,disabled:this.disabled,onChange:this.handleTreeChange})}renderHelperLine(){return this.helperText?t("limel-helper-line",{helperText:this.helperText,helperTextId:this.helperTextId,invalid:this.invalid}):null}renderHelp(){return this.help?t("limel-help",{value:this.help}):null}get currentMode(){var t,e;const i=this.modes;if(null==i?void 0:i.length)return null!==(e=null!==(t=this.modeOverride)&&void 0!==t?t:u(this.value))&&void 0!==e?e:i[0]}clearReachedModeOverride(){const t=u(this.value);void 0!==t&&t!==this.modeOverride&&(this.modeOverride=null)}indexMetadata(){var t,e,i;const s=null!==(i=null===(e=(t=this.ruleRegistry).listMetadata)||void 0===e?void 0:e.call(t))&&void 0!==i?i:[];this.metadataById=new Map(s.map((t=>[t.id,t]))),this.primitiveTitles=new Map(s.map((t=>[t.id,v(t,this.translator)])))}rebuildAvailableOptions(){var t,e;this.availablePrimitiveOptions=(t=this.availablePrimitiveMetadata(),e=this.translator,[...t.values()].map((t=>({value:t.id,text:v(t,e),secondaryText:t.description?e.get(t.description):"",icon:t.icon}))).sort(((t,e)=>t.text.localeCompare(e.text)))),this.searcher=f(this.availablePrimitiveOptions)}availablePrimitiveMetadata(){const t=new Map;for(const[e,i]of this.metadataById)e!==c&&b(i,this.reachableSlots)&&t.set(e,i);return t}computeReachableSlots(){var t;const e=this.contextRegistry,i=e.list().map((t=>t.id)).filter((t=>void 0!==e.get(t,this.host)));this.reachableSlots=new Set([...i,...null!==(t=this.availableContexts)&&void 0!==t?t:[]])}runValidation(){this.issuesByNode=this.findIssues()}findIssues(){const t=this.normalizedValue;if(!t)return new Map;try{const e=this.ruleRegistry.validate(t,[...this.reachableSlots]);return e.ok?new Map:function(t,e){var i,s;const l=function(t){const e=new Map,i=(t,s)=>{if("object"==typeof t&&null!==t)if(e.set(t,s),"not"!==t.type){if(("all"===t.type||"any"===t.type)&&Array.isArray(t.rules))for(const e of t.rules)i(e,e)}else i(t.rule,s)};return i(t,t),e}(t),n=new Map;for(const r of e){const e=m(t,r.path),o=null!==(i=e&&l.get(e))&&void 0!==i?i:t;n.set(o,[...null!==(s=n.get(o))&&void 0!==s?s:[],r.message])}return n}(t,e.issues)}catch(e){return console.warn("rule-editor could not validate the rule",{rule:t,error:e}),new Map}}rebuildAdapter(){this.adapter=a({metadata:this.metadataById,titles:this.primitiveTitles,translate:o(this.platform),issues:()=>this.issuesByNode,created:()=>this.created})}get normalizedValue(){if(!this.value)return;const t=this.currentMode;if(null!==this.normalizedCache&&this.normalizedCache.source===this.value&&this.normalizedCache.mode===t)return this.normalizedCache.normalized;const e=function(t,e){return"always"===e||"never"===e||h(t)?t:{type:"all",rules:[t]}}(this.value,t);return this.normalizedCache={source:this.value,mode:t,normalized:e},e}emitNormalization(){if(!this.value)return!1;const t=this.normalizedValue;return t!==this.value&&(this.change.emit(t),!0)}get ruleRegistry(){return this.platform.get(r.RuleRegistry)}get translator(){return this.platform.get(r.Translate)}get contextRegistry(){return this.platform.get(r.ContextRegistry)}get effectiveContext(){var t,e;return(null===(t=this.context)||void 0===t?void 0:t.limetype)?this.context:(null===(e=this.resolvedContext)||void 0===e?void 0:e.limetype)?this.resolvedContext:C}get host(){return l(this)}static get watchers(){return{value:[{onValueChange:0}],availableContexts:[{onAvailableContextsChange:0}]}}};!function(t,e,i,s){var l,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(l=t[o])&&(r=(n<3?l(r):n>3?l(e,i,r):l(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([n("context")],y.prototype,"resolvedContext",void 0);const C=Object.freeze({limetype:null,id:null});y.style='@charset "UTF-8";:host{display:block;position:relative}.limel-notched-outline{--limel-notched-outline-background-color:transparent;padding:0.5rem 0 0 0}limel-notched-outline:not([invalid]:not([invalid=false])) .limel-notched-outline{--limel-notched-outline-border-color:transparent}.rule-editor--disabled{opacity:0.6;pointer-events:none}limebb-condition-tree{--popover-surface-width:min(calc(100vw - 4rem), 50rem)}:host(limebb-rule-editor:focus),:host(limebb-rule-editor:focus-visible),:host(limebb-rule-editor:focus-within){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limebb-rule-editor){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}:host(limebb-rule-editor:focus) limel-helper-line,:host(limebb-rule-editor:focus-visible) limel-helper-line,:host(limebb-rule-editor:focus-within) limel-helper-line,:host(limebb-rule-editor:hover) limel-helper-line{will-change:grid-template-rows}limel-help{position:absolute;top:calc(var(--form-row-gap, 1rem) * -0.5);left:calc(var(--form-column-gap, 1rem) * -0.5);z-index:1}';export{y as limebb_rule_editor}
@@ -0,0 +1 @@
1
+ import{r as i,c as t,h as e}from"./p-BK566_jX.js";import{c as s}from"./p-DOULPRTn.js";import{c as o}from"./p-C2JP2nLw.js";import"./p-DhGRAeCH.js";const h=class{constructor(e){i(this,e),this.remove=t(this,"remove"),this.negated=!1,this.invalid=!1,this.selected=!1,this.readonly=!1,this.disabled=!1,this.removable=!0,this.chipId="rule-condition-chip-"+o(),this.handleRemove=i=>{i.stopPropagation(),this.remove.emit()}}render(){return[e("limel-chip",{key:"f5b4e4c7ea6a2538fbffc683f25c1119309b3c43",id:this.chipId,text:this.label,icon:this.glyph,invalid:this.invalid,selected:this.selected,disabled:this.disabled,removable:this.removable&&!this.readonly,onRemove:this.handleRemove}),this.renderPolarityTooltip()]}renderPolarityTooltip(){const i=s(this.platform);return e("limel-tooltip",{elementId:this.chipId,label:this.label,helperLabel:this.negated?i("webclient.rule-editor.negated-condition","This condition must not be met."):i("webclient.rule-editor.affirmed-condition","This condition must be met.")})}get glyph(){return this.negated?"cancel_2":"ok"}};h.style=":host{display:inline-flex;min-width:0}";export{h as limebb_rule_condition_chip}
@@ -1 +1 @@
1
- import{r as t,h as s,H as e,g as i}from"./p-BK566_jX.js";import{n as h}from"./p-DhGRAeCH.js";const o=class{constructor(s){t(this,s),this.shouldRender=!1}componentWillLoad(){this.evaluate()}disconnectedCallback(){var t;null===(t=this.stopSubscription)||void 0===t||t.call(this)}onRuleChange(){this.evaluate()}onScopeChange(){this.evaluate()}render(){return s(e,{key:"36ac8be5125b3a169160a699388f69641d8b4c1c",hidden:!this.shouldRender},s("slot",{key:"3b14a3726279f295e5983adab2b2f5f7b5c103ed"}))}get ruleRegistry(){return this.platform.get(h.RuleRegistry)}evaluate(){var t;if(null===(t=this.stopSubscription)||void 0===t||t.call(this),this.stopSubscription=void 0,this.rule)try{const t=this.ruleRegistry.compile(this.rule);if(this.scope)return void(this.shouldRender=t.evaluate(this.scope));this.stopSubscription=this.ruleRegistry.subscribe(t,{host:this.host},(t=>{this.shouldRender=t}))}catch(t){console.warn("rule-gate failed to compile rule; hiding slot",{rule:this.rule,error:t}),this.shouldRender=!1}else this.shouldRender=!0}get host(){return i(this)}static get watchers(){return{rule:[{onRuleChange:0}],scope:[{onScopeChange:0}]}}};o.style=":host{display:block}:host([hidden]){display:none}";export{o as limebb_rule_gate}
1
+ import{r as t,h as e,H as s,g as i}from"./p-BK566_jX.js";import{n as h}from"./p-DhGRAeCH.js";const o=class{constructor(e){t(this,e),this.shouldRender=!1}componentWillLoad(){this.evaluate()}disconnectedCallback(){var t;null===(t=this.stopSubscription)||void 0===t||t.call(this)}onRuleChange(){this.evaluate()}onScopeChange(){this.evaluate()}render(){return e(s,{key:"36ac8be5125b3a169160a699388f69641d8b4c1c",hidden:!this.shouldRender},e("slot",{key:"3b14a3726279f295e5983adab2b2f5f7b5c103ed"}))}get ruleRegistry(){return this.platform.get(h.RuleRegistry)}evaluate(){var t;if(null===(t=this.stopSubscription)||void 0===t||t.call(this),this.stopSubscription=void 0,this.rule)try{const t=this.ruleRegistry.compile(this.rule);if(this.scope)return void(this.shouldRender=t.evaluate(this.scope));this.stopSubscription=this.ruleRegistry.subscribe(t,{host:this.host},(t=>{this.shouldRender=t}))}catch(t){console.warn("rule-gate failed to compile rule; hiding slot",{rule:this.rule,error:t}),this.shouldRender=!1}else this.shouldRender=!0}get host(){return i(this)}static get watchers(){return{rule:[{onRuleChange:0}],scope:[{onScopeChange:0}]}}};o.style=":host(limebb-rule-gate){display:contents}:host(limebb-rule-gate[hidden]){display:none}";export{o as limebb_rule_gate}
@@ -13,8 +13,8 @@ import { LimeWebComponentPlatform } from '@limetech/lime-web-components';
13
13
  */
14
14
  export declare class RuleConditionChip {
15
15
  /**
16
- * Platform service provider. Unread, but declared so that the tree setting
17
- * it does not leave it in the DOM as an attribute.
16
+ * Platform service provider, used to translate what the negation glyph
17
+ * means. The chip reads nothing else from it.
18
18
  */
19
19
  platform: LimeWebComponentPlatform;
20
20
  /**
@@ -22,12 +22,14 @@ export declare class RuleConditionChip {
22
22
  */
23
23
  label: string;
24
24
  /**
25
- * The condition's glyph.
25
+ * The condition's glyph. Declared because the tree sets it, but not drawn:
26
+ * the polarity glyph has the only slot there is — see {@link glyph}.
26
27
  */
27
28
  icon?: IconName;
28
29
  /**
29
30
  * The glyph's colour, which travels beside the name because
30
- * `ConditionTreeChip.icon` has no room for it.
31
+ * `ConditionTreeChip.icon` has no room for it. Not drawn either, for the
32
+ * same reason as `icon`.
31
33
  */
32
34
  iconColor?: string;
33
35
  /**
@@ -66,17 +68,34 @@ export declare class RuleConditionChip {
66
68
  * Emitted when the author asks for the condition to be deleted.
67
69
  */
68
70
  remove: EventEmitter<void>;
69
- render(): any;
70
71
  /**
71
- * The glyph, with its colour put back on when it has one.
72
+ * What the tooltip attaches itself to. Its own, rather than the host's `id`:
73
+ * nothing outside sets one on a chip the tree creates, and the tooltip needs
74
+ * a target in the same shadow root either way.
72
75
  */
73
- private get glyph();
76
+ private chipId;
77
+ render(): any[];
78
+ /**
79
+ * What the polarity glyph means, in words.
80
+ *
81
+ * A glyph on its own is no better than the `¬` it replaces unless someone
82
+ * who does not recognize it can still find out what it means, and unless it
83
+ * reaches a screen reader. `limel-chip` cannot help with either: its
84
+ * accessible name is its `text` and it has no tooltip. `limel-tooltip`
85
+ * carries the wording on hover and sets `aria-describedby` on the chip, so
86
+ * the polarity is announced rather than merely drawn.
87
+ */
88
+ private renderPolarityTooltip;
74
89
  /**
75
- * The name, behind `¬` when negated — a symbol rather than a word, so it
76
- * does not compete with the "not" the tree writes between the rows of a
77
- * negated group.
90
+ * Which way round the condition is.
91
+ *
92
+ * It has the slot unconditionally, which is why `icon` and `iconColor` do
93
+ * not reach it: there is one slot, and which way round a condition is
94
+ * matters more than which kind of condition it is. No built-in primitive
95
+ * registers an icon, so in practice this withholds only the glyphs of the
96
+ * docs-app examples and of `legacy.*` conditions whose author set one.
78
97
  */
79
- private get text();
98
+ private get glyph();
80
99
  private handleRemove;
81
100
  }
82
101
  //# sourceMappingURL=rule-condition-chip.d.ts.map
@@ -2549,11 +2549,11 @@ export namespace Components {
2549
2549
  */
2550
2550
  "disabled": boolean;
2551
2551
  /**
2552
- * The condition's glyph.
2552
+ * The condition's glyph. Declared because the tree sets it, but not drawn: the polarity glyph has the only slot there is — see {@link glyph}.
2553
2553
  */
2554
2554
  "icon"?: IconName;
2555
2555
  /**
2556
- * The glyph's colour, which travels beside the name because `ConditionTreeChip.icon` has no room for it.
2556
+ * The glyph's colour, which travels beside the name because `ConditionTreeChip.icon` has no room for it. Not drawn either, for the same reason as `icon`.
2557
2557
  */
2558
2558
  "iconColor"?: string;
2559
2559
  /**
@@ -2571,7 +2571,7 @@ export namespace Components {
2571
2571
  */
2572
2572
  "negated": boolean;
2573
2573
  /**
2574
- * Platform service provider. Unread, but declared so that the tree setting it does not leave it in the DOM as an attribute.
2574
+ * Platform service provider, used to translate what the negation glyph means. The chip reads nothing else from it.
2575
2575
  */
2576
2576
  "platform": LimeWebComponentPlatform;
2577
2577
  /**
@@ -8091,11 +8091,11 @@ declare namespace LocalJSX {
8091
8091
  */
8092
8092
  "disabled"?: boolean;
8093
8093
  /**
8094
- * The condition's glyph.
8094
+ * The condition's glyph. Declared because the tree sets it, but not drawn: the polarity glyph has the only slot there is — see {@link glyph}.
8095
8095
  */
8096
8096
  "icon"?: IconName;
8097
8097
  /**
8098
- * The glyph's colour, which travels beside the name because `ConditionTreeChip.icon` has no room for it.
8098
+ * The glyph's colour, which travels beside the name because `ConditionTreeChip.icon` has no room for it. Not drawn either, for the same reason as `icon`.
8099
8099
  */
8100
8100
  "iconColor"?: string;
8101
8101
  /**
@@ -8117,7 +8117,7 @@ declare namespace LocalJSX {
8117
8117
  */
8118
8118
  "onRemove"?: (event: LimebbRuleConditionChipCustomEvent<void>) => void;
8119
8119
  /**
8120
- * Platform service provider. Unread, but declared so that the tree setting it does not leave it in the DOM as an attribute.
8120
+ * Platform service provider, used to translate what the negation glyph means. The chip reads nothing else from it.
8121
8121
  */
8122
8122
  "platform"?: LimeWebComponentPlatform;
8123
8123
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-crm-building-blocks",
3
- "version": "2.4.0",
3
+ "version": "2.4.2",
4
4
  "description": "A home for shared components meant for use with Lime CRM",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1 +0,0 @@
1
- import{r as t,c as i,h as s}from"./p-BK566_jX.js";const h=class{constructor(s){t(this,s),this.remove=i(this,"remove"),this.negated=!1,this.invalid=!1,this.selected=!1,this.readonly=!1,this.disabled=!1,this.removable=!0,this.handleRemove=t=>{t.stopPropagation(),this.remove.emit()}}render(){return s("limel-chip",{key:"3b1e45748efbdd1bdbf8effd7bca4976f9ba537c",text:this.text,icon:this.glyph,invalid:this.invalid,selected:this.selected,disabled:this.disabled,removable:this.removable&&!this.readonly,onRemove:this.handleRemove})}get glyph(){return this.icon&&this.iconColor?{name:this.icon,color:this.iconColor}:this.icon}get text(){return this.negated?`¬ ${this.label}`:this.label}};h.style=":host{display:inline-flex;min-width:0}";export{h as limebb_rule_condition_chip}