@vonage/vivid 3.0.1 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/calendar/index.js +1 -0
  2. package/custom-elements.json +6214 -0
  3. package/data-grid/index.js +1104 -0
  4. package/index.js +1 -0
  5. package/lib/data-grid/data-grid-cell.d.ts +5 -0
  6. package/lib/data-grid/data-grid-cell.template.d.ts +4 -0
  7. package/lib/data-grid/data-grid-row.d.ts +3 -0
  8. package/lib/data-grid/data-grid-row.template.d.ts +3 -0
  9. package/lib/data-grid/data-grid.d.ts +3 -0
  10. package/lib/data-grid/data-grid.options.d.ts +31 -0
  11. package/lib/data-grid/data-grid.template.d.ts +3 -0
  12. package/lib/data-grid/definition.d.ts +6 -0
  13. package/lib/data-grid/index.d.ts +1 -0
  14. package/lib/popup/definition.d.ts +0 -1
  15. package/lib/popup/popup.d.ts +2 -2
  16. package/number-field/index.js +1 -1
  17. package/package.json +28 -29
  18. package/shared/definition.js +1 -1
  19. package/shared/definition11.js +1 -1
  20. package/shared/definition12.js +3 -763
  21. package/shared/definition13.js +1 -1
  22. package/shared/definition14.js +1 -1
  23. package/shared/definition16.js +1 -1
  24. package/shared/definition17.js +1 -1
  25. package/shared/definition18.js +5 -316
  26. package/shared/definition19.js +1 -1
  27. package/shared/definition2.js +1 -1
  28. package/shared/definition20.js +1 -1
  29. package/shared/definition21.js +1 -1
  30. package/shared/definition22.js +1 -1
  31. package/shared/definition23.js +1 -1
  32. package/shared/definition25.js +1 -1
  33. package/shared/definition27.js +2 -2
  34. package/shared/definition29.js +1 -1
  35. package/shared/definition30.js +1 -1
  36. package/shared/definition31.js +1 -1
  37. package/shared/definition32.js +1 -1
  38. package/shared/definition33.js +1 -1
  39. package/shared/definition34.js +1 -1
  40. package/shared/definition35.js +2 -2
  41. package/shared/definition36.js +1 -1
  42. package/shared/definition37.js +1 -1
  43. package/shared/definition38.js +1 -1
  44. package/shared/definition39.js +1 -1
  45. package/shared/definition4.js +1 -1
  46. package/shared/definition40.js +1 -1
  47. package/shared/definition42.js +2 -2
  48. package/shared/definition43.js +1 -1
  49. package/shared/definition45.js +1 -1
  50. package/shared/definition5.js +1 -1
  51. package/shared/definition6.js +1 -1
  52. package/shared/definition7.js +1 -1
  53. package/shared/definition8.js +1 -1
  54. package/shared/definition9.js +1 -1
  55. package/shared/form-elements.js +1 -1
  56. package/shared/key-codes.js +4 -1
  57. package/shared/patterns/form-elements/form-elements.d.ts +2 -2
  58. package/shared/repeat.js +764 -0
  59. package/shared/slotted.js +1 -1
  60. package/shared/text-field.js +1 -1
  61. package/styles/core/all.css +1 -1
  62. package/styles/core/theme.css +1 -1
  63. package/styles/core/typography.css +1 -1
  64. package/styles/tokens/theme-dark.css +4 -4
  65. package/styles/tokens/theme-light.css +4 -4
  66. package/vivid.api.json +3695 -0
@@ -1,768 +1,8 @@
1
- import { e as emptyArray, O as Observable, X as SubscriberSet, W as DOM, Y as HTMLDirective, Z as HTMLView, F as FoundationElement, U as __classPrivateFieldGet, _ as __decorate, a as attr, b as __metadata, h as html, r as registerFactory } from './index.js';
1
+ import { F as FoundationElement, U as __classPrivateFieldGet, _ as __decorate, a as attr, b as __metadata, h as html, r as registerFactory } from './index.js';
2
2
  import { C as CalendarEvent } from './calendar-event.js';
3
3
  import './es.object.assign.js';
4
4
  import { b as _has, _ as _curry1, a as _curry2 } from './_has.js';
