@haiilo/catalyst 0.14.2 → 0.15.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 (65) hide show
  1. package/dist/catalyst/catalyst.esm.js +1 -1
  2. package/dist/catalyst/catalyst.esm.js.map +1 -1
  3. package/dist/catalyst/index.cdn.js +42 -15
  4. package/dist/catalyst/p-311d10a7.entry.js +12 -0
  5. package/dist/catalyst/p-311d10a7.entry.js.map +1 -0
  6. package/dist/cjs/{cat-alert_22.cjs.entry.js → cat-alert_24.cjs.entry.js} +2229 -19
  7. package/dist/cjs/cat-alert_24.cjs.entry.js.map +1 -0
  8. package/dist/cjs/catalyst.cjs.js +1 -1
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/collection/collection-manifest.json +2 -0
  11. package/dist/collection/components/cat-badge/cat-badge.css +5 -5
  12. package/dist/collection/components/cat-button/cat-button.css +4 -0
  13. package/dist/collection/components/cat-checkbox/cat-checkbox.css +1 -0
  14. package/dist/collection/components/cat-input/cat-input.css +1 -0
  15. package/dist/collection/components/cat-scrollable/cat-scrollable.css +0 -1
  16. package/dist/collection/components/cat-select-remote/cat-select-remote.css +209 -0
  17. package/dist/collection/components/cat-select-remote/cat-select-remote.js +798 -0
  18. package/dist/collection/components/cat-select-remote/cat-select-remote.js.map +1 -0
  19. package/dist/collection/components/cat-select-remote-test/cat-select-remote-test.js +1288 -0
  20. package/dist/collection/components/cat-select-remote-test/cat-select-remote-test.js.map +1 -0
  21. package/dist/collection/index.cdn.js +42 -15
  22. package/dist/collection/index.js.map +1 -1
  23. package/dist/components/cat-badge.js +1 -1
  24. package/dist/components/cat-badge.js.map +1 -1
  25. package/dist/components/cat-button2.js +1 -1
  26. package/dist/components/cat-button2.js.map +1 -1
  27. package/dist/components/cat-checkbox.js +1 -115
  28. package/dist/components/cat-checkbox.js.map +1 -1
  29. package/dist/components/cat-checkbox2.js +119 -0
  30. package/dist/components/cat-checkbox2.js.map +1 -0
  31. package/dist/components/cat-input.js +1 -1
  32. package/dist/components/cat-input.js.map +1 -1
  33. package/dist/components/cat-scrollable.js +1 -1355
  34. package/dist/components/cat-scrollable.js.map +1 -1
  35. package/dist/components/cat-scrollable2.js +1359 -0
  36. package/dist/components/cat-scrollable2.js.map +1 -0
  37. package/dist/components/cat-select-remote-test.d.ts +11 -0
  38. package/dist/components/cat-select-remote-test.js +1368 -0
  39. package/dist/components/cat-select-remote-test.js.map +1 -0
  40. package/dist/components/cat-select-remote.d.ts +11 -0
  41. package/dist/components/cat-select-remote.js +8 -0
  42. package/dist/components/cat-select-remote.js.map +1 -0
  43. package/dist/components/cat-select-remote2.js +982 -0
  44. package/dist/components/cat-select-remote2.js.map +1 -0
  45. package/dist/components/cat-skeleton.js +1 -71
  46. package/dist/components/cat-skeleton.js.map +1 -1
  47. package/dist/components/cat-skeleton2.js +75 -0
  48. package/dist/components/cat-skeleton2.js.map +1 -0
  49. package/dist/components/index.d.ts +2 -0
  50. package/dist/components/index.js +2 -0
  51. package/dist/components/index.js.map +1 -1
  52. package/dist/esm/{cat-alert_22.entry.js → cat-alert_24.entry.js} +2228 -20
  53. package/dist/esm/cat-alert_24.entry.js.map +1 -0
  54. package/dist/esm/catalyst.js +1 -1
  55. package/dist/esm/loader.js +1 -1
  56. package/dist/types/components/cat-select-remote/autosize.d.ts +1 -0
  57. package/dist/types/components/cat-select-remote/cat-select-remote.d.ts +145 -0
  58. package/dist/types/components/cat-select-remote-test/cat-select-remote-test.d.ts +6 -0
  59. package/dist/types/components.d.ts +145 -0
  60. package/dist/types/index.d.ts +3 -0
  61. package/package.json +5 -4
  62. package/dist/catalyst/p-45547af1.entry.js +0 -12
  63. package/dist/catalyst/p-45547af1.entry.js.map +0 -1
  64. package/dist/cjs/cat-alert_22.cjs.entry.js.map +0 -1
  65. package/dist/esm/cat-alert_22.entry.js.map +0 -1
