@primeui/scheduler-core 0.0.1-alpha.1

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 (63) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +1 -0
  3. package/dist/calendar/index.d.mts +57 -0
  4. package/dist/calendar/index.mjs +1 -0
  5. package/dist/chunk-2B3YLWHA.mjs +196 -0
  6. package/dist/chunk-2THQAZ26.mjs +1669 -0
  7. package/dist/chunk-5KORIWDT.mjs +41 -0
  8. package/dist/chunk-5N4ZOBJV.mjs +866 -0
  9. package/dist/chunk-6OZAPQZ5.mjs +229 -0
  10. package/dist/chunk-6PK5WSKT.mjs +369 -0
  11. package/dist/chunk-6VYWVIGM.mjs +1170 -0
  12. package/dist/chunk-AAVM7UCG.mjs +100 -0
  13. package/dist/chunk-C7ADJGNV.mjs +157 -0
  14. package/dist/chunk-DYW6WUHE.mjs +277 -0
  15. package/dist/chunk-F5W5HD7S.mjs +285 -0
  16. package/dist/chunk-FIBAZFC4.mjs +871 -0
  17. package/dist/chunk-HPC5B3AR.mjs +558 -0
  18. package/dist/chunk-KQGRXTP5.mjs +650 -0
  19. package/dist/chunk-NMX4BW42.mjs +672 -0
  20. package/dist/chunk-NX46LPLF.mjs +440 -0
  21. package/dist/chunk-NZGJN7HG.mjs +314 -0
  22. package/dist/chunk-QDMZBJDV.mjs +251 -0
  23. package/dist/chunk-QR2SVYAD.mjs +1144 -0
  24. package/dist/chunk-SYJ5O4KH.mjs +136 -0
  25. package/dist/chunk-TNKJPFGI.mjs +569 -0
  26. package/dist/chunk-UMAMDBU4.mjs +1 -0
  27. package/dist/chunk-W2SJW3QQ.mjs +3925 -0
  28. package/dist/chunk-WFUJWDST.mjs +352 -0
  29. package/dist/chunk-XUBQ2IQS.mjs +1 -0
  30. package/dist/chunk-ZUKUKGNK.mjs +613 -0
  31. package/dist/controllers/index.d.mts +384 -0
  32. package/dist/controllers/index.mjs +13 -0
  33. package/dist/date-D_CjQPmM.d.mts +74 -0
  34. package/dist/display-format-CLVvRt4I.d.mts +57 -0
  35. package/dist/event/index.d.mts +267 -0
  36. package/dist/event/index.mjs +8 -0
  37. package/dist/event-surface-_R_LHD95.d.mts +21 -0
  38. package/dist/event.positioning-BdzAVPk7.d.mts +51 -0
  39. package/dist/event.utils-QSNdd-3W.d.mts +35 -0
  40. package/dist/index.d.mts +1128 -0
  41. package/dist/index.mjs +1022 -0
  42. package/dist/interaction/index.d.mts +442 -0
  43. package/dist/interaction/index.mjs +9 -0
  44. package/dist/month/index.d.mts +104 -0
  45. package/dist/month/index.mjs +6 -0
  46. package/dist/overlay-BYM9B6nC.d.mts +64 -0
  47. package/dist/resource/index.d.mts +172 -0
  48. package/dist/resource/index.mjs +1 -0
  49. package/dist/selection-CO_98HdS.d.mts +56 -0
  50. package/dist/time-grid/index.d.mts +92 -0
  51. package/dist/time-grid/index.mjs +13 -0
  52. package/dist/timeline/index.d.mts +165 -0
  53. package/dist/timeline/index.mjs +6 -0
  54. package/dist/touch-BhsMWsjf.d.mts +69 -0
  55. package/dist/utils/index.d.mts +494 -0
  56. package/dist/utils/index.mjs +17 -0
  57. package/dist/views/index.d.mts +51 -0
  58. package/dist/views/index.mjs +8 -0
  59. package/dist/views/timeline/index.d.mts +37 -0
  60. package/dist/views/timeline/index.mjs +4 -0
  61. package/dist/year/index.d.mts +70 -0
  62. package/dist/year/index.mjs +6 -0
  63. package/package.json +58 -0
