@limetech/lime-crm-building-blocks 1.120.0 → 1.121.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/{_MapCache-De1Fwe0H.js → _MapCache-DHOVMBKi.js} +341 -3
  3. package/dist/cjs/{_getTag-CdUodI28.js → _Uint8Array-CXHKqIsu.js} +375 -30
  4. package/dist/cjs/{_baseIsEqual-BtwicGmu.js → _baseIsEqual-Ba8g_ag_.js} +11 -13
  5. package/dist/cjs/{_defineProperty-eImBwVFM.js → _defineProperty-Bl_qu8Vn.js} +2 -2
  6. package/dist/cjs/{get-BRGtX379.js → get-D1lIKhWp.js} +6 -7
  7. package/dist/cjs/{isSymbol-D8S28StA.js → isSymbol-BJj6FNl6.js} +2 -2
  8. package/dist/cjs/limebb-component-config.cjs.entry.js +3 -4
  9. package/dist/cjs/limebb-info-tile.cjs.entry.js +134 -135
  10. package/dist/cjs/limebb-lime-query-filter-builder_3.cjs.entry.js +5 -7
  11. package/dist/cjs/limebb-locale-picker.cjs.entry.js +18 -20
  12. package/dist/cjs/limebb-object-chip.cjs.entry.js +1 -1
  13. package/dist/cjs/limebb-percentage-visualizer.cjs.entry.js +3 -3
  14. package/dist/cjs/limebb-property-selector.cjs.entry.js +1 -1
  15. package/dist/cjs/limebb-text-editor.cjs.entry.js +23 -25
  16. package/dist/cjs/limebb-trend-indicator.cjs.entry.js +2 -2
  17. package/dist/cjs/{limetype-TVwQ2eby.js → limetype-C7_hrzhN.js} +46 -0
  18. package/dist/collection/components/info-tile/info-tile.js +30 -67
  19. package/dist/collection/components/percentage-visualizer/percentage-visualizer.js +3 -3
  20. package/dist/collection/components/text-editor/text-editor.js +1 -1
  21. package/dist/collection/components/trend-indicator/trend-indicator.js +2 -2
  22. package/dist/collection/util/explorer-link.js +68 -0
  23. package/dist/collection/util/find-filter.js +16 -0
  24. package/dist/collection/util/limetype.js +45 -0
  25. package/dist/collection/util/localize-record.js +21 -0
  26. package/dist/components/_MapCache.js +1 -1
  27. package/dist/components/_Uint8Array.js +1 -1
  28. package/dist/components/_baseIsEqual.js +1 -1
  29. package/dist/components/_defineProperty.js +1 -1
  30. package/dist/components/get.js +1 -1
  31. package/dist/components/isSymbol.js +1 -1
  32. package/dist/components/limebb-info-tile.js +1 -1
  33. package/dist/components/limebb-locale-picker.js +1 -1
  34. package/dist/components/limebb-text-editor.js +1 -1
  35. package/dist/components/limebb-trend-indicator.js +1 -1
  36. package/dist/components/limetype-field.js +1 -1
  37. package/dist/components/limetype.js +1 -1
  38. package/dist/components/percentage-visualizer.js +1 -1
  39. package/dist/esm/{_MapCache-C_kVhYUl.js → _MapCache-BgAfMcRA.js} +329 -2
  40. package/dist/esm/{_getTag-DZlkp9mJ.js → _Uint8Array-CUI8uY-p.js} +351 -11
  41. package/dist/esm/{_baseIsEqual-DB13O4pD.js → _baseIsEqual-C-Mrg4RA.js} +2 -4
  42. package/dist/esm/{_defineProperty-DSmG08hO.js → _defineProperty-DZ483KPn.js} +1 -1
  43. package/dist/esm/{get-Bo260bSC.js → get-Cq4rshNg.js} +2 -3
  44. package/dist/esm/{isSymbol-Ci8cASb6.js → isSymbol-_IkM6xCs.js} +1 -1
  45. package/dist/esm/limebb-component-config.entry.js +3 -4
  46. package/dist/esm/limebb-info-tile.entry.js +135 -136
  47. package/dist/esm/limebb-lime-query-filter-builder_3.entry.js +4 -6
  48. package/dist/esm/limebb-locale-picker.entry.js +6 -8
  49. package/dist/esm/limebb-object-chip.entry.js +1 -1
  50. package/dist/esm/limebb-percentage-visualizer.entry.js +3 -3
  51. package/dist/esm/limebb-property-selector.entry.js +1 -1
  52. package/dist/esm/limebb-text-editor.entry.js +5 -7
  53. package/dist/esm/limebb-trend-indicator.entry.js +2 -2
  54. package/dist/esm/{limetype-BCEsb4WT.js → limetype-C4AY5lRw.js} +46 -1
  55. package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
  56. package/dist/lime-crm-building-blocks/p--IuhN2yx.js +1 -0
  57. package/dist/lime-crm-building-blocks/{p-c663afd2.entry.js → p-0cac0e56.entry.js} +1 -1
  58. package/dist/lime-crm-building-blocks/{p-5f1a4341.entry.js → p-34ad8e75.entry.js} +1 -1
  59. package/dist/lime-crm-building-blocks/p-37bab931.entry.js +1 -0
  60. package/dist/lime-crm-building-blocks/p-4163a0c0.entry.js +1 -0
  61. package/dist/lime-crm-building-blocks/p-49edd4fe.entry.js +1 -0
  62. package/dist/lime-crm-building-blocks/p-6PYziigk.js +1 -0
  63. package/dist/lime-crm-building-blocks/p-7a983aca.entry.js +1 -0
  64. package/dist/lime-crm-building-blocks/p-9019ca6f.entry.js +1 -0
  65. package/dist/lime-crm-building-blocks/p-BgAfMcRA.js +1 -0
  66. package/dist/lime-crm-building-blocks/p-BsH0YW6Z.js +1 -0
  67. package/dist/lime-crm-building-blocks/p-CKEnwX6j.js +1 -0
  68. package/dist/lime-crm-building-blocks/p-Ceen0vzd.js +1 -0
  69. package/dist/lime-crm-building-blocks/p-CtcTT7BK.js +1 -0
  70. package/dist/lime-crm-building-blocks/p-aa9b7af3.entry.js +1 -0
  71. package/dist/lime-crm-building-blocks/p-f397b288.entry.js +1 -0
  72. package/dist/types/components/info-tile/info-tile.d.ts +0 -3
  73. package/dist/types/util/explorer-link.d.ts +52 -0
  74. package/dist/types/util/find-filter.d.ts +13 -0
  75. package/dist/types/util/limetype.d.ts +35 -0
  76. package/dist/types/util/localize-record.d.ts +17 -0
  77. package/package.json +2 -2
  78. package/dist/cjs/_Map-BlpAtLvq.js +0 -342
  79. package/dist/cjs/_Uint8Array-C_lvn5HO.js +0 -352
  80. package/dist/components/_Map.js +0 -1
  81. package/dist/components/_getTag.js +0 -1
  82. package/dist/esm/_Map-ByjZfyP_.js +0 -330
  83. package/dist/esm/_Uint8Array-DVXPnoWk.js +0 -345
  84. package/dist/lime-crm-building-blocks/p-25700afb.entry.js +0 -1
  85. package/dist/lime-crm-building-blocks/p-3622d9b7.entry.js +0 -1
  86. package/dist/lime-crm-building-blocks/p-44347a69.entry.js +0 -1
  87. package/dist/lime-crm-building-blocks/p-60a09d6b.entry.js +0 -1
  88. package/dist/lime-crm-building-blocks/p-7cbec456.entry.js +0 -1
  89. package/dist/lime-crm-building-blocks/p-B8RiYkLS.js +0 -1
  90. package/dist/lime-crm-building-blocks/p-BJ8HvfgI.js +0 -1
  91. package/dist/lime-crm-building-blocks/p-BoVsXNfL.js +0 -1
  92. package/dist/lime-crm-building-blocks/p-ByjZfyP_.js +0 -1
  93. package/dist/lime-crm-building-blocks/p-CQ-z_HTt.js +0 -1
  94. package/dist/lime-crm-building-blocks/p-V3xfp9dg.js +0 -1
  95. package/dist/lime-crm-building-blocks/p-e2a6b9d2.entry.js +0 -1
  96. package/dist/lime-crm-building-blocks/p-e70a5298.entry.js +0 -1
  97. package/dist/lime-crm-building-blocks/p-mljVfXwO.js +0 -1
  98. package/dist/lime-crm-building-blocks/p-wbuFLk-j.js +0 -1
  99. package/dist/lime-crm-building-blocks/p-yc--7_7T.js +0 -1
