@limetech/lime-crm-building-blocks 1.96.0 → 1.97.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/cjs/{_MapCache-2e84a981.js → _MapCache-8b125fbb.js} +0 -26
- package/dist/cjs/{_Uint8Array-1e99726d.js → _Uint8Array-95263550.js} +1 -12
- package/dist/cjs/_baseIsEqual-cb7951b0.js +496 -0
- package/dist/cjs/_defineProperty-40a6ad5d.js +15 -0
- package/dist/cjs/{get-1acf79ce.js → get-932b213e.js} +5 -4
- package/dist/cjs/isEqual-e77cce75.js +37 -0
- package/dist/cjs/isSymbol-5b36aeee.js +30 -0
- package/dist/cjs/lime-crm-building-blocks.cjs.js +1 -1
- package/dist/cjs/lime-query.types-bcb63a22.js +61 -0
- package/dist/cjs/limebb-component-config.cjs.entry.js +3 -2
- package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +382 -150
- package/dist/cjs/limebb-lime-query-filter-and_5.cjs.entry.js +278 -0
- package/dist/cjs/limebb-lime-query-value-input.cjs.entry.js +239 -0
- package/dist/cjs/limebb-limetype-field_2.cjs.entry.js +406 -0
- package/dist/cjs/limebb-live-docs-info.cjs.entry.js +2 -2
- package/dist/cjs/limebb-locale-picker.cjs.entry.js +13 -498
- package/dist/cjs/limebb-mention-group-counter.cjs.entry.js +2 -2
- package/dist/cjs/limebb-navigation-button_2.cjs.entry.js +3 -3
- package/dist/cjs/limebb-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-percentage-visualizer.cjs.entry.js +2 -2
- package/dist/cjs/limebb-property-selector.cjs.entry.js +234 -0
- package/dist/cjs/limebb-response-format-item.cjs.entry.js +80 -0
- package/dist/cjs/limebb-text-editor.cjs.entry.js +20 -61
- package/dist/cjs/limebb-trend-indicator.cjs.entry.js +1 -1
- package/dist/cjs/limetype-1fe0207f.js +90 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/property-resolution-fb42a46b.js +66 -0
- package/dist/collection/collection-manifest.json +10 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-and.css +121 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-and.js +257 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-comparison.css +39 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-comparison.js +246 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-expression.css +104 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-expression.js +220 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-not.css +107 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-not.js +212 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-or.css +123 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-or.js +237 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-value-input.css +48 -0
- package/dist/collection/components/lime-query-builder/expressions/lime-query-value-input.js +457 -0
- package/dist/collection/components/lime-query-builder/filter-conversion.js +118 -21
- package/dist/collection/components/lime-query-builder/lime-query-builder.css +30 -17
- package/dist/collection/components/lime-query-builder/lime-query-builder.js +233 -28
- package/dist/collection/components/lime-query-builder/limetype-field/limetype-field.js +435 -0
- package/dist/collection/components/lime-query-builder/property-selection-format.js +158 -0
- package/dist/collection/components/lime-query-builder/property-selector/property-selector.css +8 -0
- package/dist/collection/components/lime-query-builder/property-selector/property-selector.js +422 -0
- package/dist/collection/components/lime-query-builder/response-format-editor.css +72 -0
- package/dist/collection/components/lime-query-builder/response-format-editor.js +249 -0
- package/dist/collection/components/lime-query-builder/response-format-item.css +61 -0
- package/dist/collection/components/lime-query-builder/response-format-item.js +208 -0
- package/dist/collection/components/limeobject/file-viewer/live-docs-info.js +2 -2
- package/dist/collection/components/locale-picker/locale-picker.js +1 -1
- package/dist/collection/components/notification-list/notification-item/notification-item.js +1 -1
- package/dist/collection/components/percentage-visualizer/percentage-visualizer.js +2 -2
- package/dist/collection/components/summary-popover/summary-popover.js +3 -3
- package/dist/collection/components/text-editor/mention-group-counter.js +2 -2
- package/dist/collection/components/text-editor/text-editor.js +1 -1
- package/dist/collection/components/trend-indicator/trend-indicator.js +1 -1
- package/dist/components/_MapCache.js +2 -27
- package/dist/components/_Uint8Array.js +2 -12
- package/dist/components/_baseIsEqual.js +494 -0
- package/dist/components/_defineProperty.js +13 -0
- package/dist/components/get.js +2 -1
- package/dist/components/isEqual.js +35 -0
- package/dist/components/isSymbol.js +28 -0
- package/dist/components/lime-query-filter-and.js +408 -0
- package/dist/components/lime-query-filter-comparison.js +152 -0
- package/dist/components/lime-query-value-input.js +266 -0
- package/dist/components/limebb-lime-query-builder.js +441 -149
- package/dist/components/limebb-lime-query-filter-and.d.ts +11 -0
- package/dist/components/limebb-lime-query-filter-and.js +6 -0
- package/dist/components/limebb-lime-query-filter-comparison.d.ts +11 -0
- package/dist/components/limebb-lime-query-filter-comparison.js +6 -0
- package/dist/components/limebb-lime-query-filter-expression.d.ts +11 -0
- package/dist/components/limebb-lime-query-filter-expression.js +6 -0
- package/dist/components/limebb-lime-query-filter-not.d.ts +11 -0
- package/dist/components/limebb-lime-query-filter-not.js +6 -0
- package/dist/components/limebb-lime-query-filter-or.d.ts +11 -0
- package/dist/components/limebb-lime-query-filter-or.js +6 -0
- package/dist/components/limebb-lime-query-value-input.d.ts +11 -0
- package/dist/components/limebb-lime-query-value-input.js +6 -0
- package/dist/components/limebb-limetype-field.d.ts +11 -0
- package/dist/components/limebb-limetype-field.js +6 -0
- package/dist/components/limebb-locale-picker.js +8 -493
- package/dist/components/limebb-mention-group-counter.js +2 -2
- package/dist/components/limebb-percentage-visualizer.js +2 -2
- package/dist/components/limebb-property-selector.d.ts +11 -0
- package/dist/components/limebb-property-selector.js +6 -0
- package/dist/components/limebb-response-format-editor.d.ts +11 -0
- package/dist/components/limebb-response-format-editor.js +6 -0
- package/dist/components/limebb-response-format-item.d.ts +11 -0
- package/dist/components/limebb-response-format-item.js +6 -0
- package/dist/components/limebb-text-editor.js +7 -48
- package/dist/components/limebb-trend-indicator.js +1 -1
- package/dist/components/limetype-field.js +184 -0
- package/dist/components/limetype.js +85 -0
- package/dist/components/live-docs-info.js +2 -2
- package/dist/components/notification-item.js +1 -1
- package/dist/components/property-selector.js +317 -0
- package/dist/components/response-format-editor.js +278 -0
- package/dist/components/response-format-item.js +104 -0
- package/dist/components/summary-popover.js +3 -3
- package/dist/esm/{_MapCache-6484495d.js → _MapCache-af496e9d.js} +2 -27
- package/dist/esm/{_Uint8Array-e5cac922.js → _Uint8Array-d6ebd526.js} +3 -13
- package/dist/esm/_baseIsEqual-28053b81.js +494 -0
- package/dist/esm/_defineProperty-e6a185c3.js +13 -0
- package/dist/esm/{get-f9e0b2e1.js → get-3e42932b.js} +2 -1
- package/dist/esm/isEqual-57d0c223.js +35 -0
- package/dist/esm/isSymbol-1c5f65cc.js +28 -0
- package/dist/esm/lime-crm-building-blocks.js +1 -1
- package/dist/esm/lime-query.types-f72355e1.js +59 -0
- package/dist/esm/limebb-component-config.entry.js +3 -2
- package/dist/esm/limebb-lime-query-builder.entry.js +379 -147
- package/dist/esm/limebb-lime-query-filter-and_5.entry.js +270 -0
- package/dist/esm/limebb-lime-query-value-input.entry.js +235 -0
- package/dist/esm/limebb-limetype-field_2.entry.js +401 -0
- package/dist/esm/limebb-live-docs-info.entry.js +2 -2
- package/dist/esm/limebb-locale-picker.entry.js +9 -494
- package/dist/esm/limebb-mention-group-counter.entry.js +2 -2
- package/dist/esm/limebb-navigation-button_2.entry.js +3 -3
- package/dist/esm/limebb-notification-item.entry.js +1 -1
- package/dist/esm/limebb-percentage-visualizer.entry.js +2 -2
- package/dist/esm/limebb-property-selector.entry.js +230 -0
- package/dist/esm/limebb-response-format-item.entry.js +76 -0
- package/dist/esm/limebb-text-editor.entry.js +7 -48
- package/dist/esm/limebb-trend-indicator.entry.js +1 -1
- package/dist/esm/limetype-6e7552a7.js +85 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/property-resolution-fde2375e.js +63 -0
- package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/{p-88c64360.entry.js → p-00da9b24.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-02c0cc04.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-123190c3.js +1 -0
- package/dist/lime-crm-building-blocks/p-244ee55b.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-35897ec3.js +1 -0
- package/dist/lime-crm-building-blocks/{p-85b7291c.entry.js → p-3932077b.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-3b0a15ec.js +1 -0
- package/dist/lime-crm-building-blocks/p-5a6d2e7f.js +1 -0
- package/dist/lime-crm-building-blocks/p-60971d64.js +1 -0
- package/dist/lime-crm-building-blocks/p-6c1146ca.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-70a28b93.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-7e6fb4af.js +1 -0
- package/dist/lime-crm-building-blocks/{p-8664381a.entry.js → p-8c4eb49f.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-96beaabc.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-a659d55a.js +1 -0
- package/dist/lime-crm-building-blocks/p-b7c72179.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-baf4e428.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-d298b34e.js +1 -0
- package/dist/lime-crm-building-blocks/{p-7c4bdc1b.entry.js → p-d89c44ad.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-e0ab1554.js +1 -0
- package/dist/lime-crm-building-blocks/{p-8064cbfb.entry.js → p-e9d23ef7.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-ef8a5266.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-c9126885.entry.js → p-f52125a0.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-f99c611d.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-fe2b91d9.js +1 -0
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-and.d.ts +56 -0
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-comparison.d.ts +64 -0
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-expression.d.ts +53 -0
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-not.d.ts +54 -0
- package/dist/types/components/lime-query-builder/expressions/lime-query-filter-or.d.ts +55 -0
- package/dist/types/components/lime-query-builder/expressions/lime-query-value-input.d.ts +92 -0
- package/dist/types/components/lime-query-builder/filter-conversion.d.ts +18 -0
- package/dist/types/components/lime-query-builder/lime-query-builder.d.ts +30 -8
- package/dist/types/components/lime-query-builder/limetype-field/limetype-field.d.ts +96 -0
- package/dist/types/components/lime-query-builder/property-selection-format.d.ts +23 -0
- package/dist/types/components/lime-query-builder/property-selector/property-selector.d.ts +71 -0
- package/dist/types/components/lime-query-builder/response-format-editor.d.ts +57 -0
- package/dist/types/components/lime-query-builder/response-format-item.d.ts +46 -0
- package/dist/types/components.d.ts +1558 -117
- package/package.json +1 -1
- package/dist/lime-crm-building-blocks/p-00e7e0d4.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-11ac105b.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-5abe3fff.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-8044ffbd.js +0 -1
- package/dist/lime-crm-building-blocks/p-92ec9205.entry.js +0 -1
- package/dist/lime-crm-building-blocks/p-bcc23575.js +0 -1
- package/dist/lime-crm-building-blocks/p-c40a3f4b.js +0 -1
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
4
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else
|
|
6
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
7
|
+
if (d = decorators[i])
|
|
8
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10
|
+
};
|
|
11
|
+
import { h } from "@stencil/core";
|
|
12
|
+
import { SelectLimeTypes as Limetypes, } from "@limetech/lime-web-components";
|
|
13
|
+
import { getPropertyFromPath, getNormalizedProperties, } from "../property-resolution";
|
|
14
|
+
/**
|
|
15
|
+
* Property Selector Component
|
|
16
|
+
*
|
|
17
|
+
* A menu-based property selector that allows users to navigate through properties
|
|
18
|
+
* and relations, only emitting complete property paths (not intermediate relations).
|
|
19
|
+
*
|
|
20
|
+
* Similar to limec-context-expression but specifically for selecting properties
|
|
21
|
+
* with dot-notation paths.
|
|
22
|
+
*
|
|
23
|
+
* Features:
|
|
24
|
+
* - Menu-based navigation through properties
|
|
25
|
+
* - Submenu support for drilling into relations
|
|
26
|
+
* - Internal state management during navigation
|
|
27
|
+
* - Only emits complete paths (leaf properties)
|
|
28
|
+
* - Chip-set display showing current path
|
|
29
|
+
* @private
|
|
30
|
+
*/
|
|
31
|
+
export class PropertySelector {
|
|
32
|
+
constructor() {
|
|
33
|
+
/**
|
|
34
|
+
* Label for the input
|
|
35
|
+
*/
|
|
36
|
+
this.label = 'Property';
|
|
37
|
+
/**
|
|
38
|
+
* Whether the field is required
|
|
39
|
+
*/
|
|
40
|
+
this.required = false;
|
|
41
|
+
this.isOpen = false;
|
|
42
|
+
this.navigationPath = '';
|
|
43
|
+
this.menuItems = [];
|
|
44
|
+
this.handleChipSetWrapperClick = (event) => {
|
|
45
|
+
// Stop all clicks on the chip-set from bubbling
|
|
46
|
+
// This prevents the menu from opening when clicking chip remove buttons
|
|
47
|
+
event.stopPropagation();
|
|
48
|
+
};
|
|
49
|
+
this.handleChipSetFocus = () => {
|
|
50
|
+
// Open menu when the chip-set input receives focus
|
|
51
|
+
// This happens when user clicks to type/edit
|
|
52
|
+
if (!this.isOpen) {
|
|
53
|
+
this.navigationPath = this.value || '';
|
|
54
|
+
this.loadMenuItems();
|
|
55
|
+
this.isOpen = true;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
this.handleSelect = (event) => {
|
|
59
|
+
event.stopPropagation();
|
|
60
|
+
const selectedPath = event.detail.value;
|
|
61
|
+
if (!selectedPath) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
// Check if this is a complete path (leaf property, not a relation)
|
|
65
|
+
const property = getPropertyFromPath(this.limetypes, this.limetype, selectedPath);
|
|
66
|
+
if (property === null || property === void 0 ? void 0 : property.relation) {
|
|
67
|
+
// This is a relation - update navigation but don't emit
|
|
68
|
+
this.navigationPath = selectedPath;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
// This is a leaf property - emit and close
|
|
72
|
+
this.change.emit(selectedPath);
|
|
73
|
+
this.isOpen = false;
|
|
74
|
+
this.navigationPath = '';
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
this.handleNavigateMenu = (event) => {
|
|
78
|
+
var _a;
|
|
79
|
+
event.stopPropagation();
|
|
80
|
+
if ((_a = event.detail) === null || _a === void 0 ? void 0 : _a.value) {
|
|
81
|
+
// Update navigation path when drilling down
|
|
82
|
+
this.navigationPath = event.detail.value;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
this.handleCancel = () => {
|
|
86
|
+
this.isOpen = false;
|
|
87
|
+
this.navigationPath = '';
|
|
88
|
+
};
|
|
89
|
+
this.handleChipSetChange = (event) => {
|
|
90
|
+
event.stopPropagation();
|
|
91
|
+
const detail = event.detail;
|
|
92
|
+
// Handle both single chip and array of chips
|
|
93
|
+
if (!detail) {
|
|
94
|
+
// Clear all was clicked
|
|
95
|
+
this.change.emit('');
|
|
96
|
+
this.navigationPath = '';
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
// Convert to array if it's a single chip
|
|
100
|
+
const chips = Array.isArray(detail) ? detail : [detail];
|
|
101
|
+
if (chips.length === 0) {
|
|
102
|
+
// All chips removed
|
|
103
|
+
this.change.emit('');
|
|
104
|
+
this.navigationPath = '';
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
// A chip was removed - emit the last remaining chip's value
|
|
108
|
+
const lastChip = chips.at(-1);
|
|
109
|
+
if (lastChip) {
|
|
110
|
+
this.change.emit(lastChip.value);
|
|
111
|
+
}
|
|
112
|
+
this.navigationPath = '';
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
render() {
|
|
117
|
+
if (!this.limetype || !this.limetypes) {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
const chips = this.getChipsForPath(this.navigationPath || this.value || '');
|
|
121
|
+
return (h("limel-menu", { items: this.menuItems, open: this.isOpen, emptyResultMessage: "No available properties", surfaceWidth: "inherit-from-trigger", openDirection: "bottom-end", onSelect: this.handleSelect, onNavigateMenu: this.handleNavigateMenu, onCancel: this.handleCancel }, h("div", { slot: "trigger" }, h("div", { onClick: this.handleChipSetWrapperClick }, h("limel-chip-set", { type: "input", label: this.label, value: chips, required: this.required, helperText: this.helperText, delimiter: "\u203A", maxItems: 1, onChange: this.handleChipSetChange, onFocus: this.handleChipSetFocus })))));
|
|
122
|
+
}
|
|
123
|
+
loadMenuItems() {
|
|
124
|
+
// Get the limetype we're currently navigating in
|
|
125
|
+
const currentLimetype = this.getCurrentLimetype();
|
|
126
|
+
if (!currentLimetype) {
|
|
127
|
+
this.menuItems = [];
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
this.menuItems = this.createMenuItems(currentLimetype, '');
|
|
131
|
+
}
|
|
132
|
+
getCurrentLimetype() {
|
|
133
|
+
if (!this.navigationPath) {
|
|
134
|
+
return this.limetypes[this.limetype];
|
|
135
|
+
}
|
|
136
|
+
// Get the limetype at the current navigation path
|
|
137
|
+
const property = getPropertyFromPath(this.limetypes, this.limetype, this.navigationPath);
|
|
138
|
+
if (property === null || property === void 0 ? void 0 : property.relation) {
|
|
139
|
+
return property.relation.getLimetype();
|
|
140
|
+
}
|
|
141
|
+
return this.limetypes[this.limetype];
|
|
142
|
+
}
|
|
143
|
+
createMenuItems(limetype, pathPrefix) {
|
|
144
|
+
const results = [];
|
|
145
|
+
if (!limetype) {
|
|
146
|
+
return results;
|
|
147
|
+
}
|
|
148
|
+
const normalizedProperties = getNormalizedProperties(limetype);
|
|
149
|
+
for (const [propName, property] of Object.entries(normalizedProperties)) {
|
|
150
|
+
// Skip hasMany and hasAndBelongsToMany relations
|
|
151
|
+
if (property.type === 'hasmany' ||
|
|
152
|
+
property.type === 'hasandbelongstomany') {
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
const fullPath = pathPrefix
|
|
156
|
+
? `${pathPrefix}.${propName}`
|
|
157
|
+
: propName;
|
|
158
|
+
const isRelation = !!property.relation;
|
|
159
|
+
let items;
|
|
160
|
+
if (isRelation && property.relation) {
|
|
161
|
+
// Create submenu for relation (only belongsto at this point)
|
|
162
|
+
const relatedLimetype = property.relation.getLimetype();
|
|
163
|
+
if (relatedLimetype) {
|
|
164
|
+
items = async () => this.createMenuItems(relatedLimetype, fullPath);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
results.push({
|
|
168
|
+
text: property.localname || propName,
|
|
169
|
+
secondaryText: this.getSecondaryText(property),
|
|
170
|
+
icon: this.getIconForProperty(property),
|
|
171
|
+
value: fullPath,
|
|
172
|
+
items: items,
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
if (results.length === 0) {
|
|
176
|
+
return [
|
|
177
|
+
{
|
|
178
|
+
text: 'No available properties',
|
|
179
|
+
value: '',
|
|
180
|
+
disabled: true,
|
|
181
|
+
},
|
|
182
|
+
];
|
|
183
|
+
}
|
|
184
|
+
return results;
|
|
185
|
+
}
|
|
186
|
+
getSecondaryText(property) {
|
|
187
|
+
var _a;
|
|
188
|
+
if (property.relation) {
|
|
189
|
+
const relatedLimetype = property.relation.getLimetype();
|
|
190
|
+
return ((_a = relatedLimetype === null || relatedLimetype === void 0 ? void 0 : relatedLimetype.localname) === null || _a === void 0 ? void 0 : _a.singular) || 'Object';
|
|
191
|
+
}
|
|
192
|
+
// Return the property type as the secondary text
|
|
193
|
+
return property.type.charAt(0).toUpperCase() + property.type.slice(1);
|
|
194
|
+
}
|
|
195
|
+
getIconForProperty(property) {
|
|
196
|
+
if (property.relation) {
|
|
197
|
+
return {
|
|
198
|
+
name: 'link',
|
|
199
|
+
color: 'rgb(var(--color-sky-default))',
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
// Use generic property icon
|
|
203
|
+
return {
|
|
204
|
+
name: 'decision',
|
|
205
|
+
color: 'rgb(var(--color-gray-default))',
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
getChipsForPath(path) {
|
|
209
|
+
if (!path) {
|
|
210
|
+
return [];
|
|
211
|
+
}
|
|
212
|
+
const parts = path.split('.');
|
|
213
|
+
const chips = [];
|
|
214
|
+
let currentLimetype = this.limetypes[this.limetype];
|
|
215
|
+
let currentPath = '';
|
|
216
|
+
for (const part of parts) {
|
|
217
|
+
currentPath = currentPath ? `${currentPath}.${part}` : part;
|
|
218
|
+
// Use getNormalizedProperties to include _id and _timestamp
|
|
219
|
+
const normalizedProperties = getNormalizedProperties(currentLimetype);
|
|
220
|
+
const property = normalizedProperties[part];
|
|
221
|
+
if (property) {
|
|
222
|
+
chips.push({
|
|
223
|
+
id: currentPath,
|
|
224
|
+
text: property.localname || part,
|
|
225
|
+
icon: this.getIconForProperty(property),
|
|
226
|
+
value: currentPath,
|
|
227
|
+
});
|
|
228
|
+
if (property.relation) {
|
|
229
|
+
currentLimetype = property.relation.getLimetype();
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
return chips;
|
|
234
|
+
}
|
|
235
|
+
static get is() { return "limebb-property-selector"; }
|
|
236
|
+
static get encapsulation() { return "shadow"; }
|
|
237
|
+
static get originalStyleUrls() {
|
|
238
|
+
return {
|
|
239
|
+
"$": ["property-selector.scss"]
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
static get styleUrls() {
|
|
243
|
+
return {
|
|
244
|
+
"$": ["property-selector.css"]
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
static get properties() {
|
|
248
|
+
return {
|
|
249
|
+
"platform": {
|
|
250
|
+
"type": "unknown",
|
|
251
|
+
"mutable": false,
|
|
252
|
+
"complexType": {
|
|
253
|
+
"original": "LimeWebComponentPlatform",
|
|
254
|
+
"resolved": "LimeWebComponentPlatform",
|
|
255
|
+
"references": {
|
|
256
|
+
"LimeWebComponentPlatform": {
|
|
257
|
+
"location": "import",
|
|
258
|
+
"path": "@limetech/lime-web-components",
|
|
259
|
+
"id": "node_modules::LimeWebComponentPlatform"
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
"required": false,
|
|
264
|
+
"optional": false,
|
|
265
|
+
"docs": {
|
|
266
|
+
"tags": [],
|
|
267
|
+
"text": "Platform service provider"
|
|
268
|
+
},
|
|
269
|
+
"getter": false,
|
|
270
|
+
"setter": false
|
|
271
|
+
},
|
|
272
|
+
"context": {
|
|
273
|
+
"type": "unknown",
|
|
274
|
+
"mutable": false,
|
|
275
|
+
"complexType": {
|
|
276
|
+
"original": "LimeWebComponentContext",
|
|
277
|
+
"resolved": "LimeWebComponentContext",
|
|
278
|
+
"references": {
|
|
279
|
+
"LimeWebComponentContext": {
|
|
280
|
+
"location": "import",
|
|
281
|
+
"path": "@limetech/lime-web-components",
|
|
282
|
+
"id": "node_modules::LimeWebComponentContext"
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
"required": false,
|
|
287
|
+
"optional": false,
|
|
288
|
+
"docs": {
|
|
289
|
+
"tags": [],
|
|
290
|
+
"text": "Component context"
|
|
291
|
+
},
|
|
292
|
+
"getter": false,
|
|
293
|
+
"setter": false
|
|
294
|
+
},
|
|
295
|
+
"limetype": {
|
|
296
|
+
"type": "string",
|
|
297
|
+
"mutable": false,
|
|
298
|
+
"complexType": {
|
|
299
|
+
"original": "string",
|
|
300
|
+
"resolved": "string",
|
|
301
|
+
"references": {}
|
|
302
|
+
},
|
|
303
|
+
"required": false,
|
|
304
|
+
"optional": false,
|
|
305
|
+
"docs": {
|
|
306
|
+
"tags": [],
|
|
307
|
+
"text": "The limetype to select properties from"
|
|
308
|
+
},
|
|
309
|
+
"getter": false,
|
|
310
|
+
"setter": false,
|
|
311
|
+
"attribute": "limetype",
|
|
312
|
+
"reflect": false
|
|
313
|
+
},
|
|
314
|
+
"value": {
|
|
315
|
+
"type": "string",
|
|
316
|
+
"mutable": false,
|
|
317
|
+
"complexType": {
|
|
318
|
+
"original": "string",
|
|
319
|
+
"resolved": "string",
|
|
320
|
+
"references": {}
|
|
321
|
+
},
|
|
322
|
+
"required": false,
|
|
323
|
+
"optional": false,
|
|
324
|
+
"docs": {
|
|
325
|
+
"tags": [],
|
|
326
|
+
"text": "Current complete property path value"
|
|
327
|
+
},
|
|
328
|
+
"getter": false,
|
|
329
|
+
"setter": false,
|
|
330
|
+
"attribute": "value",
|
|
331
|
+
"reflect": false
|
|
332
|
+
},
|
|
333
|
+
"label": {
|
|
334
|
+
"type": "string",
|
|
335
|
+
"mutable": false,
|
|
336
|
+
"complexType": {
|
|
337
|
+
"original": "string",
|
|
338
|
+
"resolved": "string",
|
|
339
|
+
"references": {}
|
|
340
|
+
},
|
|
341
|
+
"required": false,
|
|
342
|
+
"optional": false,
|
|
343
|
+
"docs": {
|
|
344
|
+
"tags": [],
|
|
345
|
+
"text": "Label for the input"
|
|
346
|
+
},
|
|
347
|
+
"getter": false,
|
|
348
|
+
"setter": false,
|
|
349
|
+
"attribute": "label",
|
|
350
|
+
"reflect": false,
|
|
351
|
+
"defaultValue": "'Property'"
|
|
352
|
+
},
|
|
353
|
+
"required": {
|
|
354
|
+
"type": "boolean",
|
|
355
|
+
"mutable": false,
|
|
356
|
+
"complexType": {
|
|
357
|
+
"original": "boolean",
|
|
358
|
+
"resolved": "boolean",
|
|
359
|
+
"references": {}
|
|
360
|
+
},
|
|
361
|
+
"required": false,
|
|
362
|
+
"optional": false,
|
|
363
|
+
"docs": {
|
|
364
|
+
"tags": [],
|
|
365
|
+
"text": "Whether the field is required"
|
|
366
|
+
},
|
|
367
|
+
"getter": false,
|
|
368
|
+
"setter": false,
|
|
369
|
+
"attribute": "required",
|
|
370
|
+
"reflect": false,
|
|
371
|
+
"defaultValue": "false"
|
|
372
|
+
},
|
|
373
|
+
"helperText": {
|
|
374
|
+
"type": "string",
|
|
375
|
+
"mutable": false,
|
|
376
|
+
"complexType": {
|
|
377
|
+
"original": "string",
|
|
378
|
+
"resolved": "string",
|
|
379
|
+
"references": {}
|
|
380
|
+
},
|
|
381
|
+
"required": false,
|
|
382
|
+
"optional": false,
|
|
383
|
+
"docs": {
|
|
384
|
+
"tags": [],
|
|
385
|
+
"text": "Helper text to display"
|
|
386
|
+
},
|
|
387
|
+
"getter": false,
|
|
388
|
+
"setter": false,
|
|
389
|
+
"attribute": "helper-text",
|
|
390
|
+
"reflect": false
|
|
391
|
+
}
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
static get states() {
|
|
395
|
+
return {
|
|
396
|
+
"limetypes": {},
|
|
397
|
+
"isOpen": {},
|
|
398
|
+
"navigationPath": {}
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
static get events() {
|
|
402
|
+
return [{
|
|
403
|
+
"method": "change",
|
|
404
|
+
"name": "change",
|
|
405
|
+
"bubbles": true,
|
|
406
|
+
"cancelable": true,
|
|
407
|
+
"composed": true,
|
|
408
|
+
"docs": {
|
|
409
|
+
"tags": [],
|
|
410
|
+
"text": "Emitted when a complete property path is selected"
|
|
411
|
+
},
|
|
412
|
+
"complexType": {
|
|
413
|
+
"original": "string",
|
|
414
|
+
"resolved": "string",
|
|
415
|
+
"references": {}
|
|
416
|
+
}
|
|
417
|
+
}];
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
__decorate([
|
|
421
|
+
Limetypes()
|
|
422
|
+
], PropertySelector.prototype, "limetypes", void 0);
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
:host(limebb-response-format-editor) {
|
|
2
|
+
display: block;
|
|
3
|
+
width: 100%;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.response-format-editor {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: 1rem;
|
|
10
|
+
padding: 1rem;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.header {
|
|
14
|
+
display: flex;
|
|
15
|
+
justify-content: space-between;
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: 1rem;
|
|
18
|
+
}
|
|
19
|
+
.header h4 {
|
|
20
|
+
margin: 0;
|
|
21
|
+
font-size: 1rem;
|
|
22
|
+
font-weight: 600;
|
|
23
|
+
color: rgb(var(--contrast-1000));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.property-list {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
gap: 1rem;
|
|
30
|
+
padding: 0.5rem;
|
|
31
|
+
border: 1px solid rgb(var(--contrast-300));
|
|
32
|
+
border-radius: 0.25rem;
|
|
33
|
+
background-color: rgb(var(--contrast-50));
|
|
34
|
+
min-height: 4rem;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.property-item {
|
|
38
|
+
padding: 0.5rem;
|
|
39
|
+
border-radius: 0.25rem;
|
|
40
|
+
transition: background-color 0.2s;
|
|
41
|
+
}
|
|
42
|
+
.property-item:hover {
|
|
43
|
+
background-color: rgb(var(--contrast-100));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.actions {
|
|
47
|
+
display: flex;
|
|
48
|
+
justify-content: flex-start;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.summary {
|
|
52
|
+
display: flex;
|
|
53
|
+
justify-content: space-between;
|
|
54
|
+
align-items: center;
|
|
55
|
+
padding-top: 0.5rem;
|
|
56
|
+
border-top: 1px solid rgb(var(--contrast-300));
|
|
57
|
+
}
|
|
58
|
+
.summary .count {
|
|
59
|
+
font-size: 0.875rem;
|
|
60
|
+
font-weight: 500;
|
|
61
|
+
color: rgb(var(--contrast-900));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.empty-state {
|
|
65
|
+
padding: 2rem;
|
|
66
|
+
text-align: center;
|
|
67
|
+
color: rgb(var(--contrast-700));
|
|
68
|
+
font-style: italic;
|
|
69
|
+
}
|
|
70
|
+
.empty-state p {
|
|
71
|
+
margin: 0;
|
|
72
|
+
}
|