@@ -0,0 +1,1144 @@
1
+ // src/resource/resource-tree.ts
2
+ function flattenResourceTree(resourceList) {
3
+ const output = [];
4
+ for (const resource of resourceList) {
5
+ output.push(resource);
6
+ if (resource.children && resource.children.length > 0) {
7
+ output.push(...flattenResourceTree(resource.children));
8
+ }
9
+ }
10
+ return output;
11
+ }
12
+ function upsertResourceById(resourceList, resource) {
13
+ const index = resourceList.findIndex((item) => item.id === resource.id);
14
+ if (index === -1) {
15
+ return [...resourceList, resource];
16
+ }
17
+ const next = [...resourceList];
18
+ next[index] = resource;
19
+ return next;
20
+ }
21
+ function addResourceToTree(resourceList, resource, parentId) {
22
+ if (parentId === void 0 || parentId === null) {
23
+ return {
24
+ resources: upsertResourceById(resourceList, resource),
25
+ changed: true
26
+ };
27
+ }
28
+ let changed = false;
29
+ const next = resourceList.map((node) => {
30
+ if (node.id === parentId) {
31
+ changed = true;
32
+ const child = resource.parentId === void 0 ? { ...resource, parentId } : resource;
33
+ return {
34
+ ...node,
35
+ children: upsertResourceById(node.children ?? [], child)
36
+ };
37
+ }
38
+ if (!node.children || node.children.length === 0) {
39
+ return node;
40
+ }
41
+ const childResult = addResourceToTree(node.children, resource, parentId);
42
+ if (!childResult.changed) {
43
+ return node;
44
+ }
45
+ changed = true;
46
+ return {
47
+ ...node,
48
+ children: childResult.resources
49
+ };
50
+ });
51
+ return {
52
+ resources: changed ? next : resourceList,
53
+ changed
54
+ };
55
+ }
56
+ function updateResourceInTree(resourceList, updatedResource) {
57
+ let changed = false;
58
+ const next = resourceList.map((node) => {
59
+ if (node.id === updatedResource.id) {
60
+ changed = true;
61
+ return {
62
+ ...node,
63
+ ...updatedResource
64
+ };
65
+ }
66
+ if (!node.children || node.children.length === 0) {
67
+ return node;
68
+ }
69
+ const childResult = updateResourceInTree(node.children, updatedResource);
70
+ if (!childResult.changed) {
71
+ return node;
72
+ }
73
+ changed = true;
74
+ return {
75
+ ...node,
76
+ children: childResult.resources
77
+ };
78
+ });
79
+ return {
80
+ resources: changed ? next : resourceList,
81
+ changed
82
+ };
83
+ }
84
+ function removeResourceFromTree(resourceList, resourceId) {
85
+ let changed = false;
86
+ const next = [];
87
+ for (const node of resourceList) {
88
+ if (node.id === resourceId) {
89
+ changed = true;
90
+ continue;
91
+ }
92
+ if (!node.children || node.children.length === 0) {
93
+ next.push(node);
94
+ continue;
95
+ }
96
+ const childResult = removeResourceFromTree(node.children, resourceId);
97
+ if (childResult.changed) {
98
+ changed = true;
99
+ next.push({
100
+ ...node,
101
+ children: childResult.resources
102
+ });
103
+ } else {
104
+ next.push(node);
105
+ }
106
+ }
107
+ return {
108
+ resources: changed ? next : resourceList,
109
+ changed
110
+ };
111
+ }
112
+ function setResourceExpansionInTree(resourceList, resourceId, expanded) {
113
+ let changed = false;
114
+ const next = resourceList.map((node) => {
115
+ if (node.id === resourceId) {
116
+ changed = true;
117
+ return {
118
+ ...node,
119
+ metadata: {
120
+ ...node.metadata ?? {},
121
+ __schedulerExpanded: expanded
122
+ }
123
+ };
124
+ }
125
+ if (!node.children || node.children.length === 0) {
126
+ return node;
127
+ }
128
+ const childResult = setResourceExpansionInTree(node.children, resourceId, expanded);
129
+ if (!childResult.changed) {
130
+ return node;
131
+ }
132
+ changed = true;
133
+ return {
134
+ ...node,
135
+ children: childResult.resources
136
+ };
137
+ });
138
+ return {
139
+ resources: changed ? next : resourceList,
140
+ changed
141
+ };
142
+ }
143
+ function dedupeResourceIds(resourceIds) {
144
+ const seen = /* @__PURE__ */ new Set();
145
+ const deduped = [];
146
+ for (const resourceId of resourceIds) {
147
+ const key = String(resourceId);
148
+ if (seen.has(key)) {
149
+ continue;
150
+ }
151
+ seen.add(key);
152
+ deduped.push(resourceId);
153
+ }
154
+ return deduped;
155
+ }
156
+ function areResourceIdSetsEqual(left, right) {
157
+ if (left.length !== right.length) {
158
+ return false;
159
+ }
160
+ const leftKeys = dedupeResourceIds(left).map((id) => String(id)).sort();
161
+ const rightKeys = dedupeResourceIds(right).map((id) => String(id)).sort();
162
+ if (leftKeys.length !== rightKeys.length) {
163
+ return false;
164
+ }
165
+ for (let i = 0; i < leftKeys.length; i++) {
166
+ if (leftKeys[i] !== rightKeys[i]) {
167
+ return false;
168
+ }
169
+ }
170
+ return true;
171
+ }
172
+
173
+ // src/resource/resource.store.ts
174
+ function createResourceStore(initialResources = [], options = {}) {
175
+ const { initialExpanded = true } = options;
176
+ const resourceMap = /* @__PURE__ */ new Map();
177
+ const expandedIds = /* @__PURE__ */ new Set();
178
+ buildResourceMap(initialResources, resourceMap);
179
+ collectParentExpansionState(initialResources, expandedIds, initialExpanded);
180
+ const flattenedResources = flattenResources(initialResources, expandedIds, resourceMap);
181
+ return {
182
+ resources: initialResources,
183
+ flattenedResources,
184
+ expandedIds,
185
+ visibleResourceIds: new Set(flattenedResources.filter((r) => r.isVisible).map((r) => r.id)),
186
+ resourceMap
187
+ };
188
+ }
189
+ function buildResourceMap(resources, map, parentId) {
190
+ for (const resource of resources) {
191
+ const resourceWithParent = parentId !== void 0 ? { ...resource, parentId } : resource;
192
+ map.set(resource.id, resourceWithParent);
193
+ if (resource.children && resource.children.length > 0) {
194
+ buildResourceMap(resource.children, map, resource.id);
195
+ }
196
+ }
197
+ }
198
+ function getPersistedExpansion(resource) {
199
+ const persisted = resource.metadata?.__schedulerExpanded;
200
+ return typeof persisted === "boolean" ? persisted : void 0;
201
+ }
202
+ function collectParentExpansionState(resources, expandedIds, initialExpanded) {
203
+ for (const resource of resources) {
204
+ if (resource.children && resource.children.length > 0) {
205
+ const persisted = getPersistedExpansion(resource);
206
+ const shouldExpand = persisted ?? initialExpanded;
207
+ if (shouldExpand) {
208
+ expandedIds.add(resource.id);
209
+ }
210
+ collectParentExpansionState(resource.children, expandedIds, initialExpanded);
211
+ }
212
+ }
213
+ }
214
+ function collectAllParentIds(resources, expandedIds) {
215
+ for (const resource of resources) {
216
+ if (resource.children && resource.children.length > 0) {
217
+ expandedIds.add(resource.id);
218
+ collectAllParentIds(resource.children, expandedIds);
219
+ }
220
+ }
221
+ }
222
+ function flattenResources(resources, expandedIds, resourceMap, depth = 0, ancestorIds = [], parentExpanded = true) {
223
+ const result = [];
224
+ for (const resource of resources) {
225
+ const hasChildren = !!(resource.children && resource.children.length > 0);
226
+ const isExpanded = !hasChildren || expandedIds.has(resource.id);
227
+ const isVisible = parentExpanded;
228
+ result.push({
229
+ ...resource,
230
+ depth,
231
+ hasChildren,
232
+ isExpanded,
233
+ isVisible,
234
+ ancestorIds: [...ancestorIds]
235
+ });
236
+ if (hasChildren && resource.children) {
237
+ const childResources = flattenResources(resource.children, expandedIds, resourceMap, depth + 1, [...ancestorIds, resource.id], isVisible && isExpanded);
238
+ result.push(...childResources);
239
+ }
240
+ }
241
+ return result;
242
+ }
243
+ function addResource(state, resource, parentId) {
244
+ const newResources = [...state.resources];
245
+ if (parentId !== void 0) {
246
+ const parent = findResourceById(newResources, parentId);
247
+ if (parent) {
248
+ if (!parent.children) {
249
+ parent.children = [];
250
+ }
251
+ parent.children.push(resource);
252
+ }
253
+ } else {
254
+ newResources.push(resource);
255
+ }
256
+ const newMap = new Map(state.resourceMap);
257
+ newMap.set(resource.id, { ...resource, parentId });
258
+ const flattenedResources = flattenResources(newResources, state.expandedIds, newMap);
259
+ return {
260
+ ...state,
261
+ resources: newResources,
262
+ flattenedResources,
263
+ resourceMap: newMap,
264
+ visibleResourceIds: new Set(flattenedResources.filter((r) => r.isVisible).map((r) => r.id))
265
+ };
266
+ }
267
+ function updateResource(state, resourceId, updates) {
268
+ const newResources = updateResourceInTree2(state.resources, resourceId, updates);
269
+ const newMap = new Map(state.resourceMap);
270
+ const existing = newMap.get(resourceId);
271
+ if (existing) {
272
+ newMap.set(resourceId, { ...existing, ...updates });
273
+ }
274
+ const flattenedResources = flattenResources(newResources, state.expandedIds, newMap);
275
+ return {
276
+ ...state,
277
+ resources: newResources,
278
+ flattenedResources,
279
+ resourceMap: newMap,
280
+ visibleResourceIds: new Set(flattenedResources.filter((r) => r.isVisible).map((r) => r.id))
281
+ };
282
+ }
283
+ function updateResourceInTree2(resources, resourceId, updates) {
284
+ return resources.map((resource) => {
285
+ if (resource.id === resourceId) {
286
+ return { ...resource, ...updates };
287
+ }
288
+ if (resource.children && resource.children.length > 0) {
289
+ return {
290
+ ...resource,
291
+ children: updateResourceInTree2(resource.children, resourceId, updates)
292
+ };
293
+ }
294
+ return resource;
295
+ });
296
+ }
297
+ function removeResource(state, resourceId) {
298
+ const newResources = removeResourceFromTree2(state.resources, resourceId);
299
+ const newMap = new Map(state.resourceMap);
300
+ removeResourceFromMap(newMap, resourceId);
301
+ const newExpandedIds = new Set(state.expandedIds);
302
+ newExpandedIds.delete(resourceId);
303
+ const flattenedResources = flattenResources(newResources, newExpandedIds, newMap);
304
+ return {
305
+ ...state,
306
+ resources: newResources,
307
+ flattenedResources,
308
+ expandedIds: newExpandedIds,
309
+ resourceMap: newMap,
310
+ visibleResourceIds: new Set(flattenedResources.filter((r) => r.isVisible).map((r) => r.id))
311
+ };
312
+ }
313
+ function removeResourceFromTree2(resources, resourceId) {
314
+ return resources.filter((resource) => resource.id !== resourceId).map((resource) => {
315
+ if (resource.children && resource.children.length > 0) {
316
+ return {
317
+ ...resource,
318
+ children: removeResourceFromTree2(resource.children, resourceId)
319
+ };
320
+ }
321
+ return resource;
322
+ });
323
+ }
324
+ function removeResourceFromMap(map, resourceId) {
325
+ const resource = map.get(resourceId);
326
+ map.delete(resourceId);
327
+ if (resource?.children) {
328
+ for (const child of resource.children) {
329
+ removeResourceFromMap(map, child.id);
330
+ }
331
+ }
332
+ }
333
+ function expandResource(state, resourceId) {
334
+ if (state.expandedIds.has(resourceId)) {
335
+ return state;
336
+ }
337
+ const newExpandedIds = new Set(state.expandedIds);
338
+ newExpandedIds.add(resourceId);
339
+ const flattenedResources = flattenResources(state.resources, newExpandedIds, state.resourceMap);
340
+ return {
341
+ ...state,
342
+ expandedIds: newExpandedIds,
343
+ flattenedResources,
344
+ visibleResourceIds: new Set(flattenedResources.filter((r) => r.isVisible).map((r) => r.id))
345
+ };
346
+ }
347
+ function collapseResource(state, resourceId) {
348
+ if (!state.expandedIds.has(resourceId)) {
349
+ return state;
350
+ }
351
+ const newExpandedIds = new Set(state.expandedIds);
352
+ newExpandedIds.delete(resourceId);
353
+ const flattenedResources = flattenResources(state.resources, newExpandedIds, state.resourceMap);
354
+ return {
355
+ ...state,
356
+ expandedIds: newExpandedIds,
357
+ flattenedResources,
358
+ visibleResourceIds: new Set(flattenedResources.filter((r) => r.isVisible).map((r) => r.id))
359
+ };
360
+ }
361
+ function toggleResourceExpansion(state, resourceId) {
362
+ if (state.expandedIds.has(resourceId)) {
363
+ return collapseResource(state, resourceId);
364
+ }
365
+ return expandResource(state, resourceId);
366
+ }
367
+ function expandAllResources(state) {
368
+ const newExpandedIds = /* @__PURE__ */ new Set();
369
+ collectAllParentIds(state.resources, newExpandedIds);
370
+ const flattenedResources = flattenResources(state.resources, newExpandedIds, state.resourceMap);
371
+ return {
372
+ ...state,
373
+ expandedIds: newExpandedIds,
374
+ flattenedResources,
375
+ visibleResourceIds: new Set(flattenedResources.filter((r) => r.isVisible).map((r) => r.id))
376
+ };
377
+ }
378
+ function collapseAllResources(state) {
379
+ const newExpandedIds = /* @__PURE__ */ new Set();
380
+ const flattenedResources = flattenResources(state.resources, newExpandedIds, state.resourceMap);
381
+ return {
382
+ ...state,
383
+ expandedIds: newExpandedIds,
384
+ flattenedResources,
385
+ visibleResourceIds: new Set(flattenedResources.filter((r) => r.isVisible).map((r) => r.id))
386
+ };
387
+ }
388
+ function getResourceById(state, resourceId) {
389
+ return state.resourceMap.get(resourceId);
390
+ }
391
+ function getResourcesByIds(state, resourceIds) {
392
+ return resourceIds.map((id) => state.resourceMap.get(id)).filter((r) => r !== void 0);
393
+ }
394
+ function getVisibleResources(state) {
395
+ return state.flattenedResources.filter((r) => r.isVisible);
396
+ }
397
+ function getChildResources(state, parentId) {
398
+ const parent = state.resourceMap.get(parentId);
399
+ return parent?.children ?? [];
400
+ }
401
+ function getParentResource(state, resourceId) {
402
+ const resource = state.resourceMap.get(resourceId);
403
+ if (!resource?.parentId) {
404
+ return void 0;
405
+ }
406
+ return state.resourceMap.get(resource.parentId);
407
+ }
408
+ function getAncestorResources(state, resourceId) {
409
+ const ancestors = [];
410
+ let current = state.resourceMap.get(resourceId);
411
+ while (current?.parentId) {
412
+ const parent = state.resourceMap.get(current.parentId);
413
+ if (parent) {
414
+ ancestors.unshift(parent);
415
+ current = parent;
416
+ } else {
417
+ break;
418
+ }
419
+ }
420
+ return ancestors;
421
+ }
422
+ function findResourceById(resources, resourceId) {
423
+ for (const resource of resources) {
424
+ if (resource.id === resourceId) {
425
+ return resource;
426
+ }
427
+ if (resource.children) {
428
+ const found = findResourceById(resource.children, resourceId);
429
+ if (found) {
430
+ return found;
431
+ }
432
+ }
433
+ }
434
+ return void 0;
435
+ }
436
+ function getAllResourceIds(resources) {
437
+ const ids = [];
438
+ function collect(resources2) {
439
+ for (const resource of resources2) {
440
+ ids.push(resource.id);
441
+ if (resource.children) {
442
+ collect(resource.children);
443
+ }
444
+ }
445
+ }
446
+ collect(resources);
447
+ return ids;
448
+ }
449
+ function countResources(resources) {
450
+ let count = 0;
451
+ function countRecursive(resources2) {
452
+ for (const resource of resources2) {
453
+ count++;
454
+ if (resource.children) {
455
+ countRecursive(resource.children);
456
+ }
457
+ }
458
+ }
459
+ countRecursive(resources);
460
+ return count;
461
+ }
462
+ function getLeafResources(resources) {
463
+ const leaves = [];
464
+ function collect(resources2) {
465
+ for (const resource of resources2) {
466
+ if (resource.children && resource.children.length > 0) {
467
+ collect(resource.children);
468
+ } else {
469
+ leaves.push(resource);
470
+ }
471
+ }
472
+ }
473
+ collect(resources);
474
+ return leaves;
475
+ }
476
+ function getMaxDepth(resources, currentDepth = 0) {
477
+ let maxDepth = currentDepth;
478
+ for (const resource of resources) {
479
+ if (resource.children && resource.children.length > 0) {
480
+ const childMaxDepth = getMaxDepth(resource.children, currentDepth + 1);
481
+ maxDepth = Math.max(maxDepth, childMaxDepth);
482
+ }
483
+ }
484
+ return maxDepth;
485
+ }
486
+ function countLeafDescendants(resource) {
487
+ if (!resource.children || resource.children.length === 0) {
488
+ return 1;
489
+ }
490
+ let count = 0;
491
+ for (const child of resource.children) {
492
+ count += countLeafDescendants(child);
493
+ }
494
+ return count;
495
+ }
496
+ function getHierarchicalHeaderRows(resources) {
497
+ const maxDepth = getMaxDepth(resources);
498
+ const rows = [];
499
+ for (let depth = 0; depth <= maxDepth; depth++) {
500
+ rows.push({ depth, cells: [] });
501
+ }
502
+ function processResources(resources2, currentDepth) {
503
+ for (const resource of resources2) {
504
+ const hasChildren = !!(resource.children && resource.children.length > 0);
505
+ const colspan = countLeafDescendants(resource);
506
+ const isLeaf = !hasChildren;
507
+ rows[currentDepth].cells.push({
508
+ resource,
509
+ colspan,
510
+ depth: currentDepth,
511
+ isLeaf
512
+ });
513
+ if (hasChildren && resource.children) {
514
+ processResources(resource.children, currentDepth + 1);
515
+ } else if (currentDepth < maxDepth) {
516
+ for (let d = currentDepth + 1; d <= maxDepth; d++) {
517
+ rows[d].cells.push({
518
+ resource,
519
+ colspan: 1,
520
+ depth: d,
521
+ isLeaf: true
522
+ });
523
+ }
524
+ }
525
+ }
526
+ }
527
+ processResources(resources, 0);
528
+ return rows;
529
+ }
530
+ function groupResourcesByField(resources, fieldName) {
531
+ const groups = /* @__PURE__ */ new Map();
532
+ for (const resource of resources) {
533
+ const fieldValue = resource.metadata?.[fieldName] ?? resource[fieldName] ?? "Ungrouped";
534
+ if (!groups.has(fieldValue)) {
535
+ groups.set(fieldValue, []);
536
+ }
537
+ groups.get(fieldValue).push(resource);
538
+ }
539
+ const hierarchicalResources = [];
540
+ for (const [groupName, groupResources] of groups) {
541
+ hierarchicalResources.push({
542
+ id: `group-${groupName}`,
543
+ title: groupName,
544
+ children: groupResources
545
+ });
546
+ }
547
+ return hierarchicalResources;
548
+ }
549
+ function hasHierarchy(resources) {
550
+ return resources.some((r) => r.children && r.children.length > 0);
551
+ }
552
+
553
+ // src/resource/resource.grouping.ts
554
+ var DEFAULT_RESOURCE_AREA_WIDTH = 200;
555
+ var DEFAULT_RESOURCE_ROW_HEIGHT = 40;
556
+ var DEFAULT_RESOURCE_MIN_ROW_HEIGHT = 32;
557
+ function groupEventsByResource(events, state) {
558
+ const visibleResources = state.flattenedResources.filter((r) => r.isVisible);
559
+ const groups = [];
560
+ for (const resource of visibleResources) {
561
+ const resourceEvents = getEventsForResource(events, resource.id);
562
+ groups.push({
563
+ resource,
564
+ events: resourceEvents
565
+ });
566
+ }
567
+ return groups;
568
+ }
569
+ function groupEventsByDate(events, resources, dates) {
570
+ const groups = [];
571
+ for (const date of dates) {
572
+ const dateStr = formatDateKey(date);
573
+ const dateEvents = filterEventsByDate(events, date);
574
+ const resourceGroups = resources.map((resource) => ({
575
+ resource,
576
+ events: getEventsForResource(dateEvents, resource.id)
577
+ }));
578
+ groups.push({
579
+ date,
580
+ dateStr,
581
+ resources: resourceGroups
582
+ });
583
+ }
584
+ return groups;
585
+ }
586
+ function getEventsForResource(events, resourceId) {
587
+ return events.filter((event) => {
588
+ if (event.resourceId !== void 0) {
589
+ return event.resourceId === resourceId;
590
+ }
591
+ if (event.resourceIds && event.resourceIds.length > 0) {
592
+ return event.resourceIds.includes(resourceId);
593
+ }
594
+ return false;
595
+ });
596
+ }
597
+ function getEventsWithoutResource(events) {
598
+ return events.filter((event) => event.resourceId === void 0 && (!event.resourceIds || event.resourceIds.length === 0));
599
+ }
600
+ function getResourceIdsForEvent(event) {
601
+ if (event.resourceIds && event.resourceIds.length > 0) {
602
+ return event.resourceIds;
603
+ }
604
+ if (event.resourceId !== void 0) {
605
+ return [event.resourceId];
606
+ }
607
+ return [];
608
+ }
609
+ function assignEventToResource(event, resourceId) {
610
+ const newEvent = { ...event };
611
+ if (event.resourceIds && event.resourceIds.length > 1) {
612
+ newEvent.resourceIds = [...event.resourceIds.filter((id) => id !== resourceId), resourceId];
613
+ } else {
614
+ newEvent.resourceId = resourceId;
615
+ delete newEvent.resourceIds;
616
+ }
617
+ return newEvent;
618
+ }
619
+ function moveEventToResource(event, fromResourceId, toResourceId) {
620
+ const newEvent = { ...event };
621
+ if (event.resourceIds && event.resourceIds.length > 1) {
622
+ newEvent.resourceIds = event.resourceIds.map((id) => id === fromResourceId ? toResourceId : id);
623
+ } else {
624
+ newEvent.resourceId = toResourceId;
625
+ }
626
+ return newEvent;
627
+ }
628
+ function addResourceToEvent(event, resourceId) {
629
+ const currentIds = getResourceIdsForEvent(event);
630
+ if (currentIds.includes(resourceId)) {
631
+ return event;
632
+ }
633
+ return {
634
+ ...event,
635
+ resourceIds: [...currentIds, resourceId],
636
+ resourceId: void 0
637
+ };
638
+ }
639
+ function removeResourceFromEvent(event, resourceId) {
640
+ const currentIds = getResourceIdsForEvent(event);
641
+ const newIds = currentIds.filter((id) => id !== resourceId);
642
+ if (newIds.length === 0) {
643
+ const result = { ...event };
644
+ delete result.resourceId;
645
+ delete result.resourceIds;
646
+ return result;
647
+ }
648
+ if (newIds.length === 1) {
649
+ return {
650
+ ...event,
651
+ resourceId: newIds[0],
652
+ resourceIds: void 0
653
+ };
654
+ }
655
+ return {
656
+ ...event,
657
+ resourceIds: newIds,
658
+ resourceId: void 0
659
+ };
660
+ }
661
+ var LANE_HEIGHT = 24;
662
+ var LANE_GAP = 2;
663
+ var LANE_BASE_PADDING = 4;
664
+ function calculateResourceRowLayouts(visibleResources, rowHeight = DEFAULT_RESOURCE_ROW_HEIGHT, expandedRowHeights, laneCounts) {
665
+ const layouts = [];
666
+ let currentTop = 0;
667
+ for (let i = 0; i < visibleResources.length; i++) {
668
+ const resource = visibleResources[i];
669
+ const isGroup = Boolean(resource.hasChildren);
670
+ const laneCount = Math.max(1, laneCounts?.get(resource.id) ?? 1);
671
+ let height;
672
+ if (expandedRowHeights?.has(resource.id)) {
673
+ height = expandedRowHeights.get(resource.id);
674
+ } else if (isGroup) {
675
+ height = rowHeight;
676
+ } else {
677
+ const lanesHeight = LANE_BASE_PADDING * 2 + laneCount * (LANE_HEIGHT + LANE_GAP);
678
+ height = Math.max(rowHeight, lanesHeight);
679
+ }
680
+ layouts.push({
681
+ resource,
682
+ top: currentTop,
683
+ height,
684
+ rowIndex: i,
685
+ laneCount,
686
+ isGroup
687
+ });
688
+ currentTop += height;
689
+ }
690
+ return layouts;
691
+ }
692
+ function calculateResourceColumnLayouts(resources, totalWidth, minColumnWidth = 100) {
693
+ const layouts = [];
694
+ const columnWidth = Math.max(minColumnWidth, totalWidth / resources.length);
695
+ for (let i = 0; i < resources.length; i++) {
696
+ layouts.push({
697
+ resource: resources[i],
698
+ left: i * columnWidth,
699
+ width: columnWidth,
700
+ columnIndex: i
701
+ });
702
+ }
703
+ return layouts;
704
+ }
705
+ function getResourceAtPosition(layouts, y) {
706
+ for (const layout of layouts) {
707
+ if (y >= layout.top && y < layout.top + layout.height) {
708
+ return layout.resource;
709
+ }
710
+ }
711
+ return void 0;
712
+ }
713
+ function getResourceColumnAtPosition(layouts, x) {
714
+ for (const layout of layouts) {
715
+ if (x >= layout.left && x < layout.left + layout.width) {
716
+ return layout.resource;
717
+ }
718
+ }
719
+ return void 0;
720
+ }
721
+ function sortResources(resources, options) {
722
+ const { resourceOrder } = options;
723
+ if (!resourceOrder) {
724
+ return resources;
725
+ }
726
+ const sorted = [...resources];
727
+ if (typeof resourceOrder === "function") {
728
+ sorted.sort(resourceOrder);
729
+ } else if (resourceOrder === "asc") {
730
+ sorted.sort((a, b) => a.title.localeCompare(b.title));
731
+ } else if (resourceOrder === "desc") {
732
+ sorted.sort((a, b) => b.title.localeCompare(a.title));
733
+ }
734
+ return sorted.map((resource) => {
735
+ if (resource.children && resource.children.length > 0) {
736
+ return {
737
+ ...resource,
738
+ children: sortResources(resource.children, options)
739
+ };
740
+ }
741
+ return resource;
742
+ });
743
+ }
744
+ function getTotalResourceHeight(layouts) {
745
+ if (layouts.length === 0) {
746
+ return 0;
747
+ }
748
+ const lastLayout = layouts[layouts.length - 1];
749
+ return lastLayout.top + lastLayout.height;
750
+ }
751
+ function getResourceAreaWidth(options) {
752
+ if (typeof options.resourceAreaWidth === "number") {
753
+ return options.resourceAreaWidth;
754
+ }
755
+ if (typeof options.resourceAreaWidth === "string") {
756
+ const parsed = parseInt(options.resourceAreaWidth, 10);
757
+ return isNaN(parsed) ? DEFAULT_RESOURCE_AREA_WIDTH : parsed;
758
+ }
759
+ return DEFAULT_RESOURCE_AREA_WIDTH;
760
+ }
761
+ function getResourceLabel(resource, options) {
762
+ if (options?.resourceLabelContent) {
763
+ return options.resourceLabelContent(resource);
764
+ }
765
+ return resource.title;
766
+ }
767
+ function calculateExpandedRowHeight(eventCount, eventHeight = 24, eventGap = 4, minHeight = DEFAULT_RESOURCE_MIN_ROW_HEIGHT, padding = 8) {
768
+ if (eventCount === 0) {
769
+ return minHeight;
770
+ }
771
+ const contentHeight = eventCount * eventHeight + (eventCount - 1) * eventGap + padding * 2;
772
+ return Math.max(minHeight, contentHeight);
773
+ }
774
+ function formatDateKey(date) {
775
+ return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
776
+ }
777
+ function filterEventsByDate(events, date) {
778
+ const dayStart = new Date(date.getFullYear(), date.getMonth(), date.getDate());
779
+ const dayEnd = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59, 999);
780
+ return events.filter((event) => {
781
+ const eventStart = typeof event.start === "string" ? new Date(event.start) : event.start;
782
+ const eventEnd = event.end ? typeof event.end === "string" ? new Date(event.end) : event.end : eventStart;
783
+ return eventStart <= dayEnd && eventEnd >= dayStart;
784
+ });
785
+ }
786
+
787
+ // src/resource/resource.filtering.ts
788
+ function filterResources(state, query, options = { enabled: true, searchable: true }) {
789
+ if (!options.enabled || !query.trim()) {
790
+ return {
791
+ filteredResources: state.resources,
792
+ flattenedResources: state.flattenedResources,
793
+ matchingIds: new Set(state.resourceMap.keys()),
794
+ visibleIds: state.visibleResourceIds
795
+ };
796
+ }
797
+ const normalizedQuery = query.toLowerCase().trim();
798
+ const predicate = options.filterPredicate ?? defaultFilterPredicate;
799
+ const matchingIds = /* @__PURE__ */ new Set();
800
+ const parentIdsToShow = /* @__PURE__ */ new Set();
801
+ findMatchingResources(state.resources, normalizedQuery, predicate, matchingIds, parentIdsToShow);
802
+ const filteredResources = filterResourceTree(state.resources, matchingIds, parentIdsToShow);
803
+ const expandedIdsForFilter = new Set(state.expandedIds);
804
+ for (const id of parentIdsToShow) {
805
+ expandedIdsForFilter.add(id);
806
+ }
807
+ const flattenedResources = flattenResources(filteredResources, expandedIdsForFilter, state.resourceMap);
808
+ const visibleIds = new Set(flattenedResources.filter((r) => r.isVisible).map((r) => r.id));
809
+ return {
810
+ filteredResources,
811
+ flattenedResources,
812
+ matchingIds,
813
+ visibleIds
814
+ };
815
+ }
816
+ function defaultFilterPredicate(resource, query) {
817
+ return resource.title.toLowerCase().includes(query);
818
+ }
819
+ function findMatchingResources(resources, query, predicate, matchingIds, parentIdsToShow, ancestorIds = []) {
820
+ let hasMatchingDescendant = false;
821
+ for (const resource of resources) {
822
+ const isMatch = predicate(resource, query);
823
+ let childHasMatch = false;
824
+ if (resource.children && resource.children.length > 0) {
825
+ childHasMatch = findMatchingResources(resource.children, query, predicate, matchingIds, parentIdsToShow, [...ancestorIds, resource.id]);
826
+ }
827
+ if (isMatch || childHasMatch) {
828
+ matchingIds.add(resource.id);
829
+ for (const ancestorId of ancestorIds) {
830
+ parentIdsToShow.add(ancestorId);
831
+ }
832
+ hasMatchingDescendant = true;
833
+ }
834
+ }
835
+ return hasMatchingDescendant;
836
+ }
837
+ function filterResourceTree(resources, matchingIds, parentIdsToShow) {
838
+ return resources.filter((resource) => matchingIds.has(resource.id) || parentIdsToShow.has(resource.id)).map((resource) => {
839
+ if (resource.children && resource.children.length > 0) {
840
+ const filteredChildren = filterResourceTree(resource.children, matchingIds, parentIdsToShow);
841
+ if (filteredChildren.length > 0) {
842
+ return { ...resource, children: filteredChildren };
843
+ }
844
+ if (matchingIds.has(resource.id)) {
845
+ return { ...resource, children: [] };
846
+ }
847
+ return null;
848
+ }
849
+ return resource;
850
+ }).filter((r) => r !== null);
851
+ }
852
+ function searchResources(resources, query, predicate) {
853
+ if (!query.trim()) {
854
+ return [];
855
+ }
856
+ const normalizedQuery = query.toLowerCase().trim();
857
+ const searchPredicate = predicate ?? defaultFilterPredicate;
858
+ const results = [];
859
+ searchResourcesRecursive(resources, normalizedQuery, searchPredicate, results);
860
+ return results;
861
+ }
862
+ function searchResourcesRecursive(resources, query, predicate, results) {
863
+ for (const resource of resources) {
864
+ if (predicate(resource, query)) {
865
+ results.push(resource);
866
+ }
867
+ if (resource.children && resource.children.length > 0) {
868
+ searchResourcesRecursive(resource.children, query, predicate, results);
869
+ }
870
+ }
871
+ }
872
+ function createResourceFilter(options = {}) {
873
+ return {
874
+ enabled: options.enabled ?? true,
875
+ searchable: options.searchable ?? true,
876
+ placeholder: options.placeholder ?? "Search resources...",
877
+ filterPredicate: options.filterPredicate
878
+ };
879
+ }
880
+ function highlightMatch(text, query) {
881
+ if (!query.trim()) {
882
+ return [{ text, isMatch: false }];
883
+ }
884
+ const normalizedQuery = query.toLowerCase();
885
+ const normalizedText = text.toLowerCase();
886
+ const results = [];
887
+ let lastIndex = 0;
888
+ let index = normalizedText.indexOf(normalizedQuery);
889
+ while (index !== -1) {
890
+ if (index > lastIndex) {
891
+ results.push({
892
+ text: text.slice(lastIndex, index),
893
+ isMatch: false
894
+ });
895
+ }
896
+ results.push({
897
+ text: text.slice(index, index + query.length),
898
+ isMatch: true
899
+ });
900
+ lastIndex = index + query.length;
901
+ index = normalizedText.indexOf(normalizedQuery, lastIndex);
902
+ }
903
+ if (lastIndex < text.length) {
904
+ results.push({
905
+ text: text.slice(lastIndex),
906
+ isMatch: false
907
+ });
908
+ }
909
+ return results;
910
+ }
911
+ function getFilterStats(filterResult, totalCount) {
912
+ const matchCount = filterResult.matchingIds.size;
913
+ return {
914
+ matchCount,
915
+ totalCount,
916
+ percentage: totalCount > 0 ? Math.round(matchCount / totalCount * 100) : 0
917
+ };
918
+ }
919
+
920
+ // src/resource/resource-scale-policy.ts
921
+ var HORIZONTAL_RESOURCE_VIEWS = /* @__PURE__ */ new Set(["resourceDay", "resourceWeek", "resourceMonth"]);
922
+ function resolveScaleTier(leafCount) {
923
+ if (leafCount <= 5) return "small";
924
+ if (leafCount <= 15) return "medium";
925
+ if (leafCount <= 30) return "large";
926
+ return "xlarge";
927
+ }
928
+ function resolveResourceScalePolicy(input) {
929
+ const { view, resourceLeafCount, horizontalOverflowThreshold, adaptiveModeEnabled } = input;
930
+ const isHorizontalView = HORIZONTAL_RESOURCE_VIEWS.has(view);
931
+ const shouldForceHorizontalOverflow = isHorizontalView && resourceLeafCount > horizontalOverflowThreshold;
932
+ const shouldUseAdaptiveSingleResource = adaptiveModeEnabled && resourceLeafCount <= 1;
933
+ const scaleTier = resolveScaleTier(resourceLeafCount);
934
+ return {
935
+ shouldForceHorizontalOverflow,
936
+ shouldUseAdaptiveSingleResource,
937
+ scaleTier
938
+ };
939
+ }
940
+
941
+ // src/resource/resource-scale-strategy.ts
942
+ var HORIZONTAL_RESOURCE_VIEWS2 = /* @__PURE__ */ new Set(["resourceDay", "resourceWeek", "resourceMonth"]);
943
+ var MULTI_DAY_HORIZONTAL_VIEWS = /* @__PURE__ */ new Set(["resourceWeek"]);
944
+ var TIMELINE_VIEWS = /* @__PURE__ */ new Set(["resourceTimelineDay", "resourceTimelineWeek", "resourceTimelineMonth"]);
945
+ var DATE_GROUPED_VIEWS = /* @__PURE__ */ new Set(["dateDay", "dateWeek", "dateMonth"]);
946
+ function classifyView(view) {
947
+ if (HORIZONTAL_RESOURCE_VIEWS2.has(view)) return "resource-horizontal";
948
+ if (TIMELINE_VIEWS.has(view)) return "resource-timeline";
949
+ if (DATE_GROUPED_VIEWS.has(view)) return "date-grouped";
950
+ return "other";
951
+ }
952
+ var GROUP_MIN_WIDTH = {
953
+ small: 120,
954
+ medium: 100,
955
+ large: 80,
956
+ xlarge: 70
957
+ };
958
+ var DAY_MIN_WIDTH = {
959
+ small: 60,
960
+ medium: 56,
961
+ large: 48,
962
+ xlarge: 40
963
+ };
964
+ var COLUMN_MODE = {
965
+ small: "auto",
966
+ medium: "auto",
967
+ large: "minmax",
968
+ xlarge: "fixed"
969
+ };
970
+ var HIERARCHICAL_GROUP_MIN_WIDTH = 100;
971
+ function resolveResourceScaleStrategy(input) {
972
+ const { policy, view, isHierarchical, currentColumnMode } = input;
973
+ const { scaleTier, shouldForceHorizontalOverflow, shouldUseAdaptiveSingleResource } = policy;
974
+ const reasonCodes = [];
975
+ const viewCategory = classifyView(view);
976
+ const isHorizontal = viewCategory === "resource-horizontal";
977
+ const hasDayColumns = MULTI_DAY_HORIZONTAL_VIEWS.has(view);
978
+ reasonCodes.push(`tier-${scaleTier}`);
979
+ reasonCodes.push(`view-${viewCategory}`);
980
+ reasonCodes.push(isHierarchical ? "hierarchical" : "flat");
981
+ if (shouldForceHorizontalOverflow) reasonCodes.push("force-overflow");
982
+ if (shouldUseAdaptiveSingleResource) reasonCodes.push("adaptive-single");
983
+ if (!isHorizontal) {
984
+ return {
985
+ recommendedForceOverflow: shouldForceHorizontalOverflow,
986
+ recommendedAdaptiveSingle: shouldUseAdaptiveSingleResource,
987
+ recommendedGroupMinWidth: null,
988
+ recommendedDayMinWidth: null,
989
+ recommendedColumnMode: null,
990
+ reasonCodes
991
+ };
992
+ }
993
+ const isCompact = scaleTier === "large" || scaleTier === "xlarge";
994
+ let recommendedGroupMinWidth = GROUP_MIN_WIDTH[scaleTier];
995
+ const recommendedDayMinWidth = hasDayColumns ? DAY_MIN_WIDTH[scaleTier] : null;
996
+ const recommendedColumnMode = COLUMN_MODE[scaleTier];
997
+ if (isCompact) {
998
+ reasonCodes.push("group-min-width-compact");
999
+ if (hasDayColumns) reasonCodes.push("day-min-width-compact");
1000
+ }
1001
+ if (isHierarchical && recommendedGroupMinWidth < HIERARCHICAL_GROUP_MIN_WIDTH) {
1002
+ recommendedGroupMinWidth = HIERARCHICAL_GROUP_MIN_WIDTH;
1003
+ reasonCodes.push("group-min-width-hierarchical");
1004
+ } else if (isHierarchical) {
1005
+ reasonCodes.push("group-min-width-hierarchical");
1006
+ }
1007
+ if (currentColumnMode !== recommendedColumnMode) {
1008
+ reasonCodes.push("column-mode-mismatch");
1009
+ }
1010
+ return {
1011
+ recommendedForceOverflow: shouldForceHorizontalOverflow,
1012
+ recommendedAdaptiveSingle: shouldUseAdaptiveSingleResource,
1013
+ recommendedGroupMinWidth,
1014
+ recommendedDayMinWidth,
1015
+ recommendedColumnMode,
1016
+ reasonCodes
1017
+ };
1018
+ }
1019
+
1020
+ // src/resource/resource.adaptive.ts
1021
+ var DEFAULT_ADAPTIVE_BREAKPOINT = 768;
1022
+ var DEFAULT_SIDEBAR_WIDTH = 280;
1023
+ function createAdaptiveGroupingState() {
1024
+ return {
1025
+ isMobile: false,
1026
+ isSidebarOpen: false,
1027
+ selectedResourceId: null,
1028
+ selectionPath: []
1029
+ };
1030
+ }
1031
+ function detectMobileMode(viewportWidth, breakpoint = DEFAULT_ADAPTIVE_BREAKPOINT) {
1032
+ return viewportWidth < breakpoint;
1033
+ }
1034
+ function getAncestorIds(resourceMap, resourceId) {
1035
+ const ancestors = [];
1036
+ let current = resourceMap.get(resourceId);
1037
+ while (current?.parentId !== void 0) {
1038
+ ancestors.unshift(current.parentId);
1039
+ current = resourceMap.get(current.parentId);
1040
+ }
1041
+ return ancestors;
1042
+ }
1043
+ function selectResource(state, resourceMap, resourceId, closeSidebarOnSelect = true) {
1044
+ const resource = resourceMap.get(resourceId);
1045
+ if (!resource) return state;
1046
+ const ancestors = getAncestorIds(resourceMap, resourceId);
1047
+ const selectionPath = [...ancestors, resourceId];
1048
+ return {
1049
+ ...state,
1050
+ selectedResourceId: resourceId,
1051
+ selectionPath,
1052
+ isSidebarOpen: closeSidebarOnSelect ? false : state.isSidebarOpen
1053
+ };
1054
+ }
1055
+ function buildBreadcrumbPath(resourceMap, selectionPath) {
1056
+ return selectionPath.map((id, index) => {
1057
+ const resource = resourceMap.get(id);
1058
+ return {
1059
+ id,
1060
+ title: resource?.title ?? String(id),
1061
+ isRoot: index === 0
1062
+ };
1063
+ });
1064
+ }
1065
+ function toggleSidebar(state) {
1066
+ return {
1067
+ ...state,
1068
+ isSidebarOpen: !state.isSidebarOpen
1069
+ };
1070
+ }
1071
+ function openSidebar(state) {
1072
+ return {
1073
+ ...state,
1074
+ isSidebarOpen: true
1075
+ };
1076
+ }
1077
+ function closeSidebar(state) {
1078
+ return {
1079
+ ...state,
1080
+ isSidebarOpen: false
1081
+ };
1082
+ }
1083
+ function setMobileMode(state, isMobile) {
1084
+ return {
1085
+ ...state,
1086
+ isMobile,
1087
+ isSidebarOpen: isMobile ? state.isSidebarOpen : false
1088
+ };
1089
+ }
1090
+ function navigateBreadcrumb(state, resourceMap, targetId) {
1091
+ const targetIndex = state.selectionPath.indexOf(targetId);
1092
+ if (targetIndex === -1) return state;
1093
+ return selectResource(state, resourceMap, targetId, false);
1094
+ }
1095
+ function getFilteredEventsForResource(events, resourceId, descendantIds) {
1096
+ if (resourceId === null) return events;
1097
+ const matchIds = descendantIds ? /* @__PURE__ */ new Set([resourceId, ...descendantIds]) : /* @__PURE__ */ new Set([resourceId]);
1098
+ return events.filter((event) => {
1099
+ if (event.resourceId !== void 0 && matchIds.has(event.resourceId)) return true;
1100
+ if (Array.isArray(event.resourceIds) && event.resourceIds.some((id) => matchIds.has(id))) return true;
1101
+ return false;
1102
+ });
1103
+ }
1104
+ function clearResourceSelection(state) {
1105
+ return {
1106
+ ...state,
1107
+ selectedResourceId: null,
1108
+ selectionPath: []
1109
+ };
1110
+ }
1111
+ function getSelectedResource(resourceMap, resourceId) {
1112
+ if (resourceId === null) return null;
1113
+ return resourceMap.get(resourceId) ?? null;
1114
+ }
1115
+ function isResourceInPath(selectionPath, resourceId) {
1116
+ return selectionPath.includes(resourceId);
1117
+ }
1118
+ function getSelectionDepth(selectionPath) {
1119
+ return selectionPath.length;
1120
+ }
1121
+ var adaptiveClasses = {
1122
+ container: "p-scheduler-adaptive",
1123
+ mobile: "p-scheduler-adaptive-mobile",
1124
+ desktop: "p-scheduler-adaptive-desktop",
1125
+ sidebar: "p-scheduler-adaptive-sidebar",
1126
+ sidebarOpen: "p-scheduler-adaptive-sidebar-open",
1127
+ sidebarLeft: "p-scheduler-adaptive-sidebar-left",
1128
+ sidebarRight: "p-scheduler-adaptive-sidebar-right",
1129
+ sidebarOverlay: "p-scheduler-adaptive-sidebar-overlay",
1130
+ sidebarHeader: "p-scheduler-adaptive-sidebar-header",
1131
+ sidebarBody: "p-scheduler-adaptive-sidebar-body",
1132
+ sidebarClose: "p-scheduler-adaptive-sidebar-close",
1133
+ breadcrumb: "p-scheduler-adaptive-breadcrumb",
1134
+ breadcrumbList: "p-scheduler-adaptive-breadcrumb-list",
1135
+ breadcrumbItem: "p-scheduler-adaptive-breadcrumb-item",
1136
+ breadcrumbItemWrapper: "p-scheduler-adaptive-breadcrumb-item-wrapper",
1137
+ breadcrumbSeparator: "p-scheduler-adaptive-breadcrumb-separator",
1138
+ breadcrumbCurrent: "p-scheduler-adaptive-breadcrumb-current",
1139
+ menuButton: "p-scheduler-adaptive-menu-button",
1140
+ secondaryToolbar: "p-scheduler-adaptive-secondary-toolbar",
1141
+ resourceSelected: "p-scheduler-adaptive-resource-selected"
1142
+ };
1143
+
1144
+ export { DEFAULT_ADAPTIVE_BREAKPOINT, DEFAULT_RESOURCE_AREA_WIDTH, DEFAULT_RESOURCE_MIN_ROW_HEIGHT, DEFAULT_RESOURCE_ROW_HEIGHT, DEFAULT_SIDEBAR_WIDTH, adaptiveClasses, addResource, addResourceToEvent, addResourceToTree, areResourceIdSetsEqual, assignEventToResource, buildBreadcrumbPath, calculateExpandedRowHeight, calculateResourceColumnLayouts, calculateResourceRowLayouts, clearResourceSelection, closeSidebar, collapseAllResources, collapseResource, countLeafDescendants, countResources, createAdaptiveGroupingState, createResourceFilter, createResourceStore, dedupeResourceIds, detectMobileMode, expandAllResources, expandResource, filterResources, findResourceById, flattenResourceTree, flattenResources, getAllResourceIds, getAncestorIds, getAncestorResources, getChildResources, getEventsForResource, getEventsWithoutResource, getFilterStats, getFilteredEventsForResource, getHierarchicalHeaderRows, getLeafResources, getMaxDepth, getParentResource, getResourceAreaWidth, getResourceAtPosition, getResourceById, getResourceColumnAtPosition, getResourceIdsForEvent, getResourceLabel, getResourcesByIds, getSelectedResource, getSelectionDepth, getTotalResourceHeight, getVisibleResources, groupEventsByDate, groupEventsByResource, groupResourcesByField, hasHierarchy, highlightMatch, isResourceInPath, moveEventToResource, navigateBreadcrumb, openSidebar, removeResource, removeResourceFromEvent, removeResourceFromTree, resolveResourceScalePolicy, resolveResourceScaleStrategy, searchResources, selectResource, setMobileMode, setResourceExpansionInTree, sortResources, toggleResourceExpansion, toggleSidebar, updateResource, updateResourceInTree, upsertResourceById };