@@ -1,74 +1,6 @@
1
1
  import { r as registerInstance, h, g as getElement } from './index-BIwHMk6j.js';
2
- import { n, r as rt, b as at, j as je, Z as Ze, X as Xe } from './index.esm-mwnk3PIM.js';
3
- import { i as isArrayLike, a as isBuffer, b as isTypedArray, c as isArguments, g as getTag, d as isPrototype, e as baseKeys } from './_getTag-DZlkp9mJ.js';
4
- import { a as isArray } from './_Map-ByjZfyP_.js';
5
-
6
- /** `Object#toString` result references. */
7
- var mapTag = '[object Map]',
8
- setTag = '[object Set]';
9
-
10
- /** Used for built-in method references. */
11
- var objectProto = Object.prototype;
12
-
13
- /** Used to check objects for own properties. */
14
- var hasOwnProperty = objectProto.hasOwnProperty;
15
-
16
- /**
17
- * Checks if `value` is an empty object, collection, map, or set.
18
- *
19
- * Objects are considered empty if they have no own enumerable string keyed
20
- * properties.
21
- *
22
- * Array-like values such as `arguments` objects, arrays, buffers, strings, or
23
- * jQuery-like collections are considered empty if they have a `length` of `0`.
24
- * Similarly, maps and sets are considered empty if they have a `size` of `0`.
25
- *
26
- * @static
27
- * @memberOf _
28
- * @since 0.1.0
29
- * @category Lang
30
- * @param {*} value The value to check.
31
- * @returns {boolean} Returns `true` if `value` is empty, else `false`.
32
- * @example
33
- *
34
- * _.isEmpty(null);
35
- * // => true
36
- *
37
- * _.isEmpty(true);
38
- * // => true
39
- *
40
- * _.isEmpty(1);
41
- * // => true
42
- *
43
- * _.isEmpty([1, 2, 3]);
44
- * // => false
45
- *
46
- * _.isEmpty({ 'a': 1 });
47
- * // => false
48
- */
49
- function isEmpty(value) {
50
- if (value == null) {
51
- return true;
52
- }
53
- if (isArrayLike(value) &&
54
- (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
55
- isBuffer(value) || isTypedArray(value) || isArguments(value))) {
56
- return !value.length;
57
- }
58
- var tag = getTag(value);
59
- if (tag == mapTag || tag == setTag) {
60
- return !value.size;
61
- }
62
- if (isPrototype(value)) {
63
- return !baseKeys(value).length;
64
- }
65
- for (var key in value) {
66
- if (hasOwnProperty.call(value, key)) {
67
- return false;
68
- }
69
- }
70
- return true;
71
- }
2
+ import { n, X as Xe, r as rt, b as at, j as je, Z as Ze } from './index.esm-mwnk3PIM.js';
3
+ import { a as getRelationPropertyName } from './limetype-C4AY5lRw.js';
72
4
 
