@limetech/lime-crm-building-blocks 1.95.0 → 1.96.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/lime-crm-building-blocks.cjs.js +1 -1
- package/dist/cjs/limebb-document-item.cjs.entry.js +174 -0
- package/dist/cjs/limebb-document-picker.cjs.entry.js +82 -0
- package/dist/cjs/limebb-feed-item-thumbnail-file-info.cjs.entry.js +1 -1
- package/dist/cjs/limebb-feed-timeline-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-feed.cjs.entry.js +1 -1
- package/dist/cjs/limebb-icon-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-info-tile-format.cjs.entry.js +1 -1
- package/dist/cjs/limebb-info-tile.cjs.entry.js +1 -1
- package/dist/cjs/limebb-kanban-group.cjs.entry.js +1 -1
- package/dist/cjs/limebb-kanban-item.cjs.entry.js +1 -1
- package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +1 -1
- package/dist/cjs/limebb-live-docs-info.cjs.entry.js +2 -2
- package/dist/cjs/limebb-locale-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-mention-group-counter.cjs.entry.js +2 -2
- package/dist/cjs/limebb-navigation-button_2.cjs.entry.js +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-text-editor.cjs.entry.js +3 -23
- package/dist/cjs/limebb-trend-indicator.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/random-string-aac0a74b.js +24 -0
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/document-picker/document-item/document-item.css +64 -0
- package/dist/collection/components/document-picker/document-item/document-item.js +265 -0
- package/dist/collection/components/document-picker/document-item/document-item.types.js +1 -0
- package/dist/collection/components/document-picker/document-picker.css +139 -0
- package/dist/collection/components/document-picker/document-picker.js +304 -0
- package/dist/collection/components/document-picker/document.types.js +1 -0
- package/dist/collection/components/feed/feed-item/feed-timeline-item.js +1 -1
- package/dist/collection/components/feed/feed-item-thumbnail-file-info/feed-item-thumbnail-file-info.js +1 -1
- package/dist/collection/components/feed/feed.js +1 -1
- package/dist/collection/components/icon-picker/icon-picker.js +1 -1
- package/dist/collection/components/info-tile/format/config/info-tile-format.js +1 -1
- package/dist/collection/components/info-tile/info-tile.js +1 -1
- package/dist/collection/components/kanban/kanban-group/kanban-group.js +1 -1
- package/dist/collection/components/kanban/kanban-item/kanban-item.js +1 -1
- package/dist/collection/components/lime-query-builder/lime-query-builder.js +1 -1
- package/dist/collection/components/limeobject/file-viewer/live-docs-info.js +2 -2
- package/dist/collection/components/locale-picker/locale-picker.js +1 -1
- package/dist/collection/components/notification-list/notification-item/notification-item.js +1 -1
- package/dist/collection/components/percentage-visualizer/percentage-visualizer.js +2 -2
- package/dist/collection/components/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/collection/util/format-bytes.js +36 -0
- package/dist/components/document-item.js +190 -0
- package/dist/components/feed-item-thumbnail-file-info.js +1 -1
- package/dist/components/feed-timeline-item.js +1 -1
- package/dist/components/kanban-group.js +1 -1
- package/dist/components/kanban-item.js +1 -1
- package/dist/components/limebb-document-item.d.ts +11 -0
- package/dist/components/limebb-document-item.js +6 -0
- package/dist/components/limebb-document-picker.d.ts +11 -0
- package/dist/components/limebb-document-picker.js +111 -0
- package/dist/components/limebb-feed.js +1 -1
- package/dist/components/limebb-icon-picker.js +1 -1
- package/dist/components/limebb-info-tile-format.js +1 -1
- package/dist/components/limebb-info-tile.js +1 -1
- package/dist/components/limebb-lime-query-builder.js +1 -1
- package/dist/components/limebb-locale-picker.js +1 -1
- package/dist/components/limebb-mention-group-counter.js +2 -2
- package/dist/components/limebb-percentage-visualizer.js +2 -2
- package/dist/components/limebb-text-editor.js +2 -22
- package/dist/components/limebb-trend-indicator.js +1 -1
- package/dist/components/live-docs-info.js +2 -2
- package/dist/components/notification-item.js +1 -1
- package/dist/components/random-string.js +22 -0
- package/dist/components/summary-popover.js +3 -3
- package/dist/esm/lime-crm-building-blocks.js +1 -1
- package/dist/esm/limebb-document-item.entry.js +170 -0
- package/dist/esm/limebb-document-picker.entry.js +78 -0
- package/dist/esm/limebb-feed-item-thumbnail-file-info.entry.js +1 -1
- package/dist/esm/limebb-feed-timeline-item.entry.js +1 -1
- package/dist/esm/limebb-feed.entry.js +1 -1
- package/dist/esm/limebb-icon-picker.entry.js +1 -1
- package/dist/esm/limebb-info-tile-format.entry.js +1 -1
- package/dist/esm/limebb-info-tile.entry.js +1 -1
- package/dist/esm/limebb-kanban-group.entry.js +1 -1
- package/dist/esm/limebb-kanban-item.entry.js +1 -1
- package/dist/esm/limebb-lime-query-builder.entry.js +1 -1
- package/dist/esm/limebb-live-docs-info.entry.js +2 -2
- package/dist/esm/limebb-locale-picker.entry.js +1 -1
- package/dist/esm/limebb-mention-group-counter.entry.js +2 -2
- package/dist/esm/limebb-navigation-button_2.entry.js +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-text-editor.entry.js +2 -22
- package/dist/esm/limebb-trend-indicator.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/random-string-f6ef6fbf.js +22 -0
- package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/{p-7ef3bace.entry.js → p-00e7e0d4.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-11ac105b.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-4a82410e.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-a694aae5.entry.js → p-50d3d61a.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-4ccce5cc.entry.js → p-5abe3fff.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-a44f543c.entry.js → p-61282e1a.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-16199127.entry.js → p-79d4668a.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-047c89de.entry.js → p-7c4bdc1b.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-8ef39ab8.entry.js → p-8064cbfb.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-88cc5b66.entry.js → p-82d33d43.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-d6a07ea4.entry.js → p-85b7291c.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-7db8652e.entry.js → p-8664381a.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-85e11ff7.entry.js → p-88c64360.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-9d25ed5a.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-8dce83ad.entry.js → p-9d9f25da.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-516210d4.entry.js → p-beb0d164.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-abf1c197.entry.js → p-c9126885.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-46d2f604.entry.js → p-e35299e0.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-fbda77a7.js +1 -0
- package/dist/lime-crm-building-blocks/{p-d6af09a8.entry.js → p-ff0b244b.entry.js} +1 -1
- package/dist/types/components/document-picker/document-item/document-item.d.ts +46 -0
- package/dist/types/components/document-picker/document-item/document-item.types.d.ts +37 -0
- package/dist/types/components/document-picker/document-picker.d.ts +80 -0
- package/dist/types/components/document-picker/document.types.d.ts +2 -0
- package/dist/types/components.d.ts +240 -0
- package/dist/types/util/format-bytes.d.ts +20 -0
- package/package.json +2 -2
- package/dist/lime-crm-building-blocks/p-29346b1a.entry.js +0 -1
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { createRandomString } from "../../util/random-string";
|
|
3
|
+
/**
|
|
4
|
+
* The document picker component allows users to select one or more
|
|
5
|
+
* files from a list of available documents.
|
|
6
|
+
*
|
|
7
|
+
* It is primarily designed to facilitate the selection of files
|
|
8
|
+
* that a user might want to import into the CRM, for example via
|
|
9
|
+
* our Microsoft Outlook Add-in.
|
|
10
|
+
*
|
|
11
|
+
* @exampleComponent limebb-example-document-picker-basic
|
|
12
|
+
* @exampleComponent limebb-example-document-picker-selection-mode
|
|
13
|
+
* @exampleComponent limebb-example-document-picker-limited-selection
|
|
14
|
+
* @exampleComponent limebb-example-document-picker-contextual-info
|
|
15
|
+
*
|
|
16
|
+
* @beta
|
|
17
|
+
*/
|
|
18
|
+
export class DocumentPicker {
|
|
19
|
+
constructor() {
|
|
20
|
+
/**
|
|
21
|
+
* The list of document items to display in the picker.
|
|
22
|
+
*/
|
|
23
|
+
this.items = [];
|
|
24
|
+
/**
|
|
25
|
+
* Set to `true` to indicate that the current selection is invalid.
|
|
26
|
+
*/
|
|
27
|
+
this.invalid = false;
|
|
28
|
+
/**
|
|
29
|
+
* Set to `true` to indicate that selecting an item is required.
|
|
30
|
+
*/
|
|
31
|
+
this.required = false;
|
|
32
|
+
/**
|
|
33
|
+
* Defines whether the picker allows single or multiple selection.
|
|
34
|
+
* - 'radio': Allows single selection within a group.
|
|
35
|
+
* - 'checkbox': Allows multiple selection.
|
|
36
|
+
*/
|
|
37
|
+
this.type = 'checkbox';
|
|
38
|
+
this.handleItemInteract = (event) => {
|
|
39
|
+
event.stopPropagation();
|
|
40
|
+
const interactedItem = event.detail;
|
|
41
|
+
if (!interactedItem) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
let updatedItems;
|
|
45
|
+
if (this.type === 'radio') {
|
|
46
|
+
// For radio buttons: either select the clicked item (and deselect others)
|
|
47
|
+
// or allow deselecting if clicking the already selected item
|
|
48
|
+
updatedItems = this.items
|
|
49
|
+
.map((item) => {
|
|
50
|
+
if (item.id === interactedItem.id) {
|
|
51
|
+
return Object.assign(Object.assign({}, item), { selected: interactedItem.selected });
|
|
52
|
+
}
|
|
53
|
+
return Object.assign(Object.assign({}, item), { selected: false });
|
|
54
|
+
})
|
|
55
|
+
.find((item) => item.selected);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
updatedItems = this.items
|
|
59
|
+
.map((item) => {
|
|
60
|
+
if (item.id === interactedItem.id) {
|
|
61
|
+
return Object.assign(Object.assign({}, item), { selected: interactedItem.selected });
|
|
62
|
+
}
|
|
63
|
+
return item;
|
|
64
|
+
})
|
|
65
|
+
.filter((item) => item.selected);
|
|
66
|
+
}
|
|
67
|
+
this.change.emit(updatedItems);
|
|
68
|
+
};
|
|
69
|
+
this.renderHelperLine = () => {
|
|
70
|
+
if (!this.helperText) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
return (h("limel-helper-line", { helperText: this.helperText, helperTextId: this.helperTextId, invalid: this.invalid }));
|
|
74
|
+
};
|
|
75
|
+
this.helperTextId = createRandomString();
|
|
76
|
+
this.labelId = createRandomString();
|
|
77
|
+
}
|
|
78
|
+
render() {
|
|
79
|
+
return (h(Host, { key: '28bf6afd1999efc62689bc43b7d63d8c308d3663' }, h("limel-notched-outline", { key: '0b6f3d9f0cc88e9e1b782e3d12e7a08853211be6', labelId: this.labelId, label: this.label, required: this.required, invalid: this.invalid, hasFloatingLabel: true }, h("div", { key: 'a3d64740ca2139a3435884526b9a6195929d8060', slot: "content", role: this.type === 'radio' ? 'radiogroup' : 'group', "aria-labelledby": this.label ? this.labelId : undefined, "aria-describedby": this.helperText ? this.helperTextId : undefined }, this.renderItems())), this.renderHelperLine()));
|
|
80
|
+
}
|
|
81
|
+
renderItems() {
|
|
82
|
+
return this.items.map((item) => (h("limebb-document-item", { platform: this.platform, context: this.context, item: item, key: item.id, type: this.type, onInteract: this.handleItemInteract })));
|
|
83
|
+
}
|
|
84
|
+
static get is() { return "limebb-document-picker"; }
|
|
85
|
+
static get encapsulation() { return "shadow"; }
|
|
86
|
+
static get originalStyleUrls() {
|
|
87
|
+
return {
|
|
88
|
+
"$": ["document-picker.scss"]
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
static get styleUrls() {
|
|
92
|
+
return {
|
|
93
|
+
"$": ["document-picker.css"]
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
static get properties() {
|
|
97
|
+
return {
|
|
98
|
+
"platform": {
|
|
99
|
+
"type": "unknown",
|
|
100
|
+
"mutable": false,
|
|
101
|
+
"complexType": {
|
|
102
|
+
"original": "LimeWebComponentPlatform",
|
|
103
|
+
"resolved": "LimeWebComponentPlatform",
|
|
104
|
+
"references": {
|
|
105
|
+
"LimeWebComponentPlatform": {
|
|
106
|
+
"location": "import",
|
|
107
|
+
"path": "@limetech/lime-web-components",
|
|
108
|
+
"id": "node_modules::LimeWebComponentPlatform"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"required": true,
|
|
113
|
+
"optional": false,
|
|
114
|
+
"docs": {
|
|
115
|
+
"tags": [{
|
|
116
|
+
"name": "inheritdoc",
|
|
117
|
+
"text": undefined
|
|
118
|
+
}],
|
|
119
|
+
"text": "Reference to the platform"
|
|
120
|
+
},
|
|
121
|
+
"getter": false,
|
|
122
|
+
"setter": false
|
|
123
|
+
},
|
|
124
|
+
"context": {
|
|
125
|
+
"type": "unknown",
|
|
126
|
+
"mutable": false,
|
|
127
|
+
"complexType": {
|
|
128
|
+
"original": "LimeWebComponentContext",
|
|
129
|
+
"resolved": "LimeWebComponentContext",
|
|
130
|
+
"references": {
|
|
131
|
+
"LimeWebComponentContext": {
|
|
132
|
+
"location": "import",
|
|
133
|
+
"path": "@limetech/lime-web-components",
|
|
134
|
+
"id": "node_modules::LimeWebComponentContext"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"required": false,
|
|
139
|
+
"optional": false,
|
|
140
|
+
"docs": {
|
|
141
|
+
"tags": [{
|
|
142
|
+
"name": "inheritdoc",
|
|
143
|
+
"text": undefined
|
|
144
|
+
}],
|
|
145
|
+
"text": "The context this component belongs to"
|
|
146
|
+
},
|
|
147
|
+
"getter": false,
|
|
148
|
+
"setter": false
|
|
149
|
+
},
|
|
150
|
+
"items": {
|
|
151
|
+
"type": "unknown",
|
|
152
|
+
"mutable": false,
|
|
153
|
+
"complexType": {
|
|
154
|
+
"original": "DocumentItem[]",
|
|
155
|
+
"resolved": "DocumentItem[]",
|
|
156
|
+
"references": {
|
|
157
|
+
"DocumentItem": {
|
|
158
|
+
"location": "import",
|
|
159
|
+
"path": "./document-item/document-item.types",
|
|
160
|
+
"id": "src/components/document-picker/document-item/document-item.types.ts::DocumentItem"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"required": false,
|
|
165
|
+
"optional": false,
|
|
166
|
+
"docs": {
|
|
167
|
+
"tags": [],
|
|
168
|
+
"text": "The list of document items to display in the picker."
|
|
169
|
+
},
|
|
170
|
+
"getter": false,
|
|
171
|
+
"setter": false,
|
|
172
|
+
"defaultValue": "[]"
|
|
173
|
+
},
|
|
174
|
+
"label": {
|
|
175
|
+
"type": "string",
|
|
176
|
+
"mutable": false,
|
|
177
|
+
"complexType": {
|
|
178
|
+
"original": "string",
|
|
179
|
+
"resolved": "string | undefined",
|
|
180
|
+
"references": {}
|
|
181
|
+
},
|
|
182
|
+
"required": false,
|
|
183
|
+
"optional": true,
|
|
184
|
+
"docs": {
|
|
185
|
+
"tags": [],
|
|
186
|
+
"text": "Label to display for the group of items."
|
|
187
|
+
},
|
|
188
|
+
"getter": false,
|
|
189
|
+
"setter": false,
|
|
190
|
+
"attribute": "label",
|
|
191
|
+
"reflect": true
|
|
192
|
+
},
|
|
193
|
+
"helperText": {
|
|
194
|
+
"type": "string",
|
|
195
|
+
"mutable": false,
|
|
196
|
+
"complexType": {
|
|
197
|
+
"original": "string",
|
|
198
|
+
"resolved": "string | undefined",
|
|
199
|
+
"references": {}
|
|
200
|
+
},
|
|
201
|
+
"required": false,
|
|
202
|
+
"optional": true,
|
|
203
|
+
"docs": {
|
|
204
|
+
"tags": [],
|
|
205
|
+
"text": "Optional helper text to display below the items."
|
|
206
|
+
},
|
|
207
|
+
"getter": false,
|
|
208
|
+
"setter": false,
|
|
209
|
+
"attribute": "helper-text",
|
|
210
|
+
"reflect": true
|
|
211
|
+
},
|
|
212
|
+
"invalid": {
|
|
213
|
+
"type": "boolean",
|
|
214
|
+
"mutable": false,
|
|
215
|
+
"complexType": {
|
|
216
|
+
"original": "boolean",
|
|
217
|
+
"resolved": "boolean",
|
|
218
|
+
"references": {}
|
|
219
|
+
},
|
|
220
|
+
"required": false,
|
|
221
|
+
"optional": false,
|
|
222
|
+
"docs": {
|
|
223
|
+
"tags": [],
|
|
224
|
+
"text": "Set to `true` to indicate that the current selection is invalid."
|
|
225
|
+
},
|
|
226
|
+
"getter": false,
|
|
227
|
+
"setter": false,
|
|
228
|
+
"attribute": "invalid",
|
|
229
|
+
"reflect": true,
|
|
230
|
+
"defaultValue": "false"
|
|
231
|
+
},
|
|
232
|
+
"required": {
|
|
233
|
+
"type": "boolean",
|
|
234
|
+
"mutable": false,
|
|
235
|
+
"complexType": {
|
|
236
|
+
"original": "boolean",
|
|
237
|
+
"resolved": "boolean",
|
|
238
|
+
"references": {}
|
|
239
|
+
},
|
|
240
|
+
"required": false,
|
|
241
|
+
"optional": false,
|
|
242
|
+
"docs": {
|
|
243
|
+
"tags": [],
|
|
244
|
+
"text": "Set to `true` to indicate that selecting an item is required."
|
|
245
|
+
},
|
|
246
|
+
"getter": false,
|
|
247
|
+
"setter": false,
|
|
248
|
+
"attribute": "required",
|
|
249
|
+
"reflect": true,
|
|
250
|
+
"defaultValue": "false"
|
|
251
|
+
},
|
|
252
|
+
"type": {
|
|
253
|
+
"type": "string",
|
|
254
|
+
"mutable": false,
|
|
255
|
+
"complexType": {
|
|
256
|
+
"original": "DocumentType",
|
|
257
|
+
"resolved": "\"checkbox\" | \"radio\"",
|
|
258
|
+
"references": {
|
|
259
|
+
"DocumentType": {
|
|
260
|
+
"location": "import",
|
|
261
|
+
"path": "./document.types",
|
|
262
|
+
"id": "src/components/document-picker/document.types.ts::DocumentType"
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
"required": false,
|
|
267
|
+
"optional": false,
|
|
268
|
+
"docs": {
|
|
269
|
+
"tags": [],
|
|
270
|
+
"text": "Defines whether the picker allows single or multiple selection.\n- 'radio': Allows single selection within a group.\n- 'checkbox': Allows multiple selection."
|
|
271
|
+
},
|
|
272
|
+
"getter": false,
|
|
273
|
+
"setter": false,
|
|
274
|
+
"attribute": "type",
|
|
275
|
+
"reflect": true,
|
|
276
|
+
"defaultValue": "'checkbox'"
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
static get events() {
|
|
281
|
+
return [{
|
|
282
|
+
"method": "change",
|
|
283
|
+
"name": "change",
|
|
284
|
+
"bubbles": true,
|
|
285
|
+
"cancelable": true,
|
|
286
|
+
"composed": true,
|
|
287
|
+
"docs": {
|
|
288
|
+
"tags": [],
|
|
289
|
+
"text": "Fired when a user changes the selection state of an item."
|
|
290
|
+
},
|
|
291
|
+
"complexType": {
|
|
292
|
+
"original": "DocumentItem | DocumentItem[]",
|
|
293
|
+
"resolved": "DocumentItem | DocumentItem[]",
|
|
294
|
+
"references": {
|
|
295
|
+
"DocumentItem": {
|
|
296
|
+
"location": "import",
|
|
297
|
+
"path": "./document-item/document-item.types",
|
|
298
|
+
"id": "src/components/document-picker/document-item/document-item.types.ts::DocumentItem"
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}];
|
|
303
|
+
}
|
|
304
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -188,7 +188,7 @@ export class FeedTimelineItem {
|
|
|
188
188
|
render() {
|
|
189
189
|
var _a, _b;
|
|
190
190
|
const helperTextId = `helper-text-${this.item.id}`;
|
|
191
|
-
return (h(Host, { key: '
|
|
191
|
+
return (h(Host, { key: 'ae530cfe3aa5c54f8c1d3ceae6630b606f5ca57f', id: this.item.id, class: {
|
|
192
192
|
'has-unpromoted-actions': !!((_a = this.item.unpromotedActions) === null || _a === void 0 ? void 0 : _a.length),
|
|
193
193
|
'has-author-picture': !!((_b = this.item.author) === null || _b === void 0 ? void 0 : _b.picture),
|
|
194
194
|
'shows-less': !this.showMore,
|
|
@@ -8,7 +8,7 @@ import { h } from "@stencil/core";
|
|
|
8
8
|
*/
|
|
9
9
|
export class FeedItemThumbnailFileInfo {
|
|
10
10
|
render() {
|
|
11
|
-
return h("span", { key: '
|
|
11
|
+
return h("span", { key: 'dd3413d387c4183a82de9b4bc2e3c276f2e0d3e5' }, this.description);
|
|
12
12
|
}
|
|
13
13
|
static get is() { return "limebb-feed-item-thumbnail-file-info"; }
|
|
14
14
|
static get encapsulation() { return "shadow"; }
|
|
@@ -103,7 +103,7 @@ export class Feed {
|
|
|
103
103
|
this.highlighter.unregisterFeed(this.feedItemElement);
|
|
104
104
|
}
|
|
105
105
|
render() {
|
|
106
|
-
return (h(Host, { key: '
|
|
106
|
+
return (h(Host, { key: '8b53e0a71a8921ed0cb7fcd50273c1070eef365e', role: "log", "aria-busy": this.loading ? 'true' : 'false', style: {
|
|
107
107
|
'--limebb-feed-highlight-duration': `${ITEM_HIGHLIGHT_DURATION}ms`,
|
|
108
108
|
} }, this.renderLoadMore(), this.renderEmptyFeedMessage(), this.renderSpinner(), this.renderFeedItems()));
|
|
109
109
|
}
|
|
@@ -35,7 +35,7 @@ export class IconPicker {
|
|
|
35
35
|
icon: this.value,
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
return (h("limel-picker", { key: '
|
|
38
|
+
return (h("limel-picker", { key: 'cfb1562215c69464d6736ec96fd39e0d45c92d7d', label: this.label, helperText: this.helperText, disabled: this.disabled, readonly: this.readonly, invalid: this.invalid, required: this.required, value: value, searcher: this.search, onChange: this.handleChange, badgeIcons: false, leadingIcon: "search", searchLabel: "Start typing to find the right icon" }));
|
|
39
39
|
}
|
|
40
40
|
static get is() { return "limebb-icon-picker"; }
|
|
41
41
|
static get encapsulation() { return "shadow"; }
|
|
@@ -92,7 +92,7 @@ export class InfoTileAdminConfig {
|
|
|
92
92
|
},
|
|
93
93
|
];
|
|
94
94
|
return [
|
|
95
|
-
h("limel-button-group", { key: '
|
|
95
|
+
h("limel-button-group", { key: '8c7bba2402e84e73df2bc5e906780aeb66b1af58', value: buttons.filter(this.isValidButton), onChange: this.handleChangeType }),
|
|
96
96
|
this.renderFormatConfig(),
|
|
97
97
|
];
|
|
98
98
|
}
|
|
@@ -92,7 +92,7 @@ export class InfoTile {
|
|
|
92
92
|
const errorProps = Object.assign(Object.assign({}, baseProps), { icon: 'error', prefix: 'ERROR', loading: true, label: this.getLabel(filter) });
|
|
93
93
|
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() });
|
|
94
94
|
const props = !filter || this.error ? errorProps : normalProps;
|
|
95
|
-
return (h("limel-info-tile", Object.assign({ key: '
|
|
95
|
+
return (h("limel-info-tile", Object.assign({ key: 'bb8b9eede8bdd3fdd17934753e463d134c46f7df', class: { error: !filter || this.error } }, props)));
|
|
96
96
|
}
|
|
97
97
|
getFormattedValue() {
|
|
98
98
|
if (!this.value && this.value !== 0) {
|
|
@@ -31,7 +31,7 @@ export class KanbanGroup {
|
|
|
31
31
|
this.renderHelp(),
|
|
32
32
|
this.renderGroupHeading(),
|
|
33
33
|
this.renderGroupSummary(),
|
|
34
|
-
h("div", { key: '
|
|
34
|
+
h("div", { key: 'f02bad3d0fc87d2359dfb1a9b6ee72c93433d3f2', class: "items" }, this.renderKanbanItems(), this.renderSpinner(), this.renderLoadMore()),
|
|
35
35
|
];
|
|
36
36
|
}
|
|
37
37
|
renderGroupSummary() {
|
|
@@ -50,7 +50,7 @@ export class KanbanItemComponent {
|
|
|
50
50
|
}
|
|
51
51
|
render() {
|
|
52
52
|
var _a, _b;
|
|
53
|
-
return (h(Host, { key: '
|
|
53
|
+
return (h(Host, { key: '4219ff4f6c63ffdf95d24ad12000c4e23b1b53c2', id: this.item.id.toString(), class: {
|
|
54
54
|
'has-unpromoted-actions': !!((_a = this.item.unpromotedActions) === null || _a === void 0 ? void 0 : _a.length),
|
|
55
55
|
'is-selected': !!((_b = this.item) === null || _b === void 0 ? void 0 : _b.selected),
|
|
56
56
|
}, style: {
|
|
@@ -67,7 +67,7 @@ export class LimeQueryBuilder {
|
|
|
67
67
|
}
|
|
68
68
|
render() {
|
|
69
69
|
const guiSupported = this.checkGuiSupport();
|
|
70
|
-
return (h("div", { key: '
|
|
70
|
+
return (h("div", { key: '77e93d0277a99b8ff1c777d7ee0b63259755f740', class: "lime-query-builder" }, this.label && (h("h3", { key: '4089d69ea3404c656f1c24ec73aef6df2cc8baec', class: "lime-query-builder-label" }, this.label)), this.guiModeEnabled && (h("div", { key: '5d18a749386651cc1361b712693bad105dba9b03', class: "mode-controls" }, this.renderModeSwitch(guiSupported))), !this.guiModeEnabled || this.mode === 'code' ? (h("div", { class: "code-mode" }, this.renderCodeEditor(guiSupported))) : (h("div", { class: "gui-mode" }, h("div", { class: "placeholder-message" }, h("h4", null, "GUI Mode Not Yet Supported"), h("p", null, "The visual query builder interface is not yet available. Please use Code mode to write queries in JSON format."))))));
|
|
71
71
|
}
|
|
72
72
|
checkGuiSupport() {
|
|
73
73
|
if (!this.limetypes || !this.codeValue) {
|
|
@@ -5,8 +5,8 @@ import { h } from "@stencil/core";
|
|
|
5
5
|
export class LiveDocsInfo {
|
|
6
6
|
render() {
|
|
7
7
|
return [
|
|
8
|
-
h("div", { key: '
|
|
9
|
-
h("p", { key: '
|
|
8
|
+
h("div", { key: '4a4d9cfcfb7b37d5f98cef9a5e963b47125188b7', class: "header" }, h("limel-icon", { key: '832c49b5cbd38319e1a36eaff63a41417713d2c3', name: "not_showing_video_frames" }), h("h2", { key: '8e19c71383923d6964df4308fe030e68d69c9e46' }, "Viewing this file type requires ", h("em", { key: '9c5c93d320748dc4ff19c682d4228acca653e5b1' }, "Live Docs"))),
|
|
9
|
+
h("p", { key: '157a0f930aba54e52e8c777a90cd3445bf80fa5d' }, h("em", { key: '4db4bc76949be8ef1668e9ce7f416c1a3f66aa44' }, "Live Docs"), " not only enables you to view many file formats such as Microsoft Office documents, but it also empowers you to edit them right in the CRM. No need to download anything on your device!", h("a", { key: 'cf2e7bb006ab10ca91b60f740919d937e36974b2', target: "_blank", href: "https://www.lime-technologies.com/en/lime-crm/live-docs/" }, "Learn more")),
|
|
10
10
|
];
|
|
11
11
|
}
|
|
12
12
|
static get is() { return "limebb-live-docs-info"; }
|
|
@@ -53,7 +53,7 @@ export class LocalePicker {
|
|
|
53
53
|
const value = this.value;
|
|
54
54
|
selectedOptions = options.find((option) => option.value === value);
|
|
55
55
|
}
|
|
56
|
-
return (h("limel-select", { key: '
|
|
56
|
+
return (h("limel-select", { key: 'c5fb78e13f1aca2bbb3f51f5c2a1a0958eca0d6e', value: selectedOptions, options: sortBy(options, 'text'), helperText: this.helperText, label: this.label, required: this.required, disabled: this.disabled, readonly: this.readonly, onChange: this.handleChange, multiple: this.multipleChoice }));
|
|
57
57
|
}
|
|
58
58
|
static get is() { return "limebb-locale-picker"; }
|
|
59
59
|
static get encapsulation() { return "shadow"; }
|
|
@@ -56,7 +56,7 @@ export class NotificationListItem {
|
|
|
56
56
|
}
|
|
57
57
|
render() {
|
|
58
58
|
var _a, _b;
|
|
59
|
-
return (h(Host, { key: '
|
|
59
|
+
return (h(Host, { key: 'd6bb98c3ce4ec1b85c828c9f6d65bd4f4a70885d', id: this.item.id, class: {
|
|
60
60
|
'is-clickable': this.isItemClickable(),
|
|
61
61
|
'is-read': !!((_a = this.item) === null || _a === void 0 ? void 0 : _a.read),
|
|
62
62
|
'is-selected': !!((_b = this.item) === null || _b === void 0 ? void 0 : _b.selected),
|
|
@@ -91,11 +91,11 @@ export class PercentageVisualizer {
|
|
|
91
91
|
render() {
|
|
92
92
|
const normalizedValue = this.getNormalizedValue();
|
|
93
93
|
const zeroPoint = this.getZeroPointPosition();
|
|
94
|
-
return (h(Host, { key: '
|
|
94
|
+
return (h(Host, { key: '1f66075e6977c4902925fde4410079ffa8187a37', class: this.getContainerClassList(), style: {
|
|
95
95
|
'--limebb-percentage-visualizer-zero-point-position': `${zeroPoint}%`,
|
|
96
96
|
'--limebb-percentage-visualizer-width': `${Math.abs(normalizedValue)}%`,
|
|
97
97
|
'--limebb-percentage-visualizer-rotate': `${normalizedValue >= 0 ? '0deg' : '180deg'}`,
|
|
98
|
-
} }, h("limel-notched-outline", { key: '
|
|
98
|
+
} }, h("limel-notched-outline", { key: 'b4e64e40684a3011e74dcfe0ef0969699ffb7a92', 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: 'aa60e3dceadca94ed110ee0136e7faf84c745a26', slot: "content" }, this.renderVisualization())), this.renderHelperLine()));
|
|
99
99
|
}
|
|
100
100
|
renderVisualization() {
|
|
101
101
|
if (this.reducePresence && (this.numValue === 0 || !this.hasValue())) {
|
|
@@ -118,14 +118,14 @@ export class SummaryPopover {
|
|
|
118
118
|
top: '0.125rem',
|
|
119
119
|
right: '0.125rem',
|
|
120
120
|
};
|
|
121
|
-
return (h("limel-popover", { key: '
|
|
121
|
+
return (h("limel-popover", { key: '95ea1573956a1e882a8b4dfbdc865ca9ef3e424d', style: {
|
|
122
122
|
'--limebb-summary-popover-timeout': `${this.triggerDelay}ms`,
|
|
123
|
-
}, open: this.isPopoverOpen, onClose: this.onPopoverClose, openDirection: this.openDirection }, h("div", { key: '
|
|
123
|
+
}, open: this.isPopoverOpen, onClose: this.onPopoverClose, openDirection: this.openDirection }, h("div", { key: '33a1b9fcda6fbe6ecb6b1bd40b8b1290b3f74beb', slot: "trigger", tabIndex: 0, onMouseEnter: this.openPopoverWithDelay, onMouseLeave: this.resetTimeout, onFocus: this.openPopoverWithDelay }, h("slot", { key: '1037bd3b2ad03b28068b8d4831684d97a76b7f90', name: "trigger" }), h("div", { key: '1dc09768c4268f67a1fdfc5e0bb0120342223005', class: "opening-countdown-indicator" })), h("limel-card", { key: '5176b5be802feabbbfd270eb929975d2e833243e', style: {
|
|
124
124
|
'max-width': this.popoverMaxWidth,
|
|
125
125
|
'max-height': this.popoverMaxHeight,
|
|
126
126
|
'min-width': '7rem',
|
|
127
127
|
'min-height': '3rem',
|
|
128
|
-
}, orientation: "landscape", heading: this.heading, subheading: this.subheading, icon: this.icon, value: this.value, image: this.image, actions: this.actions, onActionSelected: this.handleSelected }, h("limebb-navigation-button", { key: '
|
|
128
|
+
}, orientation: "landscape", heading: this.heading, subheading: this.subheading, icon: this.icon, value: this.value, image: this.image, actions: this.actions, onActionSelected: this.handleSelected }, h("limebb-navigation-button", { key: '50e76815a3d4b04a7ea2bd044586f014a7e24459', slot: "component", type: "close", style: closeButtonStyle, tooltipLabel: "Close", tooltipHelperLabel: "Esc", onClick: this.handleCloseClick }))));
|
|
129
129
|
}
|
|
130
130
|
static get is() { return "limebb-summary-popover"; }
|
|
131
131
|
static get encapsulation() { return "shadow"; }
|
|
@@ -13,8 +13,8 @@ export class MentionGroupCounter {
|
|
|
13
13
|
render() {
|
|
14
14
|
const label = this.getLabel();
|
|
15
15
|
return [
|
|
16
|
-
h("span", { key: '
|
|
17
|
-
h("limel-tooltip", { key: '
|
|
16
|
+
h("span", { key: '101adb63d448656a9acbf43245444f1de399c655', id: this.tooltipId }, label),
|
|
17
|
+
h("limel-tooltip", { key: '232baef721c41aefa38ff7074c8ba925124a6a72', elementId: this.tooltipId, label: label, helperLabel: this.helperLabel }),
|
|
18
18
|
];
|
|
19
19
|
}
|
|
20
20
|
getLabel() {
|
|
@@ -389,7 +389,7 @@ export class LimeBBTextEditor {
|
|
|
389
389
|
}
|
|
390
390
|
render() {
|
|
391
391
|
return [
|
|
392
|
-
h("limel-text-editor", { key: '
|
|
392
|
+
h("limel-text-editor", { key: 'ba02d97b3d29f4de9e1457b81c5788c3b5fd527b', ref: (el) => (this.textEditor = el), tabindex: this.disabled ? -1 : 0, value: this.value, contentType: this.contentType, customElements: this.registeredCustomElements, "aria-disabled": this.disabled, language: this.language, triggers: this.registeredTriggers, onTriggerStart: this.handleTriggerStart, onTriggerStop: this.handleTriggerStop, onTriggerChange: this.handleTriggerChange, onImagePasted: this.handleImagePasted, onMetadataChange: this.handleMetadataChange, ui: this.ui, allowResize: this.allowResize, required: this.required, disabled: this.disabled, readonly: this.readonly, helperText: this.helperText, placeholder: this.placeholder, label: this.label, invalid: this.invalid }),
|
|
393
393
|
this.renderPicker(),
|
|
394
394
|
];
|
|
395
395
|
}
|
|
@@ -52,7 +52,7 @@ export class TrendIndicator {
|
|
|
52
52
|
this.numValue = this.parseValue(this.value);
|
|
53
53
|
}
|
|
54
54
|
render() {
|
|
55
|
-
return (h(Host, { key: '
|
|
55
|
+
return (h(Host, { key: '295196e1b1e9bf9e45f728341116ef8136a55e0b', class: this.getContainerClassList() }, h("limel-notched-outline", { key: 'aa9743e91c3891b259379c0802e61631ede2b421', 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: '5cf7728d597bd8c70710c13e251791e14fbf0cf6', slot: "content", tabIndex: 0 }, this.renderVisualization())), this.renderHelperLine(), this.renderTooltip()));
|
|
56
56
|
}
|
|
57
57
|
renderVisualization() {
|
|
58
58
|
if (this.reducePresence && (this.numValue === 0 || !this.hasValue())) {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format a file size in bytes into a human readable string.
|
|
3
|
+
*
|
|
4
|
+
* Uses base 1024 units (binary prefixes without the "i" designation)
|
|
5
|
+
* and applies adaptive precision: one decimal for values < 10 of the
|
|
6
|
+
* chosen unit, otherwise no decimals.
|
|
7
|
+
*
|
|
8
|
+
* Examples:
|
|
9
|
+
* - 0 => "0 B"
|
|
10
|
+
* - 512 => "512 B"
|
|
11
|
+
* - 1536 => "1.5 KB"
|
|
12
|
+
* - 1048576 => "1 MB"
|
|
13
|
+
* - 5347737600 => "4.98 GB" (value < 10 so one decimal)
|
|
14
|
+
*
|
|
15
|
+
* @param bytes - the size in bytes
|
|
16
|
+
* @param decimals - max number of decimals for small unit values (default: 1)
|
|
17
|
+
* @returns formatted size string
|
|
18
|
+
*/
|
|
19
|
+
export function formatBytes(bytes, decimals = 1) {
|
|
20
|
+
if (bytes == null || Number.isNaN(bytes)) {
|
|
21
|
+
return '';
|
|
22
|
+
}
|
|
23
|
+
if (bytes < 0) {
|
|
24
|
+
return '';
|
|
25
|
+
}
|
|
26
|
+
if (bytes === 0) {
|
|
27
|
+
return '0 B';
|
|
28
|
+
}
|
|
29
|
+
const k = 1024;
|
|
30
|
+
const sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
31
|
+
const i = Math.min(sizes.length - 1, Math.floor(Math.log(bytes) / Math.log(k)));
|
|
32
|
+
const value = bytes / Math.pow(k, i);
|
|
33
|
+
const precision = value < 10 ? Math.max(0, decimals) : 0; // only keep decimals for small values
|
|
34
|
+
const rounded = Number.parseFloat(value.toFixed(precision));
|
|
35
|
+
return `${rounded} ${sizes[i]}`;
|
|
36
|
+
}
|