@@ -0,0 +1,982 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { a as autoUpdate, c as computePosition, o as offset } from './floating-ui.dom.esm.js';
3
+ import { C as CatI18nRegistry } from './cat-i18n-registry.js';
4
+ import { l as loglevel } from './loglevel.js';
5
+ import { C as CatFormHint } from './cat-form-hint.js';
6
+ import { d as defineCustomElement$6 } from './cat-button2.js';
7
+ import { d as defineCustomElement$5 } from './cat-checkbox2.js';
8
+ import { d as defineCustomElement$4 } from './cat-icon2.js';
9
+ import { S as Subscription, b as arrRemove, f as from, p as popScheduler, e as createErrorClass, g as mergeAll, O as Observable, i as isScheduler, o as operate, c as createOperatorSubscriber, h as innerFrom, n as noop, E as EMPTY, j as filter, k as identity, l as isFunction, q as Subject, r as distinctUntilChanged, d as defineCustomElement$3 } from './cat-scrollable2.js';
10
+ import { d as defineCustomElement$2 } from './cat-skeleton2.js';
11
+ import { d as defineCustomElement$1 } from './cat-spinner2.js';
12
+
13
+ const dateTimestampProvider = {
14
+ now() {
15
+ return (dateTimestampProvider.delegate || Date).now();
16
+ },
17
+ delegate: undefined,
18
+ };
19
+
20
+ class Action extends Subscription {
21
+ constructor(scheduler, work) {
22
+ super();
23
+ }
24
+ schedule(state, delay = 0) {
25
+ return this;
26
+ }
27
+ }
28
+
29
+ const intervalProvider = {
30
+ setInterval(handler, timeout, ...args) {
31
+ const { delegate } = intervalProvider;
32
+ if (delegate === null || delegate === void 0 ? void 0 : delegate.setInterval) {
33
+ return delegate.setInterval(handler, timeout, ...args);
34
+ }
35
+ return setInterval(handler, timeout, ...args);
36
+ },
37
+ clearInterval(handle) {
38
+ const { delegate } = intervalProvider;
39
+ return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearInterval) || clearInterval)(handle);
40
+ },
41
+ delegate: undefined,
42
+ };
43
+
44
+ class AsyncAction extends Action {
45
+ constructor(scheduler, work) {
46
+ super(scheduler, work);
47
+ this.scheduler = scheduler;
48
+ this.work = work;
49
+ this.pending = false;
50
+ }
51
+ schedule(state, delay = 0) {
52
+ if (this.closed) {
53
+ return this;
54
+ }
55
+ this.state = state;
56
+ const id = this.id;
57
+ const scheduler = this.scheduler;
58
+ if (id != null) {
59
+ this.id = this.recycleAsyncId(scheduler, id, delay);
60
+ }
61
+ this.pending = true;
62
+ this.delay = delay;
63
+ this.id = this.id || this.requestAsyncId(scheduler, this.id, delay);
64
+ return this;
65
+ }
66
+ requestAsyncId(scheduler, _id, delay = 0) {
67
+ return intervalProvider.setInterval(scheduler.flush.bind(scheduler, this), delay);
68
+ }
69
+ recycleAsyncId(_scheduler, id, delay = 0) {
70
+ if (delay != null && this.delay === delay && this.pending === false) {
71
+ return id;
72
+ }
73
+ intervalProvider.clearInterval(id);
74
+ return undefined;
75
+ }
76
+ execute(state, delay) {
77
+ if (this.closed) {
78
+ return new Error('executing a cancelled action');
79
+ }
80
+ this.pending = false;
81
+ const error = this._execute(state, delay);
82
+ if (error) {
83
+ return error;
84
+ }
85
+ else if (this.pending === false && this.id != null) {
86
+ this.id = this.recycleAsyncId(this.scheduler, this.id, null);
87
+ }
88
+ }
89
+ _execute(state, _delay) {
90
+ let errored = false;
91
+ let errorValue;
92
+ try {
93
+ this.work(state);
94
+ }
95
+ catch (e) {
96
+ errored = true;
97
+ errorValue = e ? e : new Error('Scheduled action threw falsy error');
98
+ }
99
+ if (errored) {
100
+ this.unsubscribe();
101
+ return errorValue;
102
+ }
103
+ }
104
+ unsubscribe() {
105
+ if (!this.closed) {
106
+ const { id, scheduler } = this;
107
+ const { actions } = scheduler;
108
+ this.work = this.state = this.scheduler = null;
109
+ this.pending = false;
110
+ arrRemove(actions, this);
111
+ if (id != null) {
112
+ this.id = this.recycleAsyncId(scheduler, id, null);
113
+ }
114
+ this.delay = null;
115
+ super.unsubscribe();
116
+ }
117
+ }
118
+ }
119
+
120
+ class Scheduler {
121
+ constructor(schedulerActionCtor, now = Scheduler.now) {
122
+ this.schedulerActionCtor = schedulerActionCtor;
123
+ this.now = now;
124
+ }
125
+ schedule(work, delay = 0, state) {
126
+ return new this.schedulerActionCtor(this, work).schedule(state, delay);
127
+ }
128
+ }
129
+ Scheduler.now = dateTimestampProvider.now;
130
+
131
+ class AsyncScheduler extends Scheduler {
132
+ constructor(SchedulerAction, now = Scheduler.now) {
133
+ super(SchedulerAction, now);
134
+ this.actions = [];
135
+ this._active = false;
136
+ this._scheduled = undefined;
137
+ }
138
+ flush(action) {
139
+ const { actions } = this;
140
+ if (this._active) {
141
+ actions.push(action);
142
+ return;
143
+ }
144
+ let error;
145
+ this._active = true;
146
+ do {
147
+ if ((error = action.execute(action.state, action.delay))) {
148
+ break;
149
+ }
150
+ } while ((action = actions.shift()));
151
+ this._active = false;
152
+ if (error) {
153
+ while ((action = actions.shift())) {
154
+ action.unsubscribe();
155
+ }
156
+ throw error;
157
+ }
158
+ }
159
+ }
160
+
161
+ const asyncScheduler = new AsyncScheduler(AsyncAction);
162
+ const async = asyncScheduler;
163
+
164
+ function of(...args) {
165
+ const scheduler = popScheduler(args);
166
+ return from(args, scheduler);
167
+ }
168
+
169
+ const EmptyError = createErrorClass((_super) => function EmptyErrorImpl() {
170
+ _super(this);
171
+ this.name = 'EmptyError';
172
+ this.message = 'no elements in sequence';
173
+ });
174
+
175
+ function isValidDate(value) {
176
+ return value instanceof Date && !isNaN(value);
177
+ }
178
+
179
+ function concatAll() {
180
+ return mergeAll(1);
181
+ }
182
+
183
+ function concat(...args) {
184
+ return concatAll()(from(args, popScheduler(args)));
185
+ }
186
+
187
+ function timer(dueTime = 0, intervalOrScheduler, scheduler = async) {
188
+ let intervalDuration = -1;
189
+ if (intervalOrScheduler != null) {
190
+ if (isScheduler(intervalOrScheduler)) {
191
+ scheduler = intervalOrScheduler;
192
+ }
193
+ else {
194
+ intervalDuration = intervalOrScheduler;
195
+ }
196
+ }
197
+ return new Observable((subscriber) => {
198
+ let due = isValidDate(dueTime) ? +dueTime - scheduler.now() : dueTime;
199
+ if (due < 0) {
200
+ due = 0;
201
+ }
202
+ let n = 0;
203
+ return scheduler.schedule(function () {
204
+ if (!subscriber.closed) {
205
+ subscriber.next(n++);
206
+ if (0 <= intervalDuration) {
207
+ this.schedule(undefined, intervalDuration);
208
+ }
209
+ else {
210
+ subscriber.complete();
211
+ }
212
+ }
213
+ }, due);
214
+ });
215
+ }
216
+
217
+ function catchError(selector) {
218
+ return operate((source, subscriber) => {
219
+ let innerSub = null;
220
+ let syncUnsub = false;
221
+ let handledResult;
222
+ innerSub = source.subscribe(createOperatorSubscriber(subscriber, undefined, undefined, (err) => {
223
+ handledResult = innerFrom(selector(err, catchError(selector)(source)));
224
+ if (innerSub) {
225
+ innerSub.unsubscribe();
226
+ innerSub = null;
227
+ handledResult.subscribe(subscriber);
228
+ }
229
+ else {
230
+ syncUnsub = true;
231
+ }
232
+ }));
233
+ if (syncUnsub) {
234
+ innerSub.unsubscribe();
235
+ innerSub = null;
236
+ handledResult.subscribe(subscriber);
237
+ }
238
+ });
239
+ }
240
+
241
+ function scanInternals(accumulator, seed, hasSeed, emitOnNext, emitBeforeComplete) {
242
+ return (source, subscriber) => {
243
+ let hasState = hasSeed;
244
+ let state = seed;
245
+ let index = 0;
246
+ source.subscribe(createOperatorSubscriber(subscriber, (value) => {
247
+ const i = index++;
248
+ state = hasState
249
+ ?
250
+ accumulator(state, value, i)
251
+ :
252
+ ((hasState = true), value);
253
+ emitOnNext && subscriber.next(state);
254
+ }, emitBeforeComplete &&
255
+ (() => {
256
+ hasState && subscriber.next(state);
257
+ subscriber.complete();
258
+ })));
259
+ };
260
+ }
261
+
262
+ function debounce(durationSelector) {
263
+ return operate((source, subscriber) => {
264
+ let hasValue = false;
265
+ let lastValue = null;
266
+ let durationSubscriber = null;
267
+ const emit = () => {
268
+ durationSubscriber === null || durationSubscriber === void 0 ? void 0 : durationSubscriber.unsubscribe();
269
+ durationSubscriber = null;
270
+ if (hasValue) {
271
+ hasValue = false;
272
+ const value = lastValue;
273
+ lastValue = null;
274
+ subscriber.next(value);
275
+ }
276
+ };
277
+ source.subscribe(createOperatorSubscriber(subscriber, (value) => {
278
+ durationSubscriber === null || durationSubscriber === void 0 ? void 0 : durationSubscriber.unsubscribe();
279
+ hasValue = true;
280
+ lastValue = value;
281
+ durationSubscriber = createOperatorSubscriber(subscriber, emit, noop);
282
+ innerFrom(durationSelector(value)).subscribe(durationSubscriber);
283
+ }, () => {
284
+ emit();
285
+ subscriber.complete();
286
+ }, undefined, () => {
287
+ lastValue = durationSubscriber = null;
288
+ }));
289
+ });
290
+ }
291
+
292
+ function defaultIfEmpty(defaultValue) {
293
+ return operate((source, subscriber) => {
294
+ let hasValue = false;
295
+ source.subscribe(createOperatorSubscriber(subscriber, (value) => {
296
+ hasValue = true;
297
+ subscriber.next(value);
298
+ }, () => {
299
+ if (!hasValue) {
300
+ subscriber.next(defaultValue);
301
+ }
302
+ subscriber.complete();
303
+ }));
304
+ });
305
+ }
306
+
307
+ function take(count) {
308
+ return count <= 0
309
+ ?
310
+ () => EMPTY
311
+ : operate((source, subscriber) => {
312
+ let seen = 0;
313
+ source.subscribe(createOperatorSubscriber(subscriber, (value) => {
314
+ if (++seen <= count) {
315
+ subscriber.next(value);
316
+ if (count <= seen) {
317
+ subscriber.complete();
318
+ }
319
+ }
320
+ }));
321
+ });
322
+ }
323
+
324
+ function throwIfEmpty(errorFactory = defaultErrorFactory) {
325
+ return operate((source, subscriber) => {
326
+ let hasValue = false;
327
+ source.subscribe(createOperatorSubscriber(subscriber, (value) => {
328
+ hasValue = true;
329
+ subscriber.next(value);
330
+ }, () => (hasValue ? subscriber.complete() : subscriber.error(errorFactory()))));
331
+ });
332
+ }
333
+ function defaultErrorFactory() {
334
+ return new EmptyError();
335
+ }
336
+
337
+ function first(predicate, defaultValue) {
338
+ const hasDefaultValue = arguments.length >= 2;
339
+ return (source) => source.pipe(predicate ? filter((v, i) => predicate(v, i, source)) : identity, take(1), hasDefaultValue ? defaultIfEmpty(defaultValue) : throwIfEmpty(() => new EmptyError()));
340
+ }
341
+
342
+ function scan(accumulator, seed) {
343
+ return operate(scanInternals(accumulator, seed, arguments.length >= 2, true));
344
+ }
345
+
346
+ function startWith(...values) {
347
+ const scheduler = popScheduler(values);
348
+ return operate((source, subscriber) => {
349
+ (scheduler ? concat(values, source, scheduler) : concat(values, source)).subscribe(subscriber);
350
+ });
351
+ }
352
+
353
+ function switchMap(project, resultSelector) {
354
+ return operate((source, subscriber) => {
355
+ let innerSubscriber = null;
356
+ let index = 0;
357
+ let isComplete = false;
358
+ const checkComplete = () => isComplete && !innerSubscriber && subscriber.complete();
359
+ source.subscribe(createOperatorSubscriber(subscriber, (value) => {
360
+ innerSubscriber === null || innerSubscriber === void 0 ? void 0 : innerSubscriber.unsubscribe();
361
+ let innerIndex = 0;
362
+ const outerIndex = index++;
363
+ innerFrom(project(value, outerIndex)).subscribe((innerSubscriber = createOperatorSubscriber(subscriber, (innerValue) => subscriber.next(resultSelector ? resultSelector(value, innerValue, outerIndex, innerIndex++) : innerValue), () => {
364
+ innerSubscriber = null;
365
+ checkComplete();
366
+ })));
367
+ }, () => {
368
+ isComplete = true;
369
+ checkComplete();
370
+ }));
371
+ });
372
+ }
373
+
374
+ function takeWhile(predicate, inclusive = false) {
375
+ return operate((source, subscriber) => {
376
+ let index = 0;
377
+ source.subscribe(createOperatorSubscriber(subscriber, (value) => {
378
+ const result = predicate(value, index++);
379
+ (result || inclusive) && subscriber.next(value);
380
+ !result && subscriber.complete();
381
+ }));
382
+ });
383
+ }
384
+
385
+ function tap(observerOrNext, error, complete) {
386
+ const tapObserver = isFunction(observerOrNext) || error || complete
387
+ ?
388
+ { next: observerOrNext, error, complete }
389
+ : observerOrNext;
390
+ return tapObserver
391
+ ? operate((source, subscriber) => {
392
+ var _a;
393
+ (_a = tapObserver.subscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);
394
+ let isUnsub = true;
395
+ source.subscribe(createOperatorSubscriber(subscriber, (value) => {
396
+ var _a;
397
+ (_a = tapObserver.next) === null || _a === void 0 ? void 0 : _a.call(tapObserver, value);
398
+ subscriber.next(value);
399
+ }, () => {
400
+ var _a;
401
+ isUnsub = false;
402
+ (_a = tapObserver.complete) === null || _a === void 0 ? void 0 : _a.call(tapObserver);
403
+ subscriber.complete();
404
+ }, (err) => {
405
+ var _a;
406
+ isUnsub = false;
407
+ (_a = tapObserver.error) === null || _a === void 0 ? void 0 : _a.call(tapObserver, err);
408
+ subscriber.error(err);
409
+ }, () => {
410
+ var _a, _b;
411
+ if (isUnsub) {
412
+ (_a = tapObserver.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);
413
+ }
414
+ (_b = tapObserver.finalize) === null || _b === void 0 ? void 0 : _b.call(tapObserver);
415
+ }));
416
+ })
417
+ :
418
+ identity;
419
+ }
420
+
421
+ var GHOST_ELEMENT_ID = '__autosizeInputGhost';
422
+
423
+ var characterEntities = {
424
+ ' ': 'nbsp',
425
+ '<': 'lt',
426
+ '>': 'gt'
427
+ };
428
+ function mapSpecialCharacterToCharacterEntity (specialCharacter) {
429
+ return '&' + characterEntities[specialCharacter] + ';'
430
+ }
431
+ function escapeSpecialCharacters (string) {
432
+ return string.replace(/\s|<|>/g, mapSpecialCharacterToCharacterEntity)
433
+ }
434
+
435
+ // Create `ghostElement`, with inline styles to hide it and ensure that the text is all
436
+ // on a single line.
437
+ function createGhostElement () {
438
+ var ghostElement = document.createElement('div');
439
+ ghostElement.id = GHOST_ELEMENT_ID;
440
+ ghostElement.style.cssText =
441
+ 'display:inline-block;height:0;overflow:hidden;position:absolute;top:0;visibility:hidden;white-space:nowrap;';
442
+ document.body.appendChild(ghostElement);
443
+ return ghostElement
444
+ }
445
+
446
+ var autosizeInput = function (element, options) {
447
+ var elementStyle = window.getComputedStyle(element);
448
+ // prettier-ignore
449
+ var elementCssText = 'box-sizing:' + elementStyle.boxSizing +
450
+ ';border-left:' + elementStyle.borderLeftWidth + ' solid red' +
451
+ ';border-right:' + elementStyle.borderRightWidth + ' solid red' +
452
+ ';font-family:' + elementStyle.fontFamily +
453
+ ';font-feature-settings:' + elementStyle.fontFeatureSettings +
454
+ ';font-kerning:' + elementStyle.fontKerning +
455
+ ';font-size:' + elementStyle.fontSize +
456
+ ';font-stretch:' + elementStyle.fontStretch +
457
+ ';font-style:' + elementStyle.fontStyle +
458
+ ';font-variant:' + elementStyle.fontVariant +
459
+ ';font-variant-caps:' + elementStyle.fontVariantCaps +
460
+ ';font-variant-ligatures:' + elementStyle.fontVariantLigatures +
461
+ ';font-variant-numeric:' + elementStyle.fontVariantNumeric +
462
+ ';font-weight:' + elementStyle.fontWeight +
463
+ ';letter-spacing:' + elementStyle.letterSpacing +
464
+ ';margin-left:' + elementStyle.marginLeft +
465
+ ';margin-right:' + elementStyle.marginRight +
466
+ ';padding-left:' + elementStyle.paddingLeft +
467
+ ';padding-right:' + elementStyle.paddingRight +
468
+ ';text-indent:' + elementStyle.textIndent +
469
+ ';text-transform:' + elementStyle.textTransform;
470
+
471
+ // Assigns an appropriate width to the given `element` based on its contents.
472
+ function setWidth () {
473
+ var string = element.value || element.getAttribute('placeholder') || '';
474
+ // Check if the `ghostElement` exists. If no, create it.
475
+ var ghostElement =
476
+ document.getElementById(GHOST_ELEMENT_ID) || createGhostElement();
477
+ // Copy all width-affecting styles to the `ghostElement`.
478
+ ghostElement.style.cssText += elementCssText;
479
+ ghostElement.innerHTML = escapeSpecialCharacters(string);
480
+ // Copy the width of `ghostElement` to `element`.
481
+ var width = window.getComputedStyle(ghostElement).width;
482
+ element.style.width = width;
483
+ return width
484
+ }
485
+
486
+ element.addEventListener('input', setWidth);
487
+
488
+ var width = setWidth();
489
+
490
+ // Set `min-width` only if `options.minWidth` was set, and only if the initial
491
+ // width is non-zero.
492
+ if (options && options.minWidth && width !== '0px') {
493
+ element.style.minWidth = width;
494
+ }
495
+
496
+ // Return a function for unbinding the event listener and removing the `ghostElement`.
497
+ return function () {
498
+ element.removeEventListener('input', setWidth);
499
+ var ghostElement = document.getElementById(GHOST_ELEMENT_ID);
500
+ if (ghostElement) {
501
+ ghostElement.parentNode.removeChild(ghostElement);
502
+ }
503
+ }
504
+ };
505
+
506
+ const catSelectRemoteCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0}:host{display:flex;flex-direction:column;gap:0.5rem;position:relative}:host([hidden]){display:none}label{align-self:flex-start}label.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.input-optional{margin-left:0.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.select-wrapper{display:flex;align-items:flex-start;background:white;border-radius:0.25rem;box-shadow:0 0 0 1px #d7dbe0;transition:box-shadow 0.13s linear;padding:4px}.select-wrapper:not(.select-disabled):hover{box-shadow:0 0 0 2px #d7dbe0}.select-wrapper:not(.select-disabled):focus-within{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255))}.select-disabled{background:#f8f8fb;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.select-wrapper-inner{display:flex;flex:1 1 auto;flex-wrap:wrap;align-items:center;gap:4px;min-width:0}.select-input{font:inherit;background:none;border:none;outline:none;padding:6px 8px;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.select-disabled .select-input{cursor:inherit}.select-pills{display:contents}.pill{display:inline-flex;align-items:center;gap:4px;padding:4px 8px;background:#ebecf0;border-radius:0.125rem;white-space:nowrap;min-width:0}.pill>span{overflow:hidden;text-overflow:ellipsis}.pill>cat-button{margin-right:-4px}.select-btn{transition:transform 0.13s linear}.select-btn::part(button){outline:none}cat-spinner{padding:6px}.select-btn-open{transform:rotate(180deg)}.select-dropdown{position:absolute;right:0;background:white;display:none;overflow:auto;box-shadow:0 1px 4px 0 rgba(16, 29, 48, 0.2);border-radius:0.25rem;z-index:100}.select-options-wrapper{max-height:16rem;width:100%}.select-empty{margin:1rem 0;padding:0 1.25rem}.select-options{list-style-type:none;margin:0;padding:0.5rem 0}.select-options cat-checkbox,.select-options .select-option-single{margin:0;padding:0.5rem 1rem}.select-option-single{cursor:pointer}.select-input-transparent-caret{caret-color:transparent}.select-option-empty,.select-option-loading{padding:0.5rem 1rem}.select-option:hover{background-color:rgba(105, 118, 135, 0.05)}.select-option-active{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:-2px}.select-option-label{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}.select-option-description{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}";
507
+
508
+ const INIT_STATE = {
509
+ term: '',
510
+ isOpen: false,
511
+ isLoading: false,
512
+ isResolving: false,
513
+ options: [],
514
+ selection: [],
515
+ activeOptionIndex: -1,
516
+ activeSelectionIndex: -1
517
+ };
518
+ let nextUniqueId = 0;
519
+ const CatSelectRemote = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
520
+ constructor() {
521
+ super();
522
+ this.__registerHost();
523
+ this.__attachShadow();
524
+ this.catOpen = createEvent(this, "catOpen", 7);
525
+ this.catClose = createEvent(this, "catClose", 7);
526
+ this.catChange = createEvent(this, "catChange", 7);
527
+ this.catBlur = createEvent(this, "catBlur", 7);
528
+ this.i18n = CatI18nRegistry.getInstance();
529
+ this.id = `cat-input-${nextUniqueId++}`;
530
+ this.term$ = new Subject();
531
+ this.more$ = new Subject();
532
+ this.state = INIT_STATE;
533
+ this.hasSlottedLabel = false;
534
+ /**
535
+ * Enable multiple selection.
536
+ */
537
+ this.multiple = false;
538
+ /**
539
+ * The debounce time for the search.
540
+ */
541
+ this.debounce = 250;
542
+ /**
543
+ * The placement of the select.
544
+ */
545
+ this.placement = 'bottom-start';
546
+ /**
547
+ * Whether the select is disabled.
548
+ */
549
+ this.disabled = false;
550
+ /**
551
+ * The label for the select.
552
+ */
553
+ this.label = '';
554
+ /**
555
+ * The name of the form control. Submitted with the form as part of a name/value pair.
556
+ */
557
+ this.name = '';
558
+ /**
559
+ * Visually hide the label, but still show it to assistive technologies like screen readers.
560
+ */
561
+ this.labelHidden = false;
562
+ /**
563
+ * A value is required or must be check for the form to be submittable.
564
+ */
565
+ this.required = false;
566
+ /**
567
+ * Whether the select should show a clear button.
568
+ */
569
+ this.clearable = false;
570
+ }
571
+ onConnectorChange(connector) {
572
+ this.reset(connector);
573
+ this.resolve();
574
+ }
575
+ onStateChange(newState, oldState) {
576
+ var _a;
577
+ const changed = (key) => newState[key] !== oldState[key];
578
+ if (changed('activeOptionIndex')) {
579
+ if (this.state.activeOptionIndex >= 0) {
580
+ const option = (_a = this.dropdown) === null || _a === void 0 ? void 0 : _a.querySelector(`#select-${this.id}-option-${this.state.activeOptionIndex}`);
581
+ option === null || option === void 0 ? void 0 : option.scrollIntoView({ block: 'nearest' });
582
+ }
583
+ }
584
+ if (changed('selection')) {
585
+ if (!this.multiple && this.state.selection.length) {
586
+ this.hide();
587
+ }
588
+ const idsSelected = this.state.selection.map(item => item.item.id);
589
+ if (this.multiple) {
590
+ this.value = idsSelected;
591
+ }
592
+ else {
593
+ this.value = idsSelected.length ? idsSelected[0] : '';
594
+ }
595
+ this.catChange.emit();
596
+ }
597
+ }
598
+ componentDidLoad() {
599
+ if (this.input) {
600
+ autosizeInput(this.input);
601
+ }
602
+ if (this.trigger && this.dropdown) {
603
+ autoUpdate(this.trigger, this.dropdown, () => this.update());
604
+ }
605
+ }
606
+ componentWillRender() {
607
+ this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
608
+ if (!this.label && !this.hasSlottedLabel) {
609
+ loglevel.error('[A11y] Missing ARIA label on select', this);
610
+ }
611
+ }
612
+ onBlur(event) {
613
+ if (!this.multiple && this.state.activeOptionIndex >= 0) {
614
+ this.select(this.state.options[this.state.activeOptionIndex]);
615
+ }
616
+ this.hide();
617
+ this.patchState({ activeSelectionIndex: -1 });
618
+ this.catBlur.emit(event);
619
+ }
620
+ onKeyDown(event) {
621
+ var _a, _b, _c, _d, _e;
622
+ const isInputFocused = ((_a = this.hostElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.activeElement) === this.input;
623
+ if (['ArrowDown', 'ArrowUp', 'ArrowLeft', 'ArrowRight'].includes(event.key)) {
624
+ this.onArrowKeyDown(event);
625
+ }
626
+ else if (['Enter', ' '].includes(event.key)) {
627
+ if (isInputFocused && this.state.activeOptionIndex >= 0) {
628
+ event.preventDefault();
629
+ if (this.multiple) {
630
+ this.toggle(this.state.options[this.state.activeOptionIndex]);
631
+ }
632
+ else {
633
+ this.select(this.state.options[this.state.activeOptionIndex]);
634
+ }
635
+ }
636
+ }
637
+ else if (event.key === 'Escape') {
638
+ this.hide();
639
+ }
640
+ else if (event.key === 'Backspace' || event.key === 'Delete') {
641
+ (_b = this.input) === null || _b === void 0 ? void 0 : _b.focus();
642
+ if (!this.multiple || !this.state.term || (((_c = this.input) === null || _c === void 0 ? void 0 : _c.selectionStart) === 0 && event.key === 'Backspace')) {
643
+ if (this.state.activeSelectionIndex >= 0) {
644
+ this.deselect(this.state.selection[this.state.activeSelectionIndex].item.id);
645
+ }
646
+ else if (this.state.selection.length) {
647
+ const selectionClone = [...this.state.selection];
648
+ selectionClone.pop();
649
+ this.patchState({ selection: selectionClone });
650
+ }
651
+ }
652
+ }
653
+ else if (event.key === 'Tab') {
654
+ (_d = this.trigger) === null || _d === void 0 ? void 0 : _d.setAttribute('tabindex', '-1');
655
+ if (this.multiple) {
656
+ this.patchState({ activeSelectionIndex: -1, activeOptionIndex: -1 });
657
+ }
658
+ else if (this.state.activeOptionIndex >= 0) {
659
+ this.select(this.state.options[this.state.activeOptionIndex]);
660
+ }
661
+ }
662
+ else if (event.key.length === 1) {
663
+ (_e = this.input) === null || _e === void 0 ? void 0 : _e.focus();
664
+ }
665
+ }
666
+ onKeyUp(event) {
667
+ var _a, _b, _c, _d, _e;
668
+ if (event.key === 'Tab' && !event.shiftKey) {
669
+ ((_a = this.hostElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.activeElement) === this.trigger && ((_b = this.input) === null || _b === void 0 ? void 0 : _b.focus());
670
+ if (((_c = this.hostElement.shadowRoot) === null || _c === void 0 ? void 0 : _c.activeElement) === this.input) {
671
+ this.show();
672
+ }
673
+ }
674
+ else if (event.key === 'Tab' && event.shiftKey) {
675
+ const clearButton = (_d = this.trigger) === null || _d === void 0 ? void 0 : _d.querySelector(`#select-clear-btn-${this.id}`);
676
+ if (clearButton) {
677
+ ((_e = this.hostElement.shadowRoot) === null || _e === void 0 ? void 0 : _e.activeElement) === clearButton && this.show();
678
+ }
679
+ else {
680
+ this.show();
681
+ }
682
+ }
683
+ }
684
+ async connect(connector) {
685
+ var _a;
686
+ this.connector = connector;
687
+ let number$;
688
+ (_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
689
+ this.subscription = this.term$
690
+ .asObservable()
691
+ .pipe(debounce(term => (term ? timer(this.debounce) : of(0))), distinctUntilChanged(), tap(() => (number$ = this.more$.pipe(filter(() => !this.state.isLoading), scan(n => n + 1, 0), startWith(0)))), tap(() => this.patchState({ options: [] })), switchMap(term => number$.pipe(tap(() => this.patchState({ isLoading: true })), switchMap(number => this.connectorSafe.retrieve(term, number)), tap(page => this.patchState({ isLoading: false, totalElements: page.totalElements })), takeWhile(page => !page.last, true), scan((items, page) => [...items, ...page.content], []))))
692
+ .subscribe(items => this.patchState({
693
+ options: items === null || items === void 0 ? void 0 : items.map(item => ({
694
+ item,
695
+ render: this.connectorSafe.render(item)
696
+ }))
697
+ }));
698
+ }
699
+ render() {
700
+ return (h(Host, null, (this.hasSlottedLabel || this.label) && (h("label", { htmlFor: this.id, class: { hidden: this.labelHidden } }, h("span", { part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label, !this.required && (h("span", { class: "input-optional", "aria-hidden": "true" }, "(", this.i18n.t('input.optional'), ")"))))), h("div", { class: { 'select-wrapper': true, 'select-disabled': this.disabled }, ref: el => (this.trigger = el), id: this.id, role: "combobox", "aria-expanded": this.state.isOpen || this.isPillboxActive(), "aria-controls": this.isPillboxActive() ? `select-pillbox-${this.id}` : `select-listbox-${this.id}`, "aria-required": this.required, "aria-activedescendant": this.activeDescendant, onClick: e => this.onClick(e) }, h("div", { class: "select-wrapper-inner" }, this.multiple && this.state.selection.length ? (h("div", { id: `select-pillbox-${this.id}`, role: "listbox", "aria-orientation": "horizontal", class: "select-pills" }, this.state.selection.map((item, i) => (h("span", { class: {
701
+ pill: true,
702
+ 'select-no-open': true,
703
+ 'select-option-active': this.state.activeSelectionIndex === i
704
+ }, role: "option", "aria-selected": "true", id: `select-${this.id}-selection-${i}` }, h("span", null, item.render.label), !this.disabled && (h("cat-button", { size: "xs", variant: "text", icon: "16-cross", iconOnly: true, a11yLabel: this.i18n.t('select.deselect'), onClick: () => this.deselect(item.item.id), tabIndex: -1 }))))))) : null, h("input", { class: "select-input", ref: el => (this.input = el), "aria-controls": this.isPillboxActive() ? `select-pillbox-${this.id}` : `select-listbox-${this.id}`, "aria-activedescendant": this.activeDescendant, onInput: () => this.onInput(), value: !this.multiple ? this.state.term : undefined, placeholder: this.placeholder, disabled: this.disabled || this.state.isResolving })), this.state.isResolving && h("cat-spinner", null), (this.state.selection.length || this.state.term.length) &&
705
+ !this.disabled &&
706
+ !this.state.isResolving &&
707
+ this.clearable ? (h("cat-button", { id: `select-clear-btn-${this.id}`, iconOnly: true, icon: "cross-circle-outlined", variant: "text", size: "s", a11yLabel: this.i18n.t('select.clear'), onClick: () => this.clear() })) : null, !this.state.isResolving && (h("cat-button", { iconOnly: true, icon: "chevron-down-outlined", class: { 'select-btn': true, 'select-btn-open': this.state.isOpen }, variant: "text", size: "s", a11yLabel: this.state.isOpen ? this.i18n.t('select.close') : this.i18n.t('select.open'), "aria-controls": `select-listbox-${this.id}`, "aria-expanded": this.state.isOpen, tabIndex: -1, disabled: this.disabled || this.state.isResolving }))), this.hintSection, h("div", { class: "select-dropdown", ref: el => (this.dropdown = el), style: { display: this.state.isOpen ? 'block' : undefined } }, this.state.isOpen && (h("cat-scrollable", { class: "select-options-wrapper", scrolledBuffer: 56, noOverflowX: true, noOverscroll: true, noScrolledInit: true, onScrolledBottom: () => this.more$.next() }, h("ul", { class: "select-options", role: "listbox", "aria-multiselectable": this.multiple, "aria-setsize": this.state.totalElements, id: `select-listbox-${this.id}` }, this.state.options.map((item, i) => (h("li", { role: "option", class: "select-option", id: `select-${this.id}-option-${i}`, "aria-selected": this.isSelected(item.item.id) ? 'true' : 'false' }, this.multiple ? (h("cat-checkbox", { class: { 'select-option-active': this.state.activeOptionIndex === i }, checked: this.isSelected(item.item.id), tabIndex: -1, labelLeft: true, onFocus: () => { var _a; return (_a = this.input) === null || _a === void 0 ? void 0 : _a.focus(); }, onCatChange: e => {
708
+ this.toggle(item);
709
+ e.stopPropagation();
710
+ } }, h("span", { slot: "label", class: "select-option" }, h("span", { class: "select-option-label" }, item.render.label), h("span", { class: "select-option-description" }, item.render.description)))) : (h("div", { class: {
711
+ 'select-option-single': true,
712
+ 'select-option-active': this.state.activeOptionIndex === i
713
+ }, onFocus: () => { var _a; return (_a = this.input) === null || _a === void 0 ? void 0 : _a.focus(); }, onClick: () => this.select(item), tabIndex: -1 }, h("span", { class: "select-option-label" }, item.render.label), h("span", { class: "select-option-description" }, item.render.description)))))), this.state.isLoading
714
+ ? Array.from(Array(CatSelectRemote.SKELETON_COUNT)).map(() => (h("li", { class: "select-option-loading" }, h("cat-skeleton", { variant: "body", lines: 1 }), h("cat-skeleton", { variant: "body", lines: 1 }))))
715
+ : !this.state.options.length && h("li", { class: "select-option-empty" }, this.i18n.t('select.empty'))))))));
716
+ }
717
+ get hintSection() {
718
+ const hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
719
+ return ((this.hint || hasSlottedHint) && (h(CatFormHint, { hint: this.hint, slottedHint: hasSlottedHint && h("slot", { name: "hint" }) })));
720
+ }
721
+ get connectorSafe() {
722
+ if (this.connector) {
723
+ return this.connector;
724
+ }
725
+ throw new Error('CatSelectRemoteConnector not set');
726
+ }
727
+ resolve() {
728
+ var _a;
729
+ this.patchState({ isResolving: true });
730
+ let ids;
731
+ if (this.multiple) {
732
+ ids = this.value;
733
+ }
734
+ else {
735
+ ids = [this.value];
736
+ }
737
+ const data$ = ((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) ? this.connectorSafe.resolve(ids).pipe(first()) : of([]);
738
+ data$.pipe(catchError(() => of([]))).subscribe(items => this.patchState({
739
+ isResolving: false,
740
+ selection: items === null || items === void 0 ? void 0 : items.map(item => ({ item, render: this.connectorSafe.render(item) })),
741
+ term: !this.multiple && items.length ? this.connectorSafe.render(items[0]).label : ''
742
+ }));
743
+ }
744
+ show() {
745
+ var _a;
746
+ if (!this.state.isOpen) {
747
+ this.patchState({ isOpen: true });
748
+ this.catOpen.emit();
749
+ this.term$.next(this.state.term);
750
+ (_a = this.input) === null || _a === void 0 ? void 0 : _a.classList.remove('select-input-transparent-caret');
751
+ }
752
+ }
753
+ hide() {
754
+ if (this.state.isOpen) {
755
+ this.patchState({ isOpen: false, activeOptionIndex: -1 });
756
+ this.catClose.emit();
757
+ }
758
+ }
759
+ search(term) {
760
+ this.patchState({ term, activeOptionIndex: -1, activeSelectionIndex: -1 });
761
+ this.term$.next(term);
762
+ }
763
+ isSelected(id) {
764
+ return this.state.selection.findIndex(s => s.item.id === id) >= 0;
765
+ }
766
+ select(item) {
767
+ var _a;
768
+ if (!this.isSelected(item.item.id)) {
769
+ let newSelection;
770
+ if (this.multiple) {
771
+ newSelection = [...this.state.selection, item];
772
+ }
773
+ else {
774
+ newSelection = [item];
775
+ this.search(item.render.label);
776
+ }
777
+ this.patchState({ selection: newSelection });
778
+ }
779
+ if (!this.multiple) {
780
+ this.hide();
781
+ (_a = this.input) === null || _a === void 0 ? void 0 : _a.classList.add('select-input-transparent-caret');
782
+ }
783
+ }
784
+ deselect(id) {
785
+ if (this.isSelected(id)) {
786
+ this.patchState({
787
+ selection: this.state.selection.filter(item => item.item.id !== id),
788
+ activeSelectionIndex: -1
789
+ });
790
+ }
791
+ }
792
+ toggle(item) {
793
+ this.isSelected(item.item.id) ? this.deselect(item.item.id) : this.select(item);
794
+ }
795
+ clear() {
796
+ if (this.input && this.state.term) {
797
+ this.patchState({ selection: [], options: [], term: '', activeOptionIndex: -1 });
798
+ this.term$.next('');
799
+ this.input.value = '';
800
+ }
801
+ else {
802
+ this.patchState({ selection: [] });
803
+ }
804
+ }
805
+ reset(connector) {
806
+ var _a;
807
+ this.connector = connector !== null && connector !== void 0 ? connector : this.connector;
808
+ (_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
809
+ this.subscription = undefined;
810
+ this.state = INIT_STATE;
811
+ }
812
+ onClick(event) {
813
+ var _a, _b;
814
+ const elem = event.target;
815
+ (_a = this.trigger) === null || _a === void 0 ? void 0 : _a.setAttribute('tabindex', '0');
816
+ (_b = this.input) === null || _b === void 0 ? void 0 : _b.focus();
817
+ if (elem === this.trigger ||
818
+ elem === this.input ||
819
+ elem.classList.contains('select-btn') ||
820
+ elem.nodeName === 'SPAN') {
821
+ this.state.isOpen ? this.hide() : this.show();
822
+ }
823
+ }
824
+ onInput() {
825
+ var _a;
826
+ this.search(((_a = this.input) === null || _a === void 0 ? void 0 : _a.value) || '');
827
+ this.show();
828
+ }
829
+ update() {
830
+ if (this.trigger && this.dropdown) {
831
+ computePosition(this.trigger, this.dropdown, {
832
+ placement: this.placement,
833
+ middleware: [offset(CatSelectRemote.DROPDOWN_OFFSET)]
834
+ }).then(({ x, y }) => {
835
+ if (this.dropdown) {
836
+ Object.assign(this.dropdown.style, {
837
+ left: `${x}px`,
838
+ top: `${y}px`
839
+ });
840
+ }
841
+ });
842
+ }
843
+ }
844
+ patchState(update) {
845
+ this.state = Object.assign(Object.assign({}, this.state), update);
846
+ }
847
+ isPillboxActive() {
848
+ return this.state.activeSelectionIndex >= 0;
849
+ }
850
+ get activeDescendant() {
851
+ let activeDescendant = undefined;
852
+ if (this.state.activeOptionIndex >= 0) {
853
+ activeDescendant = `select-${this.id}-option-${this.state.activeOptionIndex}`;
854
+ }
855
+ else if (this.state.activeSelectionIndex >= 0) {
856
+ activeDescendant = `select-${this.id}-selection-${this.state.activeSelectionIndex}`;
857
+ }
858
+ return activeDescendant;
859
+ }
860
+ onArrowKeyDown(event) {
861
+ var _a, _b;
862
+ let preventDefault = false;
863
+ (_a = this.input) === null || _a === void 0 ? void 0 : _a.focus();
864
+ if (event.key === 'ArrowDown') {
865
+ preventDefault = true;
866
+ this.state.isOpen
867
+ ? this.patchState({
868
+ activeOptionIndex: Math.min(this.state.activeOptionIndex + 1, this.state.options.length - 1),
869
+ activeSelectionIndex: -1
870
+ })
871
+ : this.show();
872
+ }
873
+ else if (event.key === 'ArrowUp') {
874
+ preventDefault = true;
875
+ this.state.activeOptionIndex >= 0
876
+ ? this.patchState({
877
+ activeOptionIndex: Math.max(this.state.activeOptionIndex - 1, -1),
878
+ activeSelectionIndex: -1
879
+ })
880
+ : this.hide();
881
+ }
882
+ else if (event.key === 'ArrowLeft') {
883
+ if (((_b = this.input) === null || _b === void 0 ? void 0 : _b.selectionStart) === 0) {
884
+ preventDefault = true;
885
+ let index;
886
+ this.state.activeSelectionIndex > 0
887
+ ? (index = Math.max(this.state.activeSelectionIndex - 1, -1))
888
+ : (index = this.state.selection.length - 1);
889
+ this.patchState({ activeSelectionIndex: index, activeOptionIndex: -1 });
890
+ }
891
+ }
892
+ else if (event.key === 'ArrowRight') {
893
+ if (this.state.activeSelectionIndex >= 0) {
894
+ preventDefault = true;
895
+ let index = -1;
896
+ if (this.state.activeSelectionIndex < this.state.selection.length - 1) {
897
+ index = Math.min(this.state.activeSelectionIndex + 1, this.state.selection.length - 1);
898
+ }
899
+ else if (!this.state.term) {
900
+ index = 0;
901
+ }
902
+ this.patchState({ activeSelectionIndex: index, activeOptionIndex: -1 });
903
+ }
904
+ }
905
+ if (preventDefault) {
906
+ event.preventDefault();
907
+ event.stopPropagation();
908
+ }
909
+ }
910
+ get hostElement() { return this; }
911
+ static get watchers() { return {
912
+ "connector": ["onConnectorChange"],
913
+ "state": ["onStateChange"]
914
+ }; }
915
+ static get style() { return catSelectRemoteCss; }
916
+ }, [1, "cat-select-remote", {
917
+ "multiple": [4],
918
+ "debounce": [2],
919
+ "placement": [1],
920
+ "value": [1025],
921
+ "disabled": [4],
922
+ "placeholder": [1],
923
+ "hint": [1],
924
+ "label": [1],
925
+ "name": [1],
926
+ "labelHidden": [4, "label-hidden"],
927
+ "required": [4],
928
+ "clearable": [4],
929
+ "connector": [32],
930
+ "state": [32],
931
+ "hasSlottedLabel": [32],
932
+ "connect": [64]
933
+ }, [[0, "blur", "onBlur"], [0, "keydown", "onKeyDown"], [0, "keyup", "onKeyUp"]]]);
934
+ CatSelectRemote.SKELETON_COUNT = 4;
935
+ CatSelectRemote.DROPDOWN_OFFSET = 4;
936
+ function defineCustomElement() {
937
+ if (typeof customElements === "undefined") {
938
+ return;
939
+ }
940
+ const components = ["cat-select-remote", "cat-button", "cat-checkbox", "cat-icon", "cat-scrollable", "cat-skeleton", "cat-spinner"];
941
+ components.forEach(tagName => { switch (tagName) {
942
+ case "cat-select-remote":
943
+ if (!customElements.get(tagName)) {
944
+ customElements.define(tagName, CatSelectRemote);
945
+ }
946
+ break;
947
+ case "cat-button":
948
+ if (!customElements.get(tagName)) {
949
+ defineCustomElement$6();
950
+ }
951
+ break;
952
+ case "cat-checkbox":
953
+ if (!customElements.get(tagName)) {
954
+ defineCustomElement$5();
955
+ }
956
+ break;
957
+ case "cat-icon":
958
+ if (!customElements.get(tagName)) {
959
+ defineCustomElement$4();
960
+ }
961
+ break;
962
+ case "cat-scrollable":
963
+ if (!customElements.get(tagName)) {
964
+ defineCustomElement$3();
965
+ }
966
+ break;
967
+ case "cat-skeleton":
968
+ if (!customElements.get(tagName)) {
969
+ defineCustomElement$2();
970
+ }
971
+ break;
972
+ case "cat-spinner":
973
+ if (!customElements.get(tagName)) {
974
+ defineCustomElement$1();
975
+ }
976
+ break;
977
+ } });
978
+ }
979
+
980
+ export { CatSelectRemote as C, asyncScheduler as a, timer as b, concat as c, defineCustomElement as d, of as o, take as t };
981
+
982
+ //# sourceMappingURL=cat-select-remote2.js.map