5
-
6
- /** @internal */
7
- function newSplice(index, removed, addedCount) {
8
- return {
9
- index: index,
10
- removed: removed,
11
- addedCount: addedCount,
12
- };
13
- }
14
- const EDIT_LEAVE = 0;
15
- const EDIT_UPDATE = 1;
16
- const EDIT_ADD = 2;
17
- const EDIT_DELETE = 3;
18
- // Note: This function is *based* on the computation of the Levenshtein
19
- // "edit" distance. The one change is that "updates" are treated as two
20
- // edits - not one. With Array splices, an update is really a delete
21
- // followed by an add. By retaining this, we optimize for "keeping" the
22
- // maximum array items in the original array. For example:
23
- //
24
- // 'xxxx123' -> '123yyyy'
25
- //
26
- // With 1-edit updates, the shortest path would be just to update all seven
27
- // characters. With 2-edit updates, we delete 4, leave 3, and add 4. This
28
- // leaves the substring '123' intact.
29
- function calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd) {
30
- // "Deletion" columns
31
- const rowCount = oldEnd - oldStart + 1;
32
- const columnCount = currentEnd - currentStart + 1;
33
- const distances = new Array(rowCount);
34
- let north;
35
- let west;
36
- // "Addition" rows. Initialize null column.
37
- for (let i = 0; i < rowCount; ++i) {
38
- distances[i] = new Array(columnCount);
39
- distances[i][0] = i;
40
- }
41
- // Initialize null row
42
- for (let j = 0; j < columnCount; ++j) {
43
- distances[0][j] = j;
44
- }
45
- for (let i = 1; i < rowCount; ++i) {
46
- for (let j = 1; j < columnCount; ++j) {
47
- if (current[currentStart + j - 1] === old[oldStart + i - 1]) {
48
- distances[i][j] = distances[i - 1][j - 1];
49
- }
50
- else {
51
- north = distances[i - 1][j] + 1;
52
- west = distances[i][j - 1] + 1;
53
- distances[i][j] = north < west ? north : west;
54
- }
55
- }
56
- }
57
- return distances;
58
- }
59
- // This starts at the final weight, and walks "backward" by finding
60
- // the minimum previous weight recursively until the origin of the weight
61
- // matrix.
62
- function spliceOperationsFromEditDistances(distances) {
63
- let i = distances.length - 1;
64
- let j = distances[0].length - 1;
65
- let current = distances[i][j];
66
- const edits = [];
67
- while (i > 0 || j > 0) {
68
- if (i === 0) {
69
- edits.push(EDIT_ADD);
70
- j--;
71
- continue;
72
- }
73
- if (j === 0) {
74
- edits.push(EDIT_DELETE);
75
- i--;
76
- continue;
77
- }
78
- const northWest = distances[i - 1][j - 1];
79
- const west = distances[i - 1][j];
80
- const north = distances[i][j - 1];
81
- let min;
82
- if (west < north) {
83
- min = west < northWest ? west : northWest;
84
- }
85
- else {
86
- min = north < northWest ? north : northWest;
87
- }
88
- if (min === northWest) {
89
- if (northWest === current) {
90
- edits.push(EDIT_LEAVE);
91
- }
92
- else {
93
- edits.push(EDIT_UPDATE);
94
- current = northWest;
95
- }
96
- i--;
97
- j--;
98
- }
99
- else if (min === west) {
100
- edits.push(EDIT_DELETE);
101
- i--;
102
- current = west;
103
- }
104
- else {
105
- edits.push(EDIT_ADD);
106
- j--;
107
- current = north;
108
- }
109
- }
110
- edits.reverse();
111
- return edits;
112
- }
113
- function sharedPrefix(current, old, searchLength) {
114
- for (let i = 0; i < searchLength; ++i) {
115
- if (current[i] !== old[i]) {
116
- return i;
117
- }
118
- }
119
- return searchLength;
120
- }
121
- function sharedSuffix(current, old, searchLength) {
122
- let index1 = current.length;
123
- let index2 = old.length;
124
- let count = 0;
125
- while (count < searchLength && current[--index1] === old[--index2]) {
126
- count++;
127
- }
128
- return count;
129
- }
130
- function intersect(start1, end1, start2, end2) {
131
- // Disjoint
132
- if (end1 < start2 || end2 < start1) {
133
- return -1;
134
- }
135
- // Adjacent
136
- if (end1 === start2 || end2 === start1) {
137
- return 0;
138
- }
139
- // Non-zero intersect, span1 first
140
- if (start1 < start2) {
141
- if (end1 < end2) {
142
- return end1 - start2; // Overlap
143
- }
144
- return end2 - start2; // Contained
145
- }
146
- // Non-zero intersect, span2 first
147
- if (end2 < end1) {
148
- return end2 - start1; // Overlap
149
- }
150
- return end1 - start1; // Contained
151
- }
152
- /**
153
- * Splice Projection functions:
154
- *
155
- * A splice map is a representation of how a previous array of items
156
- * was transformed into a new array of items. Conceptually it is a list of
157
- * tuples of
158
- *
159
- * <index, removed, addedCount>
160
- *
161
- * which are kept in ascending index order of. The tuple represents that at
162
- * the |index|, |removed| sequence of items were removed, and counting forward
163
- * from |index|, |addedCount| items were added.
164
- */
165
- /**
166
- * @internal
167
- * @remarks
168
- * Lacking individual splice mutation information, the minimal set of
169
- * splices can be synthesized given the previous state and final state of an
170
- * array. The basic approach is to calculate the edit distance matrix and
171
- * choose the shortest path through it.
172
- *
173
- * Complexity: O(l * p)
174
- * l: The length of the current array
175
- * p: The length of the old array
176
- */
177
- function calcSplices(current, currentStart, currentEnd, old, oldStart, oldEnd) {
178
- let prefixCount = 0;
179
- let suffixCount = 0;
180
- const minLength = Math.min(currentEnd - currentStart, oldEnd - oldStart);
181
- if (currentStart === 0 && oldStart === 0) {
182
- prefixCount = sharedPrefix(current, old, minLength);
183
- }
184
- if (currentEnd === current.length && oldEnd === old.length) {
185
- suffixCount = sharedSuffix(current, old, minLength - prefixCount);
186
- }
187
- currentStart += prefixCount;
188
- oldStart += prefixCount;
189
- currentEnd -= suffixCount;
190
- oldEnd -= suffixCount;
191
- if (currentEnd - currentStart === 0 && oldEnd - oldStart === 0) {
192
- return emptyArray;
193
- }
194
- if (currentStart === currentEnd) {
195
- const splice = newSplice(currentStart, [], 0);
196
- while (oldStart < oldEnd) {
197
- splice.removed.push(old[oldStart++]);
198
- }
199
- return [splice];
200
- }
201
- else if (oldStart === oldEnd) {
202
- return [newSplice(currentStart, [], currentEnd - currentStart)];
203
- }
204
- const ops = spliceOperationsFromEditDistances(calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd));
205
- const splices = [];
206
- let splice = void 0;
207
- let index = currentStart;
208
- let oldIndex = oldStart;
209
- for (let i = 0; i < ops.length; ++i) {
210
- switch (ops[i]) {
211
- case EDIT_LEAVE:
212
- if (splice !== void 0) {
213
- splices.push(splice);
214
- splice = void 0;
215
- }
216
- index++;
217
- oldIndex++;
218
- break;
219
- case EDIT_UPDATE:
220
- if (splice === void 0) {
221
- splice = newSplice(index, [], 0);
222
- }
223
- splice.addedCount++;
224
- index++;
225
- splice.removed.push(old[oldIndex]);
226
- oldIndex++;
227
- break;
228
- case EDIT_ADD:
229
- if (splice === void 0) {
230
- splice = newSplice(index, [], 0);
231
- }
232
- splice.addedCount++;
233
- index++;
234
- break;
235
- case EDIT_DELETE:
236
- if (splice === void 0) {
237
- splice = newSplice(index, [], 0);
238
- }
239
- splice.removed.push(old[oldIndex]);
240
- oldIndex++;
241
- break;
242
- // no default
243
- }
244
- }
245
- if (splice !== void 0) {
246
- splices.push(splice);
247
- }
248
- return splices;
249
- }
250
- const $push = Array.prototype.push;
251
- function mergeSplice(splices, index, removed, addedCount) {
252
- const splice = newSplice(index, removed, addedCount);
253
- let inserted = false;
254
- let insertionOffset = 0;
255
- for (let i = 0; i < splices.length; i++) {
256
- const current = splices[i];
257
- current.index += insertionOffset;
258
- if (inserted) {
259
- continue;
260
- }
261
- const intersectCount = intersect(splice.index, splice.index + splice.removed.length, current.index, current.index + current.addedCount);
262
- if (intersectCount >= 0) {
263
- // Merge the two splices
264
- splices.splice(i, 1);
265
- i--;
266
- insertionOffset -= current.addedCount - current.removed.length;
267
- splice.addedCount += current.addedCount - intersectCount;
268
- const deleteCount = splice.removed.length + current.removed.length - intersectCount;
269
- if (!splice.addedCount && !deleteCount) {
270
- // merged splice is a noop. discard.
271
- inserted = true;
272
- }
273
- else {
274
- let currentRemoved = current.removed;
275
- if (splice.index < current.index) {
276
- // some prefix of splice.removed is prepended to current.removed.
277
- const prepend = splice.removed.slice(0, current.index - splice.index);
278
- $push.apply(prepend, currentRemoved);
279
- currentRemoved = prepend;
280
- }
281
- if (splice.index + splice.removed.length >
282
- current.index + current.addedCount) {
283
- // some suffix of splice.removed is appended to current.removed.
284
- const append = splice.removed.slice(current.index + current.addedCount - splice.index);
285
- $push.apply(currentRemoved, append);
286
- }
287
- splice.removed = currentRemoved;
288
- if (current.index < splice.index) {
289
- splice.index = current.index;
290
- }
291
- }
292
- }
293
- else if (splice.index < current.index) {
294
- // Insert splice here.
295
- inserted = true;
296
- splices.splice(i, 0, splice);
297
- i++;
298
- const offset = splice.addedCount - splice.removed.length;
299
- current.index += offset;
300
- insertionOffset += offset;
301
- }
302
- }
303
- if (!inserted) {
304
- splices.push(splice);
305
- }
306
- }
307
- function createInitialSplices(changeRecords) {
308
- const splices = [];
309
- for (let i = 0, ii = changeRecords.length; i < ii; i++) {
310
- const record = changeRecords[i];
311
- mergeSplice(splices, record.index, record.removed, record.addedCount);
312
- }
313
- return splices;
314
- }
315
- /** @internal */
316
- function projectArraySplices(array, changeRecords) {
317
- let splices = [];
318
- const initialSplices = createInitialSplices(changeRecords);
319
- for (let i = 0, ii = initialSplices.length; i < ii; ++i) {
320
- const splice = initialSplices[i];
321
- if (splice.addedCount === 1 && splice.removed.length === 1) {
322
- if (splice.removed[0] !== array[splice.index]) {
323
- splices.push(splice);
324
- }
325
- continue;
326
- }
327
- splices = splices.concat(calcSplices(array, splice.index, splice.index + splice.addedCount, splice.removed, 0, splice.removed.length));
328
- }
329
- return splices;
330
- }
331
-
332
- let arrayObservationEnabled = false;
333
- function adjustIndex(changeRecord, array) {
334
- let index = changeRecord.index;
335
- const arrayLength = array.length;
336
- if (index > arrayLength) {
337
- index = arrayLength - changeRecord.addedCount;
338
- }
339
- else if (index < 0) {
340
- index =
341
- arrayLength + changeRecord.removed.length + index - changeRecord.addedCount;
342
- }
343
- if (index < 0) {
344
- index = 0;
345
- }
346
- changeRecord.index = index;
347
- return changeRecord;
348
- }
349
- class ArrayObserver extends SubscriberSet {
350
- constructor(source) {
351
- super(source);
352
- this.oldCollection = void 0;
353
- this.splices = void 0;
354
- this.needsQueue = true;
355
- this.call = this.flush;
356
- Reflect.defineProperty(source, "$fastController", {
357
- value: this,
358
- enumerable: false,
359
- });
360
- }
361
- subscribe(subscriber) {
362
- this.flush();
363
- super.subscribe(subscriber);
364
- }
365
- addSplice(splice) {
366
- if (this.splices === void 0) {
367
- this.splices = [splice];
368
- }
369
- else {
370
- this.splices.push(splice);
371
- }
372
- if (this.needsQueue) {
373
- this.needsQueue = false;
374
- DOM.queueUpdate(this);
375
- }
376
- }
377
- reset(oldCollection) {
378
- this.oldCollection = oldCollection;
379
- if (this.needsQueue) {
380
- this.needsQueue = false;
381
- DOM.queueUpdate(this);
382
- }
383
- }
384
- flush() {
385
- const splices = this.splices;
386
- const oldCollection = this.oldCollection;
387
- if (splices === void 0 && oldCollection === void 0) {
388
- return;
389
- }
390
- this.needsQueue = true;
391
- this.splices = void 0;
392
- this.oldCollection = void 0;
393
- const finalSplices = oldCollection === void 0
394
- ? projectArraySplices(this.source, splices)
395
- : calcSplices(this.source, 0, this.source.length, oldCollection, 0, oldCollection.length);
396
- this.notify(finalSplices);
397
- }
398
- }
399
- /* eslint-disable prefer-rest-params */
400
- /* eslint-disable @typescript-eslint/explicit-function-return-type */
401
- /**
402
- * Enables the array observation mechanism.
403
- * @remarks
404
- * Array observation is enabled automatically when using the
405
- * {@link RepeatDirective}, so calling this API manually is
406
- * not typically necessary.
407
- * @public
408
- */
409
- function enableArrayObservation() {
410
- if (arrayObservationEnabled) {
411
- return;
412
- }
413
- arrayObservationEnabled = true;
414
- Observable.setArrayObserverFactory((collection) => {
415
- return new ArrayObserver(collection);
416
- });
417
- const proto = Array.prototype;
418
- // Don't patch Array if it has already been patched
419
- // by another copy of fast-element.
420
- if (proto.$fastPatch) {
421
- return;
422
- }
423
- Reflect.defineProperty(proto, "$fastPatch", {
424
- value: 1,
425
- enumerable: false,
426
- });
427
- const pop = proto.pop;
428
- const push = proto.push;
429
- const reverse = proto.reverse;
430
- const shift = proto.shift;
431
- const sort = proto.sort;
432
- const splice = proto.splice;
433
- const unshift = proto.unshift;
434
- proto.pop = function () {
435
- const notEmpty = this.length > 0;
436
- const methodCallResult = pop.apply(this, arguments);
437
- const o = this.$fastController;
438
- if (o !== void 0 && notEmpty) {
439
- o.addSplice(newSplice(this.length, [methodCallResult], 0));
440
- }
441
- return methodCallResult;
442
- };
443
- proto.push = function () {
444
- const methodCallResult = push.apply(this, arguments);
445
- const o = this.$fastController;
446
- if (o !== void 0) {
447
- o.addSplice(adjustIndex(newSplice(this.length - arguments.length, [], arguments.length), this));
448
- }
449
- return methodCallResult;
450
- };
451
- proto.reverse = function () {
452
- let oldArray;
453
- const o = this.$fastController;
454
- if (o !== void 0) {
455
- o.flush();
456
- oldArray = this.slice();
457
- }
458
- const methodCallResult = reverse.apply(this, arguments);
459
- if (o !== void 0) {
460
- o.reset(oldArray);
461
- }
462
- return methodCallResult;
463
- };
464
- proto.shift = function () {
465
- const notEmpty = this.length > 0;
466
- const methodCallResult = shift.apply(this, arguments);
467
- const o = this.$fastController;
468
- if (o !== void 0 && notEmpty) {
469
- o.addSplice(newSplice(0, [methodCallResult], 0));
470
- }
471
- return methodCallResult;
472
- };
473
- proto.sort = function () {
474
- let oldArray;
475
- const o = this.$fastController;
476
- if (o !== void 0) {
477
- o.flush();
478
- oldArray = this.slice();
479
- }
480
- const methodCallResult = sort.apply(this, arguments);
481
- if (o !== void 0) {
482
- o.reset(oldArray);
483
- }
484
- return methodCallResult;
485
- };
486
- proto.splice = function () {
487
- const methodCallResult = splice.apply(this, arguments);
488
- const o = this.$fastController;
489
- if (o !== void 0) {
490
- o.addSplice(adjustIndex(newSplice(+arguments[0], methodCallResult, arguments.length > 2 ? arguments.length - 2 : 0), this));
491
- }
492
- return methodCallResult;
493
- };
494
- proto.unshift = function () {
495
- const methodCallResult = unshift.apply(this, arguments);
496
- const o = this.$fastController;
497
- if (o !== void 0) {
498
- o.addSplice(adjustIndex(newSplice(0, [], arguments.length), this));
499
- }
500
- return methodCallResult;
501
- };
502
- }
503
- /* eslint-enable prefer-rest-params */
504
- /* eslint-enable @typescript-eslint/explicit-function-return-type */
505
-
506
- const defaultRepeatOptions = Object.freeze({
507
- positioning: false,
508
- recycle: true,
509
- });
510
- function bindWithoutPositioning(view, items, index, context) {
511
- view.bind(items[index], context);
512
- }
513
- function bindWithPositioning(view, items, index, context) {
514
- const childContext = Object.create(context);
515
- childContext.index = index;
516
- childContext.length = items.length;
517
- view.bind(items[index], childContext);
518
- }
519
- /**
520
- * A behavior that renders a template for each item in an array.
521
- * @public
522
- */
523
- class RepeatBehavior {
524
- /**
525
- * Creates an instance of RepeatBehavior.
526
- * @param location - The location in the DOM to render the repeat.
527
- * @param itemsBinding - The array to render.
528
- * @param isItemsBindingVolatile - Indicates whether the items binding has volatile dependencies.
529
- * @param templateBinding - The template to render for each item.
530
- * @param isTemplateBindingVolatile - Indicates whether the template binding has volatile dependencies.
531
- * @param options - Options used to turn on special repeat features.
532
- */
533
- constructor(location, itemsBinding, isItemsBindingVolatile, templateBinding, isTemplateBindingVolatile, options) {
534
- this.location = location;
535
- this.itemsBinding = itemsBinding;
536
- this.templateBinding = templateBinding;
537
- this.options = options;
538
- this.source = null;
539
- this.views = [];
540
- this.items = null;
541
- this.itemsObserver = null;
542
- this.originalContext = void 0;
543
- this.childContext = void 0;
544
- this.bindView = bindWithoutPositioning;
545
- this.itemsBindingObserver = Observable.binding(itemsBinding, this, isItemsBindingVolatile);
546
- this.templateBindingObserver = Observable.binding(templateBinding, this, isTemplateBindingVolatile);
547
- if (options.positioning) {
548
- this.bindView = bindWithPositioning;
549
- }
550
- }
551
- /**
552
- * Bind this behavior to the source.
553
- * @param source - The source to bind to.
554
- * @param context - The execution context that the binding is operating within.
555
- */
556
- bind(source, context) {
557
- this.source = source;
558
- this.originalContext = context;
559
- this.childContext = Object.create(context);
560
- this.childContext.parent = source;
561
- this.childContext.parentContext = this.originalContext;
562
- this.items = this.itemsBindingObserver.observe(source, this.originalContext);
563
- this.template = this.templateBindingObserver.observe(source, this.originalContext);
564
- this.observeItems(true);
565
- this.refreshAllViews();
566
- }
567
- /**
568
- * Unbinds this behavior from the source.
569
- * @param source - The source to unbind from.
570
- */
571
- unbind() {
572
- this.source = null;
573
- this.items = null;
574
- if (this.itemsObserver !== null) {
575
- this.itemsObserver.unsubscribe(this);
576
- }
577
- this.unbindAllViews();
578
- this.itemsBindingObserver.disconnect();
579
- this.templateBindingObserver.disconnect();
580
- }
581
- /** @internal */
582
- handleChange(source, args) {
583
- if (source === this.itemsBinding) {
584
- this.items = this.itemsBindingObserver.observe(this.source, this.originalContext);
585
- this.observeItems();
586
- this.refreshAllViews();
587
- }
588
- else if (source === this.templateBinding) {
589
- this.template = this.templateBindingObserver.observe(this.source, this.originalContext);
590
- this.refreshAllViews(true);
591
- }
592
- else {
593
- this.updateViews(args);
594
- }
595
- }
596
- observeItems(force = false) {
597
- if (!this.items) {
598
- this.items = emptyArray;
599
- return;
600
- }
601
- const oldObserver = this.itemsObserver;
602
- const newObserver = (this.itemsObserver = Observable.getNotifier(this.items));
603
- const hasNewObserver = oldObserver !== newObserver;
604
- if (hasNewObserver && oldObserver !== null) {
605
- oldObserver.unsubscribe(this);
606
- }
607
- if (hasNewObserver || force) {
608
- newObserver.subscribe(this);
609
- }
610
- }
611
- updateViews(splices) {
612
- const childContext = this.childContext;
613
- const views = this.views;
614
- const bindView = this.bindView;
615
- const items = this.items;
616
- const template = this.template;
617
- const recycle = this.options.recycle;
618
- const leftoverViews = [];
619
- let leftoverIndex = 0;
620
- let availableViews = 0;
621
- for (let i = 0, ii = splices.length; i < ii; ++i) {
622
- const splice = splices[i];
623
- const removed = splice.removed;
624
- let removeIndex = 0;
625
- let addIndex = splice.index;
626
- const end = addIndex + splice.addedCount;
627
- const removedViews = views.splice(splice.index, removed.length);
628
- const totalAvailableViews = (availableViews =
629
- leftoverViews.length + removedViews.length);
630
- for (; addIndex < end; ++addIndex) {
631
- const neighbor = views[addIndex];
632
- const location = neighbor ? neighbor.firstChild : this.location;
633
- let view;
634
- if (recycle && availableViews > 0) {
635
- if (removeIndex <= totalAvailableViews && removedViews.length > 0) {
636
- view = removedViews[removeIndex];
637
- removeIndex++;
638
- }
639
- else {
640
- view = leftoverViews[leftoverIndex];
641
- leftoverIndex++;
642
- }
643
- availableViews--;
644
- }
645
- else {
646
- view = template.create();
647
- }
648
- views.splice(addIndex, 0, view);
649
- bindView(view, items, addIndex, childContext);
650
- view.insertBefore(location);
651
- }
652
- if (removedViews[removeIndex]) {
653
- leftoverViews.push(...removedViews.slice(removeIndex));
654
- }
655
- }
656
- for (let i = leftoverIndex, ii = leftoverViews.length; i < ii; ++i) {
657
- leftoverViews[i].dispose();
658
- }
659
- if (this.options.positioning) {
660
- for (let i = 0, ii = views.length; i < ii; ++i) {
661
- const currentContext = views[i].context;
662
- currentContext.length = ii;
663
- currentContext.index = i;
664
- }
665
- }
666
- }
667
- refreshAllViews(templateChanged = false) {
668
- const items = this.items;
669
- const childContext = this.childContext;
670
- const template = this.template;
671
- const location = this.location;
672
- const bindView = this.bindView;
673
- let itemsLength = items.length;
674
- let views = this.views;
675
- let viewsLength = views.length;
676
- if (itemsLength === 0 || templateChanged || !this.options.recycle) {
677
- // all views need to be removed
678
- HTMLView.disposeContiguousBatch(views);
679
- viewsLength = 0;
680
- }
681
- if (viewsLength === 0) {
682
- // all views need to be created
683
- this.views = views = new Array(itemsLength);
684
- for (let i = 0; i < itemsLength; ++i) {
685
- const view = template.create();
686
- bindView(view, items, i, childContext);
687
- views[i] = view;
688
- view.insertBefore(location);
689
- }
690
- }
691
- else {
692
- // attempt to reuse existing views with new data
693
- let i = 0;
694
- for (; i < itemsLength; ++i) {
695
- if (i < viewsLength) {
696
- const view = views[i];
697
- bindView(view, items, i, childContext);
698
- }
699
- else {
700
- const view = template.create();
701
- bindView(view, items, i, childContext);
702
- views.push(view);
703
- view.insertBefore(location);
704
- }
705
- }
706
- const removed = views.splice(i, viewsLength - i);
707
- for (i = 0, itemsLength = removed.length; i < itemsLength; ++i) {
708
- removed[i].dispose();
709
- }
710
- }
711
- }
712
- unbindAllViews() {
713
- const views = this.views;
714
- for (let i = 0, ii = views.length; i < ii; ++i) {
715
- views[i].unbind();
716
- }
717
- }
718
- }
719
- /**
720
- * A directive that configures list rendering.
721
- * @public
722
- */
723
- class RepeatDirective extends HTMLDirective {
724
- /**
725
- * Creates an instance of RepeatDirective.
726
- * @param itemsBinding - The binding that provides the array to render.
727
- * @param templateBinding - The template binding used to obtain a template to render for each item in the array.
728
- * @param options - Options used to turn on special repeat features.
729
- */
730
- constructor(itemsBinding, templateBinding, options) {
731
- super();
732
- this.itemsBinding = itemsBinding;
733
- this.templateBinding = templateBinding;
734
- this.options = options;
735
- /**
736
- * Creates a placeholder string based on the directive's index within the template.
737
- * @param index - The index of the directive within the template.
738
- */
739
- this.createPlaceholder = DOM.createBlockPlaceholder;
740
- enableArrayObservation();
741
- this.isItemsBindingVolatile = Observable.isVolatileBinding(itemsBinding);
742
- this.isTemplateBindingVolatile = Observable.isVolatileBinding(templateBinding);
743
- }
744
- /**
745
- * Creates a behavior for the provided target node.
746
- * @param target - The node instance to create the behavior for.
747
- */
748
- createBehavior(target) {
749
- return new RepeatBehavior(target, this.itemsBinding, this.isItemsBindingVolatile, this.templateBinding, this.isTemplateBindingVolatile, this.options);
750
- }
751
- }
752
- /**
753
- * A directive that enables list rendering.
754
- * @param itemsBinding - The array to render.
755
- * @param templateOrTemplateBinding - The template or a template binding used obtain a template
756
- * to render for each item in the array.
757
- * @param options - Options used to turn on special repeat features.
758
- * @public
759
- */
760
- function repeat(itemsBinding, templateOrTemplateBinding, options = defaultRepeatOptions) {
761
- const templateBinding = typeof templateOrTemplateBinding === "function"
762
- ? templateOrTemplateBinding
763
- : () => templateOrTemplateBinding;
764
- return new RepeatDirective(itemsBinding, templateBinding, Object.assign(Object.assign({}, defaultRepeatOptions), options));
765
- }
5
+ import { r as repeat } from './repeat.js';
766
6
 