73
5
  /**
74
6
  * Context provider for the info-tile component.
@@ -178,6 +110,113 @@ class InfoTileLoader {
178
110
  }
179
111
  }
180
112
 
113
+ /**
114
+ * Picks a localized string from a record keyed by locale code.
115
+ *
116
+ * Looks up the value for `language` first, then falls back to `en` and
117
+ * `en_us`. Returns an empty string when none of those keys carry a
118
+ * non-empty value, even if other locales are present in the record —
119
+ * matching the behavior consumers rely on today.
120
+ *
121
+ * Useful for resolving values such as `Filter.name`, where strings are
122
+ * provided per locale.
123
+ *
124
+ * @param strings - Record where keys are locale codes and values are
125
+ * the localized strings.
126
+ * @param language - The preferred locale code.
127
+ */
128
+ function localizeRecord(strings, language) {
129
+ if (!strings) {
130
+ return '';
131
+ }
132
+ return strings[language] || strings.en || strings.en_us || '';
133
+ }
134
+
135
+ /**
136
+ * Finds a filter set by id in an array of filter sets.
137
+ *
138
+ * Returns `undefined` when either `filters` or `filterId` is missing or
139
+ * when no filter matches — safe to call with optional inputs without a
140
+ * guard.
141
+ *
142
+ * @param filters - The filter sets to search.
143
+ * @param filterId - The id of the filter set to find.
144
+ */
145
+ function findFilter(filters, filterId) {
146
+ if (!filters || !filterId) {
147
+ return undefined;
148
+ }
149
+ return filters.find((filter) => filter.id === filterId);
150
+ }
151
+
152
+ /**
153
+ * Build a parsed explorer destination for a filter, optionally
154
+ * narrowing it with extra expressions AND-combined onto the filter's
155
+ * own expression. Use this when navigating imperatively via the
156
+ * `Navigator` service so the host SPA stays on the page (no full
157
+ * reload).
158
+ * @param filter - the filter set whose limetype and id form the
159
+ * explorer path. When `undefined`, the function returns
160
+ * `{ path: '#' }` so callers can wire it into a link without a
161
+ * special-case branch.
162
+ * @param extraExpressions - expressions to AND onto the filter's own
163
+ * expression. The chart passes `{ key: groupBy, op: '=', exp: item }`
164
+ * here, info-tile passes a back-reference constraint when the widget
165
+ * is on an object card. Order matters in the resulting AND: extras
166
+ * come before the filter's own expression.
167
+ * @returns `path` plus, when there's any filter expression to apply,
168
+ * `query.filter` holding the combined expression as a raw object (the
169
+ * navigator stringifies and URL-encodes it when generating the URL).
170
+ */
171
+ function buildExplorerLocation(filter, extraExpressions = []) {
172
+ if (!filter) {
173
+ return { path: '#' };
174
+ }
175
+ const path = ['explorer', filter.limetype, filter.id].join('/');
176
+ const combined = combineExpressions(filter.filter, extraExpressions);
177
+ return combined ? { path, query: { filter: combined } } : { path };
178
+ }
179
+ /**
180
+ * Build a Lime CRM explorer href for a filter, optionally narrowing it
181
+ * with extra expressions AND-combined onto the filter's own expression.
182
+ *
183
+ * Used by widgets like `limebb-info-tile` to render anchor `<a>` links
184
+ * to a filtered list. For imperative navigation prefer
185
+ * {@link buildExplorerLocation} together with the `Navigator` service.
186
+ * @param filter - the filter set whose limetype and id form the
187
+ * explorer href. When `undefined`, the function returns `'#'` so
188
+ * callers can wire it into a link without a special-case branch.
189
+ * @param extraExpressions - expressions to AND onto the filter's own
190
+ * expression, with the same ordering and use-cases as
191
+ * {@link buildExplorerLocation}.
192
+ * @returns an explorer href such as
193
+ * `explorer/{limetype}/{filterId}?filter=<URL-encoded JSON>`, or
194
+ * `'#'` when `filter` is `undefined`.
195
+ */
196
+ function buildExplorerHref(filter, extraExpressions = []) {
197
+ const { path, query } = buildExplorerLocation(filter, extraExpressions);
198
+ if (!query) {
199
+ return path;
200
+ }
201
+ const search = Object.entries(query)
202
+ .map(([key, value]) => `${key}=${encodeURIComponent(JSON.stringify(value))}`)
203
+ .join('&');
204
+ return `${path}?${search}`;
205
+ }
206
+ function combineExpressions(filter, extras) {
207
+ const all = [...extras, filter].filter((exp) => exp !== undefined);
208
+ if (all.length === 0) {
209
+ return undefined;
210
+ }
211
+ if (all.length === 1) {
212
+ return all[0];
213
+ }
214
+ return {
215
+ op: Xe.AND,
216
+ exp: all,
217
+ };
218
+ }
219
+
181
220
  class BasicFormatter {
182
221
  constructor(locale) {
183
222
  this.locale = locale;
@@ -432,7 +471,7 @@ const InfoTile = class {
432
471
  const errorProps = Object.assign(Object.assign({}, baseProps), { icon: 'error', prefix: 'ERROR', loading: true, label: this.getLabel(filter) });
433
472
  const normalProps = Object.assign(Object.assign({}, baseProps), { label: this.getLabel(filter), link: this.getLink(filter), loading: this.loading, value: value === null || value === void 0 ? void 0 : value.value.trim() });
434
473
  const props = !filter || this.error ? errorProps : normalProps;
435
- return (h("limel-info-tile", Object.assign({ key: '163c9aa74b485cb28ae56735a9643dd7e6579465', class: { error: !filter || this.error } }, props)));
474
+ return (h("limel-info-tile", Object.assign({ key: '540d2ccbd5c4e3d09fb736e260b3ec5c02d42415', class: { error: !filter || this.error } }, props)));
436
475
  }
437
476
  getFormattedValue() {
438
477
  if (!this.value && this.value !== 0) {
@@ -456,79 +495,39 @@ const InfoTile = class {
456
495
  return this.translator.get(this.label);
457
496
  }
458
497
  if (this.label && typeof this.label === 'object') {
459
- return this.getLocalizedString(this.label);
498
+ return localizeRecord(this.label, this.language);
460
499
  }
461
- return this.getLocalizedString(filter.name);
462
- }
463
- getLocalizedString(strings) {
464
- if (isEmpty(strings)) {
465
- return '';
466
- }
467
- let localizedString = strings[this.language];
468
- if (!localizedString) {
469
- localizedString =
470
- strings.en ||
471
- strings.en_us ||
472
- Object.values(localizedString !== null && localizedString !== void 0 ? localizedString : {}).find((name) => !!name);
473
- }
474
- return localizedString !== null && localizedString !== void 0 ? localizedString : '';
500
+ return localizeRecord(filter.name, this.language);
475
501
  }
476
502
  getLink(filter) {
477
- if (!filter) {
478
- return { href: '#' };
479
- }
480
- const baseHref = ['explorer', filter.limetype, filter.id].join('/');
481
- const relationPropertyName = this.getRelationPropertyName(this.limetypes[filter.limetype]);
482
- const contextAwareFilter = this.buildContextAwareFilter(filter.filter, relationPropertyName);
483
- if (!contextAwareFilter) {
484
- return { href: baseHref };
485
- }
486
- const filterQuery = encodeURIComponent(JSON.stringify(contextAwareFilter));
487
- return { href: `${baseHref}?filter=${filterQuery}` };
488
- }
489
- buildContextAwareFilter(filter, relationPropertyName) {
490
- if (!relationPropertyName) {
491
- return filter;
492
- }
493
- const relationFilter = {
494
- key: relationPropertyName,
495
- op: Xe.EQUALS,
496
- exp: this.context.id,
497
- };
498
- if (!filter) {
499
- return {
500
- relationFilter,
501
- };
502
- }
503
- return {
504
- op: Xe.AND,
505
- exp: [relationFilter, filter],
506
- };
503
+ const relationPropertyName = getRelationPropertyName({
504
+ targetLimetype: filter
505
+ ? this.limetypes[filter.limetype]
506
+ : undefined,
507
+ currentLimetype: this.context.limetype
508
+ ? this.limetypes[this.context.limetype]
509
+ : undefined,
510
+ contextLimetypeName: this.context.limetype,
511
+ contextId: this.context.id,
512
+ propertyName: this.propertyName,
513
+ });
514
+ const extras = relationPropertyName && this.context.id
515
+ ? [
516
+ {
517
+ key: relationPropertyName,
518
+ op: Xe.EQUALS,
519
+ exp: this.context.id,
520
+ },
521
+ ]
522
+ : [];
523
+ return { href: buildExplorerHref(filter, extras) };
507
524
  }
508
525
  getFilter() {
509
- var _a;
510
- return (_a = this.filters) === null || _a === void 0 ? void 0 : _a.find((filter) => filter.id === this.filterId);
526
+ return findFilter(this.filters, this.filterId);
511
527
  }
512
528
  getFormatter(value) {
513
529
  return new InfoTileFormatterFactory(this.language).createFormatter(this.format, value);
514
530
  }
515
- getRelationPropertyName(limetype) {
516
- var _a, _b, _c;
517
- if (!limetype || !this.context.limetype || !this.context.id) {
518
- return;
519
- }
520
- if (this.propertyName) {
521
- const currentLimeType = this.limetypes[this.context.limetype];
522
- const backReference = (_b = (_a = currentLimeType === null || currentLimeType === void 0 ? void 0 : currentLimeType.getProperty(this.propertyName)) === null || _a === void 0 ? void 0 : _a.relation) === null || _b === void 0 ? void 0 : _b.getBackreference();
523
- if (backReference) {
524
- return backReference.name;
525
- }
526
- }
527
- return (_c = Object.values(limetype.properties).find((property) => {
528
- var _a;
529
- return (((_a = property.relation) === null || _a === void 0 ? void 0 : _a.getLimetype().name) === this.context.limetype);
530
- })) === null || _c === void 0 ? void 0 : _c.name;
531
- }
532
531
  get translator() {
533
532
  return this.platform.get(n.Translate);
534
533
  }
@@ -549,7 +548,7 @@ const InfoTile = class {
549
548
  limetype: filter === null || filter === void 0 ? void 0 : filter.limetype,
550
549
  filterId: this.filterId,
551
550
  filterName: filter
552
- ? this.getLocalizedString(filter.name)
551
+ ? localizeRecord(filter.name, this.language)
553
552
  : undefined,
554
553
  aggregateOperator: this.aggregateOperator,
555
554
  propertyName: this.propertyName,
@@ -1,12 +1,10 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-BIwHMk6j.js';
2
2
  import { X as Xe, n } from './index.esm-mwnk3PIM.js';
3
- import { g as getIcon } from './limetype-BCEsb4WT.js';
3
+ import { g as getIcon } from './limetype-C4AY5lRw.js';
4
4
  import { i as isNonNull } from './non-null-CkTg5UPD.js';
5
- import { b as baseIsEqual } from './_baseIsEqual-DB13O4pD.js';
6
- import { i as isObjectLike, a as isArray, b as baseGetTag } from './_Map-ByjZfyP_.js';
7
- import './_Uint8Array-DVXPnoWk.js';
8
- import './_MapCache-C_kVhYUl.js';
9
- import './_getTag-DZlkp9mJ.js';
5
+ import { b as baseIsEqual } from './_baseIsEqual-C-Mrg4RA.js';
6
+ import { i as isObjectLike, a as isArray, b as baseGetTag } from './_MapCache-BgAfMcRA.js';
7
+ import './_Uint8Array-CUI8uY-p.js';
10
8
 
11
9
  /** `Object#toString` result references. */
12
10
  var stringTag = '[object String]';
@@ -1,13 +1,11 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-BIwHMk6j.js';
2
2
  import { n } from './index.esm-mwnk3PIM.js';
3
- import { t as toString, c as castPath, a as toKey, i as isKey, g as get, b as baseGet, d as arrayMap } from './get-Bo260bSC.js';
4
- import { i as isIndex, a as arrayPush, S as Stack, k as keys } from './_Uint8Array-DVXPnoWk.js';
5
- import { d as isObject, a as isArray, S as Symbol } from './_Map-ByjZfyP_.js';
6
- import { i as isArrayLike, c as isArguments, h as isLength, f as baseUnary } from './_getTag-DZlkp9mJ.js';
7
- import { b as baseIsEqual } from './_baseIsEqual-DB13O4pD.js';
8
- import { i as isSymbol } from './isSymbol-Ci8cASb6.js';
9
- import { d as defineProperty } from './_defineProperty-DSmG08hO.js';
10
- import { e as eq } from './_MapCache-C_kVhYUl.js';
3
+ import { t as toString, c as castPath, a as toKey, i as isKey, g as get, b as baseGet, d as arrayMap } from './get-Cq4rshNg.js';
4
+ import { e as isArrayLike, f as isIndex, h as isArguments, j as arrayPush, S as Stack, k as keys, l as isLength, d as baseUnary } from './_Uint8Array-CUI8uY-p.js';
5
+ import { c as isObject, e as eq, a as isArray, S as Symbol } from './_MapCache-BgAfMcRA.js';
6
+ import { b as baseIsEqual } from './_baseIsEqual-C-Mrg4RA.js';
7
+ import { i as isSymbol } from './isSymbol-_IkM6xCs.js';
8
+ import { d as defineProperty } from './_defineProperty-DZ483KPn.js';
11
9
 
12
10
  /**
13
11
  * This method returns the first argument it receives.
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, g as getElement, h } from './index-BIwHMk6j.js';
2
- import { g as getIcon } from './limetype-BCEsb4WT.js';
2
+ import { g as getIcon } from './limetype-C4AY5lRw.js';
3
3
  import { f as findParentElement } from './dom-B95D7tDb.js';
4
4
  import { g as gt, n } from './index.esm-mwnk3PIM.js';
5
5
 
@@ -68,7 +68,7 @@ const PercentageVisualizer = class {
68
68
  this.numberFormat = new Intl.NumberFormat(this.locale);
69
69
  }
70
70
  catch (_a) {
71
- console.error(`Could not get user's locale (${this.locale}), falling back to 'en'.`);
71
+ console.warn(`Could not get user's locale (${this.locale}), falling back to 'en'.`);
72
72
  this.locale = 'en';
73
73
  this.numberFormat = new Intl.NumberFormat('en');
74
74
  }
@@ -88,11 +88,11 @@ const PercentageVisualizer = class {
88
88
  render() {
89
89
  const normalizedValue = this.getNormalizedValue();
90
90
  const zeroPoint = this.getZeroPointPosition();
91
- return (h(Host, { key: 'e3ff49b03b4703e06dbe85edc26421d95ed3974d', class: this.getContainerClassList(), style: {
91
+ return (h(Host, { key: '11b3795adc2f38c75866292070edc9f89bd7c099', class: this.getContainerClassList(), style: {
92
92
  '--limebb-percentage-visualizer-zero-point-position': `${zeroPoint}%`,
93
93
  '--limebb-percentage-visualizer-width': `${Math.abs(normalizedValue)}%`,
94
94
  '--limebb-percentage-visualizer-rotate': `${normalizedValue >= 0 ? '0deg' : '180deg'}`,
95
- } }, h("limel-notched-outline", { key: '308a71d2427118515f5a7bfbb3dbe20a7b310461', tabIndex: 0, role: "meter", "aria-valuemin": this.rangeMin, "aria-valuemax": this.rangeMax, "aria-valuenow": this.numValue, "aria-labelledby": this.labelId, "aria-describedby": this.helperTextId, label: this.label, labelId: this.labelId, invalid: this.invalid, required: this.required, hasValue: true, hasFloatingLabel: true, "aria-controls": this.helperTextId }, h("div", { key: '80bdd6e8423cc62ba4298d1f3af48cc77e662e72', slot: "content" }, this.renderVisualization())), this.renderHelperLine()));
95
+ } }, h("limel-notched-outline", { key: '2c3000f41ba01de424c3cb18dcb2f71799800449', tabIndex: 0, role: "meter", "aria-valuemin": this.rangeMin, "aria-valuemax": this.rangeMax, "aria-valuenow": this.numValue, "aria-labelledby": this.labelId, "aria-describedby": this.helperTextId, label: this.label, labelId: this.labelId, invalid: this.invalid, required: this.required, hasValue: true, hasFloatingLabel: true, "aria-controls": this.helperTextId }, h("div", { key: 'b0b064361c57341342344e7ecfe29818413737ee', slot: "content" }, this.renderVisualization())), this.renderHelperLine()));
96
96
  }
97
97
  renderVisualization() {
98
98
  if (this.reducePresence && (this.numValue === 0 || !this.hasValue())) {
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-BIwHMk6j.js';
2
2
  import { j as je, n } from './index.esm-mwnk3PIM.js';
3
3
  import { g as getPropertyFromPath, a as getNormalizedProperties } from './property-resolution-CQUZjrU4.js';
4
- import { g as getIcon } from './limetype-BCEsb4WT.js';
4
+ import { g as getIcon } from './limetype-C4AY5lRw.js';
5
5
 
6
6
  const propertySelectorCss = () => `:host(limebb-property-selector){display:block}limel-menu{display:block;width:100%}`;
7
7
 
@@ -1,15 +1,13 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement } from './index-BIwHMk6j.js';
2
2
  import { n, Z as Ze, Q as Qe, j as je } from './index.esm-mwnk3PIM.js';
3
3
  import { A as ARROW_DOWN, a as ESCAPE, b as ARROW_UP, E as ENTER, T as TAB } from './keycodes-CwMJvF_Z.js';
4
- import { U as Uint8Array, S as Stack, g as getAllKeys } from './_Uint8Array-DVXPnoWk.js';
5
- import { d as defineProperty } from './_defineProperty-DSmG08hO.js';
6
- import { e as eq } from './_MapCache-C_kVhYUl.js';
7
- import { o as overArg, d as isPrototype, g as getTag, f as baseUnary, n as nodeUtil, a as isBuffer } from './_getTag-DZlkp9mJ.js';
8
- import { d as isObject, S as Symbol, i as isObjectLike, a as isArray, r as root } from './_Map-ByjZfyP_.js';
4
+ import { o as overArg, U as Uint8Array, c as isPrototype, a as getTag, d as baseUnary, n as nodeUtil, i as isBuffer, S as Stack, g as getAllKeys } from './_Uint8Array-CUI8uY-p.js';
5
+ import { d as defineProperty } from './_defineProperty-DZ483KPn.js';
6
+ import { c as isObject, e as eq, S as Symbol, i as isObjectLike, a as isArray, r as root } from './_MapCache-BgAfMcRA.js';
9
7
  import { c as createRandomString } from './random-string-C2JP2nLw.js';
10
- import { h as hasHasManyRelation, a as hasLabel, b as getRelationProperty } from './limetype-BCEsb4WT.js';
8
+ import { h as hasHasManyRelation, b as hasLabel, c as getRelationProperty } from './limetype-C4AY5lRw.js';
11
9
  import { i as isNonNull } from './non-null-CkTg5UPD.js';
12
- import { i as isSymbol } from './isSymbol-Ci8cASb6.js';
10
+ import { i as isSymbol } from './isSymbol-_IkM6xCs.js';
13
11
 
14
12
  /** Used to match a single whitespace character. */
15
13
  var reWhitespace = /\s/;
@@ -42,14 +42,14 @@ const TrendIndicator = class {
42
42
  this.numberFormat = new Intl.NumberFormat(this.locale);
43
43
  }
44
44
  catch (_a) {
45
- console.error(`Could not get user's locale (${this.locale}), falling back to 'en'.`);
45
+ console.warn(`Could not get user's locale (${this.locale}), falling back to 'en'.`);
46
46
  this.locale = 'en';
47
47
  this.numberFormat = new Intl.NumberFormat('en');
48
48
  }
49
49
  this.numValue = this.parseValue(this.value);
50
50
  }
51
51
  render() {
52
- return (h(Host, { key: 'c1d0e3cbfbfe0da3d821817b3986773ea7af13de', class: this.getContainerClassList() }, h("limel-notched-outline", { key: 'd32675f77f9a6bc700d566acc9f59b3575f03ff1', id: this.tooltipId, label: this.label, labelId: this.labelId, invalid: this.invalid, required: this.required, hasValue: true, hasFloatingLabel: true, "aria-labelledby": this.labelId, "aria-describedby": this.helperTextId, "aria-controls": this.helperTextId }, h("div", { key: '558eac3631f2daced6d6e4f246912140ceb65268', slot: "content", tabIndex: 0 }, this.renderVisualization())), this.renderHelperLine(), this.renderTooltip()));
52
+ return (h(Host, { key: '4dc77e741406e9b51fdde5744b8c46bf70fd8cab', class: this.getContainerClassList() }, h("limel-notched-outline", { key: '3a0209effdb1ef52d8109e420162e0675e40178f', id: this.tooltipId, label: this.label, labelId: this.labelId, invalid: this.invalid, required: this.required, hasValue: true, hasFloatingLabel: true, "aria-labelledby": this.labelId, "aria-describedby": this.helperTextId, "aria-controls": this.helperTextId }, h("div", { key: 'fcf81af972393a538a65e6014afa581935fcf837', slot: "content", tabIndex: 0 }, this.renderVisualization())), this.renderHelperLine(), this.renderTooltip()));
53
53
  }
54
54
  renderVisualization() {
55
55
  if (this.reducePresence && (this.numValue === 0 || !this.hasValue())) {
@@ -81,5 +81,50 @@ function hasHasManyRelation(limetype, relatedLabel) {
81
81
  const property = getRelationProperty(limetype, relatedLabel);
82
82
  return !!property && isManyRelation(property);
83
83
  }
84
+ /**
85
+ * Find the property on `targetLimetype` whose relation points back to
86
+ * `contextLimetypeName`. This is the property a Lime CRM widget can use
87
+ * to narrow a filter to "items related to the current context object"
88
+ * — for example, "deals belonging to *this* company" when a widget is
89
+ * placed on a company card.
90
+ *
91
+ * Pass `propertyName` (the widget's configured property) to prefer the
92
+ * back-reference of *that* property's relation when ambiguous, falling
93
+ * back to the first matching relation on the limetype otherwise.
94
+ * @param options - the lookup inputs.
95
+ * @param options.targetLimetype - the limetype the filter is querying
96
+ * (i.e. the limetype the explorer would land on). The returned property
97
+ * name is one of *its* properties.
98
+ * @param options.currentLimetype - the limetype of the page hosting the
99
+ * widget, used together with `propertyName` to resolve a back-reference
100
+ * when the configured property is itself a relation.
101
+ * @param options.contextLimetypeName - name of the page's limetype.
102
+ * Returns `undefined` when missing — there is no context to relate to.
103
+ * @param options.contextId - id of the current context object. Returns
104
+ * `undefined` when missing — the relation cannot be narrowed without it.
105
+ * @param options.propertyName - widget-configured property whose
106
+ * relation back-reference should be preferred over a generic limetype
107
+ * scan. Optional.
108
+ * @returns name of the property on `targetLimetype` that points back at
109
+ * the context, or `undefined` when no such relation exists or the
110
+ * required inputs are missing.
111
+ */
112
+ function getRelationPropertyName(options) {
113
+ var _a, _b, _c;
114
+ const { targetLimetype, currentLimetype, contextLimetypeName, contextId, propertyName, } = options;
115
+ if (!targetLimetype || !contextLimetypeName || !contextId) {
116
+ return undefined;
117
+ }
118
+ if (propertyName) {
119
+ const backReference = (_b = (_a = currentLimetype === null || currentLimetype === void 0 ? void 0 : currentLimetype.getProperty(propertyName)) === null || _a === void 0 ? void 0 : _a.relation) === null || _b === void 0 ? void 0 : _b.getBackreference();
120
+ if (backReference) {
121
+ return backReference.name;
122
+ }
123
+ }
124
+ return (_c = Object.values(targetLimetype.properties).find((property) => {
125
+ var _a;
126
+ return ((_a = property.relation) === null || _a === void 0 ? void 0 : _a.getLimetype().name) === contextLimetypeName;
127
+ })) === null || _c === void 0 ? void 0 : _c.name;
128
+ }
84
129
 
85
- export { hasLabel as a, getRelationProperty as b, getIcon as g, hasHasManyRelation as h };
130
+ export { getRelationPropertyName as a, hasLabel as b, getRelationProperty as c, getIcon as g, hasHasManyRelation as h };
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-BIwHMk6j.js";export{s as setNonce}from"./p-BIwHMk6j.js";import{g as i}from"./p-DQuL1Twl.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((async e=>(await i(),t(JSON.parse('[["p-2b913c47",[[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-2d35d237",[[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-3252e153",[[1,"limebb-kanban",{"platform":[16],"context":[16],"groups":[16]}]]],["p-91368f57",[[1,"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-9d1c84ee",[[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-cc07285b",[[1,"limebb-document-chips",{"accessibleLabel":[513,"accessible-label"],"files":[16]},null,{"files":[{"onFilesChanged":0}]}]]],["p-f3e2fd00",[[1,"limebb-limeobject-file-viewer",{"platform":[16],"context":[16],"property":[1],"fileTypes":[16],"limeobject":[32],"limetype":[32]}]]],["p-25700afb",[[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],"allowInlineImages":[4,"allow-inline-images"],"items":[32],"highlightedItemIndex":[32],"editorPickerQuery":[32],"searchableLimetypes":[32],"isPickerOpen":[32],"isSearching":[32]},null,{"isPickerOpen":[{"watchOpen":0}],"editorPickerQuery":[{"watchQuery":0}]}]]],["p-e5511ba8",[[1,"limebb-data-cells",{"platform":[16],"context":[16],"limeobject":[8],"items":[16],"image":[16],"relativeDates":[4,"relative-dates"]}]]],["p-54bb577b",[[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-02a3530f",[[1,"limebb-document-picker",{"platform":[16],"context":[16],"items":[16],"label":[513],"helperText":[513,"helper-text"],"invalid":[516],"required":[516],"type":[513]}]]],["p-b2383e7f",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["p-46da9897",[[1,"limebb-notification-list",{"platform":[16],"context":[16],"items":[16],"loading":[4],"lastVisitedTimestamp":[1,"last-visited-timestamp"]},null,{"items":[{"handleItemsChange":0}]}]]],["p-e4005988",[[257,"limebb-alert-dialog",{"type":[513],"open":[516],"icon":[513],"heading":[513],"subheading":[1]}]]],["p-03aa9f07",[[17,"limebb-browser",{"platform":[16],"context":[16],"items":[16],"layout":[1],"filter":[32]}]]],["p-60a09d6b",[[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-bc0ffe17",[[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-79d17b2b",[[257,"limebb-composer-toolbar",{"platform":[16],"mentions":[516],"textSnippets":[516,"text-snippets"],"internalLinks":[516,"internal-links"],"richText":[516,"rich-text"],"fileInput":[16]}]]],["p-d153e06d",[[257,"limebb-dashboard-widget",{"heading":[513],"subheading":[513],"supportingText":[513,"supporting-text"],"icon":[513]}]]],["p-655968ce",[[1,"limebb-icon-picker",{"value":[1],"required":[4],"readonly":[4],"invalid":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-44347a69",[[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],"config":[32],"filters":[32],"value":[32],"loading":[32],"error":[32],"limetypes":[32]},null,{"filterId":[{"watchFilterId":0}],"propertyName":[{"watchPropertyName":0}],"aggregateOperator":[{"watchAggregateOperator":0}]}]]],["p-1428aa13",[[1,"limebb-info-tile-date-format",{"value":[16]}]]],["p-dabb227b",[[1,"limebb-info-tile-decimal-format",{"value":[16]}]]],["p-750dbb18",[[1,"limebb-info-tile-format",{"platform":[16],"context":[16],"type":[1],"value":[16]}]]],["p-32f8477f",[[1,"limebb-info-tile-relative-date-format",{"value":[16]}]]],["p-3263f8d5",[[1,"limebb-info-tile-unit-format",{"value":[16]}]]],["p-bd43f3f1",[[1,"limebb-loader",{"platform":[16],"context":[16]}]]],["p-e70a5298",[[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-705f6e72",[[257,"limebb-mention",{"limetype":[1],"objectid":[2],"limeobject":[32]}]]],["p-2079ae59",[[1,"limebb-mention-group-counter",{"count":[2],"limetype":[16],"helperLabel":[1,"helper-label"]}]]],["p-c663afd2",[[1,"limebb-object-chip",{"limetype":[1],"objectid":[2],"size":[1],"platform":[16],"data":[32]},null,{"limetype":[{"handlePropChange":0}],"objectid":[{"handlePropChange":0}]}]]],["p-3622d9b7",[[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-cceff7f9",[[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-d7181a32",[[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-8da95b3a",[[17,"limebb-document-item",{"platform":[16],"context":[16],"item":[16],"type":[513],"fileTypes":[16]}]]],["p-d5e0131d",[[257,"limebb-kanban-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-4d402806",[[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-4446f170",[[1,"limebb-empty-state",{"heading":[513],"value":[513],"icon":[16]}]]],["p-d2a01f51",[[1,"limebb-text-editor-picker",{"items":[16],"open":[516],"isSearching":[4,"is-searching"],"emptyMessage":[1,"empty-message"]},null,{"open":[{"watchOpen":0}]}]]],["p-9589553c",[[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-2aae332a",[[1,"limebb-live-docs-info"]]],["p-195c2348",[[1,"limebb-notification-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-7cbec456",[[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-ebeddc29",[[1,"limebb-lime-query-order-by-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16]}]]],["p-8a820ede",[[1,"limebb-feed-item-thumbnail-file-info",{"description":[1]}]]],["p-e2a6b9d2",[[1,"limebb-lime-query-filter-builder",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[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-d4f14723",[[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-5f1a4341",[[1,"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-5ef41ad0",[[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-6559886d",[[1,"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]}]]],["p-cee4e6a6",[[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-b7027fc8",[[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]}],[1,"limebb-lime-query-filter-group",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16],"value":[32]}],[1,"limebb-lime-query-filter-not",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}]]]]'),e))));
1
+ import{p as e,b as t}from"./p-BIwHMk6j.js";export{s as setNonce}from"./p-BIwHMk6j.js";import{g as i}from"./p-DQuL1Twl.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((async e=>(await i(),t(JSON.parse('[["p-2b913c47",[[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-2d35d237",[[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-3252e153",[[1,"limebb-kanban",{"platform":[16],"context":[16],"groups":[16]}]]],["p-91368f57",[[1,"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-9d1c84ee",[[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-cc07285b",[[1,"limebb-document-chips",{"accessibleLabel":[513,"accessible-label"],"files":[16]},null,{"files":[{"onFilesChanged":0}]}]]],["p-f3e2fd00",[[1,"limebb-limeobject-file-viewer",{"platform":[16],"context":[16],"property":[1],"fileTypes":[16],"limeobject":[32],"limetype":[32]}]]],["p-37bab931",[[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],"allowInlineImages":[4,"allow-inline-images"],"items":[32],"highlightedItemIndex":[32],"editorPickerQuery":[32],"searchableLimetypes":[32],"isPickerOpen":[32],"isSearching":[32]},null,{"isPickerOpen":[{"watchOpen":0}],"editorPickerQuery":[{"watchQuery":0}]}]]],["p-e5511ba8",[[1,"limebb-data-cells",{"platform":[16],"context":[16],"limeobject":[8],"items":[16],"image":[16],"relativeDates":[4,"relative-dates"]}]]],["p-54bb577b",[[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-02a3530f",[[1,"limebb-document-picker",{"platform":[16],"context":[16],"items":[16],"label":[513],"helperText":[513,"helper-text"],"invalid":[516],"required":[516],"type":[513]}]]],["p-b2383e7f",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["p-46da9897",[[1,"limebb-notification-list",{"platform":[16],"context":[16],"items":[16],"loading":[4],"lastVisitedTimestamp":[1,"last-visited-timestamp"]},null,{"items":[{"handleItemsChange":0}]}]]],["p-e4005988",[[257,"limebb-alert-dialog",{"type":[513],"open":[516],"icon":[513],"heading":[513],"subheading":[1]}]]],["p-03aa9f07",[[17,"limebb-browser",{"platform":[16],"context":[16],"items":[16],"layout":[1],"filter":[32]}]]],["p-aa9b7af3",[[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-bc0ffe17",[[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-79d17b2b",[[257,"limebb-composer-toolbar",{"platform":[16],"mentions":[516],"textSnippets":[516,"text-snippets"],"internalLinks":[516,"internal-links"],"richText":[516,"rich-text"],"fileInput":[16]}]]],["p-d153e06d",[[257,"limebb-dashboard-widget",{"heading":[513],"subheading":[513],"supportingText":[513,"supporting-text"],"icon":[513]}]]],["p-655968ce",[[1,"limebb-icon-picker",{"value":[1],"required":[4],"readonly":[4],"invalid":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-4163a0c0",[[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],"config":[32],"filters":[32],"value":[32],"loading":[32],"error":[32],"limetypes":[32]},null,{"filterId":[{"watchFilterId":0}],"propertyName":[{"watchPropertyName":0}],"aggregateOperator":[{"watchAggregateOperator":0}]}]]],["p-1428aa13",[[1,"limebb-info-tile-date-format",{"value":[16]}]]],["p-dabb227b",[[1,"limebb-info-tile-decimal-format",{"value":[16]}]]],["p-750dbb18",[[1,"limebb-info-tile-format",{"platform":[16],"context":[16],"type":[1],"value":[16]}]]],["p-32f8477f",[[1,"limebb-info-tile-relative-date-format",{"value":[16]}]]],["p-3263f8d5",[[1,"limebb-info-tile-unit-format",{"value":[16]}]]],["p-bd43f3f1",[[1,"limebb-loader",{"platform":[16],"context":[16]}]]],["p-7a983aca",[[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-705f6e72",[[257,"limebb-mention",{"limetype":[1],"objectid":[2],"limeobject":[32]}]]],["p-2079ae59",[[1,"limebb-mention-group-counter",{"count":[2],"limetype":[16],"helperLabel":[1,"helper-label"]}]]],["p-0cac0e56",[[1,"limebb-object-chip",{"limetype":[1],"objectid":[2],"size":[1],"platform":[16],"data":[32]},null,{"limetype":[{"handlePropChange":0}],"objectid":[{"handlePropChange":0}]}]]],["p-9019ca6f",[[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-cceff7f9",[[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-d7181a32",[[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-8da95b3a",[[17,"limebb-document-item",{"platform":[16],"context":[16],"item":[16],"type":[513],"fileTypes":[16]}]]],["p-d5e0131d",[[257,"limebb-kanban-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-4d402806",[[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-4446f170",[[1,"limebb-empty-state",{"heading":[513],"value":[513],"icon":[16]}]]],["p-d2a01f51",[[1,"limebb-text-editor-picker",{"items":[16],"open":[516],"isSearching":[4,"is-searching"],"emptyMessage":[1,"empty-message"]},null,{"open":[{"watchOpen":0}]}]]],["p-9589553c",[[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-2aae332a",[[1,"limebb-live-docs-info"]]],["p-195c2348",[[1,"limebb-notification-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-f397b288",[[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-ebeddc29",[[1,"limebb-lime-query-order-by-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16]}]]],["p-8a820ede",[[1,"limebb-feed-item-thumbnail-file-info",{"description":[1]}]]],["p-49edd4fe",[[1,"limebb-lime-query-filter-builder",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[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-d4f14723",[[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-34ad8e75",[[1,"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-5ef41ad0",[[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-6559886d",[[1,"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]}]]],["p-cee4e6a6",[[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-b7027fc8",[[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]}],[1,"limebb-lime-query-filter-group",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16],"value":[32]}],[1,"limebb-lime-query-filter-not",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}]]]]'),e))));
@@ -0,0 +1 @@
1
+ import{i as n,a as r}from"./p-B3U_Lxk4.js";function o(n){var r;return(o=(null===(r=null==n?void 0:n.ui)||void 0===r?void 0:r.color)||"rgb(var(--color-gray-default))").startsWith("lime-")?`var(--${o})`:o;var o}function t(n){var r;return{name:(null===(r=null==n?void 0:n.ui)||void 0===r?void 0:r.icon)||"decision",color:o(n)}}function i(n,r){return n.label===r}function e(n,r){return Object.values(n.properties).find((n=>n&&n.relation&&i(n.relation.getLimetype(),r)))}function u(o,t){const i=e(o,t);return!!i&&function(o){return n(o)&&!r(o)}(i)}function l(n){var r,o,t;const{targetLimetype:i,currentLimetype:e,contextLimetypeName:u,contextId:l,propertyName:v}=n;if(i&&u&&l){if(v){const n=null===(o=null===(r=null==e?void 0:e.getProperty(v))||void 0===r?void 0:r.relation)||void 0===o?void 0:o.getBackreference();if(n)return n.name}return null===(t=Object.values(i.properties).find((n=>{var r;return(null===(r=n.relation)||void 0===r?void 0:r.getLimetype().name)===u})))||void 0===t?void 0:t.name}}export{l as a,i as b,e as c,t as g,u as h}
@@ -1 +1 @@
1
- import{r as t,g as i,h as s}from"./p-BIwHMk6j.js";import{g as e}from"./p-BoVsXNfL.js";import{f as h}from"./p-B95D7tDb.js";import{g as o,n as a}from"./p-B3U_Lxk4.js";const r=o("object-resolver");class l{constructor(t){this.onStateChange=t,this.state={loadFailed:!1},this.hasPendingLoad=!1,this.isDisconnected=!1}get resolvedPlatform(){return this._platform}connect(t,i,s,e){this.limetype=t,this.objectid=i,this.isDisconnected=!1,this.hasPendingLoad=!1,this._platform=e||this.findPlatform(s),this._platform?(this.resolveLimeType(),this.loadLimeObject()):r.error(`No platform found. Pass "platform" prop or place the component inside a parent that exposes "platform". limetype=${t}, objectid=${i}`)}update(t,i){this.limetype=t,this.objectid=i,this.updateState({limeobject:void 0,limetypeData:void 0,loadFailed:!1}),this.hasPendingLoad||(this.hasPendingLoad=!0,queueMicrotask((()=>{if(this.hasPendingLoad=!1,!this.isDisconnected){if(!this._platform)return this.updateState({loadFailed:!0}),void r.warn(`Cannot update: no platform available. limetype=${this.limetype}, objectid=${this.objectid}`);this.resolveLimeType(),this.loadLimeObject()}})))}disconnect(){this.isDisconnected=!0}findPlatform(t){const i=h(t,this.hasPlatformProp);return null==i?void 0:i.platform}hasPlatformProp(t){return"platform"in t&&!!t.platform&&"object"==typeof t.platform}resolveLimeType(){const t=this._platform.get(a.LimeTypeRepository);this.updateState({limetypeData:t.getLimeType(this.limetype)})}async loadLimeObject(){const t=this.limetype,i=this.objectid,s=this._platform.get(a.LimeObjectRepository),e=s.getObject(t,i);if(e)this.updateState({limeobject:e});else{try{await s.loadObject(t,i)}catch(s){if(this.isStale(t,i))return;return this.updateState({loadFailed:!0}),void r.error(`Failed to load ${t}/${i}`,s)}this.isStale(t,i)||this.updateState({limeobject:s.getObject(t,i)})}}isStale(t,i){return this.isDisconnected||this.limetype!==t||this.objectid!==i}updateState(t){this.state=Object.assign(Object.assign({},this.state),t),this.isDisconnected||this.onStateChange(this.state)}}const n=class{constructor(i){t(this,i),this.size="default",this.data={loadFailed:!1},this.resolver=new l((t=>{this.data=t}))}connectedCallback(){this.resolver.connect(this.limetype,this.objectid,i(this),this.platform)}disconnectedCallback(){this.resolver.disconnect()}handlePropChange(){this.resolver.update(this.limetype,this.objectid)}render(){if(!this.resolver.resolvedPlatform)return;const t=e(this.data.limetypeData);return s("limel-chip",{text:this.getChipText(),icon:t,size:this.size,link:{href:(i=this.limetype,h=this.objectid,`object/${i}/${h}`)},loading:!this.data.limeobject&&!this.data.loadFailed});var i,h}getChipText(){var t;return(null===(t=this.data.limeobject)||void 0===t?void 0:t.descriptive)?this.data.limeobject.descriptive:this.data.loadFailed?this.getErrorText():""}getErrorText(){if(!this.resolver.resolvedPlatform)return"loading failed";try{return this.resolver.resolvedPlatform.get(a.Translate).get("webclient.limeobject.errors.load-failed")}catch(t){return"loading failed"}}static get watchers(){return{limetype:[{handlePropChange:0}],objectid:[{handlePropChange:0}]}}};n.style=":host{display:inline-block;vertical-align:baseline}";export{n as limebb_object_chip}
1
+ import{r as t,g as i,h as s}from"./p-BIwHMk6j.js";import{g as e}from"./p--IuhN2yx.js";import{f as h}from"./p-B95D7tDb.js";import{g as o,n as a}from"./p-B3U_Lxk4.js";const r=o("object-resolver");class l{constructor(t){this.onStateChange=t,this.state={loadFailed:!1},this.hasPendingLoad=!1,this.isDisconnected=!1}get resolvedPlatform(){return this._platform}connect(t,i,s,e){this.limetype=t,this.objectid=i,this.isDisconnected=!1,this.hasPendingLoad=!1,this._platform=e||this.findPlatform(s),this._platform?(this.resolveLimeType(),this.loadLimeObject()):r.error(`No platform found. Pass "platform" prop or place the component inside a parent that exposes "platform". limetype=${t}, objectid=${i}`)}update(t,i){this.limetype=t,this.objectid=i,this.updateState({limeobject:void 0,limetypeData:void 0,loadFailed:!1}),this.hasPendingLoad||(this.hasPendingLoad=!0,queueMicrotask((()=>{if(this.hasPendingLoad=!1,!this.isDisconnected){if(!this._platform)return this.updateState({loadFailed:!0}),void r.warn(`Cannot update: no platform available. limetype=${this.limetype}, objectid=${this.objectid}`);this.resolveLimeType(),this.loadLimeObject()}})))}disconnect(){this.isDisconnected=!0}findPlatform(t){const i=h(t,this.hasPlatformProp);return null==i?void 0:i.platform}hasPlatformProp(t){return"platform"in t&&!!t.platform&&"object"==typeof t.platform}resolveLimeType(){const t=this._platform.get(a.LimeTypeRepository);this.updateState({limetypeData:t.getLimeType(this.limetype)})}async loadLimeObject(){const t=this.limetype,i=this.objectid,s=this._platform.get(a.LimeObjectRepository),e=s.getObject(t,i);if(e)this.updateState({limeobject:e});else{try{await s.loadObject(t,i)}catch(s){if(this.isStale(t,i))return;return this.updateState({loadFailed:!0}),void r.error(`Failed to load ${t}/${i}`,s)}this.isStale(t,i)||this.updateState({limeobject:s.getObject(t,i)})}}isStale(t,i){return this.isDisconnected||this.limetype!==t||this.objectid!==i}updateState(t){this.state=Object.assign(Object.assign({},this.state),t),this.isDisconnected||this.onStateChange(this.state)}}const n=class{constructor(i){t(this,i),this.size="default",this.data={loadFailed:!1},this.resolver=new l((t=>{this.data=t}))}connectedCallback(){this.resolver.connect(this.limetype,this.objectid,i(this),this.platform)}disconnectedCallback(){this.resolver.disconnect()}handlePropChange(){this.resolver.update(this.limetype,this.objectid)}render(){if(!this.resolver.resolvedPlatform)return;const t=e(this.data.limetypeData);return s("limel-chip",{text:this.getChipText(),icon:t,size:this.size,link:{href:(i=this.limetype,h=this.objectid,`object/${i}/${h}`)},loading:!this.data.limeobject&&!this.data.loadFailed});var i,h}getChipText(){var t;return(null===(t=this.data.limeobject)||void 0===t?void 0:t.descriptive)?this.data.limeobject.descriptive:this.data.loadFailed?this.getErrorText():""}getErrorText(){if(!this.resolver.resolvedPlatform)return"loading failed";try{return this.resolver.resolvedPlatform.get(a.Translate).get("webclient.limeobject.errors.load-failed")}catch(t){return"loading failed"}}static get watchers(){return{limetype:[{handlePropChange:0}],objectid:[{handlePropChange:0}]}}};n.style=":host{display:inline-block;vertical-align:baseline}";export{n as limebb_object_chip}
@@ -1 +1 @@
1
- import{r as t,c as i,h as s}from"./p-BIwHMk6j.js";import{j as e,n as o}from"./p-B3U_Lxk4.js";import{g as r,a as n}from"./p-CQUZjrU4.js";import{g as h}from"./p-BoVsXNfL.js";const l=class{constructor(s){t(this,s),this.change=i(this,"change"),this.label="Property",this.required=!1,this.isOpen=!1,this.navigationPath="",this.menuItems=[],this.handleChipSetWrapperClick=t=>{t.stopPropagation()},this.handleChipSetFocus=()=>{this.isOpen||(this.navigationPath=this.value||"",this.loadMenuItems(),this.isOpen=!0)},this.handleSelect=t=>{t.stopPropagation();const i=t.detail.value;if(!i)return;const s=r(this.limetypes,this.limetype,i);(null==s?void 0:s.relation)?this.navigationPath=i:(this.change.emit(i),this.isOpen=!1,this.navigationPath="")},this.handleNavigateMenu=t=>{var i;t.stopPropagation(),(null===(i=t.detail)||void 0===i?void 0:i.value)&&(this.navigationPath=t.detail.value)},this.handleCancel=()=>{this.isOpen=!1,this.navigationPath=""},this.handleChipSetChange=t=>{t.stopPropagation();const i=t.detail;if(!i)return this.change.emit(""),void(this.navigationPath="");const s=Array.isArray(i)?i:[i];if(0===s.length)this.change.emit(""),this.navigationPath="";else{const t=s.at(-1);t&&this.change.emit(t.value),this.navigationPath=""}}}componentWillLoad(){const t=this.platform.get(o.Application).getLanguage();this.collator=new Intl.Collator(t,{numeric:!0,sensitivity:"base"})}render(){if(!this.limetype||!this.limetypes)return null;const t=this.getChipsForPath(this.navigationPath||this.value||"");return s("limel-menu",{items:this.menuItems,open:this.isOpen,emptyResultMessage:"No available properties",surfaceWidth:"inherit-from-trigger",openDirection:"bottom-end",onSelect:this.handleSelect,onNavigateMenu:this.handleNavigateMenu,onCancel:this.handleCancel},s("div",{slot:"trigger"},s("div",{onClick:this.handleChipSetWrapperClick},s("limel-chip-set",{type:"input",label:this.label,value:t,required:this.required,helperText:this.helperText,delimiter:"›",maxItems:1,onChange:this.handleChipSetChange,onFocus:this.handleChipSetFocus}))))}loadMenuItems(){const t=this.getCurrentLimetype();this.menuItems=t?this.createMenuItems(t,""):[]}getCurrentLimetype(){if(!this.navigationPath)return this.limetypes[this.limetype];const t=r(this.limetypes,this.limetype,this.navigationPath);return(null==t?void 0:t.relation)?t.relation.getLimetype():this.limetypes[this.limetype]}createMenuItems(t,i){const s=[];if(!t)return s;const e=n(t);for(const[t,o]of Object.entries(e)){if("hasmany"===o.type||"hasandbelongstomany"===o.type)continue;const e=i?`${i}.${t}`:t;let r;if(o.relation&&o.relation){const t=o.relation.getLimetype();t&&(r=async()=>this.createMenuItems(t,e))}s.push({text:o.localname||t,secondaryText:this.getSecondaryText(o),icon:this.getIconForProperty(o),value:e,items:r})}return s.sort(((t,i)=>{var s,e;return this.collator.compare(null!==(s=t.text)&&void 0!==s?s:"",null!==(e=i.text)&&void 0!==e?e:"")})),0===s.length?[{text:"No available properties",value:"",disabled:!0}]:s}getSecondaryText(t){var i;if(t.relation){const s=t.relation.getLimetype();return(null===(i=null==s?void 0:s.localname)||void 0===i?void 0:i.singular)||"Object"}return t.type.charAt(0).toUpperCase()+t.type.slice(1)}getIconForProperty(t){return t.relation?h(t.relation.getLimetype()):{name:"dot_circle",color:"rgb(var(--color-gray-default))"}}getChipsForPath(t){if(!t)return[];const i=t.split("."),s=[];let e=this.limetypes[this.limetype],o="";for(const t of i){o=o?`${o}.${t}`:t;const i=n(e)[t];i&&(s.push({id:o,text:i.localname||t,icon:this.getIconForProperty(i),value:o}),i.relation&&(e=i.relation.getLimetype()))}return s}};(function(t,i,s,e){var o,r=arguments.length,n=r<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,i,s,e);else for(var h=t.length-1;h>=0;h--)(o=t[h])&&(n=(r<3?o(n):r>3?o(i,s,n):o(i,s))||n);r>3&&n&&Object.defineProperty(i,s,n)})([e()],l.prototype,"limetypes",void 0),l.style=":host(limebb-property-selector){display:block}limel-menu{display:block;width:100%}";export{l as limebb_property_selector}
1
+ import{r as t,c as i,h as s}from"./p-BIwHMk6j.js";import{j as e,n as o}from"./p-B3U_Lxk4.js";import{g as r,a as n}from"./p-CQUZjrU4.js";import{g as h}from"./p--IuhN2yx.js";const l=class{constructor(s){t(this,s),this.change=i(this,"change"),this.label="Property",this.required=!1,this.isOpen=!1,this.navigationPath="",this.menuItems=[],this.handleChipSetWrapperClick=t=>{t.stopPropagation()},this.handleChipSetFocus=()=>{this.isOpen||(this.navigationPath=this.value||"",this.loadMenuItems(),this.isOpen=!0)},this.handleSelect=t=>{t.stopPropagation();const i=t.detail.value;if(!i)return;const s=r(this.limetypes,this.limetype,i);(null==s?void 0:s.relation)?this.navigationPath=i:(this.change.emit(i),this.isOpen=!1,this.navigationPath="")},this.handleNavigateMenu=t=>{var i;t.stopPropagation(),(null===(i=t.detail)||void 0===i?void 0:i.value)&&(this.navigationPath=t.detail.value)},this.handleCancel=()=>{this.isOpen=!1,this.navigationPath=""},this.handleChipSetChange=t=>{t.stopPropagation();const i=t.detail;if(!i)return this.change.emit(""),void(this.navigationPath="");const s=Array.isArray(i)?i:[i];if(0===s.length)this.change.emit(""),this.navigationPath="";else{const t=s.at(-1);t&&this.change.emit(t.value),this.navigationPath=""}}}componentWillLoad(){const t=this.platform.get(o.Application).getLanguage();this.collator=new Intl.Collator(t,{numeric:!0,sensitivity:"base"})}render(){if(!this.limetype||!this.limetypes)return null;const t=this.getChipsForPath(this.navigationPath||this.value||"");return s("limel-menu",{items:this.menuItems,open:this.isOpen,emptyResultMessage:"No available properties",surfaceWidth:"inherit-from-trigger",openDirection:"bottom-end",onSelect:this.handleSelect,onNavigateMenu:this.handleNavigateMenu,onCancel:this.handleCancel},s("div",{slot:"trigger"},s("div",{onClick:this.handleChipSetWrapperClick},s("limel-chip-set",{type:"input",label:this.label,value:t,required:this.required,helperText:this.helperText,delimiter:"›",maxItems:1,onChange:this.handleChipSetChange,onFocus:this.handleChipSetFocus}))))}loadMenuItems(){const t=this.getCurrentLimetype();this.menuItems=t?this.createMenuItems(t,""):[]}getCurrentLimetype(){if(!this.navigationPath)return this.limetypes[this.limetype];const t=r(this.limetypes,this.limetype,this.navigationPath);return(null==t?void 0:t.relation)?t.relation.getLimetype():this.limetypes[this.limetype]}createMenuItems(t,i){const s=[];if(!t)return s;const e=n(t);for(const[t,o]of Object.entries(e)){if("hasmany"===o.type||"hasandbelongstomany"===o.type)continue;const e=i?`${i}.${t}`:t;let r;if(o.relation&&o.relation){const t=o.relation.getLimetype();t&&(r=async()=>this.createMenuItems(t,e))}s.push({text:o.localname||t,secondaryText:this.getSecondaryText(o),icon:this.getIconForProperty(o),value:e,items:r})}return s.sort(((t,i)=>{var s,e;return this.collator.compare(null!==(s=t.text)&&void 0!==s?s:"",null!==(e=i.text)&&void 0!==e?e:"")})),0===s.length?[{text:"No available properties",value:"",disabled:!0}]:s}getSecondaryText(t){var i;if(t.relation){const s=t.relation.getLimetype();return(null===(i=null==s?void 0:s.localname)||void 0===i?void 0:i.singular)||"Object"}return t.type.charAt(0).toUpperCase()+t.type.slice(1)}getIconForProperty(t){return t.relation?h(t.relation.getLimetype()):{name:"dot_circle",color:"rgb(var(--color-gray-default))"}}getChipsForPath(t){if(!t)return[];const i=t.split("."),s=[];let e=this.limetypes[this.limetype],o="";for(const t of i){o=o?`${o}.${t}`:t;const i=n(e)[t];i&&(s.push({id:o,text:i.localname||t,icon:this.getIconForProperty(i),value:o}),i.relation&&(e=i.relation.getLimetype()))}return s}};(function(t,i,s,e){var o,r=arguments.length,n=r<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,i,s,e);else for(var h=t.length-1;h>=0;h--)(o=t[h])&&(n=(r<3?o(n):r>3?o(i,s,n):o(i,s))||n);r>3&&n&&Object.defineProperty(i,s,n)})([e()],l.prototype,"limetypes",void 0),l.style=":host(limebb-property-selector){display:block}limel-menu{display:block;width:100%}";export{l as limebb_property_selector}