767
7
  /**
768
8
  * Tests whether or not an object is an array.
@@ -1257,7 +497,7 @@ _curry1(function isEmpty(x) {
1257
497
 
1258
498
  var isEmpty$1 = isEmpty;
1259
499
 
1260
- var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 30 Jan 2023 11:28:31 GMT\n */\nol {\n padding: 0;\n margin: 0;\n list-style: none;\n}\n\n[role=grid i] {\n position: relative;\n z-index: 0;\n display: grid;\n margin: auto;\n grid-template-areas: \". column-headers\" \"row-headers calendar\";\n grid-template-columns: min-content auto;\n inline-size: max(100%, 500px);\n min-inline-size: 880px;\n}\n\n.row-headers {\n display: grid;\n grid-area: row-headers;\n grid-template-rows: repeat(24, 1fr);\n margin-inline-end: 2px;\n}\n.row-headers > [role=rowheader i] {\n display: flex;\n align-items: flex-end;\n justify-content: flex-end;\n}\n.row-headers > [role=rowheader i] > time {\n font: var(--vvd-typography-base-condensed);\n font-size: small;\n line-height: 1;\n text-transform: uppercase;\n white-space: nowrap;\n}\n\n.calendar-row {\n display: contents;\n}\n\n.calendar-grid-presentation {\n display: grid;\n overflow: hidden;\n background: var(--vvd-color-surface-2dp);\n border-radius: 6px;\n counter-reset: listing;\n filter: var(--vvd-shadow-surface-2dp);\n gap: 1px;\n grid-area: calendar;\n grid-auto-flow: column;\n grid-template: repeat(24, 1fr)/repeat(7, 1fr);\n}\n\n.hours {\n display: contents;\n}\n.hours > [role=listitem i] {\n position: relative;\n grid-column: 1/8;\n grid-row: var(--row);\n min-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 8));\n pointer-events: none;\n}\n.hours > [role=listitem i]:not(:first-child)::after {\n position: absolute;\n border-block-end: var(--vvd-color-neutral-100) 1px solid;\n content: \"\";\n inline-size: 100%;\n margin-block-start: -1px;\n}\n.hours > [role=listitem i]:nth-child(24n+1) {\n --row: 1;\n}\n.hours > [role=listitem i]:nth-child(24n+2) {\n --row: 2;\n}\n.hours > [role=listitem i]:nth-child(24n+3) {\n --row: 3;\n}\n.hours > [role=listitem i]:nth-child(24n+4) {\n --row: 4;\n}\n.hours > [role=listitem i]:nth-child(24n+5) {\n --row: 5;\n}\n.hours > [role=listitem i]:nth-child(24n+6) {\n --row: 6;\n}\n.hours > [role=listitem i]:nth-child(24n+7) {\n --row: 7;\n}\n.hours > [role=listitem i]:nth-child(24n+8) {\n --row: 8;\n}\n.hours > [role=listitem i]:nth-child(24n+9) {\n --row: 9;\n}\n.hours > [role=listitem i]:nth-child(24n+10) {\n --row: 10;\n}\n.hours > [role=listitem i]:nth-child(24n+11) {\n --row: 11;\n}\n.hours > [role=listitem i]:nth-child(24n+12) {\n --row: 12;\n}\n.hours > [role=listitem i]:nth-child(24n+13) {\n --row: 13;\n}\n.hours > [role=listitem i]:nth-child(24n+14) {\n --row: 14;\n}\n.hours > [role=listitem i]:nth-child(24n+15) {\n --row: 15;\n}\n.hours > [role=listitem i]:nth-child(24n+16) {\n --row: 16;\n}\n.hours > [role=listitem i]:nth-child(24n+17) {\n --row: 17;\n}\n.hours > [role=listitem i]:nth-child(24n+18) {\n --row: 18;\n}\n.hours > [role=listitem i]:nth-child(24n+19) {\n --row: 19;\n}\n.hours > [role=listitem i]:nth-child(24n+20) {\n --row: 20;\n}\n.hours > [role=listitem i]:nth-child(24n+21) {\n --row: 21;\n}\n.hours > [role=listitem i]:nth-child(24n+22) {\n --row: 22;\n}\n.hours > [role=listitem i]:nth-child(24n+23) {\n --row: 23;\n}\n.hours > [role=listitem i]:nth-child(24n+24) {\n --row: 24;\n}\n\n[role=gridcell i] {\n display: grid;\n gap: 1px;\n grid-auto-flow: column;\n}\n\n[role=gridcell i],\n[role=columnheader i],\n[role=columnheader i] [role=button i] {\n position: relative;\n}\n[role=gridcell i]::before,\n[role=columnheader i]::before,\n[role=columnheader i] [role=button i]::before {\n position: absolute;\n z-index: -1;\n background-color: var(--vvd-color-information-400);\n content: \"\";\n}\n@supports (inset: 0) {\n [role=gridcell i]::before,\n[role=columnheader i]::before,\n[role=columnheader i] [role=button i]::before {\n inset: 0;\n }\n}\n@supports not (inset: 0) {\n [role=gridcell i]::before,\n[role=columnheader i]::before,\n[role=columnheader i] [role=button i]::before {\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n }\n}\n[role=gridcell i]:focus,\n[role=columnheader i]:focus,\n[role=columnheader i] [role=button i]:focus {\n outline: none;\n}\n[role=gridcell i]:not(:focus-visible)::before,\n[role=columnheader i]:not(:focus-visible)::before,\n[role=columnheader i] [role=button i]:not(:focus-visible)::before {\n display: none;\n}\n\n.columns {\n display: contents;\n}\n.columns > [role=gridcell i] {\n position: relative;\n grid-column: var(--column);\n grid-row: 1/25;\n}\n.columns > [role=gridcell i]:nth-child(1) {\n --column: 1;\n}\n.columns > [role=gridcell i]:nth-child(2) {\n --column: 2;\n}\n.columns > [role=gridcell i]:nth-child(3) {\n --column: 3;\n}\n.columns > [role=gridcell i]:nth-child(4) {\n --column: 4;\n}\n.columns > [role=gridcell i]:nth-child(5) {\n --column: 5;\n}\n.columns > [role=gridcell i]:nth-child(6) {\n --column: 6;\n}\n.columns > [role=gridcell i]:nth-child(7) {\n --column: 7;\n}\n.columns > [role=gridcell i]:not(:first-child)::after {\n position: absolute;\n block-size: 100%;\n border-inline-end: var(--vvd-color-neutral-100) 1px solid;\n content: \"\";\n margin-inline-start: -1px;\n}\n\n.column-headers {\n display: grid;\n grid-area: column-headers;\n grid-template-columns: repeat(7, 1fr);\n}\n.column-headers [role=columnheader i] h2 {\n display: grid;\n align-items: baseline;\n margin: 0;\n font: var(--vvd-typography-heading-4);\n grid-template-columns: 1fr auto 1fr;\n}\n.column-headers [role=columnheader i] h2 > em {\n font: inherit;\n inline-size: min-content;\n}\n@supports (inset: 0) {\n .column-headers [role=columnheader i] h2 > em {\n inset-inline-start: 0;\n }\n}\n@supports not (inset: 0) {\n .column-headers [role=columnheader i] h2 > em {\n left: 0;\n }\n}\n.column-headers [role=columnheader i] h2 > small {\n font: var(--vvd-typography-base-condensed);\n text-transform: uppercase;\n}";
500
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Fri, 03 Feb 2023 15:57:56 GMT\n */\nol {\n padding: 0;\n margin: 0;\n list-style: none;\n}\n\n[role=grid i] {\n position: relative;\n z-index: 0;\n display: grid;\n margin: auto;\n grid-template-areas: \". column-headers\" \"row-headers calendar\";\n grid-template-columns: min-content auto;\n inline-size: max(100%, 500px);\n min-inline-size: 880px;\n}\n\n.row-headers {\n display: grid;\n grid-area: row-headers;\n grid-template-rows: repeat(24, 1fr);\n margin-inline-end: 2px;\n}\n.row-headers > [role=rowheader i] {\n display: flex;\n align-items: flex-end;\n justify-content: flex-end;\n}\n.row-headers > [role=rowheader i] > time {\n font: var(--vvd-typography-base-condensed);\n font-size: small;\n line-height: 1;\n text-transform: uppercase;\n white-space: nowrap;\n}\n\n.calendar-row {\n display: contents;\n}\n\n.calendar-grid-presentation {\n display: grid;\n overflow: hidden;\n background: var(--vvd-color-surface-2dp);\n border-radius: 6px;\n counter-reset: listing;\n filter: var(--vvd-shadow-surface-2dp);\n gap: 1px;\n grid-area: calendar;\n grid-auto-flow: column;\n grid-template: repeat(24, 1fr)/repeat(7, 1fr);\n}\n\n.hours {\n display: contents;\n}\n.hours > [role=listitem i] {\n position: relative;\n grid-column: 1/8;\n grid-row: var(--row);\n min-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 8));\n pointer-events: none;\n}\n.hours > [role=listitem i]:not(:first-child)::after {\n position: absolute;\n border-block-end: var(--vvd-color-neutral-100) 1px solid;\n content: \"\";\n inline-size: 100%;\n margin-block-start: -1px;\n}\n.hours > [role=listitem i]:nth-child(24n+1) {\n --row: 1;\n}\n.hours > [role=listitem i]:nth-child(24n+2) {\n --row: 2;\n}\n.hours > [role=listitem i]:nth-child(24n+3) {\n --row: 3;\n}\n.hours > [role=listitem i]:nth-child(24n+4) {\n --row: 4;\n}\n.hours > [role=listitem i]:nth-child(24n+5) {\n --row: 5;\n}\n.hours > [role=listitem i]:nth-child(24n+6) {\n --row: 6;\n}\n.hours > [role=listitem i]:nth-child(24n+7) {\n --row: 7;\n}\n.hours > [role=listitem i]:nth-child(24n+8) {\n --row: 8;\n}\n.hours > [role=listitem i]:nth-child(24n+9) {\n --row: 9;\n}\n.hours > [role=listitem i]:nth-child(24n+10) {\n --row: 10;\n}\n.hours > [role=listitem i]:nth-child(24n+11) {\n --row: 11;\n}\n.hours > [role=listitem i]:nth-child(24n+12) {\n --row: 12;\n}\n.hours > [role=listitem i]:nth-child(24n+13) {\n --row: 13;\n}\n.hours > [role=listitem i]:nth-child(24n+14) {\n --row: 14;\n}\n.hours > [role=listitem i]:nth-child(24n+15) {\n --row: 15;\n}\n.hours > [role=listitem i]:nth-child(24n+16) {\n --row: 16;\n}\n.hours > [role=listitem i]:nth-child(24n+17) {\n --row: 17;\n}\n.hours > [role=listitem i]:nth-child(24n+18) {\n --row: 18;\n}\n.hours > [role=listitem i]:nth-child(24n+19) {\n --row: 19;\n}\n.hours > [role=listitem i]:nth-child(24n+20) {\n --row: 20;\n}\n.hours > [role=listitem i]:nth-child(24n+21) {\n --row: 21;\n}\n.hours > [role=listitem i]:nth-child(24n+22) {\n --row: 22;\n}\n.hours > [role=listitem i]:nth-child(24n+23) {\n --row: 23;\n}\n.hours > [role=listitem i]:nth-child(24n+24) {\n --row: 24;\n}\n\n[role=gridcell i] {\n display: grid;\n gap: 1px;\n grid-auto-flow: column;\n}\n\n[role=gridcell i],\n[role=columnheader i],\n[role=columnheader i] [role=button i] {\n position: relative;\n}\n[role=gridcell i]::before,\n[role=columnheader i]::before,\n[role=columnheader i] [role=button i]::before {\n position: absolute;\n z-index: -1;\n background-color: var(--vvd-color-information-400);\n content: \"\";\n}\n@supports (inset: 0) {\n [role=gridcell i]::before,\n[role=columnheader i]::before,\n[role=columnheader i] [role=button i]::before {\n inset: 0;\n }\n}\n@supports not (inset: 0) {\n [role=gridcell i]::before,\n[role=columnheader i]::before,\n[role=columnheader i] [role=button i]::before {\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n }\n}\n[role=gridcell i]:focus,\n[role=columnheader i]:focus,\n[role=columnheader i] [role=button i]:focus {\n outline: none;\n}\n[role=gridcell i]:not(:focus-visible)::before,\n[role=columnheader i]:not(:focus-visible)::before,\n[role=columnheader i] [role=button i]:not(:focus-visible)::before {\n display: none;\n}\n\n.columns {\n display: contents;\n}\n.columns > [role=gridcell i] {\n position: relative;\n grid-column: var(--column);\n grid-row: 1/25;\n}\n.columns > [role=gridcell i]:nth-child(1) {\n --column: 1;\n}\n.columns > [role=gridcell i]:nth-child(2) {\n --column: 2;\n}\n.columns > [role=gridcell i]:nth-child(3) {\n --column: 3;\n}\n.columns > [role=gridcell i]:nth-child(4) {\n --column: 4;\n}\n.columns > [role=gridcell i]:nth-child(5) {\n --column: 5;\n}\n.columns > [role=gridcell i]:nth-child(6) {\n --column: 6;\n}\n.columns > [role=gridcell i]:nth-child(7) {\n --column: 7;\n}\n.columns > [role=gridcell i]:not(:first-child)::after {\n position: absolute;\n block-size: 100%;\n border-inline-end: var(--vvd-color-neutral-100) 1px solid;\n content: \"\";\n margin-inline-start: -1px;\n}\n\n.column-headers {\n display: grid;\n grid-area: column-headers;\n grid-template-columns: repeat(7, 1fr);\n}\n.column-headers [role=columnheader i] h2 {\n display: grid;\n align-items: baseline;\n margin: 0;\n font: var(--vvd-typography-heading-4);\n grid-template-columns: 1fr auto 1fr;\n}\n.column-headers [role=columnheader i] h2 > em {\n font: inherit;\n inline-size: min-content;\n}\n@supports (inset: 0) {\n .column-headers [role=columnheader i] h2 > em {\n inset-inline-start: 0;\n }\n}\n@supports not (inset: 0) {\n .column-headers [role=columnheader i] h2 > em {\n left: 0;\n }\n}\n.column-headers [role=columnheader i] h2 > small {\n font: var(--vvd-typography-base-condensed);\n text-transform: uppercase;\n}";
1261
501
 
1262
502
  const ARROW_UP = 'ArrowUp';
1263
503
  const ARROW_RIGHT = 'ArrowRight';